正在查看: Mantra Counter v25.01 应用的 AlarmInvoke.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Mantra Counter v25.01 应用的 AlarmInvoke.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.sweetedge.mantracounter;
import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.bumptech.glide.Glide;
import java.io.File;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import sweetedge.calendar.PCalendar;
import sweetedge.decoration.PSetTypeface;
import sweetedge.preference.PSharedPreference;
public class AlarmInvoke extends AppCompatActivity {
public static String Music = "";
public static int NotiCode = 0;
public static String Target = "";
public static String Themes = "";
public static String TitleStr = "";
public static String media = "";
ImageView MediaImg;
ImageView ThemeIcon;
TextView close;
Button no;
TextView time;
TextView title;
Button yes;
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.activity_alarm_invoke);
this.yes = (Button) findViewById(R.id.btn_click);
this.no = (Button) findViewById(R.id.btn_no);
this.time = (TextView) findViewById(R.id.time);
this.title = (TextView) findViewById(R.id.title);
this.close = (TextView) findViewById(R.id.close);
this.MediaImg = (ImageView) findViewById(R.id.mediaImg);
this.ThemeIcon = (ImageView) findViewById(R.id.themeIcon);
PSetTypeface.setTextView(this, this.close, "sweetedge_lib.otf");
String str = Themes;
if (str != null) {
setThemeIcon(this.ThemeIcon, str);
}
try {
this.time.setText(new SimpleDateFormat("hh:mm a").format(new SimpleDateFormat("HH:mm:ss").parse(PCalendar.getHour24Format() + ":" + PCalendar.getMin() + ":" + PCalendar.getSec())));
} catch (ParseException e) {
e.printStackTrace();
}
String str2 = media;
if (str2 != null) {
if (str2.length() > 0) {
if (media.contains("https")) {
Glide.with(this).load(Uri.parse(media)).into(this.MediaImg);
} else {
Glide.with(this).load(new File(media)).into(this.MediaImg);
}
} else {
Glide.with(this).load(Integer.valueOf(R.mipmap.ic_launcher)).into(this.MediaImg);
}
}
this.title.setText(TitleStr);
this.yes.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (AlarmInvoke.media != null && AlarmInvoke.media.length() > 2) {
PSharedPreference.setBoolean(AlarmInvoke.this, "PHOTOMODE", true);
PSharedPreference.setBoolean(AlarmInvoke.this, "VIDEOMODE", false);
PSharedPreference.setString(AlarmInvoke.this, "IMG_PHOTO", AlarmInvoke.media);
PSharedPreference.setBoolean(AlarmInvoke.this, "R_Daily", true);
}
if (AlarmInvoke.Themes != null && AlarmInvoke.Themes.length() > 0) {
PSharedPreference.setInteger(AlarmInvoke.this, "THEMES", Integer.parseInt(AlarmInvoke.Themes));
}
AlarmInvoke.this.setTargetinMainActivity();
AlarmInvoke.this.setMusicforMainActivity();
((NotificationManager) AlarmInvoke.this.getApplicationContext().getSystemService("notification")).cancel(AlarmInvoke.NotiCode);
Intent intent = new Intent((Context) AlarmInvoke.this, (Class<?>) Splash.class);
intent.setFlags(268435456);
AlarmInvoke.this.startActivity(intent);
AlarmInvoke.this.finish();
}
});
this.close.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
PSharedPreference.setBoolean(AlarmInvoke.this, "R_Daily", false);
((NotificationManager) AlarmInvoke.this.getApplicationContext().getSystemService("notification")).cancel(AlarmInvoke.NotiCode);
AlarmInvoke.this.finish();
}
});
this.no.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
AlarmInvoke.this.close.performClick();
}
});
}
public void setMusicforMainActivity() {
String str = Music;
if (str == null || str.length() <= 0) {
return;
}
PSharedPreference.setString(this, "MUSIC_FILE", Music.trim());
}
public void setTargetinMainActivity() {
String str = Target;
if (str == null || str.length() <= 0) {
return;
}
Long valueOf = Long.valueOf(Long.parseLong(Target));
if (valueOf.longValue() > 0) {
if (valueOf.longValue() > 9999999) {
PSharedPreference.setLong(this, "TGT", 9999999L);
} else {
PSharedPreference.setLong(this, "TGT", valueOf.longValue());
}
}
}
private void setThemeIcon(ImageView imageView, String str) {
if (str.length() > 0) {
int parseInt = Integer.parseInt(str);
if (parseInt == 1) {
imageView.setImageResource(R.drawable.theme_red);
return;
}
if (parseInt == 2) {
imageView.setImageResource(R.drawable.theme_blue);
} else if (parseInt == 3) {
imageView.setImageResource(R.drawable.theme_lavender);
} else {
if (parseInt != 5) {
return;
}
imageView.setImageResource(R.drawable.theme_orange);
}
}
}
}