Notify v1.3版本的 MD5 值为:895e81227cabff93166e4db568124d5d

以下内容为反编译后的 HomeActivity.java 源代码,内容仅作参考


package com.notify.app;

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.Typeface;
import android.graphics.drawable.ColorDrawable;
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.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
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 androidx.cardview.widget.CardView;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;
public class HomeActivity extends AppCompatActivity {
    private EditText app_name;
    private CardView cardview1;
    private ProgressDialog coreprog;
    private SharedPreferences data;
    private ImageView imageview1;
    private SharedPreferences inAppData;
    private LinearLayout linear1;
    private LinearLayout linear16;
    private LinearLayout linear2;
    private LinearLayout linearButtion;
    private LinearLayout linearOne;
    private LinearLayout linearTWo;
    private LinearLayout linearThree;
    private EditText packagename;
    private EditText serverkey;
    private TimerTask t;
    private TextView textview1;
    private TextView textview5;
    private TextView textview6;
    private Timer _timer = new Timer();
    private String fontName = "";
    private String typeace = "";
    private HashMap<String, Object> map = new HashMap<>();
    private ArrayList<HashMap<String, Object>> listmap = new ArrayList<>();
    private Intent i = new Intent();
    private Intent web = new Intent();

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.home);
        initialize(bundle);
        initializeLogic();
    }

    private void initialize(Bundle bundle) {
        this.linear1 = (LinearLayout) findViewById(R.id.linear1);
        this.linear16 = (LinearLayout) findViewById(R.id.linear16);
        this.linear2 = (LinearLayout) findViewById(R.id.linear2);
        this.textview5 = (TextView) findViewById(R.id.textview5);
        this.cardview1 = (CardView) findViewById(R.id.cardview1);
        this.textview1 = (TextView) findViewById(R.id.textview1);
        this.imageview1 = (ImageView) findViewById(R.id.imageview1);
        this.linearOne = (LinearLayout) findViewById(R.id.linearOne);
        this.linearTWo = (LinearLayout) findViewById(R.id.linearTWo);
        this.linearThree = (LinearLayout) findViewById(R.id.linearThree);
        this.linearButtion = (LinearLayout) findViewById(R.id.linearButtion);
        this.app_name = (EditText) findViewById(R.id.app_name);
        this.packagename = (EditText) findViewById(R.id.packagename);
        this.serverkey = (EditText) findViewById(R.id.serverkey);
        this.textview6 = (TextView) findViewById(R.id.textview6);
        this.inAppData = getSharedPreferences("inAppData", 0);
        this.data = getSharedPreferences("data", 0);
        this.textview5.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                HomeActivity.this.web.setData(Uri.parse("https://youtu.be/4EBVmhxRSps?si=FLAnx8fPZds9Ma8_"));
                HomeActivity.this.web.setAction("android.intent.action.VIEW");
                HomeActivity.this.startActivity(HomeActivity.this.web);
            }
        });
        this.linearButtion.setOnClickListener(new AnonymousClass2());
    }

    public class AnonymousClass2 implements View.OnClickListener {
        AnonymousClass2() {
        }

        @Override
        public void onClick(View view) {
            if (!HomeActivity.this.app_name.getText().toString().equals("")) {
                if (!HomeActivity.this.packagename.getText().toString().equals("")) {
                    if (HomeActivity.this.serverkey.getText().toString().equals("")) {
                        SketchwareUtil.showMessage(HomeActivity.this.getApplicationContext(), "Add Server Key");
                        return;
                    }
                    HomeActivity.this._Custom_Loading(true);
                    HomeActivity.this.t = new TimerTask() {
                        @Override
                        public void run() {
                            HomeActivity.this.runOnUiThread(new Runnable() {
                                @Override
                                public void run() {
                                    HomeActivity.this.map.put("app", HomeActivity.this.app_name.getText().toString());
                                    HomeActivity.this.map.put("package", HomeActivity.this.packagename.getText().toString());
                                    HomeActivity.this.map.put("key", HomeActivity.this.serverkey.getText().toString().trim());
                                    HomeActivity.this.listmap.add(HomeActivity.this.map);
                                    HomeActivity.this.data.edit().putString("project", new Gson().toJson(HomeActivity.this.listmap)).commit();
                                    HomeActivity.this._Custom_Loading(false);
                                    SketchwareUtil.showMessage(HomeActivity.this.getApplicationContext(), "Project Created ");
                                    HomeActivity.this.finish();
                                }
                            });
                        }
                    };
                    HomeActivity.this._timer.schedule(HomeActivity.this.t, 1000L);
                    return;
                }
                SketchwareUtil.showMessage(HomeActivity.this.getApplicationContext(), "Enter Your Package Name");
                return;
            }
            SketchwareUtil.showMessage(HomeActivity.this.getApplicationContext(), "Enter Your Application Name");
        }
    }

    private void initializeLogic() {
        getWindow().getDecorView().setSystemUiVisibility(8192);
        getWindow().setStatusBarColor(-1);
        _changeActivityFont("hrs2");
        GradientDrawable gradientDrawable = new GradientDrawable();
        gradientDrawable.setColor(-1);
        gradientDrawable.setCornerRadius(getDip(0));
        this.linear2.setElevation(getDip(10));
        this.linear2.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-1}), gradientDrawable, null));
        GradientDrawable gradientDrawable2 = new GradientDrawable();
        gradientDrawable2.setColor(-1);
        gradientDrawable2.setCornerRadius(getDip(8));
        gradientDrawable2.setStroke((int) getDip(1), -14575885);
        this.linearOne.setElevation(getDip(2));
        this.linearOne.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-1}), gradientDrawable2, null));
        GradientDrawable gradientDrawable3 = new GradientDrawable();
        gradientDrawable3.setColor(-1);
        gradientDrawable3.setCornerRadius(getDip(8));
        gradientDrawable3.setStroke((int) getDip(1), -14575885);
        this.linearTWo.setElevation(getDip(2));
        this.linearTWo.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-1}), gradientDrawable3, null));
        GradientDrawable gradientDrawable4 = new GradientDrawable();
        gradientDrawable4.setColor(-1);
        gradientDrawable4.setCornerRadius(getDip(8));
        gradientDrawable4.setStroke((int) getDip(1), -14575885);
        this.linearThree.setElevation(getDip(2));
        this.linearThree.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-1}), gradientDrawable4, null));
        GradientDrawable gradientDrawable5 = new GradientDrawable();
        gradientDrawable5.setColor(-14575885);
        gradientDrawable5.setCornerRadius(getDip(8));
        this.linearButtion.setElevation(getDip(0));
        this.linearButtion.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{-1}), gradientDrawable5, null));
        if (!this.data.getString("project", "").equals("")) {
            this.listmap = (ArrayList) new Gson().fromJson(this.data.getString("project", ""), new TypeToken<ArrayList<HashMap<String, Object>>>() {
            }.getType());
        }
    }

    public void _changeActivityFont(String str) {
        this.fontName = "fonts/".concat(str.concat(".ttf"));
        overrideFonts(this, getWindow().getDecorView());
    }

    private void overrideFonts(Context context, View view) {
        try {
            Typeface createFromAsset = Typeface.createFromAsset(getAssets(), this.fontName);
            if (view instanceof ViewGroup) {
                ViewGroup viewGroup = (ViewGroup) view;
                for (int i = 0; i < viewGroup.getChildCount(); i++) {
                    overrideFonts(context, viewGroup.getChildAt(i));
                }
            } else if (view instanceof TextView) {
                ((TextView) view).setTypeface(createFromAsset);
            } else if (view instanceof EditText) {
                ((EditText) view).setTypeface(createFromAsset);
            } else if (view instanceof Button) {
                ((Button) view).setTypeface(createFromAsset);
            }
        } catch (Exception e) {
            SketchwareUtil.showMessage(getApplicationContext(), "Error Loading Font");
        }
    }

    public void _Custom_Loading(boolean z) {
        if (z) {
            if (this.coreprog == null) {
                this.coreprog = new ProgressDialog(this);
                this.coreprog.setCancelable(false);
                this.coreprog.setCanceledOnTouchOutside(false);
                this.coreprog.requestWindowFeature(1);
                this.coreprog.getWindow().setBackgroundDrawable(new ColorDrawable(0));
            }
            this.coreprog.setMessage(null);
            this.coreprog.show();
            View inflate = getLayoutInflater().inflate(R.layout.custom_dialog, (ViewGroup) null);
            GradientDrawable gradientDrawable = new GradientDrawable();
            gradientDrawable.setColor(Color.parseColor("#FFFFFF"));
            gradientDrawable.setCornerRadius(100.0f);
            ((LinearLayout) inflate.findViewById(R.id.linear_base)).setBackground(gradientDrawable);
            this.coreprog.setContentView(inflate);
        } else if (this.coreprog != null) {
            this.coreprog.dismiss();
        }
    }

    @Deprecated
    public void showMessage(String str) {
        Toast.makeText(getApplicationContext(), 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;
    }
}