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

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

MD5 校验值:facd8e3913e14e36e7daf9e69fbd45cb

反编译源代码说明

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


package it.Ettore.spesaelettrica.ui.activity;

import B1.b;
import C.a;
import C2.CA.pVPGWdr;
import D0.PXWk.rBCr;
import G1.M;
import G1.ViewOnClickListenerC0054l;
import G1.n;
import G1.p;
import G1.w;
import P1.c;
import Y1.d;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.LocaleList;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.Toast;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AlertDialog;
import com.google.android.ump.ConsentForm;
import com.google.android.ump.ConsentInformation;
import com.google.android.ump.FormError;
import com.google.android.ump.UserMessagingPlatform;
import com.google.firebase.crashlytics.internal.metadata.UserMetadata;
import f2.C0223A;
import f2.C0224B;
import g2.AbstractC0263c;
import g2.ViewOnClickListenerC0266f;
import g2.g;
import g2.h;
import g2.i;
import it.Ettore.spesaelettrica.R;
import it.Ettore.spesaelettrica.ui.activity.ActivityImpostazioni;
import it.Ettore.spesaelettrica.ui.activity.ActivityLicenza;
import it.Ettore.spesaelettrica.ui.activity.ActivitySceltaTipoFasciaCosto;
import it.Ettore.spesaelettrica.utils.Lingue;
import it.ettoregallina.translatortool.activity.ActivityTranslatorMain;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Locale;
import java.util.Set;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import kotlin.jvm.internal.k;
import l2.j;
import org.json.JSONException;
import org.json.JSONObject;

public final class ActivityImpostazioni extends M {
    public static final n Companion = new Object();

    public C0224B f2666d;
    public b e;
    public g f;

