Notify v1.3版本的 MD5 值为:895e81227cabff93166e4db568124d5d
以下内容为反编译后的 sketchify.java 源代码,内容仅作参考
package com.sketchify.util;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.RippleDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.util.SparseBooleanArray;
import android.util.TypedValue;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import com.bumptech.glide.Glide;
import com.google.android.material.bottomsheet.BottomSheetDialog;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.sketchify.util.SketchifyRequestNetwork;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Random;
public class sketchify extends AppCompatActivity {
private static final int YOUR_BOTTOM_SHEET_ID = 2131230872;
private String MainAPI;
private SharedPreferences UCSP;
private SketchifyRequestNetwork.RequestListener _sketchify_config_request_listener;
private SketchifyRequestNetwork.RequestListener _sketchify_request_request_listener;
private SketchifyRequestNetwork.RequestListener _sketchify_track_request_listener;
private Activity activity;
private SharedPreferences isSubscribe;
private Context mContext;
private String mainAPI;
private String mainTrack;
private String packageName;
private ProgressDialog prog;
AlertDialog sketchifyDialog;
BottomSheetDialog sketchifySheet;
private SketchifyRequestNetwork sketchify_config;
private SketchifyRequestNetwork sketchify_request;
private SketchifyRequestNetwork sketchify_track;
private String state;
private double sketchify_time = 0.0d;
private HashMap<String, Object> SketchifyMap = new HashMap<>();
private double sketchify_load = 0.0d;
private HashMap<String, Object> SketchifyMap2 = new HashMap<>();
private String ver = "";
private String libversion = "1.4";
private void initialize(Bundle bundle) {
this.UCSP = this.mContext.getSharedPreferences("UCSP", 0);
this.isSubscribe = this.mContext.getSharedPreferences("isSubscribe", 0);
this.packageName = this.mContext.getPackageName();
this.sketchify_request = new SketchifyRequestNetwork(this.activity, this.mContext);
this.sketchify_config = new SketchifyRequestNetwork(this.activity, this.mContext);
this.sketchify_track = new SketchifyRequestNetwork(this.activity, this.mContext);
this._sketchify_request_request_listener = new SketchifyRequestNetwork.RequestListener() {
@Override
public void onResponse(String str, String str2, HashMap<String, Object> hashMap) {
try {
sketchify.this.loadingdialog(false, "");
sketchify.this._Sketchify_without_notification(str, str2);
} catch (Exception e) {
if (sketchify.this.mContext != null) {
SketchwareUtil.showMessage(sketchify.this.mContext, String.valueOf(e.getMessage()) + " 1");
}
}
}
@Override
public void onErrorResponse(String str, String str2) {
}
};
this._sketchify_track_request_listener = new SketchifyRequestNetwork.RequestListener() {
@Override
public void onResponse(String str, String str2, HashMap<String, Object> hashMap) {
}
@Override
public void onErrorResponse(String str, String str2) {
}
};
this._sketchify_config_request_listener = new SketchifyRequestNetwork.RequestListener() {
@Override
public void onResponse(String str, String str2, HashMap<String, Object> hashMap) {
}
@Override
public void onErrorResponse(String str, String str2) {
}
};
}
public void request(Context context, String str, Activity activity, String str2, String str3) {
this.MainAPI = str3;
this.mContext = context;
this.activity = activity;
this.mainTrack = str2;
initializeLogic(str);
}
public void loadingdialog(boolean z, String str) {
if (z) {
if (this.prog == null) {
this.prog = new ProgressDialog(this.mContext);
this.prog.setMax(100);
this.prog.setIndeterminate(true);
this.prog.setCancelable(false);
this.prog.setCanceledOnTouchOutside(false);
}
this.prog.setMessage(str);
this.prog.show();
} else if (this.prog != null) {
this.prog.dismiss();
}
}
private void initializeLogic(String str) {
initialize(null);
try {
if (this.mContext != null) {
if (this.UCSP.contains("isLoading")) {
if (Boolean.parseBoolean(this.UCSP.getString("isLoading", ""))) {
loadingdialog(true, this.UCSP.getString("LoadingTitle", ""));
}
} else {
this.UCSP.edit().putString("isLoading", "true").commit();
loadingdialog(true, "Please wait..");
}
this.sketchify_request.startSketchifyRequestNetwork("GET", str, "", this._sketchify_request_request_listener);
this.sketchify_track.startSketchifyRequestNetwork("GET", this.mainTrack.concat("projectUID=".concat(this.MainAPI.concat("&package=".concat(this.packageName)))), "", this._sketchify_track_request_listener);
return;
}
SketchwareUtil.showMessage(this.mContext, "Context is null");
} catch (Exception e) {
if (this.mContext != null) {
SketchwareUtil.showMessage(this.mContext, String.valueOf(e.getMessage()) + " 85");
}
}
}
public void _Sketchify_without_notification(String str, String str2) {
String obj;
String obj2;
double parseDouble;
String obj3;
String obj4;
try {
if (this.sketchify_time == 0.0d) {
String str3 = this.mContext.getPackageManager().getPackageInfo(this.mContext.getPackageName(), 0).versionName;
this.SketchifyMap = (HashMap) new Gson().fromJson(str2, new TypeToken<HashMap<String, Object>>() {
}.getType());
if (this.sketchify_load == 0.0d) {
this.sketchify_load += 1.0d;
this.UCSP.edit().putString("dialogOption", this.SketchifyMap.get("dialogOption").toString()).commit();
this.UCSP.edit().putString("amount", this.SketchifyMap.get("amount").toString()).commit();
this.UCSP.edit().putString("amount_extra", this.SketchifyMap.get("amount_extra").toString()).commit();
this.UCSP.edit().putString("server", this.SketchifyMap.get("server").toString()).commit();
this.UCSP.edit().putString("Url", this.SketchifyMap.get("openLinkExtra").toString()).commit();
this.UCSP.edit().putString("Url1", this.SketchifyMap.get("openLinkMain").toString()).commit();
this.UCSP.edit().putString("isCancelable", this.SketchifyMap.get("isCancelable").toString()).commit();
this.UCSP.edit().putString("dialogBtnExtra", this.SketchifyMap.get("dialogBtnExtra").toString()).commit();
this.UCSP.edit().putString("dialogBtnMainClick", this.SketchifyMap.get("dialogBtnMainClick").toString()).commit();
this.UCSP.edit().putString("dialogBtnMain", this.SketchifyMap.get("dialogBtnMain").toString()).commit();
this.UCSP.edit().putString("newVersion", this.SketchifyMap.get("newVersion").toString()).commit();
this.UCSP.edit().putString("isOneTime", this.SketchifyMap.get("isOneTime").toString()).commit();
this.UCSP.edit().putString("dialogBtnExtraClick", this.SketchifyMap.get("dialogBtnExtraClick").toString()).commit();
this.UCSP.edit().putString("server", this.SketchifyMap.get("server").toString()).commit();
this.UCSP.edit().putString("alertOption", this.SketchifyMap.get("alertOption").toString()).commit();
this.UCSP.edit().putString("isOneTimeKey", this.SketchifyMap.get("isOneTimeKey").toString()).commit();
this.UCSP.edit().putString("isLoading", this.SketchifyMap.get("isLoading").toString()).commit();
this.UCSP.edit().putString("LoadingTitle", this.SketchifyMap.get("LoadingTitle").toString()).commit();
}
String obj5 = this.SketchifyMap.get("dialogTitle").toString();
String obj6 = this.SketchifyMap.get("dialogSubtitle").toString();
String obj7 = this.SketchifyMap.get("dialogBtnExtraTxt").toString();
String obj8 = this.SketchifyMap.get("dialogBtnMainTxt").toString();
if (this.UCSP.getString("dialogOption", "").equals("warning")) {
obj = "#BD081C";
obj2 = "#FFFFFF";
parseDouble = 60.0d;
obj3 = "#212121";
obj4 = "#FFFFFF";
} else if (this.UCSP.getString("dialogOption", "").equals("update")) {
obj = "#0084FF";
obj2 = "#FFFFFF";
parseDouble = 60.0d;
obj3 = "#212121";
obj4 = "#FFFFFF";
} else if (this.UCSP.getString("dialogOption", "").equals("message")) {
obj = "#00B489";
obj2 = "#FFFFFF";
parseDouble = 60.0d;
obj3 = "#212121";
obj4 = "#FFFFFF";
} else {
obj = this.SketchifyMap.get("customDialogAccent").toString();
obj2 = this.SketchifyMap.get("customDialogBack").toString();
parseDouble = Double.parseDouble(this.SketchifyMap.get("customDialogRound").toString());
obj3 = this.SketchifyMap.get("customDialogMainTxtColor").toString();
obj4 = this.SketchifyMap.get("customDialogBtnTxtColor").toString();
}
if (!this.SketchifyMap.containsKey("alertOption")) {
this.SketchifyMap.put("alertOption", "dialog");
}
LinearLayout linearLayout = new LinearLayout(this.mContext);
linearLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 0.0f));
linearLayout.setPadding(0, 0, 0, 0);
linearLayout.setOrientation(1);
linearLayout.setGravity(17);
if (this.SketchifyMap.get("alertOption").toString().equals("sheet")) {
this.sketchifySheet = new BottomSheetDialog(this.mContext);
this.sketchifySheet.setContentView(linearLayout);
View findViewById = this.sketchifySheet.getWindow().getDecorView().findViewById(com.notify.app.R.id.decor_content_parent);
if (findViewById != null && findViewById.getBackground() != null) {
findViewById.setBackgroundColor(0);
}
} else if (this.SketchifyMap.get("alertOption").toString().equals("dialog")) {
this.sketchifyDialog = new AlertDialog.Builder(this.mContext).create();
this.sketchifyDialog.setView(linearLayout);
this.sketchifyDialog.getWindow().setBackgroundDrawableResource(17170445);
}
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setColor(Color.parseColor(obj));
gradientDrawable.setCornerRadius(100.0f);
LinearLayout linearLayout2 = new LinearLayout(this.mContext);
linearLayout2.setLayoutParams(new LinearLayout.LayoutParams(175, 175, 0.0f));
linearLayout2.setPadding(0, 0, 0, 0);
linearLayout2.setOrientation(1);
linearLayout2.setGravity(17);
linearLayout2.setBackground(gradientDrawable);
linearLayout.addView(linearLayout2);
GradientDrawable gradientDrawable2 = new GradientDrawable();
gradientDrawable2.setColor(Color.parseColor(obj2));
gradientDrawable2.setCornerRadius((float) parseDouble);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -2);
layoutParams.setMargins(40, 0, 40, 0);
LinearLayout linearLayout3 = new LinearLayout(this.mContext);
linearLayout3.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 0.0f));
linearLayout3.setPadding(45, 140, 45, 45);
linearLayout3.setLayoutParams(layoutParams);
linearLayout3.setOrientation(1);
linearLayout3.setGravity(17);
linearLayout3.setBackground(gradientDrawable2);
linearLayout.addView(linearLayout3);
linearLayout3.setTranslationY(-57.5f);
TextView textView = new TextView(this.mContext);
textView.setLayoutParams(new LinearLayout.LayoutParams(-2, -2, 0.0f));
textView.setPadding(0, 0, 0, 0);
textView.setGravity(17);
textView.setText(obj5);
textView.setTextSize(16.0f);
textView.setTypeface(null, 1);
textView.setTextColor(Color.parseColor(obj3));
textView.setSingleLine(true);
linearLayout3.addView(textView);
LinearLayout linearLayout4 = new LinearLayout(this.mContext);
linearLayout4.setLayoutParams(new LinearLayout.LayoutParams(-1, 15, 0.0f));
linearLayout4.setPadding(10, 10, 10, 10);
linearLayout4.setOrientation(0);
linearLayout4.setGravity(17);
linearLayout3.addView(linearLayout4);
TextView textView2 = new TextView(this.mContext);
textView2.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 0.0f));
textView2.setPadding(0, 20, 0, 20);
textView2.setGravity(17);
textView2.setText(obj6);
textView2.setTextSize(14.0f);
textView2.setTypeface(textView2.getTypeface(), 1);
textView2.setTextColor(Color.parseColor(obj3));
linearLayout3.addView(textView2);
ImageView imageView = new ImageView(this.mContext);
imageView.setLayoutParams(new LinearLayout.LayoutParams(90, 90, 0.0f));
imageView.setPadding(0, 0, 0, 0);
if (this.UCSP.getString("dialogOption", "").equals("custom")) {
Glide.with(this.mContext).load(Uri.parse(this.SketchifyMap.get("customDialogIcon").toString())).into(imageView);
} else {
if (this.UCSP.getString("dialogOption", "").equals("message")) {
Glide.with(this.mContext).load(Uri.parse("https://sketchify.expressme.in/asset/dia_msg.png")).into(imageView);
} else if (this.UCSP.getString("dialogOption", "").equals("warning")) {
Glide.with(this.mContext).load(Uri.parse("https://sketchify.expressme.in/asset/dia_warning.png")).into(imageView);
} else {
Glide.with(this.mContext).load(Uri.parse("https://sketchify.expressme.in/asset/dia_update.png")).into(imageView);
}
imageView.setImageTintList(new ColorStateList(new int[][]{new int[]{-16842919}, new int[]{16842919}}, new int[]{Color.parseColor("#FFFFFF"), Color.parseColor("#FFFFFF")}));
}
linearLayout2.addView(imageView);
linearLayout2.setElevation(5.0f);
linearLayout2.setTranslationY(30.0f);
if (this.UCSP.getString("dialogBtnExtra", "").equals("true")) {
LinearLayout linearLayout5 = new LinearLayout(this.mContext);
linearLayout5.setLayoutParams(new LinearLayout.LayoutParams(-1, 50, 0.0f));
linearLayout5.setPadding(8, 8, 8, 8);
linearLayout5.setOrientation(0);
linearLayout3.addView(linearLayout5);
TextView textView3 = new TextView(this.mContext);
textView3.setLayoutParams(new LinearLayout.LayoutParams(-1, 100, 1.0f));
textView3.setPadding(16, 8, 16, 8);
textView3.setText(obj7);
textView3.setTextSize(14.0f);
textView3.setTextColor(Color.parseColor(obj3));
textView3.setGravity(17);
linearLayout3.addView(textView3);
GradientDrawable gradientDrawable3 = new GradientDrawable();
gradientDrawable3.setColor(Color.parseColor(obj2));
gradientDrawable3.setCornerRadius((float) parseDouble);
gradientDrawable3.setStroke(0, Color.parseColor(obj));
textView3.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{Color.parseColor("#EEEEEE")}), gradientDrawable3, null));
textView3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (!sketchify.this.UCSP.getString("dialogBtnExtraClick", "").equals("exit")) {
if (sketchify.this.UCSP.getString("dialogBtnExtraClick", "").equals("browser")) {
if (!sketchify.this.UCSP.getString("isCancelable", "").equals("true")) {
if (!sketchify.this.UCSP.getString("isCancelable", "").equals("false")) {
SketchwareUtil.showMessage(sketchify.this.mContext, " [CANCEL]");
return;
}
try {
sketchify.this.mContext.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(sketchify.this.UCSP.getString("Url", ""))));
sketchify.this.finishAffinity();
return;
} catch (Exception e) {
SketchwareUtil.showMessage(sketchify.this.mContext, String.valueOf(e.toString()) + " 76");
return;
}
}
try {
sketchify.this.mContext.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(sketchify.this.UCSP.getString("Url", ""))));
return;
} catch (Exception e2) {
SketchwareUtil.showMessage(sketchify.this.mContext, String.valueOf(e2.toString()) + " 56");
return;
}
} else if (sketchify.this.UCSP.getString("dialogBtnExtraClick", "").equals("dismiss")) {
try {
if (!sketchify.this.UCSP.getString("alertOption", "").equals("dialog")) {
if (sketchify.this.UCSP.getString("alertOption", "").equals("sheet")) {
sketchify.this.sketchifySheet.dismiss();
}
} else {
sketchify.this.sketchifyDialog.dismiss();
}
return;
} catch (Exception e3) {
return;
}
} else if (sketchify.this.UCSP.getString("dialogBtnExtraClick", "").equals("donate")) {
connection.sketchifyPayment(sketchify.this.activity, Double.parseDouble(sketchify.this.UCSP.getString("amount_extra", "")), sketchify.this.MainAPI);
try {
if (!sketchify.this.UCSP.getString("alertOption", "").equals("dialog")) {
if (sketchify.this.UCSP.getString("alertOption", "").equals("sheet")) {
sketchify.this.sketchifySheet.dismiss();
}
} else {
sketchify.this.sketchifyDialog.dismiss();
}
return;
} catch (Exception e4) {
return;
}
} else {
SketchwareUtil.showMessage(sketchify.this.mContext, " [DISMISS]");
return;
}
}
System.exit(0);
}
});
}
if (this.UCSP.getString("dialogBtnMain", "").equals("true")) {
LinearLayout linearLayout6 = new LinearLayout(this.mContext);
linearLayout6.setLayoutParams(new LinearLayout.LayoutParams(-1, 30, 0.0f));
linearLayout6.setPadding(8, 8, 8, 8);
linearLayout6.setOrientation(0);
linearLayout3.addView(linearLayout6);
TextView textView4 = new TextView(this.mContext);
textView4.setLayoutParams(new LinearLayout.LayoutParams(-1, 100, 0.0f));
textView4.setPadding(16, 8, 16, 8);
textView4.setText(obj8);
textView4.setTextSize(14.0f);
textView4.setTextColor(Color.parseColor(obj4));
textView4.setGravity(17);
linearLayout3.addView(textView4);
GradientDrawable gradientDrawable4 = new GradientDrawable();
gradientDrawable4.setColor(Color.parseColor(obj));
gradientDrawable4.setCornerRadius((float) parseDouble);
gradientDrawable4.setStroke(0, Color.parseColor(obj));
textView4.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{Color.parseColor("#EEEEEE")}), gradientDrawable4, null));
textView4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (!sketchify.this.UCSP.getString("dialogBtnMainClick", "").equals("exit")) {
if (sketchify.this.UCSP.getString("dialogBtnMainClick", "").equals("browser")) {
if (!sketchify.this.UCSP.getString("isCancelable", "").equals("true")) {
if (!sketchify.this.UCSP.getString("isCancelable", "").equals("false")) {
SketchwareUtil.showMessage(sketchify.this.mContext, "[CANCEL]");
return;
}
try {
sketchify.this.mContext.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(sketchify.this.UCSP.getString("Url1", ""))));
return;
} catch (Exception e) {
SketchwareUtil.showMessage(sketchify.this.mContext, String.valueOf(e.toString()) + " 99");
return;
}
}
try {
sketchify.this.mContext.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(sketchify.this.UCSP.getString("Url1", ""))));
sketchify.this.finishAffinity();
return;
} catch (Exception e2) {
SketchwareUtil.showMessage(sketchify.this.mContext, String.valueOf(e2.toString()) + " 96");
return;
}
} else if (sketchify.this.UCSP.getString("dialogBtnMainClick", "").equals("dismiss")) {
try {
if (!sketchify.this.UCSP.getString("alertOption", "").equals("dialog")) {
if (sketchify.this.UCSP.getString("alertOption", "").equals("sheet")) {
sketchify.this.sketchifySheet.dismiss();
}
} else {
sketchify.this.sketchifyDialog.dismiss();
}
return;
} catch (Exception e3) {
return;
}
} else if (sketchify.this.UCSP.getString("dialogBtnMainClick", "").equals("donate")) {
connection.sketchifyPayment(sketchify.this.activity, Double.parseDouble(sketchify.this.UCSP.getString("amount", "")), sketchify.this.MainAPI);
try {
if (!sketchify.this.UCSP.getString("alertOption", "").equals("dialog")) {
if (sketchify.this.UCSP.getString("alertOption", "").equals("sheet")) {
sketchify.this.sketchifySheet.dismiss();
}
} else {
sketchify.this.sketchifyDialog.dismiss();
}
return;
} catch (Exception e4) {
return;
}
} else {
SketchwareUtil.showMessage(sketchify.this.mContext, " [DISMISS]");
return;
}
}
System.exit(0);
}
});
}
if (this.UCSP.getString("isCancelable", "").equals("false")) {
if (this.SketchifyMap.get("alertOption").toString().equals("sheet")) {
this.sketchifySheet.setCancelable(false);
} else if (this.SketchifyMap.get("alertOption").toString().equals("dialog")) {
this.sketchifyDialog.setCancelable(false);
}
} else if (this.UCSP.getString("isCancelable", "").equals("true")) {
if (this.SketchifyMap.get("alertOption").toString().equals("sheet")) {
this.sketchifySheet.setCancelable(true);
} else if (this.SketchifyMap.get("alertOption").toString().equals("dialog")) {
this.sketchifyDialog.setCancelable(true);
}
} else {
SketchwareUtil.showMessage(this.mContext, " [CANCEL]");
}
if (!this.UCSP.getString("newVersion", "").equals(str3)) {
if (this.UCSP.getString("isOneTime", "").equals("true")) {
if (!this.UCSP.getString("isOneTimes", "").equals(this.UCSP.getString("isOneTimeKey", ""))) {
if (this.SketchifyMap.get("alertOption").toString().equals("sheet")) {
this.sketchifySheet.show();
} else if (this.SketchifyMap.get("alertOption").toString().equals("dialog")) {
this.sketchifyDialog.show();
}
this.UCSP.edit().putString("isOneTimes", this.UCSP.getString("isOneTimeKey", "")).commit();
}
} else if (this.SketchifyMap.get("alertOption").toString().equals("sheet")) {
this.sketchifySheet.show();
} else if (this.SketchifyMap.get("alertOption").toString().equals("dialog")) {
this.sketchifyDialog.show();
}
}
}
} catch (Exception e) {
SketchwareUtil.showMessage(this.mContext, String.valueOf(e.toString()) + " 79");
}
}
@Deprecated
public void showMessage(String str) {
Toast.makeText(this.mContext, str, 0).show();
}
@Deprecated
public int getLocationX(View view) {
int[] iArr = new int[2];
view.getLocationInWindow(iArr);
return iArr[0];
}
@Deprecated
public int getLocationY(View view) {
int[] iArr = new int[2];
view.getLocationInWindow(iArr);
return iArr[1];
}
@Deprecated
public int getRandom(int i, int i2) {
return new Random().nextInt((i2 - i) + 1) + i;
}
@Deprecated
public ArrayList<Double> getCheckedItemPositionsToArray(ListView listView) {
ArrayList<Double> arrayList = new ArrayList<>();
SparseBooleanArray checkedItemPositions = listView.getCheckedItemPositions();
for (int i = 0; i < checkedItemPositions.size(); i++) {
if (checkedItemPositions.valueAt(i)) {
arrayList.add(Double.valueOf(checkedItemPositions.keyAt(i)));
}
}
return arrayList;
}
@Deprecated
public float getDip(int i) {
return TypedValue.applyDimension(1, i, getResources().getDisplayMetrics());
}
@Deprecated
public int getDisplayWidthPixels() {
return getResources().getDisplayMetrics().widthPixels;
}
@Deprecated
public int getDisplayHeightPixels() {
return getResources().getDisplayMetrics().heightPixels;
}
}