APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:Electrical Cost
版本号:6.0.5
包名称:it.Ettore.spesaelettrica

MD5 校验值:facd8e3913e14e36e7daf9e69fbd45cb

反编译源代码说明

g.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package M1;

import B2.LdvJ.lDACLjZEOR;
import D2.m;
import D2.n;
import D2.u;
import Y1.w;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.util.Log;
import android.webkit.WebView;
import android.widget.LinearLayout;
import androidx.appcompat.app.AlertDialog;
import androidx.core.app.qpFQ.NFBhD;
import androidx.preference.PreferenceManager;
import it.Ettore.spesaelettrica.R;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public final class g {
    public static final f Companion = new Object();

    public final Context f734a;

    public final SharedPreferences f735b;

    public final String f736c;

    public final String f737d;
    public final String e;

    public g(Context context) {
        kotlin.jvm.internal.k.e(context, "context");
        this.f734a = context;
        SharedPreferences defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);
        kotlin.jvm.internal.k.d(defaultSharedPreferences, "getDefaultSharedPreferences(...)");
        this.f735b = defaultSharedPreferences;
        int a4 = w.a(context, R.attr.colorChangelogList);
        j.Companion.getClass();
        this.e = i.a(a4).b();
        this.f737d = i.a(w.a(context, R.attr.colorChangelogDate)).b();
        this.f736c = i.a(w.a(context, R.attr.colorChangelogVersion)).b();
    }

    public final AlertDialog a(boolean z3) {
        String O3;
        String obj;
        String str;
        String str2 = "$version";
        StringBuilder sb = new StringBuilder("\n             <!DOCTYPE html>\n             <html>\n             <head>\n             <style type=\"text/css\">\n             a { color:");
        String str3 = this.f736c;
        sb.append(str3);
        sb.append("; }\n             .version {\n             color:");
        sb.append(str3);
        sb.append(";\n             text-align:center;\n             font-weight:bold;\n             margin-top:2em;\n             font-size:1.1em;\n             }\n             .date {\n             color:");
        sb.append(this.f737d);
        sb.append(";\n             text-align:center;\n             font-size:0.8em;\n             }\n             li {\n             font-size:0.9em;\n             color:");
        sb.append(this.e);
        sb.append(";\n             margin-left:-1.3em;\n             }\n             </style>\n             </head>\n             <body>\n             \n             ");
        StringBuilder sb2 = new StringBuilder(n.D(sb.toString()));
        Context context = this.f734a;
        InputStream openRawResource = context.getResources().openRawResource(R.raw.changelog);
        try {
            InputStreamReader inputStreamReader = new InputStreamReader(openRawResource, "UTF-8");
            try {
                BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
                boolean z4 = false;
                boolean z5 = false;
                boolean z6 = false;
                while (true) {
                    try {
                        String readLine = bufferedReader.readLine();
                        if (readLine == null || (obj = m.r0(readLine).toString()) == null) {
                            break;
                        }
                        if (u.Q(obj, str2, z4)) {
                            sb2.append("<div class=\"version\">");
                            sb2.append("v");
                            sb2.append(m.r0(u.O(obj, str2, "")).toString());
                            sb2.append("</div>\n");
                            z6 = true;
                        } else {
                            if (!u.Q(obj, "$date", z4)) {
                                str = str2;
                                if (!u.Q(obj, "*", false)) {
                                    if (z5) {
                                        sb2.append("</ul>\n");
                                        z5 = false;
                                    }
                                    if (!z3 && z6) {
                                        break;
                                    }
                                } else {
                                    if (!z5) {
                                        sb2.append(lDACLjZEOR.qQjwDpHdPXxlyn);
                                        z5 = true;
                                    }
                                    sb2.append("<li>");
                                    String substring = obj.substring(1);
                                    kotlin.jvm.internal.k.d(substring, "this as java.lang.String).substring(startIndex)");
                                    sb2.append(m.r0(substring).toString());
                                    sb2.append("</li>\n");
                                }
                            } else {
                                String obj2 = m.r0(u.O(obj, "$date", "")).toString();
                                try {
                                    str = str2;
                                    Date parse = new SimpleDateFormat("dd/MM/yyyy", Locale.ITALIAN).parse(obj2);
                                    if (parse == null) {
                                        break;
                                    }
                                    String format = DateFormat.getDateInstance(1, Locale.getDefault()).format(parse);
                                    kotlin.jvm.internal.k.d(format, "format(...)");
                                    sb2.append("<div class=\"date\">");
                                    sb2.append(format);
                                    sb2.append("</div>\n");
                                } catch (Exception e) {
                                    e.printStackTrace();
                                    Log.e("Changelog", "Errore nella formattazione della data: " + m.r0(u.O(obj, "$date", "")).toString());
                                    p3.g.f(bufferedReader, null);
                                    p3.g.f(inputStreamReader, null);
                                    p3.g.f(openRawResource, null);
                                    O3 = null;
                                }
                            }
                            str2 = str;
                            z4 = false;
                        }
                    } finally {
                    }
                }
                p3.g.f(bufferedReader, null);
                p3.g.f(inputStreamReader, null);
                p3.g.f(openRawResource, null);
                sb2.append("</body>\n</html>");
                String sb3 = sb2.toString();
                kotlin.jvm.internal.k.d(sb3, "toString(...)");
                O3 = u.O(sb3, "#", "&num;");
                if (O3 == null) {
                    return null;
                }
                try {
                    LinearLayout linearLayout = new LinearLayout(context);
                    WebView webView = new WebView(context);
                    linearLayout.addView(webView);
                    webView.setBackgroundColor(0);
                    webView.loadDataWithBaseURL("file:///android_res/", O3, "text/html", NFBhD.sVJB, null);
                    webView.setLongClickable(true);
                    webView.setOnLongClickListener(new Object());
                    String string = z3 ? context.getString(R.string.changelog_full_title) : context.getString(R.string.changelog_title);
                    kotlin.jvm.internal.k.b(string);
                    AlertDialog.Builder builder = new AlertDialog.Builder(context);
                    final int i = 0;
                    builder.setTitle(string).setView(linearLayout).setCancelable(true).setPositiveButton(context.getString(android.R.string.ok), new DialogInterface.OnClickListener(this) {

                        public final g f733b;

                        {
                            this.f733b = this;
                        }

                        @Override
                        public final void onClick(DialogInterface dialogInterface, int i4) {
                            switch (i) {
                                case 0:
                                    g this$0 = this.f733b;
                                    kotlin.jvm.internal.k.e(this$0, "this$0");
                                    SharedPreferences.Editor edit = this$0.f735b.edit();
                                    edit.putString("changelog_last_version", this$0.b());
                                    edit.apply();
                                    return;
                                default:
                                    g this$02 = this.f733b;
                                    kotlin.jvm.internal.k.e(this$02, "this$0");
                                    AlertDialog a4 = this$02.a(true);
                                    if (a4 != null) {
                                        a4.show();
                                        return;
                                    }
                                    return;
                            }
                        }
                    });
                    if (!z3) {
                        final int i4 = 1;
                        builder.setNegativeButton(R.string.changelog_show_full, new DialogInterface.OnClickListener(this) {

                            public final g f733b;

                            {
                                this.f733b = this;
                            }

                            @Override
                            public final void onClick(DialogInterface dialogInterface, int i42) {
                                switch (i4) {
                                    case 0:
                                        g this$0 = this.f733b;
                                        kotlin.jvm.internal.k.e(this$0, "this$0");
                                        SharedPreferences.Editor edit = this$0.f735b.edit();
                                        edit.putString("changelog_last_version", this$0.b());
                                        edit.apply();
                                        return;
                                    default:
                                        g this$02 = this.f733b;
                                        kotlin.jvm.internal.k.e(this$02, "this$0");
                                        AlertDialog a4 = this$02.a(true);
                                        if (a4 != null) {
                                            a4.show();
                                            return;
                                        }
                                        return;
                                }
                            }
                        });
                    }
                    return builder.create();
                } catch (Exception e4) {
                    e4.printStackTrace();
                    return null;
                }
            } finally {
            }
        } finally {
        }
    }

    public final String b() {
        Context context = this.f734a;
        kotlin.jvm.internal.k.e(context, "context");
        PackageManager packageManager = context.getPackageManager();
        kotlin.jvm.internal.k.d(packageManager, "getPackageManager(...)");
        try {
            String packageName = context.getPackageName();
            kotlin.jvm.internal.k.d(packageName, "getPackageName(...)");
            int i = 4 >> 0;
            String versionName = packageManager.getPackageInfo(packageName, 0).versionName;
            kotlin.jvm.internal.k.d(versionName, "versionName");
            return versionName;
        } catch (PackageManager.NameNotFoundException unused) {
            return "";
        }
    }
}