    @Override
    public final void onActivityResult(int i, int i4, Intent intent) {
        ZipInputStream zipInputStream;
        ZipInputStream zipInputStream2;
        JSONObject jSONObject;
        InputStream inputStream;
        int i5 = 4;
        super.onActivityResult(i, i4, intent);
        ZipInputStream zipInputStream3 = null;
        char c4 = 0;
        int i6 = -1;
        if (i4 != -1 || i != 59 || intent == null) {
            if (i4 == -1 && i == 58 && intent != null) {
                Uri data = intent.getData();
                Y1.b bVar = new Y1.b(this);
                String[] strArr = {a.k(getPackageName(), "_preferences"), "appirater_prefs", "review_in_app_prefs", "TranslateTool"};
                int i7 = 0;
                while (i7 < i5) {
                    File file = new File(bVar.f1465c, a.k(strArr[i7], ".xml"));
                    if (file.exists()) {
                        bVar.f.add(file);
                    } else {
                        Log.w("b", "File \"" + file.getAbsolutePath() + "\" non trovato!");
                    }
                    i7++;
                    i5 = 4;
                }
                File[] listFiles = new File(getFilesDir(), "Templates").listFiles();
                HashSet hashSet = bVar.g;
                if (listFiles != null) {
                    int length = listFiles.length;
                    int i8 = 0;
                    while (i8 < length) {
                        File file2 = listFiles[i8];
                        String name = file2.getName();
                        k.d(name, "getName(...)");
                        if (name.endsWith(".xml")) {
                            File file3 = new File(bVar.f1466d, new String[]{com.google.android.gms.internal.play_billing.a.e("Templates/", file2.getName())}[c4]);
                            if (file3.exists()) {
                                hashSet.add(file3);
                            } else {
                                Log.w("b", "File \"" + file3.getAbsolutePath() + "\" non trovato!");
                            }
                        }
                        i8++;
                        c4 = 0;
                    }
                }
                String[] strArr2 = {"carichi_predefiniti", "bollette"};
                for (int i9 = 0; i9 < 2; i9++) {
                    File file4 = new File(bVar.e, strArr2[i9]);
                    if (file4.exists()) {
                        hashSet.add(file4);
                    } else {
                        Log.w("b", "File \"" + file4.getAbsolutePath() + "\" non trovato!");
                    }
                }
                Context context = bVar.f1463a;
                String fileName = a.k(context.getPackageName(), "_preferences");
                String[] strArr3 = {"SETTINGS", "SETTINGS_TYPE"};
                k.e(fileName, "fileName");
                HashMap hashMap = bVar.i;
                Set set = (Set) hashMap.get(fileName);
                LinkedHashSet h0 = set != null ? j.h0(set) : null;
                if (h0 == null) {
                    h0 = new LinkedHashSet();
                }
                LinkedHashSet linkedHashSet = h0;
                Collections.addAll(linkedHashSet, Arrays.copyOf(strArr3, 2));
                hashMap.put(fileName, linkedHashSet);
                if (data == null) {
                    Toast.makeText(context, R.string.errore_creazione_backup, 1).show();
                    return;
                }
                try {
                    bVar.e(context.getContentResolver().openOutputStream(data));
                    return;
                } catch (FileNotFoundException unused) {
                    Toast.makeText(context, R.string.errore_creazione_backup, 1).show();
                    return;
                }
            }
            return;
        }
        Uri data2 = intent.getData();
        Y1.b bVar2 = new Y1.b(this);
        if (data2 == null) {
            Toast.makeText(this, R.string.errore_ripristino_backup, 1).show();
            return;
        }
        try {
            InputStream openInputStream = getContentResolver().openInputStream(data2);
            try {
                if (openInputStream == null) {
                    jSONObject = null;
                } else {
                    try {
                        zipInputStream2 = new ZipInputStream(openInputStream);
                        jSONObject = null;
                    } catch (Exception e) {
                        e = e;
                        zipInputStream2 = null;
                        jSONObject = null;
                    } catch (Throwable th) {
                        th = th;
                        if (zipInputStream3 != null) {
                            try {
                                zipInputStream3.close();
                            } catch (Exception unused2) {
                            }
                        }
                        throw th;
                    }
                    while (true) {
                        try {
                            ZipEntry nextEntry = zipInputStream2.getNextEntry();
                            if (nextEntry != null) {
                                String name2 = nextEntry.getName();
                                k.d(name2, "getName(...)");
                                if (Y1.b.f(name2).endsWith("manifest.json")) {
                                    StringBuilder sb = new StringBuilder();
                                    byte[] bArr = new byte[UserMetadata.MAX_ATTRIBUTE_SIZE];
                                    while (true) {
                                        int read = zipInputStream2.read(bArr);
                                        if (read == i6) {
                                            break;
                                        }
                                        sb.append(new String(bArr, 0, read, D2.a.f118a));
                                        i6 = -1;
                                    }
                                    jSONObject = new JSONObject(sb.toString());
                                }
                                zipInputStream2.closeEntry();
                                i6 = -1;
                            }
                        } catch (Exception e4) {
                            e = e4;
                            e.printStackTrace();
                        }
                        try {
                            break;
                        } catch (Exception unused3) {
                        }
                    }
                    zipInputStream2.close();
                }
                try {
                    inputStream = getContentResolver().openInputStream(data2);
                } catch (Exception unused4) {
                    inputStream = null;
                }
                if (jSONObject == null || inputStream == null) {
                    Toast.makeText(this, R.string.errore_ripristino_backup, 1).show();
                    return;
                }
                AlertDialog.Builder builder = new AlertDialog.Builder(this);
                try {
                    if (k.a(jSONObject.getString("Package"), getPackageName())) {
                        builder.setMessage("\nPackage:  " + jSONObject.getString("Package") + "\nManifest version:  " + jSONObject.getInt("Manifest version") + "\nApp version:  " + jSONObject.getString("App version") + "\nApp build:  " + jSONObject.getInt("App build") + "\nDate:  " + DateFormat.getDateTimeInstance().format(Long.valueOf(jSONObject.getLong("Date"))) + "\n");
                        builder.setTitle(R.string.ripristina_backup_impostazioni);
                        builder.setPositiveButton(R.string.ripristina_backup, new w(i5, bVar2, inputStream));
                        builder.setNegativeButton(android.R.string.cancel, (DialogInterface.OnClickListener) null);
                        builder.create().show();
                    } else {
                        Toast.makeText(this, R.string.errore_ripristino_backup, 1).show();
                    }
                } catch (JSONException e5) {
                    Toast.makeText(this, R.string.errore_ripristino_backup, 1).show();
                    e5.printStackTrace();
                }
            } catch (Throwable th2) {
                th = th2;
                zipInputStream3 = zipInputStream;
            }
        } catch (Exception unused5) {
            Toast.makeText(this, R.string.errore_ripristino_backup, 1).show();
        }
    }

    @Override
    public final void onCreate(Bundle bundle) {
        Locale locale;
        LocaleList locales;
        super.onCreate(bundle);
        ActionBar supportActionBar = getSupportActionBar();
        if (supportActionBar != null) {
            supportActionBar.setTitle(R.string.impostazioni);
        }
        C0224B.Companion.getClass();
        this.f2666d = C0223A.a(this);
        this.e = new b(this);
        i iVar = new i(this);
        h hVar = new h(this, R.string.impostazioni_generali);
        h hVar2 = new h(this, R.string.backup);
        h hVar3 = new h(this, R.string.debug);
        ViewOnClickListenerC0266f viewOnClickListenerC0266f = new ViewOnClickListenerC0266f(this, R.string.lingua, "language");
        viewOnClickListenerC0266f.setIcon(R.drawable.pref_lingua);
        Lingue.Companion.getClass();
        P1.b bVar = new P1.b(this, Lingue.f2682a);
        viewOnClickListenerC0266f.setEntries(bVar.f861c);
        viewOnClickListenerC0266f.setEntryValues(bVar.f862d);
        if (Build.VERSION.SDK_INT >= 24) {
            locales = getResources().getConfiguration().getLocales();
            locale = locales.get(0);
            k.d(locale, "get(...)");
        } else {
            locale = getResources().getConfiguration().locale;
            k.d(locale, "locale");
        }
        c b4 = bVar.b(locale);
        if (b4 == null) {
            b4 = bVar.b(new Locale("en"));
        }
        k.b(b4);
        viewOnClickListenerC0266f.setValue(b4.f864b);
        viewOnClickListenerC0266f.setPreferenceChangeListener(new p(this, 0));
        viewOnClickListenerC0266f.e();
        hVar.addView(viewOnClickListenerC0266f);
        ViewOnClickListenerC0266f viewOnClickListenerC0266f2 = new ViewOnClickListenerC0266f(this, R.string.valuta, "valuta");
        viewOnClickListenerC0266f2.setIcon(R.drawable.pref_valuta);
        LinkedHashSet a4 = d.a();
        LinkedHashSet linkedHashSet = new LinkedHashSet(a4.size() + 1);
        linkedHashSet.add("Default");
        linkedHashSet.addAll(a4);
        viewOnClickListenerC0266f2.setEntries((String[]) linkedHashSet.toArray(new String[0]));
        Object settedValue = viewOnClickListenerC0266f2.getSettedValue();
        String str = settedValue instanceof String ? (String) settedValue : null;
        if (str == null || !linkedHashSet.contains(str)) {
            viewOnClickListenerC0266f2.setDefaultIndex(0);
        }
        viewOnClickListenerC0266f2.e();
        hVar.addView(viewOnClickListenerC0266f2);
        g gVar = new g(this, R.string.configura_costi);
        gVar.setIcon(R.drawable.pref_configura_costi);
        final int i = 3;
        gVar.setOnClickListener(new View.OnClickListener(this) {

            public final ActivityImpostazioni f299b;

            {
                this.f299b = this;
            }

            @Override
            public final void onClick(View view) {
                final ActivityImpostazioni this$0 = this.f299b;
                switch (i) {
                    case 0:
                        n nVar = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        this$0.startActivity(new Intent(this$0, (Class<?>) ActivityTranslatorMain.class));
                        return;
                    case 1:
                        n nVar2 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        AlertDialog.Builder builder = new AlertDialog.Builder(this$0);
                        builder.setTitle(R.string.reset_app_titolo);
                        builder.setMessage(R.string.reset_app_messaggio);
                        builder.setPositiveButton(android.R.string.ok, new DialogInterfaceOnClickListenerC0055m(this$0, 0));
                        builder.setNegativeButton(android.R.string.cancel, (DialogInterface.OnClickListener) null);
                        builder.create().show();
                        return;
                    case 2:
                        n nVar3 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        Intent intent = new Intent(rBCr.IrEHocftvpfavEx);
                        intent.addCategory("android.intent.category.OPENABLE");
                        intent.setType("*/*");
                        try {
                            this$0.startActivityForResult(intent, 59);
                            return;
                        } catch (ActivityNotFoundException unused) {
                            B2.o.a0(this$0, 1, "File management activity not found").show();
                            return;
                        }
                    case 3:
                        n nVar4 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        this$0.startActivity(new Intent(this$0, (Class<?>) ActivitySceltaTipoFasciaCosto.class));
                        this$0.finish();
                        return;
                    case 4:
                        n nVar5 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        final C0224B c0224b = this$0.f2666d;
                        if (c0224b != null) {
                            UserMessagingPlatform.showPrivacyOptionsForm(this$0, new ConsentForm.OnConsentFormDismissedListener() {
                                @Override
                                public final void onConsentFormDismissed(FormError formError) {
                                    C0224B this$02 = C0224B.this;
                                    kotlin.jvm.internal.k.e(this$02, "this$0");
                                    Activity activity = this$0;
                                    kotlin.jvm.internal.k.e(activity, "$activity");
                                    if (formError == null) {
                                        long currentTimeMillis = System.currentTimeMillis();
                                        SharedPreferences.Editor edit = this$02.f2317a.edit();
                                        edit.putLong("ump_last_consent_time", currentTimeMillis);
                                        edit.apply();
                                    }
                                    if (formError != null) {
                                        formError.getMessage();
                                    }
                                }
                            });
                        }
                        return;
                    case 5:
                        n nVar6 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        Intent intent2 = new Intent("android.intent.action.CREATE_DOCUMENT");
                        intent2.addCategory("android.intent.category.OPENABLE");
                        intent2.setType("*/*");
                        Y1.a aVar = Y1.b.Companion;
                        String string = this$0.getString(R.string.app_name);
                        kotlin.jvm.internal.k.d(string, pVPGWdr.zhguwxaxNTMzm);
                        aVar.getClass();
                        intent2.putExtra("android.intent.extra.TITLE", C.a.m(string, " - Settings - ", new SimpleDateFormat("yyyyMMdd", Locale.ENGLISH).format(new Date()), ".zip"));
                        try {
                            this$0.startActivityForResult(intent2, 58);
                            return;
                        } catch (ActivityNotFoundException unused2) {
                            B2.o.a0(this$0, 1, "File management activity not found").show();
                            return;
                        }
                    default:
                        n nVar7 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        this$0.startActivity(new Intent(this$0, (Class<?>) ActivityLicenza.class));
                        return;
                }
            }
        });
        hVar.addView(gVar);
        AbstractC0263c abstractC0263c = new AbstractC0263c(this, getString(R.string.changelog_avvio), null);
        View.inflate(this, R.layout.switch_preference, abstractC0263c);
        abstractC0263c.c(true);
        abstractC0263c.setIcon(R.drawable.pref_changelog);
        abstractC0263c.setSummary(R.string.changelog_avvio_descr);
        abstractC0263c.setDefaultChecked(true);
        hVar.addView(abstractC0263c);
        g gVar2 = new g(this, R.string.licenza);
        gVar2.setIcon(R.drawable.pref_licenza);
        final int i4 = 6;
        gVar2.setOnClickListener(new View.OnClickListener(this) {

            public final ActivityImpostazioni f299b;

            {
                this.f299b = this;
            }

            @Override
            public final void onClick(View view) {
                final Activity this$0 = this.f299b;
                switch (i4) {
                    case 0:
                        n nVar = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        this$0.startActivity(new Intent(this$0, (Class<?>) ActivityTranslatorMain.class));
                        return;
                    case 1:
                        n nVar2 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        AlertDialog.Builder builder = new AlertDialog.Builder(this$0);
                        builder.setTitle(R.string.reset_app_titolo);
                        builder.setMessage(R.string.reset_app_messaggio);
                        builder.setPositiveButton(android.R.string.ok, new DialogInterfaceOnClickListenerC0055m(this$0, 0));
                        builder.setNegativeButton(android.R.string.cancel, (DialogInterface.OnClickListener) null);
                        builder.create().show();
                        return;
                    case 2:
                        n nVar3 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        Intent intent = new Intent(rBCr.IrEHocftvpfavEx);
                        intent.addCategory("android.intent.category.OPENABLE");
                        intent.setType("*/*");
                        try {
                            this$0.startActivityForResult(intent, 59);
                            return;
                        } catch (ActivityNotFoundException unused) {
                            B2.o.a0(this$0, 1, "File management activity not found").show();
                            return;
                        }
                    case 3:
                        n nVar4 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        this$0.startActivity(new Intent(this$0, (Class<?>) ActivitySceltaTipoFasciaCosto.class));
                        this$0.finish();
                        return;
                    case 4:
                        n nVar5 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        final C0224B c0224b = this$0.f2666d;
                        if (c0224b != null) {
                            UserMessagingPlatform.showPrivacyOptionsForm(this$0, new ConsentForm.OnConsentFormDismissedListener() {
                                @Override
                                public final void onConsentFormDismissed(FormError formError) {
                                    C0224B this$02 = C0224B.this;
                                    kotlin.jvm.internal.k.e(this$02, "this$0");
                                    Activity activity = this$0;
                                    kotlin.jvm.internal.k.e(activity, "$activity");
                                    if (formError == null) {
                                        long currentTimeMillis = System.currentTimeMillis();
                                        SharedPreferences.Editor edit = this$02.f2317a.edit();
                                        edit.putLong("ump_last_consent_time", currentTimeMillis);
                                        edit.apply();
                                    }
                                    if (formError != null) {
                                        formError.getMessage();
                                    }
                                }
                            });
                        }
                        return;
                    case 5:
                        n nVar6 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        Intent intent2 = new Intent("android.intent.action.CREATE_DOCUMENT");
                        intent2.addCategory("android.intent.category.OPENABLE");
                        intent2.setType("*/*");
                        Y1.a aVar = Y1.b.Companion;
                        String string = this$0.getString(R.string.app_name);
                        kotlin.jvm.internal.k.d(string, pVPGWdr.zhguwxaxNTMzm);
                        aVar.getClass();
                        intent2.putExtra("android.intent.extra.TITLE", C.a.m(string, " - Settings - ", new SimpleDateFormat("yyyyMMdd", Locale.ENGLISH).format(new Date()), ".zip"));
                        try {
                            this$0.startActivityForResult(intent2, 58);
                            return;
                        } catch (ActivityNotFoundException unused2) {
                            B2.o.a0(this$0, 1, "File management activity not found").show();
                            return;
                        }
                    default:
                        n nVar7 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        this$0.startActivity(new Intent(this$0, (Class<?>) ActivityLicenza.class));
                        return;
                }
            }
        });
        hVar.addView(gVar2);
        g gVar3 = new g(this, R.string.tr_translator_tool);
        gVar3.setIcon(R.drawable.pref_translator_tool);
        final int i5 = 0;
        gVar3.setOnClickListener(new View.OnClickListener(this) {

            public final ActivityImpostazioni f299b;

            {
                this.f299b = this;
            }

            @Override
            public final void onClick(View view) {
                final Activity this$0 = this.f299b;
                switch (i5) {
                    case 0:
                        n nVar = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        this$0.startActivity(new Intent(this$0, (Class<?>) ActivityTranslatorMain.class));
                        return;
                    case 1:
                        n nVar2 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        AlertDialog.Builder builder = new AlertDialog.Builder(this$0);
                        builder.setTitle(R.string.reset_app_titolo);
                        builder.setMessage(R.string.reset_app_messaggio);
                        builder.setPositiveButton(android.R.string.ok, new DialogInterfaceOnClickListenerC0055m(this$0, 0));
                        builder.setNegativeButton(android.R.string.cancel, (DialogInterface.OnClickListener) null);
                        builder.create().show();
                        return;
                    case 2:
                        n nVar3 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        Intent intent = new Intent(rBCr.IrEHocftvpfavEx);
                        intent.addCategory("android.intent.category.OPENABLE");
                        intent.setType("*/*");
                        try {
                            this$0.startActivityForResult(intent, 59);
                            return;
                        } catch (ActivityNotFoundException unused) {
                            B2.o.a0(this$0, 1, "File management activity not found").show();
                            return;
                        }
                    case 3:
                        n nVar4 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        this$0.startActivity(new Intent(this$0, (Class<?>) ActivitySceltaTipoFasciaCosto.class));
                        this$0.finish();
                        return;
                    case 4:
                        n nVar5 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        final C0224B c0224b = this$0.f2666d;
                        if (c0224b != null) {
                            UserMessagingPlatform.showPrivacyOptionsForm(this$0, new ConsentForm.OnConsentFormDismissedListener() {
                                @Override
                                public final void onConsentFormDismissed(FormError formError) {
                                    C0224B this$02 = C0224B.this;
                                    kotlin.jvm.internal.k.e(this$02, "this$0");
                                    Activity activity = this$0;
                                    kotlin.jvm.internal.k.e(activity, "$activity");
                                    if (formError == null) {
                                        long currentTimeMillis = System.currentTimeMillis();
                                        SharedPreferences.Editor edit = this$02.f2317a.edit();
                                        edit.putLong("ump_last_consent_time", currentTimeMillis);
                                        edit.apply();
                                    }
                                    if (formError != null) {
                                        formError.getMessage();
                                    }
                                }
                            });
                        }
                        return;
                    case 5:
                        n nVar6 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        Intent intent2 = new Intent("android.intent.action.CREATE_DOCUMENT");
                        intent2.addCategory("android.intent.category.OPENABLE");
                        intent2.setType("*/*");
                        Y1.a aVar = Y1.b.Companion;
                        String string = this$0.getString(R.string.app_name);
                        kotlin.jvm.internal.k.d(string, pVPGWdr.zhguwxaxNTMzm);
                        aVar.getClass();
                        intent2.putExtra("android.intent.extra.TITLE", C.a.m(string, " - Settings - ", new SimpleDateFormat("yyyyMMdd", Locale.ENGLISH).format(new Date()), ".zip"));
                        try {
                            this$0.startActivityForResult(intent2, 58);
                            return;
                        } catch (ActivityNotFoundException unused2) {
                            B2.o.a0(this$0, 1, "File management activity not found").show();
                            return;
                        }
                    default:
                        n nVar7 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        this$0.startActivity(new Intent(this$0, (Class<?>) ActivityLicenza.class));
                        return;
                }
            }
        });
        hVar.addView(gVar3);
        g gVar4 = new g(this, R.string.reset_app_titolo);
        gVar4.setIcon(R.drawable.pref_reset_app);
        final int i6 = 1;
        gVar4.setOnClickListener(new View.OnClickListener(this) {

            public final ActivityImpostazioni f299b;

            {
                this.f299b = this;
            }

            @Override
            public final void onClick(View view) {
                final Activity this$0 = this.f299b;
                switch (i6) {
                    case 0:
                        n nVar = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        this$0.startActivity(new Intent(this$0, (Class<?>) ActivityTranslatorMain.class));
                        return;
                    case 1:
                        n nVar2 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        AlertDialog.Builder builder = new AlertDialog.Builder(this$0);
                        builder.setTitle(R.string.reset_app_titolo);
                        builder.setMessage(R.string.reset_app_messaggio);
                        builder.setPositiveButton(android.R.string.ok, new DialogInterfaceOnClickListenerC0055m(this$0, 0));
                        builder.setNegativeButton(android.R.string.cancel, (DialogInterface.OnClickListener) null);
                        builder.create().show();
                        return;
                    case 2:
                        n nVar3 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        Intent intent = new Intent(rBCr.IrEHocftvpfavEx);
                        intent.addCategory("android.intent.category.OPENABLE");
                        intent.setType("*/*");
                        try {
                            this$0.startActivityForResult(intent, 59);
                            return;
                        } catch (ActivityNotFoundException unused) {
                            B2.o.a0(this$0, 1, "File management activity not found").show();
                            return;
                        }
                    case 3:
                        n nVar4 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        this$0.startActivity(new Intent(this$0, (Class<?>) ActivitySceltaTipoFasciaCosto.class));
                        this$0.finish();
                        return;
                    case 4:
                        n nVar5 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        final C0224B c0224b = this$0.f2666d;
                        if (c0224b != null) {
                            UserMessagingPlatform.showPrivacyOptionsForm(this$0, new ConsentForm.OnConsentFormDismissedListener() {
                                @Override
                                public final void onConsentFormDismissed(FormError formError) {
                                    C0224B this$02 = C0224B.this;
                                    kotlin.jvm.internal.k.e(this$02, "this$0");
                                    Activity activity = this$0;
                                    kotlin.jvm.internal.k.e(activity, "$activity");
                                    if (formError == null) {
                                        long currentTimeMillis = System.currentTimeMillis();
                                        SharedPreferences.Editor edit = this$02.f2317a.edit();
                                        edit.putLong("ump_last_consent_time", currentTimeMillis);
                                        edit.apply();
                                    }
                                    if (formError != null) {
                                        formError.getMessage();
                                    }
                                }
                            });
                        }
                        return;
                    case 5:
                        n nVar6 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        Intent intent2 = new Intent("android.intent.action.CREATE_DOCUMENT");
                        intent2.addCategory("android.intent.category.OPENABLE");
                        intent2.setType("*/*");
                        Y1.a aVar = Y1.b.Companion;
                        String string = this$0.getString(R.string.app_name);
                        kotlin.jvm.internal.k.d(string, pVPGWdr.zhguwxaxNTMzm);
                        aVar.getClass();
                        intent2.putExtra("android.intent.extra.TITLE", C.a.m(string, " - Settings - ", new SimpleDateFormat("yyyyMMdd", Locale.ENGLISH).format(new Date()), ".zip"));
                        try {
                            this$0.startActivityForResult(intent2, 58);
                            return;
                        } catch (ActivityNotFoundException unused2) {
                            B2.o.a0(this$0, 1, "File management activity not found").show();
                            return;
                        }
                    default:
                        n nVar7 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        this$0.startActivity(new Intent(this$0, (Class<?>) ActivityLicenza.class));
                        return;
                }
            }
        });
        hVar.addView(gVar4);
        g gVar5 = new g(this, R.string.consenso_annunci_personalizzati);
        this.f = gVar5;
        gVar5.setIcon(R.drawable.pref_ad);
        g gVar6 = this.f;
        if (gVar6 == null) {
            k.j("preferenceAdConsent");
            throw null;
        }
        gVar6.setSummary(R.string.consenso_annunci_personalizzati_descr);
        g gVar7 = this.f;
        if (gVar7 == null) {
            k.j("preferenceAdConsent");
            throw null;
        }
        final int i7 = 4;
        gVar7.setOnClickListener(new View.OnClickListener(this) {

            public final ActivityImpostazioni f299b;

            {
                this.f299b = this;
            }

            @Override
            public final void onClick(View view) {
                final Activity this$0 = this.f299b;
                switch (i7) {
                    case 0:
                        n nVar = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        this$0.startActivity(new Intent(this$0, (Class<?>) ActivityTranslatorMain.class));
                        return;
                    case 1:
                        n nVar2 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        AlertDialog.Builder builder = new AlertDialog.Builder(this$0);
                        builder.setTitle(R.string.reset_app_titolo);
                        builder.setMessage(R.string.reset_app_messaggio);
                        builder.setPositiveButton(android.R.string.ok, new DialogInterfaceOnClickListenerC0055m(this$0, 0));
                        builder.setNegativeButton(android.R.string.cancel, (DialogInterface.OnClickListener) null);
                        builder.create().show();
                        return;
                    case 2:
                        n nVar3 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        Intent intent = new Intent(rBCr.IrEHocftvpfavEx);
                        intent.addCategory("android.intent.category.OPENABLE");
                        intent.setType("*/*");
                        try {
                            this$0.startActivityForResult(intent, 59);
                            return;
                        } catch (ActivityNotFoundException unused) {
                            B2.o.a0(this$0, 1, "File management activity not found").show();
                            return;
                        }
                    case 3:
                        n nVar4 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        this$0.startActivity(new Intent(this$0, (Class<?>) ActivitySceltaTipoFasciaCosto.class));
                        this$0.finish();
                        return;
                    case 4:
                        n nVar5 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        final C0224B c0224b = this$0.f2666d;
                        if (c0224b != null) {
                            UserMessagingPlatform.showPrivacyOptionsForm(this$0, new ConsentForm.OnConsentFormDismissedListener() {
                                @Override
                                public final void onConsentFormDismissed(FormError formError) {
                                    C0224B this$02 = C0224B.this;
                                    kotlin.jvm.internal.k.e(this$02, "this$0");
                                    Activity activity = this$0;
                                    kotlin.jvm.internal.k.e(activity, "$activity");
                                    if (formError == null) {
                                        long currentTimeMillis = System.currentTimeMillis();
                                        SharedPreferences.Editor edit = this$02.f2317a.edit();
                                        edit.putLong("ump_last_consent_time", currentTimeMillis);
                                        edit.apply();
                                    }
                                    if (formError != null) {
                                        formError.getMessage();
                                    }
                                }
                            });
                        }
                        return;
                    case 5:
                        n nVar6 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        Intent intent2 = new Intent("android.intent.action.CREATE_DOCUMENT");
                        intent2.addCategory("android.intent.category.OPENABLE");
                        intent2.setType("*/*");
                        Y1.a aVar = Y1.b.Companion;
                        String string = this$0.getString(R.string.app_name);
                        kotlin.jvm.internal.k.d(string, pVPGWdr.zhguwxaxNTMzm);
                        aVar.getClass();
                        intent2.putExtra("android.intent.extra.TITLE", C.a.m(string, " - Settings - ", new SimpleDateFormat("yyyyMMdd", Locale.ENGLISH).format(new Date()), ".zip"));
                        try {
                            this$0.startActivityForResult(intent2, 58);
                            return;
                        } catch (ActivityNotFoundException unused2) {
                            B2.o.a0(this$0, 1, "File management activity not found").show();
                            return;
                        }
                    default:
                        n nVar7 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        this$0.startActivity(new Intent(this$0, (Class<?>) ActivityLicenza.class));
                        return;
                }
            }
        });
        g gVar8 = this.f;
        if (gVar8 == null) {
            k.j("preferenceAdConsent");
            throw null;
        }
        hVar.addView(gVar8);
        g gVar9 = new g(this, R.string.effettua_backup_impostazioni);
        gVar9.setIcon(R.drawable.pref_backup_impostazioni);
        final int i8 = 5;
        gVar9.setOnClickListener(new View.OnClickListener(this) {

            public final ActivityImpostazioni f299b;

            {
                this.f299b = this;
            }

            @Override
            public final void onClick(View view) {
                final Activity this$0 = this.f299b;
                switch (i8) {
                    case 0:
                        n nVar = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        this$0.startActivity(new Intent(this$0, (Class<?>) ActivityTranslatorMain.class));
                        return;
                    case 1:
                        n nVar2 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        AlertDialog.Builder builder = new AlertDialog.Builder(this$0);
                        builder.setTitle(R.string.reset_app_titolo);
                        builder.setMessage(R.string.reset_app_messaggio);
                        builder.setPositiveButton(android.R.string.ok, new DialogInterfaceOnClickListenerC0055m(this$0, 0));
                        builder.setNegativeButton(android.R.string.cancel, (DialogInterface.OnClickListener) null);
                        builder.create().show();
                        return;
                    case 2:
                        n nVar3 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        Intent intent = new Intent(rBCr.IrEHocftvpfavEx);
                        intent.addCategory("android.intent.category.OPENABLE");
                        intent.setType("*/*");
                        try {
                            this$0.startActivityForResult(intent, 59);
                            return;
                        } catch (ActivityNotFoundException unused) {
                            B2.o.a0(this$0, 1, "File management activity not found").show();
                            return;
                        }
                    case 3:
                        n nVar4 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        this$0.startActivity(new Intent(this$0, (Class<?>) ActivitySceltaTipoFasciaCosto.class));
                        this$0.finish();
                        return;
                    case 4:
                        n nVar5 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        final C0224B c0224b = this$0.f2666d;
                        if (c0224b != null) {
                            UserMessagingPlatform.showPrivacyOptionsForm(this$0, new ConsentForm.OnConsentFormDismissedListener() {
                                @Override
                                public final void onConsentFormDismissed(FormError formError) {
                                    C0224B this$02 = C0224B.this;
                                    kotlin.jvm.internal.k.e(this$02, "this$0");
                                    Activity activity = this$0;
                                    kotlin.jvm.internal.k.e(activity, "$activity");
                                    if (formError == null) {
                                        long currentTimeMillis = System.currentTimeMillis();
                                        SharedPreferences.Editor edit = this$02.f2317a.edit();
                                        edit.putLong("ump_last_consent_time", currentTimeMillis);
                                        edit.apply();
                                    }
                                    if (formError != null) {
                                        formError.getMessage();
                                    }
                                }
                            });
                        }
                        return;
                    case 5:
                        n nVar6 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        Intent intent2 = new Intent("android.intent.action.CREATE_DOCUMENT");
                        intent2.addCategory("android.intent.category.OPENABLE");
                        intent2.setType("*/*");
                        Y1.a aVar = Y1.b.Companion;
                        String string = this$0.getString(R.string.app_name);
                        kotlin.jvm.internal.k.d(string, pVPGWdr.zhguwxaxNTMzm);
                        aVar.getClass();
                        intent2.putExtra("android.intent.extra.TITLE", C.a.m(string, " - Settings - ", new SimpleDateFormat("yyyyMMdd", Locale.ENGLISH).format(new Date()), ".zip"));
                        try {
                            this$0.startActivityForResult(intent2, 58);
                            return;
                        } catch (ActivityNotFoundException unused2) {
                            B2.o.a0(this$0, 1, "File management activity not found").show();
                            return;
                        }
                    default:
                        n nVar7 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        this$0.startActivity(new Intent(this$0, (Class<?>) ActivityLicenza.class));
                        return;
                }
            }
        });
        hVar2.addView(gVar9);
        g gVar10 = new g(this, R.string.ripristina_backup_impostazioni);
        gVar10.setIcon(R.drawable.pref_ripristina_backup);
        final int i9 = 2;
        gVar10.setOnClickListener(new View.OnClickListener(this) {

            public final ActivityImpostazioni f299b;

            {
                this.f299b = this;
            }

            @Override
            public final void onClick(View view) {
                final Activity this$0 = this.f299b;
                switch (i9) {
                    case 0:
                        n nVar = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        this$0.startActivity(new Intent(this$0, (Class<?>) ActivityTranslatorMain.class));
                        return;
                    case 1:
                        n nVar2 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        AlertDialog.Builder builder = new AlertDialog.Builder(this$0);
                        builder.setTitle(R.string.reset_app_titolo);
                        builder.setMessage(R.string.reset_app_messaggio);
                        builder.setPositiveButton(android.R.string.ok, new DialogInterfaceOnClickListenerC0055m(this$0, 0));
                        builder.setNegativeButton(android.R.string.cancel, (DialogInterface.OnClickListener) null);
                        builder.create().show();
                        return;
                    case 2:
                        n nVar3 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        Intent intent = new Intent(rBCr.IrEHocftvpfavEx);
                        intent.addCategory("android.intent.category.OPENABLE");
                        intent.setType("*/*");
                        try {
                            this$0.startActivityForResult(intent, 59);
                            return;
                        } catch (ActivityNotFoundException unused) {
                            B2.o.a0(this$0, 1, "File management activity not found").show();
                            return;
                        }
                    case 3:
                        n nVar4 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        this$0.startActivity(new Intent(this$0, (Class<?>) ActivitySceltaTipoFasciaCosto.class));
                        this$0.finish();
                        return;
                    case 4:
                        n nVar5 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        final C0224B c0224b = this$0.f2666d;
                        if (c0224b != null) {
                            UserMessagingPlatform.showPrivacyOptionsForm(this$0, new ConsentForm.OnConsentFormDismissedListener() {
                                @Override
                                public final void onConsentFormDismissed(FormError formError) {
                                    C0224B this$02 = C0224B.this;
                                    kotlin.jvm.internal.k.e(this$02, "this$0");
                                    Activity activity = this$0;
                                    kotlin.jvm.internal.k.e(activity, "$activity");
                                    if (formError == null) {
                                        long currentTimeMillis = System.currentTimeMillis();
                                        SharedPreferences.Editor edit = this$02.f2317a.edit();
                                        edit.putLong("ump_last_consent_time", currentTimeMillis);
                                        edit.apply();
                                    }
                                    if (formError != null) {
                                        formError.getMessage();
                                    }
                                }
                            });
                        }
                        return;
                    case 5:
                        n nVar6 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        Intent intent2 = new Intent("android.intent.action.CREATE_DOCUMENT");
                        intent2.addCategory("android.intent.category.OPENABLE");
                        intent2.setType("*/*");
                        Y1.a aVar = Y1.b.Companion;
                        String string = this$0.getString(R.string.app_name);
                        kotlin.jvm.internal.k.d(string, pVPGWdr.zhguwxaxNTMzm);
                        aVar.getClass();
                        intent2.putExtra("android.intent.extra.TITLE", C.a.m(string, " - Settings - ", new SimpleDateFormat("yyyyMMdd", Locale.ENGLISH).format(new Date()), ".zip"));
                        try {
                            this$0.startActivityForResult(intent2, 58);
                            return;
                        } catch (ActivityNotFoundException unused2) {
                            B2.o.a0(this$0, 1, "File management activity not found").show();
                            return;
                        }
                    default:
                        n nVar7 = ActivityImpostazioni.Companion;
                        kotlin.jvm.internal.k.e(this$0, "this$0");
                        this$0.startActivity(new Intent(this$0, (Class<?>) ActivityLicenza.class));
                        return;
                }
            }
        });
        hVar2.addView(gVar10);
        g gVar11 = new g(this, R.string.command_line);
        gVar11.setIcon(R.drawable.pref_debug);
        gVar11.setOnClickListener(new ViewOnClickListenerC0054l(0, this, gVar11));
        hVar3.addView(gVar11);
        LinearLayout linearLayout = iVar.f2423a;
        linearLayout.addView(hVar);
        linearLayout.addView(hVar2);
        linearLayout.addView(hVar3);
        setContentView(iVar);
    }

    @Override
    public final boolean onCreateOptionsMenu(Menu menu) {
        k.e(menu, "menu");
        super.onCreateOptionsMenu(menu);
        menu.removeItem(R.id.impostazioni);
        return true;
    }

    @Override
    public final void onDestroy() {
        b bVar = this.e;
        if (bVar == null) {
            k.j("bundleDatiApplicazioneGenerator");
            throw null;
        }
        int i = 5 | 1;
        bVar.f47b = true;
        super.onDestroy();
    }

    @Override
    public final void onStart() {
        super.onStart();
        int i = 8;
        if (f()) {
            g gVar = this.f;
            if (gVar == null) {
                k.j("preferenceAdConsent");
                throw null;
            }
            gVar.setVisibility(8);
        } else {
            g gVar2 = this.f;
            if (gVar2 == null) {
                k.j("preferenceAdConsent");
                throw null;
            }
            C0224B c0224b = this.f2666d;
            if (c0224b != null && c0224b.f2318b.getPrivacyOptionsRequirementStatus() == ConsentInformation.PrivacyOptionsRequirementStatus.REQUIRED) {
                i = 0;
            }
            gVar2.setVisibility(i);
        }
    }
}