Luсky+Рatcher v11.3.3版本的 MD5 值为:fcc08dfa98a57a21951c5463e292fdaf

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


package p085;

import android.app.AlertDialog;
import android.app.Dialog;
import android.app.NotificationManager;
import android.app.ProgressDialog;
import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ProviderInfo;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.content.res.Resources;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.StatFs;
import android.os.Vibrator;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.text.Editable;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.style.RelativeSizeSpan;
import android.text.util.Linkify;
import android.util.Xml;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ExpandableListView;
import android.widget.Filter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import androidx.core.content.FileProvider;
import androidx.core.graphics.drawable.IconCompat;
import androidx.drawerlayout.widget.DrawerLayout;
import androidx.fragment.app.ActivityC0588;
import androidx.fragment.app.Fragment;
import com.android.apksig.apk.ApkFormatException;
import com.android.apksig.apk.ApkUtils;
import com.android.vending.licensing.ILicensingService;
import com.android.vending.licensing.InterfaceC0904;
import com.google.android.finsky.billing.iab.InAppBillingService;
import com.google.android.finsky.services.LicensingService;
import com.google.android.material.navigation.NavigationView;
import com.ui.EditTextFix;
import com.unity3d.ads.metadata.MediationMetaData;
import com.widgets.Widget1;
import com.widgets.Widget2;
import com.widgets.Widget3;
import com.widgets.Widget4;
import com.widgets.Widget5;
import com.xposed.XposedUtils;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.RandomAccessFile;
import java.net.MalformedURLException;
import java.net.ServerSocket;
import java.net.URL;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.Semaphore;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import javaroot.utils.C1543;
import javaroot.utils.C1547;
import javaroot.utils.C1549;
import javaroot.utils.C1551;
import javaroot.utils.C1553;
import javaroot.utils.C1555;
import javaroot.utils.C1557;
import javaroot.utils.C1559;
import javaroot.utils.C1563;
import javaroot.utils.C1565;
import javaroot.utils.C1567;
import javaroot.utils.C1570;
import javaroot.utils.C1572;
import javaroot.utils.C1574;
import javaroot.utils.C1578;
import javaroot.utils.C1588;
import javaroot.utils.C1592;
import javaroot.utils.C1594;
import javaroot.utils.C1596;
import javaroot.utils.C1598;
import javaroot.utils.C1601;
import javaroot.utils.C1617;
import javaroot.utils.C1620;
import javaroot.utils.C1623;
import javaroot.utils.C1626;
import javaroot.utils.C1629;
import javaroot.utils.C1632;
import javaroot.utils.C1637;
import javaroot.utils.C1640;
import javaroot.utils.C1664;
import javaroot.utils.C1668;
import javaroot.utils.C1670;
import javaroot.utils.C1674;
import javaroot.utils.C1676;
import javaroot.utils.C1678;
import javaroot.utils.C1690;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import net.lingala.zip4j.core.ZipFile;
import net.lingala.zip4j.exception.ZipException;
import net.lingala.zip4j.util.InternalZipConstants;
import org.jf.dexlib2.DexFileFactory;
import org.jf.dexlib2.analysis.RegisterType;
import org.jf.dexlib2.dexbacked.DexBackedDexFile;
import org.jf.dexlib2.dexbacked.raw.ItemType;
import org.json.JSONException;
import org.json.JSONObject;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserFactory;
import org.xmlpull.v1.XmlSerializer;
import p030.C2415;
import p031.C2419;
import p031.C2420;
import p035.C2454;
import p037.C2471;
import p037.C2483;
import p037.C2500;
import p038.C2596;
import p038.C2597;
import p038.C2600;
import p038.C2601;
import p038.C2603;
import p040.C2608;
import p040.C2614;
import p040.C2623;
import p040.C2624;
import p040.C2630;
import p040.C2634;
import p040.C2635;
import p041.C2636;
import p041.C2637;
import p041.C2638;
import p075.C2810;
import p075.C2811;
import p076.C2812;
import p076.C2813;
import p086.C3506;
import p086.C3538;
import p086.C3549;
import p086.C3698;
import p086.C3702;
import p086.C3705;
import p086.C3727;
import p086.C3730;
import p086.C3733;
import p086.C3737;
import p086.C3740;
import p086.C3743;
import p086.C3746;
import p105.C3862;
import p105.C3864;
import p144.C4318;
import p146.C4341;
import p146.C4345;
import ru.aaaaabbt.installer.R;
import ru.sxbuIDfx.pFSOyagrF.App;
import ru.sxbuIDfx.pFSOyagrF.BinderActivity;
import ru.sxbuIDfx.pFSOyagrF.MainActivity;
import ru.sxbuIDfx.pFSOyagrF.PkgName;
import sun.security.util.DerValue;
import sun.security.x509.PolicyMappingsExtension;

public class C2975 extends Fragment {

    public static String f9234 = "";

    public static boolean f9235 = false;

    public static boolean f9236 = false;

    public static String f9237 = "com.android.vending.billing.InAppBillingService.BINN";

    public static String f9238 = "com.android.vending.billing.InAppBillingService.COIN";

    public static boolean f9239 = false;

    public static String f9240 = null;

    public static byte[] f9241 = null;

    private static Context f9242 = null;

    public static boolean f9243 = false;

    public static int f9244 = 255;

    public static C2975 f9245 = null;

    public static String f9246 = "";

    public static String f9247 = "permissive";

    public static String f9248 = null;

    public static C2938 f9249 = null;

    public static String f9250 = null;

    public static String f9251 = null;

    public static C3479 f9252 = null;

    public static C3478 f9253 = null;

    public static int f9254 = -1;

    public static File f9255 = null;

    public static File[] f9256 = null;

    public static boolean f9257 = false;

    public static ExpandableListView f9258 = null;

    public static MainActivity f9259 = null;

    public static ArrayList<C3478> f9260 = null;

    public static boolean f9261 = false;

    public static ArrayAdapter f9263 = null;

    public static ArrayAdapter f9264 = null;

    public static C2931<C3477> f9265 = null;

    public static C2931<C2935> f9266 = null;

    public static C2934 f9267 = null;

    public static String f9268 = "beleberda";

    public static String f9269 = "beleberda";

    public static Context f9270 = null;

    public static String f9271 = null;

    public static int f9272 = 0;

    public static String f9273 = null;

    public static boolean f9274 = true;

    public static C3740 f9275 = null;

    public static C3743 f9276 = null;

    public static C3746 f9277 = null;

    public static C3746 f9278 = null;

    public static String f9279 = null;

    public static C2974 f9280 = null;

    public static boolean f9281 = false;

    public static String f9282 = "";

    public static boolean f9283 = false;

    public static String f9284 = "";

    public static String f9285 = "";

    public static boolean f9286 = false;

    public static C2940 f9287 = null;

    public static int f9288 = 0;

    public static boolean f9289 = false;

    public static Boolean f9290 = null;

    public static boolean f9291 = false;

    public static String f9292 = null;

    public static boolean f9293 = false;

    public static boolean f9294 = false;

    public static String[] f9295 = null;

    public static boolean f9297 = false;

    public static String f9298 = "";

    public static int f9299 = 0;

    public static int f9300 = 0;

    public static ArrayAdapter<C2933> f9301 = null;

    public static String f9302 = "";

    public static int f9303;

    public static SharedPreferences f9304;

    public static Process f9305;

    public static DataInputStream f9306;

    public static DataOutputStream f9307;

    public static DataInputStream f9308;

    public static C3363 f9315;

    public static C3361 f9316;

    public static Boolean f9323;

    public static ArrayList<C3478> f9332;

    public static ExpandableListView f9333;

    public static C2943 f9335;

    public static Vibrator f9346;

    static Menu f9358;

    public static C2624 f9366;

    public static File f9367;

    static ServiceConnection f9387;

    public int f9417;

    public String f9419;

    public String f9420;

    public String f9421;

    ILicensingService f9424;

    public static String[] f9262 = {"empty"};

    public static String[] f9296 = {"busybox", "/data/adb/magisk/busybox", "toolbar", "/system/bin/failsafe/toolbox"};

    public static Semaphore f9309 = new Semaphore(1);

    public static boolean f9310 = false;

    public static boolean f9311 = false;

    public static Handler f9312 = null;

    public static Handler f9313 = null;

    public static C3698 f9314 = null;

    public static int f9317 = 0;

    public static boolean f9318 = false;

    public static boolean f9319 = false;

    public static boolean f9320 = false;

    public static ServerSocket f9321 = null;

    public static boolean f9322 = false;

    public static long f9324 = 0;

    public static ArrayList<C3478> f9325 = new ArrayList<>();

    public static boolean f9326 = false;

    public static int f9327 = 0;

    public static boolean f9328 = false;

    public static boolean f9329 = false;

    public static SQLiteDatabase f9330 = null;

    public static SQLiteDatabase f9331 = null;

    public static boolean f9334 = false;

    public static Intent f9336 = null;

    public static C3478 f9337 = null;

    public static ArrayList<File> f9338 = null;

    public static boolean f9339 = false;

    public static Boolean f9340 = null;

    public static boolean f9341 = false;

    public static PackageManager f9342 = null;

    public static Resources f9343 = null;

    public static Boolean f9344 = null;

    public static Boolean f9345 = null;

    public static Boolean f9347 = null;

    public static Boolean f9348 = null;

    public static String f9349 = "";

    public static ArrayList<String[]> f9350 = new ArrayList<>();

    public static ArrayList<String[]> f9351 = new ArrayList<>();

    public static boolean f9352 = false;

    public static boolean f9353 = false;

    public static boolean f9354 = false;

    public static String f9355 = C2500.m7148("lp_utils");

    public static String f9356 = C2500.m7148("xposed");

    public static ArrayList<Dialog> f9357 = new ArrayList<>();

    private static final char[] f9359 = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};

    public static ArrayList<String> f9360 = new ArrayList<>();

    public static String f9361 = "";

    public static ArrayList<String> f9362 = null;

    public static boolean f9363 = true;

    public static boolean f9364 = true;

    public static int f9365 = 0;

    public static boolean f9368 = false;

    public static boolean f9369 = false;

    public static boolean f9370 = false;

    public static boolean f9371 = false;

    public static boolean f9372 = false;

    public static boolean f9373 = false;

    public static boolean f9374 = false;

    public static boolean f9375 = false;

    public static boolean f9376 = false;

    public static boolean f9377 = false;

    public static boolean f9378 = false;

    public static boolean f9379 = false;

    public static boolean f9380 = false;

    public static boolean f9381 = false;

    public static boolean f9382 = false;

    public static boolean f9383 = false;

    public static boolean f9384 = false;

    public static boolean f9385 = false;

    public static boolean f9386 = false;

    static byte[] f9388 = {-33, 43, 12, -98, -78, -24, 65, -42, DerValue.tag_UniversalString, RegisterType.UNINIT_THIS, -112, 99, 66, -34, -11, RegisterType.LONG_HI, -99, 32, -62, 89};

    public static C2939 f9389 = null;

    public static int f9390 = 106;

    public static int f9391 = 105;

    public static int f9392 = 104;

    public static int f9393 = 103;

    public static int f9394 = 102;

    public static int f9395 = 101;

    public static int f9396 = 100;

    public static int f9397 = 99;

    public static int f9398 = 98;

    public static int f9399 = 97;

    public static int f9400 = 96;

    public static boolean f9401 = false;

    public static String f9402 = "";

    public static String f9403 = "";

    static C3538 f9404 = null;

    static C3737 f9405 = null;

    static C3702 f9406 = null;

    static C3730 f9407 = null;

    static C3733 f9408 = null;

    static C3705 f9409 = null;

    static C3506 f9410 = null;

    public static String f9411 = "";

    private static final String[] f9412 = {"android.permission.WRITE_EXTERNAL_STORAGE"};

    private static final String[] f9413 = {"android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"};

    private static final String[] f9414 = {"android.permission.READ_PHONE_STATE"};

    int f9415 = 0;

    Runnable f9416 = new RunnableC3115();

    public String f9418 = "";

    public String f9422 = "";

    View f9423 = null;

    int f9425 = 255;

    String f9426 = "com.emulator.fpse";

    String f9427 = "shared_prefs";

    String[] f9428 = {"com.android.vending.licensing.ServerManagedPolicy.xml", "com.google.android.vending.licensing.ServerManagedPolicy.xml"};

    private File f9429 = null;

    public boolean f9430 = false;

    String f9431 = "empty";

    Runnable f9432 = null;

    public class RunnableC2976 implements Runnable {

        final C3478 f9433;

        class RunnableC2977 implements Runnable {

            final ArrayList f9435;

            class DialogInterfaceOnClickListenerC2978 implements DialogInterface.OnClickListener {
                DialogInterfaceOnClickListenerC2978() {
                }

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    if (i != -1) {
                        return;
                    }
                    C3549.m8161(RunnableC2977.this.f9435, false);
                }
            }

            class C2979 implements CompoundButton.OnCheckedChangeListener {
                C2979() {
                }

                @Override
                public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
                    if (z) {
                        C2975.m7928().edit().putBoolean("warning_system_apps", false).commit();
                    } else {
                        C2975.m7928().edit().putBoolean("warning_system_apps", true).commit();
                    }
                }
            }

            RunnableC2977(ArrayList arrayList) {
                this.f9435 = arrayList;
            }

            @Override
            public void run() {
                C2975.m7951(11);
                if (!RunnableC2976.this.f9433.f10061) {
                    C3549.m8161(this.f9435, false);
                    return;
                }
                DialogInterfaceOnClickListenerC2978 dialogInterfaceOnClickListenerC2978 = new DialogInterfaceOnClickListenerC2978();
                if (C2975.m7928().getBoolean("warning_system_apps", true)) {
                    C2500.m7127(C2500.m7007(R.string.warning), C2500.m7007(R.string.dialog_system), C2500.m7007(R.string.warning_superSu_mount_name_space_separation_3), new C2979(), false, dialogInterfaceOnClickListenerC2978, null, null, false);
                } else if (C2975.f9245 != null) {
                    C3549.m8161(this.f9435, false);
                }
            }
        }

        RunnableC2976(C3478 c3478) {
            this.f9433 = c3478;
        }

        @Override
        public void run() {
            boolean z;
            ArrayList arrayList = new ArrayList();
            if (!this.f9433.f10061) {
                arrayList.add(new C3727(R.string.cloneApplication, 0, "#ffcc66", R.mipmap.clone));
            }
            try {
                C2637 c2637 = new C2637(C2975.m7929(), this.f9433.f10046, false);
                if (this.f9433.f10059 && c2637.m7284()) {
                    arrayList.add(new C3727(R.string.context_purchases_sorter, 0, "#66cc66", R.drawable.context_permissions));
                } else {
                    arrayList.add(new C3727(R.string.context_purchases_sorter, 0, "#aaaaaa", R.drawable.context_permissions));
                }
            } catch (Throwable th) {
                th.printStackTrace();
            }
            if (this.f9433.f10059) {
                arrayList.add(new C3727(R.string.context_remove_saved_purchaces, 0, "#66cc66", R.drawable.context_lvl));
            }
            if (C2975.f9283) {
                if (this.f9433.f10064) {
                    arrayList.add(new C3727(R.string.context_disable_package, 0, "#fe6c00", R.drawable.context_lvl));
                } else {
                    arrayList.add(new C3727(R.string.context_enable_package, 0, "#c2f055", R.drawable.context_patch_reboot));
                }
                if (!this.f9433.f10061) {
                    arrayList.add(new C3727(R.string.make_app_a_sys, 0, "#cccccc", R.drawable.move_to));
                    arrayList.add(new C3727(R.string.move_to_sys, 0, "#cccccc", R.drawable.move_to));
                }
                try {
                    String str = C2975.m7932().getPackageInfo(this.f9433.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                    if (this.f9433.f10061 && (str.startsWith("/data/app") || str.startsWith("/mnt/") || str.startsWith("/data/priv-app"))) {
                        arrayList.add(new C3727(R.string.integrate_updates_to_system, 0, "#cccccc", R.drawable.move_to));
                    }
                } catch (PackageManager.NameNotFoundException e) {
                    e.printStackTrace();
                }
            }
            try {
                for (File file : new File(C2975.f9251 + "/Backup").listFiles()) {
                    if (file.getName().startsWith(this.f9433.f10046) || file.getName().startsWith(C2500.m6873(this.f9433.f10047))) {
                        z = true;
                        break;
                    }
                }
            } catch (Exception unused) {
                C2975.m7942("LuckyPatcher error: backup files or directory not found!");
            }
            z = false;
            boolean m7198 = new C2500().m7198(new File(C2975.f9251 + "/Backup/Data/" + this.f9433.f10046), ".lpbkp");
            if (z || m7198) {
                if (z) {
                    arrayList.add(new C3727(R.string.contextrestore, 0, "#cccccc", R.drawable.context_restore));
                } else if (C2975.f9283 && m7198) {
                    arrayList.add(new C3727(R.string.contextrestore, 0, "#cccccc", R.drawable.context_restore));
                }
            }
            arrayList.add(new C3727(R.string.contextbackup, 0, "#cccccc", R.drawable.context_backup));
            if (C2975.f9283) {
                arrayList.add(new C3727(R.string.context_dexopt_app, 0, "#ffffbb", R.drawable.context_odex));
            }
            C3478 c3478 = this.f9433;
            boolean z2 = c3478.f10061;
            if ((!z2 && C2975.f9283) || (z2 && c3478.f10067.startsWith("/data/app/"))) {
                arrayList.add(new C3727(R.string.contextreinstall, 0, "#9999cc", R.drawable.context_deodex));
            }
            if (this.f9433.f10062 && C2975.f9283) {
                arrayList.add(new C3727(R.string.contextdeodex, 0, "#9999cc", R.drawable.context_deodex));
            }
            if (C2975.f9283) {
                arrayList.add(new C3727(R.string.context_files_observer, 0, "#cccccc", R.drawable.context_permissions));
            }
            arrayList.add(new C3727(R.string.open_to_GP, 0, "#cccccc", R.drawable.run));
            arrayList.add(new C3727(R.string.share_this_app, 0, "#cccccc", R.drawable.context_share));
            C2975.m7954(new RunnableC2977(arrayList));
        }
    }

    public class RunnableC2980 implements Runnable {
        RunnableC2980() {
        }

        @Override
        public void run() {
            C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_message_for_share_app));
        }
    }

    public class DialogInterfaceOnClickListenerC2981 implements DialogInterface.OnClickListener {

        final C2939 f9439;

        class RunnableC2982 implements Runnable {

            final String f9441;

            class RunnableC2983 implements Runnable {
                RunnableC2983() {
                }

                @Override
                public void run() {
                    C2975.m7951(11);
                    C2975.m7962(C2975.this.m1869(R.string.warning), C2975.this.m1869(R.string.error_apk_to_system));
                }
            }

            class RunnableC2984 implements Runnable {
                RunnableC2984() {
                }

                @Override
                public void run() {
                    String str = C2975.f9284 + C1637.class.getName() + " " + RunnableC2982.this.f9441 + " '" + DialogInterfaceOnClickListenerC2981.this.f9439.f9156.getAbsolutePath() + "' " + C2975.this.f9431 + " " + C2975.f9250 + " " + Build.CPU_ABI + " armeabi " + C2975.f9402 + " " + C2975.f9403 + " " + C2975.f9401 + "\n";
                    C2975.m7942(str);
                    RunnableC2982 runnableC2982 = RunnableC2982.this;
                    C2975.this.m7939(runnableC2982.f9441, str, C2975.f9401);
                }
            }

            RunnableC2982(String str) {
                this.f9441 = str;
            }

            @Override
            public void run() {
                String str;
                C2500.m6970();
                try {
                    str = C2975.m7932().getPackageInfo(this.f9441, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                    C2975 c2975 = C2975.this;
                    c2975.f9431 = "empty";
                    c2975.f9431 = C2975.m7932().getPackageInfo(this.f9441, ItemType.CLASS_DATA_ITEM).applicationInfo.dataDir;
                } catch (PackageManager.NameNotFoundException unused) {
                }
                if (str.equals(DialogInterfaceOnClickListenerC2981.this.f9439.f9156.getAbsoluteFile().toString().trim())) {
                    C2975.m7954(new RunnableC2983());
                    return;
                }
                if (!str.startsWith("/system/")) {
                    new C2500("").m7211("pm clear " + this.f9441);
                    new C2500("").m7211("pm uninstall " + this.f9441);
                    new C2500("w").m7212(6000L);
                }
                C2975.f9402 = C2500.m7169(C2500.m6973(this.f9441, true));
                C2975.m7942("sys:" + C2975.f9402);
                C2975.f9403 = C2500.m7092(C1632.class, this.f9441).replaceAll("\n", "");
                C2975.m7942("magisk:" + C2975.f9403);
                C2975.m7954(new RunnableC2984());
            }
        }

        DialogInterfaceOnClickListenerC2981(C2939 c2939) {
            this.f9439 = c2939;
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            if (i != -2) {
                if (i == -1) {
                    C2975.this.f9431 = "empty";
                    C2975.m7956(new RunnableC2982(this.f9439.f9151));
                    C2975.f9282 = "";
                    return;
                }
                return;
            }
            C2975.f9282 = "";
        }
    }

    public class C2985 implements CompoundButton.OnCheckedChangeListener {
        C2985() {
        }

        @Override
        public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
            C2975.f9401 = z;
        }
    }

    class RunnableC2986 implements Runnable {

        final String f9446;

        final C2939 f9447;

        class RunnableC2987 implements Runnable {

            class RunnableC2988 implements Runnable {

                final String f9450;

                final String f9451;

                class RunnableC2989 implements Runnable {
                    RunnableC2989() {
                    }

                    @Override
                    public void run() {
                        C2975 c2975 = C2975.this;
                        c2975.m7963(c2975.mo1874(), C2500.m7007(R.string.warning), C2500.m7007(R.string.no_space_in_system));
                        C2975.m7951(11);
                    }
                }

                class RunnableC2990 implements Runnable {

                    final String f9454;

                    final String f9455;

                    RunnableC2990(String str, String str2) {
                        this.f9454 = str;
                        this.f9455 = str2;
                    }

                    @Override
                    public void run() {
                        try {
                            File m6947 = C2500.m6947(this.f9454 + this.f9455 + ".apk");
                            if (m6947 != null) {
                                C2500.m7093("rm " + m6947.getAbsolutePath());
                                C2975.m7942("LuckyPatcher: dalvik-cache deleted.");
                            }
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                }

                class RunnableC2991 implements Runnable {
                    RunnableC2991() {
                    }

                    @Override
                    public void run() {
                        C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.unknown_error));
                        C3549.m8192();
                    }
                }

                class RunnableC2992 implements Runnable {

                    class DialogInterfaceOnClickListenerC2993 implements DialogInterface.OnClickListener {
                        DialogInterfaceOnClickListenerC2993() {
                        }

                        @Override
                        public void onClick(DialogInterface dialogInterface, int i) {
                            if (RunnableC2986.this.f9447.f9156.getAbsolutePath().contains("/files/p.apk")) {
                                if (C2500.m6947("/system/framework/core.jar") != null && !C2500.m6935().equals("ART")) {
                                    C2975.f9318 = true;
                                } else {
                                    C2975.f9318 = false;
                                }
                                C2975.f9320 = true;
                                C2975.this.m8002("_patch1");
                                return;
                            }
                            if (RunnableC2986.this.f9447.f9156.getName().contains("mod.")) {
                                if (C2500.m6947("/system/framework/core.jar") != null && !C2500.m6935().equals("ART")) {
                                    C2975.f9318 = true;
                                } else if (C2975.f9299 >= 20 && C2500.m6935().equals("ART") && C2500.m7031()) {
                                    C2975.f9318 = true;
                                } else {
                                    C2975.f9318 = false;
                                }
                                C2975.f9320 = true;
                                C2975.this.m8002("_patch1_patch2");
                            }
                        }
                    }

                    RunnableC2992() {
                    }

                    @Override
                    public void run() {
                        C2500.m7125(C2500.m7007(R.string.warning), C2500.m7007(R.string.final_market_message), new DialogInterfaceOnClickListenerC2993(), null, null);
                        C3549.m8192();
                    }
                }

                class DialogInterfaceOnClickListenerC2994 implements DialogInterface.OnClickListener {
                    DialogInterfaceOnClickListenerC2994() {
                    }

                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        C2500.m7073();
                    }
                }

                RunnableC2988(String str, String str2) {
                    this.f9450 = str;
                    this.f9451 = str2;
                }

                @Override
                public void run() {
                    String str = "";
                    try {
                        String str2 = this.f9450;
                        C2500.m7053(str2);
                        if (!C2975.f9401) {
                            C2500.m7078("/system", InternalZipConstants.WRITE_MODE);
                        }
                        C2975.m7942("root code start");
                        C3549.m8183();
                        String m7211 = new C2500("").m7211(this.f9451);
                        C2975.m7942("" + m7211);
                        if (m7211.contains("In /system space not found!")) {
                            C2975.m7954(new RunnableC2989());
                            return;
                        }
                        if (C2975.f9401) {
                            str = C2500.m6970();
                        }
                        String str3 = str + "/system/app/";
                        try {
                            if (new File(str + "/system/priv-app").exists()) {
                                if (new File(str + "/system/priv-app").list() != null) {
                                    str3 = str + "/system/priv-app/";
                                }
                            }
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                        if (C2975.f9299 >= 21) {
                            str3 = str + "/system/priv-app/" + RunnableC2986.this.f9446 + InternalZipConstants.ZIP_FILE_SEPARATOR;
                        }
                        C2500.m7093("chmod 0644 " + str3 + str2 + ".apk");
                        C2500.m7093("chown 0.0 " + str3 + str2 + ".apk");
                        C2500.m7093("chown 0:0 " + str3 + str2 + ".apk");
                        if (!C2500.m6935().contains("ART")) {
                            C2975.m7954(new RunnableC2990(str3, str2));
                        }
                        if ((RunnableC2986.this.f9447.f9156.getName().contains("mod.") || RunnableC2986.this.f9447.f9156.getAbsolutePath().contains("/files/p.apk")) && !C2500.m7182()) {
                            C2975.m7954(new RunnableC2992());
                        } else {
                            C2500.m7125(C2500.m7007(R.string.information), C2500.m7007(R.string.reboot_after_install_google_play_to_system_partition), new DialogInterfaceOnClickListenerC2994(), null, null);
                        }
                    } catch (Exception e2) {
                        C2975.m7942("Move to system " + e2);
                        e2.printStackTrace();
                        C2975.m7954(new RunnableC2991());
                    }
                }
            }

            RunnableC2987() {
            }

            @Override
            public void run() {
                C2975.m7942("useMagiskModule " + C2975.f9401);
                String str = C2975.f9284 + C1637.class.getName() + " " + RunnableC2986.this.f9446 + " '" + RunnableC2986.this.f9447.f9156.getAbsolutePath() + "' " + C2975.this.f9431 + " " + C2975.f9250 + " " + Build.CPU_ABI + " armeabi " + C2975.f9402 + " " + C2975.f9403 + " " + C2975.f9401 + "\n";
                if (RunnableC2986.this.f9447.f9156.exists() && C2975.m7966(false)) {
                    C2975.m7942(str);
                    Thread thread = new Thread(new RunnableC2988(RunnableC2986.this.f9446, str));
                    thread.setPriority(10);
                    thread.start();
                    return;
                }
                C3549.m8192();
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.apk_not_found_error));
            }
        }

        RunnableC2986(String str, C2939 c2939) {
            this.f9446 = str;
            this.f9447 = c2939;
        }

        @Override
        public void run() {
            if (!C2500.m6898("/system/framework/core.jar.jex") && !C2500.m6898("/system/framework/core-libart.jar.jex") && !C2500.m6898("/system/framework/services.jar.jex")) {
                C2500.m6970();
                try {
                    String str = C2975.m7932().getPackageInfo(this.f9446, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                    C2975 c2975 = C2975.this;
                    c2975.f9431 = "empty";
                    c2975.f9431 = C2975.m7932().getPackageInfo(this.f9446, ItemType.CLASS_DATA_ITEM).applicationInfo.dataDir;
                    if (!str.startsWith("/system/")) {
                        new C2500("").m7211("pm clear " + this.f9446);
                        new C2500("").m7211("pm uninstall " + this.f9446);
                        new C2500("w").m7212(6000L);
                    }
                } catch (PackageManager.NameNotFoundException unused) {
                }
                C2975.f9402 = C2500.m7169(C2500.m6973(this.f9446, true));
                C2975.m7942("sys:" + C2975.f9402);
                C2975.f9403 = C2500.m7092(C1632.class, this.f9446).replaceAll("\n", "");
                C2975.m7942("magisk:" + C2975.f9403);
                if (C2975.f9339) {
                    new C2500("").m7211("pm clear " + this.f9446);
                    new C2500("").m7211("pm clear com.google.android.gms");
                    try {
                        new C2500("").m7211(C2975.f9284 + C1664.class.getName() + " " + C2975.m7932().getPackageInfo("com.google.android.gms", ItemType.CLASS_DATA_ITEM).applicationInfo.dataDir + "\n");
                    } catch (Throwable unused2) {
                    }
                }
                C2975.m7954(new RunnableC2987());
                return;
            }
            C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.warning_jex_optimised_firmware));
        }
    }

    public class RunnableC2995 implements Runnable {
        RunnableC2995() {
        }

        @Override
        public void run() {
            Toast.makeText(C2975.this.mo1874(), "SDCard mounted:\n" + C2975.f9251.replace("/LuckyPatcher", ""), 0).show();
        }
    }

    public class RunnableC2996 implements Runnable {
        RunnableC2996() {
        }

        @Override
        public void run() {
            C2975.m7960(11);
            C2975.f9276.m8238(true);
            C2975.f9276.m8239(C2500.m7007(R.string.wait));
        }
    }

    public class RunnableC2997 implements Runnable {

        final C3478 f9462;

        RunnableC2997(C3478 c3478) {
            this.f9462 = c3478;
        }

        @Override
        public void run() {
            C2975.m7951(11);
            C2975.m7964(C2975.f9259, this.f9462.f10047, C2500.m7007(R.string.integrate_updates_result) + ": " + C2500.m7007(R.string.no_space_in_system_all));
        }
    }

    public class RunnableC2998 implements Runnable {

        final C3478 f9463;

        RunnableC2998(C3478 c3478) {
            this.f9463 = c3478;
        }

        @Override
        public void run() {
            C2975.m7951(11);
            C2975.m7965(this.f9463.f10047, C2500.m7007(R.string.integrate_updates_result) + ": " + C2500.m7007(R.string.unknown_error));
        }
    }

    public class RunnableC2999 implements Runnable {

        final C3478 f9464;

        class DialogInterfaceOnClickListenerC3000 implements DialogInterface.OnClickListener {
            DialogInterfaceOnClickListenerC3000() {
            }

            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                C2500.m7073();
            }
        }

        RunnableC2999(C3478 c3478) {
            this.f9464 = c3478;
        }

        @Override
        public void run() {
            C2975.m7951(11);
            C2500.m7125(this.f9464.f10047, C2500.m7007(R.string.integrate_updates_result) + ": " + C2500.m7007(R.string.well_done) + " " + C2500.m7007(R.string.integrate_updates_result_message) + " " + C2500.m7007(R.string.message_to_reboot_device), new DialogInterfaceOnClickListenerC3000(), null, null);
        }
    }

    public class RunnableC3001 implements Runnable {

        final C3478 f9466;

        RunnableC3001(C3478 c3478) {
            this.f9466 = c3478;
        }

        @Override
        public void run() {
            C2975.m7951(11);
            C2975.m7964(C2975.f9259, this.f9466.f10047, C2500.m7007(R.string.integrate_updates_result) + ": " + C2500.m7007(R.string.no_space_in_system_all));
        }
    }

    public class RunnableC3002 implements Runnable {

        final C3478 f9467;

        RunnableC3002(C3478 c3478) {
            this.f9467 = c3478;
        }

        @Override
        public void run() {
            C2975.m7951(11);
            C2975.m7964(C2975.f9259, this.f9467.f10047, C2500.m7007(R.string.integrate_updates_result) + ": " + C2500.m7007(R.string.no_space_in_system_all));
        }
    }

    public class RunnableC3003 implements Runnable {

        final C3478 f9468;

        RunnableC3003(C3478 c3478) {
            this.f9468 = c3478;
        }

        @Override
        public void run() {
            C2975.m7951(11);
            C2975.m7965(this.f9468.f10047, C2500.m7007(R.string.integrate_updates_result) + ": " + C2500.m7007(R.string.unknown_error));
        }
    }

    public class RunnableC3004 implements Runnable {

        final C3478 f9469;

        RunnableC3004(C3478 c3478) {
            this.f9469 = c3478;
        }

        @Override
        public void run() {
            C2975.m7951(11);
            C2500.m7130(C2975.f9259, this.f9469.f10047, C2500.m7007(R.string.integrate_updates_result) + ": " + C2500.m7007(R.string.well_done));
        }
    }

    public class RunnableC3005 implements Runnable {

        final C3478 f9470;

        RunnableC3005(C3478 c3478) {
            this.f9470 = c3478;
        }

        @Override
        public void run() {
            C2975.m7951(11);
            C2500.m7130(C2975.f9259, this.f9470.f10047, C2500.m7007(R.string.integrate_updates_result) + ": " + C2500.m7007(R.string.well_done));
        }
    }

    public class RunnableC3006 implements Runnable {

        class RunnableC3007 implements Runnable {
            RunnableC3007() {
            }

            @Override
            public void run() {
                C2975.m7951(11);
            }
        }

        RunnableC3006() {
        }

        @Override
        public void run() {
            C2975.m7955(new RunnableC3007());
        }
    }

    public class RunnableC3008 implements Runnable {
        RunnableC3008() {
        }

        @Override
        public void run() {
            Toast.makeText(C2975.this.mo1874(), C2500.m7007(R.string.not_detect), 0).show();
        }
    }

    public class RunnableC3009 implements Runnable {

        final String f9473;

        class DialogInterfaceOnClickListenerC3010 implements DialogInterface.OnClickListener {
            DialogInterfaceOnClickListenerC3010() {
            }

            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                C2500.m7073();
            }
        }

        RunnableC3009(String str) {
            this.f9473 = str;
        }

        @Override
        public void run() {
            C2975.m7951(11);
            C2500.m7125(C2500.m7007(R.string.integrate_updates_result), this.f9473, new DialogInterfaceOnClickListenerC3010(), null, null);
        }
    }

    public class RunnableC3011 implements Runnable {
        RunnableC3011() {
        }

        @Override
        public void run() {
            C2975.m7951(6);
        }
    }

    public class C3012 extends C2931<C3477> {

        class C3013 extends Filter {
            C3013() {
            }

            @Override
            protected Filter.FilterResults performFiltering(CharSequence charSequence) {
                Filter.FilterResults filterResults = new Filter.FilterResults();
                ArrayList arrayList = new ArrayList();
                C3012 c3012 = C3012.this;
                if (c3012.f9124 == null) {
                    c3012.f9124 = c3012.f9122;
                }
                if (charSequence != null) {
                    List<Object> list = c3012.f9124;
                    if (list != 0 && list.size() > 0) {
                        for (Object object : C3012.this.f9124) {
                            if (object.f10044.toLowerCase().contains(charSequence.toString().toLowerCase())) {
                                arrayList.add(object);
                            }
                        }
                    }
                    arrayList.toArray(new C3477[arrayList.size()]);
                    filterResults.values = arrayList;
                }
                return filterResults;
            }

            @Override
            protected void publishResults(CharSequence charSequence, Filter.FilterResults filterResults) {
                C3012 c3012 = C3012.this;
                c3012.f9122 = (List) filterResults.values;
                c3012.notifyDataSetChanged();
            }
        }

        C3012(Context context, int i, List list) {
            super(context, i, list);
        }

        @Override
        public Filter getFilter() {
            return new C3013();
        }

        @Override
        public View getView(int i, View view, ViewGroup viewGroup) {
            String m7007;
            View view2 = super.getView(i, view, viewGroup);
            TextView textView = (TextView) view2.findViewById(R.id.conttext);
            textView.setTextAppearance(getContext(), C2975.m7934());
            textView.setCompoundDrawablePadding((int) ((C2975.m7933().getDisplayMetrics().density * 5.0f) + 0.5f));
            String str = getItem(i).f10044.replace("disabled_", "").replace("chelpa_per_", "").replace("chelpus_", "").replace("android.permission.", "").replace("com.android.vending.", "") + "\n";
            if (getItem(i).f10045) {
                textView.setText(C2500.m6934(str, "#ff00ffff", "bold"));
                if (C2500.m7026(getItem(i).f10044)) {
                    textView.setText(C2500.m6934(str, "#ffffff00", "bold"));
                }
            } else {
                textView.setText(C2500.m6934(str, "#ffff0000", "bold"));
            }
            if (C2500.m7026(getItem(i).f10044)) {
                m7007 = C2500.m7007(R.string.activity_ads_descr);
            } else {
                m7007 = C2500.m7007(R.string.activity_descr);
            }
            textView.append(C2500.m6934(m7007, "#ff888888", "italic"));
            return view2;
        }
    }

    public class C3014 implements Comparator<C3477> {
        C3014() {
        }

        @Override
        public int compare(C3477 c3477, C3477 c34772) {
            if (c3477 != null && c34772 != null) {
                if (C2500.m7026(c3477.f10044) && !C2500.m7026(c34772.f10044)) {
                    return -1;
                }
                if (!C2500.m7026(c3477.f10044) && C2500.m7026(c34772.f10044)) {
                    return 1;
                }
                if (C2500.m7026(c3477.f10044) && C2500.m7026(c34772.f10044)) {
                    return c3477.f10044.compareTo(c34772.f10044);
                }
                return 0;
            }
            throw new ClassCastException();
        }
    }

    public class C3015 extends C2931<C2935> {

        class C3016 extends Filter {
            C3016() {
            }

            @Override
            protected Filter.FilterResults performFiltering(CharSequence charSequence) {
                Filter.FilterResults filterResults = new Filter.FilterResults();
                ArrayList arrayList = new ArrayList();
                C3015 c3015 = C3015.this;
                if (c3015.f9124 == null) {
                    c3015.f9124 = c3015.f9122;
                }
                if (charSequence != null) {
                    List<Object> list = c3015.f9124;
                    if (list != 0 && list.size() > 0) {
                        for (Object object : C3015.this.f9124) {
                            if (object.f9143 || object.f9136.toLowerCase().contains(charSequence.toString().toLowerCase())) {
                                arrayList.add(object);
                            }
                        }
                    }
                    arrayList.toArray(new C2935[arrayList.size()]);
                    filterResults.values = arrayList;
                }
                return filterResults;
            }

            @Override
            protected void publishResults(CharSequence charSequence, Filter.FilterResults filterResults) {
                C3015 c3015 = C3015.this;
                c3015.f9122 = (List) filterResults.values;
                c3015.notifyDataSetChanged();
            }
        }

        C3015(Context context, int i, List list) {
            super(context, i, list);
        }

        @Override
        public Filter getFilter() {
            return new C3016();
        }

        @Override
        public View getView(int i, View view, ViewGroup viewGroup) {
            String m7007;
            View inflate = ((LayoutInflater) C2975.m7929().getSystemService("layout_inflater")).inflate(R.layout.contextmenu, viewGroup, false);
            TextView textView = (TextView) inflate.findViewById(R.id.conttext);
            textView.setTextAppearance(getContext(), C2975.m7934());
            textView.setCompoundDrawablePadding((int) ((C2975.m7933().getDisplayMetrics().density * 5.0f) + 0.5f));
            if (getItem(i).f9143) {
                textView.setText(C2500.m6934(getItem(i).f9136, "#ffffffff", "bold"));
                inflate.setBackgroundColor(-12303292);
            } else {
                if (getItem(i).f9139) {
                    String str = getItem(i).f9136 + "\n";
                    if (getItem(i).f9137) {
                        textView.setText(C2500.m6934(str, "#ff00ffff", "bold"));
                        if (C2500.m7026(getItem(i).f9136)) {
                            textView.setText(C2500.m6934(str, "#ffffff00", "bold"));
                        }
                    } else {
                        textView.setText(C2500.m6934(str, "#ffff0000", "bold"));
                    }
                    if (C2500.m7026(getItem(i).f9136)) {
                        m7007 = C2500.m7007(R.string.activity_ads_descr);
                    } else {
                        m7007 = C2500.m7007(R.string.activity_descr);
                    }
                    textView.append(C2500.m6934(m7007, "#ff888888", "italic"));
                }
                if (getItem(i).f9138) {
                    String str2 = getItem(i).f9136 + "\n";
                    if (getItem(i).f9137) {
                        textView.setText(C2500.m6934(str2, "#ff00ff00", "bold"));
                    } else {
                        textView.setText(C2500.m6934(str2, "#ffff0000", "bold"));
                    }
                    PackageManager m7932 = C2975.m7932();
                    try {
                        String charSequence = m7932.getPermissionInfo(getItem(i).f9136.replace("chelpa_per_", "").replace("chelpus_", ""), 0).loadDescription(m7932).toString();
                        if (charSequence == null) {
                            textView.append(C2500.m6934(C2500.m7007(R.string.permission_not_descr), "#ff888888", "italic"));
                        } else {
                            textView.append(C2500.m6934(charSequence, "#ff888888", "italic"));
                        }
                    } catch (PackageManager.NameNotFoundException unused) {
                        textView.append(C2500.m6934(C2500.m7007(R.string.permission_not_descr), "#ff888888", "italic"));
                    } catch (NullPointerException unused2) {
                        textView.append(C2500.m6934(C2500.m7007(R.string.permission_not_descr), "#ff888888", "italic"));
                    }
                }
                if (getItem(i).f9141) {
                    String str3 = getItem(i).f9136 + "\n";
                    if (getItem(i).f9137) {
                        textView.setText(C2500.m6934(str3, "#ff00ff00", "bold"));
                    } else {
                        textView.setText(C2500.m6934(str3, "#ffff0000", "bold"));
                    }
                }
                if (getItem(i).f9142) {
                    String str4 = getItem(i).f9136 + "\n";
                    if (getItem(i).f9137) {
                        textView.setText(C2500.m6934(str4, "#ff00ffff", "bold"));
                    } else {
                        textView.setText(C2500.m6934(str4, "#ffff0000", "bold"));
                    }
                }
                if (getItem(i).f9140) {
                    String str5 = getItem(i).f9136 + "\n";
                    if (getItem(i).f9137) {
                        textView.setText(C2500.m6934(str5, "#ff00ff00", "bold"));
                    } else {
                        textView.setText(C2500.m6934(str5, "#ffff0000", "bold"));
                    }
                }
            }
            return inflate;
        }
    }

    public class RunnableC3017 implements Runnable {
        RunnableC3017() {
        }

        @Override
        public void run() {
            Toast.makeText(C2975.this.mo1874(), C2500.m7007(R.string.not_detect), 0).show();
        }
    }

    public class DialogInterfaceOnClickListenerC3018 implements DialogInterface.OnClickListener {

        class RunnableC3019 implements Runnable {
            RunnableC3019() {
            }

            @Override
            public void run() {
                C2500.m7092(C1563.class, "");
                C2500.m7073();
            }
        }

        DialogInterfaceOnClickListenerC3018() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            new Thread(new RunnableC3019()).start();
        }
    }

    public class RunnableC3020 implements Runnable {

        final String f9483;

        final String f9484;

        RunnableC3020(String str, String str2) {
            this.f9483 = str;
            this.f9484 = str2;
        }

        @Override
        public void run() {
            C2913 c2913 = new C2913(C2975.f9259);
            c2913.m7860(this.f9483);
            c2913.m7876(this.f9484);
            c2913.m7873(R.string.ok, null);
            try {
                C2500.m7117(c2913.m7851());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    public class RunnableC3021 implements Runnable {

        final boolean f9485;

        class RunnableC3022 implements Runnable {
            RunnableC3022() {
            }

            @Override
            public void run() {
                if (C2975.f9252 != null && C2975.f9245 != null) {
                    Collections.sort(C2975.f9332, C2975.f9245.m7935());
                    C2975.f9252.f10079 = new C3478[C2975.f9332.size()];
                    C2975.f9252.f10079 = (C3478[]) C2975.f9332.toArray(C2975.f9252.f10079);
                    C2975.f9252.m8121();
                    C2975.f9252.notifyDataSetChanged();
                }
            }
        }

        RunnableC3021(boolean z) {
            this.f9485 = z;
        }

        @Override
        public void run() {
            try {
                long currentTimeMillis = System.currentTimeMillis();
                if (this.f9485) {
                    C2975.m7942("LuckyPatcher: fast scan at start.");
                    Iterator<C3478> it = C2975.f9332.iterator();
                    while (it.hasNext()) {
                        C3478 next = it.next();
                        if (C2500.m7028(next)) {
                            C2975.m7942("update PkgListItem for " + next.f10047);
                            C3479 c3479 = C2975.f9252;
                            if (c3479 != null) {
                                c3479.m8123(next.f10046);
                            }
                        }
                    }
                } else {
                    C2975.m7942("LuckyPatcher: full scan at start.");
                    if (C2975.f9249 == null) {
                        C2975.f9249 = new C2938(C2975.m7929());
                    }
                    C2975.f9332 = C2975.f9249.m7893(false, false, true);
                    C2975.m7954(new RunnableC3022());
                }
                C2975.f9281 = false;
                C2975.m7942("Lucky Patcher: time refresh apps is " + (System.currentTimeMillis() - currentTimeMillis));
            } catch (Throwable th) {
                th.printStackTrace();
                C2975.f9281 = false;
            }
        }
    }

    public class RunnableC3023 implements Runnable {

        final String f9487;

        final String f9488;

        final String f9489;

        final boolean f9490;

        class RunnableC3024 implements Runnable {
            RunnableC3024() {
            }

            @Override
            public void run() {
                try {
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_odex_app_impossible));
                } catch (Exception unused) {
                }
            }
        }

        class RunnableC3025 implements Runnable {

            final Exception f9493;

            RunnableC3025(Exception exc) {
                this.f9493 = exc;
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.warning), this.f9493.toString());
                C2975.m7951(11);
            }
        }

        RunnableC3023(String str, String str2, String str3, boolean z) {
            this.f9487 = str;
            this.f9488 = str2;
            this.f9489 = str3;
            this.f9490 = z;
        }

        @Override
        public void run() {
            String str;
            String str2;
            try {
                String absolutePath = C2975.this.mo1874().getFilesDir().getAbsolutePath();
                String m6965 = C2500.m6965(this.f9487, this.f9488);
                if (!this.f9487.startsWith("/system/")) {
                    str = String.valueOf(C2975.m7932().getPackageInfo(this.f9489, ItemType.CLASS_DATA_ITEM).applicationInfo.uid);
                } else {
                    str = "0";
                }
                C2500.m7078(this.f9487, InternalZipConstants.WRITE_MODE);
                if (new File(m6965).exists()) {
                    new File(m6965).delete();
                    C2500.m7093("rm " + m6965);
                }
                if (new File(m6965).exists()) {
                    C2975.m7942("Ne udalos udalit");
                }
                C2500.m7053(this.f9489);
                C2500.m6891();
                C2500.m7093("chown 0.0 " + absolutePath + "/dexopt-wrapper");
                C2500.m7093("chown 0:0 " + absolutePath + "/dexopt-wrapper");
                C2500.m7093("chmod 777 " + absolutePath + "/dexopt-wrapper");
                if (this.f9490) {
                    str2 = "splitted";
                } else {
                    str2 = "no_split";
                }
                String m7211 = new C2500("").m7211(C2975.f9284 + C1553.class.getName() + " " + this.f9487 + " " + str + " " + C2500.m6935() + " " + str2);
                C2975.m7942(m7211);
                if (m7211.contains("chelpus_return_1") || m7211.contains("chelpus_return_4")) {
                    new File(m6965).delete();
                    C2500.m7093("rm " + m6965);
                    C2975.m7951(11);
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_odex_app));
                }
                if (m7211.contains("chelpus_return_10")) {
                    C2975.m7951(11);
                    C2975.m7954(new RunnableC3024());
                }
                if (!this.f9487.startsWith("/system/")) {
                    C2500.m7093("chmod 0644 " + m6965);
                    C2500.m7093("chown 1000." + str + " " + m6965);
                    C2500.m7093("chown 1000:" + str + " " + m6965);
                } else {
                    C2500.m7093("chmod 0644 " + m6965);
                    C2500.m7093("chown 0.0 " + m6965);
                    C2500.m7093("chown 0:0 " + m6965);
                }
            } catch (Exception e) {
                e.printStackTrace();
                C2975.m7954(new RunnableC3025(e));
            }
            C2975.f9252.m8123(this.f9489);
            C2975.m7951(11);
        }
    }

    public class RunnableC3026 implements Runnable {

        final Integer f9495;

        RunnableC3026(Integer num) {
            this.f9495 = num;
        }

        @Override
        public void run() {
            try {
                int intValue = this.f9495.intValue();
                if (intValue != 1) {
                    if (intValue != 2) {
                        if (intValue != 6) {
                            if (intValue != 7) {
                                if (intValue != 11) {
                                    if (intValue != 23) {
                                        if (intValue != 25) {
                                            if (intValue != 30) {
                                                if (intValue != 38) {
                                                    if (intValue != 40) {
                                                        if (intValue != 41) {
                                                            C2975.m7942("dialog " + this.f9495);
                                                            C3506 c3506 = C2975.f9410;
                                                            if (c3506 != null) {
                                                                if (c3506.m8145()) {
                                                                    C2975.f9410.m8144();
                                                                }
                                                                C2975.f9410 = null;
                                                            }
                                                            C2975.f9410 = new C3506();
                                                            C2975.f9244 = this.f9495.intValue();
                                                            C2975.f9410.f10137 = this.f9495.intValue();
                                                            C2975.f9410.m8147();
                                                            return;
                                                        }
                                                        C3746 c3746 = C2975.f9278;
                                                        if (c3746 != null) {
                                                            c3746.m8242();
                                                            C2975.f9278 = null;
                                                            C3746 m8241 = C3746.m8241();
                                                            C2975.f9278 = m8241;
                                                            m8241.m8252();
                                                            return;
                                                        }
                                                        C3746 m82412 = C3746.m8241();
                                                        C2975.f9278 = m82412;
                                                        m82412.m8252();
                                                        return;
                                                    }
                                                    C3702 c3702 = C2975.f9406;
                                                    if (c3702 != null) {
                                                        c3702.m8211();
                                                        C2975.f9406 = null;
                                                    }
                                                    C3702 c37022 = new C3702();
                                                    C2975.f9406 = c37022;
                                                    c37022.m8213();
                                                    return;
                                                }
                                                C3733 c3733 = C2975.f9408;
                                                if (c3733 != null) {
                                                    c3733.m8222();
                                                    C2975.f9408 = null;
                                                }
                                                C3733 c37332 = new C3733();
                                                C2975.f9408 = c37332;
                                                c37332.m8224();
                                                return;
                                            }
                                            C3705 c3705 = C2975.f9409;
                                            if (c3705 != null) {
                                                c3705.m8214();
                                                C2975.f9409 = null;
                                            }
                                            C3705 c37052 = new C3705();
                                            C2975.f9409 = c37052;
                                            c37052.m8216();
                                            return;
                                        }
                                        C3746 c37462 = C2975.f9277;
                                        if (c37462 != null) {
                                            c37462.m8242();
                                            C2975.f9277 = null;
                                            C3746 m82413 = C3746.m8241();
                                            C2975.f9277 = m82413;
                                            m82413.f10540 = true;
                                            m82413.m8252();
                                            return;
                                        }
                                        C3746 m82414 = C3746.m8241();
                                        C2975.f9277 = m82414;
                                        m82414.f10540 = true;
                                        m82414.m8252();
                                        return;
                                    }
                                    C3746 c37463 = C2975.f9277;
                                    if (c37463 != null) {
                                        c37463.m8242();
                                        C2975.f9277 = null;
                                        C3746 m82415 = C3746.m8241();
                                        C2975.f9277 = m82415;
                                        m82415.f10540 = false;
                                        m82415.m8252();
                                        return;
                                    }
                                    C3746 m82416 = C3746.m8241();
                                    C2975.f9277 = m82416;
                                    m82416.f10540 = false;
                                    m82416.m8252();
                                    return;
                                }
                                C3743 c3743 = C2975.f9276;
                                if (c3743 != null) {
                                    c3743.m8235();
                                    C2975.f9276 = null;
                                    C3743 m8234 = C3743.m8234();
                                    C2975.f9276 = m8234;
                                    m8234.m8240();
                                    return;
                                }
                                C3743 m82342 = C3743.m8234();
                                C2975.f9276 = m82342;
                                m82342.m8240();
                                return;
                            }
                            C3730 c3730 = C2975.f9407;
                            if (c3730 != null) {
                                c3730.m8219();
                                C2975.f9407 = null;
                            }
                            C3730 c37302 = new C3730();
                            C2975.f9407 = c37302;
                            c37302.m8221();
                            return;
                        }
                        C3538 c3538 = C2975.f9404;
                        if (c3538 != null) {
                            c3538.m8151();
                            C2975.f9404 = null;
                        }
                        C3538 c35382 = new C3538();
                        C2975.f9404 = c35382;
                        c35382.m8153();
                        return;
                    }
                    C3737 c3737 = C2975.f9405;
                    if (c3737 != null) {
                        c3737.m8225();
                        C2975.f9405 = null;
                    }
                    C3737 c37372 = new C3737();
                    C2975.f9405 = c37372;
                    c37372.m8227();
                    return;
                }
                C3740 c3740 = C2975.f9275;
                if (c3740 != null) {
                    c3740.m8229();
                    C2975.f9275 = null;
                    C3740 m8228 = C3740.m8228();
                    C2975.f9275 = m8228;
                    m8228.m8233();
                    return;
                }
                C3740 m82282 = C3740.m8228();
                C2975.f9275 = m82282;
                m82282.m8233();
            } catch (RuntimeException e) {
                e.printStackTrace();
            } catch (Exception e2) {
                e2.printStackTrace();
            }
        }
    }

    public class RunnableC3027 implements Runnable {
        RunnableC3027() {
        }

        @Override
        public void run() {
            C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_message_for_share_app));
        }
    }

    public class RunnableC3028 implements Runnable {

        final Integer f9496;

        RunnableC3028(Integer num) {
            this.f9496 = num;
        }

        @Override
        public void run() {
            try {
                int intValue = this.f9496.intValue();
                if (intValue != 1) {
                    if (intValue != 2) {
                        if (intValue != 6) {
                            if (intValue != 7) {
                                if (intValue != 11) {
                                    if (intValue != 23) {
                                        if (intValue != 30) {
                                            if (intValue != 38) {
                                                if (intValue != 41) {
                                                    C3506 c3506 = C2975.f9410;
                                                    if (c3506 != null) {
                                                        if (c3506.f10137 == this.f9496.intValue()) {
                                                            C2975.f9410.m8144();
                                                        }
                                                        C2975.f9410 = null;
                                                        return;
                                                    }
                                                    return;
                                                }
                                                C3746 c3746 = C2975.f9278;
                                                if (c3746 != null) {
                                                    c3746.m8242();
                                                    C2975.f9278 = null;
                                                    return;
                                                }
                                                return;
                                            }
                                            C3733 c3733 = C2975.f9408;
                                            if (c3733 != null) {
                                                c3733.m8222();
                                                C2975.f9408 = null;
                                                return;
                                            }
                                            return;
                                        }
                                        C3705 c3705 = C2975.f9409;
                                        if (c3705 != null) {
                                            c3705.m8214();
                                            C2975.f9409 = null;
                                            return;
                                        }
                                        return;
                                    }
                                    C3746 c37462 = C2975.f9277;
                                    if (c37462 != null) {
                                        c37462.m8242();
                                        C2975.f9277 = null;
                                        return;
                                    }
                                    return;
                                }
                                C3743 c3743 = C2975.f9276;
                                if (c3743 != null) {
                                    c3743.m8235();
                                    C2975.f9276 = null;
                                    return;
                                }
                                return;
                            }
                            C3730 c3730 = C2975.f9407;
                            if (c3730 != null) {
                                c3730.m8219();
                                C2975.f9407 = null;
                                return;
                            }
                            return;
                        }
                        C3538 c3538 = C2975.f9404;
                        if (c3538 != null) {
                            c3538.m8151();
                            C2975.f9404 = null;
                            return;
                        }
                        return;
                    }
                    C3737 c3737 = C2975.f9405;
                    if (c3737 != null) {
                        c3737.m8225();
                        C2975.f9405 = null;
                        return;
                    }
                    return;
                }
                C3740 c3740 = C2975.f9275;
                if (c3740 != null) {
                    c3740.m8229();
                    C2975.f9275 = null;
                }
            } catch (RuntimeException e) {
                e.printStackTrace();
            } catch (Exception e2) {
                e2.printStackTrace();
            }
        }
    }

    public class RunnableC3029 implements Runnable {

        class RunnableC3030 implements Runnable {
            RunnableC3030() {
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_not_found_storage_lic));
                C2975.f9282 = "";
                C2975.m7951(11);
            }
        }

        class RunnableC3031 implements Runnable {
            RunnableC3031() {
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_not_found_storage_lic));
                C2975.f9282 = "";
                C2975.m7951(11);
            }
        }

        class RunnableC3032 implements Runnable {
            RunnableC3032() {
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_not_found_lic_data));
                C2975.f9282 = "";
                C2975.m7951(11);
            }
        }

        class RunnableC3033 implements Runnable {
            RunnableC3033() {
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_not_found_lic_data));
                C2975.f9282 = "";
                C2975.m7951(11);
            }
        }

        class RunnableC3034 implements Runnable {
            RunnableC3034() {
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.well_done), C2500.m7007(R.string.create_lic_done));
                C2975.f9282 = "";
                C2975.m7951(11);
                try {
                    C2975.f9252.m8115(C2975.f9253.f10046).f10060 = true;
                    C3479 c3479 = C2975.f9252;
                    c3479.m8117(c3479.m8115(C2975.f9253.f10046));
                } catch (Exception e) {
                    e.printStackTrace();
                }
                C2975.m7928().edit().putBoolean(C2975.f9252.m8115(C2975.f9253.f10046).f10046, true).commit();
            }
        }

        RunnableC3029() {
        }

        @Override
        public void run() {
            String str;
            String str2;
            String str3;
            String str4;
            String str5;
            String str6;
            File file;
            File file2;
            String str7;
            String str8;
            String str9;
            String str10;
            String str11;
            String str12;
            String str13;
            String str14;
            String str15;
            String str16;
            boolean z;
            boolean z2;
            boolean z3;
            boolean z4;
            boolean z5;
            Iterator it;
            boolean z6;
            String replace;
            int i;
            String str17;
            int i2;
            String str18;
            int i3;
            int i4;
            int i5;
            String str19;
            int i6;
            int i7;
            int i8;
            String str20;
            int i9;
            int i10;
            int i11;
            boolean z7;
            boolean z8;
            int i12;
            String str21;
            boolean z9;
            MappedByteBuffer map;
            byte[] bArr;
            PackageManager m7932;
            String str22;
            File m6947;
            File file3;
            String str23;
            FileInputStream fileInputStream;
            ZipInputStream zipInputStream;
            ZipEntry nextEntry;
            String str24 = "retryUntil";
            String str25 = "maxRetries";
            String str26 = "retryCount";
            String str27 = "lastResponse";
            String str28 = InternalZipConstants.ZIP_FILE_SEPARATOR;
            ArrayList arrayList = new ArrayList();
            byte[] bArr2 = {0, 3, 1, 0, DerValue.tag_T61String, 0, 0, 0};
            File file4 = C2975.f9367;
            try {
            } catch (PackageManager.NameNotFoundException e) {
                e = e;
                str = "retryUntil";
                str2 = "maxRetries";
                str3 = "retryCount";
                str4 = "validityTimestamp";
                str5 = MediationMetaData.KEY_NAME;
            }
            if (!C2500.m6935().equals("Dalvik")) {
                str4 = "validityTimestamp";
                str5 = MediationMetaData.KEY_NAME;
                try {
                    str23 = C2975.m7932().getPackageInfo(C2975.f9253.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                    try {
                        fileInputStream = new FileInputStream(str23);
                        zipInputStream = new ZipInputStream(fileInputStream);
                        nextEntry = zipInputStream.getNextEntry();
                    } catch (Exception e2) {
                        e = e2;
                        str = str24;
                        str2 = str25;
                        str3 = str26;
                    }
                } catch (PackageManager.NameNotFoundException e3) {
                    e = e3;
                    str = "retryUntil";
                    str2 = "maxRetries";
                    str3 = "retryCount";
                    str6 = "lastResponse";
                    file = null;
                    e.printStackTrace();
                    file2 = file;
                    FileChannel channel = new RandomAccessFile(file2, InternalZipConstants.READ_MODE).getChannel();
                    map = channel.map(FileChannel.MapMode.READ_ONLY, 0L, (int) channel.size());
                    byte[] bArr3 = new byte[20];
                    while (map.hasRemaining()) {
                    }
                    channel.close();
                    if (file2.getAbsolutePath().endsWith("/classes.dex")) {
                    }
                    if (arrayList.size() <= 0) {
                    }
                }
                while (true) {
                    if (nextEntry != null) {
                        String name = nextEntry.getName();
                        str3 = str26;
                        try {
                            str2 = str25;
                            try {
                                if (name.toLowerCase().equals("classes.dex") && !name.contains(InternalZipConstants.ZIP_FILE_SEPARATOR)) {
                                    break;
                                }
                                str = str24;
                                str6 = str27;
                                try {
                                    nextEntry = zipInputStream.getNextEntry();
                                    str26 = str3;
                                    str25 = str2;
                                    str24 = str;
                                    str27 = str6;
                                } catch (Exception e4) {
                                    e = e4;
                                }
                                e = e4;
                            } catch (Exception e5) {
                                e = e5;
                                str = str24;
                            }
                        } catch (Exception e6) {
                            e = e6;
                            str = str24;
                            str2 = str25;
                        }
                        Exception exc = e;
                        file = null;
                        try {
                            try {
                                new ZipFile(str23).extractFile("classes.dex", C2975.f9251);
                                file = new File(C2975.f9251 + "/classes.dex");
                            } catch (PackageManager.NameNotFoundException e7) {
                                e = e7;
                                e.printStackTrace();
                                file2 = file;
                                FileChannel channel2 = new RandomAccessFile(file2, InternalZipConstants.READ_MODE).getChannel();
                                map = channel2.map(FileChannel.MapMode.READ_ONLY, 0L, (int) channel2.size());
                                byte[] bArr32 = new byte[20];
                                while (map.hasRemaining()) {
                                }
                                channel2.close();
                                if (file2.getAbsolutePath().endsWith("/classes.dex")) {
                                }
                                if (arrayList.size() <= 0) {
                                }
                            }
                        } catch (ZipException e8) {
                            C2500.m7103("Error classes.dex decompress! " + e8);
                            C2500.m7103("Exception e1" + exc.toString());
                        } catch (Exception e9) {
                            C2500.m7103("Error classes.dex decompress! " + e9);
                            C2500.m7103("Exception e1" + exc.toString());
                        }
                        C2500.m7103("Exception e" + exc.toString());
                        file2 = file;
                        FileChannel channel22 = new RandomAccessFile(file2, InternalZipConstants.READ_MODE).getChannel();
                        map = channel22.map(FileChannel.MapMode.READ_ONLY, 0L, (int) channel22.size());
                        byte[] bArr322 = new byte[20];
                        while (map.hasRemaining()) {
                        }
                        channel22.close();
                        if (file2.getAbsolutePath().endsWith("/classes.dex")) {
                        }
                        if (arrayList.size() <= 0) {
                        }
                    } else {
                        str = str24;
                        str2 = str25;
                        str3 = str26;
                        str6 = str27;
                        file = null;
                        break;
                    }
                }
                zipInputStream.close();
                fileInputStream.close();
                file2 = file;
                FileChannel channel222 = new RandomAccessFile(file2, InternalZipConstants.READ_MODE).getChannel();
                map = channel222.map(FileChannel.MapMode.READ_ONLY, 0L, (int) channel222.size());
                byte[] bArr3222 = new byte[20];
                while (map.hasRemaining()) {
                }
                channel222.close();
                if (file2.getAbsolutePath().endsWith("/classes.dex")) {
                }
                if (arrayList.size() <= 0) {
                }
            } else {
                try {
                    m7932 = C2975.m7932();
                    str22 = C2975.f9253.f10046;
                    str5 = MediationMetaData.KEY_NAME;
                } catch (PackageManager.NameNotFoundException e10) {
                    e = e10;
                    str4 = "validityTimestamp";
                    str5 = MediationMetaData.KEY_NAME;
                }
                try {
                    m6947 = C2500.m6947(m7932.getPackageInfo(str22, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir);
                } catch (PackageManager.NameNotFoundException e11) {
                    e = e11;
                    str4 = "validityTimestamp";
                    str = "retryUntil";
                    str2 = "maxRetries";
                    str3 = "retryCount";
                    str6 = "lastResponse";
                    file = null;
                    e.printStackTrace();
                    file2 = file;
                    FileChannel channel2222 = new RandomAccessFile(file2, InternalZipConstants.READ_MODE).getChannel();
                    map = channel2222.map(FileChannel.MapMode.READ_ONLY, 0L, (int) channel2222.size());
                    byte[] bArr32222 = new byte[20];
                    while (map.hasRemaining()) {
                        try {
                        } catch (Exception e12) {
                            e12.printStackTrace();
                            C2975.m7942("" + e12);
                        }
                    }
                    channel2222.close();
                    if (file2.getAbsolutePath().endsWith("/classes.dex")) {
                    }
                    if (arrayList.size() <= 0) {
                    }
                }
                if (m6947 != null) {
                    str4 = "validityTimestamp";
                    file3 = m6947;
                } else {
                    try {
                        file3 = m6947;
                        try {
                            str4 = "validityTimestamp";
                        } catch (PackageManager.NameNotFoundException e13) {
                            e = e13;
                            str4 = "validityTimestamp";
                        }
                    } catch (PackageManager.NameNotFoundException e14) {
                        e = e14;
                        str4 = "validityTimestamp";
                        file3 = m6947;
                    }
                    try {
                        File file5 = new File(C2500.m6976(C2975.m7932().getPackageInfo(C2975.f9253.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir, false));
                        if (file5.exists()) {
                            file2 = file5;
                        } else {
                            file2 = file3;
                        }
                        str = "retryUntil";
                        str2 = "maxRetries";
                        str3 = "retryCount";
                        str6 = "lastResponse";
                    } catch (PackageManager.NameNotFoundException e15) {
                        e = e15;
                        try {
                            e.printStackTrace();
                            str = "retryUntil";
                            str2 = "maxRetries";
                            str6 = "lastResponse";
                            file2 = file3;
                            str3 = "retryCount";
                        } catch (PackageManager.NameNotFoundException e16) {
                            e = e16;
                            str = "retryUntil";
                            str2 = "maxRetries";
                            str6 = "lastResponse";
                            file = file3;
                            str3 = "retryCount";
                            e.printStackTrace();
                            file2 = file;
                            FileChannel channel22222 = new RandomAccessFile(file2, InternalZipConstants.READ_MODE).getChannel();
                            map = channel22222.map(FileChannel.MapMode.READ_ONLY, 0L, (int) channel22222.size());
                            byte[] bArr322222 = new byte[20];
                            while (map.hasRemaining()) {
                            }
                            channel22222.close();
                            if (file2.getAbsolutePath().endsWith("/classes.dex")) {
                            }
                            if (arrayList.size() <= 0) {
                            }
                        }
                        FileChannel channel222222 = new RandomAccessFile(file2, InternalZipConstants.READ_MODE).getChannel();
                        map = channel222222.map(FileChannel.MapMode.READ_ONLY, 0L, (int) channel222222.size());
                        byte[] bArr3222222 = new byte[20];
                        while (map.hasRemaining()) {
                        }
                        channel222222.close();
                        if (file2.getAbsolutePath().endsWith("/classes.dex")) {
                        }
                        if (arrayList.size() <= 0) {
                        }
                    }
                    FileChannel channel2222222 = new RandomAccessFile(file2, InternalZipConstants.READ_MODE).getChannel();
                    map = channel2222222.map(FileChannel.MapMode.READ_ONLY, 0L, (int) channel2222222.size());
                    byte[] bArr32222222 = new byte[20];
                    while (map.hasRemaining()) {
                        int position = map.position();
                        if (map.get() == bArr2[0]) {
                            int i13 = position + 1;
                            map.position(i13);
                            if (!map.hasRemaining()) {
                                break;
                            }
                            byte b = map.get();
                            int i14 = 1;
                            while (true) {
                                if (b == bArr2[i14]) {
                                    int i15 = i14 + 1;
                                    if (i15 == 8) {
                                        C2975.m7942("Check");
                                        map.get(bArr32222222);
                                        int position2 = map.position();
                                        if (map.get(position2) == 0) {
                                            bArr = bArr2;
                                            if (map.get(position2 + 1) != 3) {
                                            }
                                            arrayList.add(bArr32222222);
                                            C2975.m7942(" " + ((int) bArr32222222[0]) + " " + ((int) bArr32222222[1]) + " " + ((int) bArr32222222[2]) + " " + ((int) bArr32222222[3]) + " " + ((int) bArr32222222[4]) + " " + ((int) bArr32222222[5]) + " " + ((int) bArr32222222[6]) + " " + ((int) bArr32222222[7]) + " " + ((int) bArr32222222[8]) + " " + ((int) bArr32222222[9]) + " " + ((int) bArr32222222[10]) + " " + ((int) bArr32222222[11]) + " " + ((int) bArr32222222[12]) + " " + ((int) bArr32222222[13]) + " " + ((int) bArr32222222[14]) + " " + ((int) bArr32222222[15]) + " " + ((int) bArr32222222[16]) + " " + ((int) bArr32222222[17]) + " " + ((int) bArr32222222[18]) + " " + ((int) bArr32222222[19]));
                                        } else {
                                            bArr = bArr2;
                                        }
                                        if (map.get(position2 + 6) == 0) {
                                        }
                                    } else {
                                        b = map.get();
                                        bArr2 = bArr2;
                                        i14 = i15;
                                    }
                                } else {
                                    bArr = bArr2;
                                    break;
                                }
                            }
                            map.position(i13);
                        } else {
                            bArr = bArr2;
                        }
                        map.position(position + 1);
                        bArr2 = bArr;
                    }
                    channel2222222.close();
                    if (file2.getAbsolutePath().endsWith("/classes.dex")) {
                        file2.delete();
                    }
                    if (arrayList.size() <= 0) {
                        File file6 = new File(C2975.this.mo1874().getFilesDir() + InternalZipConstants.ZIP_FILE_SEPARATOR + C2975.f9367.getName());
                        if (C2500.m6898(file4.getAbsolutePath())) {
                            if (file6.exists()) {
                                file6.delete();
                            }
                            C2500.m6877(file4.getAbsolutePath(), file6.getAbsolutePath(), false, false);
                            C2500.m7105(file6.getAbsolutePath());
                            if (file6.exists()) {
                                try {
                                    XmlPullParserFactory newInstance = XmlPullParserFactory.newInstance();
                                    newInstance.setNamespaceAware(true);
                                    XmlPullParser newPullParser = newInstance.newPullParser();
                                    newPullParser.setInput(new FileReader(new File(C2975.this.mo1874().getFilesDir() + InternalZipConstants.ZIP_FILE_SEPARATOR + C2975.f9367.getName())));
                                    int eventType = newPullParser.getEventType();
                                    str12 = "";
                                    str13 = str12;
                                    str14 = str13;
                                    str15 = str14;
                                    str16 = str15;
                                    boolean z10 = false;
                                    boolean z11 = false;
                                    boolean z12 = false;
                                    z = false;
                                    z2 = false;
                                    int i16 = 1;
                                    while (eventType != i16) {
                                        try {
                                            if (eventType == 2) {
                                                try {
                                                    if (newPullParser.getName().equals("string")) {
                                                        if (eventType == 2) {
                                                            i2 = eventType;
                                                            try {
                                                                str18 = str6;
                                                                try {
                                                                    z5 = z10;
                                                                    if (newPullParser.getAttributeValue(0).equals(str18)) {
                                                                        i3 = i2;
                                                                        while (i3 != 1 && i3 != 3) {
                                                                            try {
                                                                                i3 = newPullParser.next();
                                                                                if (i3 == 4) {
                                                                                    str12 = newPullParser.getText();
                                                                                    i4 = 2;
                                                                                    z = true;
                                                                                    break;
                                                                                }
                                                                            } catch (Exception e17) {
                                                                                e = e17;
                                                                                str11 = str18;
                                                                                str7 = str3;
                                                                                str8 = str4;
                                                                                String str29 = str;
                                                                                z4 = z11;
                                                                                str10 = str29;
                                                                                String str30 = str2;
                                                                                z3 = z12;
                                                                                str9 = str30;
                                                                                e.printStackTrace();
                                                                                String str31 = str12;
                                                                                String m6914 = C2500.m6914(C2975.this.mo1874(), C2975.f9253.f10046);
                                                                                String l = Long.toString(System.currentTimeMillis() + 62208000000L);
                                                                                it = arrayList.iterator();
                                                                                String str32 = str8;
                                                                                String str33 = str10;
                                                                                String str34 = str9;
                                                                                String str35 = str13;
                                                                                String str36 = str15;
                                                                                C2810 c2810 = null;
                                                                                z6 = false;
                                                                                String str37 = str16;
                                                                                String str38 = str31;
                                                                                String str39 = str14;
                                                                                String str40 = str7;
                                                                                String str41 = str39;
                                                                                while (it.hasNext()) {
                                                                                }
                                                                                String str42 = str28;
                                                                                if (!z6) {
                                                                                }
                                                                            }
                                                                        }
                                                                        i4 = 2;
                                                                        if (i3 != i4) {
                                                                            i5 = i3;
                                                                            str11 = str18;
                                                                            try {
                                                                                str19 = str;
                                                                                try {
                                                                                    z4 = z11;
                                                                                    if (newPullParser.getAttributeValue(0).equals(str19)) {
                                                                                        i6 = i5;
                                                                                        while (i6 != 1 && i6 != 3) {
                                                                                            try {
                                                                                                i6 = newPullParser.next();
                                                                                                if (i6 == 4) {
                                                                                                    str14 = newPullParser.getText();
                                                                                                    i7 = 2;
                                                                                                    z4 = true;
                                                                                                    break;
                                                                                                }
                                                                                            } catch (Exception e18) {
                                                                                                e = e18;
                                                                                                str10 = str19;
                                                                                                str7 = str3;
                                                                                                str8 = str4;
                                                                                                String str43 = str2;
                                                                                                z3 = z12;
                                                                                                str9 = str43;
                                                                                                e.printStackTrace();
                                                                                                String str312 = str12;
                                                                                                String m69142 = C2500.m6914(C2975.this.mo1874(), C2975.f9253.f10046);
                                                                                                String l2 = Long.toString(System.currentTimeMillis() + 62208000000L);
                                                                                                it = arrayList.iterator();
                                                                                                String str322 = str8;
                                                                                                String str332 = str10;
                                                                                                String str342 = str9;
                                                                                                String str352 = str13;
                                                                                                String str362 = str15;
                                                                                                C2810 c28102 = null;
                                                                                                z6 = false;
                                                                                                String str372 = str16;
                                                                                                String str382 = str312;
                                                                                                String str392 = str14;
                                                                                                String str402 = str7;
                                                                                                String str412 = str392;
                                                                                                while (it.hasNext()) {
                                                                                                }
                                                                                                String str422 = str28;
                                                                                                if (!z6) {
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                        i7 = 2;
                                                                                        if (i6 == i7) {
                                                                                            i8 = i6;
                                                                                            str10 = str19;
                                                                                            try {
                                                                                                str20 = str2;
                                                                                            } catch (Exception e19) {
                                                                                                e = e19;
                                                                                                str20 = str2;
                                                                                            }
                                                                                            try {
                                                                                                z3 = z12;
                                                                                                if (newPullParser.getAttributeValue(0).equals(str20)) {
                                                                                                    i9 = i8;
                                                                                                    while (i9 != 1 && i9 != 3) {
                                                                                                        try {
                                                                                                            i9 = newPullParser.next();
                                                                                                            if (i9 == 4) {
                                                                                                                str15 = newPullParser.getText();
                                                                                                                i10 = 2;
                                                                                                                z3 = true;
                                                                                                                break;
                                                                                                            }
                                                                                                        } catch (Exception e20) {
                                                                                                            e = e20;
                                                                                                            str9 = str20;
                                                                                                            str7 = str3;
                                                                                                            str8 = str4;
                                                                                                            e.printStackTrace();
                                                                                                            String str3122 = str12;
                                                                                                            String m691422 = C2500.m6914(C2975.this.mo1874(), C2975.f9253.f10046);
                                                                                                            String l22 = Long.toString(System.currentTimeMillis() + 62208000000L);
                                                                                                            it = arrayList.iterator();
                                                                                                            String str3222 = str8;
                                                                                                            String str3322 = str10;
                                                                                                            String str3422 = str9;
                                                                                                            String str3522 = str13;
                                                                                                            String str3622 = str15;
                                                                                                            C2810 c281022 = null;
                                                                                                            z6 = false;
                                                                                                            String str3722 = str16;
                                                                                                            String str3822 = str3122;
                                                                                                            String str3922 = str14;
                                                                                                            String str4022 = str7;
                                                                                                            String str4122 = str3922;
                                                                                                            while (it.hasNext()) {
                                                                                                            }
                                                                                                            String str4222 = str28;
                                                                                                            if (!z6) {
                                                                                                            }
                                                                                                        }
                                                                                                    }
                                                                                                    i10 = 2;
                                                                                                    if (i9 != i10) {
                                                                                                        i11 = i9;
                                                                                                        str9 = str20;
                                                                                                        try {
                                                                                                            str7 = str3;
                                                                                                        } catch (Exception e21) {
                                                                                                            e = e21;
                                                                                                            str7 = str3;
                                                                                                        }
                                                                                                        try {
                                                                                                            z7 = z;
                                                                                                            if (newPullParser.getAttributeValue(0).equals(str7)) {
                                                                                                                i12 = i11;
                                                                                                                while (i12 != 1 && i12 != 3) {
                                                                                                                    try {
                                                                                                                        i12 = newPullParser.next();
                                                                                                                        if (i12 == 4) {
                                                                                                                            str16 = newPullParser.getText();
                                                                                                                            z8 = true;
                                                                                                                            break;
                                                                                                                        }
                                                                                                                    } catch (Exception e22) {
                                                                                                                        e = e22;
                                                                                                                        z = z7;
                                                                                                                        str8 = str4;
                                                                                                                        e.printStackTrace();
                                                                                                                        String str31222 = str12;
                                                                                                                        String m6914222 = C2500.m6914(C2975.this.mo1874(), C2975.f9253.f10046);
                                                                                                                        String l222 = Long.toString(System.currentTimeMillis() + 62208000000L);
                                                                                                                        it = arrayList.iterator();
                                                                                                                        String str32222 = str8;
                                                                                                                        String str33222 = str10;
                                                                                                                        String str34222 = str9;
                                                                                                                        String str35222 = str13;
                                                                                                                        String str36222 = str15;
                                                                                                                        C2810 c2810222 = null;
                                                                                                                        z6 = false;
                                                                                                                        String str37222 = str16;
                                                                                                                        String str38222 = str31222;
                                                                                                                        String str39222 = str14;
                                                                                                                        String str40222 = str7;
                                                                                                                        String str41222 = str39222;
                                                                                                                        while (it.hasNext()) {
                                                                                                                        }
                                                                                                                        String str42222 = str28;
                                                                                                                        if (!z6) {
                                                                                                                        }
                                                                                                                    }
                                                                                                                }
                                                                                                                z8 = z2;
                                                                                                                if (i12 == 2) {
                                                                                                                    int i17 = i12;
                                                                                                                    try {
                                                                                                                        str21 = str4;
                                                                                                                    } catch (Exception e23) {
                                                                                                                        e = e23;
                                                                                                                        str21 = str4;
                                                                                                                    }
                                                                                                                    try {
                                                                                                                        z9 = z8;
                                                                                                                        if (newPullParser.getAttributeValue(0).equals(str21)) {
                                                                                                                            int i18 = i17;
                                                                                                                            while (i18 != 1 && i18 != 3) {
                                                                                                                                try {
                                                                                                                                    i18 = newPullParser.next();
                                                                                                                                    if (i18 == 4) {
                                                                                                                                        str13 = newPullParser.getText();
                                                                                                                                        str8 = str21;
                                                                                                                                        z2 = z9;
                                                                                                                                        z5 = true;
                                                                                                                                        break;
                                                                                                                                    }
                                                                                                                                } catch (Exception e24) {
                                                                                                                                    e = e24;
                                                                                                                                    str8 = str21;
                                                                                                                                    z = z7;
                                                                                                                                    z2 = z9;
                                                                                                                                    e.printStackTrace();
                                                                                                                                    String str312222 = str12;
                                                                                                                                    String m69142222 = C2500.m6914(C2975.this.mo1874(), C2975.f9253.f10046);
                                                                                                                                    String l2222 = Long.toString(System.currentTimeMillis() + 62208000000L);
                                                                                                                                    it = arrayList.iterator();
                                                                                                                                    String str322222 = str8;
                                                                                                                                    String str332222 = str10;
                                                                                                                                    String str342222 = str9;
                                                                                                                                    String str352222 = str13;
                                                                                                                                    String str362222 = str15;
                                                                                                                                    C2810 c28102222 = null;
                                                                                                                                    z6 = false;
                                                                                                                                    String str372222 = str16;
                                                                                                                                    String str382222 = str312222;
                                                                                                                                    String str392222 = str14;
                                                                                                                                    String str402222 = str7;
                                                                                                                                    String str412222 = str392222;
                                                                                                                                    while (it.hasNext()) {
                                                                                                                                    }
                                                                                                                                    String str422222 = str28;
                                                                                                                                    if (!z6) {
                                                                                                                                    }
                                                                                                                                }
                                                                                                                            }
                                                                                                                        }
                                                                                                                    } catch (Exception e25) {
                                                                                                                        e = e25;
                                                                                                                        z9 = z8;
                                                                                                                        str8 = str21;
                                                                                                                        z = z7;
                                                                                                                        z2 = z9;
                                                                                                                        e.printStackTrace();
                                                                                                                        String str3122222 = str12;
                                                                                                                        String m691422222 = C2500.m6914(C2975.this.mo1874(), C2975.f9253.f10046);
                                                                                                                        String l22222 = Long.toString(System.currentTimeMillis() + 62208000000L);
                                                                                                                        it = arrayList.iterator();
                                                                                                                        String str3222222 = str8;
                                                                                                                        String str3322222 = str10;
                                                                                                                        String str3422222 = str9;
                                                                                                                        String str3522222 = str13;
                                                                                                                        String str3622222 = str15;
                                                                                                                        C2810 c281022222 = null;
                                                                                                                        z6 = false;
                                                                                                                        String str3722222 = str16;
                                                                                                                        String str3822222 = str3122222;
                                                                                                                        String str3922222 = str14;
                                                                                                                        String str4022222 = str7;
                                                                                                                        String str4122222 = str3922222;
                                                                                                                        while (it.hasNext()) {
                                                                                                                        }
                                                                                                                        String str4222222 = str28;
                                                                                                                        if (!z6) {
                                                                                                                        }
                                                                                                                    }
                                                                                                                } else {
                                                                                                                    str21 = str4;
                                                                                                                    z9 = z8;
                                                                                                                }
                                                                                                                str8 = str21;
                                                                                                                z2 = z9;
                                                                                                                str4 = str8;
                                                                                                                z = z7;
                                                                                                                eventType = newPullParser.next();
                                                                                                                str3 = str7;
                                                                                                                i16 = 1;
                                                                                                                boolean z13 = z5;
                                                                                                                str6 = str11;
                                                                                                                z10 = z13;
                                                                                                                boolean z14 = z4;
                                                                                                                str = str10;
                                                                                                                z11 = z14;
                                                                                                                boolean z15 = z3;
                                                                                                                str2 = str9;
                                                                                                                z12 = z15;
                                                                                                            }
                                                                                                        } catch (Exception e26) {
                                                                                                            e = e26;
                                                                                                            str8 = str4;
                                                                                                            e.printStackTrace();
                                                                                                            String str31222222 = str12;
                                                                                                            String m6914222222 = C2500.m6914(C2975.this.mo1874(), C2975.f9253.f10046);
                                                                                                            String l222222 = Long.toString(System.currentTimeMillis() + 62208000000L);
                                                                                                            it = arrayList.iterator();
                                                                                                            String str32222222 = str8;
                                                                                                            String str33222222 = str10;
                                                                                                            String str34222222 = str9;
                                                                                                            String str35222222 = str13;
                                                                                                            String str36222222 = str15;
                                                                                                            C2810 c2810222222 = null;
                                                                                                            z6 = false;
                                                                                                            String str37222222 = str16;
                                                                                                            String str38222222 = str31222222;
                                                                                                            String str39222222 = str14;
                                                                                                            String str40222222 = str7;
                                                                                                            String str41222222 = str39222222;
                                                                                                            while (it.hasNext()) {
                                                                                                            }
                                                                                                            String str42222222 = str28;
                                                                                                            if (!z6) {
                                                                                                            }
                                                                                                        }
                                                                                                    } else {
                                                                                                        i11 = i9;
                                                                                                        str9 = str20;
                                                                                                        str7 = str3;
                                                                                                        z7 = z;
                                                                                                    }
                                                                                                    z8 = z2;
                                                                                                    i12 = i11;
                                                                                                    if (i12 == 2) {
                                                                                                    }
                                                                                                    str8 = str21;
                                                                                                    z2 = z9;
                                                                                                    str4 = str8;
                                                                                                    z = z7;
                                                                                                    eventType = newPullParser.next();
                                                                                                    str3 = str7;
                                                                                                    i16 = 1;
                                                                                                    boolean z132 = z5;
                                                                                                    str6 = str11;
                                                                                                    z10 = z132;
                                                                                                    boolean z142 = z4;
                                                                                                    str = str10;
                                                                                                    z11 = z142;
                                                                                                    boolean z152 = z3;
                                                                                                    str2 = str9;
                                                                                                    z12 = z152;
                                                                                                }
                                                                                            } catch (Exception e27) {
                                                                                                e = e27;
                                                                                                z3 = z12;
                                                                                                str9 = str20;
                                                                                                str7 = str3;
                                                                                                str8 = str4;
                                                                                                e.printStackTrace();
                                                                                                String str312222222 = str12;
                                                                                                String m69142222222 = C2500.m6914(C2975.this.mo1874(), C2975.f9253.f10046);
                                                                                                String l2222222 = Long.toString(System.currentTimeMillis() + 62208000000L);
                                                                                                it = arrayList.iterator();
                                                                                                String str322222222 = str8;
                                                                                                String str332222222 = str10;
                                                                                                String str342222222 = str9;
                                                                                                String str352222222 = str13;
                                                                                                String str362222222 = str15;
                                                                                                C2810 c28102222222 = null;
                                                                                                z6 = false;
                                                                                                String str372222222 = str16;
                                                                                                String str382222222 = str312222222;
                                                                                                String str392222222 = str14;
                                                                                                String str402222222 = str7;
                                                                                                String str412222222 = str392222222;
                                                                                                while (it.hasNext()) {
                                                                                                }
                                                                                                String str422222222 = str28;
                                                                                                if (!z6) {
                                                                                                }
                                                                                            }
                                                                                        } else {
                                                                                            i8 = i6;
                                                                                            str10 = str19;
                                                                                            str20 = str2;
                                                                                            z3 = z12;
                                                                                        }
                                                                                        i9 = i8;
                                                                                        i10 = 2;
                                                                                        if (i9 != i10) {
                                                                                        }
                                                                                        z8 = z2;
                                                                                        i12 = i11;
                                                                                        if (i12 == 2) {
                                                                                        }
                                                                                        str8 = str21;
                                                                                        z2 = z9;
                                                                                        str4 = str8;
                                                                                        z = z7;
                                                                                        eventType = newPullParser.next();
                                                                                        str3 = str7;
                                                                                        i16 = 1;
                                                                                        boolean z1322 = z5;
                                                                                        str6 = str11;
                                                                                        z10 = z1322;
                                                                                        boolean z1422 = z4;
                                                                                        str = str10;
                                                                                        z11 = z1422;
                                                                                        boolean z1522 = z3;
                                                                                        str2 = str9;
                                                                                        z12 = z1522;
                                                                                    }
                                                                                } catch (Exception e28) {
                                                                                    e = e28;
                                                                                    z4 = z11;
                                                                                    str10 = str19;
                                                                                    str7 = str3;
                                                                                    str8 = str4;
                                                                                    String str432 = str2;
                                                                                    z3 = z12;
                                                                                    str9 = str432;
                                                                                    e.printStackTrace();
                                                                                    String str3122222222 = str12;
                                                                                    String m691422222222 = C2500.m6914(C2975.this.mo1874(), C2975.f9253.f10046);
                                                                                    String l22222222 = Long.toString(System.currentTimeMillis() + 62208000000L);
                                                                                    it = arrayList.iterator();
                                                                                    String str3222222222 = str8;
                                                                                    String str3322222222 = str10;
                                                                                    String str3422222222 = str9;
                                                                                    String str3522222222 = str13;
                                                                                    String str3622222222 = str15;
                                                                                    C2810 c281022222222 = null;
                                                                                    z6 = false;
                                                                                    String str3722222222 = str16;
                                                                                    String str3822222222 = str3122222222;
                                                                                    String str3922222222 = str14;
                                                                                    String str4022222222 = str7;
                                                                                    String str4122222222 = str3922222222;
                                                                                    while (it.hasNext()) {
                                                                                    }
                                                                                    String str4222222222 = str28;
                                                                                    if (!z6) {
                                                                                    }
                                                                                }
                                                                            } catch (Exception e29) {
                                                                                e = e29;
                                                                                str19 = str;
                                                                            }
                                                                        } else {
                                                                            i5 = i3;
                                                                            str11 = str18;
                                                                            str19 = str;
                                                                            z4 = z11;
                                                                        }
                                                                        i6 = i5;
                                                                        i7 = 2;
                                                                        if (i6 == i7) {
                                                                        }
                                                                        i9 = i8;
                                                                        i10 = 2;
                                                                        if (i9 != i10) {
                                                                        }
                                                                        z8 = z2;
                                                                        i12 = i11;
                                                                        if (i12 == 2) {
                                                                        }
                                                                        str8 = str21;
                                                                        z2 = z9;
                                                                        str4 = str8;
                                                                        z = z7;
                                                                        eventType = newPullParser.next();
                                                                        str3 = str7;
                                                                        i16 = 1;
                                                                        boolean z13222 = z5;
                                                                        str6 = str11;
                                                                        z10 = z13222;
                                                                        boolean z14222 = z4;
                                                                        str = str10;
                                                                        z11 = z14222;
                                                                        boolean z15222 = z3;
                                                                        str2 = str9;
                                                                        z12 = z15222;
                                                                    }
                                                                } catch (Exception e30) {
                                                                    e = e30;
                                                                    z5 = z10;
                                                                    str11 = str18;
                                                                    str7 = str3;
                                                                    str8 = str4;
                                                                    String str292 = str;
                                                                    z4 = z11;
                                                                    str10 = str292;
                                                                    String str302 = str2;
                                                                    z3 = z12;
                                                                    str9 = str302;
                                                                    e.printStackTrace();
                                                                    String str31222222222 = str12;
                                                                    String m6914222222222 = C2500.m6914(C2975.this.mo1874(), C2975.f9253.f10046);
                                                                    String l222222222 = Long.toString(System.currentTimeMillis() + 62208000000L);
                                                                    it = arrayList.iterator();
                                                                    String str32222222222 = str8;
                                                                    String str33222222222 = str10;
                                                                    String str34222222222 = str9;
                                                                    String str35222222222 = str13;
                                                                    String str36222222222 = str15;
                                                                    C2810 c2810222222222 = null;
                                                                    z6 = false;
                                                                    String str37222222222 = str16;
                                                                    String str38222222222 = str31222222222;
                                                                    String str39222222222 = str14;
                                                                    String str40222222222 = str7;
                                                                    String str41222222222 = str39222222222;
                                                                    while (it.hasNext()) {
                                                                    }
                                                                    String str42222222222 = str28;
                                                                    if (!z6) {
                                                                    }
                                                                }
                                                            } catch (Exception e31) {
                                                                e = e31;
                                                                str18 = str6;
                                                            }
                                                        } else {
                                                            i2 = eventType;
                                                            str18 = str6;
                                                            z5 = z10;
                                                        }
                                                        i3 = i2;
                                                        i4 = 2;
                                                        if (i3 != i4) {
                                                        }
                                                        i6 = i5;
                                                        i7 = 2;
                                                        if (i6 == i7) {
                                                        }
                                                        i9 = i8;
                                                        i10 = 2;
                                                        if (i9 != i10) {
                                                        }
                                                        z8 = z2;
                                                        i12 = i11;
                                                        if (i12 == 2) {
                                                        }
                                                        str8 = str21;
                                                        z2 = z9;
                                                        str4 = str8;
                                                        z = z7;
                                                        eventType = newPullParser.next();
                                                        str3 = str7;
                                                        i16 = 1;
                                                        boolean z132222 = z5;
                                                        str6 = str11;
                                                        z10 = z132222;
                                                        boolean z142222 = z4;
                                                        str = str10;
                                                        z11 = z142222;
                                                        boolean z152222 = z3;
                                                        str2 = str9;
                                                        z12 = z152222;
                                                    }
                                                } catch (Exception e32) {
                                                    e = e32;
                                                    str7 = str3;
                                                    str8 = str4;
                                                    String str44 = str6;
                                                    z5 = z10;
                                                    str11 = str44;
                                                    String str45 = str;
                                                    z4 = z11;
                                                    str10 = str45;
                                                    String str46 = str2;
                                                    z3 = z12;
                                                    str9 = str46;
                                                }
                                            }
                                            str4 = str8;
                                            z = z7;
                                            eventType = newPullParser.next();
                                            str3 = str7;
                                            i16 = 1;
                                            boolean z1322222 = z5;
                                            str6 = str11;
                                            z10 = z1322222;
                                            boolean z1422222 = z4;
                                            str = str10;
                                            z11 = z1422222;
                                            boolean z1522222 = z3;
                                            str2 = str9;
                                            z12 = z1522222;
                                        } catch (Exception e33) {
                                            e = e33;
                                            z = z7;
                                            e.printStackTrace();
                                            String str312222222222 = str12;
                                            String m69142222222222 = C2500.m6914(C2975.this.mo1874(), C2975.f9253.f10046);
                                            String l2222222222 = Long.toString(System.currentTimeMillis() + 62208000000L);
                                            it = arrayList.iterator();
                                            String str322222222222 = str8;
                                            String str332222222222 = str10;
                                            String str342222222222 = str9;
                                            String str352222222222 = str13;
                                            String str362222222222 = str15;
                                            C2810 c28102222222222 = null;
                                            z6 = false;
                                            String str372222222222 = str16;
                                            String str382222222222 = str312222222222;
                                            String str392222222222 = str14;
                                            String str402222222222 = str7;
                                            String str412222222222 = str392222222222;
                                            while (it.hasNext()) {
                                            }
                                            String str422222222222 = str28;
                                            if (!z6) {
                                            }
                                        }
                                        str7 = str3;
                                        str8 = str4;
                                        z7 = z;
                                        String str47 = str6;
                                        z5 = z10;
                                        str11 = str47;
                                        String str48 = str;
                                        z4 = z11;
                                        str10 = str48;
                                        String str49 = str2;
                                        z3 = z12;
                                        str9 = str49;
                                    }
                                    str7 = str3;
                                    str8 = str4;
                                    String str50 = str6;
                                    z5 = z10;
                                    str11 = str50;
                                    String str51 = str;
                                    z4 = z11;
                                    str10 = str51;
                                    String str52 = str2;
                                    z3 = z12;
                                    str9 = str52;
                                } catch (Exception e34) {
                                    e = e34;
                                    str7 = str3;
                                    str8 = str4;
                                    str9 = str2;
                                    str10 = str;
                                    str11 = str6;
                                    str12 = "";
                                    str13 = str12;
                                    str14 = str13;
                                    str15 = str14;
                                    str16 = str15;
                                    z = false;
                                    z2 = false;
                                    z3 = false;
                                    z4 = false;
                                    z5 = false;
                                }
                                String str3122222222222 = str12;
                                String m691422222222222 = C2500.m6914(C2975.this.mo1874(), C2975.f9253.f10046);
                                String l22222222222 = Long.toString(System.currentTimeMillis() + 62208000000L);
                                it = arrayList.iterator();
                                String str3222222222222 = str8;
                                String str3322222222222 = str10;
                                String str3422222222222 = str9;
                                String str3522222222222 = str13;
                                String str3622222222222 = str15;
                                C2810 c281022222222222 = null;
                                z6 = false;
                                String str3722222222222 = str16;
                                String str3822222222222 = str3122222222222;
                                String str3922222222222 = str14;
                                String str4022222222222 = str7;
                                String str4122222222222 = str3922222222222;
                                while (it.hasNext()) {
                                    Iterator it2 = it;
                                    try {
                                        str17 = str28;
                                        try {
                                            C2810 c28103 = new C2810((byte[]) it.next(), C2975.f9253.f10046, m691422222222222);
                                            if (z) {
                                                try {
                                                    try {
                                                        str3822222222222 = c28103.m7670(str3822222222222, "");
                                                    } catch (Throwable th) {
                                                        th = th;
                                                        c281022222222222 = c28103;
                                                        th.printStackTrace();
                                                        it = it2;
                                                        str28 = str17;
                                                    }
                                                } catch (C2811 e35) {
                                                    e35.printStackTrace();
                                                    c281022222222222 = c28103;
                                                    it = it2;
                                                    str28 = str17;
                                                } catch (Exception e36) {
                                                    e36.printStackTrace();
                                                    c281022222222222 = c28103;
                                                    it = it2;
                                                    str28 = str17;
                                                }
                                            }
                                            if (z5) {
                                                try {
                                                    str3522222222222 = c28103.m7670(str3522222222222, "");
                                                } catch (C2811 e37) {
                                                    e37.printStackTrace();
                                                    c281022222222222 = c28103;
                                                    it = it2;
                                                    str28 = str17;
                                                }
                                            }
                                            if (z2) {
                                                try {
                                                    str3722222222222 = c28103.m7670(str3722222222222, "");
                                                } catch (C2811 e38) {
                                                    e38.printStackTrace();
                                                    c281022222222222 = c28103;
                                                    it = it2;
                                                    str28 = str17;
                                                }
                                            }
                                            if (z3) {
                                                try {
                                                    str3622222222222 = c28103.m7670(str3622222222222, "");
                                                } catch (C2811 e39) {
                                                    e39.printStackTrace();
                                                    c281022222222222 = c28103;
                                                    it = it2;
                                                    str28 = str17;
                                                }
                                            }
                                            if (z4) {
                                                try {
                                                    str4122222222222 = c28103.m7670(str4122222222222, "");
                                                } catch (C2811 e40) {
                                                    e40.printStackTrace();
                                                    c281022222222222 = c28103;
                                                    it = it2;
                                                    str28 = str17;
                                                }
                                            }
                                            c281022222222222 = c28103;
                                            z6 = true;
                                        } catch (Throwable th2) {
                                            th = th2;
                                        }
                                    } catch (Throwable th3) {
                                        th = th3;
                                        str17 = str28;
                                    }
                                    it = it2;
                                    str28 = str17;
                                }
                                String str4222222222222 = str28;
                                if (!z6) {
                                    String str53 = "256";
                                    if (!str3822222222222.contains("291") && !str3822222222222.contains("561") && !str3822222222222.contains("256")) {
                                        replace = "";
                                        str53 = replace;
                                    } else {
                                        replace = str3822222222222.replace("256", "").replace("291", "").replace("561", "");
                                    }
                                    if (str3822222222222.contains("NOT_LICENSED") || str3822222222222.contains("RETRY") || str3822222222222.contains("LICENSED")) {
                                        replace = str3822222222222.replace("NOT_LICENSED", "").replace("RETRY", "").replace("LICENSED", "");
                                        str53 = "LICENSED";
                                    }
                                    String replaceAll = str3522222222222.replaceAll("[0-9]", "");
                                    String replaceAll2 = str3722222222222.replaceAll("[0-9]", "");
                                    String replaceAll3 = str3622222222222.replaceAll("[0-9]", "");
                                    String replaceAll4 = str4122222222222.replaceAll("[0-9]", "");
                                    if (!z5 && replace.equals(str11)) {
                                        replaceAll = str3222222222222;
                                    }
                                    if (!z2 && replace.equals(str11)) {
                                        replaceAll2 = str4022222222222;
                                    }
                                    if (!z3 && replace.equals(str11)) {
                                        replaceAll3 = str3422222222222;
                                    }
                                    if (!z4 && replace.equals(str11)) {
                                        replaceAll4 = str3322222222222;
                                    }
                                    String l3 = Long.toString(System.currentTimeMillis() + 62208000000L);
                                    String m7669 = c281022222222222.m7669(l22222222222, replaceAll);
                                    String m76692 = c281022222222222.m7669(str53, replace);
                                    String m76693 = c281022222222222.m7669(l3, replaceAll4);
                                    String m76694 = c281022222222222.m7669("10", replaceAll3);
                                    String m76695 = c281022222222222.m7669("0", replaceAll2);
                                    File file7 = new File(C2975.this.mo1874().getFilesDir() + str4222222222222 + C2975.f9367.getName());
                                    try {
                                        file7.createNewFile();
                                        FileOutputStream fileOutputStream = new FileOutputStream(file7);
                                        XmlSerializer newSerializer = Xml.newSerializer();
                                        newSerializer.setOutput(fileOutputStream, "UTF-8");
                                        newSerializer.startDocument(null, Boolean.TRUE);
                                        newSerializer.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true);
                                        newSerializer.startTag(null, PolicyMappingsExtension.MAP);
                                        newSerializer.startTag(null, "string");
                                        String str54 = str5;
                                        newSerializer.attribute("", str54, str3222222222222);
                                        newSerializer.text(m7669);
                                        newSerializer.endTag(null, "string");
                                        newSerializer.startTag(null, "string");
                                        newSerializer.attribute("", str54, str4022222222222);
                                        newSerializer.text(m76695);
                                        newSerializer.endTag(null, "string");
                                        newSerializer.startTag(null, "string");
                                        newSerializer.attribute("", str54, str3422222222222);
                                        newSerializer.text(m76694);
                                        newSerializer.endTag(null, "string");
                                        newSerializer.startTag(null, "string");
                                        newSerializer.attribute("", str54, str3322222222222);
                                        newSerializer.text(m76693);
                                        newSerializer.endTag(null, "string");
                                        newSerializer.startTag(null, "string");
                                        newSerializer.attribute("", str54, str11);
                                        newSerializer.text(m76692);
                                        newSerializer.endTag(null, "string");
                                        newSerializer.endTag(null, PolicyMappingsExtension.MAP);
                                        newSerializer.endDocument();
                                        newSerializer.flush();
                                        fileOutputStream.close();
                                    } catch (Exception unused) {
                                    }
                                    C2500.m6877(file6.getAbsolutePath(), file4.getAbsolutePath(), false, false);
                                    C2500.m7091(file4.getAbsolutePath());
                                    if (file6.exists()) {
                                        file6.delete();
                                    }
                                    C2500.m7093("chmod 777 " + file4.getAbsolutePath());
                                    try {
                                        i = C2975.m7932().getApplicationInfo(C2975.f9253.f10046, ItemType.CLASS_DATA_ITEM).uid;
                                    } catch (PackageManager.NameNotFoundException e41) {
                                        e = e41;
                                        i = 0;
                                    }
                                    try {
                                        C2500.m7053(C2975.m7929().getPackageManager().getPackageInfo(C2975.f9253.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.processName);
                                    } catch (PackageManager.NameNotFoundException e42) {
                                        e = e42;
                                        e.printStackTrace();
                                        if (i != 0) {
                                        }
                                        C2975.m7954(new RunnableC3034());
                                        return;
                                    }
                                    if (i != 0) {
                                        C2500.m7093("chown " + i + "." + i + " " + file4.getAbsolutePath());
                                        C2500.m7093("chown " + i + ":" + i + " " + file4.getAbsolutePath());
                                    }
                                    C2975.m7954(new RunnableC3034());
                                    return;
                                }
                                C2975.m7954(new RunnableC3032());
                                return;
                            }
                            C2975.m7954(new RunnableC3031());
                            return;
                        }
                        C2975.m7954(new RunnableC3030());
                        return;
                    }
                    C2975.m7954(new RunnableC3033());
                    return;
                }
                str = "retryUntil";
                str2 = "maxRetries";
                str6 = "lastResponse";
                file2 = file3;
                str3 = "retryCount";
                FileChannel channel22222222 = new RandomAccessFile(file2, InternalZipConstants.READ_MODE).getChannel();
                map = channel22222222.map(FileChannel.MapMode.READ_ONLY, 0L, (int) channel22222222.size());
                byte[] bArr322222222 = new byte[20];
                while (map.hasRemaining()) {
                }
                channel22222222.close();
                if (file2.getAbsolutePath().endsWith("/classes.dex")) {
                }
                if (arrayList.size() <= 0) {
                }
            }
        }
    }

    public class RunnableC3035 implements Runnable {

        final Runnable f9503;

        class RunnableC3036 implements Runnable {
            RunnableC3036() {
            }

            @Override
            public void run() {
                C2975.m7960(11);
                C3743 c3743 = C2975.f9276;
                if (c3743 != null) {
                    c3743.m8238(true);
                    C2975.f9276.m8239(C2500.m7007(R.string.wait));
                }
            }
        }

        class RunnableC3037 implements Runnable {
            RunnableC3037() {
            }

            @Override
            public void run() {
                C2975.m7951(11);
            }
        }

        RunnableC3035(Runnable runnable) {
            this.f9503 = runnable;
        }

        @Override
        public void run() {
            C2975.m7954(new RunnableC3036());
            try {
                this.f9503.run();
            } catch (Exception e) {
                e.printStackTrace();
            }
            C2975.m7954(new RunnableC3037());
        }
    }

    public class ViewOnClickListenerC3038 implements View.OnClickListener {

        class RunnableC3039 implements Runnable {

            class RunnableC3040 implements Runnable {
                RunnableC3040() {
                }

                @Override
                public void run() {
                    C2975.f9252.m8120();
                }
            }

            class RunnableC3041 implements Runnable {

                final C3478 f9509;

                RunnableC3041(C3478 c3478) {
                    this.f9509 = c3478;
                }

                @Override
                public void run() {
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7009(R.string.warning_for_get_apk, this.f9509.f10047));
                }
            }

            RunnableC3039() {
            }

            @Override
            public void run() {
                String str;
                String str2;
                if (C2975.f9325.size() == 0) {
                    if (C2975.f9252 != null) {
                        C2975.m7954(new RunnableC3040());
                        return;
                    }
                    return;
                }
                ArrayList arrayList = new ArrayList();
                if (C2975.f9283) {
                    str = "pm install -r -s -i com.android.vending ";
                } else {
                    str = "pm install -r -s ";
                }
                ArrayList arrayList2 = new ArrayList(C2975.f9325);
                C2975.f9325.clear();
                try {
                    Iterator it = arrayList2.iterator();
                    while (it.hasNext()) {
                        C3478 c3478 = (C3478) it.next();
                        if (!C2500.m7047(c3478.f10046)) {
                            try {
                                str2 = C2975.m7932().getPackageInfo(c3478.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                                try {
                                    C2500.m7093("chmod 644 " + str2);
                                    C2975.m7942("Start move to sdcard" + str2);
                                } catch (Exception unused) {
                                }
                            } catch (Exception unused2) {
                                str2 = "";
                            }
                            if (!str2.equals("")) {
                                arrayList.add(str + str2);
                            }
                        } else {
                            C2975.m7954(new RunnableC3041(c3478));
                        }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (arrayList.size() > 0) {
                    String[] strArr = new String[arrayList.size()];
                    arrayList.toArray(strArr);
                    if (C2975.f9283) {
                        new C2500("").m7211(strArr);
                    } else {
                        C2500.m7019(strArr);
                    }
                }
                C2975.m7952();
            }
        }

        ViewOnClickListenerC3038() {
        }

        @Override
        public void onClick(View view) {
            C2975.m7956(new RunnableC3039());
        }
    }

    public class ViewOnClickListenerC3042 implements View.OnClickListener {

        class RunnableC3043 implements Runnable {

            class RunnableC3044 implements Runnable {
                RunnableC3044() {
                }

                @Override
                public void run() {
                    C2975.f9252.m8120();
                }
            }

            class RunnableC3045 implements Runnable {

                final C3478 f9514;

                RunnableC3045(C3478 c3478) {
                    this.f9514 = c3478;
                }

                @Override
                public void run() {
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7009(R.string.warning_for_get_apk, this.f9514.f10047));
                }
            }

            RunnableC3043() {
            }

            @Override
            public void run() {
                String str;
                String str2;
                if (C2975.f9325.size() == 0) {
                    if (C2975.f9252 != null) {
                        C2975.m7954(new RunnableC3044());
                        return;
                    }
                    return;
                }
                ArrayList arrayList = new ArrayList();
                if (C2975.f9283) {
                    str = "pm install -r -f -i com.android.vending ";
                } else {
                    str = "pm install -r -f ";
                }
                ArrayList arrayList2 = new ArrayList(C2975.f9325);
                C2975.f9325.clear();
                Iterator it = arrayList2.iterator();
                while (it.hasNext()) {
                    C3478 c3478 = (C3478) it.next();
                    if (!C2500.m7047(c3478.f10046)) {
                        try {
                            str2 = C2975.m7932().getPackageInfo(c3478.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                            try {
                                C2500.m7093("chmod 644 " + str2);
                                C2975.m7942("Start move to internal " + str2);
                            } catch (Exception unused) {
                            }
                        } catch (Exception unused2) {
                            str2 = "";
                        }
                        if (!str2.equals("")) {
                            arrayList.add(str + str2);
                        }
                    } else {
                        C2975.m7954(new RunnableC3045(c3478));
                    }
                }
                if (arrayList.size() > 0) {
                    String[] strArr = new String[arrayList.size()];
                    arrayList.toArray(strArr);
                    if (C2975.f9283) {
                        new C2500("").m7211(strArr);
                    } else {
                        C2500.m7019(strArr);
                    }
                }
                C2975.m7952();
            }
        }

        ViewOnClickListenerC3042() {
        }

        @Override
        public void onClick(View view) {
            C2975.m7956(new RunnableC3043());
        }
    }

    public class RunnableC3046 implements Runnable {

        class C3047 implements CompoundButton.OnCheckedChangeListener {
            C3047() {
            }

            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
                if (z) {
                    C2975.m7928().edit().putBoolean("warning_supersu", false).commit();
                } else {
                    C2975.m7928().edit().putBoolean("warning_supersu", true).commit();
                }
            }
        }

        class DialogInterfaceOnClickListenerC3048 implements DialogInterface.OnClickListener {

            class RunnableC3049 implements Runnable {
                RunnableC3049() {
                }

                @Override
                public void run() {
                    String str;
                    try {
                        str = C2975.m7932().getPackageInfo("eu.chainfire.supersu", ItemType.CLASS_DATA_ITEM).applicationInfo.dataDir;
                    } catch (PackageManager.NameNotFoundException unused) {
                        str = "none";
                        new C2500("supersu").m7211(C2975.f9284 + C1572.class.getName() + " " + str);
                    } catch (Exception e) {
                        e.printStackTrace();
                        str = "none";
                        new C2500("supersu").m7211(C2975.f9284 + C1572.class.getName() + " " + str);
                    }
                    new C2500("supersu").m7211(C2975.f9284 + C1572.class.getName() + " " + str);
                }
            }

            DialogInterfaceOnClickListenerC3048() {
            }

            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                new Thread(new RunnableC3049()).start();
            }
        }

        RunnableC3046() {
        }

        @Override
        public void run() {
            if (C2975.m7928().getBoolean("warning_supersu", true)) {
                C2500.m7128(C2500.m7007(R.string.warning), C2500.m7007(R.string.warning_superSu_mount_name_space_separation) + "\n" + C2500.m7007(R.string.warning_superSu_mount_name_space_separation_2), C2500.m7007(R.string.warning_superSu_mount_name_space_separation_3), new C3047(), false, new DialogInterfaceOnClickListenerC3048(), null, null, false);
                return;
            }
            Toast.makeText(C2975.m7929(), C2500.m7007(R.string.warning_superSu_mount_name_space_separation), 1).show();
        }
    }

    public class ViewOnClickListenerC3050 implements View.OnClickListener {

        class RunnableC3051 implements Runnable {

            class RunnableC3052 implements Runnable {
                RunnableC3052() {
                }

                @Override
                public void run() {
                    C2975.f9252.m8120();
                }
            }

            RunnableC3051() {
            }

            @Override
            public void run() {
                if (C2975.f9325.size() == 0) {
                    if (C2975.f9252 != null) {
                        C2975.m7954(new RunnableC3052());
                        return;
                    }
                    return;
                }
                ArrayList arrayList = new ArrayList();
                ArrayList arrayList2 = new ArrayList(C2975.f9325);
                C2975.f9325.clear();
                Iterator it = arrayList2.iterator();
                while (it.hasNext()) {
                    arrayList.add("pm disable " + ((C3478) it.next()).f10046);
                }
                if (arrayList.size() > 0) {
                    String[] strArr = new String[arrayList.size()];
                    arrayList.toArray(strArr);
                    if (C2975.f9283) {
                        new C2500("").m7211(strArr);
                    } else {
                        C2500.m7019(strArr);
                    }
                }
                C2975.m7952();
            }
        }

        ViewOnClickListenerC3050() {
        }

        @Override
        public void onClick(View view) {
            C2975.m7956(new RunnableC3051());
        }
    }

    public class ViewOnClickListenerC3053 implements View.OnClickListener {

        class RunnableC3054 implements Runnable {

            class RunnableC3055 implements Runnable {
                RunnableC3055() {
                }

                @Override
                public void run() {
                    C2975.f9252.m8120();
                }
            }

            RunnableC3054() {
            }

            @Override
            public void run() {
                if (C2975.f9325.size() == 0) {
                    if (C2975.f9252 != null) {
                        C2975.m7954(new RunnableC3055());
                        return;
                    }
                    return;
                }
                ArrayList arrayList = new ArrayList();
                ArrayList arrayList2 = new ArrayList(C2975.f9325);
                C2975.f9325.clear();
                Iterator it = arrayList2.iterator();
                while (it.hasNext()) {
                    arrayList.add("pm enable " + ((C3478) it.next()).f10046);
                }
                if (arrayList.size() > 0) {
                    String[] strArr = new String[arrayList.size()];
                    arrayList.toArray(strArr);
                    if (C2975.f9283) {
                        new C2500("").m7211(strArr);
                    } else {
                        C2500.m7019(strArr);
                    }
                }
                C2975.m7952();
            }
        }

        ViewOnClickListenerC3053() {
        }

        @Override
        public void onClick(View view) {
            C2975.m7956(new RunnableC3054());
        }
    }

    public class ViewOnClickListenerC3056 implements View.OnClickListener {

        class RunnableC3057 implements Runnable {

            class RunnableC3058 implements Runnable {
                RunnableC3058() {
                }

                @Override
                public void run() {
                    C2975.f9252.m8120();
                }
            }

            RunnableC3057() {
            }

            @Override
            public void run() {
                if (C2975.f9325.size() == 0) {
                    if (C2975.f9252 != null) {
                        C2975.m7954(new RunnableC3058());
                        return;
                    }
                    return;
                }
                ArrayList arrayList = new ArrayList();
                ArrayList arrayList2 = new ArrayList(C2975.f9325);
                C2975.f9325.clear();
                Iterator it = arrayList2.iterator();
                while (it.hasNext()) {
                    C3478 c3478 = (C3478) it.next();
                    C2975.m7942("Uninstall");
                    arrayList.add("pm uninstall " + c3478.f10046);
                }
                if (arrayList.size() > 0) {
                    String[] strArr = new String[arrayList.size()];
                    arrayList.toArray(strArr);
                    if (C2975.f9283) {
                        new C2500("").m7211(strArr);
                    } else {
                        C2500.m7019(strArr);
                    }
                }
                C2975.m7952();
            }
        }

        ViewOnClickListenerC3056() {
        }

        @Override
        public void onClick(View view) {
            C2975.m7956(new RunnableC3057());
        }
    }

    public class ViewOnClickListenerC3059 implements View.OnClickListener {

        class RunnableC3060 implements Runnable {

            class RunnableC3061 implements Runnable {
                RunnableC3061() {
                }

                @Override
                public void run() {
                    C2975.f9252.m8120();
                }
            }

            RunnableC3060() {
            }

            @Override
            public void run() {
                if (C2975.f9325.size() == 0) {
                    if (C2975.f9252 != null) {
                        C2975.m7954(new RunnableC3061());
                        return;
                    }
                    return;
                }
                ArrayList arrayList = new ArrayList();
                ArrayList arrayList2 = new ArrayList(C2975.f9325);
                C2975.f9325.clear();
                Iterator it = arrayList2.iterator();
                while (it.hasNext()) {
                    C3478 c3478 = (C3478) it.next();
                    C2975.m7942("Block Internet");
                    arrayList.add("pm revoke " + c3478.f10046 + "/android.permission.INTERNET");
                }
                if (arrayList.size() > 0) {
                    String[] strArr = new String[arrayList.size()];
                    arrayList.toArray(strArr);
                    if (C2975.f9283) {
                        new C2500("").m7211(strArr);
                    } else {
                        C2500.m7019(strArr);
                    }
                }
                C2975.m7952();
            }
        }

        ViewOnClickListenerC3059() {
        }

        @Override
        public void onClick(View view) {
            C2975.m7956(new RunnableC3060());
        }
    }

    public class ViewOnClickListenerC3062 implements View.OnClickListener {

        class RunnableC3063 implements Runnable {

            class RunnableC3064 implements Runnable {
                RunnableC3064() {
                }

                @Override
                public void run() {
                    C2975.f9252.m8120();
                }
            }

            RunnableC3063() {
            }

            @Override
            public void run() {
                if (C2975.f9325.size() == 0) {
                    if (C2975.f9252 != null) {
                        C2975.m7954(new RunnableC3064());
                        return;
                    }
                    return;
                }
                ArrayList arrayList = new ArrayList();
                ArrayList arrayList2 = new ArrayList(C2975.f9325);
                C2975.f9325.clear();
                Iterator it = arrayList2.iterator();
                while (it.hasNext()) {
                    C3478 c3478 = (C3478) it.next();
                    C2975.m7942("Unblock Internet");
                    arrayList.add("pm grant " + c3478.f10046 + "/android.permission.INTERNET");
                }
                if (arrayList.size() > 0) {
                    String[] strArr = new String[arrayList.size()];
                    arrayList.toArray(strArr);
                    if (C2975.f9283) {
                        new C2500("").m7211(strArr);
                    } else {
                        C2500.m7019(strArr);
                    }
                }
                C2975.m7952();
            }
        }

        ViewOnClickListenerC3062() {
        }

        @Override
        public void onClick(View view) {
            C2975.m7956(new RunnableC3063());
        }
    }

    public class ViewOnClickListenerC3065 implements View.OnClickListener {

        class RunnableC3066 implements Runnable {

            class RunnableC3067 implements Runnable {
                RunnableC3067() {
                }

                @Override
                public void run() {
                    C2975.f9252.m8120();
                }
            }

            RunnableC3066() {
            }

            @Override
            public void run() {
                if (C2975.f9325.size() == 0) {
                    if (C2975.f9252 != null) {
                        C2975.m7954(new RunnableC3067());
                        return;
                    }
                    return;
                }
                ArrayList arrayList = new ArrayList(C2975.f9325);
                C2975.f9325.clear();
                Iterator it = arrayList.iterator();
                while (it.hasNext()) {
                    C2975.m7942("Integrate update for " + ((C3478) it.next()).f10046);
                }
                C2975.m7941(arrayList, false, false, true);
                C2975.m7952();
            }
        }

        ViewOnClickListenerC3065() {
        }

        @Override
        public void onClick(View view) {
            new Thread(new RunnableC3066()).start();
        }
    }

    public class ViewOnClickListenerC3068 implements View.OnClickListener {

        class RunnableC3069 implements Runnable {

            class RunnableC3070 implements Runnable {
                RunnableC3070() {
                }

                @Override
                public void run() {
                    C2975.f9252.m8120();
                }
            }

            RunnableC3069() {
            }

            @Override
            public void run() {
                if (C2975.f9325.size() == 0) {
                    if (C2975.f9252 != null) {
                        C2975.m7954(new RunnableC3070());
                        return;
                    }
                    return;
                }
                ArrayList arrayList = new ArrayList(C2975.f9325);
                C2975.f9325.clear();
                SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();
                spannableStringBuilder.append((CharSequence) C2500.m6934(C2500.m7007(R.string.context_result_backup_settings) + "\n", "#FFCCCCCC", ""));
                Iterator it = arrayList.iterator();
                while (it.hasNext()) {
                    C3478 c3478 = (C3478) it.next();
                    C2975.m7942("Backup App Settings for " + c3478.f10046);
                    if (C2975.this.m7972(c3478, false)) {
                        spannableStringBuilder.append((CharSequence) C2500.m6934("\n" + c3478.f10047 + " - ", "#FFCCCCCC", ""));
                        spannableStringBuilder.append((CharSequence) C2500.m6934(C2500.m7007(R.string.success), "#CC00FF00", ""));
                    } else {
                        spannableStringBuilder.append((CharSequence) C2500.m6934("\n" + c3478.f10047 + " - ", "#FFCCCCCC", ""));
                        spannableStringBuilder.append((CharSequence) C2500.m6934(C2500.m7007(R.string.failed), "#CCFF0000", ""));
                    }
                }
                C2975.m7961(C2500.m7007(R.string.information), spannableStringBuilder);
                C2975.m7952();
            }
        }

        ViewOnClickListenerC3068() {
        }

        @Override
        public void onClick(View view) {
            C2975.m7956(new RunnableC3069());
        }
    }

    public class ViewOnClickListenerC3071 implements View.OnClickListener {

        class RunnableC3072 implements Runnable {

            class RunnableC3073 implements Runnable {
                RunnableC3073() {
                }

                @Override
                public void run() {
                    C2975.f9252.m8120();
                }
            }

            RunnableC3072() {
            }

            @Override
            public void run() {
                if (C2975.f9325.size() == 0) {
                    if (C2975.f9252 != null) {
                        C2975.m7954(new RunnableC3073());
                        return;
                    }
                    return;
                }
                ArrayList arrayList = new ArrayList(C2975.f9325);
                C2975.f9325.clear();
                SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();
                spannableStringBuilder.append((CharSequence) C2500.m6934(C2500.m7007(R.string.context_result_backup_apks) + "\n", "#FFCCCCCC", ""));
                Iterator it = arrayList.iterator();
                while (it.hasNext()) {
                    C3478 c3478 = (C3478) it.next();
                    C2975.m7942("Backup Apk for " + c3478.f10046);
                    if (new File(C2975.m7919(c3478, false)).exists()) {
                        spannableStringBuilder.append((CharSequence) C2500.m6934("\n" + c3478.f10047 + " - ", "#FFCCCCCC", ""));
                        spannableStringBuilder.append((CharSequence) C2500.m6934(C2500.m7007(R.string.success), "#CC00FF00", ""));
                    } else {
                        spannableStringBuilder.append((CharSequence) C2500.m6934("\n" + c3478.f10047 + " - ", "#FFCCCCCC", ""));
                        spannableStringBuilder.append((CharSequence) C2500.m6934(C2500.m7007(R.string.failed), "#CCFF0000", ""));
                    }
                }
                C2975.m7961(C2500.m7007(R.string.information), spannableStringBuilder);
                C2975.m7952();
            }
        }

        ViewOnClickListenerC3071() {
        }

        @Override
        public void onClick(View view) {
            C2975.m7956(new RunnableC3072());
        }
    }

    public class RunnableC3074 implements Runnable {
        RunnableC3074() {
        }

        @Override
        public void run() {
            C2975.f9326 = false;
            C2975.f9325.clear();
            C2975.f9317 = 0;
            TextView textView = (TextView) C2975.f9259.findViewById(R.id.line_hide_horisontal);
            TextView textView2 = (TextView) C2975.f9259.findViewById(R.id.line_hide_vertical);
            textView.setVisibility(8);
            textView2.setVisibility(8);
            ((TextView) C2975.f9259.findViewById(R.id.title_list)).setVisibility(8);
            ((Button) C2975.f9259.findViewById(R.id.title_button)).setVisibility(8);
            if (C2975.f9252 != null) {
                C2975.m7957(true);
            }
            C2975.m7951(11);
        }
    }

    public class RunnableC3075 implements Runnable {

        final Uri f9544;

        final String f9545;

        class RunnableC3076 implements Runnable {

            final String f9547;

            class RunnableC3077 implements Runnable {
                RunnableC3077() {
                }

                @Override
                public void run() {
                    try {
                        File file = new File(C2500.m7006() + RunnableC3076.this.f9547);
                        if (file.exists()) {
                            if (file.getName().toLowerCase().endsWith("lpzip")) {
                                C2975.m7942("Downloaded file:" + file.getName());
                                C2975.this.m8024(file, true);
                            }
                            if (C2500.m7027(file.getName())) {
                                C2975.m7942("Downloaded file:" + file.getName());
                                if (C2975.f9299 >= 21) {
                                    C3549.m8187(file);
                                } else {
                                    C2500.m7130(C2975.f9245.mo1874(), C2500.m7007(R.string.warning), C2500.m7007(R.string.installer_not_support_by_firmware));
                                }
                            }
                            if (file.getName().toLowerCase().endsWith(".apk")) {
                                C2975.m7942("Downloaded file:" + file.getName());
                                C3549.m8187(file);
                            }
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }

            RunnableC3076(String str) {
                this.f9547 = str;
            }

            @Override
            public void run() {
                C2975.m7956(new RunnableC3077());
            }
        }

        class RunnableC3078 implements Runnable {

            final String f9550;

            class RunnableC3079 implements Runnable {
                RunnableC3079() {
                }

                @Override
                public void run() {
                    try {
                        File file = new File(C2500.m7006() + RunnableC3078.this.f9550);
                        if (file.exists()) {
                            if (file.getName().toLowerCase().endsWith("lpzip")) {
                                C2975.m7942("Downloaded file:" + file.getName());
                                C2975.this.m8024(file, true);
                            }
                            if (C2500.m7027(file.getName())) {
                                C2975.m7942("Downloaded file:" + file.getName());
                                if (C2975.f9299 >= 21) {
                                    if (C2500.m6928(file) != null) {
                                        C3549.m8187(file);
                                    } else {
                                        C2500.m7130(C2975.f9245.mo1874(), C2500.m7007(R.string.warning), C2500.m7007(R.string.installer_error_bad_apks_file));
                                    }
                                } else {
                                    C2500.m7130(C2975.f9245.mo1874(), C2500.m7007(R.string.warning), C2500.m7007(R.string.installer_not_support_by_firmware));
                                }
                            }
                            if (file.getName().toLowerCase().endsWith(".apk")) {
                                C2975.m7942("Downloaded file:" + file.getName());
                                C3549.m8187(file);
                            }
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }

            RunnableC3078(String str) {
                this.f9550 = str;
            }

            @Override
            public void run() {
                C2975.m7942(this.f9550);
                C2975.m7956(new RunnableC3079());
            }
        }

        RunnableC3075(Uri uri, String str) {
            this.f9544 = uri;
            this.f9545 = str;
        }

        @Override
        public void run() {
            URL url;
            if (!this.f9544.toString().startsWith("http://") && !this.f9544.toString().startsWith("https://")) {
                File file = new File(C2500.m6952(C2975.this.mo1874(), this.f9544, this.f9545));
                C2975.m7942("file name from world:" + file.getAbsolutePath());
                if (file.getAbsolutePath().toLowerCase().endsWith("lpzip")) {
                    try {
                        C2975.this.m8024(file, false);
                    } catch (Throwable th) {
                        th.printStackTrace();
                    }
                }
                if (C2500.m7027(file.getAbsolutePath())) {
                    try {
                        if (C2975.f9299 >= 21) {
                            if (C2500.m6928(file) != null) {
                                C3549.m8187(file);
                            } else {
                                C2500.m7130(C2975.f9245.mo1874(), C2500.m7007(R.string.warning), C2500.m7007(R.string.installer_error_bad_apks_file));
                            }
                        } else {
                            C2500.m7130(C2975.f9245.mo1874(), C2500.m7007(R.string.warning), C2500.m7007(R.string.installer_not_support_by_firmware));
                        }
                    } catch (Throwable th2) {
                        th2.printStackTrace();
                    }
                }
                if (file.getAbsolutePath().toLowerCase().endsWith(".apk")) {
                    try {
                        C3549.m8187(file);
                        return;
                    } catch (Throwable th3) {
                        th3.printStackTrace();
                        return;
                    }
                }
                return;
            }
            try {
                url = new URL(this.f9544.toString());
            } catch (MalformedURLException e) {
                e.printStackTrace();
                url = null;
            }
            String m6950 = C2500.m6950(url.getPath());
            C2975.m7942("file name from world:" + m6950);
            if (m6950.toLowerCase().endsWith("lpzip") || C2500.m7027(m6950) || m6950.toLowerCase().endsWith(".apk")) {
                C2975.this.m8010(this.f9544.toString(), m6950, new RunnableC3076(m6950), new RunnableC3078(m6950));
            }
        }
    }

    public class RunnableC3080 implements Runnable {
        RunnableC3080() {
        }

        @Override
        public void run() {
            try {
                List<ResolveInfo> queryIntentActivities = C2975.m7929().getPackageManager().queryIntentActivities(new Intent("com.google.android.gms.settings.VERIFY_APPS_SETTINGS"), 66048);
                if (queryIntentActivities != null && queryIntentActivities.size() > 0) {
                    for (ResolveInfo resolveInfo : queryIntentActivities) {
                        int componentEnabledSetting = C2975.m7929().getPackageManager().getComponentEnabledSetting(new ComponentName(queryIntentActivities.get(0).activityInfo.packageName, queryIntentActivities.get(0).activityInfo.name));
                        if (componentEnabledSetting != 1 && componentEnabledSetting != 0) {
                            new C2500("").m7211("pm enable " + resolveInfo.activityInfo.packageName + InternalZipConstants.ZIP_FILE_SEPARATOR + resolveInfo.activityInfo.name);
                        } else {
                            new C2500("").m7211("pm disable " + resolveInfo.activityInfo.packageName + InternalZipConstants.ZIP_FILE_SEPARATOR + resolveInfo.activityInfo.name);
                        }
                    }
                }
            } catch (SecurityException unused) {
                C2975.m7942("Security exception occurred");
            }
        }
    }

    public class RunnableC3081 implements Runnable {

        final File f9553;

        final boolean f9554;

        class RunnableC3082 implements Runnable {

            final String f9556;

            final PackageInfo f9557;

            final File f9558;

            class DialogInterfaceOnClickListenerC3083 implements DialogInterface.OnClickListener {
                DialogInterfaceOnClickListenerC3083() {
                }

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    C2975.m7968(new C2939(C2975.m7929(), RunnableC3082.this.f9558, false), false);
                }
            }

            RunnableC3082(String str, PackageInfo packageInfo, File file) {
                this.f9556 = str;
                this.f9557 = packageInfo;
                this.f9558 = file;
            }

            @Override
            public void run() {
                C2500.m7125(C2500.m7007(R.string.warning), C2500.m7009(R.string.warning_for_unstall_apk_from_import_file, this.f9556, "" + this.f9557.versionName, "" + this.f9557.versionCode), new DialogInterfaceOnClickListenerC3083(), null, null);
            }
        }

        RunnableC3081(File file, boolean z) {
            this.f9553 = file;
            this.f9554 = z;
        }

        @Override
        public void run() {
            File[] listFiles;
            try {
                C2975.m7942("5");
                ZipFile zipFile = new ZipFile(this.f9553);
                try {
                    new C2500("").m7194(new File(C2975.f9251 + "/tmp/"));
                } catch (IOException e) {
                    e.printStackTrace();
                }
                String str = C2975.f9251 + "/tmp/";
                zipFile.extractAll(str);
                if (new File(str).exists() && (listFiles = new File(str).listFiles()) != null && listFiles.length > 0) {
                    ArrayList arrayList = new ArrayList();
                    for (File file : listFiles) {
                        if (!C2500.m6949(file.getName()).toLowerCase().equals("apk")) {
                            file.renameTo(new File(C2975.f9251 + "/CustomPatches/" + file.getName()));
                            arrayList.add(file.getName());
                        } else {
                            PackageInfo m6922 = C2500.m6922(file.getAbsolutePath(), 1);
                            String m6921 = C2500.m6921(file.getAbsolutePath());
                            if (m6921 != null && m6922 != null) {
                                String str2 = C2975.f9234;
                                C2975.m7954(new RunnableC3082(m6921, m6922, file));
                            }
                        }
                    }
                    if (arrayList.size() > 0) {
                        Iterator it = arrayList.iterator();
                        String str3 = "\n";
                        while (it.hasNext()) {
                            str3 = str3 + ((String) it.next()) + "\n";
                        }
                        C2975.m7962(C2500.m7007(R.string.well_done), C2500.m7007(R.string.lp_import_custom_patches) + str3);
                        C2975.f9257 = true;
                        C2975.m7949(false);
                    }
                }
            } catch (ZipException e2) {
                e2.printStackTrace();
                C2975.m7962(C2500.m7007(R.string.error), C2500.m7007(R.string.error_import_custom_patch));
            } catch (Exception e3) {
                e3.printStackTrace();
                C2975.m7962(C2500.m7007(R.string.error), C2500.m7007(R.string.unknown_error));
            }
            if (this.f9554) {
                this.f9553.delete();
            }
            C2975.f9282 = "";
            if (new File(C2975.f9251 + "/tmp2/").exists()) {
                try {
                    new C2500("").m7194(new File(C2975.f9251 + "/tmp2"));
                } catch (IOException e4) {
                    e4.printStackTrace();
                }
            }
        }
    }

    public class RunnableC3084 implements Runnable {
        RunnableC3084() {
        }

        @Override
        public void run() {
            C3746 c3746 = C2975.f9277;
            if (c3746 != null && c3746.m8243()) {
                C2975.f9277.m8248(C2500.m7007(R.string.patch_step1));
                C2975.f9277.m8249(6);
            }
        }
    }

    public class RunnableC3085 implements Runnable {
        RunnableC3085() {
        }

        @Override
        public void run() {
            C3746 c3746 = C2975.f9277;
            if (c3746 != null && c3746.m8243()) {
                C2975.f9277.m8248(C2500.m7007(R.string.patch_step7));
                C2975.f9277.m8249(7);
            }
        }
    }

    public class RunnableC3086 implements Runnable {
        RunnableC3086() {
        }

        @Override
        public void run() {
            C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.file_not_found));
            C2975.f9282 = "";
            C2975.m7951(23);
            C2975.m7970();
        }
    }

    public class RunnableC3087 implements Runnable {
        RunnableC3087() {
        }

        @Override
        public void run() {
        }
    }

    public class RunnableC3088 implements Runnable {
        RunnableC3088() {
        }

        @Override
        public void run() {
            C2975.m7951(23);
        }
    }

    public class RunnableC3089 implements Runnable {

        final boolean f9561;

        final String f9562;

        class RunnableC3090 implements Runnable {
            RunnableC3090() {
            }

            @Override
            public void run() {
                try {
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.unknown_error));
                } catch (Exception unused) {
                }
            }
        }

        RunnableC3089(boolean z, String str) {
            this.f9561 = z;
            this.f9562 = str;
        }

        @Override
        public void run() {
            String m7211;
            try {
                if (this.f9561) {
                    m7211 = new C2500("").m7211("pm enable " + this.f9562);
                } else {
                    m7211 = new C2500("").m7211("pm disable " + this.f9562);
                }
                C2975.m7942(m7211);
                if (m7211.contains("failed")) {
                    C2975.m7951(11);
                    C2975.m7954(new RunnableC3090());
                }
            } catch (Exception e) {
                e.printStackTrace();
                C2975.f9252.m8123(C2975.f9253.f10046);
                C2975.m7962(C2500.m7007(R.string.warning), e.toString());
                C2975.m7951(11);
            }
            C2975.f9252.m8123(C2975.f9253.f10046);
            C2975.m7951(11);
            Intent intent = new Intent(C2975.m7929(), (Class<?>) Widget2.class);
            intent.setAction(Widget2.f4805);
            C2975.m7929().sendBroadcast(intent);
        }
    }

    class DialogInterfaceOnClickListenerC3091 implements DialogInterface.OnClickListener {
        DialogInterfaceOnClickListenerC3091() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            C2975.this.mo1874().finish();
        }
    }

    class DialogInterfaceOnCancelListenerC3092 implements DialogInterface.OnCancelListener {
        DialogInterfaceOnCancelListenerC3092() {
        }

        @Override
        public void onCancel(DialogInterface dialogInterface) {
            C2975.this.mo1874().finish();
        }
    }

    public class RunnableC3093 implements Runnable {
        RunnableC3093() {
        }

        @Override
        public void run() {
            C2975 c2975 = C2975.f9245;
            if (c2975 != null) {
                Toast.makeText(c2975.mo1874(), C2500.m7007(R.string.backup_done) + " " + C2975.f9251 + "/Backup/", 1).show();
            }
        }
    }

    public class DialogInterfaceOnClickListenerC3094 implements DialogInterface.OnClickListener {

        final String[] f9567;

        DialogInterfaceOnClickListenerC3094(String[] strArr) {
            this.f9567 = strArr;
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            C2975.this.m8046(this.f9567, 555);
            for (String str : this.f9567) {
                C2975.m7942("ask:" + str);
            }
        }
    }

    public class RunnableC3095 implements Runnable {
        RunnableC3095() {
        }

        @Override
        public void run() {
            C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.root_access_not_found));
        }
    }

    class RunnableC3096 implements Runnable {
        RunnableC3096() {
        }

        @Override
        public void run() {
            if (!C2975.f9329 && C2500.m7017() == 32) {
                ArrayList<C3478> arrayList = C2975.f9332;
                if (arrayList == null) {
                    C2975.m7957(true);
                } else {
                    C2975 c2975 = C2975.this;
                    c2975.m7948(arrayList, c2975.m7935());
                }
            }
        }
    }

    public class DialogInterfaceOnCancelListenerC3097 implements DialogInterface.OnCancelListener {

        final String[] f9571;

        DialogInterfaceOnCancelListenerC3097(String[] strArr) {
            this.f9571 = strArr;
        }

        @Override
        public void onCancel(DialogInterface dialogInterface) {
            C2975.this.m8046(this.f9571, 555);
            for (String str : this.f9571) {
                C2975.m7942("ask:" + str);
            }
        }
    }

    public class RunnableC3098 implements Runnable {
        RunnableC3098() {
        }

        @Override
        public void run() {
            Toast.makeText(C2975.this.mo1874(), C2500.m7007(R.string.busybox_not_found), 1).show();
        }
    }

    public class RunnableC3099 implements Runnable {

        final String f9574;

        final File f9575;

        RunnableC3099(String str, File file) {
            this.f9574 = str;
            this.f9575 = file;
        }

        @Override
        public void run() {
            C2500.m7093("mkdir " + this.f9574);
            C2500.m6907(this.f9574);
            if (new C2500("").m7211("getenforce").toLowerCase().contains("enforcing")) {
                C2975.f9247 = "enforce";
            }
            C2500.m7101(this.f9575, C2975.f9250 + "%chelpus%" + C2975.f9299 + "%chelpus%" + C2975.f9246 + "%chelpus%" + C2975.f9247 + "%chelpus%" + C2500.m7171(C2975.f9295));
            StringBuilder sb = new StringBuilder();
            sb.append(this.f9574);
            sb.append(InternalZipConstants.ZIP_FILE_SEPARATOR);
            sb.append(C2975.f9355);
            C2500.m6907(sb.toString());
        }
    }

    public class RunnableC3100 implements Runnable {

        final PackageInfo f9577;

        final boolean[] f9578;

        class C3101 implements CompoundButton.OnCheckedChangeListener {
            C3101() {
            }

            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
                if (z) {
                    C2975.m7928().edit().putBoolean("use_random_name", true).commit();
                } else {
                    C2975.m7928().edit().putBoolean("use_random_name", false).commit();
                }
            }
        }

        class C3102 implements CompoundButton.OnCheckedChangeListener {
            C3102() {
            }

            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
                RunnableC3100.this.f9578[0] = z;
            }
        }

        class DialogInterfaceOnClickListenerC3103 implements DialogInterface.OnClickListener {

            class RunnableC3104 implements Runnable {
                RunnableC3104() {
                }

                @Override
                public void run() {
                    C2975.m7922(new File(C2975.m7929().getPackageCodePath()), RunnableC3100.this.f9578[0], C2975.m7928().getBoolean("use_random_name", true), false);
                }
            }

            DialogInterfaceOnClickListenerC3103() {
            }

            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                Thread thread = new Thread(new RunnableC3104());
                thread.setPriority(10);
                thread.start();
            }
        }

        class DialogInterfaceOnClickListenerC3105 implements DialogInterface.OnClickListener {
            DialogInterfaceOnClickListenerC3105() {
            }

            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                C2975.f9259.finish();
            }
        }

        class DialogInterfaceOnCancelListenerC3106 implements DialogInterface.OnCancelListener {
            DialogInterfaceOnCancelListenerC3106() {
            }

            @Override
            public void onCancel(DialogInterface dialogInterface) {
                C2975.f9259.finish();
            }
        }

        RunnableC3100(PackageInfo packageInfo, boolean[] zArr) {
            this.f9577 = packageInfo;
            this.f9578 = zArr;
        }

        @Override
        public void run() {
            C2500.m7126(C2500.m7007(R.string.title_installation_lp), C2500.m7009(R.string.message_installation_lp, "" + this.f9577.versionName), C2500.m7007(R.string.installation_option), new C3101(), true, C2500.m7007(R.string.option_installation_apk_install_on), new C3102(), false, new DialogInterfaceOnClickListenerC3103(), new DialogInterfaceOnClickListenerC3105(), new DialogInterfaceOnCancelListenerC3106(), false);
        }
    }

    public class C3107 extends ArrayList<Integer> {
        C3107() {
            add(Integer.valueOf(R.string.toolbar_switchers));
            add(Integer.valueOf(R.string.toolbar_system_utils));
            add(Integer.valueOf(R.string.toolbar_backups));
            add(Integer.valueOf(R.string.toolbar_rebuild));
            add(0);
            add(Integer.valueOf(R.string.settings));
            if (XposedUtils.isXposedEnabled()) {
                add(Integer.valueOf(R.string.xposed_settings));
            }
            if (C2975.f9283) {
                add(Integer.valueOf(R.string.manage_magisk_module_apps));
            }
            add(0);
            add(Integer.valueOf(R.string.menu_download_custom_patches));
            add(Integer.valueOf(R.string.update_lp));
            add(0);
            add(Integer.valueOf(R.string.context_menu_settings_show_last_added_custom_patches));
            add(Integer.valueOf(R.string.toolbar_refresh_apps));
            add(0);
            if (C2975.f9283) {
                add(Integer.valueOf(R.string.truble));
            }
            add(Integer.valueOf(R.string.share_lucky_patcher));
            if (!C2975.m7929().getApplicationInfo().loadLabel(C2975.m7932()).toString().startsWith("L") && C4345.m9693(C2975.m7929())) {
                add(Integer.valueOf(R.string.add_icon_to_desktop));
            }
            add(Integer.valueOf(R.string.import_settings));
            add(Integer.valueOf(R.string.export_settings));
            add(Integer.valueOf(R.string.help));
            add(Integer.valueOf(R.string.aboutmenu));
        }
    }

    public class C3108 extends ArrayAdapter<Integer> {

        ArrayAdapter<Integer> f9586;

        C3108(Context context, int i, List list) {
            super(context, i, list);
            this.f9586 = this;
        }

        @Override
        public View getView(int i, View view, ViewGroup viewGroup) {
            Integer num = (Integer) getItem(i);
            if (num.intValue() == 0) {
                return ((LayoutInflater) C2975.m7929().getSystemService("layout_inflater")).inflate(R.layout.razdelitel, viewGroup, false);
            }
            View inflate = ((LayoutInflater) C2975.m7929().getSystemService("layout_inflater")).inflate(R.layout.icon_context_menu, viewGroup, false);
            TextView textView = (TextView) inflate.findViewById(R.id.conttext);
            ImageView imageView = (ImageView) inflate.findViewById(R.id.imgIcon);
            imageView.setImageDrawable(null);
            textView.setTextAppearance(getContext(), C2975.m7934());
            textView.setCompoundDrawablePadding((int) ((C2975.m7933().getDisplayMetrics().density * 5.0f) + 0.5f));
            textView.setTextColor(-1);
            textView.setText(C2500.m6934(C2500.m7007(num.intValue()), "#A1C2F3", "bold"));
            switch (num.intValue()) {
                case R.string.aboutmenu:
                    imageView.setImageDrawable(C2975.m7933().getDrawable(R.drawable.outline_info_white_24));
                    imageView.setColorFilter(Color.parseColor("#A1C2F3"), PorterDuff.Mode.MULTIPLY);
                    break;
                case R.string.add_icon_to_desktop:
                    imageView.setImageDrawable(C2975.m7933().getDrawable(R.drawable.baseline_install_desktop_white_24));
                    imageView.setColorFilter(Color.parseColor("#A1C2F3"), PorterDuff.Mode.MULTIPLY);
                    break;
                case R.string.context_menu_settings_show_last_added_custom_patches:
                    imageView.setImageDrawable(C2975.m7933().getDrawable(R.drawable.outline_perm_device_information_white_24));
                    imageView.setColorFilter(Color.parseColor("#A1C2F3"), PorterDuff.Mode.MULTIPLY);
                    break;
                case R.string.export_settings:
                    imageView.setImageDrawable(C2975.m7933().getDrawable(R.drawable.outline_settings_backup_restore_white_24));
                    imageView.setColorFilter(Color.parseColor("#A1C2F3"), PorterDuff.Mode.MULTIPLY);
                    break;
                case R.string.help:
                    imageView.setImageDrawable(C2975.m7933().getDrawable(R.drawable.outline_help_outline_white_24));
                    imageView.setColorFilter(Color.parseColor("#A1C2F3"), PorterDuff.Mode.MULTIPLY);
                    break;
                case R.string.import_settings:
                    imageView.setImageDrawable(C2975.m7933().getDrawable(R.drawable.outline_refresh_white_24));
                    imageView.setColorFilter(Color.parseColor("#A1C2F3"), PorterDuff.Mode.MULTIPLY);
                    break;
                case R.string.manage_magisk_module_apps:
                    imageView.setImageDrawable(C2975.m7933().getDrawable(R.drawable.outline_settings_white_24));
                    imageView.setColorFilter(Color.parseColor("#A1C2F3"), PorterDuff.Mode.MULTIPLY);
                    break;
                case R.string.menu_download_custom_patches:
                    imageView.setImageDrawable(C2975.m7933().getDrawable(R.drawable.outline_get_app_white_24));
                    imageView.setColorFilter(Color.parseColor("#A1C2F3"), PorterDuff.Mode.MULTIPLY);
                    break;
                case R.string.settings:
                    imageView.setImageDrawable(C2975.m7933().getDrawable(R.drawable.outline_settings_white_24));
                    imageView.setColorFilter(Color.parseColor("#A1C2F3"), PorterDuff.Mode.MULTIPLY);
                    break;
                case R.string.share_lucky_patcher:
                    imageView.setImageDrawable(C2975.m7933().getDrawable(R.drawable.outline_share_white_24));
                    imageView.setColorFilter(Color.parseColor("#A1C2F3"), PorterDuff.Mode.MULTIPLY);
                    break;
                case R.string.toolbar_backups:
                    imageView.setImageDrawable(C2975.m7933().getDrawable(R.drawable.outline_settings_backup_restore_white_24));
                    imageView.setColorFilter(Color.parseColor("#A1C2F3"), PorterDuff.Mode.MULTIPLY);
                    break;
                case R.string.toolbar_rebuild:
                    imageView.setImageDrawable(C2975.m7933().getDrawable(R.drawable.outline_extension_white_24));
                    imageView.setColorFilter(Color.parseColor("#A1C2F3"), PorterDuff.Mode.MULTIPLY);
                    break;
                case R.string.toolbar_refresh_apps:
                    imageView.setImageDrawable(C2975.m7933().getDrawable(R.drawable.outline_refresh_white_24));
                    imageView.setColorFilter(Color.parseColor("#A1C2F3"), PorterDuff.Mode.MULTIPLY);
                    break;
                case R.string.toolbar_switchers:
                    imageView.setImageDrawable(C2975.m7933().getDrawable(R.drawable.outline_toggle_on_white_24));
                    imageView.setColorFilter(Color.parseColor("#A1C2F3"), PorterDuff.Mode.MULTIPLY);
                    break;
                case R.string.toolbar_system_utils:
                    imageView.setImageDrawable(C2975.m7933().getDrawable(R.drawable.outline_business_center_white_24));
                    imageView.setColorFilter(Color.parseColor("#A1C2F3"), PorterDuff.Mode.MULTIPLY);
                    break;
                case R.string.truble:
                    imageView.setImageDrawable(C2975.m7933().getDrawable(R.drawable.outline_wb_sunny_white_24));
                    imageView.setColorFilter(Color.parseColor("#A1C2F3"), PorterDuff.Mode.MULTIPLY);
                    break;
                case R.string.update_lp:
                    imageView.setImageDrawable(C2975.m7933().getDrawable(R.drawable.outline_get_app_white_24));
                    imageView.setColorFilter(Color.parseColor("#A1C2F3"), PorterDuff.Mode.MULTIPLY);
                    break;
                case R.string.xposed_settings:
                    imageView.setImageDrawable(C2975.m7933().getDrawable(R.drawable.outline_settings_white_24));
                    imageView.setColorFilter(Color.parseColor("#A1C2F3"), PorterDuff.Mode.MULTIPLY);
                    break;
            }
            return inflate;
        }

        @Override
        public boolean isEnabled(int i) {
            return ((Integer) getItem(i)).intValue() != 0;
        }
    }

    public class C3109 implements AdapterView.OnItemClickListener {

        final MainActivity f9587;

        C3109(MainActivity mainActivity) {
            this.f9587 = mainActivity;
        }

        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
            Integer num = (Integer) adapterView.getAdapter().getItem(i);
            DrawerLayout drawerLayout = this.f9587.mDrawerLayout;
            if (drawerLayout != null) {
                drawerLayout.m1715();
            }
            C2975 c2975 = C2975.f9245;
            if (c2975 != null) {
                c2975.m8049(num.intValue());
            }
        }
    }

    class DialogInterfaceOnClickListenerC3110 implements DialogInterface.OnClickListener {
        DialogInterfaceOnClickListenerC3110() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            C2975.this.m8041();
        }
    }

    class RunnableC3111 implements Runnable {
        RunnableC3111() {
        }

        @Override
        public void run() {
            if (C2975.f9283) {
                C2975.m7942("Enf: " + C2500.m6993());
                if (C2500.m6993().equals("enforce")) {
                    try {
                        new C2500("").m7211("setenforce 1");
                    } catch (Exception unused) {
                    }
                }
            }
            if (C2975.f9283) {
                C2975.m7926();
            }
            C2975.m7942("LuckyPatcher: EXIT!");
            C2975.this.mo1874().finish();
        }
    }

    public class RunnableC3112 implements Runnable {

        final String f9590;

        RunnableC3112(String str) {
            this.f9590 = str;
        }

        @Override
        public void run() {
            Toast.makeText(C2975.m7929(), this.f9590, 1).show();
        }
    }

    public class RunnableC3113 implements Runnable {

        final String f9591;

        final String f9592;

        RunnableC3113(String str, String str2) {
            this.f9591 = str;
            this.f9592 = str2;
        }

        @Override
        public void run() {
            C2913 c2913 = new C2913(C2975.f9245.mo1874());
            c2913.m7860(this.f9591);
            c2913.m7876(this.f9592);
            c2913.m7873(R.string.ok, null);
            try {
                C2500.m7117(c2913.m7851());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    class RunnableC3114 implements Runnable {
        RunnableC3114() {
        }

        @Override
        public void run() {
            try {
                new C2500().m7194(new File(C2500.m7006()));
            } catch (Throwable th) {
                th.printStackTrace();
            }
        }
    }

    class RunnableC3115 implements Runnable {

        class RunnableC3116 implements Runnable {

            class RunnableC3117 implements Runnable {

                class DialogInterfaceOnClickListenerC3118 implements DialogInterface.OnClickListener {

                    final String f9597;

                    class RunnableC3119 implements Runnable {
                        RunnableC3119() {
                        }

                        @Override
                        public void run() {
                            String str = DialogInterfaceOnClickListenerC3118.this.f9597;
                            if (str != null && !str.equals("")) {
                                for (String str2 : DialogInterfaceOnClickListenerC3118.this.f9597.split(",")) {
                                    C2975.m7942("emd for integrate update to /system:" + str2);
                                    new C2500("").m7211("pm uninstall -k " + str2);
                                }
                                C2975.m7928().edit().putString("uninstall_after_reboot", "").commit();
                            }
                        }
                    }

                    DialogInterfaceOnClickListenerC3118(String str) {
                        this.f9597 = str;
                    }

                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        C2975.m7956(new RunnableC3119());
                    }
                }

                class RunnableC3120 implements Runnable {
                    RunnableC3120() {
                    }

                    @Override
                    public void run() {
                        Toast.makeText(C2975.this.mo1874(), C2500.m7007(R.string.error_app_installed_on_sdcard), 1).show();
                    }
                }

                class RunnableC3121 implements Runnable {
                    RunnableC3121() {
                    }

                    @Override
                    public void run() {
                        C2975.m7958(C2975.f9259);
                    }
                }

                RunnableC3117() {
                }

                @Override
                public void run() {
                    Handler handler;
                    File file = new File(App.getInstance().getFilesDir() + "/AndroidManifest.xml");
                    if (file.exists()) {
                        file.delete();
                    }
                    File file2 = new File(App.getInstance().getFilesDir() + "/classes.dex");
                    if (file2.exists()) {
                        file2.delete();
                    }
                    File file3 = new File(App.getInstance().getFilesDir() + "/classes.dex.apk");
                    if (file3.exists()) {
                        file3.delete();
                    }
                    if (C2975.f9288 == 0) {
                        C2975.f9288 = 2000;
                    }
                    String string = C2975.m7928().getString("uninstall_after_reboot", "");
                    if (string != null && !string.equals("")) {
                        C2500.m7129(C2500.m7007(R.string.integrate_updates_result), C2500.m7007(R.string.integrate_updates_result_message_not_finished), new DialogInterfaceOnClickListenerC3118(string), null, null);
                    }
                    if (C2500.m7040(C2975.m7929().getPackageName()) && (handler = C2975.f9312) != null) {
                        handler.post(new RunnableC3120());
                    }
                    SharedPreferences.Editor edit = C2975.m7928().edit();
                    edit.putBoolean("Update0", true);
                    edit.commit();
                    C2975.this.m8062();
                    if (!C2975.m7928().getBoolean("first_run_ads_init", false)) {
                        C2975.m7928().edit().putBoolean("first_run_ads_init", true).commit();
                        SharedPreferences defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(C2975.m7929().getApplicationContext());
                        defaultSharedPreferences.edit().putString("IABConsent_SubjectToGDPR", "1").apply();
                        defaultSharedPreferences.edit().putString("IABConsent_ConsentString", "1").apply();
                    }
                    if (C2975.m7928().getBoolean("first_run_def_set_for_lp7", true)) {
                        C2975.m7928().edit().putBoolean("first_run_lvl_emulation", true).commit();
                        C2975.m7928().edit().putBoolean("first_run_fake_inapp_emulation", true).commit();
                        C2975.m7928().edit().putBoolean("first_run_def_set_for_lp7", false).commit();
                        C2975.m7928().edit().putBoolean("first_run_copy_custom_patches", true);
                    } else {
                        C2975.this.m8001();
                    }
                    if (C2975.m7928().getBoolean("first_run_lvl_emulation_new", true)) {
                        C2975.m7932().setComponentEnabledSetting(new ComponentName(C2975.m7929(), (Class<?>) LicensingService.class), 1, 1);
                        C2975.m7928().edit().putBoolean("first_run_lvl_emulation_new", false).commit();
                    }
                    C2975.this.m7978(C2975.f9259.getIntent());
                    if (!C2975.f9329) {
                        try {
                            Timer timer = new Timer("UnusedOdexTimer");
                            C3363 c3363 = new C3363();
                            C2975.f9315 = c3363;
                            timer.schedule(c3363, 5000L);
                            Timer timer2 = new Timer("FirstRunTimer");
                            C3361 c3361 = new C3361();
                            C2975.f9316 = c3361;
                            timer2.schedule(c3361, 15000L);
                        } catch (Throwable th) {
                            th.printStackTrace();
                        }
                        C2975.this.m8056();
                        if (C2975.f9283) {
                            C2975.this.m8084();
                        }
                        C2975.this.m8060();
                        if (C2975.f9283) {
                            C2975.this.m8061(true);
                        } else {
                            C2975.this.m8061(false);
                        }
                        C2975.m7954(new RunnableC3121());
                        C2975.this.m8069();
                    }
                }
            }

            RunnableC3116() {
            }

            @Override
            public void run() {
                Thread thread = new Thread(new RunnableC3117());
                thread.setPriority(10);
                thread.start();
            }
        }

        RunnableC3115() {
        }

        @Override
        public void run() {
            C2975.m7954(new RunnableC3116());
        }
    }

    public class RunnableC3122 implements Runnable {

        final String f9602;

        final SpannableStringBuilder f9603;

        RunnableC3122(String str, SpannableStringBuilder spannableStringBuilder) {
            this.f9602 = str;
            this.f9603 = spannableStringBuilder;
        }

        @Override
        public void run() {
            C2913 c2913 = new C2913(C2975.f9245.mo1874());
            c2913.m7860(this.f9602);
            c2913.m7874(this.f9603);
            c2913.m7873(R.string.ok, null);
            try {
                C2500.m7117(c2913.m7851());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    public class RunnableC3123 implements Runnable {

        class DialogInterfaceOnClickListenerC3124 implements DialogInterface.OnClickListener {
            DialogInterfaceOnClickListenerC3124() {
            }

            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                if (i != -2) {
                    if (i == -1) {
                        new AsyncTaskC3351().execute("Gruzimssite");
                    }
                } else if (C2975.this.f9417 != 999) {
                    SharedPreferences.Editor edit = C2975.m7928().edit();
                    edit.putBoolean("Update" + C2975.this.f9417, true);
                    edit.commit();
                }
            }
        }

        class RunnableC3125 implements Runnable {

            final DialogInterface.OnClickListener f9606;

            class RunnableC3126 implements Runnable {
                RunnableC3126() {
                }

                @Override
                public void run() {
                    String m7007 = C2500.m7007(R.string.update_found_title);
                    String str = C2500.m7007(R.string.new_version) + "\n\n" + C2500.m7007(R.string.begin_changelog) + " " + C2975.f9273 + "\n\nChangeLog:\n\n" + C2975.this.f9422;
                    String m70072 = C2500.m7007(R.string.update);
                    DialogInterface.OnClickListener onClickListener = RunnableC3125.this.f9606;
                    C2500.m7118(m7007, str, m70072, onClickListener, onClickListener, null, false, null, 20000L);
                }
            }

            RunnableC3125(DialogInterface.OnClickListener onClickListener) {
                this.f9606 = onClickListener;
            }

            @Override
            public void run() {
                if (C2975.m7928().getBoolean("remove_ads", false)) {
                    C2975.m7951(11);
                    String str = C2500.m7007(R.string.new_version) + "\n\n" + C2500.m7007(R.string.begin_changelog) + " " + C2975.f9273 + "\n\nChangeLog:\n\n" + C2975.this.f9422;
                    String m7007 = C2500.m7007(R.string.update);
                    DialogInterface.OnClickListener onClickListener = this.f9606;
                    C2500.m7120("", str, m7007, onClickListener, onClickListener, null, false);
                    return;
                }
                C2975.m7954(new RunnableC3126());
            }
        }

        RunnableC3123() {
        }

        @Override
        public void run() {
            C2471 c2471;
            C2975 c2975 = C2975.this;
            c2975.f9417 = 0;
            c2975.f9419 = "LuckyPatcherInstaller.apk";
            c2975.f9420 = "Lucky Patcher";
            c2975.f9421 = "package:" + C2975.f9279;
            File file = new File(new File(C2975.f9251 + "/Download/"), C2975.this.f9419);
            if (file.exists()) {
                file.delete();
            }
            C2471 c24712 = null;
            try {
                c2471 = C2500.m6985("Version.vers");
            } catch (Exception e) {
                e = e;
                c2471 = null;
            }
            try {
                if (c2471 != null) {
                    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                    c2471.m6817(byteArrayOutputStream);
                    C2975.this.f9417 = Integer.parseInt(byteArrayOutputStream.toString());
                } else {
                    C2975.this.f9417 = 0;
                }
                if (c2471 != null) {
                    c2471.m6832();
                }
            } catch (Exception e2) {
                e = e2;
                e.printStackTrace();
                if (c2471 != null) {
                    c2471.m6832();
                }
                if (C2975.this.f9417 >= C2975.m7928().getInt("http_versionCode", 0)) {
                }
                if (C2975.this.f9417 <= C2975.f9288) {
                }
            }
            if (C2975.this.f9417 >= C2975.m7928().getInt("http_versionCode", 0)) {
                C2975.m7928().edit().putInt("http_versionCode", C2975.this.f9417).commit();
            }
            if (C2975.this.f9417 <= C2975.f9288) {
                DialogInterfaceOnClickListenerC3124 dialogInterfaceOnClickListenerC3124 = new DialogInterfaceOnClickListenerC3124();
                try {
                    c24712 = C2500.m6985("Changelogs.vers");
                    ByteArrayOutputStream byteArrayOutputStream2 = new ByteArrayOutputStream();
                    c24712.m6817(byteArrayOutputStream2);
                    C2975.this.f9422 = byteArrayOutputStream2.toString();
                    c24712.m6832();
                    String str = C2975.this.f9422;
                    if (str != null && str.length() > 20) {
                        C2500.m7101(new File(C2975.f9251 + "/Changes/changelog.txt"), C2975.this.f9422);
                    }
                } catch (Exception e3) {
                    e3.printStackTrace();
                    if (c24712 != null) {
                        c24712.m6832();
                    }
                    C2975.m7951(11);
                }
                C2975.f9341 = true;
                C2975.m7954(new RunnableC3125(dialogInterfaceOnClickListenerC3124));
            }
        }
    }

    public class DialogInterfaceOnClickListenerC3127 implements DialogInterface.OnClickListener {

        class RunnableC3128 implements Runnable {

            class RunnableC3129 implements Runnable {
                RunnableC3129() {
                }

                @Override
                public void run() {
                    C2975.m7951(11);
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.odexed_not_all_apps));
                    C2975.f9282 = "";
                }
            }

            class RunnableC3130 implements Runnable {
                RunnableC3130() {
                }

                @Override
                public void run() {
                    C2975.m7951(11);
                    C2975.f9282 = "";
                }
            }

            RunnableC3128() {
            }

            @Override
            public void run() {
                C2500.m7078("/system", InternalZipConstants.WRITE_MODE);
                String m7211 = new C2500("").m7211(C2975.f9284 + C1551.class.getName() + " " + C2975.f9250);
                C2975.f9248 = m7211;
                if (!m7211.contains("Not enought space!") && !C2975.f9248.contains("IO Exception!")) {
                    C2975.m7954(new RunnableC3130());
                } else {
                    C2975.m7954(new RunnableC3129());
                }
                C2500.m7073();
            }
        }

        DialogInterfaceOnClickListenerC3127() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            if (i == -1) {
                try {
                    C2975.m7956(new RunnableC3128());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }

    public class DialogInterfaceOnClickListenerC3131 implements DialogInterface.OnClickListener {

        class RunnableC3132 implements Runnable {

            class RunnableC3133 implements Runnable {
                RunnableC3133() {
                }

                @Override
                public void run() {
                    C2975.m7951(11);
                    C2975.f9282 = "";
                }
            }

            RunnableC3132() {
            }

            @Override
            public void run() {
                C2975.m7929().deleteDatabase("BillingRestoreTransactions");
                C2975.m7954(new RunnableC3133());
            }
        }

        DialogInterfaceOnClickListenerC3131() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            if (i == -1) {
                try {
                    C2975.m7956(new RunnableC3132());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }

    public class DialogInterfaceOnClickListenerC3134 implements DialogInterface.OnClickListener {

        class RunnableC3135 implements Runnable {

            class RunnableC3136 implements Runnable {
                RunnableC3136() {
                }

                @Override
                public void run() {
                    C2975.m7951(11);
                    C2975.f9282 = "";
                }
            }

            RunnableC3135() {
            }

            @Override
            public void run() {
                C2500.m7078("/system", InternalZipConstants.WRITE_MODE);
                C2975.f9248 = new C2500("").m7211(C2975.f9284 + C1596.class.getName() + " " + C2975.f9250);
                C2975.m7949(false);
                C2500.m7078("/system", "ro");
                C2975.m7954(new RunnableC3136());
                C2500.m7073();
            }
        }

        DialogInterfaceOnClickListenerC3134() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            if (i == -1) {
                try {
                    C2975.m7956(new RunnableC3135());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }

    public class DialogInterfaceOnClickListenerC3137 implements DialogInterface.OnClickListener {

        class RunnableC3138 implements Runnable {

            class RunnableC3139 implements Runnable {
                RunnableC3139() {
                }

                @Override
                public void run() {
                    C2975.m7951(11);
                    C2975.f9282 = "";
                }
            }

            RunnableC3138() {
            }

            @Override
            public void run() {
                C2500.m7045();
                C2500.m7073();
                C2975.m7954(new RunnableC3139());
                C2500.m7073();
            }
        }

        DialogInterfaceOnClickListenerC3137() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            if (i == -1) {
                try {
                    C2975.m7956(new RunnableC3138());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }

    public class C3140 extends ArrayAdapter<C2638> {

        ArrayAdapter<C2638> f9622;

        class ViewOnClickListenerC3141 implements View.OnClickListener {
            ViewOnClickListenerC3141() {
            }

            @Override
            public void onClick(View view) {
                C2975.m7942(((C2638) view.getTag()).f7654);
                new C2636(C2975.m7929(), C2975.f9253.f10046).m7276((C2638) view.getTag());
                C3140.this.f9622.remove((C2638) view.getTag());
                if (C3140.this.f9622.getCount() == 0) {
                    C3140.this.f9622.add(new C2638(C2500.m7007(R.string.empty), "", "", 0, 0));
                }
                C3140.this.f9622.notifyDataSetChanged();
            }
        }

        C3140(Context context, int i, List list) {
            super(context, i, list);
            this.f9622 = this;
        }

        @Override
        public View getView(int i, View view, ViewGroup viewGroup) {
            C2638 c2638 = (C2638) getItem(i);
            if (view == null) {
                view = ((LayoutInflater) C2975.m7929().getSystemService("layout_inflater")).inflate(R.layout.purchases_for_delete, viewGroup, false);
            }
            TextView textView = (TextView) view.findViewById(R.id.conttext);
            Button button = (Button) view.findViewById(R.id.button_del);
            if (c2638.f7654.equals(C2500.m7007(R.string.empty)) && c2638.f7655.equals("") && c2638.f7656.equals("")) {
                button.setVisibility(8);
            } else {
                button.setTag(c2638);
                button.setOnClickListener(new ViewOnClickListenerC3141());
            }
            textView.setTextAppearance(getContext(), C2975.m7934());
            textView.setCompoundDrawablePadding((int) ((C2975.m7933().getDisplayMetrics().density * 5.0f) + 0.5f));
            textView.setTextColor(-1);
            textView.setText(c2638.f7654);
            int i2 = c2638.f7657;
            if (i2 == 1 || i2 == 2) {
                textView.append(C2500.m6934("\n" + C2500.m7007(R.string.purchase_db_dialog_saved_purchase), "#AAAAAA", ""));
            }
            if (c2638.f7658 == 1) {
                textView.append(C2500.m6934("\n" + C2500.m7007(R.string.purchase_db_dialog_auto_buy), "#AAAAAA", ""));
            }
            textView.setTypeface(null, 1);
            return view;
        }
    }

    public class DialogInterfaceOnClickListenerC3142 implements DialogInterface.OnClickListener {

        final Integer f9625;

        class RunnableC3143 implements Runnable {
            RunnableC3143() {
            }

            @Override
            public void run() {
                switch (DialogInterfaceOnClickListenerC3142.this.f9625.intValue()) {
                    case R.string.reboot:
                        C2500.m7073();
                        return;
                    case R.string.reboot_after_install_google_play_to_system_partition:
                    case R.string.reboot_message:
                    default:
                        return;
                    case R.string.reboot_to_bootloader:
                        C2500.m7074();
                        return;
                    case R.string.reboot_to_recovery:
                        C2500.m7075();
                        return;
                }
            }
        }

        DialogInterfaceOnClickListenerC3142(Integer num) {
            this.f9625 = num;
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            if (i == -1) {
                try {
                    C2975.m7956(new RunnableC3143());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }

    public class RunnableC3144 implements Runnable {

        class RunnableC3145 implements Runnable {
            RunnableC3145() {
            }

            @Override
            public void run() {
                C2975.m7960(11);
                C2975.f9276.m8238(false);
                C2975.f9276.m8239(C2500.m7007(R.string.wait));
            }
        }

        class RunnableC3146 implements Runnable {
            RunnableC3146() {
            }

            @Override
            public void run() {
                C2975.m7951(11);
                C3549.m8188();
                C2975.m7942("try rename file after patch");
                File file = C1601.f5276;
                if (file != null && file.exists()) {
                    C2975.m7962(C2500.m7007(R.string.warning), new File(C2975.f9282).getName() + " " + C2500.m7007(R.string.framework_file_patched) + " " + C1601.f5276.getName());
                    return;
                }
                if (!C1601.f5060) {
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.unknown_error));
                }
            }
        }

        RunnableC3144() {
        }

        @Override
        public void run() {
            C2975.m7954(new RunnableC3145());
            try {
                C2975.f9248 = "";
                String str = C2975.f9282;
                C1601.main(new String[]{"all", str, str, "framework"});
                if (C1601.f5060) {
                    C2975.m7962(C2500.m7007(R.string.information), C2500.m7007(R.string.framework_patch_not_result));
                }
                C2975.m7942(C2975.f9248);
            } catch (Exception e) {
                e.printStackTrace();
            }
            C2975.m7954(new RunnableC3146());
        }
    }

    public class RunnableC3147 implements Runnable {

        final Intent f9631;

        class C3148 implements CompoundButton.OnCheckedChangeListener {
            C3148() {
            }

            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
                if (z) {
                    C2975.m7928().edit().putBoolean("warning_play_protect", false).commit();
                } else {
                    C2975.m7928().edit().putBoolean("warning_play_protect", true).commit();
                }
            }
        }

        class DialogInterfaceOnClickListenerC3149 implements DialogInterface.OnClickListener {
            DialogInterfaceOnClickListenerC3149() {
            }

            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                try {
                    MainActivity mainActivity = C2975.f9259;
                    if (mainActivity != null) {
                        mainActivity.startActivity(RunnableC3147.this.f9631);
                    }
                } catch (Throwable th) {
                    th.printStackTrace();
                }
            }
        }

        RunnableC3147(Intent intent) {
            this.f9631 = intent;
        }

        @Override
        public void run() {
            C2500.m7128(C2500.m7007(R.string.warning), C2500.m7007(R.string.play_protect_warning) + "\n" + C2500.m7007(R.string.play_protect_warning2) + "\n" + C2500.m7007(R.string.play_protect_warning_question_1), C2500.m7007(R.string.warning_superSu_mount_name_space_separation_3), new C3148(), false, new DialogInterfaceOnClickListenerC3149(), null, null, true);
        }
    }

    class RunnableC3150 implements Runnable {

        final File f9635;

        class RunnableC3151 implements Runnable {
            RunnableC3151() {
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_restore));
                C2975.m7951(11);
            }
        }

        class RunnableC3152 implements Runnable {
            RunnableC3152() {
            }

            @Override
            public void run() {
                C2975.f9252.m8115(C2975.f9253.f10046).f10062 = false;
                C2975.f9252.m8115(C2975.f9253.f10046).f10060 = false;
                C2975.f9252.m8117(C2975.f9253);
            }
        }

        class RunnableC3153 implements Runnable {
            RunnableC3153() {
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_restore));
                C2975.m7951(11);
            }
        }

        class RunnableC3154 implements Runnable {
            RunnableC3154() {
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_restore));
                C2975.m7951(11);
            }
        }

        class RunnableC3155 implements Runnable {
            RunnableC3155() {
            }

            @Override
            public void run() {
                C2975.f9252.m8115(C2975.f9253.f10046).f10062 = false;
                C2975.f9252.m8115(C2975.f9253.f10046).f10060 = false;
                C2975.f9252.m8117(C2975.f9253);
            }
        }

        class RunnableC3156 implements Runnable {
            RunnableC3156() {
            }

            @Override
            public void run() {
                C2500.m7023(C2975.f9259, C2975.this.f9429, null);
                C2975.m7951(11);
            }
        }

        RunnableC3150(File file) {
            this.f9635 = file;
        }

        @Override
        public void run() {
            if (C2500.m7027(this.f9635.getName())) {
                if (C2975.f9283) {
                    if (C2500.m7025(this.f9635, null, "com.android.vending", false, false).toLowerCase().contains("success")) {
                        C2975.m7928().edit().putBoolean(C2975.f9253.f10046, false).commit();
                    } else {
                        C2975.m7942("LuckyPatcher restore app: delete package for install.");
                        C2500.m7112(C2975.f9253.f10046);
                        new C2500("").m7211("pm uninstall " + C2975.f9253.f10046);
                        if (C2500.m7025(this.f9635, null, "com.android.vending", false, false).toLowerCase().contains("success")) {
                            C2975.m7928().edit().putBoolean(C2975.f9253.f10046, false).commit();
                        } else {
                            C2975.m7954(new RunnableC3151());
                        }
                        C2500.m7090(C2975.f9253.f10046);
                    }
                    try {
                        if (C2975.f9252.m8115(C2975.f9253.f10046) != null) {
                            C2975.m7954(new RunnableC3152());
                            C2975.f9252.m8123(C2975.f9253.f10046);
                        }
                        C2975.m7928().edit().remove(C2975.f9253.f10046).commit();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    C2975.m7951(11);
                    return;
                }
                return;
            }
            if (C2975.f9283) {
                try {
                    String str = C2975.m7932().getPackageInfo(C2975.f9253.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                    C2500.m7093("rm " + C2500.m6976(str, false));
                    C2975.m7942("put refferer");
                    C2500.m7024(C2975.this.f9429.getAbsolutePath(), "com.android.vending", false, false);
                    String str2 = C2975.m7932().getPackageInfo(C2975.f9253.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                    C2975.m7942(str);
                    C2975.m7942(str2);
                    if (str.equals(str2)) {
                        C2975.m7942("LuckyPatcher restore app: delete package for install.");
                        C2500.m7112(C2975.f9253.f10046);
                        new C2500("").m7211("pm uninstall " + C2975.f9253.f10046);
                        C2500.m7024(C2975.this.f9429.getAbsolutePath(), "com.android.vending", false, false);
                        C2500.m7090(C2975.f9253.f10046);
                    }
                    C2975.m7928().edit().putBoolean(C2975.f9253.f10046, false).commit();
                } catch (PackageManager.NameNotFoundException e2) {
                    e2.printStackTrace();
                    C2975.m7954(new RunnableC3153());
                } catch (Exception e3) {
                    e3.printStackTrace();
                    C2975.m7954(new RunnableC3154());
                }
                try {
                    if (C2975.f9252.m8115(C2975.f9253.f10046) != null) {
                        C2975.m7954(new RunnableC3155());
                        C2975.f9252.m8123(C2975.f9253.f10046);
                    }
                    C2975.m7928().edit().remove(C2975.f9253.f10046).commit();
                } catch (Exception e4) {
                    e4.printStackTrace();
                }
                C2975.m7951(11);
                return;
            }
            C2975.m7954(new RunnableC3156());
        }
    }

    public class RunnableC3157 implements Runnable {

        final String f9643;

        class RunnableC3158 implements Runnable {
            RunnableC3158() {
            }

            @Override
            public void run() {
                C2975.m7960(11);
                C2975.f9276.m8238(false);
                C2975.f9276.m8239(C2500.m7007(R.string.wait));
            }
        }

        class DialogInterfaceOnClickListenerC3159 implements DialogInterface.OnClickListener {
            DialogInterfaceOnClickListenerC3159() {
            }

            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                C2500.m7073();
            }
        }

        class RunnableC3160 implements Runnable {

            class RunnableC3161 implements Runnable {
                RunnableC3161() {
                }

                @Override
                public void run() {
                    C2975.m7951(11);
                }
            }

            RunnableC3160() {
            }

            @Override
            public void run() {
                C2975.f9361 = RunnableC3157.this.f9643;
                C2975.m7954(new RunnableC3161());
            }
        }

        class DialogInterfaceOnClickListenerC3162 implements DialogInterface.OnClickListener {
            DialogInterfaceOnClickListenerC3162() {
            }

            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                C2500.m7073();
            }
        }

        class RunnableC3163 implements Runnable {
            RunnableC3163() {
            }

            @Override
            public void run() {
                C2975.m7951(11);
            }
        }

        class RunnableC3164 implements Runnable {
            RunnableC3164() {
            }

            @Override
            public void run() {
                C2975 c2975 = C2975.this;
                c2975.m7963(c2975.mo1874(), C2500.m7007(R.string.warning), C2500.m7007(R.string.no_space_in_system_all));
            }
        }

        class DialogInterfaceOnClickListenerC3165 implements DialogInterface.OnClickListener {
            DialogInterfaceOnClickListenerC3165() {
            }

            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                C2500.m7073();
            }
        }

        class RunnableC3166 implements Runnable {
            RunnableC3166() {
            }

            @Override
            public void run() {
                C2975.m7951(11);
                C2975.m7970();
            }
        }

        RunnableC3157(String str) {
            this.f9643 = str;
        }

        @Override
        public void run() {
            C2500.m7046("/system/framework/core.jar");
            C2500.m7046("/system/framework/services.jar");
            C2975.m7954(new RunnableC3158());
            try {
                if (C2975.f9319) {
                    new C2500("");
                    String m7092 = C2500.m7092(C1601.class, this.f9643, "empty", "empty", "magiskPatch", "" + C2500.m6905());
                    C2975.f9248 = m7092;
                    C2975.m7942(m7092);
                    C2500.m7125(C2500.m7007(R.string.information), C2500.m7007(R.string.message_for_reboot_after_android_patches), new DialogInterfaceOnClickListenerC3159(), null, null);
                } else if (C2975.f9318) {
                    C2975.m7942("patch only dalvik cache mode");
                    C2975.f9361 = "";
                    new C2500("");
                    String m70922 = C2500.m7092(C1601.class, this.f9643, "empty", "empty", "OnlyDalvik", "" + C2500.m6905());
                    C2975.f9248 = m70922;
                    C2975.m7942(m70922);
                    C2975.m7954(new RunnableC3160());
                    C2500.m7125(C2500.m7007(R.string.information), C2500.m7007(R.string.message_for_reboot_after_android_patches), new DialogInterfaceOnClickListenerC3162(), null, null);
                } else {
                    C2500.m7151();
                    C2975.m7942("start odex framework");
                    C2500.m7078("/system", InternalZipConstants.WRITE_MODE);
                    C2500.m7093("chattr -ai " + C2500.m6976("/system/framework/core.jar", false));
                    C2500.m7093("chattr -ai " + C2500.m6976("/system/framework/services.jar", false));
                    C2500.m7093("chattr -ai /system/framework/core.jar");
                    C2500.m7093("chattr -ai /system/framework/services.jar");
                    C2500.m7093("chattr -ai /system/framework/core-libart.jar");
                    C2500.m7093("chattr -ai /system/framework/core-oj.jar");
                    C2500.m7093("chattr -ai /system/framework/conscrypt.jar");
                    C2975.f9248 = "";
                    C2500.m7078("/system", InternalZipConstants.WRITE_MODE);
                    new C2500("");
                    String m70923 = C2500.m7092(C1601.class, this.f9643, "empty", "empty", "empty", "" + C2500.m6905());
                    C2975.f9248 = m70923;
                    C2975.m7942(m70923);
                    C2975.m7954(new RunnableC3163());
                    if (C2975.f9248.contains("LuckyPatcher: odex not equal lenght patched! Not enougth space in /system/!")) {
                        C2975.m7954(new RunnableC3164());
                    } else {
                        C2500.m7125(C2500.m7007(R.string.information), C2500.m7007(R.string.message_for_reboot_after_android_patches), new DialogInterfaceOnClickListenerC3165(), null, null);
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
            C2975.m7954(new RunnableC3166());
        }
    }

    public class RunnableC3167 implements Runnable {

        final C3478 f9654;

        RunnableC3167(C3478 c3478) {
            this.f9654 = c3478;
        }

        @Override
        public void run() {
            try {
                C2500.m7024(C2975.m7932().getPackageInfo(this.f9654.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir, "com.android.vending", false, false);
                if (C2975.f9245 != null) {
                    C2975.f9252.m8115(this.f9654.f10046).f10060 = false;
                }
                C2975.m7928().edit().putBoolean(this.f9654.f10046, false).commit();
            } catch (PackageManager.NameNotFoundException e) {
                e.printStackTrace();
            }
        }
    }

    public class RunnableC3168 implements Runnable {

        final C3478 f9656;

        class RunnableC3169 implements Runnable {
            RunnableC3169() {
            }

            @Override
            public void run() {
                C2975.f9281 = false;
                C2975.m7949(false);
                C2975.f9282 = "";
                C2975.m7951(11);
                C2975.m7962(C2500.m7007(R.string.well_done), C2500.m7007(R.string.app_install_success));
            }
        }

        RunnableC3168(C3478 c3478) {
            this.f9656 = c3478;
        }

        @Override
        public void run() {
            try {
                ArrayList<File> m7000 = C2500.m7000(this.f9656.f10046);
                m7000.add(new File(C2975.m7932().getPackageInfo(this.f9656.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir));
                if (C2500.m7025(null, m7000, "com.android.vending", false, false).toLowerCase().contains("success") || C2975.f9298.contains("Success")) {
                    C2975.m7954(new RunnableC3169());
                    if (C2975.f9245 != null) {
                        C2975.f9252.m8115(this.f9656.f10046).f10060 = false;
                    }
                    C2975.m7928().edit().putBoolean(this.f9656.f10046, false).commit();
                }
            } catch (PackageManager.NameNotFoundException e) {
                e.printStackTrace();
            }
        }
    }

    public class DialogInterfaceOnClickListenerC3170 implements DialogInterface.OnClickListener {

        final C3478 f9659;

        class RunnableC3171 implements Runnable {

            class RunnableC3172 implements Runnable {
                RunnableC3172() {
                }

                @Override
                public void run() {
                    Toast.makeText(C2975.this.mo1874(), C2500.m7007(R.string.remodex), 1).show();
                }
            }

            class RunnableC3173 implements Runnable {
                RunnableC3173() {
                }

                @Override
                public void run() {
                    Toast.makeText(C2975.this.mo1874(), C2500.m7007(R.string.remodexerror), 1).show();
                }
            }

            class RunnableC3174 implements Runnable {
                RunnableC3174() {
                }

                @Override
                public void run() {
                    Toast.makeText(C2975.this.mo1874(), C2500.m7007(R.string.remodex), 1).show();
                }
            }

            class RunnableC3175 implements Runnable {
                RunnableC3175() {
                }

                @Override
                public void run() {
                    Toast.makeText(C2975.this.mo1874(), C2500.m7007(R.string.remodexerror), 1).show();
                }
            }

            RunnableC3171() {
            }

            @Override
            public void run() {
                String str;
                String str2;
                String str3;
                try {
                    C2975.f9248 = "";
                    String str4 = C2975.m7932().getPackageInfo(DialogInterfaceOnClickListenerC3170.this.f9659.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                    if (C2500.m6935().equals("ART")) {
                        File m6948 = C2500.m6948(str4);
                        C2975.f9248 = new C2500("").m7211(C2975.f9284 + C1620.class.getName() + " " + DialogInterfaceOnClickListenerC3170.this.f9659.f10046 + " " + str4);
                        File m6947 = C2500.m6947(str4);
                        if (m6947 != null) {
                            C2500.m7093("rm " + m6947.getAbsolutePath());
                        }
                        if (!C2500.m6898(C2500.m6976(C2975.m7932().getPackageInfo(DialogInterfaceOnClickListenerC3170.this.f9659.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir, false))) {
                            C2975.m7928().edit().putBoolean(DialogInterfaceOnClickListenerC3170.this.f9659.f10046, false).commit();
                            C2975.f9252.m8123(DialogInterfaceOnClickListenerC3170.this.f9659.f10046);
                            C2975.m7954(new RunnableC3172());
                        } else {
                            C2975.m7954(new RunnableC3173());
                        }
                        if (!m6948.getAbsolutePath().contains("/arm/")) {
                            str = "";
                        } else {
                            str = "arm";
                        }
                        if (m6948.getAbsolutePath().contains("/arm64/")) {
                            str = "arm64";
                        }
                        if (m6948.getAbsolutePath().contains("/x86/")) {
                            str = "x86";
                        }
                        if (m6948.getAbsolutePath().contains("/x86_64/")) {
                            str = "x86_64";
                        }
                        if (C2975.f9299 >= 28) {
                            if (str.equals("")) {
                                str = C2500.m6964(m6948, "--instruction-set");
                            }
                            C2975.m7942("classpath parametr:" + C2500.m6964(m6948, "classpath"));
                            String m6963 = C2500.m6963(m6948, "--class-loader-context");
                            C2975.m7942("class-loader_contex:" + m6963);
                            if (!m6963.equals("")) {
                                str3 = "--class-loader-context=" + m6963;
                            } else if (DialogInterfaceOnClickListenerC3170.this.f9659.f10068) {
                                str3 = "--class-loader-context=PCL[]";
                            } else {
                                str3 = "--class-loader-context=PCL[/system/framework/org.apache.http.legacy.boot.jar]";
                            }
                            str2 = "dex2oat --dex-file=" + str4 + " --oat-file=" + m6948.getAbsolutePath() + " " + str3 + " --instruction-set=" + str;
                        } else {
                            str2 = "dex2oat --dex-file=" + str4 + " --oat-file=" + m6948.getAbsolutePath() + " --instruction-set=" + str;
                        }
                        C2975.m7942(new C2500("").m7211(str2));
                        C2500.m7093("chmod 644 " + m6948.getAbsolutePath());
                        C2500.m7093("chown 1000:" + C2975.m7932().getPackageInfo(DialogInterfaceOnClickListenerC3170.this.f9659.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.uid + " " + m6948.getAbsolutePath());
                        C2500.m7093("chown 1000." + C2975.m7932().getPackageInfo(DialogInterfaceOnClickListenerC3170.this.f9659.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.uid + " " + m6948.getAbsolutePath());
                        return;
                    }
                    C2975.f9248 = new C2500("").m7211(C2975.f9284 + C1620.class.getName() + " " + DialogInterfaceOnClickListenerC3170.this.f9659.f10046 + " " + str4);
                    if (!C2500.m6898(C2500.m6976(C2975.m7932().getPackageInfo(DialogInterfaceOnClickListenerC3170.this.f9659.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir, false))) {
                        C2975.m7928().edit().putBoolean(DialogInterfaceOnClickListenerC3170.this.f9659.f10046, false).commit();
                        C2975.f9252.m8123(DialogInterfaceOnClickListenerC3170.this.f9659.f10046);
                        C2975.m7954(new RunnableC3174());
                        return;
                    }
                    C2975.m7954(new RunnableC3175());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }

        DialogInterfaceOnClickListenerC3170(C3478 c3478) {
            this.f9659 = c3478;
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            if (i == -1) {
                try {
                    C2975.m7956(new RunnableC3171());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }

    public class RunnableC3176 implements Runnable {

        final C2597 f9666;

        final C3478 f9667;

        class RunnableC3177 implements Runnable {

            class C3178 implements CompoundButton.OnCheckedChangeListener {
                C3178() {
                }

                @Override
                public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
                    if (z) {
                        C2975.m7928().edit().putBoolean("warning_new_support_patch_dex", false).commit();
                    } else {
                        C2975.m7928().edit().putBoolean("warning_new_support_patch_dex", true).commit();
                    }
                }
            }

            RunnableC3177() {
            }

            @Override
            public void run() {
                C2500.m7131(C2500.m7007(R.string.warning), C2500.m7007(R.string.support_patch_billing_rebuild_dex_warning), C2500.m7007(R.string.warning_superSu_mount_name_space_separation_3), new C3178(), false, null, false);
            }
        }

        class RunnableC3179 implements Runnable {
            RunnableC3179() {
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.file_not_found));
                C2975.f9282 = "";
                C2975.m7951(23);
                C2975.m7970();
            }
        }

        class DialogInterfaceOnClickListenerC3180 implements DialogInterface.OnClickListener {
            DialogInterfaceOnClickListenerC3180() {
            }

            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                C2500.m7073();
            }
        }

        class DialogInterfaceOnClickListenerC3181 implements DialogInterface.OnClickListener {
            DialogInterfaceOnClickListenerC3181() {
            }

            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                C2500.m7073();
            }
        }

        class RunnableC3182 implements Runnable {

            class DialogInterfaceOnClickListenerC3183 implements DialogInterface.OnClickListener {
                DialogInterfaceOnClickListenerC3183() {
                }

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    try {
                        C2975.f9252.m8118();
                        C2975.f9253 = null;
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    C3549.m8203(C2500.m6942(RunnableC3176.this.f9666.f7340).getAbsolutePath());
                }
            }

            class DialogInterfaceOnClickListenerC3184 implements DialogInterface.OnClickListener {
                DialogInterfaceOnClickListenerC3184() {
                }

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    C3549.m8187(RunnableC3176.this.f9666.f7340);
                }
            }

            class DialogInterfaceOnClickListenerC3185 implements DialogInterface.OnClickListener {
                DialogInterfaceOnClickListenerC3185() {
                }

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    try {
                        C2975.m7968(new C2939(C2975.m7929(), RunnableC3176.this.f9666.f7340, false), false);
                    } catch (Exception e) {
                        e.printStackTrace();
                        C2975.m7962(C2500.m7007(R.string.error), C2500.m7007(R.string.unknown_error));
                    }
                }
            }

            RunnableC3182() {
            }

            @Override
            public void run() {
                C3549.m8188();
                C2975.m7951(23);
                LinearLayout linearLayout = (LinearLayout) View.inflate(C2975.f9245.mo1874(), R.layout.patchdialog, null);
                TextView textView = (TextView) ((LinearLayout) linearLayout.findViewById(R.id.patchbodyscroll).findViewById(R.id.dialogbodypatch)).findViewById(R.id.patchdesc);
                try {
                    C2597 c2597 = RunnableC3176.this.f9666;
                    C2975.m7946(textView, c2597.f7343, c2597);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                C2913 c2913 = new C2913(C2975.f9245.mo1874());
                c2913.m7872(R.drawable.ic_angel);
                C2597 c25972 = RunnableC3176.this.f9666;
                if (c25972.f7315) {
                    c2913.m7860(C2500.m7007(R.string.PatchResult));
                } else {
                    c2913.m7860(c25972.f7347);
                }
                C2975.m7942(RunnableC3176.this.f9666.f7340.getAbsolutePath());
                c2913.m7865(true).m7875(C2500.m7007(R.string.ok), null).m7878(C2500.m7007(R.string.go_to_file_path), new DialogInterfaceOnClickListenerC3184()).m7880(C2500.m7007(R.string.browse_to_file), new DialogInterfaceOnClickListenerC3183()).m7858(linearLayout);
                if (RunnableC3176.this.f9666.f7315) {
                    c2913.m7875(C2500.m7007(R.string.install_cloned_app), new DialogInterfaceOnClickListenerC3185());
                }
                c2913.m7851().show();
            }
        }

        class RunnableC3186 implements Runnable {
            RunnableC3186() {
            }

            @Override
            public void run() {
                C2975.m7951(23);
                C2975.m7962(C2500.m7007(R.string.error), C2500.m7007(R.string.not_detect));
            }
        }

        class RunnableC3187 implements Runnable {
            RunnableC3187() {
            }

            @Override
            public void run() {
                C2975.m7951(23);
                C2975.m7962(C2500.m7007(R.string.error), C2500.m7007(R.string.warning_for_no_free_space_on_device_to_patch));
            }
        }

        class RunnableC3188 implements Runnable {
            RunnableC3188() {
            }

            @Override
            public void run() {
                C2975.m7951(23);
                C2975.m7962(C2500.m7007(R.string.error), C2500.m7007(R.string.error_get_classes_files_for_patch));
            }
        }

        class C3189 extends ArrayList<String> {
            C3189() {
                add(C2975.f9237);
                add("com.android.vending.billing.InAppBillingService.BIND");
            }
        }

        class RunnableC3190 implements Runnable {
            RunnableC3190() {
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.no_freespace_patch));
            }
        }

        class RunnableC3191 implements Runnable {
            RunnableC3191() {
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_create_oat));
            }
        }

        class RunnableC3192 implements Runnable {
            RunnableC3192() {
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.no_space_in_data_all));
            }
        }

        class RunnableC3193 implements Runnable {
            RunnableC3193() {
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.unknown_error));
            }
        }

        class RunnableC3194 implements Runnable {

            class DialogInterfaceOnClickListenerC3195 implements DialogInterface.OnClickListener {

                class RunnableC3196 implements Runnable {
                    RunnableC3196() {
                    }

                    @Override
                    public void run() {
                        try {
                            C2500.m7053(C2975.m7929().getPackageManager().getPackageInfo(RunnableC3176.this.f9666.f7345, ItemType.CLASS_DATA_ITEM).applicationInfo.processName);
                        } catch (PackageManager.NameNotFoundException e) {
                            e.printStackTrace();
                        }
                        C2500.m7140(RunnableC3176.this.f9666.f7345);
                    }
                }

                DialogInterfaceOnClickListenerC3195() {
                }

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    try {
                        Intent launchIntentForPackage = C2975.m7932().getLaunchIntentForPackage(RunnableC3176.this.f9666.f7345);
                        if (C2975.f9283) {
                            new Thread(new RunnableC3196()).start();
                        } else {
                            MainActivity mainActivity = C2975.f9259;
                            if (mainActivity != null) {
                                mainActivity.startActivity(launchIntentForPackage);
                            }
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }

            RunnableC3194() {
            }

            @Override
            public void run() {
                C2975.m7951(23);
                LinearLayout linearLayout = (LinearLayout) View.inflate(C2975.f9245.mo1874(), R.layout.patchdialog, null);
                TextView textView = (TextView) ((LinearLayout) linearLayout.findViewById(R.id.patchbodyscroll).findViewById(R.id.dialogbodypatch)).findViewById(R.id.patchdesc);
                try {
                    C2975.m7942("LP test cp log:\n" + RunnableC3176.this.f9666.f7316);
                    C2597 c2597 = RunnableC3176.this.f9666;
                    C2975.m7946(textView, c2597.f7343, c2597);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                C2913 c2913 = new C2913(C2975.f9245.mo1874());
                c2913.m7872(R.drawable.ic_angel);
                c2913.m7860(C2500.m7007(R.string.PatchResult));
                c2913.m7865(true).m7875(C2500.m7007(R.string.ok), null).m7879(R.string.launchbutton, new DialogInterfaceOnClickListenerC3195()).m7858(linearLayout).m7851().show();
                if (RunnableC3176.this.f9666.f7343.contains("not enought free space for copy dalvik cache to odex.")) {
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.no_freespace_patch));
                }
            }
        }

        class RunnableC3197 implements Runnable {
            RunnableC3197() {
            }

            @Override
            public void run() {
                C3746 c3746 = C2975.f9277;
                if (c3746 != null && c3746.m8243()) {
                    C2975.f9277.m8248(C2500.m7007(R.string.patch_step6));
                    C2975.f9277.m8249(6);
                }
            }
        }

        class RunnableC3198 implements Runnable {
            RunnableC3198() {
            }

            @Override
            public void run() {
                C3746 c3746 = C2975.f9277;
                if (c3746 != null && c3746.m8243()) {
                    C2975.f9277.m8248(C2500.m7007(R.string.patch_step7));
                    C2975.f9277.m8249(6);
                }
            }
        }

        RunnableC3176(C2597 c2597, C3478 c3478) {
            this.f9666 = c2597;
            this.f9667 = c3478;
        }

        @Override
        public void run() {
            File dir;
            boolean z;
            C2597 c2597;
            boolean z2;
            boolean z3;
            boolean z4;
            C2597 c25972;
            boolean z5;
            boolean z6;
            C2597 c25973;
            boolean z7;
            C2597 c25974;
            boolean z8;
            File file;
            File file2;
            boolean z9;
            boolean z10;
            File file3;
            String str;
            String str2;
            boolean z11;
            boolean z12;
            String str3;
            String str4;
            String str5;
            boolean z13;
            String str6;
            Exception exc;
            File file4;
            ArrayList arrayList;
            File file5;
            Throwable th;
            File file6;
            File file7;
            String str7;
            Iterator it;
            File file8;
            String str8;
            String str9;
            boolean z14;
            String str10;
            String str11;
            C2597 c25975;
            File[] fileArr;
            boolean z15;
            boolean z16;
            int i;
            String str12;
            String str13;
            String str14;
            int m7083;
            byte[][] bArr;
            byte[][] bArr2;
            File file9;
            File[] fileArr2;
            boolean z17;
            File file10;
            File[] fileArr3;
            int i2;
            File file11;
            File file12;
            File file13 = this.f9666.f7329;
            if (file13 != null && C2500.m7027(file13.getName())) {
                this.f9666.f7327 = true;
            }
            C3478 c3478 = this.f9667;
            if (c3478 != null && C2500.m7047(c3478.f10046)) {
                this.f9666.f7327 = true;
            }
            C3549.m8159(C2500.m7007(R.string.wait), C2500.m7007(R.string.wait) + "...", 6, false, !C2975.m7928().getBoolean("remove_ads", false));
            do {
            } while (C2500.m7017() != 32);
            C2597 c25976 = this.f9666;
            if (c25976.f7342 && c25976.f7315) {
                dir = new File(C2975.f9251 + "/Modified/tmp");
                if (!dir.exists()) {
                    dir.mkdirs();
                }
            } else {
                dir = C2975.m7929().getDir("tmp", 0);
            }
            this.f9666.f7326 = C2975.f9251 + "/CustomPatches";
            this.f9666.f7328 = dir.getAbsolutePath();
            C2500.m6992(dir);
            C2975.m7942("original_apk_file:" + this.f9666.f7306);
            C2597 c25977 = this.f9666;
            String str15 = ".dex";
            if (c25977.f7304 && (file12 = c25977.f7306) != null) {
                if (C2500.m7027(file12.getName())) {
                    ArrayList<File> m6999 = C2500.m6999(this.f9666.f7306);
                    if (m6999 != null && m6999.size() > 0) {
                        Iterator<File> it2 = m6999.iterator();
                        while (it2.hasNext()) {
                            try {
                                C2420 c2420 = new C2420(it2.next());
                                Enumeration<C2419> m6611 = c2420.m6611();
                                while (m6611.hasMoreElements()) {
                                    C2419 nextElement = m6611.nextElement();
                                    String name = nextElement.getName();
                                    if (name.toLowerCase().endsWith(".so")) {
                                        this.f9666.f7308.add(new C2630(name, nextElement.getCrc(), nextElement.getTime()));
                                    }
                                }
                                c2420.close();
                            } catch (Throwable th2) {
                                th2.printStackTrace();
                            }
                        }
                    }
                    File m6928 = C2500.m6928(this.f9666.f7306);
                    try {
                        C2420 c24202 = new C2420(m6928);
                        Enumeration<C2419> m66112 = c24202.m6611();
                        while (m66112.hasMoreElements()) {
                            C2419 nextElement2 = m66112.nextElement();
                            String name2 = nextElement2.getName();
                            if (name2.toLowerCase().endsWith(".dex") || name2.toLowerCase().endsWith(".xml") || name2.toLowerCase().endsWith(".arsc")) {
                                this.f9666.f7308.add(new C2630(name2, nextElement2.getCrc(), nextElement2.getTime()));
                            }
                        }
                        c24202.close();
                    } catch (Throwable th3) {
                        th3.printStackTrace();
                    }
                    m6928.delete();
                } else {
                    try {
                        C2420 c24203 = new C2420(this.f9666.f7306);
                        Enumeration<C2419> m66113 = c24203.m6611();
                        while (m66113.hasMoreElements()) {
                            C2419 nextElement3 = m66113.nextElement();
                            String name3 = nextElement3.getName();
                            if (name3.toLowerCase().endsWith(".so")) {
                                this.f9666.f7308.add(new C2630(name3, nextElement3.getCrc(), nextElement3.getTime()));
                            }
                            if (name3.toLowerCase().endsWith(".dex") || name3.toLowerCase().endsWith(".xml") || name3.toLowerCase().endsWith(".arsc")) {
                                this.f9666.f7308.add(new C2630(name3, nextElement3.getCrc(), nextElement3.getTime()));
                            }
                        }
                        c24203.close();
                    } catch (Throwable th4) {
                        th4.printStackTrace();
                    }
                }
            }
            C2597 c25978 = this.f9666;
            if (c25978.f7302 && (file11 = c25978.f7303) != null && C2500.m7027(file11.getName())) {
                this.f9666.f7303 = C2500.m6928(this.f9666.f7303);
            }
            File file14 = this.f9666.f7329;
            String str16 = "";
            if (file14 != null) {
                try {
                    if (file14.exists() && this.f9666.f7329.canRead()) {
                        if (this.f9666.f7329.getName().toLowerCase().endsWith(".apk")) {
                            PackageInfo m6922 = C2500.m6922(this.f9666.f7329.getAbsolutePath(), 1);
                            C2597 c25979 = this.f9666;
                            c25979.f7345 = m6922.packageName;
                            c25979.f7347 = C2500.m6921(c25979.f7329.getAbsolutePath());
                            C2597 c259710 = this.f9666;
                            c259710.f7351 = c259710.f7329;
                            try {
                                c259710.f7349 = C2500.m6873("" + m6922.versionName);
                            } catch (Throwable th5) {
                                th5.printStackTrace();
                                this.f9666.f7349 = "unknown";
                            }
                            C2597 c259711 = this.f9666;
                            c259711.f7353 = m6922.versionCode;
                            C2635 m6994 = C2500.m6994(c259711.f7351);
                            C2597 c259712 = this.f9666;
                            c259712.f7354 = m6994.f7643;
                            c259712.f7338 = m6994.f7645;
                        }
                        if (C2500.m7027(this.f9666.f7329.getName())) {
                            C2597 c259713 = this.f9666;
                            c259713.f7345 = C2500.m6924(c259713.f7329);
                            C2597 c259714 = this.f9666;
                            c259714.f7347 = C2500.m6923(c259714.f7329);
                            C2597 c259715 = this.f9666;
                            c259715.f7351 = C2500.m6928(c259715.f7329);
                            C2597 c259716 = this.f9666;
                            c259716.f7337 = C2500.m6999(c259716.f7329);
                            try {
                                C2597 c259717 = this.f9666;
                                c259717.f7349 = C2500.m6873(C2500.m6926(c259717.f7329));
                            } catch (Throwable th6) {
                                th6.printStackTrace();
                                this.f9666.f7349 = "unknown";
                            }
                            C2597 c259718 = this.f9666;
                            c259718.f7353 = Integer.valueOf(C2500.m6925(c259718.f7329)).intValue();
                            C2635 m69942 = C2500.m6994(this.f9666.f7351);
                            C2597 c259719 = this.f9666;
                            c259719.f7354 = m69942.f7643;
                            c259719.f7338 = m69942.f7645;
                        }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            } else {
                if (this.f9667 != null) {
                    if (C2975.f9283) {
                        try {
                            String installerPackageName = C2975.m7932().getInstallerPackageName(this.f9667.f10046);
                            C2975.m7942("check reinstall needed");
                            File file15 = new File(C2975.m7932().getPackageInfo(this.f9667.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir);
                            if ((installerPackageName != null && !this.f9667.f10061 && !installerPackageName.contains("com.android.vending") && !installerPackageName.contains("com.amazon.venezia") && !installerPackageName.contains("com.google.android.feedback")) || (C2975.f9299 >= 30 && !this.f9667.f10061 && !C2500.m7092(C1674.class, file15.getAbsolutePath()).contains("ODEX FILE FOUND!"))) {
                                C2975.m7942("reinstall " + this.f9667.f10046 + " started");
                                C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_progress_reinstall_app), "", 1, 6, false);
                                if (!C2500.m7047(this.f9667.f10046)) {
                                    C2500.m7024(file15.getAbsolutePath(), "com.android.vending", false, false);
                                } else {
                                    ArrayList<File> m7000 = C2500.m7000(this.f9667.f10046);
                                    m7000.add(file15);
                                    C2500.m7025(null, m7000, "com.android.vending", false, false);
                                }
                            }
                        } catch (Throwable th7) {
                            th7.printStackTrace();
                        }
                    }
                    C2597 c259720 = this.f9666;
                    C3478 c34782 = this.f9667;
                    c259720.f7345 = c34782.f10046;
                    c259720.f7347 = c34782.f10047;
                    if (c34782.f10061) {
                        c259720.f7280 = "system";
                    }
                    try {
                        try {
                            c259720.f7351 = new File(C2975.m7932().getPackageInfo(this.f9666.f7345, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir);
                            this.f9666.f7349 = C2500.m6873("" + C2975.m7932().getPackageInfo(this.f9666.f7345, ItemType.CLASS_DATA_ITEM).versionName);
                        } catch (PackageManager.NameNotFoundException e2) {
                            e2.printStackTrace();
                        }
                    } catch (Throwable th8) {
                        th8.printStackTrace();
                        this.f9666.f7349 = "unknown";
                    }
                    this.f9666.f7353 = C2975.m7932().getPackageInfo(this.f9666.f7345, ItemType.CLASS_DATA_ITEM).versionCode;
                    try {
                        try {
                            this.f9666.f7354 = C2975.m7932().getPackageInfo(this.f9666.f7345, ItemType.CLASS_DATA_ITEM).applicationInfo.targetSdkVersion;
                            C2597 c259721 = this.f9666;
                            i2 = C2975.m7932().getPackageInfo(this.f9666.f7345, ItemType.CLASS_DATA_ITEM).applicationInfo.minSdkVersion;
                            c259721.f7338 = i2;
                        } catch (Throwable unused) {
                            C2635 m69943 = C2500.m6994(new File(C2975.m7932().getPackageInfo(this.f9666.f7345, ItemType.CLASS_DATA_ITEM).applicationInfo.publicSourceDir));
                            C2597 c259722 = this.f9666;
                            c259722.f7338 = m69943.f7645;
                            c259722.f7354 = m69943.f7643;
                        }
                        this.f9666.f7310 = String.valueOf(C2975.m7932().getPackageInfo(this.f9666.f7345, ItemType.CLASS_DATA_ITEM).applicationInfo.uid);
                        this.f9666.f7351 = new File(C2975.m7932().getPackageInfo(this.f9666.f7345, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir);
                        C2597 c259723 = this.f9666;
                        c259723.f7337 = C2500.m7000(c259723.f7345);
                    } catch (ApkFormatException e3) {
                        throw new RuntimeException(e3);
                    } catch (IOException e4) {
                        throw new RuntimeException(e4);
                    }
                }
                z = false;
                C2975.m7942("Name:" + this.f9666.f7347);
                C2975.m7942("PkgName:" + this.f9666.f7345);
                C2975.m7942("FileForRebuild:" + this.f9666.f7329);
                c2597 = this.f9666;
                z2 = c2597.f7279;
                if (!c2597.f7309 || c2597.f7305 || c2597.f7311) {
                    z2 = true;
                    z3 = true;
                } else {
                    z3 = z2;
                }
                if (c2597.f7313) {
                    z4 = false;
                } else {
                    c2597.m7240();
                    if (this.f9666.m7247()) {
                        z2 = true;
                    }
                    z4 = this.f9666.m7246() && this.f9666.f7342;
                    z3 = true;
                }
                c25972 = this.f9666;
                if (c25972.f7315) {
                    z5 = z4;
                    z6 = false;
                } else if (c25972.f7322.contains("DeepWork")) {
                    z6 = true;
                    z2 = true;
                    z3 = true;
                    z5 = true;
                } else {
                    z5 = z4;
                    z6 = false;
                    z2 = true;
                    z3 = true;
                }
                c25973 = this.f9666;
                if (!c25973.f7317 || c25973.f7319) {
                    z3 = true;
                }
                z7 = c25973.f7323;
                if (z7 && (c25973.f7290 || c25973.f7292)) {
                    z2 = true;
                    z3 = true;
                }
                if (z7 || c25973.f7350.equals("")) {
                    c25974 = this.f9666;
                    if (!c25974.f7283) {
                        if (c25974.f7281 == -1) {
                            if (c25974.f7336 == -1) {
                                if (c25974.f7282 == -1) {
                                }
                            }
                        }
                    }
                }
                z3 = true;
                C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_progress_get_classes), "", 1, 6, false);
                C2596 c2596 = new C2596(this.f9666.f7351, dir);
                if (z) {
                    File file16 = this.f9666.f7351;
                    if (file16 != null && file16.exists() && this.f9666.f7351.canRead()) {
                        c2596.m7230(this.f9666, z2, z3, z6, z5);
                        if (c2596.f7274 && c2596.f7273.getAbsolutePath().startsWith("/data/")) {
                            dir = new File(C2975.f9251 + "/Modified/tmp");
                            if (!dir.exists()) {
                                dir.mkdirs();
                            }
                            this.f9666.f7328 = dir.getAbsolutePath();
                            c2596.f7273 = dir;
                            c2596.f7274 = false;
                            c2596.m7230(this.f9666, z2, z3, z6, z5);
                            z8 = c2596.f7274;
                        } else {
                            z8 = false;
                        }
                        if (!z8) {
                            if (z2 && ((fileArr3 = c2596.f7268) == null || fileArr3.length == 0)) {
                                if (C2975.f9283) {
                                    C2500.m7093("chmod 644 " + this.f9666.f7351.getAbsolutePath());
                                } else {
                                    C2500.m7094("chmod", "644", this.f9666.f7351.getAbsolutePath());
                                }
                                c2596.m7230(this.f9666, z2, z3, z6, z5);
                                File[] fileArr4 = c2596.f7268;
                                if (fileArr4 == null || fileArr4.length == 0) {
                                    z = false;
                                }
                            }
                            if (z3 && ((file10 = c2596.f7269) == null || !file10.exists())) {
                                if (C2975.f9283) {
                                    C2500.m7093("chmod 644 " + this.f9666.f7351.getAbsolutePath());
                                } else {
                                    C2500.m7094("chmod", "644", this.f9666.f7351.getAbsolutePath());
                                }
                                c2596.m7230(this.f9666, z2, z3, z6, z5);
                                File file17 = c2596.f7269;
                                if (file17 != null) {
                                }
                            }
                            if (z) {
                                file = dir;
                                if (z8) {
                                    C2975.m7954(new RunnableC3187());
                                } else {
                                    C2975.m7954(new RunnableC3188());
                                }
                            } else {
                                C2597 c259724 = this.f9666;
                                c259724.f7331 = c2596.f7268;
                                c259724.f7333 = c2596.f7270;
                                c259724.f7335 = c2596.f7271;
                                String str17 = "SU Java-Code Running!";
                                if (c259724.f7313) {
                                    C2500.m6991();
                                    String str18 = (!C2975.f9283 || C2500.m7051()) ? "yes" : "no";
                                    C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_step2), C2500.m7007(R.string.patch_step_http), 2, 6, false);
                                    C2597 c259725 = this.f9666;
                                    z9 = z8;
                                    if (!c259725.f7342) {
                                        C2975.f9337 = this.f9667;
                                        new File(this.f9666.f7328).listFiles();
                                        C2597 c259726 = this.f9666;
                                        z10 = z5;
                                        C2597 c259727 = this.f9666;
                                        String m7092 = C2500.m7092(C1617.class, c259726.f7345, c259726.f7286.getAbsolutePath(), this.f9666.f7351.getAbsolutePath(), C2975.f9251 + "/CustomPatches", c259727.f7328, C2975.f9271, c259727.f7280, Build.CPU_ABI, "javaroot.utils", C2500.m6935(), this.f9666.f7310, str18, "" + this.f9666.f7353, C2500.m7169(this.f9666.f7337));
                                        if (m7092.contains("SU Java-Code Running!")) {
                                            m7092 = m7092.substring(m7092.indexOf("SU Java-Code Running!"));
                                        }
                                        this.f9666.f7316 = this.f9666.f7316 + m7092;
                                        C2975.m7942(this.f9666.f7316);
                                        this.f9666.m7251();
                                        this.f9666.m7241();
                                        C2597 c259728 = this.f9666;
                                        c259728.m7233(c259728.f7316);
                                        C2975.f9323 = Boolean.FALSE;
                                    } else {
                                        z10 = z5;
                                        c259725.m7251();
                                        this.f9666.m7241();
                                    }
                                    this.f9666.f7307 = ".crk.Custom.Patch";
                                } else {
                                    z9 = z8;
                                    z10 = z5;
                                }
                                C2597 c259729 = this.f9666;
                                boolean z18 = z6;
                                if (c259729.f7305) {
                                    C2600 c2600 = new C2600(c259729.f7345);
                                    z12 = z3;
                                    if (this.f9666.f7320.contains("pattern0")) {
                                        c2600.f7357 = true;
                                    }
                                    if (this.f9666.f7320.contains("pattern1")) {
                                        c2600.f7358 = true;
                                    }
                                    if (this.f9666.f7320.contains("pattern2")) {
                                        c2600.f7359 = true;
                                    }
                                    if (this.f9666.f7320.contains("pattern3")) {
                                        c2600.f7360 = true;
                                    }
                                    if (this.f9666.f7320.contains("pattern4")) {
                                        c2600.f7361 = true;
                                    }
                                    if (this.f9666.f7320.contains("pattern5")) {
                                        c2600.f7362 = true;
                                    }
                                    if (this.f9666.f7320.contains("pattern6")) {
                                        c2600.f7363 = true;
                                    }
                                    if (this.f9666.f7320.contains("dependencies")) {
                                        c2600.f7364 = true;
                                    }
                                    if (this.f9666.f7320.contains("fulloffline")) {
                                        c2600.f7365 = true;
                                    }
                                    this.f9666.f7343 = "runpatchads\n";
                                    C2634 m7259 = c2600.m7259();
                                    str = "com.android.vending";
                                    for (File file18 : this.f9666.f7331) {
                                    }
                                    this.f9666.m7252(m7259, null);
                                    C2597 c259730 = this.f9666;
                                    String str19 = c259730.f7343;
                                    c259730.f7314 = str19;
                                    C2975.m7942(str19);
                                    if (this.f9666.f7320.contains("pattern0")) {
                                        ArrayList arrayList2 = new ArrayList();
                                        ArrayList arrayList3 = new ArrayList();
                                        C2975.m7927(arrayList2, arrayList3);
                                        try {
                                            arrayList3.add("Lucky Patcher".getBytes("UTF-8"));
                                            arrayList3.add("lucky patcher".getBytes("UTF-8"));
                                            arrayList3.add("LUCKY PATCHER".getBytes("UTF-8"));
                                        } catch (Exception unused2) {
                                        }
                                        if (arrayList2.isEmpty()) {
                                            bArr = null;
                                        } else {
                                            C2975.m7942("site:" + arrayList2.size());
                                            bArr = (byte[][]) arrayList2.toArray(new byte[arrayList2.size()]);
                                        }
                                        if (arrayList3.isEmpty()) {
                                            bArr2 = null;
                                        } else {
                                            C2975.m7942("strs:" + arrayList3.size());
                                            bArr2 = (byte[][]) arrayList3.toArray(new byte[arrayList3.size()]);
                                        }
                                        C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_progress_strings_analisis), "", 3, 6, false);
                                        File[] fileArr5 = this.f9666.f7331;
                                        int length = fileArr5.length;
                                        str2 = ".apk";
                                        int i3 = 0;
                                        int i4 = 0;
                                        int i5 = 0;
                                        int i6 = 0;
                                        while (i3 < length) {
                                            int i7 = length;
                                            File file19 = fileArr5[i3];
                                            if (bArr != null) {
                                                fileArr2 = fileArr5;
                                                if (bArr.length > 0) {
                                                    file9 = dir;
                                                    z17 = z2;
                                                    i5 = C2500.m7113(file19.getAbsolutePath(), bArr, DerValue.TAG_APPLICATION, "http");
                                                    if (bArr2 != null && bArr2.length > 0) {
                                                        i6 = C2500.m7113(file19.getAbsolutePath(), bArr2, DerValue.TAG_APPLICATION, "");
                                                    }
                                                    i4 = i4 + i5 + i6;
                                                    if (!this.f9666.f7341.contains(file19) && i4 > 0) {
                                                        this.f9666.f7341.add(file19);
                                                    }
                                                    i3++;
                                                    length = i7;
                                                    fileArr5 = fileArr2;
                                                    dir = file9;
                                                    z2 = z17;
                                                } else {
                                                    file9 = dir;
                                                }
                                            } else {
                                                file9 = dir;
                                                fileArr2 = fileArr5;
                                            }
                                            z17 = z2;
                                            if (bArr2 != null) {
                                                i6 = C2500.m7113(file19.getAbsolutePath(), bArr2, DerValue.TAG_APPLICATION, "");
                                            }
                                            i4 = i4 + i5 + i6;
                                            if (!this.f9666.f7341.contains(file19)) {
                                                this.f9666.f7341.add(file19);
                                            }
                                            i3++;
                                            length = i7;
                                            fileArr5 = fileArr2;
                                            dir = file9;
                                            z2 = z17;
                                        }
                                        file3 = dir;
                                        z11 = z2;
                                        while (i4 > 0) {
                                            i4--;
                                            this.f9666.f7314 = this.f9666.f7314 + "Site from AdsBlockList blocked!";
                                        }
                                    } else {
                                        file3 = dir;
                                        str2 = ".apk";
                                        z11 = z2;
                                    }
                                    this.f9666.f7307 = ".crk.ADS.Removed";
                                } else {
                                    file3 = dir;
                                    str = "com.android.vending";
                                    str2 = ".apk";
                                    z11 = z2;
                                    z12 = z3;
                                }
                                C2597 c259731 = this.f9666;
                                if (c259731.f7311) {
                                    C2603 c2603 = new C2603(c259731.f7345);
                                    C2597 c259732 = this.f9666;
                                    if (c259732.f7294) {
                                        z16 = true;
                                        c2603.f7385 = true;
                                    } else {
                                        z16 = true;
                                    }
                                    if (c259732.f7324.contains("pattern1")) {
                                        c2603.f7386 = z16;
                                        c2603.f7387 = z16;
                                    }
                                    if (this.f9666.f7324.contains("newInappPatch")) {
                                        c2603.f7386 = z16;
                                        c2603.f7388 = z16;
                                    }
                                    if (this.f9666.f7324.contains("updatePatch")) {
                                        c2603.f7389 = z16;
                                    }
                                    if (c2603.f7387) {
                                        C2500.m7065(z16, false, false);
                                    }
                                    this.f9666.f7343 = "runpatchsupport\n";
                                    C2634 m7262 = c2603.m7262();
                                    if (c2603.f7388 && this.f9666.f7342 && C2975.m7928().getBoolean("warning_new_support_patch_dex", true)) {
                                        C2975.m7954(new RunnableC3177());
                                    }
                                    File[] fileArr6 = this.f9666.f7331;
                                    int length2 = fileArr6.length;
                                    int i8 = 0;
                                    while (i8 < length2) {
                                        File file20 = fileArr6[i8];
                                        String str20 = c2603.f7389 ? C2975.f9238 : "com.android.vending.billing.InAppBillingService.BIND";
                                        File[] fileArr7 = fileArr6;
                                        if (c2603.f7387) {
                                            i = length2;
                                            str12 = str16;
                                            str14 = str17;
                                            str13 = str15;
                                            m7083 = C2500.m7083(file20.getAbsolutePath(), new String[]{str20, "Lucky Patcher", "lucky patcher", "LUCKY PATCHER"}, false, new String[]{C2975.f9237, "Lucky Patches", "lucky patches", "LUCKY PATCHES"});
                                        } else {
                                            i = length2;
                                            str12 = str16;
                                            str13 = str15;
                                            str14 = str17;
                                            m7083 = C2500.m7083(file20.getAbsolutePath(), new String[]{"Lucky Patcher", "lucky patcher", "LUCKY PATCHER"}, false, new String[]{"Lucky Patches", "lucky patches", "LUCKY PATCHES"});
                                        }
                                        if (c2603.f7388) {
                                            C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_step_rebuild_dex) + "\n" + file20.getName(), "", 1, 6, false);
                                            if (c2603.f7389 || C2500.m7004(file20.getAbsolutePath(), new C3189(), false).size() > 0) {
                                                try {
                                                    File file21 = new File(C2500.m7176(file20.getAbsolutePath(), "tmp"));
                                                    file20.renameTo(file21);
                                                    BufferedInputStream bufferedInputStream = new BufferedInputStream(new FileInputStream(file21.getAbsolutePath()));
                                                    try {
                                                        C2975.f9350.add(new String[]{"com.android.vending.billing.InAppBillingService.BIND", PkgName.getPkgName()});
                                                        C2975.f9350.add(new String[]{C2975.f9237, PkgName.getPkgName()});
                                                        C2975.f9352 = true;
                                                        C2975.f9353 = true;
                                                        DexFileFactory.writeDexFile(file20.getAbsolutePath(), DexBackedDexFile.fromInputStream(null, bufferedInputStream));
                                                        C2975.f9350.clear();
                                                        C2975.f9352 = false;
                                                        C2975.f9353 = false;
                                                        C2975.f9354 = false;
                                                        bufferedInputStream.close();
                                                        file21.delete();
                                                        m7083++;
                                                    } catch (Throwable th9) {
                                                        try {
                                                            th9.printStackTrace();
                                                            C2500.m7130(C2975.f9259, C2500.m7007(R.string.warning), C2500.m7007(R.string.support_patch_billing_rebuild_dex_not_work));
                                                            return;
                                                        } finally {
                                                            bufferedInputStream.close();
                                                        }
                                                    }
                                                } catch (IOException e5) {
                                                    e5.printStackTrace();
                                                }
                                            }
                                        }
                                        if (m7083 > 0) {
                                            this.f9666.f7343 = this.f9666.f7343 + "support5 Fixed!\n";
                                        }
                                        this.f9666.f7343 = this.f9666.f7343 + "Relaced strings:" + m7083 + "\n";
                                        if (!this.f9666.f7341.contains(file20) && m7083 > 0) {
                                            this.f9666.f7341.add(file20);
                                        }
                                        i8++;
                                        fileArr6 = fileArr7;
                                        length2 = i;
                                        str16 = str12;
                                        str17 = str14;
                                        str15 = str13;
                                    }
                                    str3 = str16;
                                    str4 = str15;
                                    str5 = str17;
                                    this.f9666.m7252(m7262, null);
                                    C2597 c259733 = this.f9666;
                                    String str21 = c259733.f7343;
                                    c259733.f7334 = str21;
                                    C2975.m7942(str21);
                                    this.f9666.f7307 = ".crk.Support";
                                    C2975.m7932().setComponentEnabledSetting(new ComponentName(C2975.m7929(), (Class<?>) InAppBillingService.class), 1, 1);
                                    if (C2975.f9283) {
                                        C2500.m7056(true);
                                        C2500.m7058(true);
                                    }
                                } else {
                                    str3 = "";
                                    str4 = ".dex";
                                    str5 = "SU Java-Code Running!";
                                }
                                C2597 c259734 = this.f9666;
                                if (c259734.f7309) {
                                    C2601 c2601 = new C2601(c259734.f7345);
                                    if (this.f9666.f7318.contains("pattern1")) {
                                        z15 = true;
                                        c2601.f7368 = true;
                                    } else {
                                        z15 = true;
                                    }
                                    if (this.f9666.f7318.contains("pattern2")) {
                                        c2601.f7369 = z15;
                                    }
                                    if (this.f9666.f7318.contains("pattern3")) {
                                        c2601.f7370 = z15;
                                    }
                                    if (this.f9666.f7318.contains("pattern4")) {
                                        c2601.f7371 = z15;
                                    }
                                    if (this.f9666.f7318.contains("pattern5")) {
                                        c2601.f7372 = z15;
                                    }
                                    if (this.f9666.f7318.contains("pattern6")) {
                                        c2601.f7373 = z15;
                                    }
                                    if (this.f9666.f7318.contains("dependencies")) {
                                        c2601.f7374 = z15;
                                    }
                                    if (this.f9666.f7318.contains("amazon")) {
                                        c2601.f7375 = z15;
                                    }
                                    if (this.f9666.f7318.contains("samsung")) {
                                        c2601.f7376 = z15;
                                    }
                                    this.f9666.f7343 = "odexrunpatch\n";
                                    C2634 m7260 = c2601.m7260();
                                    for (File file22 : this.f9666.f7331) {
                                        int m70832 = C2500.m7083(file22.getAbsolutePath(), new String[]{"com.android.vending.billing.InAppBillingService.BIND", "Lucky Patcher", "lucky patcher", "LUCKY PATCHER"}, false, new String[]{C2975.f9237, "Lucky Patches", "lucky patches", "LUCKY PATCHES"});
                                        this.f9666.f7343 = this.f9666.f7343 + "Relaced strings:" + m70832;
                                        if (!this.f9666.f7341.contains(file22) && m70832 > 0) {
                                            this.f9666.f7341.add(file22);
                                        }
                                    }
                                    this.f9666.m7252(m7260, null);
                                    C2597 c259735 = this.f9666;
                                    String str22 = c259735.f7343;
                                    c259735.f7312 = str22;
                                    C2975.m7942(str22);
                                    C2597 c259736 = this.f9666;
                                    if (c259736.f7296) {
                                        c259736.f7307 = "crk.LVL.Auto";
                                    }
                                    if (c259736.f7318.contains("dependencies")) {
                                        this.f9666.f7307 = "crk.Dependencies";
                                    }
                                    if (this.f9666.f7318.contains("pattern5")) {
                                        this.f9666.f7307 = "crk.LVL.Auto";
                                    }
                                    if (this.f9666.f7318.contains("pattern6")) {
                                        this.f9666.f7307 = "crk.LVL.AutoInverse";
                                    }
                                    if (this.f9666.f7318.contains("pattern4")) {
                                        this.f9666.f7307 = "crk.LVL.Extreme";
                                    }
                                    if (this.f9666.f7318.contains("amazon")) {
                                        this.f9666.f7307 = "crk.Amazon";
                                    }
                                    if (this.f9666.f7318.contains("samsung")) {
                                        this.f9666.f7307 = "crk.SamsungApps";
                                    }
                                }
                                if (this.f9666.f7315) {
                                    C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_step1), "", 1, 6, false);
                                    C2597 c259737 = this.f9666;
                                    c259737.f7331 = c2596.f7268;
                                    c259737.f7348 = c2596.f7269;
                                    c259737.f7333 = c2596.f7270;
                                    c259737.f7307 = ".Clone";
                                }
                                C2597 c259738 = this.f9666;
                                if (c259738.f7317 || c259738.f7319) {
                                    c259738.f7348 = c2596.f7269;
                                    c259738.f7307 = ".Permissions.Removed";
                                }
                                if (c259738.f7323) {
                                    c259738.f7307 = ".resigned";
                                    if (c259738.f7302) {
                                        c259738.f7307 = ".orig_resigned_v1_v2";
                                    }
                                }
                                if (c259738.f7325) {
                                    c259738.f7307 = ".MultiPatch";
                                }
                                try {
                                    if (c259738.f7330) {
                                        C2975.m7942("create backup for " + this.f9666.f7345);
                                        new File(C2975.f9251 + "/Backup/").mkdirs();
                                        C2975.m7919(new C3478(this.f9666.f7345, 0, false), false);
                                    }
                                } catch (Throwable th10) {
                                    th10.printStackTrace();
                                }
                                C2597 c259739 = this.f9666;
                                if (c259739.f7279 || c259739.f7298 || c259739.f7300 || c259739.f7296 || c259739.f7292 || c259739.f7290 || c259739.f7294) {
                                    c259739.f7348 = c2596.f7269;
                                    try {
                                        C2975.m7942("start integrate");
                                        if (C2454.m6797(this.f9666)) {
                                            C2597 c259740 = this.f9666;
                                            if (c259740.f7294) {
                                                z13 = true;
                                                c259740.f7295 = true;
                                            } else {
                                                z13 = true;
                                            }
                                            if (c259740.f7290) {
                                                c259740.f7291 = z13;
                                            }
                                            if (c259740.f7292) {
                                                c259740.f7293 = z13;
                                            }
                                            if (c259740.f7296) {
                                                c259740.f7297 = z13;
                                            }
                                        }
                                    } catch (Exception e6) {
                                        e6.printStackTrace();
                                    }
                                }
                                C2597 c259741 = this.f9666;
                                if (!c259741.f7342) {
                                    ArrayList<File> arrayList4 = c259741.f7341;
                                    if (arrayList4 == null || arrayList4.size() <= 0) {
                                        str8 = str5;
                                        str9 = str4;
                                        z14 = false;
                                    } else {
                                        Iterator<File> it3 = this.f9666.f7341.iterator();
                                        while (true) {
                                            if (!it3.hasNext()) {
                                                str9 = str4;
                                                z14 = false;
                                                break;
                                            } else {
                                                str9 = str4;
                                                if (it3.next().getName().toLowerCase().endsWith(str9)) {
                                                    z14 = true;
                                                    break;
                                                }
                                                str4 = str9;
                                            }
                                        }
                                        if (z14 || (fileArr = (c25975 = this.f9666).f7331) == null || fileArr.length <= 0) {
                                            str8 = str5;
                                        } else {
                                            StringBuilder sb = new StringBuilder();
                                            sb.append(this.f9666.f7343);
                                            str8 = str5;
                                            sb.append(str8);
                                            c25975.f7343 = sb.toString();
                                        }
                                    }
                                    if (!z14 && z11) {
                                        this.f9666.f7343 = this.f9666.f7343 + str8;
                                    }
                                    this.f9666.m7239();
                                    File[] listFiles = new File(this.f9666.f7328).listFiles();
                                    C2975.m7942("tmp:" + this.f9666.f7328);
                                    for (File file23 : listFiles) {
                                        if (file23.getName().toLowerCase().startsWith("classes") && file23.getName().endsWith(str9)) {
                                            C2975.m7942("add:" + file23);
                                        }
                                    }
                                    if (z14) {
                                        C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_step4), "", 4, 6, false);
                                        if (this.f9666.f7330) {
                                            StringBuilder sb2 = new StringBuilder();
                                            str10 = str3;
                                            sb2.append(str10);
                                            sb2.append("copyDC");
                                            str11 = sb2.toString();
                                        } else {
                                            str10 = str3;
                                            str11 = str10;
                                        }
                                        if (this.f9666.f7332) {
                                            str11 = str11 + "deleteDC";
                                        }
                                        this.f9666.f7343 = this.f9666.f7343 + new C2500(str10).m7211(C2975.f9284 + C1629.class.getName() + " " + this.f9666.f7345 + " " + file3.getAbsolutePath() + " " + this.f9666.f7351.getAbsolutePath() + " " + C2975.m7929().getFilesDir() + " " + this.f9666.f7280 + " " + C2500.m6935() + " " + this.f9666.f7310 + " " + (this.f9666.f7327 ? "splitted" : "no_split") + " " + str11);
                                        C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_step6), "", 6, 6, false);
                                        C2975.f9323 = Boolean.FALSE;
                                        if (this.f9666.f7343.contains("chelpus_return_1")) {
                                            C2975.m7954(new RunnableC3190());
                                        }
                                        if (this.f9666.f7343.contains("chelpus_return_2")) {
                                            C2975.m7954(new RunnableC3191());
                                        }
                                        if (this.f9666.f7343.contains("chelpus_return_3")) {
                                            C2975.m7954(new RunnableC3192());
                                        }
                                        if (this.f9666.f7343.contains("chelpus_return_4")) {
                                            C2975.m7954(new RunnableC3193());
                                        }
                                    }
                                    C2500.m7053(this.f9666.f7345);
                                    try {
                                        C2500.m7053(C2975.m7929().getPackageManager().getPackageInfo(this.f9666.f7345, ItemType.CLASS_DATA_ITEM).applicationInfo.processName);
                                    } catch (PackageManager.NameNotFoundException e7) {
                                        e7.printStackTrace();
                                    }
                                    try {
                                        if (C2975.f9245 != null) {
                                            C2975.f9252.m8115(this.f9666.f7345).f10060 = true;
                                        }
                                        C2597 c259742 = this.f9666;
                                        if (!c259742.f7344 && C2975.f9245 != null) {
                                            C2975.f9252.m8115(c259742.f7345).f10062 = true;
                                        }
                                        C2975.m7928().edit().putBoolean(this.f9666.f7345, true).commit();
                                    } catch (Exception e8) {
                                        e8.printStackTrace();
                                    }
                                    C3479 c3479 = C2975.f9252;
                                    if (c3479 != null) {
                                        c3479.m8123(this.f9666.f7345);
                                    }
                                    C2975.m7954(new RunnableC3194());
                                    file = file3;
                                } else {
                                    String str23 = str3;
                                    String str24 = str4;
                                    if (C2975.m7966(true)) {
                                        C2597 c259743 = this.f9666;
                                        if (c259743.f7315) {
                                            c259743.m7235();
                                            try {
                                                if (this.f9666.f7350.equals(str23)) {
                                                    C2454.m6792(c2596.f7269, this.f9666.f7347 + " Clone");
                                                } else {
                                                    C2454.m6792(c2596.f7269, this.f9666.f7350);
                                                }
                                            } catch (IOException e9) {
                                                throw new RuntimeException(e9);
                                            }
                                        }
                                        C2597 c259744 = this.f9666;
                                        if (c259744.f7317 || c259744.f7319) {
                                            c259744.m7237();
                                        }
                                        this.f9666.m7239();
                                        C2975.m7954(new RunnableC3197());
                                        File file24 = new File(C2975.f9251 + "/Modified/" + C2500.m6873(this.f9666.f7347));
                                        file24.mkdirs();
                                        String str25 = ".v." + this.f9666.f7349 + ".b." + this.f9666.f7353 + ".minSDK" + this.f9666.f7338;
                                        C2597 c259745 = this.f9666;
                                        if (c259745.f7323) {
                                            try {
                                                if (!c259745.f7350.equals(str23)) {
                                                    C2597 c259746 = this.f9666;
                                                    File file25 = c2596.f7269;
                                                    c259746.f7348 = file25;
                                                    C2454.m6792(file25, c259746.f7350);
                                                    C2597 c259747 = this.f9666;
                                                    if (!c259747.f7341.contains(c259747.f7348)) {
                                                        C2597 c259748 = this.f9666;
                                                        c259748.f7341.add(c259748.f7348);
                                                    }
                                                }
                                                C2597 c259749 = this.f9666;
                                                if (c259749.f7283) {
                                                    File file26 = c2596.f7269;
                                                    c259749.f7348 = file26;
                                                    try {
                                                        C2932.m7885(file26);
                                                        C2597 c259750 = this.f9666;
                                                        if (!c259750.f7341.contains(c259750.f7348)) {
                                                            C2597 c259751 = this.f9666;
                                                            c259751.f7341.add(c259751.f7348);
                                                        }
                                                    } catch (IOException e10) {
                                                        throw new RuntimeException(e10);
                                                    }
                                                }
                                                C2597 c259752 = this.f9666;
                                                int i9 = c259752.f7336;
                                                if (i9 != -1) {
                                                    File file27 = c2596.f7269;
                                                    c259752.f7348 = file27;
                                                    C2454.m6796(file27, i9);
                                                    C2597 c259753 = this.f9666;
                                                    if (!c259753.f7341.contains(c259753.f7348)) {
                                                        C2597 c259754 = this.f9666;
                                                        c259754.f7341.add(c259754.f7348);
                                                    }
                                                }
                                                C2597 c259755 = this.f9666;
                                                int i10 = c259755.f7282;
                                                if (i10 != -1) {
                                                    File file28 = c2596.f7269;
                                                    c259755.f7348 = file28;
                                                    C2454.m6795(file28, i10);
                                                    C2597 c259756 = this.f9666;
                                                    if (!c259756.f7341.contains(c259756.f7348)) {
                                                        C2597 c259757 = this.f9666;
                                                        c259757.f7341.add(c259757.f7348);
                                                    }
                                                }
                                                C2597 c259758 = this.f9666;
                                                int i11 = c259758.f7352;
                                                if (i11 != -1) {
                                                    File file29 = c2596.f7269;
                                                    c259758.f7348 = file29;
                                                    C2454.m6794(file29, i11);
                                                    C2597 c259759 = this.f9666;
                                                    if (!c259759.f7341.contains(c259759.f7348)) {
                                                        C2597 c259760 = this.f9666;
                                                        c259760.f7341.add(c259760.f7348);
                                                    }
                                                }
                                                C2597 c259761 = this.f9666;
                                                int i12 = c259761.f7281;
                                                if (i12 != -1) {
                                                    File file30 = c2596.f7269;
                                                    c259761.f7348 = file30;
                                                    C2454.m6793(file30, i12);
                                                    C2597 c259762 = this.f9666;
                                                    if (!c259762.f7341.contains(c259762.f7348)) {
                                                        C2597 c259763 = this.f9666;
                                                        c259763.f7341.add(c259763.f7348);
                                                    }
                                                }
                                            } catch (IOException e11) {
                                                throw new RuntimeException(e11);
                                            }
                                        }
                                        C2597 c259764 = this.f9666;
                                        if (c259764.f7327) {
                                            if (c259764.f7329 != null && c259764.f7323) {
                                                c259764.f7340 = new File(C2500.m6951(this.f9666.f7329.getAbsolutePath()) + this.f9666.f7307 + ".apks");
                                            } else if (C2975.m7928().getInt("apkname", 0) == 0) {
                                                this.f9666.f7340 = new File(file24.getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR + C2500.m6873(this.f9666.f7347) + str25 + this.f9666.f7307 + ".apks");
                                            } else {
                                                this.f9666.f7340 = new File(file24.getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR + this.f9666.f7345 + str25 + this.f9666.f7307 + ".apks");
                                            }
                                            str6 = str2;
                                        } else if (c259764.f7329 != null && c259764.f7323) {
                                            StringBuilder sb3 = new StringBuilder();
                                            sb3.append(C2500.m6951(this.f9666.f7329.getAbsolutePath()));
                                            sb3.append(this.f9666.f7307);
                                            str6 = str2;
                                            sb3.append(str6);
                                            c259764.f7340 = new File(sb3.toString());
                                        } else {
                                            str6 = str2;
                                            if (C2975.m7928().getInt("apkname", 0) == 0) {
                                                this.f9666.f7340 = new File(file24.getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR + C2500.m6873(this.f9666.f7347) + str25 + this.f9666.f7307 + str6);
                                            } else {
                                                this.f9666.f7340 = new File(file24.getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR + this.f9666.f7345 + str25 + this.f9666.f7307 + str6);
                                            }
                                        }
                                        try {
                                            C2975.m7954(new RunnableC3198());
                                            arrayList = new ArrayList();
                                            try {
                                                file7 = new File(file3.getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR + this.f9666.f7345 + str6);
                                                file5 = file3;
                                                try {
                                                    c2596.m7228(file5, file7);
                                                } catch (Throwable th11) {
                                                    th = th11;
                                                    th = th;
                                                    file2 = file5;
                                                    try {
                                                        th.printStackTrace();
                                                        file6 = new File(file2.getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR + this.f9666.f7345 + str6);
                                                        if (file6.exists()) {
                                                        }
                                                        if (arrayList.size() > 0) {
                                                        }
                                                    } catch (Exception e12) {
                                                        exc = e12;
                                                        exc.printStackTrace();
                                                        file4 = this.f9666.f7340;
                                                        if (file4 == null) {
                                                        }
                                                        C2975.m7951(23);
                                                        if (c2596.f7277) {
                                                        }
                                                        C2500.m6992(file2);
                                                        C2500.m6992(new File(C2500.m7005()));
                                                    }
                                                    file4 = this.f9666.f7340;
                                                    if (file4 == null) {
                                                    }
                                                    C2975.m7951(23);
                                                    if (c2596.f7277) {
                                                    }
                                                    C2500.m6992(file2);
                                                    C2500.m6992(new File(C2500.m7005()));
                                                }
                                            } catch (Throwable th12) {
                                                th = th12;
                                                file5 = file3;
                                            }
                                        } catch (Exception e13) {
                                            exc = e13;
                                            file2 = file3;
                                        }
                                        if (!c2596.f7277) {
                                            if (!file7.exists()) {
                                                C2975.m7954(new RunnableC3179());
                                            }
                                            ArrayList<File> arrayList5 = this.f9666.f7341;
                                            if (arrayList5 != null && arrayList5.size() > 0) {
                                                Iterator<File> it4 = this.f9666.f7341.iterator();
                                                while (it4.hasNext()) {
                                                    arrayList.add(new C2912(it4.next().getAbsolutePath(), file5.getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR));
                                                }
                                            }
                                            C2597 c259765 = this.f9666;
                                            if (c259765.f7327) {
                                                if (c259765.f7319) {
                                                    File file31 = new File(file5.getAbsolutePath() + "/tmp/base.apk");
                                                    new File(file5.getAbsolutePath() + "/tmp").mkdirs();
                                                    String str26 = file5.getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR + this.f9666.f7345 + str6;
                                                    String absolutePath = file31.getAbsolutePath();
                                                    C2597 c259766 = this.f9666;
                                                    C2500.m7087(str26, absolutePath, arrayList, true, null, false, c259766.f7308, c259766.f7306, c259766);
                                                    if (file31.exists() && file31.length() > 0) {
                                                        if (this.f9666.f7351.getAbsolutePath().startsWith("/system/") && !C2500.m7173(this.f9666.f7351)) {
                                                            C2500.m6877(file31.getAbsolutePath(), this.f9666.f7351.getAbsolutePath(), true, false);
                                                            C2500.m7111(this.f9666.f7351.getAbsolutePath());
                                                            C2500.m7125(C2500.m7007(R.string.warning), C2500.m7007(R.string.system_app_change), new DialogInterfaceOnClickListenerC3180(), null, null);
                                                        } else {
                                                            this.f9666.f7337.add(file31);
                                                            C3549.m8185(C2500.m7009(R.string.patch_step9, this.f9666.f7347));
                                                            String m7025 = C2500.m7025(null, this.f9666.f7337, str, false, false);
                                                            String str27 = C2975.f9298;
                                                            String str28 = (str27 == null || str27.equals(str23)) ? m7025 : C2975.f9298;
                                                            if (!m7025.toLowerCase().contains("success") && !C2975.f9298.toLowerCase().contains("success")) {
                                                                C2975.m7962(C2500.m7007(R.string.error), C2500.m7007(R.string.error_installation) + "\n\n" + C2500.m7007(R.string.error) + ":\n" + str28);
                                                            }
                                                            C2975.m7962(C2500.m7007(R.string.information), C2500.m7007(R.string.well_done_change_components));
                                                        }
                                                    }
                                                    C2975.m7951(23);
                                                    C2500.m6992(file5);
                                                    C2500.m6992(new File(C2500.m7005()));
                                                    return;
                                                }
                                                String str29 = file5.getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR + this.f9666.f7345 + str6;
                                                String str30 = file5.getAbsolutePath() + "/base.apk";
                                                C2597 c259767 = this.f9666;
                                                C2500.m7087(str29, str30, arrayList, c259767.f7302, c259767.f7303, c259767.f7304, c259767.f7308, c259767.f7306, c259767);
                                                this.f9666.f7339.add(new File(file5.getAbsolutePath() + "/base.apk"));
                                                C2597 c259768 = this.f9666;
                                                if (c259768.f7315) {
                                                    boolean z19 = z9;
                                                    for (Iterator<File> it5 = c259768.f7337.iterator(); it5.hasNext(); it5 = it5) {
                                                        File next = it5.next();
                                                        this.f9666.f7351 = next;
                                                        C2975.m7942("LuckyPatcher: clone splitted apk - " + next.getName());
                                                        C2596 c25962 = new C2596(this.f9666.f7351, file5);
                                                        File file32 = this.f9666.f7351;
                                                        if (file32 != null && file32.exists() && this.f9666.f7351.canRead()) {
                                                            c25962.m7230(null, false, z12, z18, z10);
                                                            if (c25962.f7274 && c25962.f7273.getAbsolutePath().startsWith("/data/")) {
                                                                File file33 = new File(C2975.f9251 + "/Modified/tmp");
                                                                try {
                                                                    if (!file33.exists()) {
                                                                        file33.mkdirs();
                                                                    }
                                                                    this.f9666.f7328 = file33.getAbsolutePath();
                                                                    c25962.f7273 = file33;
                                                                    c25962.f7274 = false;
                                                                    c25962.m7230(null, false, z12, z18, z10);
                                                                    file5 = file33;
                                                                    z19 = c25962.f7274;
                                                                } catch (Throwable th13) {
                                                                    th = th13;
                                                                    file2 = file33;
                                                                    th.printStackTrace();
                                                                    file6 = new File(file2.getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR + this.f9666.f7345 + str6);
                                                                    if (file6.exists()) {
                                                                    }
                                                                    if (arrayList.size() > 0) {
                                                                    }
                                                                    file4 = this.f9666.f7340;
                                                                    if (file4 == null) {
                                                                    }
                                                                    C2975.m7951(23);
                                                                    if (c2596.f7277) {
                                                                    }
                                                                    C2500.m6992(file2);
                                                                    C2500.m6992(new File(C2500.m7005()));
                                                                }
                                                            }
                                                            if (z19) {
                                                                C2975.m7942("LuckyPatcher: free space not found for - " + this.f9666.f7351.getAbsolutePath());
                                                                C3549.m8202(null, true);
                                                                C2975.m7951(23);
                                                                C2500.m6992(file5);
                                                                C2500.m6992(new File(C2500.m7005()));
                                                                return;
                                                            }
                                                            if (z12 && ((file8 = c25962.f7269) == null || !file8.exists())) {
                                                                if (C2975.f9283) {
                                                                    C2500.m7093("chmod 644 " + this.f9666.f7351.getAbsolutePath());
                                                                } else {
                                                                    C2500.m7094("chmod", "644", this.f9666.f7351.getAbsolutePath());
                                                                }
                                                                c25962.m7230(null, z11, z12, z18, z10);
                                                                File file34 = c25962.f7269;
                                                                if (file34 != null) {
                                                                    file34.exists();
                                                                }
                                                            }
                                                        } else {
                                                            C2975.m7942("LuckyPatcher: cannot read source file - " + this.f9666.f7351.getAbsolutePath());
                                                        }
                                                        this.f9666.m7235();
                                                        arrayList.clear();
                                                        ArrayList<File> arrayList6 = this.f9666.f7341;
                                                        if (arrayList6 != null && arrayList6.size() > 0) {
                                                            Iterator<File> it6 = this.f9666.f7341.iterator();
                                                            while (it6.hasNext()) {
                                                                arrayList.add(new C2912(it6.next().getAbsolutePath(), file5.getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR));
                                                            }
                                                        }
                                                        String str31 = file5.getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR + this.f9666.f7345 + str6;
                                                        String str32 = file5.getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR + next.getName();
                                                        C2597 c259769 = this.f9666;
                                                        C2500.m7087(str31, str32, arrayList, c259769.f7302, c259769.f7303, c259769.f7304, c259769.f7308, c259769.f7306, c259769);
                                                        this.f9666.f7339.add(new File(file5.getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR + next.getName()));
                                                    }
                                                } else {
                                                    Iterator<File> it7 = c259768.f7337.iterator();
                                                    while (it7.hasNext()) {
                                                        File next2 = it7.next();
                                                        ArrayList arrayList7 = new ArrayList();
                                                        Iterator it8 = arrayList.iterator();
                                                        while (it8.hasNext()) {
                                                            C2912 c2912 = (C2912) it8.next();
                                                            StringBuilder sb4 = new StringBuilder();
                                                            Iterator<File> it9 = it7;
                                                            sb4.append("base path:");
                                                            sb4.append(c2912.f9079);
                                                            sb4.append(" file:");
                                                            sb4.append(c2912.f9078);
                                                            C2975.m7942(sb4.toString());
                                                            String replace = c2912.f9078.replace(c2912.f9079, str23);
                                                            if (replace.equalsIgnoreCase("androidmanifest.xml")) {
                                                                it = it8;
                                                            } else {
                                                                it = it8;
                                                                if (!replace.toLowerCase().startsWith("classes") || !replace.toLowerCase().endsWith(str24)) {
                                                                    C2975.m7942("entry added for ad to apk:" + replace);
                                                                    if (new File(c2912.f9078).exists()) {
                                                                        arrayList7.add(c2912);
                                                                    }
                                                                }
                                                            }
                                                            it7 = it9;
                                                            it8 = it;
                                                        }
                                                        Iterator<File> it10 = it7;
                                                        File file35 = new File(file5.getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR + next2.getName());
                                                        if (this.f9666.f7336 != -1) {
                                                            File file36 = new File(this.f9666.f7328 + "/AndroidManifest.xml");
                                                            if (C2500.m7154(next2, ApkUtils.ANDROID_MANIFEST_ZIP_ENTRY_NAME, file36) && file36.exists()) {
                                                                C2454.m6796(file36, this.f9666.f7336);
                                                                String absolutePath2 = file36.getAbsolutePath();
                                                                StringBuilder sb5 = new StringBuilder();
                                                                str7 = str24;
                                                                sb5.append(this.f9666.f7328);
                                                                sb5.append(InternalZipConstants.ZIP_FILE_SEPARATOR);
                                                                arrayList7.add(new C2912(absolutePath2, sb5.toString()));
                                                                if (file35.getName().toLowerCase().endsWith(str6)) {
                                                                    String absolutePath3 = next2.getAbsolutePath();
                                                                    String absolutePath4 = file35.getAbsolutePath();
                                                                    C2597 c259770 = this.f9666;
                                                                    C2500.m7087(absolutePath3, absolutePath4, arrayList7, c259770.f7302, c259770.f7303, c259770.f7304, c259770.f7308, c259770.f7306, null);
                                                                }
                                                                if (file35.exists() && file35.length() > 0) {
                                                                    this.f9666.f7339.add(file35);
                                                                }
                                                                it7 = it10;
                                                                str24 = str7;
                                                            }
                                                        }
                                                        str7 = str24;
                                                        if (file35.getName().toLowerCase().endsWith(str6)) {
                                                        }
                                                        if (file35.exists()) {
                                                            this.f9666.f7339.add(file35);
                                                        }
                                                        it7 = it10;
                                                        str24 = str7;
                                                    }
                                                }
                                                file2 = file5;
                                                try {
                                                    try {
                                                        C2597 c259771 = this.f9666;
                                                        C2500.m6881(c259771.f7340, c259771.f7339, c259771.f7345);
                                                        File file37 = this.f9666.f7340;
                                                        if (file37 != null && !file37.exists()) {
                                                            this.f9666.f7340 = null;
                                                        }
                                                        C2975.m7942(this.f9666.f7340.getAbsolutePath());
                                                        if (file7.exists()) {
                                                            file7.delete();
                                                        }
                                                    } catch (Throwable th14) {
                                                        th = th14;
                                                        th.printStackTrace();
                                                        file6 = new File(file2.getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR + this.f9666.f7345 + str6);
                                                        if (file6.exists()) {
                                                            file6.delete();
                                                        }
                                                        if (arrayList.size() > 0) {
                                                        }
                                                        file4 = this.f9666.f7340;
                                                        if (file4 == null) {
                                                        }
                                                        C2975.m7951(23);
                                                        if (c2596.f7277) {
                                                        }
                                                        C2500.m6992(file2);
                                                        C2500.m6992(new File(C2500.m7005()));
                                                    }
                                                } catch (Throwable th15) {
                                                    th15.printStackTrace();
                                                    C3549.m8202(th15, false);
                                                    C2975.m7951(23);
                                                    C2500.m6992(file2);
                                                    C2500.m6992(new File(C2500.m7005()));
                                                    return;
                                                }
                                            } else {
                                                String str33 = str;
                                                if (c259765.f7319) {
                                                    File file38 = new File(file5.getAbsolutePath() + "/tmp/base.apk");
                                                    new File(file5.getAbsolutePath() + "/tmp").mkdirs();
                                                    String str34 = file5.getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR + this.f9666.f7345 + str6;
                                                    String absolutePath5 = file38.getAbsolutePath();
                                                    C2597 c259772 = this.f9666;
                                                    C2500.m7087(str34, absolutePath5, arrayList, true, null, false, c259772.f7308, c259772.f7306, c259772);
                                                    if (file38.exists() && file38.length() > 0) {
                                                        if (this.f9666.f7351.getAbsolutePath().startsWith("/system/") && !C2500.m7173(this.f9666.f7351)) {
                                                            C2500.m6877(file38.getAbsolutePath(), this.f9666.f7351.getAbsolutePath(), true, false);
                                                            C2500.m7111(this.f9666.f7351.getAbsolutePath());
                                                            C2500.m7125(C2500.m7007(R.string.warning), C2500.m7007(R.string.system_app_change), new DialogInterfaceOnClickListenerC3181(), null, null);
                                                        } else {
                                                            this.f9666.f7337.add(file38);
                                                            try {
                                                                C3549.m8185(C2500.m7007(R.string.patch_step9) + "\n" + this.f9666.f7347);
                                                            } catch (Throwable unused3) {
                                                            }
                                                            C3549.m8185(C2500.m7009(R.string.patch_step9, this.f9666.f7347));
                                                            String m7024 = C2500.m7024(file38.getAbsolutePath(), str33, false, false);
                                                            String str35 = C2975.f9298;
                                                            String str36 = (str35 == null || str35.equals(str23)) ? m7024 : C2975.f9298;
                                                            if (!m7024.toLowerCase().contains("success") && !C2975.f9298.toLowerCase().contains("success")) {
                                                                C2975.m7962(C2500.m7007(R.string.error), C2500.m7007(R.string.error_installation) + "\n\n" + C2500.m7007(R.string.error) + ":\n" + str36);
                                                            }
                                                            C2975.m7962(C2500.m7007(R.string.information), C2500.m7007(R.string.well_done_change_components));
                                                        }
                                                    }
                                                    C2975.m7951(23);
                                                    C2500.m6992(file5);
                                                    C2500.m6992(new File(C2500.m7005()));
                                                    return;
                                                }
                                                String str37 = file5.getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR + this.f9666.f7345 + str6;
                                                String absolutePath6 = this.f9666.f7340.getAbsolutePath();
                                                C2597 c259773 = this.f9666;
                                                C2500.m7087(str37, absolutePath6, arrayList, c259773.f7302, c259773.f7303, c259773.f7304, c259773.f7308, c259773.f7306, c259773);
                                                File file39 = this.f9666.f7340;
                                                if (file39 != null && !file39.exists()) {
                                                    this.f9666.f7340 = null;
                                                }
                                                C2975.m7942(this.f9666.f7340.getAbsolutePath());
                                                if (file7.exists()) {
                                                    file7.delete();
                                                }
                                                file2 = file5;
                                            }
                                            if (arrayList.size() > 0) {
                                                Iterator it11 = arrayList.iterator();
                                                while (it11.hasNext()) {
                                                    C2912 c29122 = (C2912) it11.next();
                                                    if (new File(c29122.f9078).exists()) {
                                                        new File(c29122.f9078).delete();
                                                    }
                                                }
                                            }
                                            file4 = this.f9666.f7340;
                                            if (file4 == null && file4.exists()) {
                                                C2975.m7954(new RunnableC3182());
                                            } else {
                                                C2975.m7951(23);
                                                if (c2596.f7277) {
                                                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.message_about_corrupt_apk_file));
                                                } else {
                                                    C2975.m7962(C2500.m7007(R.string.error), C2500.m7007(R.string.unknown_error));
                                                }
                                            }
                                            C2500.m6992(file2);
                                            C2500.m6992(new File(C2500.m7005()));
                                        }
                                        throw new Exception("corrupt sorce apk file");
                                    }
                                    file = file3;
                                    C2975.m7954(new RunnableC3186());
                                }
                            }
                            file2 = file;
                            C2500.m6992(file2);
                            C2500.m6992(new File(C2500.m7005()));
                        }
                        z = false;
                        if (z) {
                        }
                        file2 = file;
                        C2500.m6992(file2);
                        C2500.m6992(new File(C2500.m7005()));
                    }
                    z = false;
                }
                z8 = false;
                if (z) {
                }
                file2 = file;
                C2500.m6992(file2);
                C2500.m6992(new File(C2500.m7005()));
            }
            z = true;
            C2975.m7942("Name:" + this.f9666.f7347);
            C2975.m7942("PkgName:" + this.f9666.f7345);
            C2975.m7942("FileForRebuild:" + this.f9666.f7329);
            c2597 = this.f9666;
            z2 = c2597.f7279;
            if (c2597.f7309) {
            }
            z2 = true;
            z3 = true;
            if (c2597.f7313) {
            }
            c25972 = this.f9666;
            if (c25972.f7315) {
            }
            c25973 = this.f9666;
            if (!c25973.f7317) {
            }
            z3 = true;
            z7 = c25973.f7323;
            if (z7) {
                z2 = true;
                z3 = true;
            }
            if (z7) {
            }
            c25974 = this.f9666;
            if (!c25974.f7283) {
            }
            z3 = true;
            C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_progress_get_classes), "", 1, 6, false);
            C2596 c25963 = new C2596(this.f9666.f7351, dir);
            if (z) {
            }
            z8 = false;
            if (z) {
            }
            file2 = file;
            C2500.m6992(file2);
            C2500.m6992(new File(C2500.m7005()));
        }
    }

    public class RunnableC3199 implements Runnable {

        final boolean f9690;

        RunnableC3199(boolean z) {
            this.f9690 = z;
        }

        @Override
        public void run() {
            if (this.f9690) {
                new C2500("").m7211("pm enable " + C2975.f9253.f10046 + "/android.permission.INTERNET");
                return;
            }
            new C2500("").m7211("pm disable " + C2975.f9253.f10046 + "/android.permission.INTERNET");
        }
    }

    public class RunnableC3200 implements Runnable {

        class RunnableC3201 implements Runnable {
            RunnableC3201() {
            }

            @Override
            public void run() {
                C2975.m7960(11);
                C2975.f9276.m8238(true);
                C2975.f9276.m8239(C2500.m7007(R.string.wait));
            }
        }

        class RunnableC3202 implements Runnable {
            RunnableC3202() {
            }

            @Override
            public void run() {
                C2975.f9264.notifyDataSetChanged();
            }
        }

        RunnableC3200() {
        }

        @Override
        public void run() {
            long j;
            PackageInfo m6974 = C2500.m6974("com.android.vending", 0);
            if (m6974 != null) {
                try {
                    j = new File(C2500.m6976(m6974.applicationInfo.sourceDir, false)).length();
                } catch (Exception unused) {
                    j = 0;
                }
                if (j <= 1048576 && j != 0) {
                    C2975.m7954(new RunnableC3201());
                    try {
                        new C2500("").m7211(C2975.f9284 + C1559.class.getName() + " " + m6974.applicationInfo.sourceDir + " " + C2975.f9250 + " " + String.valueOf(m6974.applicationInfo.uid) + " recovery");
                        C2500.m7056(true);
                        C2500.m7058(true);
                        C2500.m7053("com.android.vending");
                        C2975.m7954(new RunnableC3202());
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }
        }
    }

    public class RunnableC3203 implements Runnable {

        class RunnableC3204 implements Runnable {
            RunnableC3204() {
            }

            @Override
            public void run() {
                C2975.m7951(7);
                C2975.m7960(10);
            }
        }

        RunnableC3203() {
        }

        @Override
        public void run() {
            C2975.m7951(10);
            C2975.this.m8022();
            C2975.this.m7996();
            C2975.m7954(new RunnableC3204());
        }
    }

    public class RunnableC3205 implements Runnable {

        class C3206 implements Comparator<C2614> {
            C3206() {
            }

            @Override
            public int compare(C2614 c2614, C2614 c26142) {
                return Long.valueOf(c26142.f7456).compareTo(Long.valueOf(c2614.f7456));
            }
        }

        class RunnableC3207 implements Runnable {

            final ArrayList f9699;

            class DialogInterfaceOnClickListenerC3208 implements DialogInterface.OnClickListener {
                DialogInterfaceOnClickListenerC3208() {
                }

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    ArrayList<File> arrayList = C2975.f9338;
                    if (arrayList != null && arrayList.size() > 0) {
                        if (C2975.f9338.size() == 1) {
                            C2975.f9255 = C2975.f9338.get(0);
                            C2975.this.m7975(C2975.f9253, "custom");
                            return;
                        }
                        Iterator<File> it = C2975.f9338.iterator();
                        String str = "";
                        while (it.hasNext()) {
                            str = str + C2500.m7072(it.next()) + "\n[NEXT_PATCH]\n";
                        }
                        File file = new File(C2500.m6942(C2975.f9338.get(0)).getAbsolutePath() + "/join_patch.txt");
                        file.delete();
                        if (!file.exists()) {
                            C2500.m7101(file, str);
                            if (file.exists()) {
                                C2975.f9255 = file;
                                C2975.this.m7975(C2975.f9253, "custom");
                                return;
                            } else {
                                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_create_join_custom_patch));
                                return;
                            }
                        }
                        C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_delete_join_custom_patch));
                        return;
                    }
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.need_select_custom_patch));
                }
            }

            class C3209 extends ArrayAdapter<C2614> {

                TextView f9702;

                TextView f9703;

                C3209(Context context, int i, List list) {
                    super(context, i, list);
                }

                @Override
                public View getView(int i, View view, ViewGroup viewGroup) {
                    C2614 c2614 = (C2614) getItem(i);
                    View inflate = ((LayoutInflater) C2975.m7929().getSystemService("layout_inflater")).inflate(R.layout.selectpatch, viewGroup, false);
                    this.f9702 = (TextView) inflate.findViewById(R.id.txtTitle);
                    this.f9703 = (TextView) inflate.findViewById(R.id.txtStatus);
                    this.f9702.setTextAppearance(getContext(), C2975.m7934());
                    this.f9703.setTextAppearance(getContext(), C2975.m7934());
                    CheckBox checkBox = (CheckBox) inflate.findViewById(R.id.CheckBox1);
                    checkBox.setChecked(c2614.f7457);
                    checkBox.setClickable(false);
                    this.f9703.setTextAppearance(getContext(), android.R.style.TextAppearance.Small);
                    this.f9703.setTextColor(-7829368);
                    this.f9702.setTextColor(-1);
                    this.f9702.setText(((C2614) getItem(i)).f7458);
                    this.f9702.setTypeface(null, 1);
                    String str = ((C2614) getItem(i)).f7458;
                    if (!c2614.f7457) {
                        this.f9702.setText(C2500.m6934(str, "#ffff0000", "bold"));
                    } else {
                        this.f9702.setText(C2500.m6934(str, "#FF00FF00", "bold"));
                    }
                    this.f9703.setText(C2500.m6934(((C2614) getItem(i)).f7459, "#AAFFFFFF", ""));
                    return inflate;
                }
            }

            class C3210 implements AdapterView.OnItemClickListener {
                C3210() {
                }

                @Override
                public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
                    C2614 c2614 = (C2614) adapterView.getAdapter().getItem(i);
                    if (c2614.f7457) {
                        c2614.f7457 = false;
                        C2975.f9338.remove(c2614.f7454);
                    } else {
                        c2614.f7457 = true;
                        C2975.f9338.add(c2614.f7454);
                    }
                }
            }

            RunnableC3207(ArrayList arrayList) {
                this.f9699 = arrayList;
            }

            @Override
            public void run() {
                if (this.f9699.size() == 1 && this.f9699.size() != 0) {
                    C3549.m8177(((C2614) this.f9699.get(0)).f7454, false, null, true, null);
                } else {
                    C2975.f9338 = new ArrayList<>();
                    new C2913(C2975.f9245.mo1874()).m7854(R.string.title_select_custom_patch).m7862(new C3209(C2975.this.mo1874(), R.layout.contextmenu, this.f9699), new C3210()).m7873(R.string.button_add_to_boot_list, new DialogInterfaceOnClickListenerC3208()).m7863(true).m7851().show();
                }
            }
        }

        RunnableC3205() {
        }

        @Override
        public void run() {
            ArrayList<C2614> m6936;
            if (C2975.f9282.equals("")) {
                m6936 = C2500.m6936(C2975.f9253.f10046);
            } else {
                m6936 = C2500.m6936(C2500.m6920(C2975.f9282).packageName);
            }
            if (m6936 != null) {
                Collections.sort(m6936, new C3206());
                C2975.m7954(new RunnableC3207(m6936));
            }
        }
    }

    public class RunnableC3211 implements Runnable {
        RunnableC3211() {
        }

        @Override
        public void run() {
            C2975.m7919(C2975.f9253, false);
        }
    }

    public class RunnableC3212 implements Runnable {

        final List f9707;

        final Intent f9708;

        class RunnableC3213 implements Runnable {
            RunnableC3213() {
            }

            @Override
            public void run() {
                try {
                    MainActivity mainActivity = C2975.f9259;
                    if (mainActivity != null) {
                        mainActivity.startActivity(RunnableC3212.this.f9708);
                    }
                } catch (Throwable th) {
                    th.printStackTrace();
                }
            }
        }

        RunnableC3212(List list, Intent intent) {
            this.f9707 = list;
            this.f9708 = intent;
        }

        @Override
        public void run() {
            for (ResolveInfo resolveInfo : this.f9707) {
                new C2500("").m7211("pm enable " + resolveInfo.activityInfo.packageName + InternalZipConstants.ZIP_FILE_SEPARATOR + resolveInfo.activityInfo.name);
                C2975.m7954(new RunnableC3213());
            }
        }
    }

    public class RunnableC3214 implements Runnable {
        RunnableC3214() {
        }

        @Override
        public void run() {
            C2975.this.m7972(C2975.f9253, true);
        }
    }

    public class RunnableC3215 implements Runnable {
        RunnableC3215() {
        }

        @Override
        public void run() {
            for (String str : C2500.m6995()) {
                try {
                    C2500.m6907(str + InternalZipConstants.ZIP_FILE_SEPARATOR + C2975.f9356);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }

    public class RunnableC3216 implements Runnable {

        class RunnableC3217 implements Runnable {
            RunnableC3217() {
            }

            @Override
            public void run() {
                C2975.f9264.notifyDataSetChanged();
                Intent intent = new Intent(C2975.m7929(), (Class<?>) Widget5.class);
                intent.setPackage(C2975.m7929().getPackageName());
                intent.setAction(Widget5.f4834);
                C2975.m7929().sendBroadcast(intent);
            }
        }

        class RunnableC3218 implements Runnable {
            RunnableC3218() {
            }

            @Override
            public void run() {
                C2975.m7960(11);
                C2975.f9276.m8238(true);
                C2975.f9276.m8239(C2500.m7007(R.string.wait));
            }
        }

        class RunnableC3219 implements Runnable {
            RunnableC3219() {
            }

            @Override
            public void run() {
                C2975.f9264.notifyDataSetChanged();
                Intent intent = new Intent(C2975.m7929(), (Class<?>) Widget5.class);
                intent.setPackage(C2975.m7929().getPackageName());
                intent.setAction(Widget5.f4834);
                C2975.m7929().sendBroadcast(intent);
            }
        }

        RunnableC3216() {
        }

        @Override
        public void run() {
            PackageInfo m6974 = C2500.m6974("com.android.vending", 0);
            if (m6974 != null) {
                if (new File(C2975.f9250 + "/p.apk").exists()) {
                }
                C2500.m7066();
                C2500.m7067(m6974);
                if (!C2500.m6869()) {
                    C2500.m7053("com.android.vending");
                    new C2500("").m7211(C2975.f9284 + C1559.class.getName() + " " + m6974.applicationInfo.sourceDir + " " + C2975.f9250 + " " + String.valueOf(m6974.applicationInfo.uid) + " proxy");
                    C2975.m7932().setComponentEnabledSetting(new ComponentName(C2975.m7929(), (Class<?>) InAppBillingService.class), 2, 1);
                    C2975.m7932().setComponentEnabledSetting(new ComponentName(C2975.m7929(), (Class<?>) InAppBillingService.class), 1, 1);
                    C2500.m7056(true);
                    C2500.m7058(true);
                    C2500.m7053("com.android.vending");
                    C2975.m7954(new RunnableC3217());
                    return;
                }
                C2975.m7954(new RunnableC3218());
                try {
                    new C2500("").m7211(C2975.f9284 + C1559.class.getName() + " " + m6974.applicationInfo.sourceDir + " " + C2975.f9250 + " " + String.valueOf(m6974.applicationInfo.uid) + " recovery");
                    C2500.m7056(true);
                    C2500.m7058(true);
                    C2500.m7053("com.android.vending");
                    C2975.m7954(new RunnableC3219());
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }

    public class DialogInterfaceOnClickListenerC3220 implements DialogInterface.OnClickListener {

        class RunnableC3221 implements Runnable {
            RunnableC3221() {
            }

            @Override
            public void run() {
                if ((C2500.m6947("/system/framework/core.jar") != null && !C2500.m6935().equals("ART")) || (C2500.m7031() && C2975.f9299 >= 20)) {
                    C2975.f9318 = true;
                    C2975.f9320 = true;
                    C2975.this.m8002("_patch1");
                }
            }
        }

        DialogInterfaceOnClickListenerC3220() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            C2975.m7956(new RunnableC3221());
        }
    }

    public class RunnableC3222 implements Runnable {

        final String f9719;

        class RunnableC3223 implements Runnable {

            class RunnableC3224 implements Runnable {
                RunnableC3224() {
                }

                @Override
                public void run() {
                    try {
                        ArrayAdapter arrayAdapter = C2975.f9264;
                        if (arrayAdapter != null) {
                            arrayAdapter.notifyDataSetChanged();
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }

            RunnableC3223() {
            }

            @Override
            public void run() {
                if (C2975.f9245 != null) {
                    C2975.m7954(new RunnableC3224());
                }
            }
        }

        RunnableC3222(String str) {
            this.f9719 = str;
        }

        @Override
        public void run() {
            new C2500("").m7211("pm disable " + this.f9719);
            C2975.m7954(new RunnableC3223());
        }
    }

    public class RunnableC3225 implements Runnable {

        final String f9723;

        class RunnableC3226 implements Runnable {

            class RunnableC3227 implements Runnable {
                RunnableC3227() {
                }

                @Override
                public void run() {
                    try {
                        ArrayAdapter arrayAdapter = C2975.f9264;
                        if (arrayAdapter != null) {
                            arrayAdapter.notifyDataSetChanged();
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
            }

            RunnableC3226() {
            }

            @Override
            public void run() {
                Context m7929 = C2975.m7929();
                String str = C2975.f9237;
                C2500.m7145(m7929, str, str);
                if (C2975.f9245 != null) {
                    C2975.m7954(new RunnableC3227());
                }
            }
        }

        RunnableC3225(String str) {
            this.f9723 = str;
        }

        @Override
        public void run() {
            new C2500("").m7211("pm enable " + this.f9723);
            C2975.m7954(new RunnableC3226());
        }
    }

    public class RunnableC3228 implements Runnable {

        class RunnableC3229 implements Runnable {

            class RunnableC3230 implements Runnable {

                class RunnableC3231 implements Runnable {
                    RunnableC3231() {
                    }

                    @Override
                    public void run() {
                        try {
                            ArrayAdapter arrayAdapter = C2975.f9264;
                            if (arrayAdapter != null) {
                                arrayAdapter.notifyDataSetChanged();
                            }
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                }

                RunnableC3230() {
                }

                @Override
                public void run() {
                    Context m7929 = C2975.m7929();
                    String str = C2975.f9237;
                    C2500.m7145(m7929, str, str);
                    if (C2975.f9245 != null) {
                        C2975.m7954(new RunnableC3231());
                    }
                }
            }

            RunnableC3229() {
            }

            @Override
            public void run() {
                C2500.m7024(C2975.f9250 + "/pinapp.apk", "", true, false);
                C2975.m7954(new RunnableC3230());
            }
        }

        RunnableC3228() {
        }

        @Override
        public void run() {
            File file = new File(C2975.f9250 + "/pinapp.apk");
            File file2 = new File(C2975.f9251 + "/tmp/pinapp.apk");
            if (C2975.f9283) {
                new Thread(new RunnableC3229()).start();
                return;
            }
            C2500.m6875(file, file2);
            if (file.exists() && file2.exists() && file.length() == file2.length()) {
                C2500.m7023(C2975.f9259, file2, Integer.valueOf(C2975.f9395));
            }
        }
    }

    public class RunnableC3232 implements Runnable {
        RunnableC3232() {
        }

        @Override
        public void run() {
            C2500.m7177();
        }
    }

    public class RunnableC3233 implements Runnable {
        RunnableC3233() {
        }

        @Override
        public void run() {
            C2939 c2939;
            if (C2500.m7027(C2975.f9282) && C2500.m6928(new File(C2975.f9282)) == null) {
                C2500.m7130(C2975.f9245.mo1874(), C2500.m7007(R.string.warning), C2500.m7007(R.string.installer_error_bad_apks_file));
                return;
            }
            try {
                c2939 = new C2939(C2975.m7929(), new File(C2975.f9282), false);
            } catch (Throwable th) {
                th.printStackTrace();
                c2939 = null;
            }
            if (c2939 == null) {
                c2939 = new C2939("unknown", "unknown", new File(C2975.f9282));
            }
            C2975.m7951(7);
            C2975.m7968(c2939, false);
        }
    }

    public class RunnableC3234 implements Runnable {
        RunnableC3234() {
        }

        @Override
        public void run() {
            C2939 c2939 = new C2939(C2975.m7929(), new File(C2975.f9282), false);
            C2975.m7951(7);
            C2975.this.m8076(c2939, false);
        }
    }

    public class RunnableC3235 implements Runnable {

        class RunnableC3236 implements Runnable {

            final File f9735;

            RunnableC3236(File file) {
                this.f9735 = file;
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.information), C2500.m7007(R.string.res_0x7f1101de_generate_log_result_message_core_oj_jar) + " " + (this.f9735.length() / 1048576) + " Mb");
            }
        }

        RunnableC3235() {
        }

        @Override
        public void run() {
            C2608 c2608 = new C2608();
            c2608.f7411 = true;
            c2608.f7412 = true;
            Iterator<File> it = C2500.m6955(c2608).iterator();
            String str = "";
            while (it.hasNext()) {
                File next = it.next();
                if (C2500.m6898(next.getAbsolutePath())) {
                    str = next.getAbsolutePath();
                }
            }
            try {
                C2975.m7942(str);
                new C2500("1").m7211(new String(("oatdump --oat-file=" + str + " --output=/sdcard/core-oj.oat.txt").getBytes(), "ISO-8859-1"));
            } catch (Exception e) {
                e.printStackTrace();
            }
            File file = new File("/sdcard/core-oj.oat.txt");
            if (file.exists() && file.length() > 0) {
                C2975.m7954(new RunnableC3236(file));
            } else {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.generate_log_error_message));
                file.delete();
            }
        }
    }

    public class DialogInterfaceOnClickListenerC3237 implements DialogInterface.OnClickListener {

        class RunnableC3238 implements Runnable {
            RunnableC3238() {
            }

            @Override
            public void run() {
                String m7211 = new C2500("").m7211("pm uninstall com.android.vending.billing.InAppBillingService.COIN");
                new C2500("w").m7212(4000L);
                C2975.m7942("uninstall results:" + m7211);
                C2975.m7942("uninstall results errors:" + C2975.f9298);
                try {
                    C2975.m7932().getPackageInfo("com.android.vending.billing.InAppBillingService.COIN", 0);
                    C2500.m7153(App.MainActivity, "com.android.vending.billing.InAppBillingService.COIN", null);
                } catch (PackageManager.NameNotFoundException unused) {
                    System.exit(0);
                }
            }
        }

        DialogInterfaceOnClickListenerC3237() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            if (C2975.f9283) {
                new Thread(new RunnableC3238()).start();
            } else {
                C2500.m7153(App.MainActivity, "com.android.vending.billing.InAppBillingService.COIN", null);
            }
        }
    }

    public class RunnableC3239 implements Runnable {
        RunnableC3239() {
        }

        @Override
        public void run() {
            if (C2500.m7027(C2975.f9282) && C2500.m6928(new File(C2975.f9282)) == null) {
                C2500.m7130(C2975.f9245.mo1874(), C2500.m7007(R.string.warning), C2500.m7007(R.string.installer_error_bad_apks_file));
            } else {
                C2975.this.m7998();
            }
        }
    }

    public class RunnableC3240 implements Runnable {
        RunnableC3240() {
        }

        @Override
        public void run() {
            if (C2500.m7027(C2975.f9282) && C2500.m6928(new File(C2975.f9282)) == null) {
                C2500.m7130(C2975.f9245.mo1874(), C2500.m7007(R.string.warning), C2500.m7007(R.string.installer_error_bad_apks_file));
                return;
            }
            C2939 c2939 = new C2939(C2975.m7929(), new File(C2975.f9282), false);
            C2975.m7951(7);
            C2975.this.m8077(c2939);
        }
    }

    public class RunnableC3241 implements Runnable {
        RunnableC3241() {
        }

        @Override
        public void run() {
            C2975.this.m8075(new C2939(C2975.m7929(), new File(C2975.f9282), false));
        }
    }

    public class RunnableC3242 implements Runnable {
        RunnableC3242() {
        }

        @Override
        public void run() {
            Toast.makeText(C2975.this.mo1874(), C2500.m7007(R.string.not_detect), 0).show();
        }
    }

    public class RunnableC3243 implements Runnable {
        RunnableC3243() {
        }

        @Override
        public void run() {
            if (C2500.m7027(C2975.f9282) && C2500.m6928(new File(C2975.f9282)) == null) {
                C2500.m7130(C2975.f9245.mo1874(), C2500.m7007(R.string.warning), C2500.m7007(R.string.installer_error_bad_apks_file));
            } else {
                C2975.this.m8064();
            }
        }
    }

    public class RunnableC3244 implements Runnable {

        final ArrayList f9744;

        RunnableC3244(ArrayList arrayList) {
            this.f9744 = arrayList;
        }

        @Override
        public void run() {
            C2975.m7941(this.f9744, true, false, false);
        }
    }

    public class DialogInterfaceOnClickListenerC3245 implements DialogInterface.OnClickListener {
        DialogInterfaceOnClickListenerC3245() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            C2975.this.m8041();
        }
    }

    public class C3246 implements ExpandableListView.OnChildClickListener {
        C3246() {
        }

        @Override
        public boolean onChildClick(ExpandableListView expandableListView, View view, int i, int i2, long j) {
            if (C2975.m7928().getBoolean("vibration", false)) {
                Vibrator vibrator = (Vibrator) C2975.this.mo1874().getSystemService("vibrator");
                C2975.f9346 = vibrator;
                vibrator.vibrate(50L);
            }
            C2975.f9253 = C2975.f9252.m8114(i);
            switch (C2975.f9252.getChild(i, i2).intValue()) {
                case R.string.advanced_menu:
                    C2975.this.m7994();
                    break;
                case R.string.app_dialog_no_root_app_control:
                    C2975.this.m8070();
                    break;
                case R.string.app_info:
                    C3549.m8196(null);
                    break;
                case R.string.cleardata:
                    C2975.this.m7980();
                    break;
                case R.string.context_tools:
                    C2975.this.m7995();
                    break;
                case R.string.contextlaunchapp:
                    C2975.this.m8027();
                    break;
                case R.string.install_app_for_user:
                    C2975.m7940();
                    break;
                case R.string.menu_close_application:
                    C2975.this.m7981();
                    break;
                case R.string.move_to_internal:
                    C2975.this.m8031();
                    break;
                case R.string.move_to_sdcard:
                    C2975.this.m8032();
                    break;
                case R.string.uninstallapp:
                    C2975.this.m8068();
                    break;
            }
        }
    }

    public class C3247 implements ExpandableListView.OnGroupExpandListener {
        C3247() {
        }

        @Override
        public void onGroupExpand(int i) {
        }
    }

    public class C3248 implements ExpandableListView.OnGroupClickListener {

        class RunnableC3249 implements Runnable {

            final int f9750;

            RunnableC3249(int i) {
                this.f9750 = i;
            }

            @Override
            public void run() {
                C2975.f9258.setSelection(this.f9750);
            }
        }

        C3248() {
        }

        @Override
        public boolean onGroupClick(ExpandableListView expandableListView, View view, int i, long j) {
            C2975.m7942(expandableListView.getItemAtPosition(i));
            C2975.m7942(Integer.valueOf(i));
            C2975.f9253 = C2975.f9252.m8114(i);
            C2975.m7925();
            if (expandableListView.isGroupExpanded(i)) {
                expandableListView.collapseGroup(i);
                return true;
            }
            expandableListView.expandGroup(i);
            if (C2975.f9299 > 7) {
                expandableListView.smoothScrollToPosition(i);
                return true;
            }
            C2975.f9258.clearFocus();
            C2975.f9258.post(new RunnableC3249(i));
            return true;
        }
    }

    public class C3250 implements AdapterView.OnItemLongClickListener {
        C3250() {
        }

        @Override
        public boolean onItemLongClick(AdapterView<?> adapterView, View view, int i, long j) {
            if (C2975.m7928().getBoolean("vibration", false)) {
                Vibrator vibrator = (Vibrator) C2975.this.mo1874().getSystemService("vibrator");
                C2975.f9346 = vibrator;
                vibrator.vibrate(50L);
            }
            try {
                C2975.f9253 = (C3478) adapterView.getItemAtPosition(i);
                C2975.this.m7990();
            } catch (Exception e) {
                C2975.m7942("LuckyPatcher (Context menu long click): " + e);
                e.printStackTrace();
            }
            return false;
        }
    }

    public class C3251 implements ExpandableListView.OnGroupClickListener {
        C3251() {
        }

        @Override
        public boolean onGroupClick(ExpandableListView expandableListView, View view, int i, long j) {
            C2942 group = C2975.f9335.getGroup(i);
            if (group.f9170.size() != 0 && group.f9172 != 1) {
                return false;
            }
            int i2 = group.f9172;
            if (i2 != 1) {
                if (i2 != 2) {
                    if (i2 != 3) {
                        C2975.this.m8049(group.f9168);
                    } else {
                        C2975.m7954(group.f9174);
                    }
                } else {
                    switch (group.f9168) {
                        case R.string.aboutmenu:
                            C2975.this.m8065();
                            break;
                        case R.string.days_on_up:
                            C2975.this.m7976();
                            break;
                        case R.string.dir_change:
                            C2975.this.m7977();
                            break;
                        case R.string.export_settings:
                            C2500.m6901();
                            break;
                        case R.string.help:
                            C3549.m8155();
                            break;
                        case R.string.import_settings:
                            C2500.m7021();
                            break;
                        case R.string.langmenu:
                            C2975.this.m8053();
                            break;
                        case R.string.reset_dialog_settings:
                            C3549.m8167();
                            break;
                        case R.string.sendlog:
                            C2975.this.m8055();
                            break;
                        case R.string.update_lp:
                            if (C2975.f9245 != null) {
                                C2975.this.m8051();
                                break;
                            }
                            break;
                    }
                }
            }
            return true;
        }
    }

    public class C3252 implements ExpandableListView.OnChildClickListener {
        C3252() {
        }

        @Override
        public boolean onChildClick(ExpandableListView expandableListView, View view, int i, int i2, long j) {
            C2975.this.m8049(((Integer) C2975.f9335.getGroup(i).f9170.get(i2)).intValue());
            return false;
        }
    }

    public class DialogInterfaceOnCancelListenerC3253 implements DialogInterface.OnCancelListener {
        DialogInterfaceOnCancelListenerC3253() {
        }

        @Override
        public void onCancel(DialogInterface dialogInterface) {
            dialogInterface.dismiss();
        }
    }

    public class DialogInterfaceOnClickListenerC3254 implements DialogInterface.OnClickListener {
        DialogInterfaceOnClickListenerC3254() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            if (new File(C2975.f9251 + "/Changes/changelog.txt").exists()) {
                C2975.m7962(C2500.m7007(R.string.changelog), C2500.m7072(new File(C2975.f9251 + "/Changes/changelog.txt")));
                return;
            }
            C2975.m7962(C2500.m7007(R.string.changelog), C2500.m7007(R.string.not_found_changelog));
        }
    }

    public class AsyncTaskC3255 extends AsyncTask<Void, Void, Boolean> {

        ProgressDialog f9757;

        AsyncTaskC3255() {
        }

        @Override
        protected void onPreExecute() {
            ProgressDialog progressDialog = new ProgressDialog(C2975.f9259);
            this.f9757 = progressDialog;
            progressDialog.setTitle("Progress");
            this.f9757.setMessage(C2500.m7007(R.string.collect_logs));
            this.f9757.setIndeterminate(true);
            this.f9757.show();
        }

        @Override
        public Boolean doInBackground(Void... voidArr) {
            try {
                if (C2975.f9287 == null) {
                    C2975.f9287 = new C2940();
                }
                return Boolean.valueOf(C2975.f9287.m7897(C2975.m7929(), true));
            } catch (Exception e) {
                e.printStackTrace();
                return Boolean.FALSE;
            }
        }

        @Override
        public void onPostExecute(Boolean bool) {
            try {
                ProgressDialog progressDialog = this.f9757;
                if (progressDialog != null && progressDialog.isShowing()) {
                    this.f9757.dismiss();
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
            if (bool.booleanValue()) {
                C2975.m7942(Integer.valueOf(C2975.f9288));
                C2975.m7942(Integer.valueOf(C2975.m7928().getInt("http_versionCode", 0)));
                if (C2975.f9288 >= C2975.m7928().getInt("http_versionCode", 0)) {
                    if (C2500.m7062(C2975.f9259)) {
                        try {
                            C2975.f9287.m7898(C2975.m7929(), "lp.chelpus@gmail.com", "Error Log " + C2975.f9273, "Lucky Patcher " + C2975.m7932().getPackageInfo(C2975.f9245.mo1874().getPackageName(), ItemType.CLASS_DATA_ITEM).versionName);
                            return;
                        } catch (PackageManager.NameNotFoundException e2) {
                            e2.printStackTrace();
                            return;
                        }
                    }
                    AlertDialog.Builder builder = new AlertDialog.Builder(C2975.f9259);
                    builder.setTitle(C2500.m7007(R.string.warning)).setMessage(C2500.m7007(R.string.dont_send_log_lp_modified)).setNegativeButton("OK", (DialogInterface.OnClickListener) null);
                    builder.create().show();
                    return;
                }
                AlertDialog.Builder builder2 = new AlertDialog.Builder(C2975.f9259);
                builder2.setTitle(C2500.m7007(R.string.warning)).setMessage(C2500.m7007(R.string.dont_send_log_please_update_lp)).setNegativeButton("OK", (DialogInterface.OnClickListener) null);
                builder2.create().show();
                return;
            }
            AlertDialog.Builder builder3 = new AlertDialog.Builder(C2975.f9259);
            builder3.setTitle("Error").setMessage(C2500.m7007(R.string.error_collect_logs)).setNegativeButton("OK", (DialogInterface.OnClickListener) null);
            builder3.create().show();
        }
    }

    public class DialogInterfaceOnClickListenerC3256 implements DialogInterface.OnClickListener {

        final EditTextFix f9759;

        DialogInterfaceOnClickListenerC3256(EditTextFix editTextFix) {
            this.f9759 = editTextFix;
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            Editable text = this.f9759.getText();
            if (C2975.this.m7943(text)) {
                C2975.m7928().edit().putInt("days_on_up", Integer.valueOf(text.toString()).intValue()).commit();
                C2975.m7928().edit().putBoolean("settings_change", true).commit();
                C2975.m7928().edit().putBoolean("lang_change", true).commit();
                C2975.f9243 = true;
                C2975.f9300 = Integer.valueOf(text.toString()).intValue();
                C2975.m7957(true);
            }
        }
    }

    public class C3257 implements CompoundButton.OnCheckedChangeListener {

        final boolean[] f9761;

        C3257(boolean[] zArr) {
            this.f9761 = zArr;
        }

        @Override
        public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
            if (!z) {
                this.f9761[0] = false;
            } else {
                this.f9761[0] = true;
            }
        }
    }

    public class RunnableC3258 implements Runnable {

        final File[] f9763;

        final boolean[] f9764;

        class RunnableC3259 implements Runnable {

            final File f9766;

            final File f9767;

            RunnableC3259(File file, File file2) {
                this.f9766 = file;
                this.f9767 = file2;
            }

            @Override
            public void run() {
                try {
                    File[] listFiles = this.f9766.listFiles();
                    File file = this.f9766;
                    if (file != null && listFiles != null && listFiles.length == 0) {
                        RunnableC3258 runnableC3258 = RunnableC3258.this;
                        if (runnableC3258.f9764[0]) {
                            if (runnableC3258.f9763[0].getAbsolutePath().startsWith(this.f9767.getAbsolutePath())) {
                                this.f9766.mkdirs();
                                if (this.f9766.exists()) {
                                    RunnableC3258 runnableC32582 = RunnableC3258.this;
                                    if (C2975.this.m8071(false, runnableC32582.f9763[0].getAbsolutePath())) {
                                        C2975.m7928().edit().putString("basepath", RunnableC3258.this.f9763[0].getAbsolutePath()).commit();
                                        C2975.f9251 = RunnableC3258.this.f9763[0].getAbsolutePath();
                                        C2975.m7962(C2500.m7007(R.string.warning), C2500.m7009(R.string.change_folder_message_end2, RunnableC3258.this.f9763[0].getAbsolutePath()));
                                    }
                                }
                                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.write_permission_not_found));
                            } else {
                                C2500.m6878(this.f9767, this.f9766, null);
                                new C2500("").m7194(this.f9767);
                                C2975.m7928().edit().putString("basepath", RunnableC3258.this.f9763[0].getAbsolutePath()).commit();
                                C2975.f9251 = RunnableC3258.this.f9763[0].getAbsolutePath();
                                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.move_data) + " " + RunnableC3258.this.f9763[0].getAbsolutePath());
                            }
                        } else {
                            file.mkdirs();
                            if (this.f9766.exists()) {
                                RunnableC3258 runnableC32583 = RunnableC3258.this;
                                if (C2975.this.m8071(false, runnableC32583.f9763[0].getAbsolutePath())) {
                                    C2975.m7928().edit().putString("basepath", RunnableC3258.this.f9763[0].getAbsolutePath()).commit();
                                    C2975.f9251 = RunnableC3258.this.f9763[0].getAbsolutePath();
                                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7009(R.string.change_folder_message_end, RunnableC3258.this.f9763[0].getAbsolutePath()));
                                }
                            }
                            C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.write_permission_not_found));
                        }
                    } else {
                        C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.folder_message_error));
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.no_space));
                }
            }
        }

        RunnableC3258(File[] fileArr, boolean[] zArr) {
            this.f9763 = fileArr;
            this.f9764 = zArr;
        }

        @Override
        public void run() {
            if (C2975.this.m8071(true, this.f9763[0].getAbsolutePath()) && !this.f9763[0].getAbsolutePath().startsWith(C2975.m7929().getDir("sdcard", 0).getAbsolutePath())) {
                C2975.m7928().edit().putString("path", this.f9763[0].getAbsolutePath()).commit();
                C2975.m7928().edit().putBoolean("manual_path", true).commit();
                C2975.m7928().edit().putBoolean("path_changed", true).commit();
                File file = new File(C2975.m7928().getString("basepath", "Noting"));
                File file2 = this.f9763[0];
                if (!file.exists() && this.f9764[0]) {
                    C2975.m7942("Directory does not exist.");
                } else {
                    C2975.m7956(new RunnableC3259(file2, file));
                }
            }
        }
    }

    public class C3260 implements CompoundButton.OnCheckedChangeListener {

        final boolean[] f9769;

        C3260(boolean[] zArr) {
            this.f9769 = zArr;
        }

        @Override
        public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
            if (!z) {
                this.f9769[0] = false;
            } else {
                this.f9769[0] = true;
            }
        }
    }

    public class C3261 extends ArrayAdapter<String> {
        C3261(Context context, int i, List list) {
            super(context, i, list);
        }

        @Override
        public View getView(int i, View view, ViewGroup viewGroup) {
            Locale locale;
            View view2 = super.getView(i, view, viewGroup);
            TextView textView = (TextView) view2.findViewById(R.id.conttext);
            textView.setTextColor(-1);
            String str = (String) getItem(i);
            String[] split = str.split("_");
            if (split.length == 1) {
                locale = new Locale(split[0]);
            } else {
                locale = null;
            }
            if (split.length == 2) {
                locale = new Locale(split[0], split[1]);
            }
            textView.setTextAppearance(C2975.m7929(), C2975.m7934());
            textView.setText(locale.getDisplayName(locale));
            if (str.equals("be")) {
                textView.setText("Беларуская (Bełarusian)");
            }
            if (str.equals("zh_TW")) {
                textView.setText("Chinese (Taiwan)");
            }
            if (str.equals("zh_CN")) {
                textView.setText("Chinese (China)");
            }
            if (str.equals("zh_HK")) {
                textView.setText("Chinese (Hong Kong)");
            }
            if (str.equals("pt_rBR")) {
                textView.setText("Portuguese (Brazil)");
            }
            if (str.equals("pt")) {
                textView.setText("Portuguese (Portugal)");
            }
            if (str.equals("en_US")) {
                textView.setText("English (United States)");
            }
            if (str.equals("km_KH")) {
                textView.setText("Cambodia (Khmer)");
            }
            if (str.equals("ku")) {
                textView.setText(" کوردی ناوەند");
            }
            if (str.equals("lrc")) {
                textView.setText("Luri Bakhtiari");
            }
            if (str.equals("tl")) {
                textView.setText("Tagalog(Philipino)");
            }
            if (str.equals("tl_PH")) {
                textView.setText("Tagalog(Philipines)");
            }
            if (str.equals("es_ES")) {
                textView.setText("Español (Latinoamérica)");
            }
            if (str.equals("es_MX")) {
                textView.setText("Español (Méjico)");
            }
            if (str.equals("ar")) {
                textView.setText("العربية(العربية)");
            }
            textView.setTypeface(null, 1);
            textView.setTextColor(-1);
            return view2;
        }
    }

    public class DialogInterfaceOnClickListenerC3262 implements DialogInterface.OnClickListener {
        DialogInterfaceOnClickListenerC3262() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            C2975.m7928().edit().putBoolean("dont_show_old_package_warning", true).commit();
        }
    }

    public class RunnableC3263 implements Runnable {

        final Intent f9773;

        class C3264 implements CompoundButton.OnCheckedChangeListener {
            C3264() {
            }

            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
                if (z) {
                    C2975.m7928().edit().putBoolean("warning_china_muiu_phone", false).commit();
                } else {
                    C2975.m7928().edit().putBoolean("warning_china_muiu_phone", true).commit();
                }
            }
        }

        class DialogInterfaceOnClickListenerC3265 implements DialogInterface.OnClickListener {
            DialogInterfaceOnClickListenerC3265() {
            }

            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                try {
                    MainActivity mainActivity = C2975.f9259;
                    if (mainActivity != null) {
                        mainActivity.startActivity(RunnableC3263.this.f9773);
                    }
                } catch (Throwable th) {
                    th.printStackTrace();
                    C2500.m7116(PkgName.getPkgName());
                }
            }
        }

        RunnableC3263(Intent intent) {
            this.f9773 = intent;
        }

        @Override
        public void run() {
            C2500.m7128(C2500.m7007(R.string.warning), C2500.m7007(R.string.warning_china_devices_muiu), C2500.m7007(R.string.warning_superSu_mount_name_space_separation_3), new C3264(), false, new DialogInterfaceOnClickListenerC3265(), null, null, true);
        }
    }

    public class C3266 implements AdapterView.OnItemClickListener {
        C3266() {
        }

        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
            C2975.m7928().edit().putString("force_language", (String) adapterView.getItemAtPosition(i)).commit();
            C2975.m7928().edit().putBoolean("settings_change", true).commit();
            C2975.m7928().edit().putBoolean("lang_change", true).commit();
            C2500.m7108(App.getInstance());
            C2975.this.mo1800();
        }
    }

    public class RunnableC3267 implements Runnable {

        class RunnableC3268 implements Runnable {

            final File f9779;

            RunnableC3268(File file) {
                this.f9779 = file;
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.information), C2500.m7007(R.string.res_0x7f1101dc_generate_log_result_message_conscrypt_jar) + " " + (this.f9779.length() / 1048576) + " Mb");
            }
        }

        RunnableC3267() {
        }

        @Override
        public void run() {
            C2608 c2608 = new C2608();
            c2608.f7408 = true;
            c2608.f7409 = true;
            Iterator<File> it = C2500.m6955(c2608).iterator();
            String str = "";
            while (it.hasNext()) {
                File next = it.next();
                if (C2500.m6898(next.getAbsolutePath())) {
                    str = next.getAbsolutePath();
                }
            }
            try {
                C2975.m7942(str);
                new C2500("1").m7211(new String(("oatdump --oat-file=" + str + " --output=/sdcard/conscrypt.oat.txt").getBytes(), "ISO-8859-1"));
            } catch (Exception e) {
                e.printStackTrace();
            }
            File file = new File("/sdcard/conscrypt.oat.txt");
            if (file.exists() && file.length() > 0) {
                C2975.m7954(new RunnableC3268(file));
            } else {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.generate_log_error_message));
                file.delete();
            }
        }
    }

    public class RunnableC3269 implements Runnable {

        class RunnableC3270 implements Runnable {
            RunnableC3270() {
            }

            @Override
            public void run() {
                C2500.m7140(C2975.f9253.f10046);
            }
        }

        class RunnableC3271 implements Runnable {
            RunnableC3271() {
            }

            @Override
            public void run() {
                Toast.makeText(C2975.m7929(), C2500.m7007(R.string.error_launch), 1).show();
            }
        }

        RunnableC3269() {
        }

        @Override
        public void run() {
            try {
                if (C2975.f9283) {
                    C2975.m7956(new RunnableC3270());
                } else {
                    C2975.this.m1852(C2975.m7932().getLaunchIntentForPackage(C2975.f9253.f10046));
                }
            } catch (Exception unused) {
                C2975.m7954(new RunnableC3271());
            }
        }
    }

    public class RunnableC3272 implements Runnable {
        RunnableC3272() {
        }

        @Override
        public void run() {
            try {
                if (C2975.f9283) {
                    C2500.m7053(C2975.m7929().getPackageManager().getPackageInfo(C2975.f9253.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.processName);
                }
            } catch (Throwable th) {
                th.printStackTrace();
            }
        }
    }

    public class RunnableC3273 implements Runnable {

        class RunnableC3274 implements Runnable {

            class DialogInterfaceOnClickListenerC3275 implements DialogInterface.OnClickListener {

                final C3478 f9787;

                DialogInterfaceOnClickListenerC3275(C3478 c3478) {
                    this.f9787 = c3478;
                }

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    if (i == -1) {
                        try {
                            C2974 c2974 = new C2974();
                            C2975.f9280 = c2974;
                            c2974.f9233 = this.f9787;
                            c2974.f9225 = C2975.m7932().getPackageInfo(this.f9787.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                            C2975.m7942("Start uninstall to " + C2975.f9280.f9225);
                        } catch (Exception unused) {
                        }
                        C2975.this.m8030(this.f9787.f10046, true);
                        try {
                            C2975.m7928().edit().remove(this.f9787.f10046).commit();
                            C2975.f9252.m8119(this.f9787.f10046);
                            C2975.f9252.m8123(this.f9787.f10046);
                        } catch (Exception unused2) {
                        }
                        C2975.m7951(6);
                    }
                }
            }

            class C3276 implements CompoundButton.OnCheckedChangeListener {
                C3276() {
                }

                @Override
                public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
                    C2975.f9401 = z;
                }
            }

            RunnableC3274() {
            }

            @Override
            public void run() {
                if (C2975.m7928().getBoolean("vibration", false)) {
                    Vibrator vibrator = (Vibrator) C2975.this.mo1874().getSystemService("vibrator");
                    C2975.f9346 = vibrator;
                    vibrator.vibrate(50L);
                }
                C3478 c3478 = C2975.f9253;
                DialogInterfaceOnClickListenerC3275 dialogInterfaceOnClickListenerC3275 = new DialogInterfaceOnClickListenerC3275(c3478);
                if (C2500.m7060()) {
                    C2500.m7127(c3478.f10047, C2500.m7007(R.string.move_to_system), C2500.m7007(R.string.option_magisk_module), new C3276(), C2975.f9401, dialogInterfaceOnClickListenerC3275, dialogInterfaceOnClickListenerC3275, null, false);
                } else {
                    C2500.m7125(c3478.f10047, C2500.m7007(R.string.move_to_system), dialogInterfaceOnClickListenerC3275, dialogInterfaceOnClickListenerC3275, null);
                }
                C2500.m7177();
            }
        }

        RunnableC3273() {
        }

        @Override
        public void run() {
            C2975.f9401 = C2500.m7044();
            C2975.m7942("useMagiskModule:" + C2975.f9401);
            C2975.m7954(new RunnableC3274());
        }
    }

    public class RunnableC3277 implements Runnable {

        class RunnableC3278 implements Runnable {

            class DialogInterfaceOnClickListenerC3279 implements DialogInterface.OnClickListener {

                final C3478 f9792;

                DialogInterfaceOnClickListenerC3279(C3478 c3478) {
                    this.f9792 = c3478;
                }

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    if (i == -1) {
                        try {
                            C2974 c2974 = new C2974();
                            C2975.f9280 = c2974;
                            c2974.f9233 = this.f9792;
                            c2974.f9225 = C2975.m7932().getPackageInfo(this.f9792.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                            C2975.m7942("Start uninstall to " + C2975.f9280.f9225);
                        } catch (Exception unused) {
                        }
                        C2975.this.m8030(this.f9792.f10046, false);
                        C2975.m7951(6);
                    }
                }
            }

            class C3280 implements CompoundButton.OnCheckedChangeListener {
                C3280() {
                }

                @Override
                public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
                    C2975.f9401 = z;
                }
            }

            RunnableC3278() {
            }

            @Override
            public void run() {
                if (C2975.m7928().getBoolean("vibration", false)) {
                    Vibrator vibrator = (Vibrator) C2975.this.mo1874().getSystemService("vibrator");
                    C2975.f9346 = vibrator;
                    vibrator.vibrate(50L);
                }
                C3478 c3478 = C2975.f9253;
                DialogInterfaceOnClickListenerC3279 dialogInterfaceOnClickListenerC3279 = new DialogInterfaceOnClickListenerC3279(c3478);
                if (C2500.m7060()) {
                    C2500.m7127(c3478.f10047, C2500.m7007(R.string.make_app_to_system), C2500.m7007(R.string.option_magisk_module), new C3280(), C2975.f9401, dialogInterfaceOnClickListenerC3279, dialogInterfaceOnClickListenerC3279, null, false);
                } else {
                    C2500.m7125(c3478.f10047, C2500.m7007(R.string.make_app_to_system), dialogInterfaceOnClickListenerC3279, dialogInterfaceOnClickListenerC3279, null);
                }
                C2500.m7177();
            }
        }

        RunnableC3277() {
        }

        @Override
        public void run() {
            C2975.f9401 = C2500.m7044();
            C2975.m7942("useMagiskModule:" + C2975.f9401);
            C2975.m7954(new RunnableC3278());
        }
    }

    public class DialogInterfaceOnClickListenerC3281 implements DialogInterface.OnClickListener {

        final C3478 f9795;

        class RunnableC3282 implements Runnable {

            class RunnableC3283 implements Runnable {

                final String f9798;

                RunnableC3283(String str) {
                    this.f9798 = str;
                }

                @Override
                public void run() {
                    if (!this.f9798.toLowerCase().contains("sucess") && !C2975.f9298.toLowerCase().contains("success")) {
                        String str = C2975.f9298;
                        if (str == null || str.equals("")) {
                            C2975.f9298 = this.f9798;
                        }
                        C2975.m7962(C2500.m7007(R.string.error), C2500.m7007(R.string.message_error_move_to_internal) + C2975.f9298);
                    } else {
                        C2975.m7962(DialogInterfaceOnClickListenerC3281.this.f9795.f10047, C2500.m7007(R.string.message_done_move_to_internal) + " " + this.f9798);
                    }
                    new C2500("w").m7212(2000L);
                    C2975.m7951(11);
                }
            }

            RunnableC3282() {
            }

            @Override
            public void run() {
                String m7025;
                String str = "";
                try {
                    str = C2975.m7932().getPackageInfo(DialogInterfaceOnClickListenerC3281.this.f9795.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                    C2975.m7942("Start move to internal" + str);
                } catch (Exception unused) {
                }
                if (!C2500.m7047(C2975.f9253.f10046)) {
                    m7025 = C2500.m7024(str, "com.android.vending", true, false);
                } else {
                    ArrayList<File> m7000 = C2500.m7000(C2975.f9253.f10046);
                    m7000.add(new File(str));
                    m7025 = C2500.m7025(null, m7000, "com.android.vending", true, false);
                }
                C2975.f9252.m8123(DialogInterfaceOnClickListenerC3281.this.f9795.f10046);
                C2975.m7954(new RunnableC3283(m7025));
            }
        }

        DialogInterfaceOnClickListenerC3281(C3478 c3478) {
            this.f9795 = c3478;
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            if (i != -1) {
                return;
            }
            C2975.m7956(new RunnableC3282());
        }
    }

    public class C3284 extends ArrayAdapter<C2939> {
        C3284(Context context, int i, List list) {
            super(context, i, list);
        }

        @Override
        public View getView(int i, View view, ViewGroup viewGroup) {
            View view2 = super.getView(i, view, viewGroup);
            TextView textView = (TextView) view2.findViewById(R.id.conttext);
            textView.setTextAppearance(getContext(), C2975.m7934());
            textView.setCompoundDrawablePadding((int) ((C2975.m7933().getDisplayMetrics().density * 5.0f) + 0.5f));
            textView.setTextColor(-1);
            C2939 c2939 = (C2939) getItem(i);
            textView.setText(C2500.m6934(C2500.m7007(R.string.context_restore_data), "#dada00", ""));
            if (c2939.f9155 > 0) {
                textView.append(C2500.m6934("\n" + C2500.m7007(R.string.restore_version) + ": " + c2939.f9154 + " " + C2500.m7007(R.string.restore_build) + ": " + c2939.f9155, "#a0a0a0", ""));
            }
            textView.append(C2500.m6934("\n" + c2939.f9159, "#a0a0a0", ""));
            textView.setTypeface(null, 1);
            return view2;
        }
    }

    public class DialogInterfaceOnClickListenerC3285 implements DialogInterface.OnClickListener {

        final C3478 f9801;

        class RunnableC3286 implements Runnable {

            class RunnableC3287 implements Runnable {

                final String f9804;

                RunnableC3287(String str) {
                    this.f9804 = str;
                }

                @Override
                public void run() {
                    if (!this.f9804.toLowerCase().contains("sucess") && !C2975.f9298.toLowerCase().contains("success")) {
                        String str = C2975.f9298;
                        if (str == null || str.equals("")) {
                            C2975.f9298 = this.f9804;
                        }
                        C2975.m7962(C2500.m7007(R.string.error), C2500.m7007(R.string.message_error_move_to_sdcard) + C2975.f9298);
                    } else {
                        C2975.m7962(DialogInterfaceOnClickListenerC3285.this.f9801.f10047, C2500.m7007(R.string.message_done_move_to_sdcard) + " " + this.f9804);
                    }
                    new C2500("w").m7212(2000L);
                    C2975.m7951(11);
                }
            }

            RunnableC3286() {
            }

            @Override
            public void run() {
                String m7025;
                String str = "";
                try {
                    str = C2975.m7932().getPackageInfo(DialogInterfaceOnClickListenerC3285.this.f9801.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                    C2975.m7942("Start move to sdcard" + str);
                } catch (Exception unused) {
                }
                if (!C2500.m7047(C2975.f9253.f10046)) {
                    m7025 = C2500.m7024(str, "com.android.vending", false, true);
                } else {
                    ArrayList<File> m7000 = C2500.m7000(C2975.f9253.f10046);
                    m7000.add(new File(str));
                    m7025 = C2500.m7025(null, m7000, "com.android.vending", false, true);
                }
                C2975.f9252.m8123(DialogInterfaceOnClickListenerC3285.this.f9801.f10046);
                C2975.m7954(new RunnableC3287(m7025));
            }
        }

        DialogInterfaceOnClickListenerC3285(C3478 c3478) {
            this.f9801 = c3478;
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            if (i != -1) {
                return;
            }
            C2975.m7956(new RunnableC3286());
        }
    }

    public class C3288 implements CompoundButton.OnCheckedChangeListener {

        final boolean[] f9806;

        C3288(boolean[] zArr) {
            this.f9806 = zArr;
        }

        @Override
        public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
            this.f9806[0] = z;
        }
    }

    public class DialogInterfaceOnClickListenerC3289 implements DialogInterface.OnClickListener {

        final boolean[] f9808;

        DialogInterfaceOnClickListenerC3289(boolean[] zArr) {
            this.f9808 = zArr;
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            C2975.this.m8080(this.f9808[0]);
        }
    }

    public class DialogInterfaceOnClickListenerC3290 implements DialogInterface.OnClickListener {

        final boolean[] f9810;

        DialogInterfaceOnClickListenerC3290(boolean[] zArr) {
            this.f9810 = zArr;
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            C2975.this.m8080(this.f9810[0]);
        }
    }

    public class RunnableC3291 implements Runnable {

        final List f9812;

        class RunnableC3292 implements Runnable {

            final String f9814;

            class DialogInterfaceOnClickListenerC3293 implements DialogInterface.OnClickListener {
                DialogInterfaceOnClickListenerC3293() {
                }

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    RunnableC3292 runnableC3292 = RunnableC3292.this;
                    C2975.this.m8078(runnableC3292.f9814);
                }
            }

            class DialogInterfaceOnCancelListenerC3294 implements DialogInterface.OnCancelListener {
                DialogInterfaceOnCancelListenerC3294() {
                }

                @Override
                public void onCancel(DialogInterface dialogInterface) {
                    RunnableC3292 runnableC3292 = RunnableC3292.this;
                    C2975.this.m8078(runnableC3292.f9814);
                }
            }

            RunnableC3292(String str) {
                this.f9814 = str;
            }

            @Override
            public void run() {
                C2500.m7124(C2500.m7007(R.string.information), C2500.m7007(R.string.message_lp_install_success_uninstall_intsaller), C2500.m7007(R.string.button_for_uninstall_intsaller), new DialogInterfaceOnClickListenerC3293(), "", null, new DialogInterfaceOnCancelListenerC3294());
            }
        }

        RunnableC3291(List list) {
            this.f9812 = list;
        }

        @Override
        public void run() {
            Iterator it = this.f9812.iterator();
            while (it.hasNext()) {
                String str = ((ResolveInfo) it.next()).serviceInfo.packageName;
                if (str != null && str.contains("installer")) {
                    try {
                        C2975.m7954(new RunnableC3292(str));
                        return;
                    } catch (Throwable unused) {
                        C2975.this.m8078(str);
                        return;
                    }
                }
            }
        }
    }

    public class RunnableC3295 implements Runnable {

        class RunnableC3296 implements Runnable {
            RunnableC3296() {
            }

            @Override
            public void run() {
                C2975.m7951(11);
            }
        }

        class RunnableC3297 implements Runnable {
            RunnableC3297() {
            }

            @Override
            public void run() {
                C2975.m7951(11);
            }
        }

        RunnableC3295() {
        }

        @Override
        public void run() {
            String str;
            try {
                try {
                    str = C2975.m7932().getPackageInfo(C2975.f9253.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                } catch (PackageManager.NameNotFoundException unused) {
                    str = "";
                }
                new C2500("").m7211("pm uninstall " + C2975.f9253.f10046);
                if (!str.equals("")) {
                    C2500.m7093("rm " + C2500.m6976(str, false));
                }
                C2975.m7954(new RunnableC3297());
            } catch (Exception e) {
                C2975.m7942("Move to system " + e);
                C2975.m7954(new RunnableC3296());
            }
        }
    }

    public class RunnableC3298 implements Runnable {

        final boolean f9821;

        class RunnableC3299 implements Runnable {
            RunnableC3299() {
            }

            @Override
            public void run() {
                C2975.m7951(11);
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.unknown_error));
            }
        }

        class RunnableC3300 implements Runnable {

            class DialogInterfaceOnClickListenerC3301 implements DialogInterface.OnClickListener {
                DialogInterfaceOnClickListenerC3301() {
                }

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    C2500.m7073();
                }
            }

            RunnableC3300() {
            }

            @Override
            public void run() {
                C2975.m7951(11);
                C2500.m7125(C2975.f9253.f10047, C2500.m7007(R.string.well_done) + " " + C2500.m7007(R.string.integrate_updates_result_message) + " " + C2500.m7007(R.string.message_to_reboot_device), new DialogInterfaceOnClickListenerC3301(), null, null);
            }
        }

        RunnableC3298(boolean z) {
            this.f9821 = z;
        }

        @Override
        public void run() {
            String str;
            String str2;
            String str3;
            String str4;
            try {
                str = C2975.f9253.f10046;
            } catch (PackageManager.NameNotFoundException e) {
                e = e;
                str = "";
                str2 = str;
            }
            try {
                str2 = C2975.m7932().getPackageInfo(str, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                try {
                    str3 = C2975.m7932().getPackageInfo(str, ItemType.CLASS_DATA_ITEM).applicationInfo.dataDir;
                } catch (PackageManager.NameNotFoundException e2) {
                    e = e2;
                    str3 = "";
                }
            } catch (PackageManager.NameNotFoundException e3) {
                e = e3;
                str2 = "";
                str3 = str2;
                e.printStackTrace();
                str4 = str3;
                String str5 = C2975.f9284 + C1588.class.getName() + " " + C2975.f9253.f10046 + " " + str2 + " " + str4 + " " + this.f9821 + "\n";
                C2500.m7053(str);
                if (!this.f9821) {
                }
                C2975.m7942(new C2500("").m7211(str5));
                if (!this.f9821) {
                }
                C2975.m7954(new RunnableC3300());
            }
            try {
                try {
                    if (str2.startsWith("/data/app") || str2.startsWith("/mnt/")) {
                        new C2500("").m7211("pm uninstall " + str);
                    }
                    str2 = C2975.m7932().getPackageInfo(str, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                    str3 = "empty";
                    str4 = C2975.m7932().getPackageInfo(str, ItemType.CLASS_DATA_ITEM).applicationInfo.dataDir;
                } catch (PackageManager.NameNotFoundException e4) {
                    e = e4;
                    e.printStackTrace();
                    str4 = str3;
                    String str52 = C2975.f9284 + C1588.class.getName() + " " + C2975.f9253.f10046 + " " + str2 + " " + str4 + " " + this.f9821 + "\n";
                    C2500.m7053(str);
                    if (!this.f9821) {
                    }
                    C2975.m7942(new C2500("").m7211(str52));
                    if (!this.f9821) {
                    }
                    C2975.m7954(new RunnableC3300());
                }
                String str522 = C2975.f9284 + C1588.class.getName() + " " + C2975.f9253.f10046 + " " + str2 + " " + str4 + " " + this.f9821 + "\n";
                C2500.m7053(str);
                if (!this.f9821) {
                    C2500.m7078("/system", InternalZipConstants.WRITE_MODE);
                    if (!C2500.m7049(str2) && !str2.startsWith("/data") && !str2.startsWith("/mnt") && !str2.startsWith("/storage")) {
                        C2500.m7078(str2, InternalZipConstants.WRITE_MODE);
                    }
                    C2500.m7093("chattr -ai " + str2);
                }
                C2975.m7942(new C2500("").m7211(str522));
                if (!this.f9821) {
                    C2500.m7093("chmod 777 " + str2);
                    C2500.m7080(str);
                    C2500.m7093("rm '" + str2 + "'");
                }
                C2975.m7954(new RunnableC3300());
            } catch (Exception e5) {
                C2975.m7942("LuckyPatcher Uninstall: " + e5);
                C2975.m7954(new RunnableC3299());
            }
        }
    }

    public class DialogInterfaceOnClickListenerC3302 implements DialogInterface.OnClickListener {

        class RunnableC3303 implements Runnable {

            class RunnableC3304 implements Runnable {
                RunnableC3304() {
                }

                @Override
                public void run() {
                    try {
                        C2975.m7928().edit().remove(C2975.f9253.f10046).commit();
                        C2975.f9252.m8122(C2975.f9253.f10046);
                        C2975.f9252.notifyDataSetChanged();
                    } catch (Exception unused) {
                    }
                }
            }

            RunnableC3303() {
            }

            @Override
            public void run() {
                if (!C2975.f9283) {
                    C2500.m7153(C2975.f9259, C2975.f9253.f10046, Integer.valueOf(C2975.f9390));
                    return;
                }
                new C2500("").m7211("pm uninstall " + C2975.f9253.f10046);
                C2975.m7954(new RunnableC3304());
            }
        }

        DialogInterfaceOnClickListenerC3302() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            C2975.m7956(new RunnableC3303());
        }
    }

    public class DialogInterfaceOnClickListenerC3305 implements DialogInterface.OnClickListener {

        class RunnableC3306 implements Runnable {

            class RunnableC3307 implements Runnable {
                RunnableC3307() {
                }

                @Override
                public void run() {
                    try {
                        C2975.m7928().edit().remove(C2975.f9253.f10046).commit();
                        C2975.f9252.m8122(C2975.f9253.f10046);
                        C2975.f9252.notifyDataSetChanged();
                    } catch (Exception unused) {
                    }
                }
            }

            RunnableC3306() {
            }

            @Override
            public void run() {
                C2975.m7942(new C2500("").m7211("cmd package install-existing " + C2975.f9253.f10046));
                try {
                    C2975.m7932().getPackageInfo(C2975.f9253.f10046, 0);
                } catch (PackageManager.NameNotFoundException unused) {
                    new C2500("").m7211("pm install -r --user " + C2500.m6918() + " " + C2975.f9253.f10067);
                    try {
                        C2975.m7932().getPackageInfo(C2975.f9253.f10046, 0);
                    } catch (PackageManager.NameNotFoundException e) {
                        e.printStackTrace();
                    }
                }
                C2975.m7954(new RunnableC3307());
            }
        }

        DialogInterfaceOnClickListenerC3305() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            C2975.m7956(new RunnableC3306());
        }
    }

    public class DialogInterfaceOnClickListenerC3308 implements DialogInterface.OnClickListener {

        class RunnableC3309 implements Runnable {

            class RunnableC3310 implements Runnable {
                RunnableC3310() {
                }

                @Override
                public void run() {
                    try {
                        C2975.m7928().edit().remove(C2975.f9253.f10046).commit();
                        C2975.f9252.m8122(C2975.f9253.f10046);
                        C2975.f9252.notifyDataSetChanged();
                    } catch (Exception unused) {
                    }
                }
            }

            RunnableC3309() {
            }

            @Override
            public void run() {
                new C2500("").m7211("pm uninstall -k --user " + C2500.m6918() + " " + C2975.f9253.f10046);
                C2975.m7954(new RunnableC3310());
            }
        }

        DialogInterfaceOnClickListenerC3308() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            C2975.m7956(new RunnableC3309());
        }
    }

    public class DialogInterfaceOnClickListenerC3311 implements DialogInterface.OnClickListener {

        final C3478 f9834;

        class RunnableC3312 implements Runnable {

            class RunnableC3313 implements Runnable {
                RunnableC3313() {
                }

                @Override
                public void run() {
                    C2975.m7951(11);
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.unknown_error));
                }
            }

            class RunnableC3314 implements Runnable {
                RunnableC3314() {
                }

                @Override
                public void run() {
                    C2975.m7951(11);
                }
            }

            RunnableC3312() {
            }

            @Override
            public void run() {
                try {
                    C2500.m7053(DialogInterfaceOnClickListenerC3311.this.f9834.f10046);
                    C2975.f9248 = "";
                    C2975.f9248 = new C2500("").m7211(C2975.f9284 + C1664.class.getName() + " " + C2975.m7932().getPackageInfo(DialogInterfaceOnClickListenerC3311.this.f9834.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.dataDir);
                } catch (Exception e) {
                    C2975.m7942("LuckyPatcher Uninstall: " + e);
                    C2975.m7954(new RunnableC3313());
                }
                C2975.m7954(new RunnableC3314());
            }
        }

        DialogInterfaceOnClickListenerC3311(C3478 c3478) {
            this.f9834 = c3478;
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            if (i == -1) {
                if (C2975.f9283) {
                    try {
                        C2975.m7956(new RunnableC3312());
                        return;
                    } catch (Exception e) {
                        e.printStackTrace();
                        return;
                    }
                }
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.root_needed));
            }
        }
    }

    public class RunnableC3315 implements Runnable {

        class RunnableC3316 implements Runnable {
            RunnableC3316() {
            }

            @Override
            public void run() {
                C2975 c2975 = C2975.this;
                c2975.m7963(c2975.mo1874(), C2500.m7007(R.string.warning), C2500.m7007(R.string.no_space_in_data_all));
                C2975.m7951(11);
            }
        }

        class RunnableC3317 implements Runnable {
            RunnableC3317() {
            }

            @Override
            public void run() {
                C2975 c2975 = C2975.this;
                c2975.m7963(c2975.mo1874(), C2500.m7007(R.string.warning), C2500.m7007(R.string.no_space_in_system_all));
                C2975.m7951(11);
            }
        }

        class RunnableC3318 implements Runnable {
            RunnableC3318() {
            }

            @Override
            public void run() {
                Toast.makeText(C2975.m7929(), C2500.m7007(R.string.hosts_updated), 1).show();
                C2975.m7951(11);
            }
        }

        class RunnableC3319 implements Runnable {
            RunnableC3319() {
            }

            @Override
            public void run() {
                C2975 c2975 = C2975.this;
                c2975.m7963(c2975.mo1874(), C2500.m7007(R.string.warning), C2500.m7007(R.string.error_out_of_memory));
                C2975.m7951(11);
            }
        }

        class RunnableC3320 implements Runnable {
            RunnableC3320() {
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.unknown_error));
                C2975.m7951(11);
            }
        }

        class RunnableC3321 implements Runnable {
            RunnableC3321() {
            }

            @Override
            public void run() {
                C2975.m7951(11);
            }
        }

        RunnableC3315() {
        }

        @Override
        public void run() {
            File file = new File(C2975.m7929().getDir("tmp", 0) + "/hosts.txt");
            File file2 = new File(C2975.m7929().getDir("tmp", 0) + "/raw.txt");
            C2500.m6984(R.raw.xost, file2);
            String m7211 = new C2500("").m7211(C2975.f9284 + C1592.class.getName() + " /system/etc/hosts " + file.getAbsolutePath() + " " + file2.getAbsolutePath() + " " + C2975.f9250);
            C2975.m7942(m7211);
            if (m7211.contains("no_space_to_data")) {
                C2975.m7954(new RunnableC3316());
            }
            if (m7211.contains("no_space_to_system")) {
                C2975.m7954(new RunnableC3317());
            }
            if (m7211.contains("host updated!")) {
                C2975.m7954(new RunnableC3318());
            }
            if (m7211.contains("out.of.memory")) {
                C2975.m7954(new RunnableC3319());
            }
            if (m7211.contains("unknown error")) {
                C2975.m7954(new RunnableC3320());
            }
            C2975.m7954(new RunnableC3321());
            if (file2.exists()) {
                file2.delete();
            }
            if (file.exists()) {
                file.delete();
            }
        }
    }

    public class RunnableC3322 implements Runnable {

        class RunnableC3323 implements Runnable {
            RunnableC3323() {
            }

            @Override
            public void run() {
                C2975 c2975 = C2975.this;
                c2975.m7963(c2975.mo1874(), C2500.m7007(R.string.warning), C2500.m7007(R.string.no_space_in_data_all));
                C2975.m7951(11);
            }
        }

        class RunnableC3324 implements Runnable {
            RunnableC3324() {
            }

            @Override
            public void run() {
                C2975 c2975 = C2975.this;
                c2975.m7963(c2975.mo1874(), C2500.m7007(R.string.warning), C2500.m7007(R.string.no_space_in_system_all));
                C2975.m7951(11);
            }
        }

        class RunnableC3325 implements Runnable {
            RunnableC3325() {
            }

            @Override
            public void run() {
                Toast.makeText(C2975.m7929(), C2500.m7007(R.string.hosts_updated), 1).show();
                C2975.m7951(11);
            }
        }

        class RunnableC3326 implements Runnable {
            RunnableC3326() {
            }

            @Override
            public void run() {
                C2975 c2975 = C2975.this;
                c2975.m7963(c2975.mo1874(), C2500.m7007(R.string.warning), C2500.m7007(R.string.error_out_of_memory));
                C2975.m7951(11);
            }
        }

        class RunnableC3327 implements Runnable {
            RunnableC3327() {
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.unknown_error));
                C2975.m7951(11);
            }
        }

        class RunnableC3328 implements Runnable {
            RunnableC3328() {
            }

            @Override
            public void run() {
                Toast.makeText(C2975.m7929(), C2500.m7007(R.string.hosts_not_found_changes), 1).show();
                C2975.m7951(11);
            }
        }

        RunnableC3322() {
        }

        @Override
        public void run() {
            File file = new File(C2975.m7929().getDir("tmp", 0) + "/hosts.txt");
            String m7211 = new C2500("").m7211(C2975.f9284 + C1543.class.getName() + " /system/etc/hosts " + file.getAbsolutePath() + " " + C2975.f9250);
            C2975.m7942(m7211);
            if (m7211.contains("no_space_to_data")) {
                C2975.m7954(new RunnableC3323());
            }
            if (m7211.contains("no_space_to_system")) {
                C2975.m7954(new RunnableC3324());
            }
            if (m7211.contains("host updated!")) {
                C2975.m7954(new RunnableC3325());
            }
            if (m7211.contains("out.of.memory")) {
                C2975.m7954(new RunnableC3326());
            }
            if (m7211.contains("unknown error")) {
                C2975.m7954(new RunnableC3327());
            }
            if (!m7211.contains("Changes remove from host")) {
                C2975.m7954(new RunnableC3328());
            }
        }
    }

    public class RunnableC3329 implements Runnable {

        final C3478 f9853;

        class RunnableC3330 implements Runnable {

            final ArrayList f9855;

            RunnableC3330(ArrayList arrayList) {
                this.f9855 = arrayList;
            }

            @Override
            public void run() {
                boolean z = true;
                String[] strArr = {"com.android.vending.licensing.ServerManagedPolicy.xml", "com.google.android.vending.licensing.ServerManagedPolicy.xml"};
                try {
                    String str = C2975.m7932().getPackageInfo(C2975.f9253.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.dataDir;
                    int i = 0;
                    while (true) {
                        if (i < 2) {
                            String str2 = strArr[i];
                            if (C2500.m6898(str + InternalZipConstants.ZIP_FILE_SEPARATOR + "shared_prefs" + InternalZipConstants.ZIP_FILE_SEPARATOR + str2)) {
                                C2975.f9367 = new File(str + InternalZipConstants.ZIP_FILE_SEPARATOR + "shared_prefs" + InternalZipConstants.ZIP_FILE_SEPARATOR + str2);
                                break;
                            }
                            if (C2500.m6898("/dbdata/databases/" + RunnableC3329.this.f9853.f10046 + InternalZipConstants.ZIP_FILE_SEPARATOR + "shared_prefs" + InternalZipConstants.ZIP_FILE_SEPARATOR + str2)) {
                                C2975.f9367 = new File("/dbdata/databases/" + RunnableC3329.this.f9853.f10046 + InternalZipConstants.ZIP_FILE_SEPARATOR + "shared_prefs" + InternalZipConstants.ZIP_FILE_SEPARATOR + str2);
                                break;
                            }
                            i++;
                        } else {
                            z = false;
                            break;
                        }
                    }
                    if (z) {
                        this.f9855.add(new C3727(R.string.new_method_lvl, 0, "#66cc66", R.drawable.context_lvl));
                    }
                } catch (Throwable th) {
                    th.printStackTrace();
                }
            }
        }

        class RunnableC3331 implements Runnable {

            final ArrayList f9857;

            class DialogInterfaceOnClickListenerC3332 implements DialogInterface.OnClickListener {
                DialogInterfaceOnClickListenerC3332() {
                }

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    if (i != -1) {
                        return;
                    }
                    C3549.m8161(RunnableC3331.this.f9857, false);
                }
            }

            class C3333 implements CompoundButton.OnCheckedChangeListener {
                C3333() {
                }

                @Override
                public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
                    if (z) {
                        C2975.m7928().edit().putBoolean("warning_system_apps", false).commit();
                    } else {
                        C2975.m7928().edit().putBoolean("warning_system_apps", true).commit();
                    }
                }
            }

            RunnableC3331(ArrayList arrayList) {
                this.f9857 = arrayList;
            }

            @Override
            public void run() {
                C2975.m7951(11);
                if (!RunnableC3329.this.f9853.f10061) {
                    C3549.m8161(this.f9857, false);
                    return;
                }
                DialogInterfaceOnClickListenerC3332 dialogInterfaceOnClickListenerC3332 = new DialogInterfaceOnClickListenerC3332();
                if (C2975.m7928().getBoolean("warning_system_apps", true)) {
                    C2500.m7127(C2500.m7007(R.string.warning), C2500.m7007(R.string.dialog_system), C2500.m7007(R.string.warning_superSu_mount_name_space_separation_3), new C3333(), false, dialogInterfaceOnClickListenerC3332, null, null, false);
                } else if (C2975.f9245 != null) {
                    C3549.m8161(this.f9857, false);
                }
            }
        }

        RunnableC3329(C3478 c3478) {
            this.f9853 = c3478;
        }

        @Override
        public void run() {
            boolean z;
            ArrayList arrayList = new ArrayList();
            if (C2975.f9283) {
                arrayList.add(new C3727(R.string.contextmultipatch, 0, "#9999cc", R.drawable.context_deodex));
                if (this.f9853.f10056) {
                    arrayList.add(new C3727(R.string.contextcustompatch, 0, "#ffff99", R.drawable.context_custom_patch));
                }
                Thread thread = new Thread(new RunnableC3330(arrayList));
                thread.start();
                try {
                    thread.join();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                arrayList.add(new C3727(R.string.contextignore, 0, "#66cc66", R.drawable.context_lvl));
                arrayList.add(new C3727(R.string.contextads, 0, "#99cccc", R.drawable.context_ads));
                arrayList.add(new C3727(R.string.context_support_patch, 0, "#66cc66", R.drawable.context_lvl));
                arrayList.add(new C3727(R.string.context_change_components_menu, 0, "#cc99cc", R.drawable.context_permissions));
            }
            arrayList.add(new C3727(R.string.createapk, 0, "#ffcc66", R.drawable.context_create_apk));
            if (!this.f9853.f10061) {
                arrayList.add(new C3727(R.string.cloneApplication, 0, "#ffcc66", R.mipmap.clone));
            }
            C3478 c3478 = this.f9853;
            boolean z2 = c3478.f10061;
            if ((!z2 && C2975.f9283) || (z2 && c3478.f10067.startsWith("/data/app/"))) {
                arrayList.add(new C3727(R.string.contextreinstall, 0, "#9999cc", R.drawable.context_deodex));
            }
            if (this.f9853.f10062 && C2975.f9283) {
                arrayList.add(new C3727(R.string.contextdeodex, 0, "#9999cc", R.drawable.context_deodex));
            }
            try {
                C2637 c2637 = new C2637(C2975.m7929(), this.f9853.f10046, false);
                if (this.f9853.f10059 && c2637.m7284()) {
                    arrayList.add(new C3727(R.string.context_purchases_sorter, 0, "#66cc66", R.drawable.context_permissions));
                } else {
                    arrayList.add(new C3727(R.string.context_purchases_sorter, 0, "#aaaaaa", R.drawable.context_permissions));
                }
            } catch (Throwable th) {
                th.printStackTrace();
            }
            if (this.f9853.f10059) {
                arrayList.add(new C3727(R.string.context_remove_saved_purchaces, 0, "#66cc66", R.drawable.context_lvl));
            }
            try {
                for (File file : new File(C2975.f9251 + "/Backup").listFiles()) {
                    if (!file.getName().startsWith(this.f9853.f10046 + ".ver")) {
                        if (!file.getName().startsWith(C2500.m6873(this.f9853.f10047) + ".ver")) {
                            if (!file.getName().equals(this.f9853.f10046 + ".apk")) {
                            }
                        }
                    }
                    z = true;
                    break;
                }
            } catch (Exception unused) {
                C2975.m7942("LuckyPatcher error: backup files or directory not found!");
            }
            z = false;
            boolean m7198 = new C2500().m7198(new File(C2975.f9251 + "/Backup/Data/" + this.f9853.f10046), ".lpbkp");
            if (z || m7198) {
                if (z) {
                    arrayList.add(new C3727(R.string.contextrestore, 0, "#cccccc", R.drawable.context_restore));
                } else if (C2975.f9283 && m7198) {
                    arrayList.add(new C3727(R.string.contextrestore, 0, "#cccccc", R.drawable.context_restore));
                }
            }
            arrayList.add(new C3727(R.string.contextbackup, 0, "#cccccc", R.drawable.context_backup));
            if (C2975.f9283) {
                try {
                    for (File file2 : C2975.this.mo1874().getDir("bootlist", 0).listFiles()) {
                        if (file2.getName().equals(this.f9853.f10046)) {
                            arrayList.add(new C3727(R.string.context_remove_patch_boot, 0, "#8f8f8f", R.drawable.context_patch_reboot));
                        }
                    }
                } catch (Throwable th2) {
                    th2.printStackTrace();
                }
                C3478 c34782 = this.f9853;
                if (!c34782.f10061 && c34782.f10056) {
                    arrayList.add(new C3727(R.string.contextboot, 0, "#8f8f8f", R.drawable.context_patch_reboot));
                }
            }
            if (C2975.f9283) {
                arrayList.add(new C3727(R.string.context_dexopt_app, 0, "#ffffbb", R.drawable.context_odex));
                if (this.f9853.f10064) {
                    arrayList.add(new C3727(R.string.context_disable_package, 0, "#fe6c00", R.drawable.context_lvl));
                } else {
                    arrayList.add(new C3727(R.string.context_enable_package, 0, "#c2f055", R.drawable.context_patch_reboot));
                }
            }
            if (C2975.f9283) {
                if (!this.f9853.f10061) {
                    arrayList.add(new C3727(R.string.make_app_a_sys, 0, "#cccccc", R.drawable.move_to));
                    arrayList.add(new C3727(R.string.move_to_sys, 0, "#cccccc", R.drawable.move_to));
                }
                try {
                    String str = C2975.m7932().getPackageInfo(this.f9853.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                    if (this.f9853.f10061 && (str.startsWith("/data/app") || str.startsWith("/mnt/") || str.startsWith("/data/priv-app"))) {
                        arrayList.add(new C3727(R.string.integrate_updates_to_system, 0, "#cccccc", R.drawable.move_to));
                    }
                } catch (PackageManager.NameNotFoundException e2) {
                    e2.printStackTrace();
                }
            }
            arrayList.add(new C3727(R.string.open_to_GP, 0, "#cccccc", R.drawable.run));
            arrayList.add(new C3727(R.string.share_this_app, 0, "#cccccc", R.drawable.context_share));
            C2975.m7954(new RunnableC3331(arrayList));
        }
    }

    public class RunnableC3334 implements Runnable {

        final C3478 f9861;

        class RunnableC3335 implements Runnable {

            final String[] f9863;

            final ArrayList f9864;

            RunnableC3335(String[] strArr, ArrayList arrayList) {
                this.f9863 = strArr;
                this.f9864 = arrayList;
            }

            @Override
            public void run() {
                boolean z;
                try {
                    String[] strArr = this.f9863;
                    int length = strArr.length;
                    int i = 0;
                    while (true) {
                        if (i < length) {
                            String str = strArr[i];
                            String str2 = C2975.m7932().getPackageInfo(C2975.f9253.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.dataDir;
                            z = true;
                            if (C2500.m6898(str2 + InternalZipConstants.ZIP_FILE_SEPARATOR + "shared_prefs" + InternalZipConstants.ZIP_FILE_SEPARATOR + str)) {
                                C2975.f9367 = new File(str2 + InternalZipConstants.ZIP_FILE_SEPARATOR + "shared_prefs" + InternalZipConstants.ZIP_FILE_SEPARATOR + str);
                                break;
                            }
                            if (C2500.m6898("/dbdata/databases/" + RunnableC3334.this.f9861.f10046 + InternalZipConstants.ZIP_FILE_SEPARATOR + "shared_prefs" + InternalZipConstants.ZIP_FILE_SEPARATOR + str)) {
                                C2975.f9367 = new File("/dbdata/databases/" + RunnableC3334.this.f9861.f10046 + InternalZipConstants.ZIP_FILE_SEPARATOR + "shared_prefs" + InternalZipConstants.ZIP_FILE_SEPARATOR + str);
                                break;
                            }
                            i++;
                        } else {
                            z = false;
                            break;
                        }
                    }
                    if (z) {
                        this.f9864.add(new C3727(R.string.new_method_lvl, 0, "#66cc66", R.drawable.context_lvl));
                    }
                } catch (Throwable th) {
                    th.printStackTrace();
                }
            }
        }

        class RunnableC3336 implements Runnable {

            final ArrayList f9866;

            class DialogInterfaceOnClickListenerC3337 implements DialogInterface.OnClickListener {
                DialogInterfaceOnClickListenerC3337() {
                }

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    if (i != -1) {
                        return;
                    }
                    C3549.m8161(RunnableC3336.this.f9866, false);
                }
            }

            class C3338 implements CompoundButton.OnCheckedChangeListener {
                C3338() {
                }

                @Override
                public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
                    if (z) {
                        C2975.m7928().edit().putBoolean("warning_system_apps", false).commit();
                    } else {
                        C2975.m7928().edit().putBoolean("warning_system_apps", true).commit();
                    }
                }
            }

            RunnableC3336(ArrayList arrayList) {
                this.f9866 = arrayList;
            }

            @Override
            public void run() {
                C2975.m7951(11);
                if (!RunnableC3334.this.f9861.f10061) {
                    C3549.m8161(this.f9866, false);
                    return;
                }
                DialogInterfaceOnClickListenerC3337 dialogInterfaceOnClickListenerC3337 = new DialogInterfaceOnClickListenerC3337();
                if (C2975.m7928().getBoolean("warning_system_apps", true)) {
                    C2500.m7127(C2500.m7007(R.string.warning), C2500.m7007(R.string.dialog_system), C2500.m7007(R.string.warning_superSu_mount_name_space_separation_3), new C3338(), false, dialogInterfaceOnClickListenerC3337, null, null, false);
                } else if (C2975.f9245 != null) {
                    C3549.m8161(this.f9866, false);
                }
            }
        }

        RunnableC3334(C3478 c3478) {
            this.f9861 = c3478;
        }

        @Override
        public void run() {
            ArrayList arrayList = new ArrayList();
            if (C2975.f9283) {
                arrayList.add(new C3727(R.string.contextmultipatch, 0, "#9999cc", R.drawable.context_deodex));
                if (this.f9861.f10056) {
                    arrayList.add(new C3727(R.string.contextcustompatch, 0, "#ffff99", R.drawable.context_custom_patch));
                }
                Thread thread = new Thread(new RunnableC3335(new String[]{"com.android.vending.licensing.ServerManagedPolicy.xml", "com.google.android.vending.licensing.ServerManagedPolicy.xml"}, arrayList));
                thread.start();
                try {
                    thread.join();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                arrayList.add(new C3727(R.string.contextignore, 0, "#66cc66", R.drawable.context_lvl));
                arrayList.add(new C3727(R.string.contextads, 0, "#99cccc", R.drawable.context_ads));
                arrayList.add(new C3727(R.string.context_support_patch, 0, "#66cc66", R.drawable.context_lvl));
                arrayList.add(new C3727(R.string.context_change_components_menu, 0, "#cc99cc", R.drawable.context_permissions));
            }
            if (C2975.f9283) {
                arrayList.add(new C3727(R.string.createapk, 0, "#ffcc66", R.drawable.context_create_apk));
            }
            if (C2975.f9283) {
                C3478 c3478 = this.f9861;
                boolean z = c3478.f10061;
                if (!z || (z && c3478.f10067.startsWith("/data/app/"))) {
                    arrayList.add(new C3727(R.string.contextreinstall, 0, "#9999cc", R.drawable.context_deodex));
                }
                if (this.f9861.f10062) {
                    arrayList.add(new C3727(R.string.contextdeodex, 0, "#9999cc", R.drawable.context_deodex));
                }
                try {
                    for (File file : C2975.this.mo1874().getDir("bootlist", 0).listFiles()) {
                        if (file.getName().equals(this.f9861.f10046)) {
                            arrayList.add(new C3727(R.string.context_remove_patch_boot, 0, "#8f8f8f", R.drawable.context_patch_reboot));
                        }
                    }
                } catch (Throwable th) {
                    th.printStackTrace();
                }
                C3478 c34782 = this.f9861;
                if (!c34782.f10061 && c34782.f10056) {
                    arrayList.add(new C3727(R.string.contextboot, 0, "#8f8f8f", R.drawable.context_patch_reboot));
                }
            }
            C2975.m7954(new RunnableC3336(arrayList));
        }
    }

    public class RunnableC3339 implements Runnable {

        boolean f9870 = false;

        class RunnableC3340 implements Runnable {
            RunnableC3340() {
            }

            @Override
            public void run() {
                new AsyncTaskC3356().execute("");
            }
        }

        class RunnableC3341 implements Runnable {
            RunnableC3341() {
            }

            @Override
            public void run() {
                Toast.makeText(C2975.this.mo1874(), C2500.m7007(R.string.no_site), 0).show();
            }
        }

        RunnableC3339() {
        }

        @Override
        public void run() {
            boolean z;
            boolean z2;
            C2975.m7942("LuckyPatcher: check new version to Internet.");
            if (!C2975.m7928().getBoolean("disable_autoupdate", false) && (System.currentTimeMillis() - C2975.m7928().getLong("lastCheckUpdateTime", 0L)) / 3600000 > 48) {
                try {
                    C2975.this.f9417 = 0;
                    C2471 c2471 = null;
                    try {
                        c2471 = C2500.m6985("Version.vers");
                        if (c2471 != null) {
                            this.f9870 = false;
                            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                            c2471.m6817(byteArrayOutputStream);
                            C2975.this.f9417 = Integer.parseInt(byteArrayOutputStream.toString());
                        } else {
                            C2975.this.f9417 = 0;
                            this.f9870 = true;
                        }
                        if (c2471 != null) {
                            c2471.m6832();
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                        if (c2471 != null) {
                            c2471.m6832();
                        }
                        this.f9870 = true;
                    }
                } catch (Exception unused) {
                    C2975.m7942("LuckyPatcher: Internet permission removed from LP.");
                }
                C2975.m7928().edit();
                try {
                } catch (Exception e2) {
                    e = e2;
                    z2 = false;
                }
                if (!C2975.m7928().getBoolean("Update" + C2975.this.f9417, false)) {
                    C2975.m7928().edit().putLong("lastCheckUpdateTime", System.currentTimeMillis()).commit();
                    if (C2975.this.f9417 >= C2975.m7928().getInt("http_versionCode", 0)) {
                        C2975.m7928().edit().putInt("http_versionCode", C2975.this.f9417).commit();
                    }
                    if (C2975.this.f9417 > C2975.f9288) {
                        try {
                            C2975.m7954(new RunnableC3340());
                            if (this.f9870) {
                                C2975.m7954(new RunnableC3341());
                            }
                            z = true;
                        } catch (Exception e3) {
                            e = e3;
                            z2 = true;
                            e.printStackTrace();
                            z = z2;
                            if (!z) {
                            }
                        }
                        if (!z && !C2975.m7928().getBoolean("disable_autoupdate_custom_patches", false) && (System.currentTimeMillis() - C2975.m7928().getLong("lastCheckCustomPatchesUpdateTime", 0L)) / 3600000 >= 48) {
                            Thread thread = new Thread(new RunnableC3342());
                            thread.setPriority(1);
                            thread.start();
                            return;
                        }
                        return;
                    }
                }
            }
            z = false;
            if (!z) {
            }
        }
    }

    public class RunnableC3342 implements Runnable {

        boolean f9874 = false;

        public boolean f9875 = true;

        class RunnableC3343 implements Runnable {
            RunnableC3343() {
            }

            @Override
            public void run() {
                C2975.m7960(11);
            }
        }

        class RunnableC3344 implements Runnable {
            RunnableC3344() {
            }

            @Override
            public void run() {
                if (!RunnableC3342.this.f9875) {
                    C2975.m7962(C2500.m7007(R.string.information), C2500.m7007(R.string.custom_patches_update_not_found));
                }
                C2975.m7951(11);
            }
        }

        class RunnableC3345 implements Runnable {

            final ArrayList f9879;

            class DialogInterfaceOnClickListenerC3346 implements DialogInterface.OnClickListener {
                DialogInterfaceOnClickListenerC3346() {
                }

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    RunnableC3345 runnableC3345 = RunnableC3345.this;
                    C2975.this.m8011(runnableC3345.f9879);
                }
            }

            class DialogInterfaceOnClickListenerC3347 implements DialogInterface.OnClickListener {
                DialogInterfaceOnClickListenerC3347() {
                }

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    Iterator it = RunnableC3345.this.f9879.iterator();
                    while (it.hasNext()) {
                        C2623 c2623 = (C2623) it.next();
                        C2975.m7928().edit().putInt("skip_custom_patches_update_" + c2623.f7515, c2623.f7516).commit();
                    }
                }
            }

            RunnableC3345(ArrayList arrayList) {
                this.f9879 = arrayList;
            }

            @Override
            public void run() {
                C2500.m7118(C2500.m7007(R.string.update_found_title), C2500.m7007(R.string.update_custom_patches_message_1) + "\n\n" + C2500.m7007(R.string.update_custom_patches_message_2), C2500.m7007(R.string.update), new DialogInterfaceOnClickListenerC3346(), new DialogInterfaceOnClickListenerC3347(), null, true, null, 20000L);
            }
        }

        class RunnableC3348 implements Runnable {

            final ArrayList f9883;

            class DialogInterfaceOnClickListenerC3349 implements DialogInterface.OnClickListener {
                DialogInterfaceOnClickListenerC3349() {
                }

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    C2975.m7951(1);
                    RunnableC3348 runnableC3348 = RunnableC3348.this;
                    C2975.this.m8011(runnableC3348.f9883);
                }
            }

            class RunnableC3350 implements Runnable {
                RunnableC3350() {
                }

                @Override
                public void run() {
                    C2975.m7951(11);
                }
            }

            RunnableC3348(ArrayList arrayList) {
                this.f9883 = arrayList;
            }

            @Override
            public void run() {
                C2500.m7118(C2500.m7007(R.string.update_found_title), C2500.m7007(R.string.update_custom_patches_message_1) + "\n\n" + C2500.m7007(R.string.update_custom_patches_message_2), C2500.m7007(R.string.update), new DialogInterfaceOnClickListenerC3349(), null, null, true, new RunnableC3350(), 20000L);
            }
        }

        RunnableC3342() {
        }

        @Override
        public void run() {
            File file;
            long j;
            int i;
            C2975.m7942("LuckyPatcher: check new custom patches to Internet.");
            ArrayList arrayList = new ArrayList();
            try {
                if (!this.f9875) {
                    C2975.m7954(new RunnableC3343());
                }
                int i2 = 0;
                while (true) {
                    if (i2 >= 100) {
                        break;
                    }
                    if (i2 == 0) {
                        file = new File(C2975.f9251 + "/Download/CustomPatches.zip");
                    } else {
                        file = new File(C2975.f9251 + "/Download/CustomPatches" + i2 + ".zip");
                    }
                    if (file.exists()) {
                        j = file.length();
                    } else {
                        j = 0;
                    }
                    C2471 c2471 = null;
                    try {
                        c2471 = C2500.m6985(file.getName());
                        if (c2471 == null) {
                            break;
                        }
                        if (c2471.m6834()) {
                            i = c2471.m6829();
                            if (i < 2048) {
                                i = 0;
                            }
                            C2975.m7942(String.format(file.getName() + " %s bytes found, %s Mb", Integer.valueOf(i), Float.valueOf(i / 1048576.0f)));
                        } else {
                            i = 0;
                        }
                        c2471.m6832();
                        if (i > 0 && i != j) {
                            if (this.f9875) {
                                if (C2975.m7928().getInt("skip_custom_patches_update_" + file.getName(), 0) != i) {
                                    arrayList.add(new C2623(file.getName(), i, i2));
                                }
                            }
                            if (!this.f9875) {
                                arrayList.add(new C2623(file.getName(), i, i2));
                            }
                            C2975.m7928().edit().putLong("lastCheckCustomPatchesUpdateTime", System.currentTimeMillis()).commit();
                        }
                        if (i == 0) {
                            break;
                        } else {
                            i2++;
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                        if (c2471 != null) {
                            c2471.m6832();
                        }
                        this.f9874 = true;
                    }
                }
                if (arrayList.size() == 0) {
                    C2975.m7954(new RunnableC3344());
                    return;
                }
                boolean z = this.f9875;
                if (z && !C2975.f9341) {
                    C2975.f9341 = true;
                    C2975.m7954(new RunnableC3345(arrayList));
                } else if (!z) {
                    C2975.f9341 = true;
                    C2975.m7954(new RunnableC3348(arrayList));
                }
            } catch (Exception unused) {
                C2975.m7942("LuckyPatcher: Internet permission removed from LP.");
            }
        }
    }

    class AsyncTaskC3351 extends AsyncTask<String, Integer, Boolean> {

        int f9887 = 0;

        boolean f9888 = false;

        boolean f9889 = false;

        boolean f9890 = false;

        public class C3352 implements CompoundButton.OnCheckedChangeListener {
            C3352() {
            }

            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
                if (z) {
                    C2975.m7928().edit().putBoolean("use_random_name", true).commit();
                } else {
                    C2975.m7928().edit().putBoolean("use_random_name", false).commit();
                }
            }
        }

        public class C3353 implements CompoundButton.OnCheckedChangeListener {

            final boolean[] f9893;

            C3353(boolean[] zArr) {
                this.f9893 = zArr;
            }

            @Override
            public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
                this.f9893[0] = z;
            }
        }

        public class DialogInterfaceOnClickListenerC3354 implements DialogInterface.OnClickListener {

            final boolean[] f9895;

            class RunnableC3355 implements Runnable {
                RunnableC3355() {
                }

                @Override
                public void run() {
                    C2975.m7922(new File(C2975.f9251 + "/Download/LuckyPatcherInstaller.apk"), DialogInterfaceOnClickListenerC3354.this.f9895[0], C2975.m7928().getBoolean("use_random_name", true), true);
                }
            }

            DialogInterfaceOnClickListenerC3354(boolean[] zArr) {
                this.f9895 = zArr;
            }

            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                Thread thread = new Thread(new RunnableC3355());
                thread.setPriority(10);
                thread.start();
            }
        }

        AsyncTaskC3351() {
        }

        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            C2975.m7960(23);
        }

        @Override
        public Boolean doInBackground(String... strArr) {
            String str;
            boolean z;
            C2471 c2471 = null;
            try {
                c2471 = C2500.m6985("LuckyPatcherInstaller.apk");
                if (c2471 != null) {
                    this.f9890 = false;
                    int m6829 = c2471.m6829();
                    this.f9887 = m6829;
                    C2975.m7942(String.format("%s bytes found, %s Mb", Integer.valueOf(m6829), Float.valueOf(this.f9887 / 1048576.0f)));
                } else {
                    this.f9887 = 0;
                    this.f9890 = true;
                }
            } catch (Exception e) {
                e.printStackTrace();
                if (c2471 != null) {
                    c2471.m6832();
                }
            }
            if (c2471 != null) {
                c2471.m6832();
            }
            if (this.f9887 != 0) {
                C3746 c3746 = C2975.f9277;
                if (c3746 != null && c3746.m8243()) {
                    C2975.f9277.m8247(this.f9887 / 1024);
                }
                try {
                    new C2483("LuckyPatcherInstaller.apk").m6851();
                } catch (Throwable th) {
                    th.printStackTrace();
                    if (c2471 != null) {
                        c2471.m6832();
                    }
                }
                new Intent("android.intent.action.VIEW", Uri.parse(C2975.this.f9421));
                if (new File(C2975.f9251 + "/Download/LuckyPatcherInstaller.apk").exists()) {
                    if (new File(C2975.f9251 + "/Download/LuckyPatcherInstaller.apk").length() == this.f9887) {
                        if (C2975.m7928().getBoolean("first_show_option_install_apk", false) && C2975.m7928().getBoolean("first_show_option_use_random_name", false)) {
                            try {
                                String string = C2975.m7932().getPackageInfo(PkgName.getPkgName(), 8320).applicationInfo.metaData.getString("android.support");
                                z = string.equals("apk");
                                try {
                                    C2975.m7942("option apk installer:" + string);
                                } catch (PackageManager.NameNotFoundException e2) {
                                    e = e2;
                                    e.printStackTrace();
                                    C2975.m7922(new File(C2975.f9251 + "/Download/LuckyPatcherInstaller.apk"), z, !C2975.m7929().getApplicationInfo().loadLabel(C2975.m7932()).toString().startsWith("L"), true);
                                    if (C2975.this.f9417 == 999) {
                                    }
                                    return Boolean.TRUE;
                                } catch (Throwable th2) {
                                    th = th2;
                                    th.printStackTrace();
                                    C2975.m7922(new File(C2975.f9251 + "/Download/LuckyPatcherInstaller.apk"), z, !C2975.m7929().getApplicationInfo().loadLabel(C2975.m7932()).toString().startsWith("L"), true);
                                    if (C2975.this.f9417 == 999) {
                                    }
                                    return Boolean.TRUE;
                                }
                            } catch (PackageManager.NameNotFoundException e3) {
                                e = e3;
                                z = false;
                            } catch (Throwable th3) {
                                th = th3;
                                z = false;
                            }
                            C2975.m7922(new File(C2975.f9251 + "/Download/LuckyPatcherInstaller.apk"), z, !C2975.m7929().getApplicationInfo().loadLabel(C2975.m7932()).toString().startsWith("L"), true);
                            if (C2975.this.f9417 == 999) {
                                SharedPreferences.Editor edit = C2975.m7928().edit();
                                edit.putBoolean("999", true);
                                edit.commit();
                                new C2500("").m7211("pm uninstall -k " + C2975.f9279);
                                C2500.m7053(C2975.f9279);
                            }
                        } else {
                            try {
                                str = C2500.m7014(new File(C2975.f9251 + "/Download/LuckyPatcherInstaller.apk"));
                            } catch (ApkFormatException e4) {
                                e4.printStackTrace();
                                str = "";
                                boolean[] zArr = {false};
                                C2500.m7126(C2500.m7007(R.string.title_installation_lp), C2500.m7009(R.string.message_installation_lp, "" + str), C2500.m7007(R.string.installation_option), new C3352(), C2975.m7928().getBoolean("use_random_name", true), C2500.m7007(R.string.option_installation_apk_install_on), new C3353(zArr), false, new DialogInterfaceOnClickListenerC3354(zArr), null, null, false);
                                return Boolean.TRUE;
                            } catch (IOException e5) {
                                e5.printStackTrace();
                                str = "";
                                boolean[] zArr2 = {false};
                                C2500.m7126(C2500.m7007(R.string.title_installation_lp), C2500.m7009(R.string.message_installation_lp, "" + str), C2500.m7007(R.string.installation_option), new C3352(), C2975.m7928().getBoolean("use_random_name", true), C2500.m7007(R.string.option_installation_apk_install_on), new C3353(zArr2), false, new DialogInterfaceOnClickListenerC3354(zArr2), null, null, false);
                                return Boolean.TRUE;
                            }
                            boolean[] zArr22 = {false};
                            C2500.m7126(C2500.m7007(R.string.title_installation_lp), C2500.m7009(R.string.message_installation_lp, "" + str), C2500.m7007(R.string.installation_option), new C3352(), C2975.m7928().getBoolean("use_random_name", true), C2500.m7007(R.string.option_installation_apk_install_on), new C3353(zArr22), false, new DialogInterfaceOnClickListenerC3354(zArr22), null, null, false);
                        }
                    } else {
                        new File(C2975.f9251 + "/Download/" + C2975.this.f9419).delete();
                        this.f9888 = true;
                    }
                }
            } else {
                this.f9889 = true;
            }
            return Boolean.TRUE;
        }

        @Override
        public void onPostExecute(Boolean bool) {
            super.onPostExecute(bool);
            C2975.m7951(23);
            if (this.f9888) {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.corrupt_download));
            }
            if (this.f9889) {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.host_down));
            }
        }

        @Override
        public void onProgressUpdate(Integer... numArr) {
            super.onProgressUpdate(numArr);
            C3746 c3746 = C2975.f9277;
            if (c3746 != null) {
                c3746.m8249(numArr[0].intValue());
            }
        }
    }

    class AsyncTaskC3356 extends AsyncTask<String, Void, Boolean> {

        boolean f9898 = false;

        public class DialogInterfaceOnClickListenerC3357 implements DialogInterface.OnClickListener {
            DialogInterfaceOnClickListenerC3357() {
            }

            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                if (i != -2) {
                    if (i == -1) {
                        new AsyncTaskC3351().execute("Gruzimssite");
                    }
                } else if (C2975.this.f9417 != 999) {
                    SharedPreferences.Editor edit = C2975.m7928().edit();
                    edit.putBoolean("Update" + C2975.this.f9417, true);
                    edit.commit();
                }
            }
        }

        public class RunnableC3358 implements Runnable {

            final DialogInterface.OnClickListener f9901;

            RunnableC3358(DialogInterface.OnClickListener onClickListener) {
                this.f9901 = onClickListener;
            }

            @Override
            public void run() {
                String str = C2500.m7007(R.string.new_version) + "\n\n" + C2500.m7007(R.string.begin_changelog) + " " + C2975.f9273 + "\n\nChangeLog:\n\n" + C2975.this.f9422;
                String m7007 = C2500.m7007(R.string.update);
                DialogInterface.OnClickListener onClickListener = this.f9901;
                C2500.m7118("", str, m7007, onClickListener, onClickListener, null, false, null, 20000L);
            }
        }

        AsyncTaskC3356() {
        }

        @Override
        public Boolean doInBackground(String... strArr) {
            C2471 c2471;
            Exception e;
            C2975.m7942("LuckyPatcher: download changelog.");
            C2975 c2975 = C2975.this;
            c2975.f9417 = 0;
            c2975.f9419 = "LuckyPatcherInstaller.apk";
            c2975.f9420 = "Lucky Patcher";
            c2975.f9421 = "package:" + C2975.f9279;
            File file = new File(new File(C2975.f9251 + "/Download/"), C2975.this.f9419);
            if (file.exists()) {
                file.delete();
            }
            C2471 c24712 = null;
            try {
                c2471 = C2500.m6985("Version.vers");
            } catch (Exception e2) {
                c2471 = null;
                e = e2;
            }
            try {
                if (c2471 != null) {
                    this.f9898 = false;
                    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                    c2471.m6817(byteArrayOutputStream);
                    C2975.this.f9417 = Integer.parseInt(byteArrayOutputStream.toString());
                    c2471.m6832();
                } else {
                    C2975.this.f9417 = 0;
                    this.f9898 = true;
                }
                if (c2471 != null) {
                    c2471.m6832();
                }
                if (C2975.this.f9417 >= C2975.m7928().getInt("http_versionCode", 0)) {
                    C2975.m7928().edit().putInt("http_versionCode", C2975.this.f9417).commit();
                }
                if (C2975.this.f9417 > C2975.f9288) {
                    try {
                        c24712 = C2500.m6985("Changelogs.vers");
                        if (c24712 != null) {
                            this.f9898 = false;
                            ByteArrayOutputStream byteArrayOutputStream2 = new ByteArrayOutputStream();
                            c24712.m6817(byteArrayOutputStream2);
                            C2975.this.f9422 = byteArrayOutputStream2.toString();
                            String str = C2975.this.f9422;
                            if (str != null && str.length() > 20) {
                                C2500.m7101(new File(C2975.f9251 + "/Changes/changelog.txt"), C2975.this.f9422);
                            }
                            c24712.m6832();
                        } else {
                            this.f9898 = true;
                        }
                        if (c24712 != null) {
                            c24712.m6832();
                        }
                    } catch (Exception e3) {
                        e3.printStackTrace();
                        if (c24712 != null) {
                            c24712.m6832();
                        }
                        this.f9898 = true;
                    }
                }
                return Boolean.TRUE;
            } catch (Exception e4) {
                e = e4;
                e.printStackTrace();
                if (c2471 != null) {
                    c2471.m6832();
                }
                this.f9898 = true;
                return Boolean.TRUE;
            }
        }

        @Override
        public void onPostExecute(Boolean bool) {
            super.onPostExecute(bool);
            DialogInterfaceOnClickListenerC3357 dialogInterfaceOnClickListenerC3357 = new DialogInterfaceOnClickListenerC3357();
            if (!C2975.f9341) {
                C2975.f9341 = true;
                if (C2975.m7928().getBoolean("remove_ads", false)) {
                    C2500.m7120("", C2500.m7007(R.string.new_version) + "\n\n" + C2500.m7007(R.string.begin_changelog) + " " + C2975.f9273 + "\n\nChangeLog:\n\n" + C2975.this.f9422, C2500.m7007(R.string.update), dialogInterfaceOnClickListenerC3357, dialogInterfaceOnClickListenerC3357, null, false);
                    return;
                }
                C2975.m7954(new RunnableC3358(dialogInterfaceOnClickListenerC3357));
            }
        }
    }

    public class RunnableC3359 implements Runnable {

        class RunnableC3360 implements Runnable {

            final File f9904;

            RunnableC3360(File file) {
                this.f9904 = file;
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.information), C2500.m7007(R.string.res_0x7f1101dd_generate_log_result_message_core_jar) + " " + (this.f9904.length() / 1048576) + " Mb");
            }
        }

        RunnableC3359() {
        }

        @Override
        public void run() {
            C2608 c2608 = new C2608();
            c2608.f7407 = true;
            c2608.f7406 = true;
            Iterator<File> it = C2500.m6955(c2608).iterator();
            String str = "";
            while (it.hasNext()) {
                File next = it.next();
                if (C2500.m6898(next.getAbsolutePath())) {
                    str = next.getAbsolutePath();
                }
            }
            try {
                C2975.m7942(str);
                new C2500("").m7211(new String(("oatdump --oat-file=" + str + " --output=/sdcard/boot.oat.txt").getBytes(), "ISO-8859-1"));
            } catch (Exception e) {
                e.printStackTrace();
            }
            File file = new File("/sdcard/boot.oat.txt");
            if (file.exists() && file.length() > 0) {
                C2975.m7954(new RunnableC3360(file));
            } else {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.generate_log_error_message));
                file.delete();
            }
        }
    }

    public class C3361 extends TimerTask {

        boolean f9906 = false;

        class RunnableC3362 implements Runnable {
            RunnableC3362() {
            }

            @Override
            public void run() {
                C2975.this.m8052();
            }
        }

        public C3361() {
        }

        @Override
        public void run() {
            C2975.m7954(new RunnableC3362());
        }
    }

    public class C3363 extends TimerTask {

        boolean f9909 = false;

        public C3363() {
        }

        @Override
        public void run() {
            if (C2975.f9283) {
                C2975.m7920();
                C2500.m7066();
                C2975.this.m8026();
                C2975.this.m8040();
            }
            C2500.m7065(true, false, true);
        }
    }

    public class AsyncTaskC3364 extends AsyncTask<String, Void, Boolean> {

        boolean f9911 = false;

        public class RunnableC3365 implements Runnable {
            RunnableC3365() {
            }

            @Override
            public void run() {
                Toast.makeText(C2975.this.mo1874(), C2500.m7007(R.string.no_site), 0).show();
            }
        }

        AsyncTaskC3364() {
        }

        @Override
        protected void onPreExecute() {
            super.onPreExecute();
            C2975.m7960(11);
        }

        @Override
        public Boolean doInBackground(String... strArr) {
            C2975.this.f9417 = 0;
            C2471 c2471 = null;
            try {
                c2471 = C2500.m6985("Version.vers");
                if (c2471 != null) {
                    this.f9911 = false;
                    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                    c2471.m6817(byteArrayOutputStream);
                    C2975.this.f9417 = Integer.parseInt(byteArrayOutputStream.toString());
                } else {
                    C2975.this.f9417 = 0;
                    this.f9911 = true;
                }
                if (c2471 != null) {
                    c2471.m6832();
                }
                return Boolean.TRUE;
            } catch (Exception e) {
                e.printStackTrace();
                if (c2471 != null) {
                    c2471.m6832();
                }
                this.f9911 = true;
                return Boolean.TRUE;
            }
        }

        @Override
        public void onPostExecute(Boolean bool) {
            super.onPostExecute(bool);
            C2975.m7951(11);
            try {
                if (C2975.this.f9417 >= C2975.m7928().getInt("http_versionCode", 0)) {
                    C2975.m7928().edit().putInt("http_versionCode", C2975.this.f9417).commit();
                }
                if (C2975.this.f9417 == C2975.f9288) {
                    C2975.m7962(C2500.m7007(R.string.title_upd), C2500.m7007(R.string.equals_version));
                }
                if (C2975.this.f9417 == 0) {
                    C2975.m7962(C2500.m7007(R.string.title_upd), C2500.m7007(R.string.update_site_not_found));
                }
                C2975 c2975 = C2975.this;
                if (c2975.f9417 > C2975.f9288) {
                    c2975.m7969();
                    if (this.f9911) {
                        C2975.m7954(new RunnableC3365());
                    }
                }
            } catch (PackageManager.NameNotFoundException e) {
                e.printStackTrace();
            }
        }

        @Override
        public void onProgressUpdate(Void... voidArr) {
            super.onProgressUpdate(voidArr);
        }
    }

    public static final class C3366 implements Comparator<C2624> {
        @Override
        public int compare(C2624 c2624, C2624 c26242) {
            if (c2624 != null && c26242 != null) {
                if (c2624.f7519.equals("../")) {
                    return -1;
                }
                if (c26242.f7519.equals("../")) {
                    return 1;
                }
                if (C2975.f9363) {
                    if (new File(c2624.f7520).isDirectory() && new File(c26242.f7520).isDirectory()) {
                        return c2624.f7520.compareToIgnoreCase(c26242.f7520);
                    }
                    if (new File(c2624.f7520).isDirectory() && !new File(c26242.f7520).isDirectory()) {
                        return -1;
                    }
                    if (!new File(c2624.f7520).isDirectory() && !new File(c26242.f7520).isDirectory()) {
                        return c2624.f7520.compareToIgnoreCase(c26242.f7520);
                    }
                    if (!new File(c2624.f7520).isDirectory() && new File(c26242.f7520).isDirectory()) {
                        return 1;
                    }
                }
                return c2624.f7520.compareToIgnoreCase(c26242.f7520);
            }
            throw new ClassCastException();
        }
    }

    public class C3367 implements Comparator<C3478> {
        C3367() {
        }

        @Override
        public int compare(C3478 c3478, C3478 c34782) {
            int i;
            if (c3478 != null && c34782 != null) {
                boolean z = c3478.f10049;
                if (!z && !c34782.f10049) {
                    return c3478.toString().compareToIgnoreCase(c34782.toString());
                }
                int i2 = 0;
                if (z) {
                    i = 0;
                } else {
                    i = 200;
                }
                if (!c34782.f10049) {
                    i2 = 200;
                }
                int compareTo = Integer.valueOf(i).compareTo(Integer.valueOf(i2));
                if (compareTo != 0) {
                    return compareTo;
                }
                if (compareTo == 0) {
                    return c3478.toString().compareToIgnoreCase(c34782.toString());
                }
                return compareTo;
            }
            throw new ClassCastException();
        }
    }

    public final class C3368 implements Comparator<C3478> {
        C3368() {
        }

        @Override
        public int compare(C3478 c3478, C3478 c34782) {
            int i;
            if (c3478 != null && c34782 != null) {
                int i2 = 250;
                if (c3478.f10061) {
                    i = 250;
                } else {
                    i = 200;
                }
                if (!c34782.f10061) {
                    i2 = 200;
                }
                if (c3478.f10058) {
                    i = 4;
                }
                if (c34782.f10058) {
                    i2 = 4;
                }
                if (c3478.f10059) {
                    i = 3;
                }
                if (c34782.f10059) {
                    i2 = 3;
                }
                if (c3478.f10057) {
                    i = 2;
                }
                if (c34782.f10057) {
                    i2 = 2;
                }
                if (c3478.f10056) {
                    i = 1;
                }
                if (c34782.f10056) {
                    i2 = 1;
                }
                if (c3478.f10049) {
                    i = 0;
                }
                if (c34782.f10049) {
                    i2 = 0;
                }
                if (!c3478.f10064) {
                    i = 254;
                }
                if (!c34782.f10064) {
                    i2 = 254;
                }
                if (c3478.f10069) {
                    i = 255;
                }
                if (c34782.f10069) {
                    i2 = 255;
                }
                int compareTo = Integer.valueOf(i).compareTo(Integer.valueOf(i2));
                if (compareTo != 0) {
                    return compareTo;
                }
                try {
                    return c3478.toString().compareToIgnoreCase(c34782.toString());
                } catch (NullPointerException e) {
                    e.printStackTrace();
                    return 0;
                }
            }
            throw new ClassCastException();
        }
    }

    class RunnableC3369 implements Runnable {

        final C2939 f9916;

        final DialogInterface.OnClickListener f9917;

        RunnableC3369(C2939 c2939, DialogInterface.OnClickListener onClickListener) {
            this.f9916 = c2939;
            this.f9917 = onClickListener;
        }

        @Override
        public void run() {
            C2500.m7117(new C2913(C2975.f9245.mo1874()).m7860(C2500.m7007(R.string.warning)).m7876(C2500.m7007(R.string.backup_settings_restore_message) + " " + this.f9916.f9151 + "?").m7875(C2500.m7007(R.string.Yes), this.f9917).m7878(C2500.m7007(R.string.no), this.f9917).m7851());
        }
    }

    public final class C3370 implements Comparator<C3478> {
        C3370() {
        }

        @Override
        public int compare(C3478 c3478, C3478 c34782) {
            if (c3478 != null && c34782 != null) {
                return Integer.valueOf(c34782.f10063).compareTo(Integer.valueOf(c3478.f10063));
            }
            throw new ClassCastException();
        }
    }

    public static final class C3371 implements Comparator<C2624> {
        @Override
        public int compare(C2624 c2624, C2624 c26242) {
            long lastModified;
            long lastModified2;
            if (c2624 != null && c26242 != null) {
                if (c2624.f7519.equals("../")) {
                    return -1;
                }
                if (c26242.f7519.equals("../")) {
                    return 1;
                }
                if (C2975.f9363) {
                    if (new File(c2624.f7520).isDirectory() && new File(c26242.f7520).isDirectory()) {
                        lastModified = new File(c26242.f7520).lastModified();
                        lastModified2 = new File(c2624.f7520).lastModified();
                    } else {
                        if (new File(c2624.f7520).isDirectory() && !new File(c26242.f7520).isDirectory()) {
                            return -1;
                        }
                        if (!new File(c2624.f7520).isDirectory() && !new File(c26242.f7520).isDirectory()) {
                            lastModified = new File(c26242.f7520).lastModified();
                            lastModified2 = new File(c2624.f7520).lastModified();
                        } else if (!new File(c2624.f7520).isDirectory() && new File(c26242.f7520).isDirectory()) {
                            return 1;
                        }
                    }
                    return (lastModified > lastModified2 ? 1 : (lastModified == lastModified2 ? 0 : -1));
                }
                lastModified = new File(c26242.f7520).lastModified();
                lastModified2 = new File(c2624.f7520).lastModified();
                return (lastModified > lastModified2 ? 1 : (lastModified == lastModified2 ? 0 : -1));
            }
            throw new ClassCastException();
        }
    }

    public class RunnableC3372 implements Runnable {

        class RunnableC3373 implements Runnable {

            final File f9921;

            RunnableC3373(File file) {
                this.f9921 = file;
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.information), C2500.m7007(R.string.res_0x7f1101e0_generate_log_result_message_services_odex) + " " + (this.f9921.length() / 1048576) + " Mb");
            }
        }

        RunnableC3372() {
        }

        @Override
        public void run() {
            C2608 c2608 = new C2608();
            c2608.f7414 = true;
            c2608.f7415 = true;
            Iterator<File> it = C2500.m6955(c2608).iterator();
            String str = "";
            while (it.hasNext()) {
                File next = it.next();
                if (C2500.m6898(next.getAbsolutePath())) {
                    str = next.getAbsolutePath();
                }
            }
            try {
                C2975.m7942(str);
                new C2500("").m7211(new String(("oatdump --oat-file=" + str + " --output=/sdcard/services.odex.txt").getBytes(), "ISO-8859-1"));
            } catch (Exception e) {
                e.printStackTrace();
            }
            File file = new File("/sdcard/services.odex.txt");
            if (file.exists() && file.length() > 0) {
                C2975.m7954(new RunnableC3373(file));
            } else {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.generate_log_error_message));
                file.delete();
            }
        }
    }

    class DialogInterfaceOnClickListenerC3374 implements DialogInterface.OnClickListener {

        final C2939 f9923;

        class RunnableC3375 implements Runnable {

            final File f9925;

            class RunnableC3376 implements Runnable {
                RunnableC3376() {
                }

                @Override
                public void run() {
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.restore_data_error));
                    C2975.m7951(11);
                }
            }

            class RunnableC3377 implements Runnable {
                RunnableC3377() {
                }

                @Override
                public void run() {
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.restore_data_error));
                    C2975.m7951(11);
                }
            }

            class RunnableC3378 implements Runnable {
                RunnableC3378() {
                }

                @Override
                public void run() {
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.restore_data_error));
                    C2975.m7951(11);
                }
            }

            class RunnableC3379 implements Runnable {
                RunnableC3379() {
                }

                @Override
                public void run() {
                    C2975.m7962(C2500.m7007(R.string.well_done), C2500.m7007(R.string.restore_data_success));
                    C2975.m7951(11);
                }
            }

            RunnableC3375(File file) {
                this.f9925 = file;
            }

            @Override
            public void run() {
                try {
                    C2500.m7053(DialogInterfaceOnClickListenerC3374.this.f9923.f9151);
                    String str = C2975.m7932().getPackageInfo(DialogInterfaceOnClickListenerC3374.this.f9923.f9151, ItemType.CLASS_DATA_ITEM).applicationInfo.dataDir;
                    int i = C2975.m7932().getPackageInfo(DialogInterfaceOnClickListenerC3374.this.f9923.f9151, ItemType.CLASS_DATA_ITEM).applicationInfo.uid;
                    String str2 = "empty";
                    try {
                        if (C2975.f9299 > 7) {
                            str2 = C2975.m7929().getExternalFilesDir("").getAbsolutePath().replace("/files", "").replace(C2975.m7929().getPackageName(), DialogInterfaceOnClickListenerC3374.this.f9923.f9151);
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    C2975.m7942(str2);
                    String m7211 = new C2500("").m7211(C2975.f9284 + C1570.class.getName() + " " + DialogInterfaceOnClickListenerC3374.this.f9923.f9151 + " " + str + " '" + this.f9925.getAbsolutePath() + "' " + i + " '" + str2 + "'");
                    C2975.m7942(m7211);
                    if (m7211.contains("error")) {
                        C2975.m7954(new RunnableC3376());
                    } else {
                        C2975.m7954(new RunnableC3379());
                    }
                } catch (PackageManager.NameNotFoundException e2) {
                    e2.printStackTrace();
                    C2975.m7954(new RunnableC3377());
                } catch (Exception e3) {
                    e3.printStackTrace();
                    C2975.m7954(new RunnableC3378());
                }
            }
        }

        DialogInterfaceOnClickListenerC3374(C2939 c2939) {
            this.f9923 = c2939;
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            if (i == -1) {
                try {
                    File file = this.f9923.f9156;
                    file.mkdirs();
                    C2975.m7956(new RunnableC3375(file));
                } catch (Throwable th) {
                    th.printStackTrace();
                }
            }
        }
    }

    public class RunnableC3380 implements Runnable {

        class RunnableC3381 implements Runnable {

            final File f9932;

            RunnableC3381(File file) {
                this.f9932 = file;
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.information), C2500.m7007(R.string.generate_log_result_message_framework) + " " + (this.f9932.length() / 1048576) + " Mb");
            }
        }

        RunnableC3380() {
        }

        @Override
        public void run() {
            C2608 c2608 = new C2608();
            c2608.f7420 = true;
            c2608.f7421 = true;
            Iterator<File> it = C2500.m6955(c2608).iterator();
            String str = "";
            while (it.hasNext()) {
                File next = it.next();
                if (C2500.m6898(next.getAbsolutePath())) {
                    str = next.getAbsolutePath();
                }
            }
            try {
                C2975.m7942(str);
                new C2500("").m7211(new String(("oatdump --oat-file=" + str + " --output=/sdcard/framework.txt").getBytes(), "ISO-8859-1"));
            } catch (Exception e) {
                e.printStackTrace();
            }
            File file = new File("/sdcard/framework.txt");
            if (file.exists() && file.length() > 0) {
                C2975.m7954(new RunnableC3381(file));
            } else {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.generate_log_error_message));
                file.delete();
            }
        }
    }

    public class DialogInterfaceOnClickListenerC3382 implements DialogInterface.OnClickListener {

        final C2939 f9934;

        class RunnableC3383 implements Runnable {

            class RunnableC3384 implements Runnable {
                RunnableC3384() {
                }

                @Override
                public void run() {
                    C3746 c3746 = C2975.f9277;
                    if (c3746 != null && c3746.m8243()) {
                        C2975.f9277.m8248(C2500.m7007(R.string.patch_step2));
                        C2975.f9277.m8250(C2500.m7007(R.string.patch_step_http));
                    }
                }
            }

            class RunnableC3385 implements Runnable {
                RunnableC3385() {
                }

                @Override
                public void run() {
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.no_freespace_patch));
                }
            }

            class RunnableC3386 implements Runnable {
                RunnableC3386() {
                }

                @Override
                public void run() {
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_create_oat));
                }
            }

            class RunnableC3387 implements Runnable {
                RunnableC3387() {
                }

                @Override
                public void run() {
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.no_space_in_data_all));
                }
            }

            class RunnableC3388 implements Runnable {
                RunnableC3388() {
                }

                @Override
                public void run() {
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.unknown_error));
                }
            }

            class RunnableC3389 implements Runnable {
                RunnableC3389() {
                }

                @Override
                public void run() {
                    C2975.m7951(23);
                    try {
                        C2975.f9252.m8115(C2975.f9280.f9233.f10046).f10060 = true;
                        C2975.f9252.m8115(C2975.f9280.f9233.f10046).f10062 = true;
                        C3479 c3479 = C2975.f9252;
                        c3479.m8117(c3479.m8115(C2975.f9280.f9233.f10046));
                        C2975.m7928().edit().putBoolean(C2975.f9252.m8115(C2975.f9280.f9233.f10046).f10046, true).commit();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    C2975.m7951(40);
                    C2975.m7960(40);
                    if (C2975.f9248.contains("not enought free space for copy dalvik cache to odex.")) {
                        C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.no_freespace_patch));
                    }
                    C2975.f9252.m8123(C2975.f9280.f9233.f10046);
                    C2975.f9282 = "";
                }
            }

            class RunnableC3390 implements Runnable {
                RunnableC3390() {
                }

                @Override
                public void run() {
                    C2975.m7951(23);
                    try {
                        C2975.f9252.m8115(C2975.f9280.f9233.f10046).f10060 = true;
                        C2975.f9252.m8115(C2975.f9280.f9233.f10046).f10062 = true;
                        C3479 c3479 = C2975.f9252;
                        c3479.m8117(c3479.m8115(C2975.f9280.f9233.f10046));
                        C2975.m7928().edit().putBoolean(C2975.f9252.m8115(C2975.f9280.f9233.f10046).f10046, true).commit();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    C2975.m7951(40);
                    C2975.m7960(40);
                    if (C2975.f9248.contains("not enought free space for copy dalvik cache to odex.")) {
                        C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.no_freespace_patch));
                    }
                }
            }

            RunnableC3383() {
            }

            @Override
            public void run() {
                String str = C2975.f9280.f9230;
                try {
                    C2975.f9248 = "";
                    C2975.m7942(C2500.m6935());
                    C2975.m7954(new RunnableC3384());
                    C2975.f9302 = "";
                    C2975.f9248 = new C2500("").m7211(str);
                    C2975.f9323 = Boolean.FALSE;
                    if (C2975.f9248.contains("chelpus_return_1")) {
                        C2975.m7954(new RunnableC3385());
                    }
                    if (C2975.f9248.contains("chelpus_return_2")) {
                        C2975.m7954(new RunnableC3386());
                    }
                    if (C2975.f9248.contains("chelpus_return_3")) {
                        C2975.m7954(new RunnableC3387());
                    }
                    if (C2975.f9248.contains("chelpus_return_4")) {
                        C2975.m7954(new RunnableC3388());
                    }
                    C2975.m7954(new RunnableC3389());
                } catch (Exception e) {
                    C2975.m7942("LuckyPatcher Error: " + e);
                    e.printStackTrace();
                    try {
                        C2975.m7954(new RunnableC3390());
                    } catch (Exception unused) {
                        C2975.m7942("LuckyPatcher: handler Null.");
                    }
                }
            }
        }

        DialogInterfaceOnClickListenerC3382(C2939 c2939) {
            this.f9934 = c2939;
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            String absolutePath;
            try {
                C2975.f9248 = "";
                String str = C2975.f9389.f9151;
                C3478 c3478 = new C3478(str, C2975.f9300, false);
                C2975.f9253 = c3478;
                String str2 = "not_system";
                if (c3478.f10061) {
                    str2 = "system";
                }
                String valueOf = String.valueOf(C2975.m7932().getPackageInfo(str, ItemType.CLASS_DATA_ITEM).applicationInfo.uid);
                String str3 = "no_split";
                if (C2500.m7047(this.f9934.f9151)) {
                    str3 = "splitted";
                }
                C2939 c2939 = C2975.f9389;
                if (c2939.f9157) {
                    absolutePath = C2500.m6928(c2939.f9156).getAbsolutePath();
                } else {
                    absolutePath = c2939.f9156.getAbsolutePath();
                }
                String str4 = C2975.f9284 + C1676.class.getName() + " " + str + " " + C2975.m7932().getPackageInfo(C2975.f9253.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir + " " + C2975.this.mo1874().getFilesDir() + " " + str2 + " " + C2500.m6935() + " " + valueOf + " " + absolutePath + " " + str3 + "\n";
                C2975.m7942(str4);
                C2974 c2974 = new C2974();
                C2975.f9280 = c2974;
                c2974.f9233 = C2975.f9253;
                C2974 c29742 = C2975.f9280;
                c29742.f9224 = "LVL";
                c29742.f9225 = C2975.m7932().getPackageInfo(C2975.f9253.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                C2975.f9280.f9226 = C2975.f9253.f10046;
                C2974 c29743 = C2975.f9280;
                c29743.f9227 = str2;
                c29743.f9228 = C2975.this.mo1874().getFilesDir().getAbsolutePath();
                C2975.f9280.f9229 = String.valueOf(C2975.m7932().getPackageInfo(C2975.f9253.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.uid);
                C2974 c29744 = C2975.f9280;
                c29744.f9230 = str4;
                c29744.f9231 = C2975.f9284 + C1670.class.getName() + " " + C2975.m7932().getPackageInfo(C2975.f9253.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir + " " + C2975.m7929().getFilesDir() + "\n";
                C2975.f9280.f9232 = C2975.f9302;
                if (C2975.this.m1885()) {
                    C2975.f9259 = (MainActivity) C2975.this.m1860();
                }
                C2975.m7956(new RunnableC3383());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    public class RunnableC3391 implements Runnable {

        final String f9944;

        RunnableC3391(String str) {
            this.f9944 = str;
        }

        @Override
        public void run() {
            String m7211 = new C2500("").m7211("pm uninstall " + this.f9944);
            new C2500("w").m7212(4000L);
            C2975.m7942("uninstall results:" + m7211);
            C2975.m7942("uninstall results errors:" + C2975.f9298);
            try {
                C2975.m7932().getPackageInfo(this.f9944, ItemType.CLASS_DATA_ITEM);
                C2500.m7153(App.MainActivity, this.f9944, Integer.valueOf(C2975.f9399));
            } catch (PackageManager.NameNotFoundException unused) {
                C2975 c2975 = C2975.f9245;
                if (c2975 != null) {
                    c2975.m8079();
                }
            }
        }
    }

    class RunnableC3392 implements Runnable {
        RunnableC3392() {
        }

        @Override
        public void run() {
            C2975.m7962(C2500.m7007(R.string.error), C2500.m7007(R.string.backup_settings_error_message));
            C2975.m7951(11);
        }
    }

    public class RunnableC3393 implements Runnable {

        class RunnableC3394 implements Runnable {

            class RunnableC3395 implements Runnable {
                RunnableC3395() {
                }

                @Override
                public void run() {
                    for (String str : C2500.m6995()) {
                        try {
                            C2500.m6907(str + InternalZipConstants.ZIP_FILE_SEPARATOR + C2975.f9356);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                }
            }

            class C3396 extends ArrayAdapter<C2936> {

                TextView f9950;

                TextView f9951;

                class ViewOnClickListenerC3397 implements View.OnClickListener {

                    class RunnableC3398 implements Runnable {
                        RunnableC3398() {
                        }

                        @Override
                        public void run() {
                            int i;
                            String[] strArr;
                            long m6983;
                            String[] strArr2 = {"appver1", "appver2", "appnewsig", "apptargetsdk30"};
                            int i2 = 0;
                            for (int i3 = 4; i2 < i3; i3 = 4) {
                                String str = strArr2[i2];
                                File file = new File(C2975.f9250 + InternalZipConstants.ZIP_FILE_SEPARATOR + str + ".apk");
                                str.hashCode();
                                char c = 65535;
                                switch (str.hashCode()) {
                                    case -2035823470:
                                        if (str.equals("appnewsig")) {
                                            c = 0;
                                        }
                                        switch (c) {
                                            case 0:
                                                i = R.raw.appnewsig;
                                                break;
                                            case 1:
                                                i = R.raw.appver1;
                                                break;
                                            case 2:
                                                i = R.raw.appver2;
                                                break;
                                            case 3:
                                                i = R.raw.apptargetsdk30;
                                                break;
                                            default:
                                                strArr = strArr2;
                                                i = 0;
                                                break;
                                        }
                                        strArr = strArr2;
                                        m6983 = C2500.m6983(i);
                                        if (file.exists() || file.length() != m6983) {
                                            if (file.length() != m6983) {
                                                File file2 = new File(C2975.f9250 + InternalZipConstants.ZIP_FILE_SEPARATOR + str + ".apk");
                                                if (file2.exists()) {
                                                    file2.delete();
                                                }
                                                C2975.m7942("LuckyPatcher: " + str + " version updated. " + m6983 + " " + file.length());
                                                if (file.exists()) {
                                                    file.delete();
                                                }
                                            }
                                            try {
                                                C2500.m6984(i, new File(C2975.f9250 + InternalZipConstants.ZIP_FILE_SEPARATOR + str + ".apk"));
                                            } catch (Exception unused) {
                                            }
                                            C2500.m7093("chmod 06777 " + file.getAbsolutePath());
                                            C2500.m7093("chown 0.0 " + file.getAbsolutePath());
                                            C2500.m7093("chown 0:0 " + file.getAbsolutePath());
                                        }
                                        i2++;
                                        strArr2 = strArr;
                                        break;
                                    case -792940913:
                                        if (str.equals("appver1")) {
                                            c = 1;
                                        }
                                        switch (c) {
                                        }
                                        strArr = strArr2;
                                        m6983 = C2500.m6983(i);
                                        if (file.exists()) {
                                            break;
                                        }
                                        if (file.length() != m6983) {
                                        }
                                        C2500.m6984(i, new File(C2975.f9250 + InternalZipConstants.ZIP_FILE_SEPARATOR + str + ".apk"));
                                        C2500.m7093("chmod 06777 " + file.getAbsolutePath());
                                        C2500.m7093("chown 0.0 " + file.getAbsolutePath());
                                        C2500.m7093("chown 0:0 " + file.getAbsolutePath());
                                        i2++;
                                        strArr2 = strArr;
                                        break;
                                    case -792940912:
                                        if (str.equals("appver2")) {
                                            c = 2;
                                        }
                                        switch (c) {
                                        }
                                        strArr = strArr2;
                                        m6983 = C2500.m6983(i);
                                        if (file.exists()) {
                                        }
                                        if (file.length() != m6983) {
                                        }
                                        C2500.m6984(i, new File(C2975.f9250 + InternalZipConstants.ZIP_FILE_SEPARATOR + str + ".apk"));
                                        C2500.m7093("chmod 06777 " + file.getAbsolutePath());
                                        C2500.m7093("chown 0.0 " + file.getAbsolutePath());
                                        C2500.m7093("chown 0:0 " + file.getAbsolutePath());
                                        i2++;
                                        strArr2 = strArr;
                                        break;
                                    case -790162331:
                                        if (str.equals("apptargetsdk30")) {
                                            c = 3;
                                        }
                                        switch (c) {
                                        }
                                        strArr = strArr2;
                                        m6983 = C2500.m6983(i);
                                        if (file.exists()) {
                                        }
                                        if (file.length() != m6983) {
                                        }
                                        C2500.m6984(i, new File(C2975.f9250 + InternalZipConstants.ZIP_FILE_SEPARATOR + str + ".apk"));
                                        C2500.m7093("chmod 06777 " + file.getAbsolutePath());
                                        C2500.m7093("chown 0.0 " + file.getAbsolutePath());
                                        C2500.m7093("chown 0:0 " + file.getAbsolutePath());
                                        i2++;
                                        strArr2 = strArr;
                                        break;
                                    default:
                                        switch (c) {
                                        }
                                        strArr = strArr2;
                                        m6983 = C2500.m6983(i);
                                        if (file.exists()) {
                                        }
                                        if (file.length() != m6983) {
                                        }
                                        C2500.m6984(i, new File(C2975.f9250 + InternalZipConstants.ZIP_FILE_SEPARATOR + str + ".apk"));
                                        C2500.m7093("chmod 06777 " + file.getAbsolutePath());
                                        C2500.m7093("chown 0.0 " + file.getAbsolutePath());
                                        C2500.m7093("chown 0:0 " + file.getAbsolutePath());
                                        i2++;
                                        strArr2 = strArr;
                                        break;
                                }
                            }
                            File file3 = new File(C2975.f9250 + "/appver1.apk");
                            File file4 = new File(C2975.f9250 + "/appver2.apk");
                            File file5 = new File(C2975.f9250 + "/appnewsig.apk");
                            File file6 = new File(C2975.f9250 + "/apptargetsdk30.apk");
                            SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();
                            if (file3.exists() && file4.exists()) {
                                String m7024 = C2500.m7024(file4.getAbsolutePath(), null, true, false);
                                if (m7024.length() < 5) {
                                    m7024 = m7024 + C2975.f9298;
                                }
                                spannableStringBuilder.append((CharSequence) C2500.m6934(C2500.m7007(R.string.message_test_pm_utility) + ": ", "#DDDDDD", ""));
                                if (m7024.toLowerCase().contains("success")) {
                                    spannableStringBuilder.append((CharSequence) C2500.m6934("\n" + C2500.m7007(R.string.success) + "\n\n", "#8BC34A", ""));
                                    StringBuilder sb = new StringBuilder();
                                    sb.append(C2500.m7007(R.string.message_test_patch_downgrade));
                                    sb.append(": ");
                                    spannableStringBuilder.append((CharSequence) C2500.m6934(sb.toString(), "#DDDDDD", ""));
                                    String m70242 = C2500.m7024(file3.getAbsolutePath(), null, true, false);
                                    if (m70242.length() < 5) {
                                        m70242 = m70242 + C2975.f9298;
                                    }
                                    if (m70242.toLowerCase().contains("success")) {
                                        spannableStringBuilder.append((CharSequence) C2500.m6934("\n" + C2500.m7007(R.string.success) + "\n\n", "#8BC34A", ""));
                                    } else {
                                        C2975.f9375 = true;
                                        spannableStringBuilder.append((CharSequence) C2500.m6934("\n" + C2500.m7007(R.string.failed) + "\n(" + m70242.replaceAll("\n", "") + ")\n\n", "#F44336", ""));
                                    }
                                    spannableStringBuilder.append((CharSequence) C2500.m6934(C2500.m7007(R.string.message_test_patch_signatures) + ": ", "#DDDDDD", ""));
                                    String m70243 = C2500.m7024(file5.getAbsolutePath(), null, true, false);
                                    if (m70243.length() < 5) {
                                        m70243 = m70243 + C2975.f9298;
                                    }
                                    if (m70243.toLowerCase().contains("success")) {
                                        spannableStringBuilder.append((CharSequence) C2500.m6934("\n" + C2500.m7007(R.string.success) + "\n\n", "#8BC34A", ""));
                                    } else {
                                        C2975.f9375 = true;
                                        spannableStringBuilder.append((CharSequence) C2500.m6934("\n" + C2500.m7007(R.string.failed) + "\n(" + m70243.replaceAll("\n", "") + ")\n\n", "#F44336", ""));
                                    }
                                    spannableStringBuilder.append((CharSequence) C2500.m6934(C2500.m7007(R.string.message_test_patch_terget_sdk_30_installing) + ": ", "#DDDDDD", ""));
                                    new C2500("").m7211("pm uninstall ru.test.app.lp");
                                    String m70244 = C2500.m7024(file6.getAbsolutePath(), null, true, false);
                                    if (m70244.length() < 5) {
                                        m70244 = m70244 + C2975.f9298;
                                    }
                                    if (m70244.toLowerCase().contains("success")) {
                                        spannableStringBuilder.append((CharSequence) C2500.m6934("\n" + C2500.m7007(R.string.success) + "\n", "#8BC34A", ""));
                                    } else {
                                        C2975.f9375 = true;
                                        spannableStringBuilder.append((CharSequence) C2500.m6934("\n" + C2500.m7007(R.string.failed) + "\n(" + m70244.replaceAll("\n", "") + ")\n", "#F44336", ""));
                                    }
                                } else {
                                    C2975.f9375 = true;
                                    spannableStringBuilder.append((CharSequence) C2500.m6934("\n" + C2500.m7007(R.string.failed) + "\n(" + m7024.replaceAll("\n", "") + ")\n", "#F44336", ""));
                                    StringBuilder sb2 = new StringBuilder();
                                    sb2.append("\n");
                                    sb2.append(C2500.m7007(R.string.message_test_pm_utility_fail));
                                    spannableStringBuilder.append((CharSequence) C2500.m6934(sb2.toString(), "#F44336", ""));
                                }
                                new C2500("").m7211("pm uninstall ru.test.app.lp");
                            }
                            C2500.m7132(C2975.f9245.mo1874(), C2500.m7007(R.string.PatchResult), spannableStringBuilder);
                        }
                    }

                    ViewOnClickListenerC3397() {
                    }

                    @Override
                    public void onClick(View view) {
                        C2975.m7956(new RunnableC3398());
                    }
                }

                C3396(Context context, int i, List list) {
                    super(context, i, list);
                }

                @Override
                public View getView(int i, View view, ViewGroup viewGroup) {
                    JSONObject jSONObject;
                    C2936 c2936 = (C2936) getItem(i);
                    View inflate = ((LayoutInflater) C2975.m7929().getSystemService("layout_inflater")).inflate(R.layout.xposedpatch, viewGroup, false);
                    this.f9950 = (TextView) inflate.findViewById(R.id.txtTitle);
                    this.f9951 = (TextView) inflate.findViewById(R.id.txtStatus);
                    this.f9950.setTextAppearance(getContext(), C2975.m7934());
                    this.f9951.setTextAppearance(getContext(), C2975.m7934());
                    CheckBox checkBox = (CheckBox) inflate.findViewById(R.id.CheckBox1);
                    checkBox.setChecked(c2936.f9145);
                    if (!XposedUtils.isXposedEnabled()) {
                        checkBox.setEnabled(false);
                    } else {
                        checkBox.setEnabled(true);
                    }
                    checkBox.setClickable(false);
                    this.f9951.setTextAppearance(getContext(), android.R.style.TextAppearance.Small);
                    this.f9951.setTextColor(-7829368);
                    this.f9950.setTextColor(-1);
                    this.f9950.setText(((C2936) getItem(i)).f9144);
                    this.f9950.setTypeface(null, 1);
                    String str = ((C2936) getItem(i)).f9144;
                    this.f9950.setText(C2500.m6934(str, "#ff00ff00", "bold"));
                    if (i == 0) {
                        str = C2500.m7007(R.string.contextcorepatch1_descr);
                    }
                    if (i == 1) {
                        str = C2500.m7007(R.string.contextcorepatch2_descr);
                    }
                    if (i == 2) {
                        str = C2500.m7007(R.string.contextcorepatch3_descr) + "\n" + C2500.m7007(R.string.contextcorepatch3_descr_plus);
                    }
                    if (i == 3) {
                        str = C2500.m7007(R.string.contextcorepatch4_descr_xposed);
                    }
                    if (i == 4) {
                        str = C2500.m7007(R.string.context_hide_lp_descr);
                    }
                    if (XposedUtils.isXposedEnabled() && c2936.f9145) {
                        if (i == 0) {
                            if (C2500.m7182() && C2500.m7184()) {
                                this.f9950.append(C2500.m6934("\n" + C2500.m7007(R.string.test) + ": " + C2500.m7007(R.string.success), "#ff008800", ""));
                            } else {
                                this.f9950.append(C2500.m6934("\n" + C2500.m7007(R.string.test) + ": " + C2500.m7007(R.string.failed), "#ff880000", ""));
                            }
                        }
                        if (i == 1) {
                            if (C2500.m7186()) {
                                this.f9950.append(C2500.m6934("\n" + C2500.m7007(R.string.test) + ": " + C2500.m7007(R.string.success), "#ff008800", ""));
                            } else {
                                this.f9950.append(C2500.m6934("\n" + C2500.m7007(R.string.test) + ": " + C2500.m7007(R.string.failed), "#ff880000", ""));
                            }
                        }
                        if (i == 2) {
                            try {
                                jSONObject = C2500.m7071();
                            } catch (JSONException e) {
                                e.printStackTrace();
                                jSONObject = null;
                            }
                            if (jSONObject != null && jSONObject.optBoolean("patch3", false)) {
                                Button button = (Button) inflate.findViewById(R.id.button_test);
                                Drawable drawable = C2975.m7933().getDrawable(R.drawable.outline_fact_check_white_24);
                                drawable.setColorFilter(Color.parseColor("#DCFFEB3B"), PorterDuff.Mode.MULTIPLY);
                                button.setTextAppearance(getContext(), C2975.m7934());
                                button.setCompoundDrawablesWithIntrinsicBounds(drawable, (Drawable) null, (Drawable) null, (Drawable) null);
                                button.setVisibility(0);
                                button.setText(" " + C2500.m7007(R.string.option_test_patch));
                                button.setOnClickListener(new ViewOnClickListenerC3397());
                            }
                        }
                        if (i == 3) {
                            if (C2500.m7190()) {
                                this.f9950.append(C2500.m6934("\n" + C2500.m7007(R.string.test) + ": " + C2500.m7007(R.string.success), "#ff008800", ""));
                            } else {
                                this.f9950.append(C2500.m6934("\n" + C2500.m7007(R.string.test) + ": " + C2500.m7007(R.string.failed), "#ff880000", ""));
                            }
                        }
                        if (i == 4) {
                            str = C2500.m7007(R.string.context_hide_lp_descr);
                        }
                    }
                    this.f9951.append(C2500.m6934(str, "#ff888888", "italic"));
                    return inflate;
                }
            }

            RunnableC3394() {
            }

            @Override
            public void run() {
                JSONObject jSONObject;
                C3506 c3506;
                ArrayAdapter arrayAdapter;
                ArrayList arrayList = new ArrayList();
                try {
                    jSONObject = C2500.m7071();
                    if (jSONObject == null) {
                        try {
                            new Thread(new RunnableC3395()).start();
                        } catch (JSONException e) {
                            e = e;
                            e.printStackTrace();
                            arrayList.add(new C2936(C2500.m7007(R.string.contextcorepatch1), true));
                            arrayList.add(new C2936(C2500.m7007(R.string.contextcorepatch2), true));
                            arrayList.add(new C2936(C2500.m7007(R.string.contextcorepatch3), false));
                            arrayList.add(new C2936(C2500.m7007(R.string.contextcorepatch4), false));
                            arrayList.add(new C2936(C2500.m7007(R.string.context_hide_lp), false));
                            if (jSONObject != null) {
                            }
                            c3506 = C2975.f9410;
                            if (c3506 != null) {
                                arrayAdapter.notifyDataSetChanged();
                            }
                            C2975.m7950(39);
                            C2975.m7959(39, new C3396(C2975.this.mo1874(), R.layout.contextmenu, arrayList));
                            C2975.m7951(11);
                        }
                    }
                } catch (JSONException e2) {
                    e = e2;
                    jSONObject = null;
                }
                if (jSONObject != null) {
                    arrayList.clear();
                    arrayList.add(new C2936(C2500.m7007(R.string.contextcorepatch1), jSONObject.optBoolean("patch1", true)));
                    arrayList.add(new C2936(C2500.m7007(R.string.contextcorepatch2), jSONObject.optBoolean("patch2", true)));
                    arrayList.add(new C2936(C2500.m7007(R.string.contextcorepatch3), jSONObject.optBoolean("patch3", false)));
                    arrayList.add(new C2936(C2500.m7007(R.string.contextcorepatch4), jSONObject.optBoolean("patch4", false)));
                    arrayList.add(new C2936(C2500.m7007(R.string.context_hide_lp), jSONObject.optBoolean("hide", false)));
                }
                c3506 = C2975.f9410;
                if (c3506 != null && (arrayAdapter = c3506.f10138) != null) {
                    arrayAdapter.notifyDataSetChanged();
                }
                C2975.m7950(39);
                C2975.m7959(39, new C3396(C2975.this.mo1874(), R.layout.contextmenu, arrayList));
                C2975.m7951(11);
            }
        }

        RunnableC3393() {
        }

        @Override
        public void run() {
            try {
                C2975.m7954(new RunnableC3394());
            } catch (Exception unused) {
                C2975.m7942("LuckyPatcher: handler Null.");
            }
        }
    }

    public class RunnableC3399 implements Runnable {
        RunnableC3399() {
        }

        @Override
        public void run() {
            try {
                C2975.m7928().edit().remove(C2975.f9253.f10046).commit();
                C2975.f9252.m8122(C2975.f9253.f10046);
                C2975.f9252.notifyDataSetChanged();
            } catch (Exception unused) {
            }
        }
    }

    public class C3400 implements Comparator<C2939> {
        C3400() {
        }

        @Override
        public int compare(C2939 c2939, C2939 c29392) {
            int i = c29392.f9155;
            if (i == c2939.f9155) {
                return Long.valueOf(c29392.f9160).compareTo(Long.valueOf(c2939.f9160));
            }
            return Integer.valueOf(i).compareTo(Integer.valueOf(c2939.f9155));
        }
    }

    public class DialogInterfaceOnClickListenerC3401 implements DialogInterface.OnClickListener {

        final boolean f9956;

        class RunnableC3402 implements Runnable {

            class RunnableC3403 implements Runnable {

                class DialogInterfaceOnClickListenerC3404 implements DialogInterface.OnClickListener {

                    class RunnableC3405 implements Runnable {
                        RunnableC3405() {
                        }

                        @Override
                        public void run() {
                            Toast.makeText(C2975.m7929(), C2500.m7007(R.string.error_launch), 1).show();
                        }
                    }

                    DialogInterfaceOnClickListenerC3404() {
                    }

                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        try {
                            C2500.m7140(C2975.f9389.f9151);
                        } catch (Throwable th) {
                            th.printStackTrace();
                            C2975.m7954(new RunnableC3405());
                        }
                    }
                }

                RunnableC3403() {
                }

                @Override
                public void run() {
                    if (C2975.f9389 != null) {
                        C2500.m7121(C2500.m7007(R.string.well_done), C2500.m7007(R.string.app_install_success), C2500.m7007(R.string.launchbutton), new DialogInterfaceOnClickListenerC3404(), C2500.m7007(R.string.ok), null, null);
                    } else {
                        C2975.m7962(C2500.m7007(R.string.well_done), C2500.m7007(R.string.app_install_success));
                    }
                    C2975.f9281 = false;
                    C2975.m7949(false);
                    C2975.f9282 = "";
                    C2975.m7951(11);
                }
            }

            class RunnableC3406 implements Runnable {

                final String f9961;

                class DialogInterfaceOnClickListenerC3407 implements DialogInterface.OnClickListener {

                    class RunnableC3408 implements Runnable {

                        class RunnableC3409 implements Runnable {

                            class DialogInterfaceOnClickListenerC3410 implements DialogInterface.OnClickListener {

                                class RunnableC3411 implements Runnable {
                                    RunnableC3411() {
                                    }

                                    @Override
                                    public void run() {
                                        Toast.makeText(C2975.m7929(), C2500.m7007(R.string.error_launch), 1).show();
                                    }
                                }

                                DialogInterfaceOnClickListenerC3410() {
                                }

                                @Override
                                public void onClick(DialogInterface dialogInterface, int i) {
                                    try {
                                        C2500.m7140(C2975.f9389.f9151);
                                    } catch (Throwable th) {
                                        th.printStackTrace();
                                        C2975.m7954(new RunnableC3411());
                                    }
                                }
                            }

                            RunnableC3409() {
                            }

                            @Override
                            public void run() {
                                if (C2975.f9389 != null) {
                                    C2500.m7121(C2500.m7007(R.string.well_done), C2500.m7007(R.string.app_install_success), C2500.m7007(R.string.launchbutton), new DialogInterfaceOnClickListenerC3410(), C2500.m7007(R.string.ok), null, null);
                                } else {
                                    C2975.m7962(C2500.m7007(R.string.well_done), C2500.m7007(R.string.app_install_success));
                                }
                                C2975.f9281 = false;
                                C2975.m7949(false);
                                C2975.f9282 = "";
                                C2975.m7951(11);
                            }
                        }

                        class RunnableC3412 implements Runnable {
                            RunnableC3412() {
                            }

                            @Override
                            public void run() {
                                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_restore));
                                C2975.f9282 = "";
                                C2975.m7951(11);
                            }
                        }

                        class RunnableC3413 implements Runnable {
                            RunnableC3413() {
                            }

                            @Override
                            public void run() {
                                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_restore));
                                C2975.f9282 = "";
                                C2975.m7951(11);
                            }
                        }

                        RunnableC3408() {
                        }

                        @Override
                        public void run() {
                            String m7024;
                            C2500.m7112(C2975.f9389.f9151);
                            String m7211 = new C2500("").m7211("pm uninstall " + C2975.f9389.f9151);
                            C2975.m7942(m7211);
                            if (m7211.contains("Success")) {
                                if (C2500.m7027(C2975.f9389.f9156.getAbsolutePath())) {
                                    m7024 = C2500.m7025(C2975.f9389.f9156, null, "com.android.vending", false, false);
                                } else {
                                    m7024 = C2500.m7024(C2975.f9389.f9156.getAbsolutePath(), "com.android.vending", false, false);
                                }
                                C2500.m7090(C2975.f9389.f9151);
                                C2975.m7942(m7024);
                                if (m7024.contains("Success")) {
                                    C2975.m7954(new RunnableC3409());
                                    return;
                                } else {
                                    C2975.m7954(new RunnableC3412());
                                    return;
                                }
                            }
                            C2975.m7954(new RunnableC3413());
                        }
                    }

                    DialogInterfaceOnClickListenerC3407() {
                    }

                    @Override
                    public void onClick(DialogInterface dialogInterface, int i) {
                        C2975.m7956(new RunnableC3408());
                    }
                }

                RunnableC3406(String str) {
                    this.f9961 = str;
                }

                @Override
                public void run() {
                    C2500.m7125(C2500.m7007(R.string.warning), C2500.m7007(R.string.message_delete_package_new) + "\n\nPM Error:" + this.f9961, new DialogInterfaceOnClickListenerC3407(), null, null);
                    C2975.m7951(11);
                }
            }

            class RunnableC3414 implements Runnable {
                RunnableC3414() {
                }

                @Override
                public void run() {
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_restore));
                    C2975.f9282 = "";
                    C2975.m7951(11);
                }
            }

            class RunnableC3415 implements Runnable {
                RunnableC3415() {
                }

                @Override
                public void run() {
                    if (C2975.f9389.f9157) {
                        new C2500("").m7206(C2975.f9389.f9156);
                    } else if (C2975.m7928().getBoolean("use_splite_installer_for_apk_files", false)) {
                        new C2500("").m7206(C2975.f9389.f9156);
                    } else {
                        C2500.m7023(C2975.f9259, C2975.f9389.f9156, null);
                    }
                    C2975.f9281 = false;
                    C2975.m7949(false);
                    C2975.f9282 = "";
                    C2975.m7951(11);
                }
            }

            class RunnableC3416 implements Runnable {
                RunnableC3416() {
                }

                @Override
                public void run() {
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_restore));
                    C2975.f9282 = "";
                    C2975.m7951(11);
                }
            }

            RunnableC3402() {
            }

            @Override
            public void run() {
                boolean z;
                String str;
                String m7024;
                String str2;
                String str3;
                C2939 c2939 = C2975.f9389;
                String str4 = c2939.f9151;
                if (C2500.m7027(c2939.f9156.getAbsolutePath()) && !C2975.m7928().getBoolean("use_root_apks_installer", true)) {
                    z = true;
                } else {
                    z = false;
                }
                if (C2975.f9283 && !z) {
                    try {
                        try {
                            str = C2975.m7932().getPackageInfo(str4, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                            try {
                                C2975.m7942("LuckyPatcher (restore): app uzhe ustanovleno, restore from selected backup.");
                                C2975.m7942("LuckyPatcher (restore):" + str);
                            } catch (PackageManager.NameNotFoundException unused) {
                            }
                        } catch (Exception e) {
                            e.printStackTrace();
                            C2975.m7954(new RunnableC3416());
                            return;
                        }
                    } catch (PackageManager.NameNotFoundException unused2) {
                        str = "";
                    }
                    String str5 = str;
                    if (str5 != null && !str5.equals("")) {
                        C2500.m7078(C2500.m6976(str5, false), "RW");
                        C2500.m7093("rm " + C2500.m6976(str5, false));
                    }
                    C2975.m7942(C2975.f9389.f9156);
                    if (DialogInterfaceOnClickListenerC3401.this.f9956 && C2975.f9283) {
                        try {
                            new C2500("").m7211("pm uninstall com.android.vending");
                        } catch (Throwable th) {
                            th.printStackTrace();
                        }
                    }
                    if (C2500.m7027(C2975.f9389.f9156.getAbsolutePath())) {
                        m7024 = C2500.m7025(C2975.f9389.f9156, null, "com.android.vending", false, false);
                    } else {
                        m7024 = C2500.m7024(C2975.f9389.f9156.getAbsolutePath(), "com.android.vending", false, false);
                    }
                    String str6 = C2975.f9298;
                    if (str6 != null && !str6.equals("")) {
                        str2 = C2975.f9298;
                    } else {
                        str2 = m7024;
                    }
                    C2975.m7942("result pm:" + m7024);
                    new C2500("w").m7212(4000L);
                    try {
                        str3 = C2975.m7932().getPackageInfo(str4, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                        try {
                            C2975.m7942("LuckyPatcher (restore): " + str3);
                        } catch (PackageManager.NameNotFoundException unused3) {
                        }
                    } catch (PackageManager.NameNotFoundException unused4) {
                        str3 = "";
                    }
                    if (!m7024.contains("Success") && !C2975.f9298.contains("Success") && (str3.equals("") || str5.equals(str3))) {
                        C2975.m7954(new RunnableC3406(str2));
                        return;
                    }
                    if (DialogInterfaceOnClickListenerC3401.this.f9956 && C2975.f9283) {
                        try {
                            C2500.m7053("com.android.vending");
                            new C2500("").m7211(C2975.f9284 + C1664.class.getName() + " " + C2975.m7932().getPackageInfo("com.android.vending", ItemType.CLASS_DATA_ITEM).applicationInfo.dataDir);
                            if (C2975.f9339) {
                                try {
                                    C2500.m7053("com.google.android.gms");
                                    new C2500("").m7211("pm clear com.google.android.gms");
                                    new C2500("").m7211(C2975.f9284 + C1664.class.getName() + " " + C2975.m7932().getPackageInfo("com.google.android.gms", ItemType.CLASS_DATA_ITEM).applicationInfo.dataDir);
                                } catch (PackageManager.NameNotFoundException e2) {
                                    e2.printStackTrace();
                                }
                            }
                            C2500.m7057(true);
                            C2500.m7059(true);
                        } catch (Exception e3) {
                            C2975.m7942("LuckyPatcher clear cache: " + e3);
                        }
                    }
                    C2975.m7954(new RunnableC3403());
                    return;
                }
                try {
                    C2975.m7932().getPackageInfo(C2975.f9389.f9151, ItemType.CLASS_DATA_ITEM);
                } catch (PackageManager.NameNotFoundException unused5) {
                    if (C2975.f9389.f9157) {
                        new C2500("").m7206(C2975.f9389.f9156);
                    } else if (C2975.m7928().getBoolean("use_splite_installer_for_apk_files", false)) {
                        new C2500("").m7206(C2975.f9389.f9156);
                    } else {
                        C2500.m7023(C2975.f9259, C2975.f9389.f9156, null);
                    }
                    C2975.f9282 = "";
                    C2975.m7951(11);
                    C2975.f9281 = false;
                    C2975.m7949(false);
                    return;
                } catch (Exception e4) {
                    e4.printStackTrace();
                    C2975.m7954(new RunnableC3414());
                }
                C2975.m7954(new RunnableC3415());
            }
        }

        DialogInterfaceOnClickListenerC3401(boolean z) {
            this.f9956 = z;
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            C2975.m7956(new RunnableC3402());
        }
    }

    public class C3417 implements Comparator<C2939> {
        C3417() {
        }

        @Override
        public int compare(C2939 c2939, C2939 c29392) {
            return Long.valueOf(c29392.f9160).compareTo(Long.valueOf(c2939.f9160));
        }
    }

    public class DialogInterfaceOnClickListenerC3418 implements DialogInterface.OnClickListener {

        class RunnableC3419 implements Runnable {
            RunnableC3419() {
            }

            @Override
            public void run() {
                Toast.makeText(C2975.m7929(), C2500.m7007(R.string.error_launch), 1).show();
            }
        }

        DialogInterfaceOnClickListenerC3418() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            try {
                C2500.m7140(C2975.f9389.f9151);
            } catch (Throwable th) {
                th.printStackTrace();
                C2975.m7954(new RunnableC3419());
            }
        }
    }

    public class C3420 extends ArrayAdapter<C2939> {
        C3420(Context context, int i, List list) {
            super(context, i, list);
        }

        @Override
        public View getView(int i, View view, ViewGroup viewGroup) {
            View view2 = super.getView(i, view, viewGroup);
            TextView textView = (TextView) view2.findViewById(R.id.conttext);
            textView.setTextAppearance(getContext(), C2975.m7934());
            textView.setCompoundDrawablePadding((int) ((C2975.m7933().getDisplayMetrics().density * 5.0f) + 0.5f));
            textView.setTextColor(-1);
            C2939 c2939 = (C2939) getItem(i);
            String str = "" + new SimpleDateFormat("dd-MM-yyyy HH:mm").format(new Date(c2939.f9160));
            textView.setText(C2500.m7007(R.string.restore_version) + ": " + c2939.f9154 + " " + C2500.m7007(R.string.restore_build) + ": " + c2939.f9155);
            textView.setTypeface(null, 1);
            StringBuilder sb = new StringBuilder();
            sb.append("\n");
            sb.append(str);
            SpannableString m6934 = C2500.m6934(sb.toString(), "#dFdFdF", "");
            m6934.setSpan(new RelativeSizeSpan(0.8f), 0, m6934.length(), 0);
            textView.append(m6934);
            return view2;
        }
    }

    public class RunnableC3421 implements Runnable {
        RunnableC3421() {
        }

        @Override
        public void run() {
            C2500.m7064(3000);
            if (C2500.m7027(C2975.f9389.f9156.getName())) {
                new C2500().m7206(C2975.f9389.f9156);
            } else if (C2975.m7928().getBoolean("use_splite_installer_for_apk_files", false)) {
                new C2500("").m7206(C2975.f9389.f9156);
            } else {
                C2500.m7023(C2975.f9259, C2975.f9389.f9156, Integer.valueOf(C2975.f9391));
            }
            C2975.f9389 = null;
        }
    }

    public class ServiceConnectionC3422 implements ServiceConnection {

        class BinderC3423 extends InterfaceC0904.AbstractBinderC0905 {

            class RunnableC3424 implements Runnable {
                RunnableC3424() {
                }

                @Override
                public void run() {
                    C2975.m7962(C2500.m7007(R.string.mod_market_check_title), C2500.m7007(R.string.mod_market_check_internet_off));
                }
            }

            class RunnableC3425 implements Runnable {
                RunnableC3425() {
                }

                @Override
                public void run() {
                    C2975.m7962(C2500.m7007(R.string.mod_market_check_title), C2500.m7007(R.string.mod_market_check_true));
                }
            }

            class RunnableC3426 implements Runnable {
                RunnableC3426() {
                }

                @Override
                public void run() {
                    C2975.m7962(C2500.m7007(R.string.mod_market_check_title), C2500.m7007(R.string.mod_market_check_failed));
                }
            }

            class RunnableC3427 implements Runnable {
                RunnableC3427() {
                }

                @Override
                public void run() {
                    C2975.m7962(C2500.m7007(R.string.mod_market_check_title), C2500.m7007(R.string.mod_market_check_failed));
                }
            }

            BinderC3423() {
            }

            @Override
            public void mo3515(int i, String str, String str2) throws RemoteException {
                C2975.m7942(Integer.valueOf(i));
                C2975.this.f9425 = i;
                C2975.m7951(11);
                if (i != 0) {
                    if (i != 3) {
                        C2975.f9312.post(new RunnableC3427());
                    } else {
                        C2975.f9312.post(new RunnableC3424());
                    }
                } else if (str != null && str2 != null && C2500.m7182()) {
                    C2975.f9312.post(new RunnableC3425());
                } else {
                    C2975.f9312.post(new RunnableC3426());
                }
                C2975.m7942("" + str);
                C2975.m7942(str2);
                C2975.this.m7921();
            }
        }

        ServiceConnectionC3422() {
        }

        @Override
        public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
            C2975.m7942("Licensing service try to connect.");
            C2975 c2975 = C2975.this;
            if (c2975.f9424 == null) {
                c2975.f9424 = ILicensingService.AbstractBinderC0902.m3513(iBinder);
                try {
                    C2975.this.f9424.mo3511(new Random().nextLong(), C2975.m7929().getPackageName(), new BinderC3423());
                } catch (RemoteException e) {
                    e.printStackTrace();
                }
            }
        }

        @Override
        public void onServiceDisconnected(ComponentName componentName) {
            C2975.m7942("Licensing service disconnected.");
            C2975.this.f9424 = null;
            C2975.m7951(11);
        }
    }

    public class C3428 implements Comparator<C2939> {
        C3428() {
        }

        @Override
        public int compare(C2939 c2939, C2939 c29392) {
            return (c29392.f9160 > c2939.f9160 ? 1 : (c29392.f9160 == c2939.f9160 ? 0 : -1));
        }
    }

    public class RunnableC3429 implements Runnable {
        RunnableC3429() {
        }

        @Override
        public void run() {
            C2975.m7951(11);
            C2975.m7960(11);
            C3743 c3743 = C2975.f9276;
            if (c3743 != null) {
                c3743.m8238(true);
                C2975.f9276.m8239(C2500.m7007(R.string.wait));
            }
        }
    }

    public class DialogInterfaceOnClickListenerC3430 implements DialogInterface.OnClickListener {

        class RunnableC3431 implements Runnable {
            RunnableC3431() {
            }

            @Override
            public void run() {
                String str;
                String str2;
                if (C2975.f9253 != null && C2975.f9282.equals("")) {
                    str = C2975.m7919(C2975.f9253, true);
                } else {
                    str = C2975.f9282;
                }
                C2975.m7942("path_to_file:" + str);
                Intent intent = new Intent("android.intent.action.SEND");
                Uri parse = Uri.parse("file://" + str);
                if (C2975.f9299 >= 24) {
                    parse = FileProvider.m1512(C2975.f9259, PkgName.getPkgName() + ".provider", new File(str));
                }
                intent.setType("*/*");
                intent.putExtra("android.intent.extra.STREAM", parse);
                C3478 c3478 = C2975.f9253;
                if (c3478 == null) {
                    str2 = new File(C2975.f9282).getName();
                } else {
                    str2 = c3478.f10047;
                }
                intent.setFlags(131072);
                intent.addFlags(1);
                C2975.this.m1852(Intent.createChooser(intent, C2500.m7007(R.string.share) + " " + str2));
                C2975.f9282 = "";
            }
        }

        DialogInterfaceOnClickListenerC3430() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            if (i != -2) {
                if (i == -1) {
                    C2975.m7956(new RunnableC3431());
                    return;
                }
                return;
            }
            C2975.f9282 = "";
        }
    }

    public class RunnableC3432 implements Runnable {
        RunnableC3432() {
        }

        @Override
        public void run() {
            C2975.this.m7982();
        }
    }

    public class RunnableC3433 implements Runnable {

        final String f9987;

        final boolean f9988;

        class RunnableC3434 implements Runnable {
            RunnableC3434() {
            }

            @Override
            public void run() {
                C2975 c2975 = C2975.this;
                c2975.m7963(c2975.mo1874(), C2500.m7007(R.string.warning), C2500.m7007(R.string.no_space_in_system));
                C2975.m7951(11);
            }
        }

        class RunnableC3435 implements Runnable {
            RunnableC3435() {
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.unknown_error));
                C2975.m7951(11);
            }
        }

        class RunnableC3436 implements Runnable {

            class DialogInterfaceOnClickListenerC3437 implements DialogInterface.OnClickListener {
                DialogInterfaceOnClickListenerC3437() {
                }

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    C2500.m7073();
                }
            }

            RunnableC3436() {
            }

            @Override
            public void run() {
                if (C2975.f9253 != null) {
                    C2975.m7928().edit().remove(C2975.f9253.f10046).commit();
                    C2975.f9252.m8119(C2975.f9253.f10046);
                    C2975.f9252.notifyDataSetChanged();
                    C2500.m7125(C2500.m7007(R.string.warning), C2500.m7007(R.string.system_app_change), new DialogInterfaceOnClickListenerC3437(), null, null);
                }
                C2975.m7951(11);
            }
        }

        RunnableC3433(String str, boolean z) {
            this.f9987 = str;
            this.f9988 = z;
        }

        @Override
        public void run() {
            try {
                C2500.m7053(this.f9987);
                C2975.f9402 = C2500.m7169(C2500.m6973(this.f9987, true));
                C2975.m7942("sys:" + C2975.f9402);
                C2975.f9403 = C2500.m7092(C1632.class, this.f9987).replaceAll("\n", "");
                C2975.m7942("magisk:" + C2975.f9403);
                String m7211 = new C2500("").m7211(C2975.f9284 + C1547.class.getName() + " " + this.f9987 + " " + C2975.m7932().getPackageInfo(this.f9987, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir + " " + C2975.m7932().getPackageInfo(this.f9987, 0).applicationInfo.dataDir + " " + C2975.f9401 + " " + C2975.f9402 + " " + C2975.f9403 + " " + this.f9988 + "\n");
                StringBuilder sb = new StringBuilder();
                sb.append("");
                sb.append(m7211);
                C2975.m7942(sb.toString());
                if (m7211.contains("In /system space not found!")) {
                    C2975.m7954(new RunnableC3434());
                } else {
                    C2975.m7954(new RunnableC3436());
                }
            } catch (Exception e) {
                e.printStackTrace();
                C2975.m7954(new RunnableC3435());
            }
        }
    }

    public class RunnableC3438 implements Runnable {

        final boolean f9994;

        final C2597 f9995;

        class C3439 implements Comparator<C2614> {
            C3439() {
            }

            @Override
            public int compare(C2614 c2614, C2614 c26142) {
                return Long.valueOf(c26142.f7456).compareTo(Long.valueOf(c2614.f7456));
            }
        }

        class RunnableC3440 implements Runnable {

            final ArrayList f9998;

            class DialogInterfaceOnCancelListenerC3441 implements DialogInterface.OnCancelListener {
                DialogInterfaceOnCancelListenerC3441() {
                }

                @Override
                public void onCancel(DialogInterface dialogInterface) {
                    C2975.f9282 = "";
                }
            }

            class DialogInterfaceOnClickListenerC3442 implements DialogInterface.OnClickListener {
                DialogInterfaceOnClickListenerC3442() {
                }

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    ArrayList<File> arrayList = C2975.f9338;
                    if (arrayList != null && arrayList.size() > 0) {
                        if (C2975.f9338.size() == 1) {
                            if (C2975.f9282.equals("")) {
                                File file = C2975.f9338.get(0);
                                RunnableC3438 runnableC3438 = RunnableC3438.this;
                                C3549.m8177(file, runnableC3438.f9994, null, false, runnableC3438.f9995);
                                return;
                            }
                            C3549.m8177(C2975.f9338.get(0), RunnableC3438.this.f9994, new File(C2975.f9282), false, RunnableC3438.this.f9995);
                            return;
                        }
                        Iterator<File> it = C2975.f9338.iterator();
                        String str = "";
                        while (it.hasNext()) {
                            str = str + C2500.m7072(it.next()) + "\n[NEXT_PATCH]\n";
                        }
                        File file2 = new File(C2500.m6942(C2975.f9338.get(0)).getAbsolutePath() + "/join_patch.txt");
                        file2.delete();
                        if (!file2.exists()) {
                            C2500.m7101(file2, str);
                            if (file2.exists()) {
                                if (C2975.f9282.equals("")) {
                                    RunnableC3438 runnableC34382 = RunnableC3438.this;
                                    C3549.m8177(file2, runnableC34382.f9994, null, false, runnableC34382.f9995);
                                    return;
                                } else {
                                    C3549.m8177(file2, RunnableC3438.this.f9994, new File(C2975.f9282), false, RunnableC3438.this.f9995);
                                    return;
                                }
                            }
                            C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_create_join_custom_patch));
                            return;
                        }
                        C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_delete_join_custom_patch));
                        return;
                    }
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.need_select_custom_patch));
                }
            }

            class C3443 extends ArrayAdapter<C2614> {

                TextView f10002;

                TextView f10003;

                C3443(Context context, int i, List list) {
                    super(context, i, list);
                }

                @Override
                public View getView(int i, View view, ViewGroup viewGroup) {
                    C2614 c2614 = (C2614) getItem(i);
                    View inflate = ((LayoutInflater) C2975.m7929().getSystemService("layout_inflater")).inflate(R.layout.selectpatch, viewGroup, false);
                    this.f10002 = (TextView) inflate.findViewById(R.id.txtTitle);
                    this.f10003 = (TextView) inflate.findViewById(R.id.txtStatus);
                    this.f10002.setTextAppearance(getContext(), C2975.m7934());
                    this.f10003.setTextAppearance(getContext(), C2975.m7934());
                    CheckBox checkBox = (CheckBox) inflate.findViewById(R.id.CheckBox1);
                    checkBox.setChecked(c2614.f7457);
                    checkBox.setClickable(false);
                    this.f10003.setTextAppearance(getContext(), android.R.style.TextAppearance.Small);
                    this.f10003.setTextColor(-7829368);
                    this.f10002.setTextColor(-1);
                    this.f10002.setText(((C2614) getItem(i)).f7458);
                    this.f10002.setTypeface(null, 1);
                    String str = ((C2614) getItem(i)).f7458;
                    if (!c2614.f7457) {
                        this.f10002.setText(C2500.m6934(str, "#ffff0000", "bold"));
                    } else {
                        this.f10002.setText(C2500.m6934(str, "#FF00FF00", "bold"));
                    }
                    String str2 = "" + new SimpleDateFormat("dd-MM-yyyy").format(new Date(c2614.f7456));
                    this.f10003.setText(C2500.m6934(C2500.m7007(R.string.date_creation_patch) + ": " + str2 + "\n", "#57a8fb", ""));
                    this.f10003.append(C2500.m6934(((C2614) getItem(i)).f7459, "#AAFFFFFF", ""));
                    return inflate;
                }
            }

            class C3444 implements AdapterView.OnItemClickListener {
                C3444() {
                }

                @Override
                public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
                    C2614 c2614 = (C2614) adapterView.getAdapter().getItem(i);
                    if (c2614.f7457) {
                        c2614.f7457 = false;
                        C2975.f9338.remove(c2614.f7454);
                    } else {
                        c2614.f7457 = true;
                        C2975.f9338.add(c2614.f7454);
                    }
                }
            }

            RunnableC3440(ArrayList arrayList) {
                this.f9998 = arrayList;
            }

            @Override
            public void run() {
                if (this.f9998.size() == 1 && this.f9998.size() != 0) {
                    if (C2975.f9282.equals("")) {
                        File file = ((C2614) this.f9998.get(0)).f7454;
                        RunnableC3438 runnableC3438 = RunnableC3438.this;
                        C3549.m8177(file, runnableC3438.f9994, null, false, runnableC3438.f9995);
                        return;
                    }
                    C3549.m8177(((C2614) this.f9998.get(0)).f7454, RunnableC3438.this.f9994, new File(C2975.f9282), false, RunnableC3438.this.f9995);
                    return;
                }
                C2975.f9338 = new ArrayList<>();
                new C2913(C2975.f9245.mo1874()).m7854(R.string.title_select_custom_patch).m7862(new C3443(C2975.this.mo1874(), R.layout.contextmenu, this.f9998), new C3444()).m7873(R.string.patchbutton, new DialogInterfaceOnClickListenerC3442()).m7863(true).m7881(new DialogInterfaceOnCancelListenerC3441()).m7851().show();
            }
        }

        RunnableC3438(boolean z, C2597 c2597) {
            this.f9994 = z;
            this.f9995 = c2597;
        }

        @Override
        public void run() {
            String str;
            ArrayList<C2614> m6936;
            if (C2975.f9282.equals("")) {
                m6936 = C2500.m6936(C2975.f9253.f10046);
            } else {
                if (C2500.m7027(C2975.f9282.toLowerCase())) {
                    str = C2500.m6924(new File(C2975.f9282));
                } else {
                    str = C2500.m6920(C2975.f9282).packageName;
                }
                m6936 = C2500.m6936(str);
            }
            if (m6936 != null && m6936.size() > 0) {
                Collections.sort(m6936, new C3439());
            }
            if (m6936 != null) {
                C2975.m7954(new RunnableC3440(m6936));
            }
        }
    }

    public class RunnableC3445 implements Runnable {

        final String[] f10006;

        RunnableC3445(String[] strArr) {
            this.f10006 = strArr;
        }

        @Override
        public void run() {
            C2975 c2975 = C2975.f9245;
            if (c2975 != null) {
                Toast.makeText(c2975.mo1874(), C2500.m7007(R.string.backup_done) + " " + this.f10006[0], 1).show();
            }
        }
    }

    public class RunnableC3446 implements Runnable {

        final ArrayList f10007;

        class C3447 extends C2931<C3477> {

            class C3448 extends Filter {
                C3448() {
                }

                @Override
                protected Filter.FilterResults performFiltering(CharSequence charSequence) {
                    Filter.FilterResults filterResults = new Filter.FilterResults();
                    ArrayList arrayList = new ArrayList();
                    C3447 c3447 = C3447.this;
                    if (c3447.f9124 == null) {
                        c3447.f9124 = c3447.f9122;
                    }
                    if (charSequence != null) {
                        List<Object> list = c3447.f9124;
                        if (list != 0 && list.size() > 0) {
                            for (Object object : C3447.this.f9124) {
                                if (object.f10044.toLowerCase().contains(charSequence.toString().toLowerCase())) {
                                    arrayList.add(object);
                                }
                            }
                        }
                        arrayList.toArray(new C3477[arrayList.size()]);
                        filterResults.values = arrayList;
                    }
                    return filterResults;
                }

                @Override
                protected void publishResults(CharSequence charSequence, Filter.FilterResults filterResults) {
                    C3447 c3447 = C3447.this;
                    c3447.f9122 = (List) filterResults.values;
                    c3447.notifyDataSetChanged();
                }
            }

            C3447(Context context, int i, List list) {
                super(context, i, list);
            }

            @Override
            public Filter getFilter() {
                return new C3448();
            }

            @Override
            public View getView(int i, View view, ViewGroup viewGroup) {
                View view2 = super.getView(i, view, viewGroup);
                TextView textView = (TextView) view2.findViewById(R.id.conttext);
                textView.setTextAppearance(getContext(), C2975.m7934());
                textView.setCompoundDrawablePadding((int) ((C2975.m7933().getDisplayMetrics().density * 5.0f) + 0.5f));
                String str = getItem(i).f10044.replace("chelpa.disabled.", "").replace("android.permission.", "").replace("com.android.vending.", "") + "\n";
                if (getItem(i).f10045) {
                    textView.setText(C2500.m6934(str, "#ff00ff00", "bold"));
                } else {
                    textView.setText(C2500.m6934(str, "#ffff0000", "bold"));
                }
                PackageManager m7932 = C2975.m7932();
                try {
                    String charSequence = m7932.getPermissionInfo(getItem(i).f10044.replace("chelpa.disabled.", ""), 0).loadDescription(m7932).toString();
                    if (charSequence == null) {
                        textView.append(C2500.m6934(C2500.m7007(R.string.permission_not_descr), "#ff888888", "italic"));
                    } else {
                        textView.append(C2500.m6934(charSequence, "#ff888888", "italic"));
                    }
                } catch (PackageManager.NameNotFoundException unused) {
                    textView.append(C2500.m6934(C2500.m7007(R.string.permission_not_descr), "#ff888888", "italic"));
                } catch (NullPointerException unused2) {
                    textView.append(C2500.m6934(C2500.m7007(R.string.permission_not_descr), "#ff888888", "italic"));
                }
                return view2;
            }
        }

        RunnableC3446(ArrayList arrayList) {
            this.f10007 = arrayList;
        }

        @Override
        public void run() {
            C2931<C3477> c2931 = C2975.f9265;
            if (c2931 != null) {
                c2931.notifyDataSetChanged();
            }
            C2975.f9265 = new C3447(C2975.this.mo1874(), R.layout.contextmenu, this.f10007);
        }
    }

    public class RunnableC3449 implements Runnable {
        RunnableC3449() {
        }

        @Override
        public void run() {
            try {
                ArrayAdapter arrayAdapter = C2975.f9264;
                if (arrayAdapter != null) {
                    arrayAdapter.notifyDataSetChanged();
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    public class RunnableC3450 implements Runnable {
        RunnableC3450() {
        }

        @Override
        public void run() {
            try {
                String[] m7931 = C2975.m7931();
                if (m7931 != null) {
                    if (C2975.f9249 == null) {
                        C2975.f9249 = new C2938(C2975.m7929());
                    }
                    for (String str : m7931) {
                        C2975.f9249.m7894(new C3478(str, C2975.f9300, true));
                    }
                }
                C2975.m7957(false);
            } catch (Throwable th) {
                th.printStackTrace();
            }
        }
    }

    public class RunnableC3451 implements Runnable {
        RunnableC3451() {
        }

        @Override
        public void run() {
            Toast.makeText(C2975.this.mo1874(), C2500.m7007(R.string.not_detect), 0).show();
        }
    }

    public class RunnableC3452 implements Runnable {
        RunnableC3452() {
        }

        @Override
        public void run() {
            Toast.makeText(C2975.this.mo1874(), "SDCard mounted:\n" + C2975.f9251.replace("/LuckyPatcher", ""), 0).show();
        }
    }

    public class RunnableC3453 implements Runnable {
        RunnableC3453() {
        }

        @Override
        public void run() {
            try {
                ArrayAdapter arrayAdapter = C2975.f9264;
                if (arrayAdapter != null) {
                    arrayAdapter.notifyDataSetChanged();
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    public class RunnableC3454 implements Runnable {

        final boolean f10014;

        class RunnableC3455 implements Runnable {
            RunnableC3455() {
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.information), C2500.m7007(R.string.apps_not_found));
            }
        }

        class RunnableC3456 implements Runnable {
            RunnableC3456() {
            }

            @Override
            public void run() {
                try {
                    C2975.m7951(23);
                } catch (Exception unused) {
                }
                try {
                    C2975.m7951(1);
                } catch (Exception unused2) {
                }
                C2975 c2975 = C2975.f9245;
                if (c2975 != null) {
                    c2975.m7948(C2975.f9332, C2975.f9245.m7935());
                }
            }
        }

        RunnableC3454(boolean z) {
            this.f10014 = z;
        }

        @Override
        public void run() {
            try {
                C2975.f9332 = null;
                C2975.f9332 = new ArrayList<>();
                if (C2975.f9249 == null) {
                    C2975.f9249 = new C2938(C2975.m7929());
                }
                boolean z = C2975.f9291;
                if (!z) {
                    z = C2975.m7928().getBoolean("no_icon", false);
                }
                if (C2975.f9317 == 0) {
                    C2975.f9332 = C2975.f9249.m7893(false, z, false);
                } else {
                    C2975.f9332 = C2975.f9249.m7893(true, z, false);
                }
                if (C2975.f9332.size() == 0 && C2975.f9317 == 0) {
                    C2975.f9332.clear();
                    String[] m7931 = C2975.m7931();
                    int length = m7931.length;
                    if (this.f10014) {
                        try {
                            if (C2975.f9357.size() == 0) {
                                C3549.m8159(C2500.m7007(R.string.loadpkg), C2500.m7007(R.string.wait) + "...", length + 1, true, false);
                            } else {
                                C2975.m7951(23);
                                C2975.m7951(1);
                                C2975.m7951(11);
                            }
                        } catch (Throwable th) {
                            th.printStackTrace();
                        }
                    }
                    if (this.f10014) {
                        try {
                            if (C2975.f9357.size() == 0) {
                                C3746 c3746 = C2975.f9277;
                                if (c3746 == null || !c3746.m8243()) {
                                    C3549.m8159(C2500.m7007(R.string.loadpkg), C2500.m7007(R.string.wait) + "...", length + 1, true, false);
                                }
                                C3549.m8201(1);
                            } else {
                                C2975.m7951(23);
                                C2975.m7951(1);
                                C2975.m7951(11);
                            }
                        } catch (Throwable th2) {
                            th2.printStackTrace();
                        }
                    }
                    boolean z2 = !C2975.m7928().getBoolean("no_icon", false);
                    int i = 1;
                    for (String str : m7931) {
                        i++;
                        try {
                            C3478 c3478 = new C3478(str, C2975.f9300, z2);
                            c3478.m8108();
                            if (c3478.f10052 || c3478.f10054 || c3478.f10053 || c3478.f10055) {
                                C2975.f9260.add(c3478);
                            }
                        } catch (IllegalArgumentException unused) {
                        }
                        if (this.f10014) {
                            if (C2975.f9357.size() == 0) {
                                C3746 c37462 = C2975.f9277;
                                if (c37462 == null || !c37462.m8243()) {
                                    C3549.m8159(C2500.m7007(R.string.loadpkg), C2500.m7007(R.string.wait) + "...", length + 1, true, false);
                                }
                                C3549.m8201(Integer.valueOf(i));
                            } else {
                                C2975.m7951(23);
                                C2975.m7951(1);
                                C2975.m7951(11);
                            }
                        }
                    }
                    C2975.f9332 = C2975.f9249.m7893(false, false, true);
                }
                if (C2975.f9332.size() == 0 && C2975.f9317 != 0) {
                    C2975.f9317 = 0;
                    if (C2975.f9326) {
                        C2975.m7952();
                    }
                    C2975.f9312.post(new RunnableC3455());
                }
            } catch (Exception e) {
                C2975.m7942("LuckyPatcher (AppScanner): " + e);
                e.printStackTrace();
            }
            C2975.m7954(new RunnableC3456());
        }
    }

    public class C3457 implements CompoundButton.OnCheckedChangeListener {
        C3457() {
        }

        @Override
        public void onCheckedChanged(CompoundButton compoundButton, boolean z) {
            C2975.this.f9430 = z;
        }
    }

    public class RunnableC3458 implements Runnable {

        final ArrayList f10018;

        class RunnableC3459 implements Runnable {

            class RunnableC3460 implements Runnable {
                RunnableC3460() {
                }

                @Override
                public void run() {
                    C2975.m7951(23);
                }
            }

            class RunnableC3461 implements Runnable {
                RunnableC3461() {
                }

                @Override
                public void run() {
                    C2500.m6893();
                    C2975.m7962(C2500.m7007(R.string.information), C2500.m7007(R.string.all_custom_patches_updated));
                }
            }

            RunnableC3459() {
            }

            @Override
            public void run() {
                ByteArrayInputStream byteArrayInputStream;
                RunnableC3460 runnableC3460;
                Iterator it;
                BufferedReader bufferedReader = null;
                try {
                    byteArrayInputStream = new ByteArrayInputStream(new C2483("CustomPatches_plagiarism.vers").m6852(true));
                    try {
                        BufferedReader bufferedReader2 = new BufferedReader(new InputStreamReader(byteArrayInputStream));
                        while (true) {
                            try {
                                String readLine = bufferedReader2.readLine();
                                if (readLine == null) {
                                    try {
                                        break;
                                    } catch (Exception unused) {
                                    }
                                } else if (!readLine.trim().equals("")) {
                                    if (readLine.startsWith("->")) {
                                        String replace = readLine.replace("->", "");
                                        File file = new File(C2975.f9251 + "/CustomPatches");
                                        if (!file.exists()) {
                                            file.mkdirs();
                                        }
                                        File[] listFiles = file.listFiles();
                                        if (listFiles != null && listFiles.length > 0) {
                                            for (File file2 : listFiles) {
                                                if (file2.getName().startsWith(replace)) {
                                                    file2.delete();
                                                }
                                            }
                                        }
                                    } else if (readLine.startsWith("*")) {
                                        String replace2 = readLine.replace("*", "");
                                        File file3 = new File(C2975.f9251 + "/CustomPatches");
                                        if (!file3.exists()) {
                                            file3.mkdirs();
                                        }
                                        File[] listFiles2 = file3.listFiles();
                                        if (listFiles2 != null && listFiles2.length > 0) {
                                            for (File file4 : listFiles2) {
                                                if (file4.getName().contains(replace2)) {
                                                    file4.delete();
                                                }
                                            }
                                        }
                                    } else {
                                        File file5 = new File(C2975.f9251 + "/CustomPatches");
                                        if (!file5.exists()) {
                                            file5.mkdirs();
                                        }
                                        File[] listFiles3 = file5.listFiles();
                                        if (listFiles3 != null && listFiles3.length > 0) {
                                            int length = listFiles3.length;
                                            int i = 0;
                                            while (true) {
                                                if (i < length) {
                                                    File file6 = listFiles3[i];
                                                    if (file6.getName().equals(readLine)) {
                                                        file6.delete();
                                                        break;
                                                    }
                                                    i++;
                                                }
                                            }
                                        }
                                    }
                                }
                            } catch (Throwable th) {
                                th = th;
                                bufferedReader = bufferedReader2;
                                try {
                                    th.printStackTrace();
                                    if (bufferedReader != null) {
                                        try {
                                            bufferedReader.close();
                                        } catch (Exception unused2) {
                                            runnableC3460 = new RunnableC3460();
                                            C2975.m7954(runnableC3460);
                                            C2975.m7942("Unpack custom patches");
                                            it = RunnableC3458.this.f10018.iterator();
                                            while (it.hasNext()) {
                                            }
                                            C2975.m7954(new RunnableC3461());
                                            C2975.f9257 = true;
                                            C2975.m7949(false);
                                        }
                                    }
                                    if (byteArrayInputStream != null) {
                                        byteArrayInputStream.close();
                                    }
                                    runnableC3460 = new RunnableC3460();
                                    C2975.m7954(runnableC3460);
                                    C2975.m7942("Unpack custom patches");
                                    it = RunnableC3458.this.f10018.iterator();
                                    while (it.hasNext()) {
                                    }
                                    C2975.m7954(new RunnableC3461());
                                    C2975.f9257 = true;
                                    C2975.m7949(false);
                                } catch (Throwable th2) {
                                    if (bufferedReader != null) {
                                        try {
                                            bufferedReader.close();
                                        } catch (Exception unused3) {
                                            C2975.m7954(new RunnableC3460());
                                            throw th2;
                                        }
                                    }
                                    if (byteArrayInputStream != null) {
                                        byteArrayInputStream.close();
                                    }
                                    C2975.m7954(new RunnableC3460());
                                    throw th2;
                                }
                            }
                        }
                        bufferedReader2.close();
                        byteArrayInputStream.close();
                        runnableC3460 = new RunnableC3460();
                    } catch (Throwable th3) {
                        th = th3;
                    }
                } catch (Throwable th4) {
                    th = th4;
                    byteArrayInputStream = null;
                }
                C2975.m7954(runnableC3460);
                C2975.m7942("Unpack custom patches");
                try {
                    it = RunnableC3458.this.f10018.iterator();
                    while (it.hasNext()) {
                        File file7 = new File(C2975.f9251 + "/Download/" + ((C2623) it.next()).f7515);
                        if (r2.f7516 == file7.length()) {
                            FileInputStream fileInputStream = new FileInputStream(file7);
                            ZipInputStream zipInputStream = new ZipInputStream(fileInputStream);
                            while (true) {
                                ZipEntry nextEntry = zipInputStream.getNextEntry();
                                if (nextEntry == null) {
                                    break;
                                }
                                String str = C2975.f9251 + "/CustomPatches/" + nextEntry.getName();
                                new File(C2975.f9251 + "/CustomPatches/").mkdirs();
                                FileOutputStream fileOutputStream = new FileOutputStream(str);
                                byte[] bArr = new byte[InternalZipConstants.UFT8_NAMES_FLAG];
                                while (true) {
                                    int read = zipInputStream.read(bArr);
                                    if (read != -1) {
                                        fileOutputStream.write(bArr, 0, read);
                                    }
                                }
                                fileOutputStream.close();
                                new File(str).setLastModified(nextEntry.getTime());
                            }
                            zipInputStream.close();
                            fileInputStream.close();
                            if (C2975.f9283) {
                                new C2500("").m7211(C2975.f9284 + C1578.class.getName() + " '" + file7.getAbsolutePath() + "' '" + C2975.f9251 + "/CustomPatches'");
                            }
                        }
                    }
                    C2975.m7954(new RunnableC3461());
                } catch (Exception e) {
                    e.printStackTrace();
                }
                C2975.f9257 = true;
                C2975.m7949(false);
            }
        }

        RunnableC3458(ArrayList arrayList) {
            this.f10018 = arrayList;
        }

        @Override
        public void run() {
            C2975.m7956(new RunnableC3459());
        }
    }

    public class DialogInterfaceOnClickListenerC3462 implements DialogInterface.OnClickListener {

        final C2939 f10023;

        DialogInterfaceOnClickListenerC3462(C2939 c2939) {
            this.f10023 = c2939;
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            C2975.f9389 = this.f10023;
            if (C2975.this.f9430) {
                ArrayList<File> m7003 = C2500.m7003();
                String str = "/Android/data/" + this.f10023.f9151;
                String str2 = "/Android/obb/" + this.f10023.f9151;
                String str3 = "/Android/data/!lpbackup" + this.f10023.f9151;
                String str4 = "/Android/obb/!lpbackup" + this.f10023.f9151;
                if (m7003 != null && m7003.size() > 0) {
                    Iterator<File> it = m7003.iterator();
                    while (it.hasNext()) {
                        File next = it.next();
                        File file = new File(next.getAbsolutePath() + str);
                        File file2 = new File(next.getAbsolutePath() + str2);
                        File file3 = new File(next.getAbsolutePath() + str3);
                        File file4 = new File(next.getAbsolutePath() + str4);
                        if (file.exists()) {
                            if (file3.exists()) {
                                file3.delete();
                            }
                            file.renameTo(file3);
                        }
                        if (file2.exists()) {
                            if (file4.exists()) {
                                file4.delete();
                            }
                            file2.renameTo(file4);
                        }
                    }
                }
                C2975.m7928().edit().putBoolean("restore_cache_and_data_for_" + this.f10023.f9151, true).commit();
            }
            try {
                C2975.m7932().getPackageInfo(C2975.f9389.f9151, ItemType.CLASS_DATA_ITEM);
                C2500.m7153(C2975.f9259, C2975.f9389.f9151, Integer.valueOf(C2975.f9397));
                C2975.f9281 = false;
                C2975.m7949(false);
            } catch (PackageManager.NameNotFoundException unused) {
                C2500.m7023(C2975.f9259, C2975.f9389.f9156, null);
                C2975.f9281 = false;
                C2975.m7949(false);
            }
        }
    }

    public class RunnableC3463 implements Runnable {

        final ArrayList f10025;

        class RunnableC3464 implements Runnable {

            class RunnableC3465 implements Runnable {
                RunnableC3465() {
                }

                @Override
                public void run() {
                    C2975.m7951(23);
                }
            }

            class RunnableC3466 implements Runnable {
                RunnableC3466() {
                }

                @Override
                public void run() {
                    C2975.m7962(C2500.m7007(R.string.information), C2500.m7007(R.string.custom_patches_update_not_found));
                }
            }

            RunnableC3464() {
            }

            @Override
            public void run() {
                ByteArrayInputStream byteArrayInputStream;
                RunnableC3465 runnableC3465;
                Iterator it;
                BufferedReader bufferedReader = null;
                try {
                    byteArrayInputStream = new ByteArrayInputStream(new C2483("CustomPatches_plagiarism.vers").m6852(true));
                    try {
                        BufferedReader bufferedReader2 = new BufferedReader(new InputStreamReader(byteArrayInputStream));
                        while (true) {
                            try {
                                String readLine = bufferedReader2.readLine();
                                if (readLine == null) {
                                    try {
                                        break;
                                    } catch (Exception unused) {
                                    }
                                } else if (!readLine.trim().equals("")) {
                                    if (readLine.startsWith("->")) {
                                        String replace = readLine.replace("->", "");
                                        File file = new File(C2975.f9251 + "/CustomPatches");
                                        if (!file.exists()) {
                                            file.mkdirs();
                                        }
                                        File[] listFiles = file.listFiles();
                                        if (listFiles != null && listFiles.length > 0) {
                                            for (File file2 : listFiles) {
                                                if (file2.getName().startsWith(replace)) {
                                                    file2.delete();
                                                }
                                            }
                                        }
                                    } else if (readLine.startsWith("*")) {
                                        String replace2 = readLine.replace("*", "");
                                        File file3 = new File(C2975.f9251 + "/CustomPatches");
                                        if (!file3.exists()) {
                                            file3.mkdirs();
                                        }
                                        File[] listFiles2 = file3.listFiles();
                                        if (listFiles2 != null && listFiles2.length > 0) {
                                            for (File file4 : listFiles2) {
                                                if (file4.getName().contains(replace2)) {
                                                    file4.delete();
                                                }
                                            }
                                        }
                                    } else {
                                        File file5 = new File(C2975.f9251 + "/CustomPatches");
                                        if (!file5.exists()) {
                                            file5.mkdirs();
                                        }
                                        File[] listFiles3 = file5.listFiles();
                                        if (listFiles3 != null && listFiles3.length > 0) {
                                            int length = listFiles3.length;
                                            int i = 0;
                                            while (true) {
                                                if (i < length) {
                                                    File file6 = listFiles3[i];
                                                    if (file6.getName().equals(readLine)) {
                                                        file6.delete();
                                                        break;
                                                    }
                                                    i++;
                                                }
                                            }
                                        }
                                    }
                                }
                            } catch (Throwable th) {
                                th = th;
                                bufferedReader = bufferedReader2;
                                try {
                                    th.printStackTrace();
                                    if (bufferedReader != null) {
                                        try {
                                            bufferedReader.close();
                                        } catch (Exception unused2) {
                                            runnableC3465 = new RunnableC3465();
                                            C2975.m7954(runnableC3465);
                                            it = RunnableC3463.this.f10025.iterator();
                                            while (it.hasNext()) {
                                            }
                                            C2975.m7954(new RunnableC3466());
                                        }
                                    }
                                    if (byteArrayInputStream != null) {
                                        byteArrayInputStream.close();
                                    }
                                    runnableC3465 = new RunnableC3465();
                                    C2975.m7954(runnableC3465);
                                    it = RunnableC3463.this.f10025.iterator();
                                    while (it.hasNext()) {
                                    }
                                    C2975.m7954(new RunnableC3466());
                                } catch (Throwable th2) {
                                    if (bufferedReader != null) {
                                        try {
                                            bufferedReader.close();
                                        } catch (Exception unused3) {
                                            C2975.m7954(new RunnableC3465());
                                            throw th2;
                                        }
                                    }
                                    if (byteArrayInputStream != null) {
                                        byteArrayInputStream.close();
                                    }
                                    C2975.m7954(new RunnableC3465());
                                    throw th2;
                                }
                            }
                        }
                        bufferedReader2.close();
                        byteArrayInputStream.close();
                        runnableC3465 = new RunnableC3465();
                    } catch (Throwable th3) {
                        th = th3;
                    }
                } catch (Throwable th4) {
                    th = th4;
                    byteArrayInputStream = null;
                }
                C2975.m7954(runnableC3465);
                it = RunnableC3463.this.f10025.iterator();
                while (it.hasNext()) {
                    try {
                        File file7 = new File(C2975.f9251 + "/Download/" + ((C2623) it.next()).f7515);
                        FileInputStream fileInputStream = new FileInputStream(file7);
                        ZipInputStream zipInputStream = new ZipInputStream(fileInputStream);
                        while (true) {
                            ZipEntry nextEntry = zipInputStream.getNextEntry();
                            if (nextEntry == null) {
                                break;
                            }
                            String str = C2975.f9251 + "/CustomPatches/" + nextEntry.getName();
                            new File(C2975.f9251 + "/CustomPatches").mkdirs();
                            FileOutputStream fileOutputStream = new FileOutputStream(str);
                            byte[] bArr = new byte[InternalZipConstants.UFT8_NAMES_FLAG];
                            while (true) {
                                int read = zipInputStream.read(bArr);
                                if (read != -1) {
                                    fileOutputStream.write(bArr, 0, read);
                                }
                            }
                            fileOutputStream.close();
                            new File(str).setLastModified(nextEntry.getTime());
                        }
                        zipInputStream.close();
                        fileInputStream.close();
                        if (C2975.f9283) {
                            new C2500("").m7211(C2975.f9284 + C1578.class.getName() + " '" + file7.getAbsolutePath() + "' '" + C2975.f9251 + "/CustomPatches'");
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
                C2975.m7954(new RunnableC3466());
            }
        }

        RunnableC3463(ArrayList arrayList) {
            this.f10025 = arrayList;
        }

        @Override
        public void run() {
            C2975.m7942("Unpack custom patches");
            C2975.m7956(new RunnableC3464());
        }
    }

    public class DialogInterfaceOnClickListenerC3467 implements DialogInterface.OnClickListener {

        class RunnableC3468 implements Runnable {

            class RunnableC3469 implements Runnable {
                RunnableC3469() {
                }

                @Override
                public void run() {
                    C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.file_not_deleted));
                }
            }

            class RunnableC3470 implements Runnable {
                RunnableC3470() {
                }

                @Override
                public void run() {
                    if (C3549.f10208 != null && !new File(C2975.f9282).exists()) {
                        ((ArrayAdapter) C3549.f10208.getAdapter()).remove(C2975.f9366);
                        ((ArrayAdapter) C3549.f10208.getAdapter()).notifyDataSetChanged();
                    }
                }
            }

            RunnableC3468() {
            }

            @Override
            public void run() {
                new File(C2975.f9282).delete();
                if (new File(C2975.f9282).exists()) {
                    C2975.m7954(new RunnableC3469());
                } else {
                    C2975.m7954(new RunnableC3470());
                }
                C2975.f9282 = "";
            }
        }

        DialogInterfaceOnClickListenerC3467() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            if (i != -2) {
                if (i == -1) {
                    Thread thread = new Thread(new RunnableC3468());
                    thread.setPriority(10);
                    thread.start();
                    return;
                }
                return;
            }
            C2975.f9282 = "";
        }
    }

    public class RunnableC3471 implements Runnable {

        final Integer f10034;

        RunnableC3471(Integer num) {
            this.f10034 = num;
        }

        @Override
        public void run() {
            C3746 c3746 = C2975.f9278;
            if (c3746 != null && c3746.m8243()) {
                C2975.f9278.m8247(this.f10034.intValue() / 1024);
            }
        }
    }

    public class RunnableC3472 implements Runnable {

        final String f10036;

        final boolean f10037;

        final String f10038;

        class RunnableC3473 implements Runnable {
            RunnableC3473() {
            }

            @Override
            public void run() {
                C2975 c2975 = C2975.this;
                c2975.m7963(c2975.mo1874(), C2500.m7007(R.string.warning), C2500.m7007(R.string.no_space_in_system));
                C2975.m7951(11);
            }
        }

        class RunnableC3474 implements Runnable {
            RunnableC3474() {
            }

            @Override
            public void run() {
                C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.unknown_error));
                C2975.m7951(11);
            }
        }

        class RunnableC3475 implements Runnable {

            class DialogInterfaceOnClickListenerC3476 implements DialogInterface.OnClickListener {
                DialogInterfaceOnClickListenerC3476() {
                }

                @Override
                public void onClick(DialogInterface dialogInterface, int i) {
                    C2500.m7073();
                }
            }

            RunnableC3475() {
            }

            @Override
            public void run() {
                C2500.m7125(C2500.m7007(R.string.warning), C2500.m7007(R.string.system_app_change), new DialogInterfaceOnClickListenerC3476(), null, null);
                C2975.m7951(11);
            }
        }

        RunnableC3472(String str, boolean z, String str2) {
            this.f10036 = str;
            this.f10037 = z;
            this.f10038 = str2;
        }

        @Override
        public void run() {
            try {
                C2500.m7053(this.f10036);
                if (this.f10037) {
                    C2500.m6970();
                }
                if (!this.f10037) {
                    C2500.m7078("/system", InternalZipConstants.WRITE_MODE);
                }
                String m7211 = new C2500("").m7211(this.f10038);
                C2975.m7942("" + m7211);
                if (m7211.contains("In /system space not found!")) {
                    C2975.m7954(new RunnableC3473());
                } else {
                    C2975.m7954(new RunnableC3475());
                }
            } catch (Exception e) {
                C2975.m7942("Move to system " + e);
                C2975.m7954(new RunnableC3474());
            }
        }
    }

    public static String m7919(C3478 c3478, boolean z) {
        String sb;
        String str = "";
        if (!m7966(true)) {
            return "";
        }
        String[] strArr = {f9251 + "/Backup/"};
        if (z) {
            strArr[0] = f9251 + "/tmp/";
        }
        if (!C2500.m7047(c3478.f10046)) {
            new File(strArr[0]).mkdirs();
            try {
                File file = new File(m7932().getPackageInfo(c3478.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir);
                if (m7928().getInt("apkname", 0) != 0) {
                    sb = strArr[0] + c3478.f10046 + ".ver." + C2500.m6873(C2500.m6975(c3478.f10046)) + ".build." + m7932().getPackageInfo(c3478.f10046, ItemType.CLASS_DATA_ITEM).versionCode + ".apk";
                } else {
                    StringBuilder sb2 = new StringBuilder();
                    sb2.append(strArr[0]);
                    sb2.append(C2500.m6873(c3478.f10047 + ".ver." + C2500.m6975(c3478.f10046)));
                    sb2.append(".build.");
                    sb2.append(m7932().getPackageInfo(c3478.f10046, ItemType.CLASS_DATA_ITEM).versionCode);
                    sb2.append(".apk");
                    sb = sb2.toString();
                }
                if (new File(sb).exists()) {
                    new File(sb).delete();
                }
                try {
                    if (c3478.f10061) {
                        if (C2500.m7173(file)) {
                            C2500.m6875(file, new File(sb));
                        } else {
                            m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error2_backup_apk));
                        }
                    } else {
                        C2500.m6875(file, new File(sb));
                    }
                } catch (Exception e) {
                    C2500.m6877(m7932().getPackageInfo(c3478.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir, sb, false, false);
                    e.printStackTrace();
                }
                if (!new File(sb).exists()) {
                    new C2500("").m7211("dd if=" + m7932().getPackageInfo(c3478.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir + " of=" + sb);
                    StringBuilder sb3 = new StringBuilder();
                    sb3.append("chmod 777 ");
                    sb3.append(sb);
                    C2500.m7093(sb3.toString());
                }
                if (new File(sb).exists()) {
                    m7954(new RunnableC3445(strArr));
                    return sb;
                }
                m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_backup_apk));
                return "";
            } catch (PackageManager.NameNotFoundException e2) {
                e2.printStackTrace();
                return "";
            } catch (Exception e3) {
                e3.printStackTrace();
                m7954(new RunnableC2980());
                return "";
            }
        }
        try {
            String m6882 = C2500.m6882(c3478.f10046);
            if (new File(m6882).exists()) {
                m7954(new RunnableC3093());
                str = m6882;
            } else {
                m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_backup_apk));
            }
            return str;
        } catch (Exception e4) {
            e4.printStackTrace();
            m7954(new RunnableC3027());
            return str;
        }
    }

    public static void m7920() {
        int i;
        File file = new File(f9250 + "/busybox");
        if (Build.VERSION.SDK_INT >= 20) {
            String str = Build.CPU_ABI;
            if (str.toLowerCase().trim().equals("x86")) {
                i = R.raw.busyboxx86pie;
            } else if (str.toUpperCase().trim().equals("MIPS")) {
                i = R.raw.busyboxmipspie;
            } else {
                i = R.raw.busyboxpie;
            }
        } else {
            String str2 = Build.CPU_ABI;
            if (str2.toLowerCase().trim().equals("x86")) {
                i = R.raw.busyboxx86;
            } else if (str2.toUpperCase().trim().equals("MIPS")) {
                i = R.raw.busyboxmips;
            } else {
                i = R.raw.busybox;
            }
        }
        boolean z = !Arrays.equals(C2500.m6982(i, 234), C2500.m6946(file, 234));
        if (!file.exists() || z) {
            if (z) {
                m7942("LuckyPatcher: busybox version updated. " + file.length());
                if (file.exists()) {
                    file.delete();
                }
            }
            try {
                C2500.m6984(i, new File(f9250 + "/busybox"));
            } catch (Exception unused) {
            }
            try {
                C2500.m6941(new File(file.getAbsolutePath()), 3583);
            } catch (Exception e) {
                m7942(e);
                e.printStackTrace();
            }
            C2500.m7093("chmod 06777 " + file.getAbsolutePath());
            C2500.m7093("chown 0.0 " + file.getAbsolutePath());
            C2500.m7093("chown 0:0 " + file.getAbsolutePath());
            C2500.m7093("chcon u:object_r:magisk_file:s0 " + file.getAbsolutePath());
        }
    }

    public void m7921() {
        if (this.f9424 != null) {
            try {
                m7929().unbindService(f9387);
            } catch (IllegalArgumentException unused) {
            }
            this.f9424 = null;
        }
    }

    public static void m7922(File file, boolean z, boolean z2, boolean z3) {
        String packageName;
        String str;
        int i;
        boolean z4;
        int m7085;
        boolean z5;
        File file2;
        File file3 = new File(f9251 + "/Modified/tmp");
        String packageName2 = m7929().getPackageName();
        if (z3) {
            packageName2 = C2500.m6922(file.getAbsolutePath(), 1).packageName;
        }
        String str2 = packageName2;
        int i2 = f9288;
        if (str2.contains("installer") || z3) {
            if (!z3) {
                List<ResolveInfo> queryIntentServices = m7932().queryIntentServices(new Intent("com.android.vending.billing.InAppBillingService.INST"), 131584);
                if (queryIntentServices == null || queryIntentServices.size() <= 1) {
                    packageName = "";
                    str = packageName;
                    i = 0;
                } else {
                    packageName = "";
                    str = packageName;
                    i = 0;
                    for (ResolveInfo resolveInfo : queryIntentServices) {
                        String str3 = resolveInfo.serviceInfo.packageName;
                        if (str3 != null && !str3.contains("installer")) {
                            if (z2) {
                                str = resolveInfo.serviceInfo.applicationInfo.loadLabel(m7932()).toString();
                                if (str.startsWith("L")) {
                                    str = C2500.m6981(C2500.m6911(10, 18));
                                }
                            }
                            try {
                                i = m7932().getPackageInfo(str3, 8704).versionCode;
                            } catch (PackageManager.NameNotFoundException e) {
                                e.printStackTrace();
                            }
                            packageName = str3;
                        }
                    }
                }
                if (packageName.equals("")) {
                    String[] split = str2.split("\\.");
                    if (split != null && split.length > 0) {
                        for (int i3 = 0; i3 < split.length; i3++) {
                            if (i3 == 0) {
                                packageName = split[i3];
                            } else {
                                packageName = packageName + "." + C2500.m6979(split[i3].length());
                            }
                        }
                    }
                    if (z2) {
                        str = C2500.m6981(C2500.m6911(10, 18));
                    }
                }
            } else {
                packageName = m7929().getPackageName();
                if (!z2) {
                    str = "";
                } else {
                    str = m7929().getApplicationInfo().loadLabel(m7932()).toString();
                    if (str.startsWith("L")) {
                        str = C2500.m6981(C2500.m6911(10, 18));
                    }
                }
                i = 0;
            }
            f9411 = packageName;
            if (packageName != null && !packageName.equals("") && i2 >= i) {
                C3549.m8159(C2500.m7007(R.string.title_progress_installation_lp), C2500.m7007(R.string.wait) + "...", 10, false, false);
                if (!file3.exists()) {
                    file3.mkdirs();
                }
                C2500.m6992(file3);
                C3549.m8199(C2500.m7007(R.string.title_progress_installation_lp), C2500.m7007(R.string.patch_progress_get_classes), "", 1, 10, false);
                ArrayList arrayList = new ArrayList();
                File file4 = null;
                if (file != null && file.exists() && file.canRead()) {
                    byte[] bArr = new byte[4096];
                    try {
                        for (C3862 c3862 : C3864.m8444(file.getAbsolutePath()).m8446().values()) {
                            try {
                                String m8433 = c3862.m8433();
                                if (m8433.toLowerCase().startsWith("classes") && m8433.endsWith(".dex") && !m8433.contains(InternalZipConstants.ZIP_FILE_SEPARATOR)) {
                                    InputStream m8431 = c3862.m8431();
                                    FileOutputStream fileOutputStream = new FileOutputStream(file3 + InternalZipConstants.ZIP_FILE_SEPARATOR + m8433);
                                    while (true) {
                                        int read = m8431.read(bArr);
                                        file2 = file4;
                                        if (read == -1) {
                                            break;
                                        }
                                        try {
                                            fileOutputStream.write(bArr, 0, read);
                                            file4 = file2;
                                        } catch (Throwable th) {
                                            th = th;
                                            file4 = file2;
                                            th.printStackTrace();
                                            if (th.toString().contains("No space left on device") || th.toString().contains("ENOSPC")) {
                                                z5 = true;
                                                if (!z5) {
                                                }
                                                z4 = false;
                                                ArrayList arrayList2 = new ArrayList();
                                                if (z4) {
                                                }
                                                m7954(new RunnableC3088());
                                                f9329 = false;
                                                return;
                                            }
                                            z5 = false;
                                            if (!z5) {
                                            }
                                            z4 = false;
                                            ArrayList arrayList22 = new ArrayList();
                                            if (z4) {
                                            }
                                            m7954(new RunnableC3088());
                                            f9329 = false;
                                            return;
                                        }
                                    }
                                    fileOutputStream.close();
                                    arrayList.add(new File(file3.getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR + m8433));
                                    StringBuilder sb = new StringBuilder();
                                    sb.append("unpack ");
                                    sb.append(m8433);
                                    m7942(sb.toString());
                                } else {
                                    file2 = file4;
                                }
                                if (m8433.equals(ApkUtils.ANDROID_MANIFEST_ZIP_ENTRY_NAME)) {
                                    InputStream m84312 = c3862.m8431();
                                    FileOutputStream fileOutputStream2 = new FileOutputStream(file3 + InternalZipConstants.ZIP_FILE_SEPARATOR + m8433);
                                    while (true) {
                                        int read2 = m84312.read(bArr);
                                        if (read2 == -1) {
                                            break;
                                        } else {
                                            fileOutputStream2.write(bArr, 0, read2);
                                        }
                                    }
                                    fileOutputStream2.close();
                                    file4 = new File(file3.getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR + m8433);
                                    m7942("unpack " + m8433);
                                } else {
                                    file4 = file2;
                                }
                            } catch (Throwable th2) {
                                th = th2;
                            }
                        }
                    } catch (Throwable th3) {
                        th = th3;
                    }
                    z5 = false;
                    if (!z5) {
                        if (arrayList.size() == 0) {
                            z4 = false;
                        } else {
                            z4 = true;
                        }
                        if (file4 != null) {
                        }
                    }
                }
                z4 = false;
                ArrayList arrayList222 = new ArrayList();
                if (z4) {
                    C3549.m8199(C2500.m7007(R.string.title_progress_installation_lp), C2500.m7007(R.string.patch_step1), "", 1, 10, false);
                    try {
                    } catch (Exception e2) {
                        e2.printStackTrace();
                    }
                    if (file4.exists()) {
                        Iterator it = arrayList.iterator();
                        while (it.hasNext()) {
                            File file5 = (File) it.next();
                            m7942("String analysis.");
                            C3549.m8199(C2500.m7007(R.string.title_progress_installation_lp), C2500.m7007(R.string.patch_step1), "", 2, 10, false);
                            if (C2500.m7178(file5.getAbsolutePath(), str2, f9411) > 0) {
                                m7942("classes.dex changed!");
                            }
                            C3549.m8199(C2500.m7007(R.string.title_progress_installation_lp), C2500.m7007(R.string.patch_step1), "", 3, 10, false);
                            if (!arrayList222.contains(file5)) {
                                arrayList222.add(file5);
                            }
                        }
                        String str4 = "Lucky Patcher  ";
                        ArrayList arrayList3 = new ArrayList();
                        while (arrayList3.size() < 2) {
                            ArrayList arrayList4 = arrayList3;
                            int m6978 = (int) C2500.m6978(0L, 5L);
                            if (m6978 != 0) {
                                if (m6978 != 1) {
                                    if (m6978 != 2) {
                                        if (m6978 != 3) {
                                            if (m6978 != 4) {
                                                if (m6978 != 5) {
                                                }
                                                if ((arrayList4.size() != 1 && !((String) arrayList4.get(0)).equals("у")) || arrayList4.size() == 0) {
                                                    arrayList4.add("у");
                                                    str4 = str4.replace("y", "у");
                                                }
                                            }
                                            if ((arrayList4.size() == 1 && !((String) arrayList4.get(0)).equals("а")) || arrayList4.size() == 0) {
                                                arrayList4.add("а");
                                                str4 = str4.replace("a", "а");
                                            }
                                            if (arrayList4.size() != 1) {
                                            }
                                        }
                                        if ((arrayList4.size() == 1 && !((String) arrayList4.get(0)).equals("е")) || arrayList4.size() == 0) {
                                            arrayList4.add("е");
                                            str4 = str4.replace("e", "е");
                                        }
                                        if (arrayList4.size() == 1) {
                                            arrayList4.add("а");
                                            str4 = str4.replace("a", "а");
                                        }
                                        arrayList4.add("а");
                                        str4 = str4.replace("a", "а");
                                    }
                                    if ((arrayList4.size() == 1 && !((String) arrayList4.get(0)).equals("Р")) || arrayList4.size() == 0) {
                                        arrayList4.add("Р");
                                        str4 = str4.replace("P", "Р");
                                    }
                                    if (arrayList4.size() == 1) {
                                        arrayList4.add("е");
                                        str4 = str4.replace("e", "е");
                                    }
                                    arrayList4.add("е");
                                    str4 = str4.replace("e", "е");
                                }
                                if ((arrayList4.size() == 1 && !((String) arrayList4.get(0)).equals("к")) || arrayList4.size() == 0) {
                                    arrayList4.add("к");
                                    str4 = str4.replace("k", "к");
                                }
                                if (arrayList4.size() == 1) {
                                    arrayList4.add("Р");
                                    str4 = str4.replace("P", "Р");
                                }
                                arrayList4.add("Р");
                                str4 = str4.replace("P", "Р");
                            } else {
                                if ((arrayList4.size() == 1 && !((String) arrayList4.get(0)).equals("с")) || arrayList4.size() == 0) {
                                    arrayList4.add("с");
                                    str4 = str4.replaceFirst("c", "с");
                                }
                                if (arrayList4.size() == 1) {
                                    arrayList4.add("к");
                                    str4 = str4.replace("k", "к");
                                }
                                arrayList4.add("к");
                                str4 = str4.replace("k", "к");
                            }
                            arrayList3 = arrayList4;
                        }
                        switch ((int) C2500.m6978(0L, 6L)) {
                            case 0:
                                str4 = str4.replaceFirst(" ", " ");
                                break;
                            case 1:
                                str4 = str4.replaceFirst(" ", "-");
                                break;
                            case 2:
                                str4 = str4.replaceFirst(" ", "~");
                                break;
                            case 3:
                                str4 = str4.replaceFirst(" ", "`");
                                break;
                            case 4:
                                str4 = str4.replaceFirst(" ", "*");
                                break;
                            case 5:
                                str4 = str4.replaceFirst(" ", "+");
                                break;
                            case 6:
                                str4 = str4.replaceFirst(" ", "_");
                                break;
                        }
                        if (!str.equals("")) {
                            m7945(file4, " LP  Installer ", str);
                        }
                        if (z) {
                            m7085 = C2500.m7085(file4.getAbsolutePath(), new String[]{str2, " LP  Installer ", "@$#"}, new String[]{f9411, str4, "apk"});
                        } else {
                            m7085 = C2500.m7085(file4.getAbsolutePath(), new String[]{str2, " LP  Installer "}, new String[]{f9411, str4});
                        }
                        if (m7085 > 0) {
                            m7942(file4.getName() + " resource changed!");
                            if (!arrayList222.contains(file4)) {
                                arrayList222.add(file4);
                            }
                        }
                        C3549.m8199(C2500.m7007(R.string.title_progress_installation_lp), C2500.m7007(R.string.patch_step1), "", 4, 10, false);
                        if (arrayList.size() > 0) {
                            Iterator it2 = arrayList.iterator();
                            while (it2.hasNext()) {
                                File file6 = (File) it2.next();
                                if (file6.getName().toLowerCase().equals("classes.dex")) {
                                    file6.length();
                                }
                                if (!arrayList222.contains(file6)) {
                                    arrayList222.add(file6);
                                }
                                C2500.m6908(file6);
                            }
                        }
                        C3549.m8199(C2500.m7007(R.string.title_progress_installation_lp), C2500.m7007(R.string.patch_step1), "", 5, 10, false);
                        if (file4.exists()) {
                            m7942("Found androidmanifest");
                            if (!arrayList222.contains(file4)) {
                                arrayList222.add(file4);
                            }
                        }
                        m7954(new RunnableC3084());
                        try {
                            m7954(new RunnableC3085());
                            ArrayList arrayList5 = new ArrayList();
                            try {
                                if (!file.exists()) {
                                    m7954(new RunnableC3086());
                                }
                                if (arrayList222.size() > 0) {
                                    Iterator it3 = arrayList222.iterator();
                                    while (it3.hasNext()) {
                                        File file7 = (File) it3.next();
                                        m7942("files for add:" + file7.getAbsolutePath());
                                        arrayList5.add(new C2912(file7.getAbsolutePath(), file3.getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR));
                                    }
                                }
                                File file8 = new File(file3.getAbsolutePath() + "/install.apk");
                                C2500.m7089(file.getAbsolutePath(), file8.getAbsolutePath(), arrayList5, false, false);
                                if (file8.exists()) {
                                    m7942(file8.getAbsolutePath());
                                    C2500.m7023(f9259, new File(file3.getAbsolutePath() + "/install.apk"), Integer.valueOf(f9400));
                                    m7928().edit().putBoolean("first_show_option_install_apk", true).commit();
                                    m7928().edit().putBoolean("first_show_option_use_random_name", true).commit();
                                    m7954(new RunnableC3087());
                                }
                            } catch (Throwable th4) {
                                th4.printStackTrace();
                            }
                        } catch (Exception e3) {
                            e3.printStackTrace();
                        }
                    } else {
                        throw new FileNotFoundException();
                    }
                }
                m7954(new RunnableC3088());
                f9329 = false;
                return;
            }
            if (i2 < i) {
                C2500.m7153(f9259, f9411, Integer.valueOf(f9398));
            }
        }
    }

    public static String[] m7923() {
        ArrayList arrayList = new ArrayList();
        int i = 0;
        try {
            Process exec = Runtime.getRuntime().exec("pm list packages");
            exec.waitFor();
            DataInputStream dataInputStream = new DataInputStream(exec.getInputStream());
            byte[] bArr = new byte[dataInputStream.available()];
            dataInputStream.read(bArr);
            String str = new String(bArr);
            exec.destroy();
            for (String str2 : str.split("\n")) {
                if (str2.startsWith("package:")) {
                    arrayList.add(str2.substring(8));
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        } catch (InterruptedException e2) {
            e2.printStackTrace();
        } catch (Exception e3) {
            m7942("LuckyPatcher (consolePM):" + e3);
            e3.printStackTrace();
        }
        String[] strArr = new String[arrayList.size()];
        Iterator it = arrayList.iterator();
        while (it.hasNext()) {
            strArr[i] = (String) it.next();
            i++;
        }
        return strArr;
    }

    private boolean m7924(String str, boolean z) {
        if (!new File(str).exists()) {
            new File(str).mkdirs();
        }
        try {
            if (!z) {
                if (!new File(str + "/AdsBlockList.txt").exists()) {
                    try {
                        C2500.m6927("AdsBlockList.txt", str);
                        return true;
                    } catch (Exception e) {
                        e.printStackTrace();
                        return false;
                    }
                }
                return true;
            }
            if (!new File(str + "/AdsBlockList_user_edit.txt").exists()) {
                try {
                    C2500.m6927("AdsBlockList_user_edit.txt", str);
                } catch (FileNotFoundException unused) {
                } catch (Exception e2) {
                    e2.printStackTrace();
                    return false;
                }
            }
            try {
                C2500.m6927("AdsBlockList.txt", str);
            } catch (Exception e3) {
                e3.printStackTrace();
                return false;
            }
        } catch (FileNotFoundException unused2) {
            return true;
        }
    }

    public static void m7925() {
        int i;
        if (f9253 != null) {
            String str = null;
            try {
                try {
                    str = m7932().getPackageInfo(f9253.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                } catch (PackageManager.NameNotFoundException e) {
                    e.printStackTrace();
                }
            } catch (Exception e2) {
                e2.printStackTrace();
            }
            if (f9283 && str != null && !str.startsWith("/system/")) {
                f9252.f10090 = r5;
                int[] iArr = {R.string.app_info, R.string.contextlaunchapp, R.string.menu_close_application, R.string.advanced_menu, R.string.uninstallapp, R.string.cleardata};
                if (!str.startsWith("/mnt/")) {
                    i = 6;
                    f9252.f10090[6] = R.string.move_to_sdcard;
                } else {
                    i = 6;
                    f9252.f10090[6] = R.string.move_to_internal;
                }
            } else {
                i = 6;
            }
            if (f9283 && str != null && str.startsWith("/system/")) {
                int[] iArr2 = new int[i];
                f9252.f10090 = iArr2;
                iArr2[0] = R.string.app_info;
                iArr2[1] = R.string.contextlaunchapp;
                iArr2[2] = R.string.menu_close_application;
                iArr2[3] = R.string.advanced_menu;
                iArr2[4] = R.string.uninstallapp;
                iArr2[5] = R.string.cleardata;
            }
            if (!f9283) {
                f9252.f10090 = r2;
                int[] iArr3 = {R.string.app_info, R.string.contextlaunchapp, R.string.advanced_menu, R.string.uninstallapp, R.string.app_dialog_no_root_app_control};
            }
            if (f9348.booleanValue()) {
                f9252.f10090 = r2;
                int[] iArr4 = {R.string.app_info, R.string.contextlaunchapp, R.string.advanced_menu};
            }
            if (f9253.f10069) {
                f9252.f10090 = r2;
                int[] iArr5 = {R.string.app_info, R.string.install_app_for_user, R.string.uninstallapp};
            }
            if (str == null) {
                f9252.f10090 = r1;
                int[] iArr6 = {R.string.apk_not_found_error};
            }
        }
    }

    public static void m7926() {
        C2500.m6900();
    }

    public static void m7927(ArrayList<byte[]> arrayList, ArrayList<byte[]> arrayList2) {
        BufferedReader bufferedReader;
        String readLine;
        InputStream open;
        BufferedReader bufferedReader2;
        try {
            open = m7933().getAssets().open("AdsBlockList.txt");
            bufferedReader2 = new BufferedReader(new InputStreamReader(open));
        } catch (Exception e) {
            e.printStackTrace();
        }
        try {
            loop0: while (true) {
                ArrayList<byte[]> arrayList3 = arrayList;
                while (true) {
                    String readLine2 = bufferedReader2.readLine();
                    if (readLine2 == null) {
                        break loop0;
                    }
                    String trim = readLine2.trim();
                    if (trim.toLowerCase().equals("[http]")) {
                        break;
                    }
                    if (trim.toLowerCase().equals("[all_strings]")) {
                        arrayList3 = arrayList2;
                    } else if (!trim.equals("")) {
                        arrayList3.add(trim.getBytes("UTF-8"));
                    }
                }
                FileInputStream fileInputStream = new FileInputStream(f9251 + "/AdsBlockList_user_edit.txt");
                bufferedReader = new BufferedReader(new InputStreamReader(fileInputStream));
                while (true) {
                    ArrayList<byte[]> arrayList4 = arrayList;
                    while (true) {
                        readLine = bufferedReader.readLine();
                        if (readLine == null) {
                            String trim2 = readLine.trim();
                            if (trim2.toLowerCase().equals("[http]")) {
                                break;
                            }
                            if (trim2.toLowerCase().equals("[all_strings]")) {
                                arrayList4 = arrayList2;
                            } else if (!trim2.equals("")) {
                                arrayList4.add(trim2.getBytes("UTF-8"));
                            }
                        } else {
                            fileInputStream.close();
                            return;
                        }
                    }
                }
            }
            FileInputStream fileInputStream2 = new FileInputStream(f9251 + "/AdsBlockList_user_edit.txt");
            bufferedReader = new BufferedReader(new InputStreamReader(fileInputStream2));
            while (true) {
                ArrayList<byte[]> arrayList42 = arrayList;
                while (true) {
                    readLine = bufferedReader.readLine();
                    if (readLine == null) {
                    }
                }
            }
        } catch (Exception e2) {
            e2.printStackTrace();
            return;
        }
        open.close();
    }

    public static SharedPreferences m7928() {
        if (f9304 == null) {
            f9304 = m7929().getSharedPreferences("config", 4);
        }
        return f9304;
    }

    public static Context m7929() {
        try {
            Context app = App.getInstance();
            f9242 = app;
            if (app == null) {
                System.out.println("LuckyApp Instance == null");
                MainActivity mainActivity = f9259;
                if (mainActivity != null) {
                    Context applicationContext = mainActivity.getApplicationContext();
                    f9242 = applicationContext;
                    if (applicationContext == null) {
                        f9242 = f9259;
                    }
                    if (f9242 == null) {
                        System.out.println("Return Instance from acivity == null");
                    }
                } else if (f9242 == null) {
                    System.out.println("Return Instance == null");
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return f9242;
    }

    public static Intent m7930() {
        if (f9336 == null) {
            f9336 = m7932().getLaunchIntentForPackage(f9279);
        }
        return f9336;
    }

    public static String[] m7931() {
        m7942("LuckyPatcher (getPackageManager install pkgs): start.");
        PackageManager m7932 = m7932();
        int i = 0;
        String[] strArr = null;
        try {
            List<PackageInfo> installedPackages = m7932.getInstalledPackages(ItemType.CLASS_DATA_ITEM);
            try {
                strArr = new String[installedPackages.size()];
                Iterator<PackageInfo> it = installedPackages.iterator();
                int i2 = 0;
                while (it.hasNext()) {
                    strArr[i2] = it.next().packageName;
                    i2++;
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        } catch (Exception e2) {
            m7942("LuckyPatcher (getPM install pkgs): " + e2);
            e2.printStackTrace();
        }
        if (strArr == null || strArr.length == 0) {
            m7942("LuckyPatcher (Intent PackageManager install pkgs): start.");
            try {
                List<ResolveInfo> queryIntentActivities = m7932.queryIntentActivities(new Intent("android.intent.action.MAIN"), 8320);
                strArr = new String[queryIntentActivities.size()];
                Iterator<ResolveInfo> it2 = queryIntentActivities.iterator();
                while (it2.hasNext()) {
                    strArr[i] = it2.next().activityInfo.packageName;
                    i++;
                }
            } catch (Exception unused) {
            }
        }
        if (strArr == null || strArr.length == 0) {
            m7942("LuckyPatcher (consolePM install pkgs): start.");
            return m7923();
        }
        return strArr;
    }

    public static PackageManager m7932() {
        if (f9342 == null) {
            f9342 = m7929().getPackageManager();
        }
        return f9342;
    }

    public static Resources m7933() {
        if (f9343 == null) {
            C2500.m7108(m7929());
            f9343 = m7929().getResources();
        }
        return f9343;
    }

    public static int m7934() {
        int i = f9303;
        if (i == 0) {
            int i2 = m7929().getSharedPreferences("config", 4).getInt("viewsize", 0);
            if (i2 != 0) {
                if (i2 != 1) {
                    f9303 = android.R.style.TextAppearance.Large;
                } else {
                    f9303 = android.R.style.TextAppearance.Medium;
                }
            } else {
                f9303 = android.R.style.TextAppearance.Small;
            }
            return f9303;
        }
        return i;
    }

    public Comparator<C3478> m7935() {
        int i = m7928().getInt("sortby", 2);
        if (i != 1) {
            if (i != 3) {
                return new C3368();
            }
            return new C3370();
        }
        return new C3367();
    }

    public static ArrayList<File> m7936() {
        ArrayList<C2973> arrayList;
        ArrayList<File> arrayList2 = new ArrayList<>();
        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
        try {
            Process start = new ProcessBuilder(new String[0]).command("mount").redirectErrorStream(true).start();
            start.waitFor();
            InputStream inputStream = start.getInputStream();
            byte[] bArr = new byte[ItemType.CLASS_DATA_ITEM];
            while (true) {
                int read = inputStream.read(bArr);
                if (read == -1) {
                    break;
                }
                byteArrayOutputStream.write(bArr, 0, read);
            }
            inputStream.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
        String byteArrayOutputStream2 = byteArrayOutputStream.toString();
        try {
            arrayList = C2500.m6962();
        } catch (Exception e2) {
            e2.printStackTrace();
            arrayList = null;
        }
        String[] split = byteArrayOutputStream2.split("\n");
        arrayList2.clear();
        for (String str : split) {
            m7942("LuckyPatcher: mount line - " + str);
            if ((str.toLowerCase().contains("vold") && str.toLowerCase().contains("vfat") && !str.toLowerCase().contains("asec")) || str.toLowerCase().contains("sdcard")) {
                String[] split2 = str.split("\\s+");
                if (split2[1].equals("on")) {
                    arrayList2.add(new File(split2[2]));
                } else {
                    arrayList2.add(new File(split2[1]));
                }
            }
        }
        Iterator<File> it = arrayList2.iterator();
        while (it.hasNext()) {
            m7942("LuckyPatcher: SDcard found to " + it.next());
        }
        try {
            if (arrayList2.size() == 0) {
                arrayList2.clear();
                Iterator<C2973> it2 = arrayList.iterator();
                while (it2.hasNext()) {
                    C2973 next = it2.next();
                    if (next.m7906().toString().toLowerCase().contains("vold") && next.m7909().toLowerCase().contains("vfat") && !next.m7908().toString().toLowerCase().contains("asec")) {
                        arrayList2.add(next.m7908());
                    }
                }
                Iterator<File> it3 = arrayList2.iterator();
                while (it3.hasNext()) {
                    m7942("LuckyPatcher: SDcard fount to " + it3.next());
                }
            }
        } catch (Exception e3) {
            e3.printStackTrace();
        }
        return arrayList2;
    }

    public static Process m7937() throws IOException {
        if (f9305 == null) {
            f9305 = Runtime.getRuntime().exec("su");
            f9307 = new DataOutputStream(f9305.getOutputStream());
            f9306 = new DataInputStream(f9305.getInputStream());
            f9308 = new DataInputStream(f9305.getErrorStream());
        } else {
            try {
                f9307.writeBytes("echo chelpusstart!\n");
            } catch (Exception unused) {
                m7926();
                f9305 = Runtime.getRuntime().exec("su");
                f9307 = new DataOutputStream(f9305.getOutputStream());
                f9306 = new DataInputStream(f9305.getInputStream());
                f9308 = new DataInputStream(f9305.getErrorStream());
            }
        }
        return f9305;
    }

    public static void m7938(Context context) {
        String str;
        if (!f9328 && !f9329) {
            f9328 = true;
            if (!C2500.m7039()) {
                int i = m7928().getInt("root_force", 0);
                if (i == 0 && (new File("/system/bin/su").exists() || new File("/system/xbin/su").exists() || new File("/su/bin/su").exists() || new File("/system/xbin/bstk/su").exists() || new File("/sbin/su").exists() || new File("/magisk/.core/bin/su").exists() || new File("/magisk/phh/bin/su").exists())) {
                    f9283 = true;
                }
                m7942(m7929().getFilesDir());
                if (m7929().getFilesDir().getAbsolutePath().contains("io.va.exposed")) {
                    f9348 = Boolean.TRUE;
                    String absolutePath = m7929().getFilesDir().getAbsolutePath();
                    String substring = absolutePath.substring(0, (absolutePath.lastIndexOf("/virtual/") + 9) - 1);
                    f9349 = substring;
                    m7942(substring);
                } else {
                    f9348 = Boolean.FALSE;
                }
                if (i == 1) {
                    f9283 = true;
                }
                if (i == 2) {
                    f9283 = false;
                }
            }
            f9242 = App.getInstance();
            if (f9290 == null) {
                f9290 = Boolean.TRUE;
            }
            f9279 = App.getInstance().getApplicationInfo().packageName;
            f9323 = Boolean.FALSE;
            f9299 = Build.VERSION.SDK_INT;
            try {
                f9288 = m7932().getPackageInfo(App.getInstance().getPackageName(), 0).versionCode;
                f9273 = m7932().getPackageInfo(App.getInstance().getPackageName(), 0).versionName;
            } catch (Exception e) {
                e.printStackTrace();
            }
            m7942("LuckyPatcher " + f9273 + ": Application Start!");
            if (m7928().getBoolean("fast_start", false)) {
                f9291 = true;
            }
            C2500.m7108(App.getInstance());
            f9260 = new ArrayList<>();
            try {
                f9250 = App.getInstance().getFilesDir().getAbsolutePath();
            } catch (Exception unused) {
            }
            f9271 = App.getInstance().getPackageCodePath();
            f9292 = Environment.getExternalStorageDirectory().getAbsolutePath();
            f9251 = f9292 + "/LuckyPatcher";
            try {
                if (f9299 > 18) {
                    f9251 = App.getInstance().getExternalFilesDir("LuckyPatcher").getAbsolutePath();
                }
            } catch (Exception e2) {
                e2.printStackTrace();
                new File(f9292 + "/Android/data/" + f9279 + "/files/LuckyPatcher").mkdirs();
                f9251 = f9292 + "/Android/data/" + f9279 + "/files/LuckyPatcher";
            }
            if (m7928().getBoolean("manual_path", false)) {
                f9251 = m7928().getString("basepath", f9251);
            }
            if (!C2500.m7039()) {
                String str2 = "/system/bin/dalvikvm";
                if (!new File("/system/bin/dalvikvm").exists()) {
                    str2 = "";
                }
                if (new File("/system/bin/dalvikvm32").exists()) {
                    str2 = "/system/bin/dalvikvm32";
                }
                if (str2.equals("") && f9283) {
                    File file = new File(App.getInstance().getFilesDir() + "/dalvikvm");
                    if (!file.exists()) {
                        if (C2500.m6984(R.raw.dalvikvm_armv7a, file)) {
                            C2500.m7093("chmod 777 " + file.getAbsolutePath());
                            C2500.m7093("chown 0.0 " + file.getAbsolutePath());
                            C2500.m7093("chown 0:0 " + file.getAbsolutePath());
                            file.getAbsolutePath();
                        }
                    } else {
                        file.getAbsolutePath();
                        C2500.m7093("chmod 777 " + file.getAbsolutePath());
                        C2500.m7093("chown 0.0 " + file.getAbsolutePath());
                        C2500.m7093("chown 0:0 " + file.getAbsolutePath());
                    }
                }
                f9284 = C2500.m6990();
                f9285 = C2500.m6991();
                String str3 = f9246;
                if (str3 == null || str3.equals("")) {
                    try {
                        str = C2500.m6915(m7932().getPackageInfo(m7929().getPackageName(), 0).applicationInfo.sourceDir);
                    } catch (PackageManager.NameNotFoundException e3) {
                        e3.printStackTrace();
                        str = "UNKNOWN";
                    }
                    m7942("Runtime:" + str);
                    f9246 = str;
                }
                for (String str4 : C2500.m6995()) {
                    if (new File(str4 + "/lp_utils").exists()) {
                        new File(str4 + "/lp_utils").renameTo(new File(str4 + InternalZipConstants.ZIP_FILE_SEPARATOR + f9355));
                    }
                    if (f9283) {
                        if (!new File(str4 + InternalZipConstants.ZIP_FILE_SEPARATOR + f9355).exists()) {
                            m7942("Tools not found in /data. Try create.");
                            new File(str4 + InternalZipConstants.ZIP_FILE_SEPARATOR + f9355);
                        }
                    }
                }
            }
            f9300 = m7928().getInt("days_on_up", 1);
            m7930();
        }
    }

    public void m7939(String str, String str2, boolean z) {
        m7956(new RunnableC3472(str, z, str2));
    }

    public static void m7940() {
        C3478 c3478 = f9253;
        if (c3478.f10061) {
            if (!f9283) {
                m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.root_needed));
            } else {
                String str = c3478.f10047;
                C2500.m7125(str, C2500.m7009(R.string.install_app_for_user_message, str), new DialogInterfaceOnClickListenerC3305(), null, null);
            }
        }
    }

    public static void m7941(ArrayList<C3478> arrayList, boolean z, boolean z2, boolean z3) {
        String str;
        boolean z4;
        ArrayList arrayList2;
        Class<C1594> cls;
        ArrayList arrayList3;
        ArrayList arrayList4;
        String str2;
        String str3;
        Iterator<C3478> it;
        Exception exc;
        PackageManager.NameNotFoundException nameNotFoundException;
        String str4;
        String str5;
        ArrayList arrayList5;
        String str6;
        ArrayList arrayList6;
        String str7;
        String str8;
        Class cls2;
        boolean z5;
        String str9;
        String str10;
        boolean z6;
        boolean z7;
        boolean z8;
        File file;
        String str11;
        String str12;
        ArrayList arrayList7;
        String str13;
        String str14;
        String str15;
        String str16;
        String str17;
        String[] strArr;
        String str18;
        ArrayList arrayList8;
        String str19;
        String str20;
        String str21;
        String str22;
        String str23;
        String str24;
        Class<C1594> cls3 = C1594.class;
        ArrayList arrayList9 = new ArrayList();
        ArrayList arrayList10 = new ArrayList();
        String str25 = "";
        String str26 = " ";
        if (arrayList != null && arrayList.size() > 0) {
            Iterator<C3478> it2 = arrayList.iterator();
            while (it2.hasNext()) {
                C3478 next = it2.next();
                try {
                    String str27 = next.f10046;
                    if (str27 != null) {
                        if (!z2) {
                            m7955(new RunnableC2996());
                        }
                        try {
                            str4 = m7932().getPackageInfo(str27, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir;
                            str5 = m7932().getPackageInfo(str27, ItemType.CLASS_DATA_ITEM).applicationInfo.dataDir;
                            arrayList5 = new ArrayList();
                        } catch (PackageManager.NameNotFoundException e) {
                            e = e;
                            cls = cls3;
                            arrayList3 = arrayList9;
                            arrayList4 = arrayList10;
                            str2 = str25;
                            str3 = str26;
                            it = it2;
                        }
                        if (!str4.startsWith("/data/app/")) {
                            if (!str4.startsWith("/mnt/")) {
                                if (str4.startsWith("/data/priv-app")) {
                                }
                                cls = cls3;
                                arrayList3 = arrayList9;
                                arrayList4 = arrayList10;
                                str2 = str25;
                                str3 = str26;
                                it = it2;
                                if (z && !z2) {
                                    try {
                                        m7955(new RunnableC3006());
                                    } catch (Exception e2) {
                                        e = e2;
                                        exc = e;
                                        exc.printStackTrace();
                                        str26 = str3;
                                        arrayList9 = arrayList3;
                                        it2 = it;
                                        arrayList10 = arrayList4;
                                        str25 = str2;
                                        cls3 = cls;
                                    }
                                }
                            }
                        }
                        ArrayList arrayList11 = new ArrayList();
                        ArrayList arrayList12 = new ArrayList();
                        C2500.m7078("/system", InternalZipConstants.WRITE_MODE);
                        C2500.m6954(str27, new File("/system/app"), arrayList11);
                        C2500.m6954(str27, new File("/system/priv-app"), arrayList11);
                        C2500.m6954(str27, new File("/system/product/priv-app"), arrayList11);
                        C2500.m6954(str27, new File("/system/product/app"), arrayList11);
                        C2500.m6954(str27, new File("/system/vendor/priv-app"), arrayList11);
                        C2500.m6954(str27, new File("/system/vendor/app"), arrayList11);
                        C2500.m6954(str27, new File("/system/system_ext/priv-app"), arrayList11);
                        C2500.m6954(str27, new File("/system/system_ext/app"), arrayList11);
                        C2500.m6954(str27, new File("/product/priv-app"), arrayList12);
                        C2500.m6954(str27, new File("/product/app"), arrayList12);
                        C2500.m6954(str27, new File("/vendor/priv-app"), arrayList12);
                        C2500.m6954(str27, new File("/vendor/app"), arrayList12);
                        C2500.m6954(str27, new File("/system_ext/priv-app"), arrayList12);
                        C2500.m6954(str27, new File("/system_ext/app"), arrayList12);
                        Iterator it3 = arrayList12.iterator();
                        while (it3.hasNext()) {
                            C2500.m7078(((File) it3.next()).getAbsolutePath(), "RW");
                        }
                        Iterator it4 = arrayList11.iterator();
                        while (it4.hasNext()) {
                            C2500.m7078(((File) it4.next()).getAbsolutePath(), "RW");
                        }
                        if (arrayList11.size() > 0) {
                            String str28 = "chattr -ai '";
                            it = it2;
                            String str29 = "chown 0:0 '";
                            arrayList4 = arrayList10;
                            String str30 = "chown 0.0 '";
                            str2 = str25;
                            String str31 = str26;
                            ArrayList arrayList13 = arrayList9;
                            String str32 = ": ";
                            String str33 = " - ";
                            String str34 = "rm '";
                            if (arrayList11.size() == 1) {
                                try {
                                    m7942("found 1 apk");
                                    String[] strArr2 = new String[2];
                                    try {
                                        strArr2[0] = C2500.m6942((File) arrayList11.get(0)).getAbsolutePath();
                                        strArr2[1] = "rename";
                                        m7942(C2500.m7092(C1567.class, strArr2));
                                        Class cls4 = C1567.class;
                                        m7942(C2500.m7092(C1626.class, str4, ((File) arrayList11.get(0)).getAbsolutePath(), "false"));
                                        if (!C2500.m7092(cls3, str27, str5, str4, ((File) arrayList11.get(0)).getAbsolutePath(), "copyLibs").contains("In /system space not found!")) {
                                            ArrayList<File> arrayList14 = new ArrayList<>();
                                            if (C2500.m7047(next.f10046)) {
                                                arrayList14 = C2500.m7000(next.f10046);
                                            }
                                            arrayList14.add(new File(str4));
                                            File m6942 = C2500.m6942((File) arrayList11.get(0));
                                            Iterator<File> it5 = arrayList14.iterator();
                                            while (it5.hasNext()) {
                                                File next2 = it5.next();
                                                StringBuilder sb = new StringBuilder();
                                                Iterator<File> it6 = it5;
                                                sb.append(m6942.getAbsolutePath());
                                                sb.append(InternalZipConstants.ZIP_FILE_SEPARATOR);
                                                sb.append(next2.getName());
                                                String sb2 = sb.toString();
                                                if (next2.getAbsolutePath().equals(str4)) {
                                                    sb2 = ((File) arrayList11.get(0)).getAbsolutePath();
                                                }
                                                File file2 = m6942;
                                                C3478 c3478 = next;
                                                String m7092 = C2500.m7092(C1598.class, next2.getAbsolutePath(), sb2);
                                                m7942(m7092);
                                                if (m7092.contains("File copied!")) {
                                                    arrayList5.add(new File(sb2));
                                                    C2500.m7093("chmod 644 '" + sb2 + "'");
                                                    C2500.m7093(str30 + sb2 + "'");
                                                    C2500.m7093(str29 + sb2 + "'");
                                                    C2500.m7093(str28 + sb2 + "'");
                                                }
                                                if (m7092.contains("Length of Files not equals. Destination deleted!")) {
                                                    m7942(C2500.m7092(cls3, str27, str5, str4, ((File) arrayList11.get(0)).getAbsolutePath(), "deleteBigLibs"));
                                                    Iterator it7 = arrayList5.iterator();
                                                    while (it7.hasNext()) {
                                                        File file3 = (File) it7.next();
                                                        StringBuilder sb3 = new StringBuilder();
                                                        String str35 = str34;
                                                        sb3.append(str35);
                                                        sb3.append(file3.getAbsolutePath());
                                                        sb3.append("'");
                                                        C2500.m7093(sb3.toString());
                                                        str34 = str35;
                                                    }
                                                    cls2 = cls4;
                                                    m7942(C2500.m7092(cls2, C2500.m6942((File) arrayList11.get(0)).getAbsolutePath(), "restore"));
                                                    if (z2) {
                                                        StringBuilder sb4 = new StringBuilder();
                                                        next = c3478;
                                                        sb4.append(next.f10047);
                                                        str10 = str33;
                                                        sb4.append(str10);
                                                        sb4.append(C2500.m7007(R.string.integrate_updates_result));
                                                        str9 = str32;
                                                        sb4.append(str9);
                                                        sb4.append(C2500.m7007(R.string.no_space_in_system_all));
                                                        m7967(sb4.toString());
                                                    } else {
                                                        str9 = str32;
                                                        str10 = str33;
                                                        next = c3478;
                                                        m7955(new RunnableC2997(next));
                                                    }
                                                    str8 = str10;
                                                    str7 = str9;
                                                } else {
                                                    String str36 = str34;
                                                    cls2 = cls4;
                                                    next = c3478;
                                                    String str37 = str30;
                                                    String str38 = str32;
                                                    String str39 = str28;
                                                    str7 = str38;
                                                    String str40 = str33;
                                                    String str41 = str29;
                                                    str8 = str40;
                                                    if (m7092.contains("Backup not replace original!")) {
                                                        Iterator it8 = arrayList5.iterator();
                                                        while (it8.hasNext()) {
                                                            C2500.m7093(str36 + ((File) it8.next()).getAbsolutePath() + "'");
                                                        }
                                                        m7942(C2500.m7092(cls2, C2500.m6942((File) arrayList11.get(0)).getAbsolutePath(), "restore"));
                                                        if (z2) {
                                                            m7967(next.f10047 + str8 + C2500.m7007(R.string.integrate_updates_result) + str7 + C2500.m7007(R.string.unknown_error));
                                                        } else {
                                                            m7955(new RunnableC2998(next));
                                                        }
                                                    } else {
                                                        cls4 = cls2;
                                                        str30 = str37;
                                                        it5 = it6;
                                                        str34 = str36;
                                                        m6942 = file2;
                                                        str32 = str7;
                                                        str28 = str39;
                                                        str33 = str8;
                                                        str29 = str41;
                                                    }
                                                }
                                                z5 = true;
                                                if (z5) {
                                                    C2500.m6937(str27);
                                                    String[] strArr3 = new String[5];
                                                    strArr3[0] = str27;
                                                    strArr3[1] = str5;
                                                    strArr3[2] = str4;
                                                    strArr3[3] = ((File) arrayList11.get(0)).getAbsolutePath();
                                                    strArr3[4] = "replaceOldLibs";
                                                    m7942(C2500.m7092(cls3, strArr3));
                                                    String[] strArr4 = new String[2];
                                                    strArr4[0] = C2500.m6942((File) arrayList11.get(0)).getAbsolutePath();
                                                    strArr4[1] = "delete";
                                                    m7942(C2500.m7092(cls2, strArr4));
                                                    arrayList6 = arrayList13;
                                                    try {
                                                        arrayList6.add(next);
                                                        if (z && !z2) {
                                                            m7955(new RunnableC2999(next));
                                                        }
                                                        if (z2) {
                                                            StringBuilder sb5 = new StringBuilder();
                                                            sb5.append(next.f10047);
                                                            sb5.append(str8);
                                                            sb5.append(C2500.m7007(R.string.integrate_updates_result));
                                                            sb5.append(str7);
                                                            sb5.append(C2500.m7007(R.string.well_done));
                                                            str6 = str31;
                                                            try {
                                                                sb5.append(str6);
                                                                sb5.append(C2500.m7007(R.string.integrate_updates_result_message));
                                                                m7967(sb5.toString());
                                                            } catch (PackageManager.NameNotFoundException e3) {
                                                                e = e3;
                                                                cls = cls3;
                                                                arrayList3 = arrayList6;
                                                                str3 = str6;
                                                                nameNotFoundException = e;
                                                                nameNotFoundException.printStackTrace();
                                                                if (z) {
                                                                }
                                                                str26 = str3;
                                                                arrayList9 = arrayList3;
                                                                it2 = it;
                                                                arrayList10 = arrayList4;
                                                                str25 = str2;
                                                                cls3 = cls;
                                                            } catch (Exception e4) {
                                                                e = e4;
                                                                cls = cls3;
                                                                arrayList3 = arrayList6;
                                                                str3 = str6;
                                                                exc = e;
                                                                exc.printStackTrace();
                                                                str26 = str3;
                                                                arrayList9 = arrayList3;
                                                                it2 = it;
                                                                arrayList10 = arrayList4;
                                                                str25 = str2;
                                                                cls3 = cls;
                                                            }
                                                        } else {
                                                            str6 = str31;
                                                        }
                                                    } catch (PackageManager.NameNotFoundException e5) {
                                                        e = e5;
                                                        arrayList3 = arrayList6;
                                                        str3 = str31;
                                                        cls = cls3;
                                                        nameNotFoundException = e;
                                                        nameNotFoundException.printStackTrace();
                                                        if (z) {
                                                        }
                                                        str26 = str3;
                                                        arrayList9 = arrayList3;
                                                        it2 = it;
                                                        arrayList10 = arrayList4;
                                                        str25 = str2;
                                                        cls3 = cls;
                                                    } catch (Exception e6) {
                                                        e = e6;
                                                        arrayList3 = arrayList6;
                                                        str3 = str31;
                                                        cls = cls3;
                                                        exc = e;
                                                        exc.printStackTrace();
                                                        str26 = str3;
                                                        arrayList9 = arrayList3;
                                                        it2 = it;
                                                        arrayList10 = arrayList4;
                                                        str25 = str2;
                                                        cls3 = cls;
                                                    }
                                                } else {
                                                    str6 = str31;
                                                    arrayList6 = arrayList13;
                                                }
                                            }
                                            str7 = str32;
                                            str8 = str33;
                                            cls2 = cls4;
                                            z5 = false;
                                            if (z5) {
                                            }
                                        } else {
                                            str6 = str31;
                                            arrayList6 = arrayList13;
                                            m7942(C2500.m7092(cls3, str27, str5, str4, ((File) arrayList11.get(0)).getAbsolutePath(), "deleteBigLibs"));
                                            if (z2) {
                                                m7967(next.f10047 + str33 + C2500.m7007(R.string.integrate_updates_result) + str32 + C2500.m7007(R.string.no_space_in_system_all));
                                            } else {
                                                m7955(new RunnableC3001(next));
                                            }
                                        }
                                        cls = cls3;
                                        arrayList3 = arrayList6;
                                        str3 = str6;
                                    } catch (PackageManager.NameNotFoundException e7) {
                                        e = e7;
                                        str3 = str31;
                                        arrayList3 = arrayList13;
                                        cls = cls3;
                                        nameNotFoundException = e;
                                        nameNotFoundException.printStackTrace();
                                        if (z) {
                                        }
                                        str26 = str3;
                                        arrayList9 = arrayList3;
                                        it2 = it;
                                        arrayList10 = arrayList4;
                                        str25 = str2;
                                        cls3 = cls;
                                    } catch (Exception e8) {
                                        e = e8;
                                        str3 = str31;
                                        arrayList3 = arrayList13;
                                        cls = cls3;
                                        exc = e;
                                        exc.printStackTrace();
                                        str26 = str3;
                                        arrayList9 = arrayList3;
                                        it2 = it;
                                        arrayList10 = arrayList4;
                                        str25 = str2;
                                        cls3 = cls;
                                    }
                                } catch (PackageManager.NameNotFoundException e9) {
                                    e = e9;
                                    str3 = str31;
                                    arrayList3 = arrayList13;
                                } catch (Exception e10) {
                                    e = e10;
                                    str3 = str31;
                                    arrayList3 = arrayList13;
                                }
                            } else {
                                str6 = str31;
                                String str42 = str34;
                                String str43 = "chown 0.0 '";
                                arrayList6 = arrayList13;
                                String str44 = "chattr -ai '";
                                String str45 = "chown 0:0 '";
                                m7942("found more 1+ apks");
                                ArrayList<File> arrayList15 = new ArrayList<>();
                                cls = cls3;
                                try {
                                    if (C2500.m7047(next.f10046)) {
                                        try {
                                            arrayList15 = C2500.m7000(next.f10046);
                                        } catch (PackageManager.NameNotFoundException e11) {
                                            nameNotFoundException = e11;
                                            arrayList3 = arrayList6;
                                            str3 = str6;
                                            nameNotFoundException.printStackTrace();
                                            if (z) {
                                            }
                                            str26 = str3;
                                            arrayList9 = arrayList3;
                                            it2 = it;
                                            arrayList10 = arrayList4;
                                            str25 = str2;
                                            cls3 = cls;
                                        } catch (Exception e12) {
                                            exc = e12;
                                            arrayList3 = arrayList6;
                                            str3 = str6;
                                            exc.printStackTrace();
                                            str26 = str3;
                                            arrayList9 = arrayList3;
                                            it2 = it;
                                            arrayList10 = arrayList4;
                                            str25 = str2;
                                            cls3 = cls;
                                        }
                                    }
                                    arrayList15.add(new File(str4));
                                    try {
                                        String[] strArr5 = new String[3];
                                        try {
                                            strArr5[0] = str4;
                                            strArr5[1] = ((File) arrayList11.get(0)).getAbsolutePath();
                                            strArr5[2] = "false";
                                            m7942(C2500.m7092(C1626.class, strArr5));
                                            Iterator it9 = arrayList11.iterator();
                                            File file4 = null;
                                            z6 = false;
                                            z7 = false;
                                            z8 = false;
                                            while (it9.hasNext()) {
                                                try {
                                                    File file5 = (File) it9.next();
                                                    File m69422 = C2500.m6942(file5);
                                                    Iterator it10 = it9;
                                                    m7942(C2500.m7092(C1567.class, m69422.getAbsolutePath(), "rename"));
                                                    Iterator<File> it11 = arrayList15.iterator();
                                                    file4 = file4;
                                                    while (it11.hasNext()) {
                                                        File next3 = it11.next();
                                                        Iterator<File> it12 = it11;
                                                        StringBuilder sb6 = new StringBuilder();
                                                        File file6 = file4;
                                                        sb6.append(m69422.getAbsolutePath());
                                                        sb6.append(InternalZipConstants.ZIP_FILE_SEPARATOR);
                                                        sb6.append(next3.getName());
                                                        String sb7 = sb6.toString();
                                                        if (next3.getAbsolutePath().equals(str4)) {
                                                            sb7 = file5.getAbsolutePath();
                                                        }
                                                        boolean z9 = z6;
                                                        ArrayList<File> arrayList16 = arrayList15;
                                                        String m70922 = C2500.m7092(C1598.class, next3.getAbsolutePath(), sb7);
                                                        m7942(m70922);
                                                        if (m70922.contains("File copied!")) {
                                                            C2500.m7093("chmod 644 '" + sb7 + "'");
                                                            StringBuilder sb8 = new StringBuilder();
                                                            str18 = str43;
                                                            sb8.append(str18);
                                                            sb8.append(sb7);
                                                            sb8.append("'");
                                                            C2500.m7093(sb8.toString());
                                                            StringBuilder sb9 = new StringBuilder();
                                                            arrayList8 = arrayList11;
                                                            str19 = str45;
                                                            sb9.append(str19);
                                                            sb9.append(sb7);
                                                            sb9.append("'");
                                                            C2500.m7093(sb9.toString());
                                                            StringBuilder sb10 = new StringBuilder();
                                                            str20 = str27;
                                                            str21 = str44;
                                                            sb10.append(str21);
                                                            sb10.append(sb7);
                                                            sb10.append("'");
                                                            C2500.m7093(sb10.toString());
                                                            arrayList5.add(new File(sb7));
                                                            str22 = str4;
                                                            if (next3.getAbsolutePath().equals(str4)) {
                                                                file6 = file5;
                                                            }
                                                            z6 = true;
                                                        } else {
                                                            str18 = str43;
                                                            arrayList8 = arrayList11;
                                                            str19 = str45;
                                                            str20 = str27;
                                                            str21 = str44;
                                                            str22 = str4;
                                                            z6 = z9;
                                                        }
                                                        if (m70922.contains("Length of Files not equals. Destination deleted!")) {
                                                            Iterator it13 = arrayList5.iterator();
                                                            while (it13.hasNext()) {
                                                                C2500.m7093(str42 + ((File) it13.next()).getAbsolutePath() + "'");
                                                                it13 = it13;
                                                                str42 = str42;
                                                            }
                                                            str23 = str42;
                                                            m7942(C2500.m7092(C1567.class, m69422.getAbsolutePath(), "restore"));
                                                            if (z6) {
                                                                C2500.m7093("chmod 644 '" + sb7 + "'");
                                                                C2500.m7093(str18 + sb7 + "'");
                                                                C2500.m7093(str19 + sb7 + "'");
                                                                C2500.m7093(str21 + sb7 + "'");
                                                            } else if (z2) {
                                                                m7967(next.f10047 + str33 + C2500.m7007(R.string.integrate_updates_result) + str32 + C2500.m7007(R.string.no_space_in_system_all));
                                                            } else {
                                                                m7955(new RunnableC3002(next));
                                                            }
                                                            z8 = true;
                                                        } else {
                                                            str23 = str42;
                                                        }
                                                        if (m70922.contains("Backup not replace original!")) {
                                                            Iterator it14 = arrayList5.iterator();
                                                            while (it14.hasNext()) {
                                                                File file7 = (File) it14.next();
                                                                StringBuilder sb11 = new StringBuilder();
                                                                Iterator it15 = it14;
                                                                String str46 = str23;
                                                                sb11.append(str46);
                                                                sb11.append(file7.getAbsolutePath());
                                                                sb11.append("'");
                                                                C2500.m7093(sb11.toString());
                                                                str23 = str46;
                                                                it14 = it15;
                                                            }
                                                            str24 = str23;
                                                            m7942(C2500.m7092(C1567.class, m69422.getAbsolutePath(), "restore"));
                                                            if (z6) {
                                                                C2500.m7093("chmod 644 '" + sb7 + "'");
                                                                C2500.m7093(str18 + sb7 + "'");
                                                                C2500.m7093(str19 + sb7 + "'");
                                                                C2500.m7093(str21 + sb7 + "'");
                                                            } else if (z2) {
                                                                m7967(next.f10047 + str33 + C2500.m7007(R.string.integrate_updates_result) + str32 + C2500.m7007(R.string.unknown_error));
                                                            } else {
                                                                m7955(new RunnableC3003(next));
                                                            }
                                                            z7 = true;
                                                        } else {
                                                            str24 = str23;
                                                        }
                                                        str42 = str24;
                                                        str4 = str22;
                                                        it11 = it12;
                                                        file4 = file6;
                                                        str44 = str21;
                                                        str27 = str20;
                                                        str45 = str19;
                                                        arrayList11 = arrayList8;
                                                        str43 = str18;
                                                        arrayList15 = arrayList16;
                                                    }
                                                    ArrayList<File> arrayList17 = arrayList15;
                                                    str27 = str27;
                                                    it9 = it10;
                                                    str45 = str45;
                                                    arrayList11 = arrayList11;
                                                    str43 = str43;
                                                    arrayList15 = arrayList17;
                                                } catch (PackageManager.NameNotFoundException e13) {
                                                    nameNotFoundException = e13;
                                                    str3 = str6;
                                                    arrayList3 = arrayList6;
                                                    nameNotFoundException.printStackTrace();
                                                    if (z) {
                                                    }
                                                    str26 = str3;
                                                    arrayList9 = arrayList3;
                                                    it2 = it;
                                                    arrayList10 = arrayList4;
                                                    str25 = str2;
                                                    cls3 = cls;
                                                } catch (Exception e14) {
                                                    exc = e14;
                                                    str3 = str6;
                                                    arrayList3 = arrayList6;
                                                    exc.printStackTrace();
                                                    str26 = str3;
                                                    arrayList9 = arrayList3;
                                                    it2 = it;
                                                    arrayList10 = arrayList4;
                                                    str25 = str2;
                                                    cls3 = cls;
                                                }
                                            }
                                            file = file4;
                                            str11 = str42;
                                            str12 = str43;
                                            arrayList7 = arrayList11;
                                            str13 = str45;
                                            str14 = str27;
                                            str15 = str44;
                                        } catch (PackageManager.NameNotFoundException e15) {
                                            e = e15;
                                            str3 = str6;
                                            arrayList3 = arrayList6;
                                        } catch (Exception e16) {
                                            e = e16;
                                            str3 = str6;
                                            arrayList3 = arrayList6;
                                        }
                                    } catch (PackageManager.NameNotFoundException e17) {
                                        e = e17;
                                        str3 = str6;
                                        arrayList3 = arrayList6;
                                    } catch (Exception e18) {
                                        e = e18;
                                        str3 = str6;
                                        arrayList3 = arrayList6;
                                    }
                                } catch (PackageManager.NameNotFoundException e19) {
                                    e = e19;
                                    arrayList3 = arrayList6;
                                    str3 = str6;
                                    nameNotFoundException = e;
                                    nameNotFoundException.printStackTrace();
                                    if (z) {
                                    }
                                    str26 = str3;
                                    arrayList9 = arrayList3;
                                    it2 = it;
                                    arrayList10 = arrayList4;
                                    str25 = str2;
                                    cls3 = cls;
                                } catch (Exception e20) {
                                    e = e20;
                                    arrayList3 = arrayList6;
                                    str3 = str6;
                                    exc = e;
                                    exc.printStackTrace();
                                    str26 = str3;
                                    arrayList9 = arrayList3;
                                    it2 = it;
                                    arrayList10 = arrayList4;
                                    str25 = str2;
                                    cls3 = cls;
                                }
                                if (z6 && !z7 && !z8) {
                                    try {
                                        m7942(1);
                                        str16 = str2;
                                        try {
                                            new C2500(str16).m7211("pm uninstall -k " + str14);
                                            str17 = m7932().getPackageInfo(str14, 0).applicationInfo.sourceDir;
                                            m7942("appapk:" + str17);
                                            Iterator it16 = arrayList7.iterator();
                                            while (it16.hasNext()) {
                                                try {
                                                    File file8 = (File) it16.next();
                                                    m7942(file8.getAbsolutePath());
                                                    if (!file8.getAbsolutePath().equals(str17)) {
                                                        m7942(C2500.m7092(C1623.class, C2500.m6942(file8).getAbsolutePath()));
                                                    }
                                                } catch (PackageManager.NameNotFoundException e21) {
                                                    nameNotFoundException = e21;
                                                    str2 = str16;
                                                    str3 = str6;
                                                    arrayList3 = arrayList6;
                                                    nameNotFoundException.printStackTrace();
                                                    if (z) {
                                                    }
                                                    str26 = str3;
                                                    arrayList9 = arrayList3;
                                                    it2 = it;
                                                    arrayList10 = arrayList4;
                                                    str25 = str2;
                                                    cls3 = cls;
                                                } catch (Exception e22) {
                                                    exc = e22;
                                                    str2 = str16;
                                                    str3 = str6;
                                                    arrayList3 = arrayList6;
                                                    exc.printStackTrace();
                                                    str26 = str3;
                                                    arrayList9 = arrayList3;
                                                    it2 = it;
                                                    arrayList10 = arrayList4;
                                                    str25 = str2;
                                                    cls3 = cls;
                                                }
                                            }
                                            strArr = new String[2];
                                        } catch (PackageManager.NameNotFoundException e23) {
                                            e = e23;
                                            arrayList3 = arrayList6;
                                        } catch (Exception e24) {
                                            e = e24;
                                            arrayList3 = arrayList6;
                                        }
                                        try {
                                            strArr[0] = C2500.m6942(new File(str17)).getAbsolutePath();
                                            strArr[1] = "delete";
                                            m7942(C2500.m7092(C1567.class, strArr));
                                            arrayList3 = arrayList6;
                                            try {
                                                arrayList3.add(next);
                                                if (z && !z2) {
                                                    m7955(new RunnableC3004(next));
                                                }
                                                if (z2) {
                                                    m7967(next.f10047 + str33 + C2500.m7007(R.string.integrate_updates_result) + str32 + C2500.m7007(R.string.well_done));
                                                }
                                            } catch (PackageManager.NameNotFoundException e25) {
                                                e = e25;
                                                nameNotFoundException = e;
                                                str2 = str16;
                                                str3 = str6;
                                                nameNotFoundException.printStackTrace();
                                                if (z) {
                                                }
                                                str26 = str3;
                                                arrayList9 = arrayList3;
                                                it2 = it;
                                                arrayList10 = arrayList4;
                                                str25 = str2;
                                                cls3 = cls;
                                            } catch (Exception e26) {
                                                e = e26;
                                                exc = e;
                                                str2 = str16;
                                                str3 = str6;
                                                exc.printStackTrace();
                                                str26 = str3;
                                                arrayList9 = arrayList3;
                                                it2 = it;
                                                arrayList10 = arrayList4;
                                                str25 = str2;
                                                cls3 = cls;
                                            }
                                        } catch (PackageManager.NameNotFoundException e27) {
                                            arrayList3 = arrayList6;
                                            nameNotFoundException = e27;
                                            str2 = str16;
                                            str3 = str6;
                                            nameNotFoundException.printStackTrace();
                                            if (z) {
                                            }
                                            str26 = str3;
                                            arrayList9 = arrayList3;
                                            it2 = it;
                                            arrayList10 = arrayList4;
                                            str25 = str2;
                                            cls3 = cls;
                                        } catch (Exception e28) {
                                            arrayList3 = arrayList6;
                                            exc = e28;
                                            str2 = str16;
                                            str3 = str6;
                                            exc.printStackTrace();
                                            str26 = str3;
                                            arrayList9 = arrayList3;
                                            it2 = it;
                                            arrayList10 = arrayList4;
                                            str25 = str2;
                                            cls3 = cls;
                                        }
                                    } catch (PackageManager.NameNotFoundException e29) {
                                        e = e29;
                                        arrayList3 = arrayList6;
                                        nameNotFoundException = e;
                                        str3 = str6;
                                        nameNotFoundException.printStackTrace();
                                        if (z) {
                                        }
                                        str26 = str3;
                                        arrayList9 = arrayList3;
                                        it2 = it;
                                        arrayList10 = arrayList4;
                                        str25 = str2;
                                        cls3 = cls;
                                    } catch (Exception e30) {
                                        e = e30;
                                        arrayList3 = arrayList6;
                                        exc = e;
                                        str3 = str6;
                                        exc.printStackTrace();
                                        str26 = str3;
                                        arrayList9 = arrayList3;
                                        it2 = it;
                                        arrayList10 = arrayList4;
                                        str25 = str2;
                                        cls3 = cls;
                                    }
                                } else {
                                    str16 = str2;
                                    arrayList3 = arrayList6;
                                    try {
                                        m7942(2);
                                    } catch (PackageManager.NameNotFoundException e31) {
                                        e = e31;
                                        str2 = str16;
                                    } catch (Exception e32) {
                                        e = e32;
                                        str2 = str16;
                                    }
                                    if (z6) {
                                        m7942(3);
                                        str2 = str16;
                                        try {
                                            new C2500(str16).m7211("pm uninstall -k " + str14);
                                            String str47 = m7932().getPackageInfo(str14, 0).applicationInfo.sourceDir;
                                            if (file.getAbsolutePath().equals(str47)) {
                                                try {
                                                    Iterator it17 = arrayList7.iterator();
                                                    while (it17.hasNext()) {
                                                        File file9 = (File) it17.next();
                                                        if (!file9.getAbsolutePath().equals(str47)) {
                                                            m7942(C2500.m7092(C1623.class, C2500.m6942(file9).getAbsolutePath()));
                                                        }
                                                    }
                                                } catch (PackageManager.NameNotFoundException e33) {
                                                    e = e33;
                                                    nameNotFoundException = e;
                                                    str3 = str6;
                                                    nameNotFoundException.printStackTrace();
                                                    if (z) {
                                                    }
                                                    str26 = str3;
                                                    arrayList9 = arrayList3;
                                                    it2 = it;
                                                    arrayList10 = arrayList4;
                                                    str25 = str2;
                                                    cls3 = cls;
                                                } catch (Exception e34) {
                                                    e = e34;
                                                    exc = e;
                                                    str3 = str6;
                                                    exc.printStackTrace();
                                                    str26 = str3;
                                                    arrayList9 = arrayList3;
                                                    it2 = it;
                                                    arrayList10 = arrayList4;
                                                    str25 = str2;
                                                    cls3 = cls;
                                                }
                                            } else {
                                                C2500.m7093(str11 + str47 + "'");
                                                m7942(C2500.m7092(C1565.class, file.getAbsolutePath(), str47));
                                                C2500.m7093("chmod 644 '" + str47 + "'");
                                                C2500.m7093(str12 + str47 + "'");
                                                C2500.m7093(str13 + str47 + "'");
                                                C2500.m7093(str15 + str47 + "'");
                                                Iterator it18 = arrayList7.iterator();
                                                while (it18.hasNext()) {
                                                    File file10 = (File) it18.next();
                                                    if (!file10.getAbsolutePath().equals(str47)) {
                                                        m7942(C2500.m7092(C1623.class, C2500.m6942(file10).getAbsolutePath()));
                                                    }
                                                }
                                            }
                                            String[] strArr6 = new String[2];
                                            try {
                                                strArr6[0] = C2500.m6942(new File(str47)).getAbsolutePath();
                                                strArr6[1] = "delete";
                                                m7942(C2500.m7092(C1567.class, strArr6));
                                                arrayList3.add(next);
                                                if (z && !z2) {
                                                    try {
                                                        m7955(new RunnableC3005(next));
                                                    } catch (PackageManager.NameNotFoundException e35) {
                                                        nameNotFoundException = e35;
                                                        str3 = str6;
                                                        nameNotFoundException.printStackTrace();
                                                        if (z) {
                                                        }
                                                        str26 = str3;
                                                        arrayList9 = arrayList3;
                                                        it2 = it;
                                                        arrayList10 = arrayList4;
                                                        str25 = str2;
                                                        cls3 = cls;
                                                    } catch (Exception e36) {
                                                        exc = e36;
                                                        str3 = str6;
                                                        exc.printStackTrace();
                                                        str26 = str3;
                                                        arrayList9 = arrayList3;
                                                        it2 = it;
                                                        arrayList10 = arrayList4;
                                                        str25 = str2;
                                                        cls3 = cls;
                                                    }
                                                }
                                                if (z2) {
                                                    StringBuilder sb12 = new StringBuilder();
                                                    sb12.append(next.f10047);
                                                    sb12.append(str33);
                                                    sb12.append(C2500.m7007(R.string.integrate_updates_result));
                                                    sb12.append(str32);
                                                    sb12.append(C2500.m7007(R.string.well_done));
                                                    str3 = str6;
                                                    try {
                                                        sb12.append(str3);
                                                        sb12.append(C2500.m7007(R.string.integrate_updates_result_message));
                                                        m7967(sb12.toString());
                                                    } catch (PackageManager.NameNotFoundException e37) {
                                                        e = e37;
                                                        nameNotFoundException = e;
                                                        nameNotFoundException.printStackTrace();
                                                        if (z) {
                                                        }
                                                        str26 = str3;
                                                        arrayList9 = arrayList3;
                                                        it2 = it;
                                                        arrayList10 = arrayList4;
                                                        str25 = str2;
                                                        cls3 = cls;
                                                    }
                                                } else {
                                                    str3 = str6;
                                                }
                                            } catch (PackageManager.NameNotFoundException e38) {
                                                e = e38;
                                                str3 = str6;
                                            } catch (Exception e39) {
                                                e = e39;
                                                str3 = str6;
                                                exc = e;
                                                exc.printStackTrace();
                                                str26 = str3;
                                                arrayList9 = arrayList3;
                                                it2 = it;
                                                arrayList10 = arrayList4;
                                                str25 = str2;
                                                cls3 = cls;
                                            }
                                        } catch (PackageManager.NameNotFoundException e40) {
                                            e = e40;
                                            str3 = str6;
                                            nameNotFoundException = e;
                                            nameNotFoundException.printStackTrace();
                                            if (z) {
                                            }
                                            str26 = str3;
                                            arrayList9 = arrayList3;
                                            it2 = it;
                                            arrayList10 = arrayList4;
                                            str25 = str2;
                                            cls3 = cls;
                                        } catch (Exception e41) {
                                            e = e41;
                                            str3 = str6;
                                            exc = e;
                                            exc.printStackTrace();
                                            str26 = str3;
                                            arrayList9 = arrayList3;
                                            it2 = it;
                                            arrayList10 = arrayList4;
                                            str25 = str2;
                                            cls3 = cls;
                                        }
                                        if (z) {
                                            m7955(new RunnableC3006());
                                        }
                                    }
                                }
                                str2 = str16;
                                str3 = str6;
                            }
                            if (z) {
                            }
                        }
                        cls = cls3;
                        arrayList3 = arrayList9;
                        arrayList4 = arrayList10;
                        str2 = str25;
                        str3 = str26;
                        it = it2;
                        if (z) {
                        }
                    } else {
                        cls = cls3;
                        arrayList3 = arrayList9;
                        arrayList4 = arrayList10;
                        str2 = str25;
                        str3 = str26;
                        it = it2;
                    }
                } catch (Exception e42) {
                    e = e42;
                    cls = cls3;
                    arrayList3 = arrayList9;
                    arrayList4 = arrayList10;
                    str2 = str25;
                    str3 = str26;
                    it = it2;
                }
                str26 = str3;
                arrayList9 = arrayList3;
                it2 = it;
                arrayList10 = arrayList4;
                str25 = str2;
                cls3 = cls;
            }
        }
        ArrayList arrayList18 = arrayList9;
        ArrayList arrayList19 = arrayList10;
        String str48 = str25;
        String str49 = str26;
        if (arrayList.size() > 0 && !z2 && z3) {
            Iterator<C3478> it19 = arrayList.iterator();
            while (it19.hasNext()) {
                C3478 next4 = it19.next();
                Iterator it20 = arrayList18.iterator();
                while (true) {
                    if (it20.hasNext()) {
                        if (next4.m8107((C3478) it20.next())) {
                            z4 = true;
                            break;
                        }
                    } else {
                        z4 = false;
                        break;
                    }
                }
                if (!z4) {
                    arrayList2 = arrayList19;
                    arrayList2.add(next4);
                } else {
                    arrayList2 = arrayList19;
                }
                arrayList19 = arrayList2;
            }
            ArrayList arrayList20 = arrayList19;
            if (arrayList20.size() > 0) {
                String str50 = str48 + C2500.m7007(R.string.failed_group) + str49;
                for (int i = 0; i < arrayList20.size(); i++) {
                    if (i == arrayList20.size() - 1) {
                        str50 = str50 + ((C3478) arrayList20.get(i)).f10047 + ".";
                    } else {
                        str50 = str50 + ((C3478) arrayList20.get(i)).f10047 + ", ";
                    }
                }
                str = str50 + "\n\n";
            } else {
                str = str48;
            }
            if (arrayList18.size() > 0) {
                String str51 = str + C2500.m7007(R.string.well_done_group) + str49;
                for (int i2 = 0; i2 < arrayList18.size(); i2++) {
                    if (i2 == arrayList18.size() - 1) {
                        str51 = str51 + ((C3478) arrayList18.get(i2)).f10047 + ".";
                    } else {
                        str51 = str51 + ((C3478) arrayList18.get(i2)).f10047 + ", ";
                    }
                }
                str = str51 + "\n\n";
            }
            m7955(new RunnableC3009(str + C2500.m7007(R.string.integrate_updates_result_message) + str49 + C2500.m7007(R.string.message_to_reboot_device)));
        }
        if (z && !z2) {
            m7955(new RunnableC3011());
        }
    }

    public static void m7942(Object obj) {
        try {
            if (f9344 == null) {
                f9344 = Boolean.FALSE;
            }
            Boolean bool = f9323;
            if (bool != null && bool.booleanValue()) {
                System.out.println(obj);
                return;
            }
            if (f9242 != null && f9347 == null) {
                f9347 = Boolean.valueOf(m7928().getBoolean("showLog", false));
            }
            f9347 = Boolean.TRUE;
            Boolean bool2 = f9323;
            if (bool2 == null || ((!bool2.booleanValue() && f9347.booleanValue()) || (!f9323.booleanValue() && f9344.booleanValue()))) {
                System.out.println("LP:" + obj);
            }
        } catch (Throwable th) {
            th.printStackTrace();
            System.out.println(obj);
        }
    }

    public boolean m7943(Object obj) {
        if (!obj.toString().equals("") && obj.toString().matches("\\d*")) {
            try {
                Integer.valueOf(obj.toString());
                return true;
            } catch (NumberFormatException unused) {
                m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.is_an_invalid_number));
                return false;
            }
        }
        m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.is_an_invalid_number));
        return false;
    }

    public static void m7944(int i, int i2, Intent intent) {
        C2975 c2975;
        boolean canRequestPackageInstalls;
        boolean canRequestPackageInstalls2;
        m7942("requestCode:" + i + " resultCode:" + i2);
        try {
            if (i == f9390) {
                m7954(new RunnableC3399());
            }
            if (i == f9391) {
                if (i2 == -1) {
                    if (f9389 != null) {
                        C2500.m7121(C2500.m7007(R.string.well_done), C2500.m7007(R.string.app_install_success), C2500.m7007(R.string.launchbutton), new DialogInterfaceOnClickListenerC3418(), C2500.m7007(R.string.ok), null, null);
                    } else {
                        m7962(C2500.m7007(R.string.well_done), C2500.m7007(R.string.app_install_success));
                    }
                } else if (i2 == 1) {
                    m7962(C2500.m7007(R.string.well_done), C2500.m7007(R.string.installer_error_generic));
                }
            }
            if (i == f9400) {
                m7942("resultCodeLP:" + i2);
                if (f9411.equals("") || !f9411.equals(PkgName.getPkgName())) {
                    C2500.m7140(f9411);
                    if (i2 == -1) {
                        m7962(C2500.m7007(R.string.well_done), C2500.m7007(R.string.app_install_success));
                    } else if (i2 != 1) {
                        if (i2 == 0) {
                            if (f9299 >= 28) {
                                canRequestPackageInstalls2 = m7932().canRequestPackageInstalls();
                                if (!canRequestPackageInstalls2) {
                                    f9259.startActivityForResult(new Intent("android.settings.MANAGE_UNKNOWN_APP_SOURCES", Uri.parse("package:" + PkgName.getPkgName())), f9400);
                                }
                            }
                        } else if (f9299 >= 28) {
                            canRequestPackageInstalls = m7932().canRequestPackageInstalls();
                            if (!canRequestPackageInstalls) {
                                f9259.startActivityForResult(new Intent("android.settings.MANAGE_UNKNOWN_APP_SOURCES", Uri.parse("package:" + PkgName.getPkgName())), f9400);
                            }
                        }
                    }
                    f9245.mo1874().finish();
                }
            }
            if (i == f9399 && (c2975 = f9245) != null) {
                c2975.m8079();
            }
            if (i == f9398) {
                System.exit(0);
                f9259.finish();
            }
            if (i == f9397) {
                m7956(new RunnableC3421());
            }
            if (i == f9393) {
                C2500.m7064(1000);
                C2500.m7023(f9259, f9389.f9156, Integer.valueOf(f9395));
                f9389 = null;
            }
            if (i == f9392) {
                C2500.m7023(f9259, f9389.f9156, Integer.valueOf(f9394));
                f9389 = null;
            }
            if (i == f9396 && f9245 != null) {
                m7954(new RunnableC3449());
            }
            if (i == f9395) {
                Context m7929 = m7929();
                String str = f9237;
                C2500.m7145(m7929, str, str);
                if (f9245 != null) {
                    m7954(new RunnableC3453());
                }
            }
        } catch (Throwable th) {
            th.printStackTrace();
        }
    }

    public static byte[] m7945(File file, String str, String str2) throws IOException {
        C2415 m6550 = C2415.m6550(new FileInputStream(file));
        ArrayList arrayList = new ArrayList(m6550.f6728.m6545());
        m6550.f6728.m6547(arrayList);
        for (int i = 0; i < arrayList.size(); i++) {
            if (((String) arrayList.get(i)).equals(str)) {
                arrayList.set(i, str2);
            }
        }
        m6550.m6554(arrayList, new FileOutputStream(file));
        return null;
    }

    public static void m7946(TextView textView, String str, C2597 c2597) {
        boolean z;
        boolean z2;
        boolean z3;
        String str2;
        String str3;
        float f;
        String str4;
        String str5;
        String str6;
        textView.setTextAppearance(f9245.mo1874(), m7934());
        String str7 = "#9999cc";
        char c = '-';
        String str8 = ":";
        String str9 = "\n\n";
        if (c2597.f7309 || c2597.f7305 || c2597.f7311 || c2597.f7321 || c2597.f7325 || c2597.f7313) {
            String str10 = str;
            boolean z4 = true;
            while (z4) {
                if (c2597.f7313 || c2597.f7309 || c2597.f7305 || c2597.f7311) {
                    if (c2597.f7316.equals("")) {
                        z = false;
                        z2 = false;
                    } else {
                        str10 = c2597.f7316;
                        c2597.f7316 = "";
                        String str11 = C2500.m7007(R.string.contextcustompatch) + str8;
                        char[] cArr = new char[str11.length() + 10];
                        Arrays.fill(cArr, c);
                        textView.append(C2500.m6934("\n" + str11 + "\n" + new String(cArr) + str9, str7, "bold"));
                        z = true;
                        z2 = true;
                    }
                    if (!c2597.f7334.equals("") && !z) {
                        str10 = c2597.f7334;
                        c2597.f7334 = "";
                        String str12 = C2500.m7007(R.string.context_support_patch) + str8;
                        char[] cArr2 = new char[str12.length() + 10];
                        Arrays.fill(cArr2, c);
                        textView.append(C2500.m6934("\n" + str12 + "\n" + new String(cArr2) + "\n", str7, "bold"));
                        z = true;
                    }
                    if (!c2597.f7314.equals("") && !z) {
                        String str13 = c2597.f7314;
                        c2597.f7314 = "";
                        String str14 = C2500.m7007(R.string.contextads) + str8;
                        char[] cArr3 = new char[str14.length() + 10];
                        Arrays.fill(cArr3, '-');
                        textView.append(C2500.m6934("\n" + str14 + "\n" + new String(cArr3) + "\n", str7, "bold"));
                        str10 = str13;
                        z = true;
                    }
                    if (!c2597.f7312.equals("") && !z) {
                        str10 = c2597.f7312;
                        c2597.f7312 = "";
                        String str15 = C2500.m7007(R.string.contextignore) + str8;
                        char[] cArr4 = new char[str15.length() + 10];
                        Arrays.fill(cArr4, '-');
                        textView.append(C2500.m6934("\n" + str15 + "\n" + new String(cArr4) + "\n", str7, "bold"));
                    }
                } else {
                    z4 = false;
                    z2 = false;
                }
                if (z2) {
                    if (str10 == null) {
                        str10 = " ";
                    }
                    if (!str10.contains("SU Java-Code Running!")) {
                        str10 = C2500.m7007(R.string.bad_root_detected);
                    }
                    if (str10.contains("Custom Patch not Found. Put info about SuperSu.")) {
                        textView.setText(C2500.m6934(C2500.m7007(R.string.custom_patch_warning), "#ffff0055", "bold"));
                    }
                    String replaceAll = str10.replaceAll("SU Java-Code Running! javaroot.utils.custompatch\n", "");
                    String[] split = replaceAll.split(C2500.m7007(R.string.custom_patch_log_next_custom_patch) + str8);
                    z3 = z4;
                    if (split.length > 0) {
                        int length = split.length;
                        int i = 0;
                        int i2 = 0;
                        while (i < length) {
                            int i3 = length;
                            String str16 = split[i];
                            String str17 = str7;
                            int i4 = i2 + 1;
                            if (str16.contains("Error LP:") || str16.contains("Object not found!")) {
                                str5 = str8;
                            } else {
                                str5 = str8;
                                textView.append(C2500.m6934(str16, "#ff00ff73", "bold"));
                            }
                            if (str16.contains("Error LP:") || str16.contains("Object not found!")) {
                                textView.append(C2500.m6934(str16, "#ffff0055", "bold"));
                            }
                            if (split.length > 1 && i4 != split.length) {
                                textView.append(C2500.m6934("-----------" + C2500.m7007(R.string.custom_patch_log_next_custom_patch) + "------------", "#ffaaaaaa", "bold"));
                            }
                            i++;
                            str8 = str5;
                            length = i3;
                            i2 = i4;
                            str7 = str17;
                        }
                        str2 = str7;
                        str3 = str8;
                    } else {
                        str2 = str7;
                        str3 = str8;
                        if (!replaceAll.contains("Error LP:") && !replaceAll.contains("Object not found!")) {
                            textView.append(C2500.m6934(replaceAll, "#ff00ff73", "bold"));
                        }
                        if (replaceAll.contains("Error LP:") || replaceAll.contains("Object not found!")) {
                            textView.append(C2500.m6934(replaceAll, "#ffff0055", "bold"));
                        }
                    }
                    str10 = str;
                } else {
                    z3 = z4;
                    str2 = str7;
                    str3 = str8;
                    if (str10 != null) {
                        if (c2597.f7295) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern_integrate_emulation) + "\n", "#ff00ff73", "bold"));
                            f = 1.0f;
                        } else {
                            f = 0.0f;
                        }
                        if (c2597.f7291) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern_signature_kill) + "\n", "#ff00ff73", "bold"));
                            f += 1.0f;
                        }
                        if (c2597.f7293) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern_dex_kill) + "\n", "#ff00ff73", "bold"));
                            f += 1.0f;
                        }
                        if (c2597.f7297) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern_lic_kill) + "\n", "#ff00ff73", "bold"));
                            f += 1.0f;
                        }
                        if (str10.contains("com.android.vending dependencies removed\n")) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.patterndependencies) + "\n", "#ff00ff73", "bold"));
                            f += 1.0f;
                        }
                        if (str10.contains("amazon patch N1!\n") && !str10.contains("runpatchads")) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.patternamazon) + "\n", "#ff00ff73", "bold"));
                            f += 1.0f;
                        }
                        if (str10.contains("samsung patch N") && !str10.contains("runpatchads")) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.patternsamsung) + "\n", "#ff00ff73", "bold"));
                            f += 1.0f;
                        }
                        if (str10.contains("Site from AdsBlockList blocked!")) {
                            int i5 = 0;
                            while (Pattern.compile("Site from AdsBlockList blocked!").matcher(str10).find()) {
                                i5++;
                            }
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.site_pattern) + " (" + i5 + ") \n", "#ff00ff73", "bold"));
                            f += 1.0f;
                        }
                        if (str10.contains("ads1 Fixed!\n") || str10.contains("support1 Fixed!")) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern1) + "\n", "#ff00ff73", "bold"));
                            f += 1.0f;
                        }
                        if (str10.contains("ads2 Fixed!\n") || str10.contains("support2 Fixed!")) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern2) + "\n", "#ff00ff73", "bold"));
                            f += 1.0f;
                        }
                        if (str10.contains("ads3 Fixed!\n") || str10.contains("support3 Fixed!")) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern3) + "\n", "#ff00ff73", "bold"));
                            f += 1.0f;
                        }
                        if (str10.contains("ads4 Fixed!\n") || str10.contains("support4 Fixed!")) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern4) + "\n", "#ff00ff73", "bold"));
                            f += 1.0f;
                        }
                        if (str10.contains("ads5 Fixed!\n") || str10.contains("support5 Fixed!")) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern5) + "\n", "#ff00ff73", "bold"));
                            f += 1.0f;
                        }
                        if (str10.contains("ads6 Fixed!\n")) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern6) + "\n", "#ff00ff73", "bold"));
                            f += 1.0f;
                        }
                        if (str10.contains("lvl patch N1!\n")) {
                            int i6 = 0;
                            while (Pattern.compile("lvl patch N1!\n").matcher(str10).find()) {
                                i6++;
                            }
                            StringBuilder sb = new StringBuilder();
                            sb.append("\n");
                            str4 = str9;
                            sb.append(C2500.m7007(R.string.pattern1));
                            sb.append(" (");
                            sb.append(i6);
                            sb.append(")\n");
                            textView.append(C2500.m6934(sb.toString(), "#ff00ff73", "bold"));
                            f += 1.0f;
                        } else {
                            str4 = str9;
                        }
                        if (str10.contains("lvl patch N2!\n")) {
                            int i7 = 0;
                            while (Pattern.compile("lvl patch N2!\n").matcher(str10).find()) {
                                i7++;
                            }
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern2) + " (" + i7 + ")\n", "#ff00ff73", "bold"));
                            f += 1.0f;
                        }
                        if (str10.contains("lvl patch N3!\n")) {
                            int i8 = 0;
                            while (Pattern.compile("lvl patch N3!\n").matcher(str10).find()) {
                                i8++;
                            }
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern3) + " (" + i8 + ")\n", "#ff00ff73", "bold"));
                            f += 1.0f;
                        }
                        if (str10.contains("lvl patch N4!\n")) {
                            int i9 = 0;
                            while (Pattern.compile("lvl patch N4!\n").matcher(str10).find()) {
                                i9++;
                            }
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern4) + " (" + i9 + ")\n", "#ff00ff73", "bold"));
                            f += 1.0f;
                        }
                        if (str10.contains("lvl patch N5!\n")) {
                            int i10 = 0;
                            while (Pattern.compile("lvl patch N5!\n").matcher(str10).find()) {
                                i10++;
                            }
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern5) + " (" + i10 + ")\n", "#ff00ff73", "bold"));
                            f += 1.0f;
                        }
                        if (str10.contains("lvl patch N6!\n")) {
                            int i11 = 0;
                            while (Pattern.compile("lvl patch N6!\n").matcher(str10).find()) {
                                i11++;
                            }
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern6) + " (" + i11 + ")\n", "#ff00ff73", "bold"));
                            f += 1.0f;
                        }
                        if (str10.contains("lvl patch N7!\n")) {
                            int i12 = 0;
                            while (Pattern.compile("lvl patch N7!\n").matcher(str10).find()) {
                                i12++;
                            }
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern7) + " (" + i12 + ")\n", "#ff00ff73", "bold"));
                            f += 1.0f;
                        }
                        if (!str10.contains("amazon patch N1!\n") && !str10.contains("runpatchads") && !str10.contains("runpatchsupport")) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.patternamazon_f) + "\n", "#ffff0055", "bold"));
                        }
                        if (!str10.contains("samsung patch N") && !str10.contains("runpatchads") && !str10.contains("runpatchsupport")) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.patternsamsung_f) + "\n", "#ffff0055", "bold"));
                        }
                        if (!str10.contains("lvl patch N1!\n") && !str10.contains("ads1 Fixed!\n") && !str10.contains("support1 Fixed!")) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern1_f) + "\n", "#ffff0055", "bold"));
                        }
                        if (!str10.contains("lvl patch N2!\n") && !str10.contains("ads2 Fixed!\n") && !str10.contains("support2 Fixed!")) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern2_f) + "\n", "#ffff0055", "bold"));
                        }
                        if (!str10.contains("lvl patch N3!\n") && !str10.contains("ads3 Fixed!\n") && !str10.contains("support3 Fixed!")) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern3_f) + "\n", "#ffff0055", "bold"));
                        }
                        if (!str10.contains("lvl patch N4!\n") && !str10.contains("ads4 Fixed!\n") && !str10.contains("support4 Fixed!")) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern4_f) + "\n", "#ffff0055", "bold"));
                        }
                        if (!str10.contains("lvl patch N5!\n") && !str10.contains("runpatchads") && !str10.contains("support5 Fixed!")) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern5_f) + "\n", "#ffff0055", "bold"));
                        }
                        if (!str10.contains("lvl patch N6!\n") && !str10.contains("runpatchads") && !str10.contains("runpatchsupport")) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern6_f) + "\n", "#ffff0055", "bold"));
                        }
                        if (!str10.contains("lvl patch N7!\n") && !str10.contains("runpatchads") && !str10.contains("runpatchsupport")) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.pattern7_f) + "\n", "#ffff0055", "bold"));
                        }
                        if (str10.contains("Error: Program files are not found!")) {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.P_not_found) + "\n", "#ffff0055", "bold"));
                        }
                        if (!c2597.f7342) {
                            if (!c2597.f7343.contains("Error:") && !c2597.f7343.contains("Fixed") && !c2597.f7343.contains("Failed") && !c2597.f7343.contains("ads") && !c2597.f7343.contains("lvl patch") && !c2597.f7343.contains("SU Java-Code Running!")) {
                                textView.setText(C2500.m6934("\n" + C2500.m7007(R.string.no_root) + "\n", "#ff00ffff", "bold"));
                            } else {
                                float round = Math.round((f / 7.0f) * 100.0f) - 1;
                                String str18 = "\n" + C2500.m7007(R.string.have_luck) + " " + round + C2500.m7007(R.string.goodresult) + "\n";
                                if (round < 0.0f) {
                                    str18 = "\n" + C2500.m7007(R.string.have_luck) + " 0.0" + C2500.m7007(R.string.poorresult) + "\n";
                                }
                                textView.append(C2500.m6934(str18, "#fff0e442", "bold"));
                            }
                        } else {
                            textView.append(C2500.m6934("\n" + C2500.m7007(R.string.line) + "\n", "#fff0e442", "bold"));
                        }
                        z4 = (!c2597.f7316.equals("") && c2597.f7334.equals("") && c2597.f7314.equals("") && c2597.f7312.equals("")) ? false : z3;
                        str8 = str3;
                        str7 = str2;
                        str9 = str4;
                        c = '-';
                    }
                }
                str4 = str9;
                if (!c2597.f7316.equals("")) {
                }
                str8 = str3;
                str7 = str2;
                str9 = str4;
                c = '-';
            }
        }
        String str19 = str7;
        String str20 = str8;
        String str21 = str9;
        if (c2597.f7315) {
            StringBuilder sb2 = new StringBuilder();
            sb2.append(C2500.m7007(R.string.createdialog1_clone));
            sb2.append(" ");
            sb2.append(c2597.f7347);
            sb2.append(" ");
            sb2.append(C2500.m7007(R.string.createdialog2));
            sb2.append("\n");
            sb2.append(C2500.m6942(c2597.f7340));
            str6 = str21;
            sb2.append(str6);
            sb2.append(C2500.m7007(R.string.createdialog5));
            sb2.append("\n");
            sb2.append(c2597.f7340.getName());
            sb2.append(str6);
            sb2.append(C2500.m7007(R.string.createdialog3_clone));
            textView.setText(C2500.m6934(sb2.toString(), "#ff00ff73", "bold"));
        } else {
            str6 = str21;
        }
        if (c2597.f7323) {
            if (c2597.f7302) {
                textView.setText(C2500.m6934(C2500.m7009(R.string.dialog_end_orig_resign_app, c2597.f7347, c2597.f7340.getAbsolutePath()), "#ff00ff73", "bold"));
            } else {
                textView.setText(C2500.m6934(C2500.m7009(R.string.dialog_end_resign_app, c2597.f7347, c2597.f7340.getAbsolutePath()), "#ff00ff73", "bold"));
            }
        }
        boolean z5 = c2597.f7317;
        if (z5) {
            if (c2597.f7325 && z5) {
                String str22 = C2500.m7007(R.string.context_crt_apk_permission) + str20;
                char[] cArr5 = new char[str22.length() + 10];
                Arrays.fill(cArr5, '-');
                textView.append(C2500.m6934("\n" + str22 + "\n" + new String(cArr5) + str6, str19, "bold"));
                textView.append(C2500.m6933(C2500.m7007(R.string.createdialog1) + " " + c2597.f7347 + " " + C2500.m7007(R.string.createdialog2) + "\n" + C2500.m6942(c2597.f7340) + str6 + C2500.m7007(R.string.createdialog5) + "\n" + c2597.f7340.getName() + str6 + C2500.m7007(R.string.createdialog3), -16711821, "bold"));
                return;
            }
            textView.setText(C2500.m6933(C2500.m7007(R.string.createdialog1) + " " + c2597.f7347 + " " + C2500.m7007(R.string.createdialog2) + "\n" + C2500.m6942(c2597.f7340) + str6 + C2500.m7007(R.string.createdialog5) + "\n" + c2597.f7340.getName() + str6 + C2500.m7007(R.string.createdialog3), -16711821, "bold"));
        }
    }

    public static void m7947(boolean z) {
        m7956(new RunnableC3080());
    }

    public void m7948(ArrayList<C3478> arrayList, Comparator<C3478> comparator) {
        int i;
        if (arrayList != null && arrayList.size() != 0) {
            Collections.sort(arrayList, comparator);
            if (m7928().getBoolean("no_icon", false)) {
                i = R.layout.pkglistitemview_no_icon;
            } else {
                i = R.layout.pkglistitemview;
            }
            f9252 = new C3479(mo1874(), i, m7928().getInt("viewsize", 0), arrayList);
            f9267 = new C2934(mo1874(), R.layout.bootlistitemview, m7928().getInt("viewsize", 0), f9260);
            f9252.f10072 = comparator;
            m7951(3);
            f9258.invalidate();
            f9258.setAdapter(f9252);
            f9258.setOnChildClickListener(new C3246());
            f9258.setDividerHeight(2);
            f9258.setGroupIndicator(null);
            f9258.setClickable(true);
            f9258.setLongClickable(true);
            f9258.setOnGroupExpandListener(new C3247());
            f9258.setOnGroupClickListener(new C3248());
            f9258.setOnItemLongClickListener(new C3250());
        } else {
            f9258.invalidate();
        }
        if (f9335 == null) {
            f9335 = new C2943(mo1874(), m7928().getInt("viewsize", 0), new ArrayList());
        }
        f9333.invalidate();
        f9333.setGroupIndicator(null);
        f9333.setAdapter(f9335);
        f9333.setOnGroupClickListener(new C3251());
        f9333.setOnChildClickListener(new C3252());
    }

    public static void m7949(boolean z) {
        if (!f9281) {
            m7942("LuckyPatcher: start refreshShowedApps.");
            f9281 = true;
            Thread thread = new Thread(new RunnableC3021(z));
            thread.setPriority(10);
            thread.start();
            return;
        }
        m7942("LuckyPatcher: finalize refreshPackages.");
    }

    public static void m7950(int i) {
        try {
            C3506 c3506 = f9410;
            if (c3506 != null) {
                if (c3506.f10137 == i) {
                    c3506.m8144();
                }
                f9410 = null;
            }
        } catch (RuntimeException e) {
            e.printStackTrace();
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }

    public static void m7951(Integer num) {
        if (f9245 != null) {
            m7954(new RunnableC3028(num));
        }
    }

    public static void m7952() {
        m7954(new RunnableC3074());
    }

    public static void m7953(C3478 c3478, C2597 c2597) {
        RunnableC3176 runnableC3176 = new RunnableC3176(c2597, c3478);
        if (c2597.f7289) {
            runnableC3176.run();
            return;
        }
        Thread thread = new Thread(runnableC3176);
        thread.setPriority(10);
        thread.start();
    }

    public static void m7954(Runnable runnable) {
        C2975 c2975 = f9245;
        if (c2975 != null) {
            c2975.mo1874().runOnUiThread(runnable);
            return;
        }
        Handler handler = f9312;
        if (handler != null) {
            handler.post(runnable);
        }
    }

    public static void m7955(Runnable runnable) {
        if (f9245 != null) {
            f9259.runOnUiThread(runnable);
            return;
        }
        Handler handler = f9312;
        if (handler != null) {
            handler.post(runnable);
        }
    }

    public static void m7956(Runnable runnable) {
        Thread thread = new Thread(new RunnableC3035(runnable));
        thread.setPriority(10);
        thread.start();
    }

    public static void m7957(boolean z) {
        m7956(new RunnableC3454(z));
    }

    public static void m7958(MainActivity mainActivity) {
        ListView listView;
        NavigationView navigationView = (NavigationView) mainActivity.findViewById(R.id.nav_view);
        if (navigationView != null && (listView = (ListView) navigationView.findViewById(R.id.lst_menu_items)) != null) {
            listView.setDivider(null);
            listView.setAdapter((ListAdapter) new C3108(mainActivity, R.layout.contextmenu, new C3107()));
            listView.setOnItemClickListener(new C3109(mainActivity));
        }
    }

    public static void m7959(int i, ArrayAdapter arrayAdapter) {
        try {
            m7942("dialog " + i);
            C3506 c3506 = f9410;
            if (c3506 != null) {
                if (c3506.m8145()) {
                    f9410.m8144();
                }
                f9410 = null;
            }
            C3506 c35062 = new C3506();
            f9410 = c35062;
            f9244 = i;
            c35062.f10137 = i;
            c35062.f10138 = arrayAdapter;
            c35062.m8147();
        } catch (RuntimeException e) {
            e.printStackTrace();
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }

    public static void m7960(Integer num) {
        m7954(new RunnableC3026(num));
    }

    public static void m7961(String str, SpannableStringBuilder spannableStringBuilder) {
        if (f9245 != null) {
            m7954(new RunnableC3122(str, spannableStringBuilder));
        }
    }

    public static void m7962(String str, String str2) {
        if (f9245 != null) {
            m7954(new RunnableC3113(str, str2));
        }
    }

    public void m7963(Context context, String str, String str2) {
        long blockCountLong;
        long blockSizeLong;
        long availableBlocksLong;
        long blockSizeLong2;
        long blockCountLong2;
        long blockSizeLong3;
        long availableBlocksLong2;
        long blockSizeLong4;
        C2913 c2913 = new C2913(context);
        StatFs statFs = new StatFs("/system");
        blockCountLong = statFs.getBlockCountLong();
        blockSizeLong = statFs.getBlockSizeLong();
        long j = (blockCountLong * blockSizeLong) / 1048576;
        availableBlocksLong = statFs.getAvailableBlocksLong();
        blockSizeLong2 = statFs.getBlockSizeLong();
        long j2 = (availableBlocksLong * blockSizeLong2) / 1048576;
        StatFs statFs2 = new StatFs("/data");
        blockCountLong2 = statFs2.getBlockCountLong();
        blockSizeLong3 = statFs2.getBlockSizeLong();
        long j3 = (blockCountLong2 * blockSizeLong3) / 1048576;
        availableBlocksLong2 = statFs2.getAvailableBlocksLong();
        blockSizeLong4 = statFs2.getBlockSizeLong();
        long j4 = (availableBlocksLong2 * blockSizeLong4) / 1048576;
        c2913.m7865(true);
        c2913.m7860(str);
        c2913.m7875(C2500.m7007(R.string.ok), null);
        LinearLayout linearLayout = (LinearLayout) View.inflate(context, R.layout.freespace, null);
        ((TextView) linearLayout.findViewById(R.id.dialog_message)).setText(str2);
        DecimalFormatSymbols decimalFormatSymbols = new DecimalFormatSymbols();
        decimalFormatSymbols.setGroupingSeparator(' ');
        DecimalFormat decimalFormat = new DecimalFormat();
        decimalFormat.setDecimalFormatSymbols(decimalFormatSymbols);
        decimalFormat.setGroupingSize(3);
        decimalFormat.setMaximumFractionDigits(2);
        ((TextView) linearLayout.findViewById(R.id.textSystem)).setText("System ROM (/system): " + decimalFormat.format(j) + " Mb (" + decimalFormat.format(j2) + " Mb free)");
        ProgressBar progressBar = (ProgressBar) linearLayout.findViewById(R.id.progressBarSystem);
        progressBar.setMax((int) j);
        progressBar.incrementProgressBy((int) (j - j2));
        ((TextView) linearLayout.findViewById(R.id.textData)).setText("Internal SD (/data): " + decimalFormat.format(j3) + " Mb (" + decimalFormat.format(j4) + " Mb free)");
        ProgressBar progressBar2 = (ProgressBar) linearLayout.findViewById(R.id.progressBarData);
        progressBar2.setMax((int) j3);
        progressBar2.incrementProgressBy((int) (j3 - j4));
        c2913.m7858(linearLayout);
        c2913.m7851().show();
    }

    public static void m7964(Context context, String str, String str2) {
        long blockCountLong;
        long blockSizeLong;
        long availableBlocksLong;
        long blockSizeLong2;
        long blockCountLong2;
        long blockSizeLong3;
        long availableBlocksLong2;
        long blockSizeLong4;
        C2913 c2913 = new C2913(context);
        StatFs statFs = new StatFs("/system");
        blockCountLong = statFs.getBlockCountLong();
        blockSizeLong = statFs.getBlockSizeLong();
        long j = (blockCountLong * blockSizeLong) / 1048576;
        availableBlocksLong = statFs.getAvailableBlocksLong();
        blockSizeLong2 = statFs.getBlockSizeLong();
        long j2 = (availableBlocksLong * blockSizeLong2) / 1048576;
        StatFs statFs2 = new StatFs("/data");
        blockCountLong2 = statFs2.getBlockCountLong();
        blockSizeLong3 = statFs2.getBlockSizeLong();
        long j3 = (blockCountLong2 * blockSizeLong3) / 1048576;
        availableBlocksLong2 = statFs2.getAvailableBlocksLong();
        blockSizeLong4 = statFs2.getBlockSizeLong();
        long j4 = (availableBlocksLong2 * blockSizeLong4) / 1048576;
        c2913.m7865(true);
        c2913.m7860(str);
        c2913.m7875(C2500.m7007(R.string.ok), null);
        LinearLayout linearLayout = (LinearLayout) View.inflate(context, R.layout.freespace, null);
        ((TextView) linearLayout.findViewById(R.id.dialog_message)).setText(str2);
        DecimalFormatSymbols decimalFormatSymbols = new DecimalFormatSymbols();
        decimalFormatSymbols.setGroupingSeparator(' ');
        DecimalFormat decimalFormat = new DecimalFormat();
        decimalFormat.setDecimalFormatSymbols(decimalFormatSymbols);
        decimalFormat.setGroupingSize(3);
        decimalFormat.setMaximumFractionDigits(2);
        ((TextView) linearLayout.findViewById(R.id.textSystem)).setText("System ROM (/system): " + decimalFormat.format(j) + " Mb (" + decimalFormat.format(j2) + " Mb free)");
        ProgressBar progressBar = (ProgressBar) linearLayout.findViewById(R.id.progressBarSystem);
        progressBar.setMax((int) j);
        progressBar.incrementProgressBy((int) (j - j2));
        ((TextView) linearLayout.findViewById(R.id.textData)).setText("Internal SD (/data): " + decimalFormat.format(j3) + " Mb (" + decimalFormat.format(j4) + " Mb free)");
        ProgressBar progressBar2 = (ProgressBar) linearLayout.findViewById(R.id.progressBarData);
        progressBar2.setMax((int) j3);
        progressBar2.incrementProgressBy((int) (j3 - j4));
        c2913.m7858(linearLayout);
        c2913.m7851().show();
    }

    public static void m7965(String str, String str2) {
        m7955(new RunnableC3020(str, str2));
    }

    public static boolean m7966(boolean z) {
        try {
            if (f9251.startsWith(m7929().getDir("sdcard", 0).getAbsolutePath())) {
                m7942("LuckyPatcher (sdcard to internal memory): " + f9251);
                if (z && f9245 != null) {
                    m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.messageSD));
                }
                return false;
            }
            if (!new File(f9251).exists()) {
                new File(f9251).mkdirs();
            }
            if (!new File(f9251).exists()) {
                m7942("LuckyPatcher (sdcard directory not found and not created): " + f9251);
                return false;
            }
            new File(f9251 + "/tmp.txt").delete();
            m7942("LuckyPatcher (sdcard test create file): " + f9251);
            if (new File(f9251 + "/tmp.txt").createNewFile()) {
                m7942("LuckyPatcher (sdcard test create file true): " + f9251);
                new File(f9251 + "/tmp.txt").delete();
                return true;
            }
            if (z && f9245 != null) {
                m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.messageSD));
            }
            return false;
        } catch (IOException unused) {
            if (z && f9245 != null) {
                m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.messageSD));
            }
            return false;
        }
    }

    public static void m7967(String str) {
        Handler handler = f9313;
        if (handler != null) {
            handler.post(new RunnableC3112(str));
        }
    }

    public static void m7968(C2939 c2939, boolean z) {
        if (m7966(true)) {
            f9389 = c2939;
            new File(f9251 + "/Backup/").mkdirs();
            C2500.m7125(c2939.f9152, C2500.m7007(R.string.restore_message) + " " + f9389.f9152 + " " + C2500.m7007(R.string.restore_version).toLowerCase() + " " + f9389.f9154 + " " + C2500.m7007(R.string.restore_build).toLowerCase() + " " + f9389.f9155 + "?", new DialogInterfaceOnClickListenerC3401(z), null, null);
        }
    }

    public void m7969() throws PackageManager.NameNotFoundException {
        m7960(11);
        Thread thread = new Thread(new RunnableC3123());
        thread.setPriority(1);
        thread.start();
    }

    public static void m7970() {
        if (m7928().getBoolean("vibration", false)) {
            Vibrator vibrator = (Vibrator) m7929().getSystemService("vibrator");
            f9346 = vibrator;
            vibrator.vibrate(2500L);
        }
    }

    @Override
    public void mo1771(Bundle bundle) {
        super.mo1771(bundle);
        m1850(true);
        MainActivity.frag = this;
        m1843(true);
        f9245 = this;
        f9312 = new Handler();
    }

    @Override
    public void mo1772(int i, int i2, Intent intent) {
        super.mo1772(i, i2, intent);
        m7944(i, i2, intent);
    }

    @Override
    public void mo1774(Context context) {
        super.mo1774(context);
        if (context instanceof MainActivity) {
            f9259 = (MainActivity) context;
        } else {
            m7942("LP Error: activity not attach");
        }
    }

    @Override
    public void mo1777(Bundle bundle) {
        super.mo1777(bundle);
        m7942("LuckyPatcher: create fragment.");
        m7942("pkg name check:" + PkgName.getPkgName());
        m1850(true);
        m7938(m7929());
        new Thread(new RunnableC3114()).start();
        f9245 = this;
        f9312 = new Handler();
        if (m1885()) {
            f9259 = (MainActivity) super.m1860();
        }
        f9270 = super.m1860();
        if (!f9293) {
            try {
                ((NotificationManager) mo1874().getSystemService("notification")).cancelAll();
            } catch (SecurityException e) {
                e.printStackTrace();
            }
        }
        if (C2500.m7039()) {
            m8050();
        } else if (!f9344.booleanValue()) {
            m8079();
        }
        if (f9299 >= 23) {
            m8021();
        } else {
            this.f9416.run();
        }
    }

    @Override
    public void mo1780(Menu menu, MenuInflater menuInflater) {
        super.mo1780(menu, menuInflater);
    }

    @Override
    public View mo1781(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        View inflate;
        super.mo1781(layoutInflater, viewGroup, bundle);
        m7942("View created");
        C2500.m7108(layoutInflater.getContext());
        if (f9283) {
            inflate = layoutInflater.inflate(R.layout.pkglistviewlayout, viewGroup, false);
        } else {
            inflate = layoutInflater.inflate(R.layout.pkglistviewlayout_no_root, viewGroup, false);
        }
        f9258 = (ExpandableListView) inflate.findViewById(R.id.explistapps);
        f9333 = (ExpandableListView) inflate.findViewById(R.id.menu_list);
        LinearLayout linearLayout = (LinearLayout) m1860().findViewById(R.id.toolbar_bottom);
        if (linearLayout != null) {
            Button button = (Button) linearLayout.findViewById(R.id.button_switchers);
            if (button != null) {
                button.setText(C2500.m7007(R.string.toolbar_switchers));
            }
            Button button2 = (Button) linearLayout.findViewById(R.id.button_toolbox);
            if (button2 != null) {
                button2.setText(C2500.m7007(R.string.toolbar_system_utils));
            }
            Button button3 = (Button) linearLayout.findViewById(R.id.button_backups);
            if (button3 != null) {
                button3.setText(C2500.m7007(R.string.toolbar_backups));
            }
            Button button4 = (Button) linearLayout.findViewById(R.id.button_rebuild);
            if (button4 != null) {
                button4.setText(C2500.m7007(R.string.toolbar_rebuild));
            }
        }
        m7956(new RunnableC3096());
        return inflate;
    }

    @Override
    public void mo1782() {
        f9294 = false;
        new Thread(new RunnableC3111()).start();
        super.mo1782();
    }

    @Override
    public void mo1784() {
        super.mo1784();
    }

    @Override
    public boolean mo1792(MenuItem menuItem) {
        switch (menuItem.getItemId()) {
            case R.id.about:
                m8065();
                return true;
            case R.id.context_menu_settings_show_last_added_custom_patches:
                Intent intent = new Intent("android.intent.action.VIEW");
                intent.setData(Uri.parse("https://patch.chelpus.com/"));
                try {
                    m1852(intent);
                } catch (ActivityNotFoundException unused) {
                    m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.warning_message_browser_not_found));
                } catch (IllegalStateException e) {
                    e.printStackTrace();
                }
                return true;
            case R.id.download_custom_patches:
                RunnableC3342 runnableC3342 = new RunnableC3342();
                runnableC3342.f9875 = false;
                Thread thread = new Thread(runnableC3342);
                thread.setPriority(10);
                thread.start();
                return true;
            case R.id.settings:
                if (m1860() != null) {
                    ((MainActivity) m1860()).toolbar_settings_click();
                }
                return true;
            case R.id.toolbar_refresh_apps:
                C2500.m7125(C2500.m7007(R.string.warning), C2500.m7007(R.string.message_rescan_apps), new DialogInterfaceOnClickListenerC3110(), null, null);
                return true;
            case R.id.truble:
                m8000();
                return true;
            case R.id.xposed_settings:
                m7984();
                return true;
            default:
                return super.mo1792(menuItem);
        }
    }

    @Override
    public void mo1795() {
        super.mo1795();
        m7942("onPause");
        if (m1885()) {
            f9259 = (MainActivity) m1860();
        }
    }

    @Override
    public void mo1797(Menu menu) {
    }

    @Override
    public void mo1799(int i, String[] strArr, int[] iArr) {
        Runnable runnable;
        this.f9416.run();
        if (i == 555) {
            boolean z = true;
            for (int i2 = 0; i2 < iArr.length; i2++) {
                if (iArr[i2] != 0) {
                    String[] strArr2 = f9412;
                    int length = strArr2.length;
                    int i3 = 0;
                    while (true) {
                        if (i3 >= length) {
                            break;
                        }
                        if (strArr[i2].equals(strArr2[i3])) {
                            C2500.m7135(C2500.m7007(R.string.warning), C2500.m7007(R.string.warning_not_all_perms_granded), new DialogInterfaceOnClickListenerC3091(), new DialogInterfaceOnCancelListenerC3092());
                            z = false;
                            break;
                        }
                        i3++;
                    }
                }
                if (iArr[i2] != 0) {
                    String[] strArr3 = f9413;
                    int length2 = strArr3.length;
                    int i4 = 0;
                    while (true) {
                        if (i4 >= length2) {
                            break;
                        }
                        if (strArr[i2].equals(strArr3[i4])) {
                            m7928().edit().putBoolean("LOCATION_PERMISSION_BLOCK", true).commit();
                            break;
                        }
                        i4++;
                    }
                }
                if (iArr[i2] != 0) {
                    String[] strArr4 = f9414;
                    int length3 = strArr4.length;
                    int i5 = 0;
                    while (true) {
                        if (i5 < length3) {
                            if (strArr[i2].equals(strArr4[i5])) {
                                m7928().edit().putBoolean("PHONE_PERMISSION_BLOCK", true).commit();
                                break;
                            }
                            i5++;
                        }
                    }
                }
            }
            if (z && (runnable = this.f9432) != null) {
                runnable.run();
            }
            this.f9432 = null;
        }
    }

    @Override
    public void mo1800() {
        super.mo1800();
        m7942("onResume()");
        try {
            if (m1885()) {
                f9259 = (MainActivity) m1860();
            }
        } catch (Exception e) {
            m7942("LuckyPatcher (onResume): sdcard not found!");
            e.printStackTrace();
        }
        try {
            C2500.m7108(App.getInstance());
            if (m7928().getBoolean("fast_start", false)) {
                f9291 = true;
            }
            if (m7928().getBoolean("path_changed", false)) {
                m7928().edit().putBoolean("path_changed", false).commit();
                m7928().edit().putString("basepath", f9251).commit();
                if (new File(f9251).mkdirs() || new File(f9251).exists()) {
                    Toast.makeText(m1860(), "" + C2500.m7007(R.string.dirr_chg) + "\n" + f9251, 0).show();
                }
            }
            if (m7928().getBoolean("settings_change", false)) {
                m7949(false);
                m7928().edit().putBoolean("settings_change", false).commit();
                int i = m7928().getInt("viewsize", 0);
                if (i != 0) {
                    if (i != 1) {
                        f9303 = android.R.style.TextAppearance.Large;
                    } else {
                        f9303 = android.R.style.TextAppearance.Medium;
                    }
                } else {
                    f9303 = android.R.style.TextAppearance.Small;
                }
                m7957(false);
                m7958(f9259);
                LinearLayout linearLayout = (LinearLayout) m1860().findViewById(R.id.toolbar_bottom);
                if (linearLayout != null) {
                    Button button = (Button) linearLayout.findViewById(R.id.button_switchers);
                    if (button != null) {
                        button.setText(C2500.m7007(R.string.toolbar_switchers));
                    }
                    Button button2 = (Button) linearLayout.findViewById(R.id.button_toolbox);
                    if (button2 != null) {
                        button2.setText(C2500.m7007(R.string.toolbar_system_utils));
                    }
                    Button button3 = (Button) linearLayout.findViewById(R.id.button_backups);
                    if (button3 != null) {
                        button3.setText(C2500.m7007(R.string.toolbar_backups));
                    }
                    Button button4 = (Button) linearLayout.findViewById(R.id.button_rebuild);
                    if (button4 != null) {
                        button4.setText(C2500.m7007(R.string.toolbar_rebuild));
                    }
                }
                if (m7928().getBoolean("lang_change", false)) {
                    m7928().edit().putBoolean("lang_change", false).commit();
                    m7928().getString("force_language", "default");
                    C2500.m7108(m1860());
                    C2500.m7108(m7929());
                    f9358.clear();
                    m1860().getMenuInflater().inflate(R.menu.mainmenu, f9358);
                    m7957(false);
                    C3479 c3479 = f9252;
                    if (c3479 != null) {
                        c3479.notifyDataSetChanged();
                    }
                }
                if (m7928().getInt("orientstion", 3) == 1) {
                    m1860().setRequestedOrientation(0);
                }
                if (m7928().getInt("orientstion", 3) == 2) {
                    m1860().setRequestedOrientation(1);
                }
                if (m7928().getInt("orientstion", 3) == 3) {
                    m1860().setRequestedOrientation(-1);
                }
                if (f9252 != null) {
                    if (m7928().getInt("sortby", 2) == 1) {
                        f9252.f10072 = new C3367();
                        f9252.m8121();
                    }
                    if (m7928().getInt("sortby", 2) == 2) {
                        f9252.f10072 = new C3368();
                        f9252.m8121();
                    }
                    if (m7928().getInt("sortby", 2) == 3) {
                        f9252.f10072 = new C3370();
                        f9252.m8121();
                    }
                }
            }
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }

    public void m7971(Context context) {
        if (C4345.m9693(context)) {
            C4345.m9694(context, new C4341.C4342(context, "#1").m9688(new Intent(context, (Class<?>) MainActivity.class).setAction("android.intent.action.MAIN")).m9690("Lucky Patcher").m9687(IconCompat.m1519(context, R.drawable.ic_launcher)).m9686(), null);
        }
    }

    public boolean m7972(C3478 c3478, boolean z) {
        if (m7966(true)) {
            File file = new File(f9251 + "/Backup/Data/" + c3478.f10046 + InternalZipConstants.ZIP_FILE_SEPARATOR + System.currentTimeMillis());
            file.mkdirs();
            try {
                C2500.m7053(c3478.f10046);
                PackageInfo packageInfo = m7932().getPackageInfo(c3478.f10046, ItemType.CLASS_DATA_ITEM);
                String str = packageInfo.applicationInfo.dataDir;
                String str2 = packageInfo.versionName;
                String str3 = "" + packageInfo.versionCode;
                String str4 = "empty";
                try {
                    if (f9299 > 7) {
                        str4 = m7929().getExternalFilesDir("").getAbsolutePath().replace("/files", "").replace(m7929().getPackageName(), c3478.f10046);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
                String str5 = str4;
                m7942(str5);
                String m7211 = new C2500("").m7211(f9284 + C1640.class.getName() + " " + c3478.f10046 + " " + str + " '" + file.getAbsolutePath() + "' '" + str5 + "' '" + str2 + "' " + str3);
                m7942(m7211);
                if (m7211.contains("errorLP")) {
                    if (z) {
                        m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.backup_data_error));
                        m7951(11);
                    }
                    return false;
                }
                try {
                    Drawable loadIcon = m7932().getPackageInfo(c3478.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.loadIcon(m7932());
                    File file2 = new File(f9251 + "/Backup/Data/" + c3478.f10046 + "/icon.png");
                    if (!file2.exists()) {
                        C2500.m7097(loadIcon, file2);
                    }
                    File file3 = new File(f9251 + "/Backup/Data/" + c3478.f10046 + "/info.json");
                    if (!file3.exists()) {
                        C2500.m7095(file3, m7932().getApplicationInfo(c3478.f10046, 0).loadLabel(m7932()).toString());
                    }
                } catch (Throwable th) {
                    th.printStackTrace();
                }
                if (m7211.contains("empty data...")) {
                    if (z) {
                        m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.backup_data_empty));
                        m7951(11);
                    }
                    return false;
                }
                if (z) {
                    m7962(C2500.m7007(R.string.well_done), C2500.m7007(R.string.backup_data_success));
                    m7951(11);
                    return true;
                }
                return true;
            } catch (PackageManager.NameNotFoundException e2) {
                e2.printStackTrace();
                if (z) {
                    m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.backup_data_error));
                    m7951(11);
                }
            } catch (Exception e3) {
                e3.printStackTrace();
                if (z) {
                    m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.backup_data_error));
                    m7951(11);
                }
                return false;
            }
        }
        return false;
    }

    public void m7973() {
        ArrayList arrayList = new ArrayList();
        for (File file : new File(f9251 + "/Backup").listFiles()) {
            if (!file.getName().startsWith(f9253.f10046 + ".ver")) {
                if (!file.getName().startsWith(C2500.m6873(f9253.f10047) + ".ver")) {
                    if (!file.getName().equals(f9253.f10046 + ".apk")) {
                    }
                }
            }
            arrayList.add(new C2939(m7929(), file.getAbsoluteFile(), false));
        }
        int i = m7928().getInt("backups_sorting", 0);
        if (i != 0) {
            if (i == 1) {
                Collections.sort(arrayList, new C3417());
            }
        } else {
            Collections.sort(arrayList, new C3400());
        }
        f9263 = new C3420(mo1874(), R.layout.contextmenu, arrayList);
    }

    public void m7974() {
        ArrayList arrayList = new ArrayList();
        boolean z = false;
        for (File file : new File(f9251 + "/Backup/Data/" + f9253.f10046).listFiles()) {
            if (file.isDirectory() && new C2500().m7198(file, ".lpbkp")) {
                C2939 c2939 = new C2939(f9253.f10046, file);
                C2500.m7106(c2939, file);
                arrayList.add(c2939);
            }
            if (!z && file.getName().endsWith(".lpbkp")) {
                SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
                long lastModified = new File(f9251 + "/Backup/Data/" + f9253.f10046 + "/data.lpbkp").lastModified();
                C2939 c29392 = new C2939(f9253.f10046, C2500.m6942(file), simpleDateFormat.format(new Date(lastModified)), lastModified);
                C2500.m7106(c29392, C2500.m6942(file));
                arrayList.add(c29392);
                z = true;
            }
        }
        Collections.sort(arrayList, new C3428());
        f9263 = new C3284(mo1874(), R.layout.contextmenu, arrayList);
    }

    public void m7975(C3478 c3478, String str) {
        File file = new File(mo1874().getDir("bootlist", 0) + "/bootlist");
        if (str.contains("ads")) {
            c3478.f10052 = true;
            StringBuilder sb = new StringBuilder();
            int i = 0;
            while (true) {
                C3478[] c3478Arr = f9252.f10079;
                if (i >= c3478Arr.length) {
                    break;
                }
                C3478 c34782 = c3478Arr[i];
                if (c34782.f10052 || c34782.f10054 || c34782.f10053 || c34782.f10055) {
                    sb.append(c34782.f10046);
                    if (f9252.f10079[i].f10052) {
                        sb.append("%ads");
                    }
                    if (f9252.f10079[i].f10053) {
                        sb.append("%lvl");
                    }
                    if (f9252.f10079[i].f10054) {
                        sb.append("%custom");
                    }
                    if (f9252.f10079[i].f10055) {
                        sb.append("%object");
                    }
                    sb.append(",");
                }
                i++;
            }
            sb.append("\n");
            try {
                FileOutputStream fileOutputStream = new FileOutputStream(file);
                fileOutputStream.write(sb.toString().getBytes());
                fileOutputStream.close();
            } catch (FileNotFoundException unused) {
                Toast.makeText(mo1874(), "Error: bootlist file are not found!", 1).show();
            } catch (Exception e) {
                e.printStackTrace();
            }
            f9252.m8117(c3478);
        }
        if (str.contains("lvl")) {
            c3478.f10053 = true;
            StringBuilder sb2 = new StringBuilder();
            int i2 = 0;
            while (true) {
                C3478[] c3478Arr2 = f9252.f10079;
                if (i2 >= c3478Arr2.length) {
                    break;
                }
                C3478 c34783 = c3478Arr2[i2];
                if (c34783.f10052 || c34783.f10054 || c34783.f10053 || c34783.f10055) {
                    sb2.append(c34783.f10046);
                    if (f9252.f10079[i2].f10052) {
                        sb2.append("%ads");
                    }
                    if (f9252.f10079[i2].f10053) {
                        sb2.append("%lvl");
                    }
                    if (f9252.f10079[i2].f10054) {
                        sb2.append("%custom");
                    }
                    if (f9252.f10079[i2].f10055) {
                        sb2.append("%object");
                    }
                    sb2.append(",");
                }
                i2++;
            }
            sb2.append("\n");
            try {
                FileOutputStream fileOutputStream2 = new FileOutputStream(file);
                fileOutputStream2.write(sb2.toString().getBytes());
                fileOutputStream2.close();
            } catch (FileNotFoundException unused2) {
                Toast.makeText(mo1874(), "Error: bootlist file are not found!", 1).show();
            } catch (Exception e2) {
                e2.printStackTrace();
            }
            f9252.m8117(c3478);
        }
        if (str.contains("custom")) {
            c3478.f10054 = true;
            File file2 = f9255;
            if (file2 != null) {
                try {
                    C2500.m6875(file2, new File(mo1874().getDir("bootlist", 0) + InternalZipConstants.ZIP_FILE_SEPARATOR + c3478.f10046));
                } catch (Exception unused3) {
                }
                f9252.m8117(c3478);
            }
        }
        m7951(3);
        m8042();
        C2934 c2934 = new C2934(mo1874(), R.layout.bootlistitemview, m7928().getInt("viewsize", 0), f9260);
        f9267 = c2934;
        c2934.notifyDataSetChanged();
    }

    public void m7976() {
        C2913 c2913 = new C2913(f9245.mo1874());
        c2913.m7854(R.string.days_on_up);
        LinearLayout linearLayout = (LinearLayout) View.inflate(f9245.mo1874(), R.layout.child_day_on_up_pref_view, null);
        EditTextFix editTextFix = (EditTextFix) linearLayout.findViewById(R.id.editTextDOU);
        editTextFix.setText("" + m7928().getInt("days_on_up", 1));
        c2913.m7858(linearLayout);
        c2913.m7877(R.string.cancel, null).m7873(R.string.ok, new DialogInterfaceOnClickListenerC3256(editTextFix)).m7851().show();
    }

    public void m7977() {
        C2913 c2913 = new C2913(f9245.mo1874());
        c2913.m7854(R.string.dir_change);
        LinearLayout linearLayout = (LinearLayout) View.inflate(f9245.mo1874(), R.layout.child_change_dir_pref_view, null);
        ((EditTextFix) linearLayout.findViewById(R.id.editTextDir)).setText(m7928().getString("basepath", InternalZipConstants.ZIP_FILE_SEPARATOR));
        boolean[] zArr = {true};
        c2913.m7866(C2500.m7007(R.string.change_folder_checkbox), new C3257(zArr), true);
        c2913.m7858(linearLayout);
        File[] fileArr = new File[1];
        C3549.m8178(fileArr, new RunnableC3258(fileArr, zArr), new C3260(zArr));
    }

    public void m7978(Intent intent) {
        ArrayList parcelableArrayListExtra;
        if (intent != null) {
            try {
                Uri data = intent.getData();
                if (data != null) {
                    m8085(data, intent.getType());
                    return;
                }
                m7942("data intent:" + intent.getData());
                m7942("action intent:" + intent.getAction());
                m7942("type intent" + intent.getType());
                String action = intent.getAction();
                String type = intent.getType();
                if ("android.intent.action.SEND".equals(action) && type != null) {
                    Uri uri = (Uri) intent.getParcelableExtra("android.intent.extra.STREAM");
                    if (uri != null) {
                        m8085(uri, intent.getType());
                        return;
                    }
                    return;
                }
                if ("android.intent.action.SEND_MULTIPLE".equals(action) && type != null && (parcelableArrayListExtra = intent.getParcelableArrayListExtra("android.intent.extra.STREAM")) != null) {
                    Iterator it = parcelableArrayListExtra.iterator();
                    while (it.hasNext()) {
                        m8085((Uri) it.next(), intent.getType());
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    public void m7979() {
        DialogInterfaceOnClickListenerC3137 dialogInterfaceOnClickListenerC3137 = new DialogInterfaceOnClickListenerC3137();
        C2500.m7125(C2500.m7007(R.string.warning), C2500.m7007(R.string.message_clear_all_dalvik_cache), dialogInterfaceOnClickListenerC3137, dialogInterfaceOnClickListenerC3137, null);
    }

    public void m7980() {
        if (m7928().getBoolean("vibration", false)) {
            Vibrator vibrator = (Vibrator) mo1874().getSystemService("vibrator");
            f9346 = vibrator;
            vibrator.vibrate(50L);
        }
        C3478 c3478 = f9253;
        if (!f9283) {
            C2500.m7116(c3478.f10046);
        } else {
            DialogInterfaceOnClickListenerC3311 dialogInterfaceOnClickListenerC3311 = new DialogInterfaceOnClickListenerC3311(c3478);
            C2500.m7125(c3478.f10047, C2500.m7007(R.string.message_clear_data), dialogInterfaceOnClickListenerC3311, dialogInterfaceOnClickListenerC3311, null);
        }
    }

    public void m7981() {
        if (m7928().getBoolean("vibration", false)) {
            Vibrator vibrator = (Vibrator) mo1874().getSystemService("vibrator");
            f9346 = vibrator;
            vibrator.vibrate(50L);
        }
        m7956(new RunnableC3272());
    }

    public void m7982() {
        f9387 = new ServiceConnectionC3422();
        if (this.f9424 == null) {
            try {
                Intent intent = new Intent(new String(C2812.m7671("Y29tLmFuZHJvaWQudmVuZGluZy5saWNlbnNpbmcuSUxpY2Vuc2luZ1NlcnZpY2U=")));
                intent.setPackage("com.android.vending");
                intent.putExtra("xexe", "lp");
                boolean z = false;
                try {
                    if (!m7932().queryIntentServices(intent, 0).isEmpty()) {
                        for (ResolveInfo resolveInfo : m7932().queryIntentServices(intent, 0)) {
                            String str = resolveInfo.serviceInfo.packageName;
                            if (str != null && str.equals("com.android.vending")) {
                                ServiceInfo serviceInfo = resolveInfo.serviceInfo;
                                ComponentName componentName = new ComponentName(serviceInfo.packageName, serviceInfo.name);
                                Intent intent2 = new Intent();
                                intent2.setComponent(componentName);
                                intent2.putExtra("xexe", "lp");
                                f9312.post(new RunnableC3429());
                                z = m7929().bindService(intent2, f9387, 1);
                            }
                        }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                    m7951(11);
                }
                if (!z) {
                    m7921();
                    m7951(11);
                }
            } catch (SecurityException e2) {
                e2.printStackTrace();
                m7921();
            } catch (C2813 e3) {
                e3.printStackTrace();
                m7921();
            }
        }
    }

    public void m7983() {
        C3549.m8200();
        m7942("LuckyPatcher: Start core.jar test!");
    }

    public void m7984() {
        m7956(new RunnableC3393());
        m7942("LuckyPatcher: Start core.jar test!");
    }

    public void m7985() {
        ArrayList arrayList = new ArrayList();
        arrayList.add(new C3727(R.string.context_backup_apk, 0, "#cccccc", R.drawable.context_backup));
        if (f9283) {
            arrayList.add(new C3727(R.string.context_backup_data, 0, "#cccccc", R.drawable.context_backup));
        }
        C3549.m8161(arrayList, false);
    }

    public void m7986() {
        ArrayList<C2638> m7277 = new C2636(mo1874(), f9253.f10046).m7277();
        if (m7277.size() == 0) {
            m7277.add(new C2638(C2500.m7007(R.string.empty), "", "", 0, 0));
        }
        f9264 = new C3140(mo1874(), R.layout.contextmenu, m7277);
    }

    public void m7987() {
        boolean z;
        boolean z2;
        ArrayList arrayList = new ArrayList();
        try {
            for (File file : new File(f9251 + "/Backup").listFiles()) {
                if (file.getName().startsWith(f9253.f10046) || file.getName().startsWith(C2500.m6873(f9253.f10047))) {
                    z = true;
                    break;
                }
            }
        } catch (Exception unused) {
            m7942("LuckyPatcher error: backup files or directory not found!");
        }
        z = false;
        new File(f9251 + "/Backup/Data/" + f9253.f10046).listFiles();
        try {
            z2 = new C2500().m7198(new File(f9251 + "/Backup/Data/" + f9253.f10046), ".lpbkp");
        } catch (Throwable th) {
            th.printStackTrace();
            z2 = false;
        }
        if (z) {
            arrayList.add(new C3727(R.string.context_restore_apk, 0, "#cccccc", R.drawable.context_restore));
        }
        if (z2 && f9283) {
            arrayList.add(new C3727(R.string.context_restore_data, 0, "#cccccc", R.drawable.context_restore));
        }
        C3549.m8161(arrayList, false);
    }

    public void m7988() {
        ArrayList arrayList = new ArrayList();
        List<ResolveInfo> queryIntentServices = m7932().queryIntentServices(new Intent("com.google.android.gms.ads.identifier.service.START"), 0);
        if (queryIntentServices != null && queryIntentServices.size() > 0) {
            arrayList.add(new C3727(R.string.context_disable_google_ads, 0, "#99cccc", R.drawable.context_ads));
        }
        arrayList.add(new C3727(R.string.context_removeAds, 0, "#99cccc", R.drawable.context_ads));
        arrayList.add(new C3727(R.string.context_disableActivity, 0, "#99cccc", R.drawable.context_ads));
        C3549.m8161(arrayList, false);
    }

    public void m7989() {
        ArrayList arrayList = new ArrayList();
        arrayList.add(new C3727(R.string.contextmultipatchrebuild, 0, "#9999cc", R.drawable.context_deodex));
        if (f9253.f10056) {
            arrayList.add(new C3727(R.string.createapkcustom, 0, "#ffff99", R.drawable.context_custom_patch));
        }
        arrayList.add(new C3727(R.string.createapklvl, 0, "#66cc66", R.drawable.context_lvl));
        arrayList.add(new C3727(R.string.createapkads, 0, "#99cccc", R.drawable.context_ads));
        arrayList.add(new C3727(R.string.createapksupport, 0, "#66cc66", R.drawable.context_lvl));
        arrayList.add(new C3727(R.string.context_crt_apk_permission, 0, "#cc99cc", R.drawable.context_permissions));
        arrayList.add(new C3727(R.string.context_resign_app, 0, "#ffcc66", R.mipmap.clone));
        arrayList.add(new C3727(R.string.context_original_resign_app, C2500.m7009(R.string.context_original_resign_app, C2500.m7007(R.string.contextcorepatch2)), 0, "", "#ffcc66", R.mipmap.clone));
        if (f9283) {
            C3549.m8161(arrayList, false);
            return;
        }
        C3549.m8163(C2500.m7007(R.string.createapk) + ":", arrayList, false);
    }

    public void m7990() {
        m7956(new RunnableC3329(f9253));
    }

    public void m7991() {
        C3478 c3478 = f9253;
        if (!f9283) {
            m7989();
        } else {
            m7956(new RunnableC3334(c3478));
        }
    }

    public void m7992() {
        m7956(new RunnableC2976(f9253));
    }

    public void m7993() {
        ArrayList arrayList = new ArrayList();
        arrayList.add(new C3727(R.string.context_automodeslvl, 0, "#66cc66", R.drawable.context_lvl));
        arrayList.add(new C3727(R.string.contextselpatt, 0, "#66cc66", R.drawable.context_lvl));
        C3549.m8161(arrayList, false);
    }

    public void m7994() {
        if (m7928().getBoolean("vibration", false)) {
            Vibrator vibrator = (Vibrator) mo1874().getSystemService("vibrator");
            f9346 = vibrator;
            vibrator.vibrate(50L);
        }
        try {
            m7951(6);
            m7991();
        } catch (Exception e) {
            m7942("LuckyPatcher (Context menu click): " + e);
            e.printStackTrace();
        }
    }

    public void m7995() {
        if (m7928().getBoolean("vibration", false)) {
            Vibrator vibrator = (Vibrator) mo1874().getSystemService("vibrator");
            f9346 = vibrator;
            vibrator.vibrate(50L);
        }
        try {
            m7951(6);
            m7992();
        } catch (Exception e) {
            m7942("LuckyPatcher (Context menu click): " + e);
            e.printStackTrace();
        }
    }

    public void m7996() {
        PackageInfo packageInfo;
        String str;
        Document document;
        String str2;
        String str3;
        String str4;
        String str5;
        Document document2;
        int i;
        boolean z;
        boolean z2;
        NodeList nodeList;
        boolean z3;
        boolean z4;
        NodeList nodeList2;
        int i2;
        String str6;
        NodeList nodeList3;
        boolean z5;
        boolean z6;
        NodeList nodeList4;
        boolean z7;
        boolean z8;
        NodeList nodeList5;
        String str7;
        try {
            packageInfo = m7932().getPackageInfo(f9253.f10046, 12800);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
            packageInfo = null;
        }
        f9268 = f9253.f10046;
        f9269 = "package";
        ArrayList arrayList = new ArrayList();
        String str8 = mo1874().getDir("packages", 0).getAbsolutePath() + "/packages.xml";
        if (!new File(str8).exists()) {
            Toast.makeText(mo1874(), "Error: packages.xml not found!", 1).show();
        }
        try {
            Document parse = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new FileInputStream(str8));
            NodeList elementsByTagName = parse.getElementsByTagName("package");
            int i3 = 0;
            while (true) {
                str = "enabled-components";
                String str9 = "perms";
                String str10 = "node:";
                String str11 = "sharedUserId";
                document = parse;
                if (i3 >= elementsByTagName.getLength()) {
                    str2 = "perms";
                    str3 = "node:";
                    str4 = "sharedUserId";
                    str5 = null;
                    break;
                }
                Node item = elementsByTagName.item(i3);
                NodeList nodeList6 = elementsByTagName;
                Element element = (Element) elementsByTagName.item(i3);
                int i4 = i3;
                String str12 = "enabled-components";
                if (element.getAttribute(MediationMetaData.KEY_NAME).equals(f9253.f10046)) {
                    if (element.getAttribute("sharedUserId").length() != 0) {
                        str5 = element.getAttribute("sharedUserId");
                    } else {
                        str5 = null;
                    }
                    NodeList childNodes = item.getChildNodes();
                    int i5 = 0;
                    while (i5 < childNodes.getLength()) {
                        Node item2 = childNodes.item(i5);
                        StringBuilder sb = new StringBuilder();
                        sb.append(str10);
                        NodeList nodeList7 = childNodes;
                        sb.append(item2.getNodeName());
                        m7942(sb.toString());
                        if (item2.getNodeName().equals(str9)) {
                            NodeList childNodes2 = item2.getChildNodes();
                            str6 = str9;
                            int i6 = 0;
                            while (i6 < childNodes2.getLength()) {
                                StringBuilder sb2 = new StringBuilder();
                                sb2.append("perm0:");
                                String str13 = str10;
                                sb2.append(childNodes2.item(i6).getNodeName());
                                m7942(sb2.toString());
                                if (childNodes2.item(i6).getNodeName().equals("item")) {
                                    Element element2 = (Element) childNodes2.item(i6);
                                    if (element2.getAttribute(MediationMetaData.KEY_NAME).contains("chelpa.disabled.")) {
                                        nodeList5 = childNodes2;
                                        str7 = str11;
                                        arrayList.add(new C3477(element2.getAttribute(MediationMetaData.KEY_NAME), false));
                                    } else {
                                        nodeList5 = childNodes2;
                                        str7 = str11;
                                        arrayList.add(new C3477(element2.getAttribute(MediationMetaData.KEY_NAME), true));
                                    }
                                    m7942("perm:" + element2.getAttribute(MediationMetaData.KEY_NAME));
                                } else {
                                    nodeList5 = childNodes2;
                                    str7 = str11;
                                }
                                i6++;
                                childNodes2 = nodeList5;
                                str10 = str13;
                                str11 = str7;
                            }
                        } else {
                            str6 = str9;
                        }
                        String str14 = str10;
                        String str15 = str11;
                        if (item2.getNodeName().equals("disabled-components")) {
                            NodeList childNodes3 = item2.getChildNodes();
                            int i7 = 0;
                            while (i7 < childNodes3.getLength()) {
                                m7942("perm0:" + childNodes3.item(i7).getNodeName());
                                if (childNodes3.item(i7).getNodeName().equals("item")) {
                                    Element element3 = (Element) childNodes3.item(i7);
                                    if (element3.getAttribute(MediationMetaData.KEY_NAME).contains("chelpa.disabled.")) {
                                        String[] strArr = packageInfo.requestedPermissions;
                                        if (strArr != null && strArr.length != 0) {
                                            int i8 = 0;
                                            while (true) {
                                                String[] strArr2 = packageInfo.requestedPermissions;
                                                nodeList4 = childNodes3;
                                                if (i8 < strArr2.length) {
                                                    if (strArr2[i8].equals(element3.getAttribute(MediationMetaData.KEY_NAME))) {
                                                        z8 = true;
                                                        break;
                                                    } else {
                                                        i8++;
                                                        childNodes3 = nodeList4;
                                                    }
                                                } else {
                                                    z8 = false;
                                                    break;
                                                }
                                            }
                                            if (z8) {
                                                arrayList.add(new C3477(element3.getAttribute(MediationMetaData.KEY_NAME), false));
                                            }
                                        } else {
                                            nodeList4 = childNodes3;
                                        }
                                    } else {
                                        nodeList4 = childNodes3;
                                        String[] strArr3 = packageInfo.requestedPermissions;
                                        if (strArr3 != null && strArr3.length != 0) {
                                            int i9 = 0;
                                            while (true) {
                                                String[] strArr4 = packageInfo.requestedPermissions;
                                                if (i9 < strArr4.length) {
                                                    if (strArr4[i9].equals(element3.getAttribute(MediationMetaData.KEY_NAME))) {
                                                        z7 = true;
                                                        break;
                                                    }
                                                    i9++;
                                                } else {
                                                    z7 = false;
                                                    break;
                                                }
                                            }
                                            if (z7) {
                                                arrayList.add(new C3477(element3.getAttribute(MediationMetaData.KEY_NAME), true));
                                            }
                                        }
                                    }
                                    m7942("perm:" + element3.getAttribute(MediationMetaData.KEY_NAME));
                                } else {
                                    nodeList4 = childNodes3;
                                }
                                i7++;
                                childNodes3 = nodeList4;
                            }
                        }
                        String str16 = str12;
                        if (item2.getNodeName().equals(str16)) {
                            NodeList childNodes4 = item2.getChildNodes();
                            int i10 = 0;
                            while (i10 < childNodes4.getLength()) {
                                m7942("perm0:" + childNodes4.item(i10).getNodeName());
                                if (childNodes4.item(i10).getNodeName().equals("item")) {
                                    Element element4 = (Element) childNodes4.item(i10);
                                    if (element4.getAttribute(MediationMetaData.KEY_NAME).contains("chelpa.disabled.")) {
                                        String[] strArr5 = packageInfo.requestedPermissions;
                                        if (strArr5 != null && strArr5.length != 0) {
                                            int i11 = 0;
                                            while (true) {
                                                String[] strArr6 = packageInfo.requestedPermissions;
                                                nodeList3 = childNodes4;
                                                if (i11 < strArr6.length) {
                                                    if (strArr6[i11].equals(element4.getAttribute(MediationMetaData.KEY_NAME))) {
                                                        z6 = true;
                                                        break;
                                                    } else {
                                                        i11++;
                                                        childNodes4 = nodeList3;
                                                    }
                                                } else {
                                                    z6 = false;
                                                    break;
                                                }
                                            }
                                            if (z6) {
                                                arrayList.add(new C3477(element4.getAttribute(MediationMetaData.KEY_NAME), false));
                                            }
                                        } else {
                                            nodeList3 = childNodes4;
                                        }
                                    } else {
                                        nodeList3 = childNodes4;
                                        String[] strArr7 = packageInfo.requestedPermissions;
                                        if (strArr7 != null && strArr7.length != 0) {
                                            int i12 = 0;
                                            while (true) {
                                                String[] strArr8 = packageInfo.requestedPermissions;
                                                if (i12 < strArr8.length) {
                                                    if (strArr8[i12].equals(element4.getAttribute(MediationMetaData.KEY_NAME))) {
                                                        z5 = true;
                                                        break;
                                                    }
                                                    i12++;
                                                } else {
                                                    z5 = false;
                                                    break;
                                                }
                                            }
                                            if (z5) {
                                                arrayList.add(new C3477(element4.getAttribute(MediationMetaData.KEY_NAME), true));
                                            }
                                        }
                                    }
                                    m7942("perm:" + element4.getAttribute(MediationMetaData.KEY_NAME));
                                } else {
                                    nodeList3 = childNodes4;
                                }
                                i10++;
                                childNodes4 = nodeList3;
                            }
                        }
                        i5++;
                        str12 = str16;
                        childNodes = nodeList7;
                        str9 = str6;
                        str10 = str14;
                        str11 = str15;
                    }
                    str2 = str9;
                    str3 = str10;
                    str4 = str11;
                    str = str12;
                } else {
                    i3 = i4 + 1;
                    parse = document;
                    elementsByTagName = nodeList6;
                }
            }
            Document document3 = document;
            NodeList elementsByTagName2 = document3.getElementsByTagName("updated-package");
            int i13 = 0;
            while (true) {
                if (i13 >= elementsByTagName2.getLength()) {
                    break;
                }
                Node item3 = elementsByTagName2.item(i13);
                Element element5 = (Element) elementsByTagName2.item(i13);
                NodeList nodeList8 = elementsByTagName2;
                if (element5.getAttribute(MediationMetaData.KEY_NAME).equals(f9253.f10046)) {
                    String str17 = str4;
                    if (element5.getAttribute(str17).length() != 0) {
                        str5 = element5.getAttribute(str17);
                    }
                    NodeList childNodes5 = item3.getChildNodes();
                    int i14 = 0;
                    while (i14 < childNodes5.getLength()) {
                        Node item4 = childNodes5.item(i14);
                        StringBuilder sb3 = new StringBuilder();
                        String str18 = str3;
                        sb3.append(str18);
                        NodeList nodeList9 = childNodes5;
                        sb3.append(item4.getNodeName());
                        m7942(sb3.toString());
                        String str19 = str2;
                        if (item4.getNodeName().equals(str19)) {
                            NodeList childNodes6 = item4.getChildNodes();
                            str2 = str19;
                            str3 = str18;
                            int i15 = 0;
                            while (i15 < childNodes6.getLength()) {
                                StringBuilder sb4 = new StringBuilder();
                                sb4.append("perm0:");
                                Document document4 = document3;
                                sb4.append(childNodes6.item(i15).getNodeName());
                                m7942(sb4.toString());
                                if (childNodes6.item(i15).getNodeName().equals("item")) {
                                    Element element6 = (Element) childNodes6.item(i15);
                                    if (element6.getAttribute(MediationMetaData.KEY_NAME).contains("chelpa.disabled.")) {
                                        nodeList2 = childNodes6;
                                        i2 = i14;
                                        arrayList.add(new C3477(element6.getAttribute(MediationMetaData.KEY_NAME), false));
                                    } else {
                                        nodeList2 = childNodes6;
                                        i2 = i14;
                                        arrayList.add(new C3477(element6.getAttribute(MediationMetaData.KEY_NAME), true));
                                    }
                                    m7942("perm:" + element6.getAttribute(MediationMetaData.KEY_NAME));
                                } else {
                                    nodeList2 = childNodes6;
                                    i2 = i14;
                                }
                                i15++;
                                childNodes6 = nodeList2;
                                document3 = document4;
                                i14 = i2;
                            }
                            document2 = document3;
                            i = i14;
                        } else {
                            document2 = document3;
                            i = i14;
                            str2 = str19;
                            str3 = str18;
                        }
                        if (item4.getNodeName().equals("disabled-components")) {
                            NodeList childNodes7 = item4.getChildNodes();
                            int i16 = 0;
                            while (i16 < childNodes7.getLength()) {
                                m7942("perm0:" + childNodes7.item(i16).getNodeName());
                                if (childNodes7.item(i16).getNodeName().equals("item")) {
                                    Element element7 = (Element) childNodes7.item(i16);
                                    if (element7.getAttribute(MediationMetaData.KEY_NAME).contains("chelpa.disabled.")) {
                                        String[] strArr9 = packageInfo.requestedPermissions;
                                        if (strArr9 != null && strArr9.length != 0) {
                                            int i17 = 0;
                                            while (true) {
                                                String[] strArr10 = packageInfo.requestedPermissions;
                                                nodeList = childNodes7;
                                                if (i17 < strArr10.length) {
                                                    if (strArr10[i17].equals(element7.getAttribute(MediationMetaData.KEY_NAME))) {
                                                        z4 = true;
                                                        break;
                                                    } else {
                                                        i17++;
                                                        childNodes7 = nodeList;
                                                    }
                                                } else {
                                                    z4 = false;
                                                    break;
                                                }
                                            }
                                            if (z4) {
                                                arrayList.add(new C3477(element7.getAttribute(MediationMetaData.KEY_NAME), false));
                                            }
                                        } else {
                                            nodeList = childNodes7;
                                        }
                                    } else {
                                        nodeList = childNodes7;
                                        String[] strArr11 = packageInfo.requestedPermissions;
                                        if (strArr11 != null && strArr11.length != 0) {
                                            int i18 = 0;
                                            while (true) {
                                                String[] strArr12 = packageInfo.requestedPermissions;
                                                if (i18 < strArr12.length) {
                                                    if (strArr12[i18].equals(element7.getAttribute(MediationMetaData.KEY_NAME))) {
                                                        z3 = true;
                                                        break;
                                                    }
                                                    i18++;
                                                } else {
                                                    z3 = false;
                                                    break;
                                                }
                                            }
                                            if (z3) {
                                                arrayList.add(new C3477(element7.getAttribute(MediationMetaData.KEY_NAME), true));
                                            }
                                        }
                                    }
                                    m7942("perm:" + element7.getAttribute(MediationMetaData.KEY_NAME));
                                } else {
                                    nodeList = childNodes7;
                                }
                                i16++;
                                childNodes7 = nodeList;
                            }
                        }
                        if (item4.getNodeName().equals(str)) {
                            NodeList childNodes8 = item4.getChildNodes();
                            for (int i19 = 0; i19 < childNodes8.getLength(); i19++) {
                                m7942("perm0:" + childNodes8.item(i19).getNodeName());
                                if (childNodes8.item(i19).getNodeName().equals("item")) {
                                    Element element8 = (Element) childNodes8.item(i19);
                                    if (element8.getAttribute(MediationMetaData.KEY_NAME).contains("chelpa.disabled.")) {
                                        String[] strArr13 = packageInfo.requestedPermissions;
                                        if (strArr13 != null && strArr13.length != 0) {
                                            int i20 = 0;
                                            while (true) {
                                                String[] strArr14 = packageInfo.requestedPermissions;
                                                if (i20 < strArr14.length) {
                                                    if (strArr14[i20].equals(element8.getAttribute(MediationMetaData.KEY_NAME))) {
                                                        z2 = true;
                                                        break;
                                                    }
                                                    i20++;
                                                } else {
                                                    z2 = false;
                                                    break;
                                                }
                                            }
                                            if (z2) {
                                                arrayList.add(new C3477(element8.getAttribute(MediationMetaData.KEY_NAME), false));
                                            }
                                        }
                                    } else {
                                        String[] strArr15 = packageInfo.requestedPermissions;
                                        if (strArr15 != null && strArr15.length != 0) {
                                            int i21 = 0;
                                            while (true) {
                                                String[] strArr16 = packageInfo.requestedPermissions;
                                                if (i21 < strArr16.length) {
                                                    if (strArr16[i21].equals(element8.getAttribute(MediationMetaData.KEY_NAME))) {
                                                        z = true;
                                                        break;
                                                    }
                                                    i21++;
                                                } else {
                                                    z = false;
                                                    break;
                                                }
                                            }
                                            if (z) {
                                                arrayList.add(new C3477(element8.getAttribute(MediationMetaData.KEY_NAME), true));
                                            }
                                        }
                                    }
                                    m7942("perm:" + element8.getAttribute(MediationMetaData.KEY_NAME));
                                }
                            }
                        }
                        i14 = i + 1;
                        childNodes5 = nodeList9;
                        document3 = document2;
                    }
                } else {
                    i13++;
                    elementsByTagName2 = nodeList8;
                }
            }
            Document document5 = document3;
            String str20 = str5;
            if (str20 != null) {
                NodeList elementsByTagName3 = document5.getElementsByTagName("shared-user");
                int i22 = 0;
                while (true) {
                    if (i22 >= elementsByTagName3.getLength()) {
                        break;
                    }
                    Node item5 = elementsByTagName3.item(i22);
                    if (((Element) elementsByTagName3.item(i22)).getAttribute("userId").equals(str20)) {
                        break;
                    } else {
                        i22++;
                    }
                }
            }
        } catch (IOException e2) {
            e2.printStackTrace();
        } catch (ParserConfigurationException e3) {
            e3.printStackTrace();
        } catch (SAXException e4) {
            e4.printStackTrace();
        }
        new ArrayList();
        if (arrayList.size() <= 0) {
            arrayList.add(new C3477(C2500.m7007(R.string.permission_not_found), false));
        }
        m7954(new RunnableC3446(arrayList));
    }

    public void m7997() {
        ArrayList arrayList = new ArrayList();
        if (!f9253.f10061) {
            arrayList.add(new C3727(R.string.context_disableComponents, 0, "#cc99cc", R.drawable.context_permissions));
            arrayList.add(new C3727(R.string.context_hard_apk_permission, 0, "#cc99cc", R.drawable.context_permissions));
            arrayList.add(new C3727(R.string.context_safe_sign_apk_permission, 0, "#cc99cc", R.drawable.context_permissions));
        } else {
            arrayList.add(new C3727(R.string.context_disableComponents, 0, "#cc99cc", R.drawable.context_permissions));
            arrayList.add(new C3727(R.string.context_safe_sign_apk_permission, 0, "#cc99cc", R.drawable.context_permissions));
        }
        C3549.m8161(arrayList, false);
    }

    public void m7998() {
        String str;
        ArrayList arrayList = new ArrayList();
        if (f9282.toLowerCase().endsWith(".apk")) {
            str = C2500.m6922(f9282, 1).packageName;
        } else {
            str = "";
        }
        if (C2500.m7027(f9282)) {
            str = C2500.m6924(new File(f9282));
        }
        arrayList.add(new C3727(R.string.contextmultipatchrebuild, 0, "#9999cc", R.drawable.context_deodex));
        if (C2500.m7033(str)) {
            arrayList.add(new C3727(R.string.createapkcustom, 0, "#ffff99", R.drawable.context_custom_patch));
        }
        arrayList.add(new C3727(R.string.createapklvl, 0, "#66cc66", R.drawable.context_lvl));
        arrayList.add(new C3727(R.string.createapkads, 0, "#99cccc", R.drawable.context_ads));
        arrayList.add(new C3727(R.string.createapksupport, 0, "#66cc66", R.drawable.context_lvl));
        arrayList.add(new C3727(R.string.context_crt_apk_permission, 0, "#cc99cc", R.drawable.context_permissions));
        arrayList.add(new C3727(R.string.cloneApplication, 0, "#ffcc66", R.mipmap.clone));
        arrayList.add(new C3727(R.string.context_resign_app, 0, "#ffcc66", R.mipmap.clone));
        arrayList.add(new C3727(R.string.context_original_resign_app, C2500.m7009(R.string.context_original_resign_app, C2500.m7007(R.string.contextcorepatch2)), 0, "", "#ffcc66", R.mipmap.clone));
        C3549.m8161(arrayList, false);
    }

    public void m7999() {
        m7942("LuckyPatcher: Core patch start!");
        Thread thread = new Thread(new RunnableC3144());
        thread.setPriority(10);
        thread.start();
    }

    public void m8000() {
        ArrayList arrayList = new ArrayList();
        if (f9283 && m7928().getBoolean("supersu_mount_namespace_separation", false)) {
            arrayList.add(new C3727(R.string.troubleshooting_supersu_namespace_separation, 0, "#FFFFFFFF"));
        }
        List<ResolveInfo> queryIntentActivities = m7929().getPackageManager().queryIntentActivities(new Intent("com.google.android.gms.settings.VERIFY_APPS_SETTINGS"), 65536);
        if (queryIntentActivities != null && queryIntentActivities.size() > 0) {
            for (ResolveInfo resolveInfo : queryIntentActivities) {
                arrayList.add(new C3727(R.string.context_trouble_run_playprotect_dialog, 0, "#FFFFFFFF"));
            }
        } else {
            arrayList.add(new C3727(R.string.context_trouble_enable_playprotect, 0, "#FFFFFFFF"));
        }
        if (f9299 >= 26 && f9283) {
            C2608 c2608 = new C2608();
            c2608.f7411 = true;
            c2608.f7412 = true;
            if (C2500.m6955(c2608).size() > 0) {
                arrayList.add(new C3727(R.string.generate_log_for_core_oj_jar_fix_android_patches, 0, "#FFFFFFFF"));
            }
        }
        if (f9299 >= 24 && f9283) {
            C2608 c26082 = new C2608();
            c26082.f7409 = true;
            c26082.f7408 = true;
            if (C2500.m6955(c26082).size() > 0) {
                arrayList.add(new C3727(R.string.generate_log_for_conscrypt_jar_fix_android_patches, 0, "#FFFFFFFF"));
            }
        }
        if (f9299 >= 21 && f9283) {
            C2608 c26083 = new C2608();
            c26083.f7407 = true;
            c26083.f7406 = true;
            if (C2500.m6955(c26083).size() > 0) {
                arrayList.add(new C3727(R.string.res_0x7f1101d8_generate_log_for_core_jar_fix_android_patches, 0, "#FFFFFFFF"));
            }
            C2608 c26084 = new C2608();
            c26084.f7414 = true;
            c26084.f7415 = true;
            if (C2500.m6955(c26084).size() > 0) {
                arrayList.add(new C3727(R.string.res_0x7f1101db_generate_log_for_services_odex_fix_android_patches, 0, "#FFFFFFFF"));
            }
        }
        if (f9299 >= 28 && f9283) {
            C2608 c26085 = new C2608();
            c26085.f7420 = true;
            c26085.f7421 = true;
            if (C2500.m6955(c26085).size() > 0) {
                arrayList.add(new C3727(R.string.generate_log_for_framework_fix_android_patches, 0, "#FFFFFFFF"));
            }
        }
        C3549.m8161(arrayList, false);
    }

    void m8001() {
        if (!m7928().getBoolean("first_run_copy_custom_patches", false)) {
            try {
                m7928().edit().putBoolean("first_run_copy_custom_patches", true);
                File file = new File(f9251);
                File file2 = new File(f9251 + "/CustomPatches");
                if (!file2.exists()) {
                    file2.mkdirs();
                }
                File[] listFiles = file.listFiles();
                if (listFiles != null) {
                    for (File file3 : listFiles) {
                        String name = file3.getName();
                        if (file3.isFile() && !name.equals("AdsBlockList.txt") && !name.equals("AdsBlockList_user_edit.txt")) {
                            file3.renameTo(new File(file2 + InternalZipConstants.ZIP_FILE_SEPARATOR + name));
                        }
                    }
                }
            } catch (Throwable th) {
                th.printStackTrace();
            }
        }
    }

    public void m8002(String str) {
        m7942("LuckyPatcher: Core patch start!");
        Thread thread = new Thread(new RunnableC3157(str));
        thread.setPriority(10);
        if (C2500.m7040(m7929().getPackageName())) {
            m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_app_installed_on_sdcard_block));
        } else {
            thread.start();
        }
    }

    public void m8003(boolean z, C2597 c2597) {
        m7956(new RunnableC3438(z, c2597));
    }

    public void m8004() {
        if (m7966(true)) {
            DialogInterfaceOnClickListenerC3467 dialogInterfaceOnClickListenerC3467 = new DialogInterfaceOnClickListenerC3467();
            C2500.m7125(C2500.m7007(R.string.warning), C2500.m7009(R.string.delete_file_message, new File(f9282).getName()), dialogInterfaceOnClickListenerC3467, dialogInterfaceOnClickListenerC3467, null);
        }
    }

    public void m8005(C3478 c3478) {
        DialogInterfaceOnClickListenerC3170 dialogInterfaceOnClickListenerC3170 = new DialogInterfaceOnClickListenerC3170(c3478);
        C2500.m7125(C2500.m7007(R.string.warning), C2500.m7007(R.string.message_delete_odex_file), dialogInterfaceOnClickListenerC3170, dialogInterfaceOnClickListenerC3170, null);
    }

    public void m8006(String str, String str2, String str3, boolean z) {
        m7956(new RunnableC3023(str, str3, str2, z));
        m7942("LuckyPatcher: Start core.jar test!");
    }

    public void m8007(Integer num) {
        DialogInterfaceOnClickListenerC3142 dialogInterfaceOnClickListenerC3142 = new DialogInterfaceOnClickListenerC3142(num);
        C2500.m7125(C2500.m7007(R.string.warning), C2500.m7007(R.string.message_reboot), dialogInterfaceOnClickListenerC3142, dialogInterfaceOnClickListenerC3142, null);
    }

    public void m8008(String str, boolean z) {
        m7956(new RunnableC3089(z, str));
        m7942("LuckyPatcher: Start core.jar test!");
    }

    public void m8009(C3478 c3478, C3477 c3477) {
        String str;
        String str2;
        String str3;
        File file;
        File file2;
        String str4;
        String str5;
        String str6;
        String str7;
        String str8;
        Document document;
        Document document2;
        String str9;
        String str10;
        Document document3;
        String str11;
        Document document4;
        NodeList nodeList;
        Document document5;
        Document document6;
        String str12;
        String str13;
        String str14;
        String str15 = "/packages.xml";
        StringBuilder sb = new StringBuilder();
        String str16 = "packages";
        sb.append(mo1874().getDir("packages", 0).getAbsolutePath());
        String str17 = "/packages1.xml";
        sb.append("/packages1.xml");
        if (new File(sb.toString()).exists()) {
            try {
                try {
                    String str18 = mo1874().getDir("packages", 0).getAbsolutePath() + "/packages1.xml";
                    String str19 = mo1874().getDir("packages", 0).getAbsolutePath() + "/packages.xml";
                    new C2500("");
                    C2500.m7093("chmod 777 " + str18);
                    new C2500("");
                    C2500.m7093("chmod 777 " + str19);
                    try {
                        Document parse = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new FileInputStream(str18));
                        NodeList elementsByTagName = parse.getElementsByTagName("package");
                        int i = 0;
                        while (true) {
                            str4 = "perms";
                            str5 = "node:";
                            str6 = "sharedUserId";
                            str = str15;
                            str2 = str17;
                            str3 = str16;
                            str7 = str19;
                            str8 = null;
                            if (i < elementsByTagName.getLength()) {
                                try {
                                    Node item = elementsByTagName.item(i);
                                    NodeList nodeList2 = elementsByTagName;
                                    Element element = (Element) elementsByTagName.item(i);
                                    document = parse;
                                    int i2 = i;
                                    if (element.getAttribute(MediationMetaData.KEY_NAME).equals(f9253.f10046)) {
                                        if (element.getAttribute("sharedUserId").length() != 0) {
                                            str8 = element.getAttribute("sharedUserId");
                                        }
                                        NodeList childNodes = item.getChildNodes();
                                        int i3 = 0;
                                        while (i3 < childNodes.getLength()) {
                                            Node item2 = childNodes.item(i3);
                                            StringBuilder sb2 = new StringBuilder();
                                            sb2.append(str5);
                                            NodeList nodeList3 = childNodes;
                                            sb2.append(item2.getNodeName());
                                            m7942(sb2.toString());
                                            if (item2.getNodeName().equals(str4)) {
                                                NodeList childNodes2 = item2.getChildNodes();
                                                str13 = str4;
                                                int i4 = 0;
                                                while (i4 < childNodes2.getLength()) {
                                                    StringBuilder sb3 = new StringBuilder();
                                                    sb3.append("perm0:");
                                                    String str20 = str5;
                                                    sb3.append(childNodes2.item(i4).getNodeName());
                                                    m7942(sb3.toString());
                                                    if (childNodes2.item(i4).getNodeName().equals("item")) {
                                                        Element element2 = (Element) childNodes2.item(i4);
                                                        str14 = str6;
                                                        if (element2.getAttribute(MediationMetaData.KEY_NAME).equals(c3477.f10044)) {
                                                            if (element2.getAttribute(MediationMetaData.KEY_NAME).contains("chelpa.disabled.")) {
                                                                childNodes2.item(i4).getAttributes().getNamedItem(MediationMetaData.KEY_NAME).setTextContent(element2.getAttribute(MediationMetaData.KEY_NAME).replaceAll("chelpa.disabled.", ""));
                                                            } else {
                                                                childNodes2.item(i4).getAttributes().getNamedItem(MediationMetaData.KEY_NAME).setTextContent("chelpa.disabled." + element2.getAttribute(MediationMetaData.KEY_NAME));
                                                            }
                                                            if (!f9362.contains(c3477.f10044)) {
                                                                f9362.add(c3477.f10044);
                                                            }
                                                        }
                                                    } else {
                                                        str14 = str6;
                                                    }
                                                    i4++;
                                                    str5 = str20;
                                                    str6 = str14;
                                                }
                                                str12 = str6;
                                            } else {
                                                str12 = str6;
                                                str13 = str4;
                                            }
                                            String str21 = str5;
                                            if (item2.getNodeName().equals("disabled-components")) {
                                                NodeList childNodes3 = item2.getChildNodes();
                                                for (int i5 = 0; i5 < childNodes3.getLength(); i5++) {
                                                    m7942("perm0:" + childNodes3.item(i5).getNodeName());
                                                    if (childNodes3.item(i5).getNodeName().equals("item")) {
                                                        Element element3 = (Element) childNodes3.item(i5);
                                                        if (element3.getAttribute(MediationMetaData.KEY_NAME).equals(c3477.f10044)) {
                                                            if (element3.getAttribute(MediationMetaData.KEY_NAME).contains("chelpa.disabled.")) {
                                                                childNodes3.item(i5).getAttributes().getNamedItem(MediationMetaData.KEY_NAME).setTextContent(element3.getAttribute(MediationMetaData.KEY_NAME).replaceAll("chelpa.disabled.", ""));
                                                            } else {
                                                                childNodes3.item(i5).getAttributes().getNamedItem(MediationMetaData.KEY_NAME).setTextContent("chelpa.disabled." + element3.getAttribute(MediationMetaData.KEY_NAME));
                                                            }
                                                            if (!f9362.contains(c3477.f10044)) {
                                                                f9362.add(c3477.f10044);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            if (item2.getNodeName().equals("enabled-components")) {
                                                NodeList childNodes4 = item2.getChildNodes();
                                                for (int i6 = 0; i6 < childNodes4.getLength(); i6++) {
                                                    m7942("perm0:" + childNodes4.item(i6).getNodeName());
                                                    if (childNodes4.item(i6).getNodeName().equals("item")) {
                                                        Element element4 = (Element) childNodes4.item(i6);
                                                        if (element4.getAttribute(MediationMetaData.KEY_NAME).equals(c3477.f10044)) {
                                                            if (element4.getAttribute(MediationMetaData.KEY_NAME).contains("chelpa.disabled.")) {
                                                                childNodes4.item(i6).getAttributes().getNamedItem(MediationMetaData.KEY_NAME).setTextContent(element4.getAttribute(MediationMetaData.KEY_NAME).replaceAll("chelpa.disabled.", ""));
                                                            } else {
                                                                childNodes4.item(i6).getAttributes().getNamedItem(MediationMetaData.KEY_NAME).setTextContent("chelpa.disabled." + element4.getAttribute(MediationMetaData.KEY_NAME));
                                                            }
                                                            if (!f9362.contains(c3477.f10044)) {
                                                                f9362.add(c3477.f10044);
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            i3++;
                                            childNodes = nodeList3;
                                            str4 = str13;
                                            str5 = str21;
                                            str6 = str12;
                                        }
                                    } else {
                                        i = i2 + 1;
                                        str15 = str;
                                        str17 = str2;
                                        str16 = str3;
                                        str19 = str7;
                                        parse = document;
                                        elementsByTagName = nodeList2;
                                    }
                                } catch (IOException e) {
                                    e = e;
                                    e.printStackTrace();
                                    StringBuilder sb4 = new StringBuilder();
                                    String str22 = str3;
                                    sb4.append(mo1874().getDir(str22, 0));
                                    sb4.append(str2);
                                    file = new File(sb4.toString());
                                    if (file.exists()) {
                                    }
                                    file2 = new File(mo1874().getDir(str22, 0) + str);
                                    if (!file2.exists()) {
                                    }
                                } catch (ParserConfigurationException e2) {
                                    e = e2;
                                    e.printStackTrace();
                                    StringBuilder sb42 = new StringBuilder();
                                    String str222 = str3;
                                    sb42.append(mo1874().getDir(str222, 0));
                                    sb42.append(str2);
                                    file = new File(sb42.toString());
                                    if (file.exists()) {
                                    }
                                    file2 = new File(mo1874().getDir(str222, 0) + str);
                                    if (!file2.exists()) {
                                    }
                                } catch (TransformerConfigurationException e3) {
                                    e = e3;
                                    e.printStackTrace();
                                    StringBuilder sb422 = new StringBuilder();
                                    String str2222 = str3;
                                    sb422.append(mo1874().getDir(str2222, 0));
                                    sb422.append(str2);
                                    file = new File(sb422.toString());
                                    if (file.exists()) {
                                    }
                                    file2 = new File(mo1874().getDir(str2222, 0) + str);
                                    if (!file2.exists()) {
                                    }
                                } catch (TransformerException e4) {
                                    e = e4;
                                    e.printStackTrace();
                                    StringBuilder sb4222 = new StringBuilder();
                                    String str22222 = str3;
                                    sb4222.append(mo1874().getDir(str22222, 0));
                                    sb4222.append(str2);
                                    file = new File(sb4222.toString());
                                    if (file.exists()) {
                                    }
                                    file2 = new File(mo1874().getDir(str22222, 0) + str);
                                    if (!file2.exists()) {
                                    }
                                } catch (SAXException e5) {
                                    e = e5;
                                    e.printStackTrace();
                                    StringBuilder sb42222 = new StringBuilder();
                                    String str222222 = str3;
                                    sb42222.append(mo1874().getDir(str222222, 0));
                                    sb42222.append(str2);
                                    file = new File(sb42222.toString());
                                    if (file.exists()) {
                                    }
                                    file2 = new File(mo1874().getDir(str222222, 0) + str);
                                    if (!file2.exists()) {
                                    }
                                }
                            } else {
                                document = parse;
                                break;
                            }
                        }
                        String str23 = str6;
                        String str24 = str4;
                        String str25 = str5;
                        Document document7 = document;
                        NodeList elementsByTagName2 = document7.getElementsByTagName("updated-package");
                        int i7 = 0;
                        while (true) {
                            if (i7 < elementsByTagName2.getLength()) {
                                Node item3 = elementsByTagName2.item(i7);
                                Element element5 = (Element) elementsByTagName2.item(i7);
                                if (element5.getAttribute(MediationMetaData.KEY_NAME).equals(f9253.f10046)) {
                                    if (element5.getAttribute(str23).length() != 0) {
                                        str8 = element5.getAttribute(str23);
                                    }
                                    NodeList childNodes5 = item3.getChildNodes();
                                    int i8 = 0;
                                    while (i8 < childNodes5.getLength()) {
                                        Node item4 = childNodes5.item(i8);
                                        StringBuilder sb5 = new StringBuilder();
                                        String str26 = str25;
                                        sb5.append(str26);
                                        sb5.append(item4.getNodeName());
                                        m7942(sb5.toString());
                                        String str27 = str24;
                                        if (item4.getNodeName().equals(str27)) {
                                            NodeList childNodes6 = item4.getChildNodes();
                                            nodeList = childNodes5;
                                            str24 = str27;
                                            int i9 = 0;
                                            while (i9 < childNodes6.getLength()) {
                                                StringBuilder sb6 = new StringBuilder();
                                                sb6.append("perm0:");
                                                String str28 = str26;
                                                sb6.append(childNodes6.item(i9).getNodeName());
                                                m7942(sb6.toString());
                                                if (childNodes6.item(i9).getNodeName().equals("item")) {
                                                    Element element6 = (Element) childNodes6.item(i9);
                                                    document6 = document7;
                                                    if (element6.getAttribute(MediationMetaData.KEY_NAME).equals(c3477.f10044)) {
                                                        if (element6.getAttribute(MediationMetaData.KEY_NAME).contains("chelpa.disabled.")) {
                                                            childNodes6.item(i9).getAttributes().getNamedItem(MediationMetaData.KEY_NAME).setTextContent(element6.getAttribute(MediationMetaData.KEY_NAME).replaceAll("chelpa.disabled.", ""));
                                                        } else {
                                                            childNodes6.item(i9).getAttributes().getNamedItem(MediationMetaData.KEY_NAME).setTextContent("chelpa.disabled." + element6.getAttribute(MediationMetaData.KEY_NAME));
                                                        }
                                                        if (!f9362.contains(c3477.f10044)) {
                                                            f9362.add(c3477.f10044);
                                                        }
                                                    }
                                                } else {
                                                    document6 = document7;
                                                }
                                                i9++;
                                                document7 = document6;
                                                str26 = str28;
                                            }
                                            document5 = document7;
                                        } else {
                                            nodeList = childNodes5;
                                            document5 = document7;
                                            str24 = str27;
                                        }
                                        str25 = str26;
                                        if (item4.getNodeName().equals("disabled-components")) {
                                            NodeList childNodes7 = item4.getChildNodes();
                                            for (int i10 = 0; i10 < childNodes7.getLength(); i10++) {
                                                m7942("perm0:" + childNodes7.item(i10).getNodeName());
                                                if (childNodes7.item(i10).getNodeName().equals("item")) {
                                                    Element element7 = (Element) childNodes7.item(i10);
                                                    if (element7.getAttribute(MediationMetaData.KEY_NAME).equals(c3477.f10044)) {
                                                        if (element7.getAttribute(MediationMetaData.KEY_NAME).contains("chelpa.disabled.")) {
                                                            childNodes7.item(i10).getAttributes().getNamedItem(MediationMetaData.KEY_NAME).setTextContent(element7.getAttribute(MediationMetaData.KEY_NAME).replaceAll("chelpa.disabled.", ""));
                                                        } else {
                                                            childNodes7.item(i10).getAttributes().getNamedItem(MediationMetaData.KEY_NAME).setTextContent("chelpa.disabled." + element7.getAttribute(MediationMetaData.KEY_NAME));
                                                        }
                                                        if (!f9362.contains(c3477.f10044)) {
                                                            f9362.add(c3477.f10044);
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        if (item4.getNodeName().equals("enabled-components")) {
                                            NodeList childNodes8 = item4.getChildNodes();
                                            for (int i11 = 0; i11 < childNodes8.getLength(); i11++) {
                                                m7942("perm0:" + childNodes8.item(i11).getNodeName());
                                                if (childNodes8.item(i11).getNodeName().equals("item")) {
                                                    Element element8 = (Element) childNodes8.item(i11);
                                                    if (element8.getAttribute(MediationMetaData.KEY_NAME).equals(c3477.f10044)) {
                                                        if (element8.getAttribute(MediationMetaData.KEY_NAME).contains("chelpa.disabled.")) {
                                                            childNodes8.item(i11).getAttributes().getNamedItem(MediationMetaData.KEY_NAME).setTextContent(element8.getAttribute(MediationMetaData.KEY_NAME).replaceAll("chelpa.disabled.", ""));
                                                        } else {
                                                            childNodes8.item(i11).getAttributes().getNamedItem(MediationMetaData.KEY_NAME).setTextContent("chelpa.disabled." + element8.getAttribute(MediationMetaData.KEY_NAME));
                                                        }
                                                        if (!f9362.contains(c3477.f10044)) {
                                                            f9362.add(c3477.f10044);
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        i8++;
                                        childNodes5 = nodeList;
                                        document7 = document5;
                                    }
                                    document2 = document7;
                                    str10 = str8;
                                    str9 = str24;
                                } else {
                                    i7++;
                                    document7 = document7;
                                }
                            } else {
                                document2 = document7;
                                str9 = str24;
                                str10 = str8;
                                break;
                            }
                        }
                        if (str10 != null) {
                            Document document8 = document2;
                            NodeList elementsByTagName3 = document8.getElementsByTagName("shared-user");
                            int i12 = 0;
                            while (true) {
                                if (i12 >= elementsByTagName3.getLength()) {
                                    break;
                                }
                                Node item5 = elementsByTagName3.item(i12);
                                NodeList nodeList4 = elementsByTagName3;
                                if (((Element) elementsByTagName3.item(i12)).getAttribute("userId").equals(str10)) {
                                    NodeList childNodes9 = item5.getChildNodes();
                                    int i13 = 0;
                                    while (i13 < childNodes9.getLength()) {
                                        Node item6 = childNodes9.item(i13);
                                        StringBuilder sb7 = new StringBuilder();
                                        String str29 = str25;
                                        sb7.append(str29);
                                        NodeList nodeList5 = childNodes9;
                                        sb7.append(item6.getNodeName());
                                        m7942(sb7.toString());
                                        if (item6.getNodeName().equals(str9)) {
                                            NodeList childNodes10 = item6.getChildNodes();
                                            str11 = str9;
                                            int i14 = 0;
                                            while (i14 < childNodes10.getLength()) {
                                                StringBuilder sb8 = new StringBuilder();
                                                sb8.append("perm0:");
                                                String str30 = str29;
                                                sb8.append(childNodes10.item(i14).getNodeName());
                                                m7942(sb8.toString());
                                                if (childNodes10.item(i14).getNodeName().equals("item")) {
                                                    Element element9 = (Element) childNodes10.item(i14);
                                                    document4 = document8;
                                                    if (element9.getAttribute(MediationMetaData.KEY_NAME).equals(c3477.f10044)) {
                                                        if (element9.getAttribute(MediationMetaData.KEY_NAME).contains("chelpa.disabled.")) {
                                                            childNodes10.item(i14).getAttributes().getNamedItem(MediationMetaData.KEY_NAME).setTextContent(element9.getAttribute(MediationMetaData.KEY_NAME).replaceAll("chelpa.disabled.", ""));
                                                        } else {
                                                            childNodes10.item(i14).getAttributes().getNamedItem(MediationMetaData.KEY_NAME).setTextContent("chelpa.disabled." + element9.getAttribute(MediationMetaData.KEY_NAME));
                                                        }
                                                        if (!f9362.contains(c3477.f10044)) {
                                                            f9362.add(c3477.f10044);
                                                        }
                                                    }
                                                } else {
                                                    document4 = document8;
                                                }
                                                i14++;
                                                document8 = document4;
                                                str29 = str30;
                                            }
                                        } else {
                                            str11 = str9;
                                        }
                                        Document document9 = document8;
                                        str25 = str29;
                                        if (item6.getNodeName().equals("disabled-components")) {
                                            NodeList childNodes11 = item6.getChildNodes();
                                            for (int i15 = 0; i15 < childNodes11.getLength(); i15++) {
                                                m7942("perm0:" + childNodes11.item(i15).getNodeName());
                                                if (childNodes11.item(i15).getNodeName().equals("item")) {
                                                    Element element10 = (Element) childNodes11.item(i15);
                                                    if (element10.getAttribute(MediationMetaData.KEY_NAME).equals(c3477.f10044)) {
                                                        if (element10.getAttribute(MediationMetaData.KEY_NAME).contains("chelpa.disabled.")) {
                                                            childNodes11.item(i15).getAttributes().getNamedItem(MediationMetaData.KEY_NAME).setTextContent(element10.getAttribute(MediationMetaData.KEY_NAME).replaceAll("chelpa.disabled.", ""));
                                                        } else {
                                                            childNodes11.item(i15).getAttributes().getNamedItem(MediationMetaData.KEY_NAME).setTextContent("chelpa.disabled." + element10.getAttribute(MediationMetaData.KEY_NAME));
                                                        }
                                                        if (!f9362.contains(c3477.f10044)) {
                                                            f9362.add(c3477.f10044);
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        if (item6.getNodeName().equals("enabled-components")) {
                                            NodeList childNodes12 = item6.getChildNodes();
                                            for (int i16 = 0; i16 < childNodes12.getLength(); i16++) {
                                                m7942("perm0:" + childNodes12.item(i16).getNodeName());
                                                if (childNodes12.item(i16).getNodeName().equals("item")) {
                                                    Element element11 = (Element) childNodes12.item(i16);
                                                    if (element11.getAttribute(MediationMetaData.KEY_NAME).equals(c3477.f10044)) {
                                                        if (element11.getAttribute(MediationMetaData.KEY_NAME).contains("chelpa.disabled.")) {
                                                            childNodes12.item(i16).getAttributes().getNamedItem(MediationMetaData.KEY_NAME).setTextContent(element11.getAttribute(MediationMetaData.KEY_NAME).replaceAll("chelpa.disabled.", ""));
                                                        } else {
                                                            childNodes12.item(i16).getAttributes().getNamedItem(MediationMetaData.KEY_NAME).setTextContent("chelpa.disabled." + element11.getAttribute(MediationMetaData.KEY_NAME));
                                                        }
                                                        if (!f9362.contains(c3477.f10044)) {
                                                            f9362.add(c3477.f10044);
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                        i13++;
                                        childNodes9 = nodeList5;
                                        document8 = document9;
                                        str9 = str11;
                                    }
                                } else {
                                    i12++;
                                    elementsByTagName3 = nodeList4;
                                }
                            }
                            document3 = document8;
                        } else {
                            document3 = document2;
                        }
                        TransformerFactory.newInstance().newTransformer().transform(new DOMSource(document3), new StreamResult(new File(str7)));
                        m7942("Done");
                    } catch (IOException e6) {
                        e = e6;
                        str = str15;
                        str2 = str17;
                        str3 = str16;
                    } catch (ParserConfigurationException e7) {
                        e = e7;
                        str = str15;
                        str2 = str17;
                        str3 = str16;
                    } catch (TransformerConfigurationException e8) {
                        e = e8;
                        str = str15;
                        str2 = str17;
                        str3 = str16;
                    } catch (TransformerException e9) {
                        e = e9;
                        str = str15;
                        str2 = str17;
                        str3 = str16;
                    } catch (SAXException e10) {
                        e = e10;
                        str = str15;
                        str2 = str17;
                        str3 = str16;
                    }
                } catch (Exception e11) {
                    e = e11;
                    str = str15;
                    str2 = str17;
                    str3 = str16;
                    e.printStackTrace();
                    StringBuilder sb422222 = new StringBuilder();
                    String str2222222 = str3;
                    sb422222.append(mo1874().getDir(str2222222, 0));
                    sb422222.append(str2);
                    file = new File(sb422222.toString());
                    if (file.exists()) {
                    }
                    file2 = new File(mo1874().getDir(str2222222, 0) + str);
                    if (!file2.exists()) {
                    }
                }
            } catch (Exception e12) {
                e = e12;
                e.printStackTrace();
                StringBuilder sb4222222 = new StringBuilder();
                String str22222222 = str3;
                sb4222222.append(mo1874().getDir(str22222222, 0));
                sb4222222.append(str2);
                file = new File(sb4222222.toString());
                if (file.exists()) {
                }
                file2 = new File(mo1874().getDir(str22222222, 0) + str);
                if (!file2.exists()) {
                }
            }
            StringBuilder sb42222222 = new StringBuilder();
            String str222222222 = str3;
            sb42222222.append(mo1874().getDir(str222222222, 0));
            sb42222222.append(str2);
            file = new File(sb42222222.toString());
            if (file.exists()) {
                file.delete();
            }
            file2 = new File(mo1874().getDir(str222222222, 0) + str);
            if (!file2.exists()) {
                new C2500("");
                try {
                    C2500.m6875(file2, file);
                } catch (IllegalArgumentException e13) {
                    e13.printStackTrace();
                } catch (Exception e14) {
                    e14.printStackTrace();
                }
            }
        }
    }

    public boolean m8010(String str, String str2, Runnable runnable, Runnable runnable2) {
        boolean z;
        C2471 c2471;
        int i;
        Integer valueOf;
        boolean z2;
        boolean z3;
        boolean z4;
        boolean z5;
        try {
            m7960(41);
            m7942(str);
            m7942(str2);
            C2471 c24712 = null;
            int i2 = 0;
            boolean z6 = false;
            while (true) {
                if (i2 < 5) {
                    int i3 = i2 + 1;
                    try {
                        try {
                            c24712 = C2471.m6814(str);
                            c24712.m6838("User-Agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:65.0) Gecko/20100101 Firefox/65.0");
                            c24712.m6838("Accept-Encoding", "gzip,deflate");
                            c24712.m6823(false);
                            c24712.m6820(false);
                            c24712.m6836().setRequestMethod("GET");
                            c24712.m6836().setRequestProperty("Cache-Control", "no-cache");
                            c24712.m6827(1000000);
                        } catch (Exception e) {
                            e.printStackTrace();
                            c24712.m6832();
                        }
                    } catch (NumberFormatException e2) {
                        e2.printStackTrace();
                        c24712.m6832();
                    } catch (C2471.C2478 e3) {
                        e3.printStackTrace();
                        c24712.m6832();
                    }
                    if (c24712.m6834()) {
                        if (c24712.m6829() <= 0) {
                            i2 = i3;
                        } else {
                            int m6829 = c24712.m6829();
                            if (m6829 == 0) {
                                z5 = true;
                            } else {
                                z5 = false;
                            }
                            m7942(String.format("%s bytes found, %s Mb", Integer.valueOf(m6829), Float.valueOf(m6829 / 1048576.0f)));
                            z = z5;
                            c2471 = c24712;
                            i = m6829;
                            break;
                        }
                    } else {
                        i2 = i3;
                        z6 = true;
                    }
                } else {
                    z = z6;
                    c2471 = c24712;
                    i = 0;
                    break;
                }
            }
            m7942("num_bytes:" + i);
            valueOf = Integer.valueOf(i);
            try {
                m7954(new RunnableC3471(valueOf));
            } catch (Throwable th) {
                th = th;
                th.printStackTrace();
                return false;
            }
        } catch (Throwable th2) {
            th = th2;
        }
        if (new File(C2500.m7006() + str2).exists()) {
            if (!z) {
                m7942(Long.valueOf(new File(C2500.m7006() + str2).length()));
                m7942(Integer.valueOf(i));
                if (new File(C2500.m7006() + str2).length() != i) {
                }
            }
            z2 = true;
            if (z && !z2) {
                try {
                    m7942("try_get_bytes:" + i);
                    File file = new File(C2500.m7006());
                    if (!file.exists()) {
                        file.mkdirs();
                    }
                    File file2 = new File(file, str2);
                    if (file2.exists()) {
                        file2.delete();
                    }
                    FileOutputStream fileOutputStream = new FileOutputStream(file2);
                    InputStream m6819 = c2471.m6819();
                    byte[] bArr = new byte[ItemType.CLASS_DATA_ITEM];
                    int i4 = 0;
                    while (true) {
                        int read = m6819.read(bArr);
                        if (read == -1) {
                            break;
                        }
                        i4 += read;
                        C3746 c3746 = f9278;
                        if (c3746 != null && c3746.m8243()) {
                            f9278.m8249(i4 / 1024);
                            f9278.m8246(false, f9245.mo1874());
                        } else {
                            m7960(41);
                            C3746 c37462 = f9278;
                            if (c37462 != null && c37462.m8243()) {
                                f9278.m8247(valueOf.intValue() / 1024);
                                f9278.m8249(i4 / 1024);
                                f9278.m8246(false, f9245.mo1874());
                            }
                        }
                        fileOutputStream.write(bArr, 0, read);
                    }
                    fileOutputStream.close();
                    m6819.close();
                    c2471.m6832();
                } catch (IOException e4) {
                    e4.printStackTrace();
                    c2471.m6832();
                }
                if (new File(C2500.m7006() + str2).exists()) {
                    if (new File(C2500.m7006() + str2).length() == i) {
                        z3 = false;
                        z4 = true;
                        z2 = true;
                    } else {
                        new File(C2500.m7006() + str2).delete();
                        z3 = true;
                        z4 = false;
                        z2 = false;
                    }
                    m7951(41);
                    if (z3) {
                        m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.corrupt_download));
                    }
                    if (z && !z2) {
                        m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.internet_not_found));
                    }
                    if (z2) {
                        if (new File(C2500.m7006() + str2).exists()) {
                            try {
                                if (z2 && !z4 && runnable2 != null) {
                                    runnable2.run();
                                    return true;
                                }
                                if (z4 && runnable != null) {
                                    runnable.run();
                                    return true;
                                }
                            } catch (Exception e5) {
                                e5.printStackTrace();
                                m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.corrupt_download));
                            }
                        }
                    }
                    return false;
                }
            } else {
                if (new File(C2500.m7006() + str2).exists() && !z2) {
                    new File(C2500.m7006() + str2).delete();
                }
            }
            z3 = false;
            z4 = false;
            m7951(41);
            if (z3) {
            }
            if (z) {
                m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.internet_not_found));
            }
            if (z2) {
            }
            return false;
        }
        z2 = false;
        if (z) {
        }
        if (new File(C2500.m7006() + str2).exists()) {
            new File(C2500.m7006() + str2).delete();
        }
        z3 = false;
        z4 = false;
        m7951(41);
        if (z3) {
        }
        if (z) {
        }
        if (z2) {
        }
        return false;
    }

    void m8011(ArrayList<C2623> arrayList) {
        C2500.m6894(arrayList, new RunnableC3458(arrayList), new RunnableC3463(arrayList));
    }

    public void m8012() {
        String str;
        C2975 c2975 = this;
        C2810 c2810 = new C2810(f9388, c2975.f9426, Settings.Secure.getString(mo1874().getContentResolver(), "android_id"));
        String l = Long.toString(System.currentTimeMillis() + 62208000000L);
        String l2 = Long.toString(System.currentTimeMillis() + 62208000000L);
        String m7669 = c2810.m7669(l, "validityTimestamp");
        String m76692 = c2810.m7669("256", "lastResponse");
        String str2 = "retryUntil";
        String m76693 = c2810.m7669(l2, "retryUntil");
        String m76694 = c2810.m7669("10", "maxRetries");
        String m76695 = c2810.m7669("0", "retryCount");
        String str3 = m76692;
        String[] strArr = {"/data/data/", "/dbdata/databases/"};
        String[] strArr2 = c2975.f9428;
        String str4 = "lastResponse";
        int length = strArr2.length;
        String str5 = m76693;
        int i = 0;
        while (i < length) {
            int i2 = length;
            String str6 = strArr2[i];
            int i3 = i;
            String[] strArr3 = strArr2;
            int i4 = 0;
            for (int i5 = 2; i4 < i5; i5 = 2) {
                String str7 = strArr[i4];
                String[] strArr4 = strArr;
                StringBuilder sb = new StringBuilder();
                sb.append(str7);
                int i6 = i4;
                sb.append(c2975.f9426);
                sb.append(InternalZipConstants.ZIP_FILE_SEPARATOR);
                String str8 = str2;
                sb.append(c2975.f9427);
                sb.append(InternalZipConstants.ZIP_FILE_SEPARATOR);
                sb.append(str6);
                if (C2500.m6898(sb.toString())) {
                    StringBuilder sb2 = new StringBuilder();
                    String str9 = m76694;
                    sb2.append(mo1874().getFilesDir());
                    sb2.append(InternalZipConstants.ZIP_FILE_SEPARATOR);
                    sb2.append(str6);
                    File file = new File(sb2.toString());
                    File file2 = new File(str7 + c2975.f9426 + InternalZipConstants.ZIP_FILE_SEPARATOR + c2975.f9427 + InternalZipConstants.ZIP_FILE_SEPARATOR + str6);
                    try {
                        file.createNewFile();
                        FileOutputStream fileOutputStream = new FileOutputStream(file);
                        XmlSerializer newSerializer = Xml.newSerializer();
                        newSerializer.setOutput(fileOutputStream, "UTF-8");
                        newSerializer.startDocument(null, Boolean.TRUE);
                        newSerializer.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true);
                        newSerializer.startTag(null, PolicyMappingsExtension.MAP);
                        newSerializer.startTag(null, "string");
                        newSerializer.attribute("", MediationMetaData.KEY_NAME, "validityTimestamp");
                        newSerializer.text(m7669);
                        newSerializer.endTag(null, "string");
                        newSerializer.startTag(null, "string");
                        newSerializer.attribute("", MediationMetaData.KEY_NAME, "retryCount");
                        newSerializer.text(m76695);
                        newSerializer.endTag(null, "string");
                        newSerializer.startTag(null, "string");
                        newSerializer.attribute("", MediationMetaData.KEY_NAME, "maxRetries");
                        m76694 = str9;
                        try {
                            newSerializer.text(m76694);
                            newSerializer.endTag(null, "string");
                            newSerializer.startTag(null, "string");
                            try {
                                newSerializer.attribute("", MediationMetaData.KEY_NAME, str8);
                                str8 = str8;
                                String str10 = str5;
                                try {
                                    newSerializer.text(str10);
                                    str5 = str10;
                                    newSerializer.endTag(null, "string");
                                    newSerializer.startTag(null, "string");
                                    String str11 = str4;
                                    try {
                                        newSerializer.attribute("", MediationMetaData.KEY_NAME, str11);
                                        str4 = str11;
                                        str = str3;
                                    } catch (Exception unused) {
                                        str4 = str11;
                                    }
                                } catch (Exception unused2) {
                                    str5 = str10;
                                }
                            } catch (Exception unused3) {
                                str8 = str8;
                            }
                            try {
                                newSerializer.text(str);
                                str3 = str;
                                newSerializer.endTag(null, "string");
                                newSerializer.endTag(null, PolicyMappingsExtension.MAP);
                                newSerializer.endDocument();
                                newSerializer.flush();
                                fileOutputStream.close();
                            } catch (Exception unused4) {
                                str3 = str;
                                C2500.m6877(mo1874().getFilesDir() + InternalZipConstants.ZIP_FILE_SEPARATOR + str6, file2.getAbsolutePath(), false, false);
                                if (new File(mo1874().getFilesDir() + InternalZipConstants.ZIP_FILE_SEPARATOR + str6).exists()) {
                                }
                                C2500.m7093("chmod 777 " + file2.getAbsolutePath());
                                i4 = i6 + 1;
                                c2975 = this;
                                strArr = strArr4;
                                str2 = str8;
                            }
                        } catch (Exception unused5) {
                        }
                    } catch (Exception unused6) {
                        m76694 = str9;
                    }
                    C2500.m6877(mo1874().getFilesDir() + InternalZipConstants.ZIP_FILE_SEPARATOR + str6, file2.getAbsolutePath(), false, false);
                    if (new File(mo1874().getFilesDir() + InternalZipConstants.ZIP_FILE_SEPARATOR + str6).exists()) {
                        new File(mo1874().getFilesDir() + InternalZipConstants.ZIP_FILE_SEPARATOR + str6).delete();
                    }
                    C2500.m7093("chmod 777 " + file2.getAbsolutePath());
                }
                i4 = i6 + 1;
                c2975 = this;
                strArr = strArr4;
                str2 = str8;
            }
            i = i3 + 1;
            c2975 = this;
            length = i2;
            strArr2 = strArr3;
        }
    }

    public void m8013() {
        m7956(new RunnableC3267());
    }

    public void m8014() {
        m7956(new RunnableC3359());
    }

    public void m8015() {
        m7956(new RunnableC3235());
    }

    public void m8016() {
        m7956(new RunnableC3380());
    }

    public void m8017() {
        m7956(new RunnableC3372());
    }

    public void m8018() {
        PackageInfo packageInfo;
        ActivityInfo[] activityInfoArr;
        int i;
        ActivityInfo[] activityInfoArr2;
        ProviderInfo[] providerInfoArr;
        ServiceInfo[] serviceInfoArr;
        C2931<C2935> c2931;
        int i2;
        int i3;
        int i4;
        ArrayList arrayList = new ArrayList();
        try {
            packageInfo = m7932().getPackageInfo(f9253.f10046, 12815);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
            packageInfo = null;
        } catch (RuntimeException e2) {
            e2.printStackTrace();
            try {
                packageInfo = m7932().getPackageInfo(f9253.f10046, 12814);
            } catch (PackageManager.NameNotFoundException e3) {
                e3.printStackTrace();
                packageInfo = null;
                activityInfoArr = packageInfo.activities;
                if (activityInfoArr != null) {
                    arrayList.add(new C2935(C2500.m7007(R.string.header_activities), true, false, false, false, false, false, true));
                    while (i4 < packageInfo.activities.length) {
                    }
                }
                activityInfoArr2 = packageInfo.receivers;
                if (activityInfoArr2 != null) {
                    arrayList.add(new C2935(C2500.m7007(R.string.header_receivers), true, false, false, false, false, false, true));
                    while (i3 < packageInfo.receivers.length) {
                    }
                }
                providerInfoArr = packageInfo.providers;
                if (providerInfoArr != null) {
                    arrayList.add(new C2935(C2500.m7007(R.string.header_providers), true, false, false, false, false, false, true));
                    while (i2 < packageInfo.providers.length) {
                    }
                }
                serviceInfoArr = packageInfo.services;
                if (serviceInfoArr != null) {
                    arrayList.add(new C2935(C2500.m7007(R.string.header_services), true, false, false, false, false, false, true));
                    while (i < packageInfo.services.length) {
                    }
                }
                if (arrayList.size() <= 0) {
                }
                c2931 = f9266;
                if (c2931 != null) {
                }
                f9266 = new C3015(mo1874(), R.layout.contextmenu, arrayList);
            }
        }
        activityInfoArr = packageInfo.activities;
        if (activityInfoArr != null && activityInfoArr.length != 0) {
            arrayList.add(new C2935(C2500.m7007(R.string.header_activities), true, false, false, false, false, false, true));
            for (i4 = 0; i4 < packageInfo.activities.length; i4++) {
                if (m7932().getComponentEnabledSetting(new ComponentName(f9253.f10046, packageInfo.activities[i4].name)) == 2) {
                    arrayList.add(new C2935(packageInfo.activities[i4].name, false, false, true, false, false, false, false));
                } else {
                    arrayList.add(new C2935(packageInfo.activities[i4].name, true, false, true, false, false, false, false));
                }
            }
        }
        activityInfoArr2 = packageInfo.receivers;
        if (activityInfoArr2 != null && activityInfoArr2.length != 0) {
            arrayList.add(new C2935(C2500.m7007(R.string.header_receivers), true, false, false, false, false, false, true));
            for (i3 = 0; i3 < packageInfo.receivers.length; i3++) {
                if (m7932().getComponentEnabledSetting(new ComponentName(f9253.f10046, packageInfo.receivers[i3].name)) == 2) {
                    arrayList.add(new C2935(packageInfo.receivers[i3].name, false, false, false, false, false, true, false));
                } else {
                    arrayList.add(new C2935(packageInfo.receivers[i3].name, true, false, false, false, false, true, false));
                }
            }
        }
        providerInfoArr = packageInfo.providers;
        if (providerInfoArr != null && providerInfoArr.length != 0) {
            arrayList.add(new C2935(C2500.m7007(R.string.header_providers), true, false, false, false, false, false, true));
            for (i2 = 0; i2 < packageInfo.providers.length; i2++) {
                if (m7932().getComponentEnabledSetting(new ComponentName(f9253.f10046, packageInfo.providers[i2].name)) == 2) {
                    arrayList.add(new C2935(packageInfo.providers[i2].name, false, false, false, true, false, false, false));
                } else {
                    arrayList.add(new C2935(packageInfo.providers[i2].name, true, false, false, true, false, false, false));
                }
            }
        }
        serviceInfoArr = packageInfo.services;
        if (serviceInfoArr != null && serviceInfoArr.length != 0) {
            arrayList.add(new C2935(C2500.m7007(R.string.header_services), true, false, false, false, false, false, true));
            for (i = 0; i < packageInfo.services.length; i++) {
                if (m7932().getComponentEnabledSetting(new ComponentName(f9253.f10046, packageInfo.services[i].name)) == 2) {
                    arrayList.add(new C2935(packageInfo.services[i].name, false, false, false, false, true, false, false));
                } else {
                    arrayList.add(new C2935(packageInfo.services[i].name, true, false, false, false, true, false, false));
                }
            }
        }
        if (arrayList.size() <= 0) {
            arrayList.add(new C2935(C2500.m7007(R.string.permission_not_found), true, false, false, false, false, false, true));
        }
        c2931 = f9266;
        if (c2931 != null) {
            c2931.notifyDataSetChanged();
        }
        f9266 = new C3015(mo1874(), R.layout.contextmenu, arrayList);
    }

    @Override
    public ActivityC0588 mo1874() {
        if (m1885()) {
            f9259 = (MainActivity) m1860();
        }
        if (f9259 == null) {
            f9259 = (MainActivity) App.getInstance();
        }
        return f9259;
    }

    public void m8020() {
        PackageInfo packageInfo;
        ArrayList arrayList = new ArrayList();
        try {
            packageInfo = m7932().getPackageInfo(f9253.f10046, 8705);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
            packageInfo = null;
        }
        for (int i = 0; i < packageInfo.activities.length; i++) {
            if (m7932().getComponentEnabledSetting(new ComponentName(f9253.f10046, packageInfo.activities[i].name)) == 2) {
                if (!packageInfo.activities[i].name.startsWith("disabled_")) {
                    arrayList.add(new C3477(packageInfo.activities[i].name, false));
                }
            } else if (!packageInfo.activities[i].name.startsWith("disabled_")) {
                arrayList.add(new C3477(packageInfo.activities[i].name, true));
            }
        }
        if (arrayList.size() <= 0) {
            arrayList.add(new C3477(C2500.m7007(R.string.permission_not_found), false));
        }
        C2931<C3477> c2931 = f9265;
        if (c2931 != null) {
            c2931.notifyDataSetChanged();
        }
        C3012 c3012 = new C3012(mo1874(), R.layout.contextmenu, arrayList);
        f9265 = c3012;
        c3012.sort(new C3014());
    }

    List<String> m8021() {
        ArrayList arrayList = new ArrayList();
        ArrayList<String> arrayList2 = new ArrayList();
        try {
            arrayList2.add("android.permission.WRITE_EXTERNAL_STORAGE");
            try {
                int i = 0;
                if (m7929().getPackageName().contains("installer")) {
                    for (String str : arrayList2) {
                        if (C4318.m9645(mo1874(), str) != 0) {
                            arrayList.add(str);
                        }
                    }
                    Iterator it = arrayList.iterator();
                    while (it.hasNext()) {
                        m7942((String) it.next());
                    }
                    if (arrayList.size() > 0) {
                        String[] strArr = (String[]) arrayList.toArray(new String[arrayList.size()]);
                        m1832(strArr, 555);
                        int length = strArr.length;
                        while (i < length) {
                            m7942("ask:" + strArr[i]);
                            i++;
                        }
                    } else {
                        this.f9416.run();
                    }
                } else {
                    PackageInfo packageInfo = m7932().getPackageInfo(m7929().getPackageName(), 12288);
                    for (int i2 = 0; i2 < packageInfo.requestedPermissions.length; i2++) {
                        if (C4318.m9645(mo1874(), packageInfo.requestedPermissions[i2]) != 0) {
                            arrayList.add(packageInfo.requestedPermissions[i2]);
                        }
                    }
                    if (arrayList.size() > 0) {
                        String[] strArr2 = (String[]) arrayList.toArray(new String[arrayList.size()]);
                        if (!arrayList.contains("android.permission.WRITE_EXTERNAL_STORAGE") && !arrayList.contains("android.permission.READ_EXTERNAL_STORAGE") && ((m7928().getBoolean("LOCATION_PERMISSION_BLOCK", false) || (!arrayList.contains("android.permission.ACCESS_FINE_LOCATION") && !arrayList.contains("android.permission.ACCESS_COARSE_LOCATION"))) && (m7928().getBoolean("PHONE_PERMISSION_BLOCK", false) || !arrayList.contains("android.permission.READ_PHONE_STATE")))) {
                            m8046(strArr2, 555);
                            int length2 = strArr2.length;
                            while (i < length2) {
                                m7942("ask:" + strArr2[i]);
                                i++;
                            }
                        }
                        SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();
                        spannableStringBuilder.append((CharSequence) C2500.m6934(C2500.m7007(R.string.info_about_permissions_required), "#00FF00", "bold"));
                        spannableStringBuilder.append((CharSequence) C2500.m6934(C2500.m7007(R.string.info_about_permissions_required_perms), "#FFFFFF", ""));
                        spannableStringBuilder.append((CharSequence) C2500.m6934(C2500.m7007(R.string.info_about_permissions_required_describe) + "\n", "#AAAAAA", ""));
                        spannableStringBuilder.append((CharSequence) C2500.m6934(C2500.m7007(R.string.info_about_permissions_optional), "#FFFF00", "bold"));
                        spannableStringBuilder.append((CharSequence) C2500.m6934(C2500.m7007(R.string.info_about_permissions_optional_perms), "#FFFFFF", ""));
                        spannableStringBuilder.append((CharSequence) C2500.m6934(C2500.m7007(R.string.info_about_permissions_optional_describe) + "\n", "#AAAAAA", ""));
                        C2500.m7122(C2500.m7007(R.string.information), spannableStringBuilder, C2500.m7007(R.string.provide), new DialogInterfaceOnClickListenerC3094(strArr2), null, null, new DialogInterfaceOnCancelListenerC3097(strArr2));
                    } else {
                        this.f9416.run();
                    }
                }
            } catch (Exception unused) {
                this.f9416.run();
            }
        } catch (Throwable th) {
            th.printStackTrace();
        }
        return arrayList;
    }

    public void m8022() {
        File file = new File(mo1874().getDir("packages", 0) + "/packages1.xml");
        if (file.exists()) {
            file.delete();
        }
        File file2 = new File(mo1874().getDir("packages", 0) + "/packages.xml");
        if (file2.exists()) {
            file2.delete();
        }
        try {
            C2500.m7093("chmod 0777 /data/system/packages.xml");
            m7942(new C2500("").m7211(f9284 + C1668.class.getName() + " /data/system/packages.xml " + mo1874().getDir("packages", 0).getAbsolutePath() + "/packages1.xml"));
            m7942(new C2500("").m7211(f9284 + C1668.class.getName() + " /data/system/packages.xml " + mo1874().getDir("packages", 0).getAbsolutePath() + "/packages.xml"));
            StringBuilder sb = new StringBuilder();
            sb.append(mo1874().getDir("packages", 0).getAbsolutePath());
            sb.append("/packages1.xml");
            C2500.m7105(sb.toString());
            C2500.m7105(mo1874().getDir("packages", 0).getAbsolutePath() + "/packages.xml");
        } catch (Exception e) {
            e.printStackTrace();
        }
        String str = mo1874().getDir("packages", 0).getAbsolutePath() + "/packages.xml";
        if (!new File(str).exists() && new File(str).length() == 0) {
            try {
                C2500.m6877("/dbdata/system/packages.xml", mo1874().getDir("packages", 0).getAbsolutePath() + "/packages1.xml", false, true);
                C2500.m6877("/dbdata/system/packages.xml", mo1874().getDir("packages", 0).getAbsolutePath() + "/packages.xml", false, true);
                C2500.m7093("chmod 0777 " + mo1874().getDir("packages", 0).getAbsolutePath() + "/packages1.xml");
                C2500.m7093("chmod 0777 " + mo1874().getDir("packages", 0).getAbsolutePath() + "/packages.xml");
            } catch (Exception e2) {
                e2.printStackTrace();
            }
            if (!new File(mo1874().getDir("packages", 0).getAbsolutePath() + "/packages.xml").exists()) {
                Toast.makeText(mo1874(), "Error: packages.xml not found!", 1).show();
            }
        }
    }

    public void m8023() {
        f9334 = false;
        f9335.m7901();
        f9333.setVisibility(8);
        ((LinearLayout) f9259.findViewById(R.id.listapps)).setVisibility(0);
        if (f9243) {
            mo1800();
            f9243 = false;
        }
    }

    public void m8024(File file, boolean z) {
        m7956(new RunnableC3081(file, z));
    }

    public void m8025(C2939 c2939, boolean z) {
        if (m7966(true)) {
            C3549.m8183();
            f9401 = z;
            this.f9431 = "empty";
            String str = c2939.f9151;
            if (str != null) {
                m7956(new RunnableC2986(str, c2939));
                return;
            }
            return;
        }
        C3743 c3743 = f9276;
        if (c3743 != null && c3743.m8236()) {
            f9276.m8235();
        }
    }

    public void m8026() {
    }

    public void m8027() {
        if (m7928().getBoolean("vibration", false)) {
            Vibrator vibrator = (Vibrator) mo1874().getSystemService("vibrator");
            f9346 = vibrator;
            vibrator.vibrate(50L);
        }
        m7951(6);
        new Thread(new RunnableC3269()).start();
    }

    public void m8028() {
        m7956(new RunnableC3277());
    }

    public void m8029() {
        new Thread(new RunnableC3432()).start();
    }

    public void m8030(String str, boolean z) {
        m7956(new RunnableC3433(str, z));
    }

    public void m8031() {
        if (m7928().getBoolean("vibration", false)) {
            Vibrator vibrator = (Vibrator) mo1874().getSystemService("vibrator");
            f9346 = vibrator;
            vibrator.vibrate(50L);
        }
        C3478 c3478 = f9253;
        DialogInterfaceOnClickListenerC3281 dialogInterfaceOnClickListenerC3281 = new DialogInterfaceOnClickListenerC3281(c3478);
        C2500.m7125(c3478.f10047, C2500.m7007(R.string.move_to_internal_message), dialogInterfaceOnClickListenerC3281, dialogInterfaceOnClickListenerC3281, null);
    }

    public void m8032() {
        if (m7928().getBoolean("vibration", false)) {
            Vibrator vibrator = (Vibrator) mo1874().getSystemService("vibrator");
            f9346 = vibrator;
            vibrator.vibrate(50L);
        }
        C3478 c3478 = f9253;
        DialogInterfaceOnClickListenerC3285 dialogInterfaceOnClickListenerC3285 = new DialogInterfaceOnClickListenerC3285(c3478);
        C2500.m7125(c3478.f10047, C2500.m7007(R.string.move_to_sdcard_message), dialogInterfaceOnClickListenerC3285, dialogInterfaceOnClickListenerC3285, null);
    }

    public void m8033() {
        m7956(new RunnableC3273());
    }

    public void m8034() {
        m7956(new RunnableC3029());
    }

    public void m8035(C3478 c3478) {
        try {
            String str = "not_system";
            if (c3478.f10061) {
                str = "system";
            }
            f9248 = "";
            C2500 c2500 = new C2500("");
            StringBuilder sb = new StringBuilder();
            sb.append(f9284);
            sb.append(C1549.class.getName());
            sb.append(" ");
            sb.append(c3478.f10046);
            sb.append(" ");
            sb.append(m7932().getPackageInfo(c3478.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir);
            sb.append(" ");
            sb.append(str);
            sb.append(" ");
            sb.append(m7929().getFilesDir());
            sb.append(" ");
            sb.append(m7932().getPackageInfo(c3478.f10046, 0).applicationInfo.uid);
            String m7211 = c2500.m7211(sb.toString());
            f9248 = m7211;
            String[] strArr = new String[m7211.split("\n").length];
            for (String str2 : f9248.split("\n")) {
                if (str2.contains("Changes Fix to: ")) {
                    str2.replace("Changes Fix to: ", "");
                    f9252.m8115(c3478.f10046).f10062 = true;
                    C3479 c3479 = f9252;
                    c3479.m8117(c3479.m8115(c3478.f10046));
                    Toast.makeText(mo1874(), "Dalvik-cache fixed!", 1).show();
                }
            }
            f9252.m8123(c3478.f10046);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void m8036() {
        DialogInterfaceOnClickListenerC3127 dialogInterfaceOnClickListenerC3127 = new DialogInterfaceOnClickListenerC3127();
        C2500.m7125(C2500.m7007(R.string.warning), C2500.m7007(R.string.odex_all_system_app_message), dialogInterfaceOnClickListenerC3127, dialogInterfaceOnClickListenerC3127, null);
    }

    public void m8037() {
        ArrayList arrayList = new ArrayList();
        arrayList.add(new C3727(R.string.menu_download_custom_patches, 0, "#cccccc", R.drawable.update));
        arrayList.add(new C3727(R.string.context_menu_settings_show_last_added_custom_patches, 0, "#cccccc", R.drawable.update));
        arrayList.add(new C3727(R.string.toolbar_refresh_apps, 0, "#cccccc", R.drawable.update));
        arrayList.add(new C3727(R.string.settings, 0, "#cccccc", R.drawable.settings));
        if (XposedUtils.isXposedEnabled()) {
            arrayList.add(new C3727(R.string.xposed_settings, 0, "#cccccc", R.drawable.settings));
        }
        if (f9283) {
            arrayList.add(new C3727(R.string.truble, 0, "#cccccc", R.drawable.faq));
        }
        arrayList.add(new C3727(R.string.aboutmenu, 0, "#cccccc", R.drawable.faq));
        C3549.m8161(arrayList, false);
    }

    public void m8038() {
        String string;
        String str;
        String str2;
        String str3;
        String m7211;
        String str4 = "/mnt/sdcard";
        String str5 = "path";
        if (C2500.m6898("/data/data/com.maxmpz.audioplayer/databases/folders.db-wal")) {
            C2500.m7093("rm /data/data/com.maxmpz.audioplayer/databases/folders.db-wal");
        }
        if (C2500.m6898("/data/data/com.maxmpz.audioplayer/databases/folders.db-shm")) {
            C2500.m7093("rm /data/data/com.maxmpz.audioplayer/databases/folders.db-shm");
        }
        C2810 c2810 = new C2810(new byte[]{19, -31, -111, -52, 0, 41, 12, 98, 21, 88, RegisterType.DOUBLE_LO, 2, -34, 94, DerValue.tag_GeneralizedTime, -9, 31, DerValue.tag_IA5String, -95, 99}, "com.maxmpz.audioplayer", Settings.Secure.getString(mo1874().getContentResolver(), "android_id") + Build.FINGERPRINT);
        C2810.f8978 = "com.maxmpz.audioplayer|";
        String m7669 = c2810.m7669("2147483645|1344880878|0|1407088878", "");
        boolean z = false;
        if (C2500.m7051()) {
            if (f9299 >= 23) {
                m7211 = new C2500("").m7211(f9284 + C1555.class.getName() + " " + m7669 + " " + f9250);
            } else {
                m7211 = new C2500("").m7211(f9285 + C1555.class.getName() + " " + m7669 + " " + f9250);
            }
            f9323 = Boolean.FALSE;
            m7942(m7211);
        } else {
            SQLiteDatabase sQLiteDatabase = null;
            try {
                C2500.m6877("/data/data/com.maxmpz.audioplayer/databases/folders.db", mo1874().getFilesDir().getAbsolutePath() + "/folders.db", false, false);
                String absolutePath = mo1874().getFilesDir().getAbsolutePath();
                C2500.m7093("chmod 777 " + absolutePath + "/folders.db");
                if (new File(absolutePath + "/folders.db").exists()) {
                    sQLiteDatabase = SQLiteDatabase.openDatabase(absolutePath + "/folders.db", null, 0);
                    Cursor query = sQLiteDatabase.query("storages", new String[]{"_id", "path", "path_hash", "updated_at"}, null, null, null, null, null);
                    query.moveToFirst();
                    while (true) {
                        String string2 = query.getString(query.getColumnIndex("_id"));
                        string = query.getString(query.getColumnIndex(str5));
                        try {
                            if (!query.moveToNext()) {
                                break;
                            }
                            str = str4;
                            try {
                                str3 = str5;
                            } catch (Exception unused) {
                                str3 = str5;
                            }
                            if (string.length() < 4) {
                                break;
                            }
                            try {
                                m7942("2 " + string);
                            } catch (Exception unused2) {
                                string = Environment.getExternalStorageDirectory().getAbsolutePath();
                                m7942("3 " + string);
                                if (string != null) {
                                }
                                sQLiteDatabase.execSQL("UPDATE storages SET path='" + string + "',path_hash='" + m7669 + "',updated_at='" + System.currentTimeMillis() + "' WHERE _id='" + string2 + "'");
                                str4 = str;
                                str5 = str3;
                                z = true;
                            }
                            if (string != null) {
                                string = str;
                            }
                            sQLiteDatabase.execSQL("UPDATE storages SET path='" + string + "',path_hash='" + m7669 + "',updated_at='" + System.currentTimeMillis() + "' WHERE _id='" + string2 + "'");
                            str4 = str;
                            str5 = str3;
                            z = true;
                        } catch (Exception unused3) {
                            str = str4;
                            query.close();
                        }
                    }
                    if (string == null) {
                        str2 = str;
                    } else {
                        str2 = string;
                    }
                    m7942("4 " + str2);
                    if (!z) {
                        sQLiteDatabase.execSQL("UPDATE storages SET path='" + str2 + "',path_hash='" + m7669 + "',updated_at='" + System.currentTimeMillis() + "'");
                    }
                    sQLiteDatabase.close();
                    C2500.m6877(mo1874().getFilesDir().getAbsolutePath() + "/folders.db", "/data/data/com.maxmpz.audioplayer/databases/folders.db", true, true);
                    if (new File(absolutePath + "/folders.db").exists()) {
                        new File(absolutePath + "/folders.db").delete();
                    } else {
                        f9248 = "SU Java-Code Running!\nYou must run Poweramp before patch!\nRun Poweramp and apply custom patch again!\n\nGood Luck!\nSaNX@forpda.ru";
                    }
                } else {
                    throw null;
                }
            } catch (Exception e) {
                m7942("LuckyPatcher: SQL error - " + e);
                sQLiteDatabase.close();
                if (new File(mo1874().getFilesDir().getAbsolutePath() + "/folders.db").exists()) {
                    new File(mo1874().getFilesDir().getAbsolutePath() + "/folders.db").delete();
                }
            }
        }
        File file = new File("/data/data/com.maxmpz.audioplayer/shared_prefs/l.xml");
        File file2 = new File("/dbdata/databases/com.maxmpz.audioplayer/shared_prefs/l.xml");
        if (C2500.m6898(file.getAbsolutePath())) {
            C2500.m7093("rm " + file.getAbsolutePath());
        }
        if (C2500.m6898(file2.getAbsolutePath())) {
            C2500.m7093("rm " + file2.getAbsolutePath());
        }
    }

    public void m8039() {
        new C2500("").m7211(f9284 + C1557.class.getName() + " 1");
    }

    public void m8040() {
        int i;
        File file = new File(f9250 + "/reboot");
        String str = Build.CPU_ABI;
        if (str.toLowerCase().trim().equals("x86")) {
            i = R.raw.rebootx86;
        } else if (str.toUpperCase().trim().equals("MIPS")) {
            i = R.raw.rebootmips;
        } else {
            i = R.raw.reboot;
        }
        if (!file.exists() || file.length() != C2500.m6983(i)) {
            try {
                C2500.m6984(i, new File(f9250 + "/reboot"));
            } catch (Exception unused) {
            }
            try {
                C2500.m6941(new File(file.getAbsolutePath()), 777);
            } catch (Exception e) {
                m7942(e);
                e.printStackTrace();
            }
            C2500.m7093("chmod 777 " + file.getAbsolutePath());
            C2500.m7093("chown 0.0 " + file.getAbsolutePath());
            C2500.m7093("chown 0:0 " + file.getAbsolutePath());
        }
    }

    public void m8041() {
        m7956(new RunnableC3450());
    }

    public void m8042() {
        f9260 = new ArrayList<>();
        String string = m7928().getString("patch_dalvik_on_boot_patterns", "");
        if (!string.equals("") && (string.contains("patch1") || string.contains("patch1") || string.contains("patch1"))) {
            f9260.add(new C3478(mo1874(), C2500.m7007(R.string.android_patches_for_bootlist), C2500.m7007(R.string.android_patches_for_bootlist), false, 0, "", 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, null, 0, 0, "", false, false, false, 0, 0, false));
        }
        try {
            for (File file : mo1874().getDir("bootlist", 0).listFiles()) {
                if (!file.getName().endsWith("bootlist")) {
                    try {
                        m7932().getPackageInfo(file.getName(), ItemType.CLASS_DATA_ITEM);
                    } catch (PackageManager.NameNotFoundException unused) {
                        f9260.add(new C3478(mo1874(), file.getName(), file.getName(), false, 0, "���������� �������", 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, null, 0, 0, "", false, false, false, 0, 0, false));
                    }
                }
            }
            int i = 0;
            while (true) {
                C3478[] c3478Arr = f9252.f10079;
                if (i < c3478Arr.length) {
                    if (c3478Arr[i].f10054) {
                        if (new File(mo1874().getDir("bootlist", 0) + InternalZipConstants.ZIP_FILE_SEPARATOR + f9252.f10079[i].f10046).exists()) {
                            f9260.add(new C3478(mo1874(), f9252.f10079[i]));
                            i++;
                        }
                    }
                    C3478 c3478 = f9252.f10079[i];
                    if (c3478.f10052 || c3478.f10053 || c3478.f10055) {
                        f9260.add(new C3478(mo1874(), f9252.f10079[i]));
                    }
                    i++;
                } else {
                    return;
                }
            }
        } catch (Exception unused2) {
            m7942("LuckyPatcher Error: Refresh BootList");
        }
    }

    public void m8043(C3478 c3478) {
        if (!C2500.m7047(c3478.f10046)) {
            m7956(new RunnableC3167(c3478));
        } else {
            m7956(new RunnableC3168(c3478));
        }
    }

    public void m8044() {
        DialogInterfaceOnClickListenerC3131 dialogInterfaceOnClickListenerC3131 = new DialogInterfaceOnClickListenerC3131();
        C2500.m7125(C2500.m7007(R.string.warning), C2500.m7007(R.string.remove_all_saved_purchases_message), dialogInterfaceOnClickListenerC3131, dialogInterfaceOnClickListenerC3131, null);
    }

    public void m8045() {
        DialogInterfaceOnClickListenerC3134 dialogInterfaceOnClickListenerC3134 = new DialogInterfaceOnClickListenerC3134();
        C2500.m7125(C2500.m7007(R.string.warning), C2500.m7007(R.string.message_remove_all_odex), dialogInterfaceOnClickListenerC3134, dialogInterfaceOnClickListenerC3134, null);
    }

    public void m8046(String[] strArr, int i) {
        for (String str : strArr) {
            if (str.equals("android.permission.WRITE_EXTERNAL_STORAGE")) {
                if (f9299 >= 30) {
                    C2500.m7001();
                } else {
                    m1832(new String[]{str}, 555);
                }
            }
        }
        m1832(strArr, 555);
    }

    public void m8047(C3478 c3478, File file) {
        if (m7966(true)) {
            this.f9429 = file;
            new File(f9251 + "/Backup/").mkdirs();
            m7956(new RunnableC3150(file));
        }
    }

    public void m8048(C2939 c2939) {
        try {
            m7932().getPackageInfo(c2939.f9151, ItemType.CLASS_DATA_ITEM);
            if (m7966(true)) {
                m7954(new RunnableC3369(c2939, new DialogInterfaceOnClickListenerC3374(c2939)));
            }
        } catch (PackageManager.NameNotFoundException unused) {
            m7954(new RunnableC3392());
        }
    }

    public void m8049(int i) {
        PackageInfo m6974;
        ServiceInfo[] serviceInfoArr;
        PackageInfo m69742;
        ServiceInfo[] serviceInfoArr2;
        boolean z;
        JSONException jSONException;
        JSONObject jSONObject;
        ServiceInfo[] serviceInfoArr3;
        ServiceInfo[] serviceInfoArr4;
        File file = null;
        PackageInfo packageInfo = null;
        PackageInfo packageInfo2 = null;
        boolean z2 = false;
        try {
            switch (i) {
                case R.string.aboutmenu:
                    m8065();
                    if (i != R.string.settings && i != R.string.toolbar_system_utils && f9334) {
                        m8023();
                        return;
                    }
                    return;
                case R.string.add_icon_to_desktop:
                    C2975 c2975 = f9245;
                    if (c2975 != null) {
                        c2975.m7971(m7929());
                        f9245.mo1874().finish();
                    }
                    if (i != R.string.settings) {
                        return;
                    } else {
                        return;
                    }
                case R.string.app_info:
                    C3549.m8196(new File(f9282));
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.billing_hack_menu:
                    if (m7929().getPackageManager().getComponentEnabledSetting(new ComponentName(m7929(), (Class<?>) InAppBillingService.class)) == 2) {
                        m7932().setComponentEnabledSetting(new ComponentName(m7929(), (Class<?>) InAppBillingService.class), 1, 1);
                    } else {
                        m7932().setComponentEnabledSetting(new ComponentName(m7929(), (Class<?>) InAppBillingService.class), 2, 1);
                        C2500.m7056(true);
                    }
                    if (f9283) {
                        C2500.m7056(true);
                        C2500.m7058(true);
                    }
                    Intent intent = new Intent(m7929(), (Class<?>) Widget4.class);
                    intent.setPackage(m7929().getPackageName());
                    intent.setAction(Widget4.f4832);
                    m7929().sendBroadcast(intent);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.billing_proxy_server_for_support_patch_inapp:
                    C2500.m7065(true, true, false);
                    String str = C2500.m6922(f9250 + "/pinapp.apk", 1).packageName;
                    try {
                        if (m7932().getPackageInfo(str, ItemType.CLASS_DATA_ITEM).applicationInfo.enabled) {
                            if (f9283) {
                                new Thread(new RunnableC3222(str)).start();
                            } else {
                                C2500.m7153(f9259, str, Integer.valueOf(f9396));
                            }
                        } else if (f9283) {
                            new Thread(new RunnableC3225(str)).start();
                        }
                    } catch (PackageManager.NameNotFoundException unused) {
                        m7932().setComponentEnabledSetting(new ComponentName(m7929(), (Class<?>) InAppBillingService.class), 1, 1);
                        m7954(new RunnableC3228());
                    }
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.bootview:
                    m7951(3);
                    m7960(3);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.cleardalvik:
                    m7979();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.cloneApplication:
                    m7951(7);
                    if (f9282.equals("")) {
                        C3549.m8171(true, null);
                    } else {
                        C3549.m8171(true, new File(f9282));
                    }
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.context_install:
                    m7956(new RunnableC3233());
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.context_install_as_system:
                    m7951(7);
                    m7956(new RunnableC3241());
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.context_integrate_dalvik:
                    m7956(new RunnableC3234());
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.context_integrate_update_selected_apps:
                    f9327 = R.string.button_integrate_update_apps;
                    m8054();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.context_menu_settings_show_last_added_custom_patches:
                    Intent intent2 = new Intent("android.intent.action.VIEW");
                    intent2.setData(Uri.parse("https://patch.chelpus.com/"));
                    try {
                        m1852(intent2);
                    } catch (ActivityNotFoundException unused2) {
                        m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.warning_message_browser_not_found));
                    } catch (IllegalStateException e) {
                        e.printStackTrace();
                    }
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.context_move_selected_apps_to_internal:
                    f9327 = R.string.button_move_to_internal;
                    m8054();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.context_move_selected_apps_to_sdcard:
                    f9327 = R.string.button_move_to_sdcard;
                    m8054();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.context_original_resign_app:
                    if (f9282.equals("")) {
                        C3549.m8181(true, null);
                    } else {
                        C3549.m8181(true, new File(f9282));
                    }
                    m7951(7);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.context_patch_framework:
                    f9282 = f9366.f7520;
                    m7999();
                    m7951(7);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.context_purchases_sorter:
                    C3549.m8165(f9253.f10046);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.context_rebuild:
                    m7956(new RunnableC3239());
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.context_removeAds:
                    m7951(7);
                    C3549.m8173(false, null, null);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.context_remove_patch_boot:
                    try {
                        File file2 = new File(mo1874().getDir("bootlist", 0).getAbsolutePath() + InternalZipConstants.ZIP_FILE_SEPARATOR + f9253.f10046);
                        if (file2.exists()) {
                            file2.delete();
                        }
                        if (!file2.exists()) {
                            m7962(C2500.m7007(R.string.well_done), C2500.m7007(R.string.message_for_removed_patch_boot));
                            C3478 c3478 = f9253;
                            c3478.f10054 = false;
                            f9252.m8117(c3478);
                        }
                    } catch (Throwable th) {
                        th.printStackTrace();
                    }
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.context_remove_saved_purchaces:
                    m7986();
                    m7951(7);
                    m7960(7);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.context_resign_app:
                    if (f9282.equals("")) {
                        C3549.m8191(true, null);
                    } else {
                        C3549.m8191(true, new File(f9282));
                    }
                    m7951(7);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.context_restore_apk:
                    m7951(7);
                    m7973();
                    m7951(26);
                    m7960(26);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.context_restore_data:
                    m7951(7);
                    m7974();
                    m7951(42);
                    m7960(42);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.context_safe_sign_apk_permission:
                    m7951(7);
                    if (f9282.equals("")) {
                        C3549.m8169(R.string.context_safe_sign_apk_permission, true, null, null);
                    }
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.context_support_patch:
                    m7951(7);
                    C3549.m8195(false, null, null);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.contextignore:
                    m7993();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.corepatches:
                    m7983();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.createapk:
                    m7989();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.createapkads:
                    m7951(7);
                    if (f9282.equals("")) {
                        C3549.m8173(true, null, null);
                    } else {
                        C3549.m8173(true, new File(f9282), null);
                    }
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.createapkcustom:
                    m7951(7);
                    m8003(true, null);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.createapklvl:
                    m7951(7);
                    if (f9282.equals("")) {
                        C3549.m8175(true, null, null);
                    } else {
                        C3549.m8175(true, new File(f9282), null);
                    }
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.createapksupport:
                    m7951(7);
                    if (f9282.equals("")) {
                        C3549.m8195(true, null, null);
                    } else {
                        C3549.m8195(true, new File(f9282), null);
                    }
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.delete_file:
                    m7951(7);
                    m8004();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.delete_system_app:
                    m8081(true);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.delete_system_app_for_user:
                    m8082();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.dirbinder:
                    m1852(new Intent(mo1874(), (Class<?>) BinderActivity.class));
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.disable_inapp_services_google:
                    if (f9283 && (m6974 = C2500.m6974("com.android.vending", 516)) != null && (serviceInfoArr = m6974.services) != null && serviceInfoArr.length != 0) {
                        int i2 = 0;
                        boolean z3 = false;
                        boolean z4 = false;
                        while (true) {
                            ServiceInfo[] serviceInfoArr5 = m6974.services;
                            if (i2 < serviceInfoArr5.length) {
                                try {
                                    if ((serviceInfoArr5[i2].name.endsWith("InAppBillingService") || m6974.services[i2].name.endsWith("MarketBillingService")) && m7932().getComponentEnabledSetting(new ComponentName("com.android.vending", m6974.services[i2].name)) != 1) {
                                        m7960(11);
                                        f9276.m8238(true);
                                        f9276.m8239(C2500.m7007(R.string.wait));
                                        C2500.m7056(true);
                                        z3 = true;
                                    }
                                    if ((m6974.services[i2].name.endsWith("InAppBillingService") || m6974.services[i2].name.endsWith("MarketBillingService")) && m7932().getComponentEnabledSetting(new ComponentName("com.android.vending", m6974.services[i2].name)) == 1) {
                                        m7960(11);
                                        f9276.m8238(true);
                                        f9276.m8239(C2500.m7007(R.string.wait));
                                        C2500.m7056(false);
                                        if (!z4) {
                                            m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.message_warning_InApp_service_disable));
                                        }
                                        z3 = true;
                                        z4 = true;
                                    }
                                } catch (Exception e2) {
                                    e2.printStackTrace();
                                }
                                i2++;
                            } else if (!z3) {
                                m7960(11);
                                f9276.m8238(true);
                                f9276.m8239(C2500.m7007(R.string.wait));
                                C2500.m7056(true);
                            }
                        }
                    }
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.disable_license_services_google:
                    if (f9283 && (m69742 = C2500.m6974("com.android.vending", 516)) != null && (serviceInfoArr2 = m69742.services) != null && serviceInfoArr2.length != 0) {
                        int i3 = 0;
                        boolean z5 = false;
                        while (true) {
                            ServiceInfo[] serviceInfoArr6 = m69742.services;
                            if (i3 < serviceInfoArr6.length) {
                                try {
                                    if (serviceInfoArr6[i3].name.endsWith("LicensingService") && m7932().getComponentEnabledSetting(new ComponentName("com.android.vending", m69742.services[i3].name)) != 1) {
                                        m7960(11);
                                        f9276.m8238(true);
                                        f9276.m8239(C2500.m7007(R.string.wait));
                                        C2500.m7058(true);
                                        z5 = true;
                                    }
                                    if (m69742.services[i3].name.endsWith("LicensingService") && m7932().getComponentEnabledSetting(new ComponentName("com.android.vending", m69742.services[i3].name)) == 1) {
                                        m7960(11);
                                        f9276.m8238(true);
                                        f9276.m8239(C2500.m7007(R.string.wait));
                                        C2500.m7058(false);
                                        m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.message_warning_LVL_service_disable));
                                        z5 = true;
                                    }
                                } catch (Exception e3) {
                                    e3.printStackTrace();
                                }
                                i3++;
                            } else if (!z5) {
                                m7960(11);
                                f9276.m8238(true);
                                f9276.m8239(C2500.m7007(R.string.wait));
                                C2500.m7058(true);
                            }
                        }
                    }
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.export_settings:
                    C2500.m6901();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.generate_log_for_conscrypt_jar_fix_android_patches:
                    m8013();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.res_0x7f1101d8_generate_log_for_core_jar_fix_android_patches:
                    m8014();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.generate_log_for_core_oj_jar_fix_android_patches:
                    m8015();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.generate_log_for_framework_fix_android_patches:
                    m8016();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.res_0x7f1101db_generate_log_for_services_odex_fix_android_patches:
                    m8017();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.help:
                    C3549.m8155();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.import_settings:
                    C2500.m7021();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.import_to_lucky_patcher:
                    m7951(7);
                    f9245.m8024(new File(f9282), false);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.installsupersu:
                    Intent intent3 = new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=eu.chainfire.supersu"));
                    intent3.addFlags(1073741824);
                    m1852(intent3);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.integrate_updates_to_system:
                    ArrayList arrayList = new ArrayList(1);
                    arrayList.add(f9253);
                    new Thread(new RunnableC3244(arrayList)).start();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.make_app_a_sys:
                    m8028();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.manage_magisk_module_apps:
                    C3549.m8157();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.market_install:
                    m7951(30);
                    m7960(30);
                    m7956(new RunnableC3232());
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.menu_download_custom_patches:
                    RunnableC3342 runnableC3342 = new RunnableC3342();
                    runnableC3342.f9875 = false;
                    Thread thread = new Thread(runnableC3342);
                    thread.setPriority(10);
                    thread.start();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.mod_market_check:
                    m8029();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.move_to_sys:
                    m8033();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.new_method_lvl:
                    m7951(7);
                    m8034();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.odex_all_system_app:
                    m8036();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.open_to_GP:
                    m7951(7);
                    try {
                        MainActivity mainActivity = f9259;
                        if (mainActivity != null) {
                            mainActivity.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("market://details?id=" + f9253.f10046)));
                        }
                    } catch (ActivityNotFoundException unused3) {
                        MainActivity mainActivity2 = f9259;
                        if (mainActivity2 != null) {
                            mainActivity2.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=" + f9253.f10046)));
                        }
                    }
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.permission:
                    m7951(10);
                    m8022();
                    m7996();
                    m7951(7);
                    m7960(10);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.proxyGP:
                    if (XposedUtils.isXposedEnabled()) {
                        new ArrayList();
                        try {
                            jSONObject = C2500.m7071();
                            if (jSONObject == null) {
                                try {
                                    new Thread(new RunnableC3215()).start();
                                } catch (JSONException e4) {
                                    jSONException = e4;
                                    jSONException.printStackTrace();
                                    if (jSONObject != null) {
                                    }
                                    z = !z2;
                                    if (!C2500.m7182()) {
                                    }
                                    if (i != R.string.settings) {
                                    }
                                }
                            }
                        } catch (JSONException e5) {
                            jSONException = e5;
                            jSONObject = null;
                        }
                        if (jSONObject != null) {
                            z2 = jSONObject.optBoolean("patch4", false);
                        }
                        z = !z2;
                    } else {
                        z = true;
                    }
                    if (!C2500.m7182()) {
                        if (z) {
                            m7960(11);
                            f9276.m8238(true);
                            f9276.m8239(C2500.m7007(R.string.wait));
                            m7956(new RunnableC3216());
                        } else {
                            m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.proxyGP_widget_warning_1));
                        }
                    } else if (!C2500.m7182() && (C2500.m6898("/system/framework/core.jar.jex") || C2500.m6898("/system/framework/core-libart.jar.jex") || C2500.m6898("/system/framework/services.jar.jex"))) {
                        m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.warning_jex_optimised_firmware));
                    } else if (C2500.m7031() && f9299 >= 20) {
                        C2500.m7125(C2500.m7007(R.string.warning), C2500.m7007(R.string.message_apply_android_patch_for_proxy_gp), new DialogInterfaceOnClickListenerC3220(), null, null);
                    } else {
                        m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.proxyGP_widget_warning_2));
                    }
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.reboot:
                    m8007(Integer.valueOf(R.string.reboot));
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.reboot_to_bootloader:
                    m8007(Integer.valueOf(R.string.reboot_to_bootloader));
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.reboot_to_recovery:
                    m8007(Integer.valueOf(R.string.reboot_to_recovery));
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.remove_all_saved_purchases:
                    m8044();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.removefixes:
                    m8045();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.search:
                    f9259.toolbar_refresh_click(null);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.set_default_to_install_auto:
                    m8057();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.set_default_to_install_internal_memory:
                    m8058();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.set_default_to_install_sdcard:
                    m8059();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.set_switchers_def:
                    m7928().edit().putBoolean("switch_auto_backup_apk", false).commit();
                    m7928().edit().putBoolean("switch_auto_backup_apk_only_gp", false).commit();
                    m7928().edit().putBoolean("switch_auto_integrate_update", false).commit();
                    m7928().edit().putBoolean("switch_auto_move_to_sd", false).commit();
                    m7928().edit().putBoolean("switch_auto_move_to_internal", false).commit();
                    m7932().setComponentEnabledSetting(new ComponentName(m7929(), (Class<?>) LicensingService.class), 1, 1);
                    m7932().setComponentEnabledSetting(new ComponentName(m7929(), (Class<?>) InAppBillingService.class), 1, 1);
                    C2500.m7056(true);
                    C2500.m7058(true);
                    Intent intent4 = new Intent(m7929(), (Class<?>) Widget4.class);
                    intent4.setPackage(m7929().getPackageName());
                    intent4.setAction(Widget4.f4832);
                    m7929().sendBroadcast(intent4);
                    m7956(new RunnableC3200());
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.settings:
                    if (m1860() != null) {
                        ((MainActivity) m1860()).toolbar_settings_click();
                    }
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.share_lucky_patcher:
                    f9253 = new C3478(m7929().getPackageName(), 0, false);
                    m8064();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.share_this_app:
                    m7951(7);
                    m7956(new RunnableC3243());
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.switcher_auto_backup:
                    if (m7928().getBoolean("switch_auto_backup_apk", false)) {
                        m7928().edit().putBoolean("switch_auto_backup_apk", false).commit();
                    } else {
                        m7928().edit().putBoolean("switch_auto_backup_apk", true).commit();
                        m7928().edit().putBoolean("switch_auto_backup_apk_only_gp", false).commit();
                    }
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.switcher_auto_backup_only_gp:
                    if (m7928().getBoolean("switch_auto_backup_apk_only_gp", false)) {
                        m7928().edit().putBoolean("switch_auto_backup_apk_only_gp", false).commit();
                    } else {
                        m7928().edit().putBoolean("switch_auto_backup_apk_only_gp", true).commit();
                        m7928().edit().putBoolean("switch_auto_backup_apk", false).commit();
                    }
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.switcher_auto_integrate_update:
                    if (m7928().getBoolean("switch_auto_integrate_update", false)) {
                        m7928().edit().putBoolean("switch_auto_integrate_update", false).commit();
                    } else {
                        m7928().edit().putBoolean("switch_auto_integrate_update", true).commit();
                    }
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.switcher_auto_move_to_internal:
                    if (m7928().getBoolean("switch_auto_move_to_internal", false)) {
                        m7928().edit().putBoolean("switch_auto_move_to_internal", false).commit();
                    } else {
                        m7928().edit().putBoolean("switch_auto_move_to_internal", true).commit();
                        m7928().edit().putBoolean("switch_auto_move_to_sd", false).commit();
                    }
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.switcher_auto_move_to_sd:
                    if (m7928().getBoolean("switch_auto_move_to_sd", false)) {
                        m7928().edit().putBoolean("switch_auto_move_to_sd", false).commit();
                    } else {
                        m7928().edit().putBoolean("switch_auto_move_to_sd", true).commit();
                        m7928().edit().putBoolean("switch_auto_move_to_internal", false).commit();
                    }
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.toolbar_backups:
                    f9259.toolbar_backups_click(null);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.toolbar_options_menu:
                    f9259.toolbar_options_show(null);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.toolbar_rebuild:
                    f9259.toolbar_rebuild_click(null);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.toolbar_refresh_apps:
                    C2500.m7125(C2500.m7007(R.string.warning), C2500.m7007(R.string.message_rescan_apps), new DialogInterfaceOnClickListenerC3245(), null, null);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.toolbar_switchers:
                    f9259.toolbar_switchers_click(null);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.toolbar_system_utils:
                    f9259.toolbar_system_utils_click(null);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.tools_menu_block_internet:
                    m8063(false);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.tools_menu_unblock_internet:
                    m8063(true);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.troubleshooting_supersu_namespace_separation:
                    String str2 = "none";
                    try {
                        str2 = m7932().getPackageInfo("eu.chainfire.supersu", ItemType.CLASS_DATA_ITEM).applicationInfo.dataDir;
                    } catch (PackageManager.NameNotFoundException unused4) {
                    } catch (Exception e6) {
                        e6.printStackTrace();
                    }
                    new C2500("supersu").m7211(f9284 + C1572.class.getName() + " " + str2);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.truble:
                    m8000();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.uninstall_updates:
                    m8083();
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.update_lp:
                    C2975 c29752 = f9245;
                    if (c29752 != null) {
                        c29752.m8051();
                    }
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.updatebusybox:
                    Intent intent5 = new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=stericson.busybox&feature"));
                    intent5.addFlags(1073741824);
                    m1852(intent5);
                    if (i != R.string.settings) {
                    }
                    break;
                case R.string.xposed_settings:
                    m7984();
                    if (i != R.string.settings) {
                    }
                    break;
                default:
                    switch (i) {
                        case R.string.context_automodeslvl:
                            m7951(7);
                            C3549.m8175(false, null, null);
                            if (i != R.string.settings) {
                            }
                            break;
                        case R.string.context_backup_apk:
                            m7956(new RunnableC3211());
                            if (i != R.string.settings) {
                            }
                            break;
                        case R.string.context_backup_apk_selected_apps:
                            f9327 = R.string.button_backup_apk_apps;
                            m8054();
                            if (i != R.string.settings) {
                            }
                            break;
                        case R.string.context_backup_data:
                            m7956(new RunnableC3214());
                            if (i != R.string.settings) {
                            }
                            break;
                        case R.string.context_backup_settings_selected_apps:
                            f9327 = R.string.button_backup_settings_apps;
                            m8054();
                            if (i != R.string.settings) {
                            }
                            break;
                        default:
                            switch (i) {
                                case R.string.context_block_internet_selected_apps:
                                    f9327 = R.string.button_block_internet;
                                    m8054();
                                    if (i != R.string.settings) {
                                    }
                                    break;
                                case R.string.context_blockads:
                                    m7951(7);
                                    m8074();
                                    if (i != R.string.settings) {
                                    }
                                    break;
                                case R.string.context_change_components_menu:
                                    m7997();
                                    if (i != R.string.settings) {
                                    }
                                    break;
                                case R.string.context_clearhosts:
                                    m7951(7);
                                    m8072();
                                    if (i != R.string.settings) {
                                    }
                                    break;
                                case R.string.context_crt_apk_permission:
                                    m7951(7);
                                    if (f9282.equals("")) {
                                        C3549.m8169(R.string.context_crt_apk_permission, true, null, null);
                                    } else {
                                        C3549.m8169(R.string.context_crt_apk_permission, true, new File(f9282), null);
                                    }
                                    if (i != R.string.settings) {
                                    }
                                    break;
                                default:
                                    switch (i) {
                                        case R.string.context_dexopt_app:
                                            try {
                                                m8006(m7932().getPackageInfo(f9253.f10046, ItemType.CLASS_DATA_ITEM).applicationInfo.sourceDir, f9253.f10046, "" + m7932().getPackageInfo(f9253.f10046, 0).applicationInfo.uid, f9253.f10068);
                                            } catch (Exception e7) {
                                                e7.printStackTrace();
                                                m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_get_pkgInfo));
                                            }
                                            if (i != R.string.settings) {
                                            }
                                            break;
                                        case R.string.context_disableActivity:
                                            m7951(29);
                                            m8020();
                                            m7951(7);
                                            m7960(29);
                                            if (i != R.string.settings) {
                                            }
                                            break;
                                        case R.string.context_disableComponents:
                                            m7951(31);
                                            m8018();
                                            m7951(7);
                                            m7960(31);
                                            if (i != R.string.settings) {
                                            }
                                            break;
                                        case R.string.context_disable_google_ads:
                                            if (f9283) {
                                                m7942("Disable Google services ads");
                                                try {
                                                    packageInfo = m7932().getPackageInfo("com.google.android.gms", 8708);
                                                } catch (PackageManager.NameNotFoundException e8) {
                                                    e8.printStackTrace();
                                                }
                                                if (packageInfo != null && (serviceInfoArr3 = packageInfo.services) != null && serviceInfoArr3.length != 0) {
                                                    int i4 = 0;
                                                    while (true) {
                                                        ServiceInfo[] serviceInfoArr7 = packageInfo.services;
                                                        if (i4 < serviceInfoArr7.length) {
                                                            try {
                                                                if (serviceInfoArr7[i4].name.startsWith("com.google.android.gms.ads.identifier.") && m7932().getComponentEnabledSetting(new ComponentName("com.google.android.gms", packageInfo.services[i4].name)) != 2 && !packageInfo.services[i4].name.startsWith("com.google.android.gms.ads.social") && !packageInfo.services[i4].name.startsWith("com.google.android.gms.ads.jams.")) {
                                                                    m7942("Disable Google services ads:" + packageInfo.services[i4].name);
                                                                    m7960(11);
                                                                    f9276.m8238(true);
                                                                    f9276.m8239(C2500.m7007(R.string.wait));
                                                                    new C2500("").m7211("pm disable 'com.google.android.gms/" + packageInfo.services[i4].name + "'");
                                                                }
                                                                m7951(11);
                                                            } catch (Exception e9) {
                                                                e9.printStackTrace();
                                                            }
                                                            i4++;
                                                        }
                                                    }
                                                }
                                            }
                                            if (i != R.string.settings) {
                                            }
                                            break;
                                        case R.string.context_disable_package:
                                            try {
                                                m8008(f9253.f10046, false);
                                            } catch (Exception e10) {
                                                e10.printStackTrace();
                                                m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_get_pkgInfo));
                                            }
                                            if (i != R.string.settings) {
                                            }
                                            break;
                                        case R.string.context_disable_package_for_selected_apps:
                                            f9327 = R.string.button_disable_package;
                                            m8054();
                                            if (i != R.string.settings) {
                                            }
                                            break;
                                        case R.string.context_enable_google_ads:
                                            if (f9283) {
                                                m7942("Enable Google services ads");
                                                try {
                                                    packageInfo2 = m7932().getPackageInfo("com.google.android.gms", 8708);
                                                } catch (PackageManager.NameNotFoundException e11) {
                                                    e11.printStackTrace();
                                                }
                                                if (packageInfo2 != null && (serviceInfoArr4 = packageInfo2.services) != null && serviceInfoArr4.length != 0) {
                                                    int i5 = 0;
                                                    while (true) {
                                                        ServiceInfo[] serviceInfoArr8 = packageInfo2.services;
                                                        if (i5 < serviceInfoArr8.length) {
                                                            try {
                                                                if (serviceInfoArr8[i5].name.startsWith("com.google.android.gms.ads") && m7932().getComponentEnabledSetting(new ComponentName("com.google.android.gms", packageInfo2.services[i5].name)) == 2) {
                                                                    m7942("Enable Google services ads:" + packageInfo2.services[i5].name);
                                                                    m7960(11);
                                                                    f9276.m8238(true);
                                                                    f9276.m8239(C2500.m7007(R.string.wait));
                                                                    new C2500("").m7211("pm enable 'com.google.android.gms/" + packageInfo2.services[i5].name + "'");
                                                                }
                                                                m7951(11);
                                                            } catch (Exception e12) {
                                                                e12.printStackTrace();
                                                            }
                                                            i5++;
                                                        }
                                                    }
                                                }
                                            }
                                            if (i != R.string.settings) {
                                            }
                                            break;
                                        case R.string.context_enable_package:
                                            try {
                                                m8008(f9253.f10046, true);
                                            } catch (Exception e13) {
                                                e13.printStackTrace();
                                                m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.error_get_pkgInfo));
                                            }
                                            if (i != R.string.settings) {
                                            }
                                            break;
                                        case R.string.context_enable_package_for_selected_apps:
                                            f9327 = R.string.button_enable_package;
                                            m8054();
                                            if (i != R.string.settings) {
                                            }
                                            break;
                                        case R.string.context_files_observer:
                                            m7951(7);
                                            C3549.m8189(false, null);
                                            if (i != R.string.settings) {
                                            }
                                            break;
                                        case R.string.context_hard_apk_permission:
                                            m7956(new RunnableC3203());
                                            if (i != R.string.settings) {
                                            }
                                            break;
                                        default:
                                            switch (i) {
                                                case R.string.context_trouble_enable_playprotect:
                                                    m7947(true);
                                                    if (i != R.string.settings) {
                                                    }
                                                    break;
                                                case R.string.context_trouble_run_playprotect_dialog:
                                                    Intent intent6 = new Intent("com.google.android.gms.settings.VERIFY_APPS_SETTINGS");
                                                    try {
                                                        MainActivity mainActivity3 = f9259;
                                                        if (mainActivity3 != null) {
                                                            mainActivity3.startActivity(intent6);
                                                        }
                                                    } catch (Throwable th2) {
                                                        th2.printStackTrace();
                                                    }
                                                    if (i != R.string.settings) {
                                                    }
                                                    break;
                                                case R.string.context_unblock_internet_selected_apps:
                                                    f9327 = R.string.button_unblock_internet;
                                                    m8054();
                                                    if (i != R.string.settings) {
                                                    }
                                                    break;
                                                case R.string.context_unblockads:
                                                    m7951(7);
                                                    m8073();
                                                    if (i != R.string.settings) {
                                                    }
                                                    break;
                                                case R.string.context_uninstall_if_installed:
                                                    m7956(new RunnableC3240());
                                                    if (i != R.string.settings) {
                                                    }
                                                    break;
                                                case R.string.context_uninstall_selected_apps:
                                                    f9327 = R.string.button_uninstall_apps;
                                                    m8054();
                                                    if (i != R.string.settings) {
                                                    }
                                                    break;
                                                default:
                                                    switch (i) {
                                                        case R.string.contextads:
                                                            m7988();
                                                            m7951(7);
                                                            break;
                                                        case R.string.contextbackup:
                                                            m7985();
                                                            break;
                                                        default:
                                                            switch (i) {
                                                                case R.string.contextboot:
                                                                    m7951(7);
                                                                    m7956(new RunnableC3205());
                                                                    break;
                                                                case R.string.contextbootads:
                                                                    m7975(f9253, "ads");
                                                                    break;
                                                                case R.string.contextbootcustom:
                                                                    m7975(f9253, "custom");
                                                                    break;
                                                                case R.string.contextbootlvl:
                                                                    m7975(f9253, "lvl");
                                                                    break;
                                                                default:
                                                                    switch (i) {
                                                                        case R.string.contextcustompatch:
                                                                            m7951(7);
                                                                            m8003(false, null);
                                                                            break;
                                                                        case R.string.contextdeodex:
                                                                            m8005(f9253);
                                                                            break;
                                                                        default:
                                                                            switch (i) {
                                                                                case R.string.contextmultipatch:
                                                                                    m7951(7);
                                                                                    C3549.m8193(false, null);
                                                                                    break;
                                                                                case R.string.contextmultipatchrebuild:
                                                                                    m7951(7);
                                                                                    if (!f9282.equals("")) {
                                                                                        file = new File(f9282);
                                                                                    }
                                                                                    C3549.m8193(true, file);
                                                                                    break;
                                                                                case R.string.contextodex:
                                                                                    m8035(f9253);
                                                                                    break;
                                                                                default:
                                                                                    switch (i) {
                                                                                        case R.string.contextreinstall:
                                                                                            m8043(f9253);
                                                                                            break;
                                                                                        case R.string.contextrestore:
                                                                                            m7987();
                                                                                            break;
                                                                                        case R.string.contextselpatt:
                                                                                            C3549.m8179(false, null);
                                                                                            break;
                                                                                    }
                                                                            }
                                                                    }
                                                            }
                                                    }
                                                    if (i != R.string.settings) {
                                                    }
                                                    break;
                                            }
                                    }
                            }
                    }
            }
        } catch (Exception e14) {
            e14.printStackTrace();
        }
    }

    public void m8050() {
        PackageInfo packageInfo;
        f9329 = true;
        try {
            packageInfo = m7932().getPackageInfo(m7929().getPackageName(), ItemType.CLASS_DATA_ITEM);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
            packageInfo = null;
        }
        if (packageInfo != null) {
            m7954(new RunnableC3100(packageInfo, new boolean[]{false}));
        } else {
            f9259.finish();
        }
    }

    public void m8051() {
        new AsyncTaskC3364().execute("novajaversia");
    }

    public void m8052() {
        Thread thread = new Thread(new RunnableC3339());
        thread.setPriority(1);
        thread.start();
    }

    public void m8053() {
        ArrayList arrayList = new ArrayList();
        arrayList.add("en_CA");
        arrayList.add("en_GB");
        arrayList.add("en_US");
        arrayList.add("af_ZA");
        arrayList.add("ar");
        arrayList.add("ar_EG");
        arrayList.add("ar_IQ");
        arrayList.add("ar_SA");
        arrayList.add("ar_SY");
        arrayList.add("az");
        arrayList.add("be");
        arrayList.add("bg");
        arrayList.add("bn_BD");
        arrayList.add("cs");
        arrayList.add("da_DK");
        arrayList.add("de");
        arrayList.add("el");
        arrayList.add("es");
        arrayList.add("es_ES");
        arrayList.add("es_MX");
        arrayList.add("et");
        arrayList.add("fa");
        arrayList.add("fi");
        arrayList.add("fr");
        arrayList.add("gl_ES");
        arrayList.add("gu");
        arrayList.add("he");
        arrayList.add("hi");
        arrayList.add("hy_AM");
        arrayList.add("hr");
        arrayList.add("hu");
        arrayList.add("in");
        arrayList.add("it");
        arrayList.add("iw");
        arrayList.add("ja");
        arrayList.add("km");
        arrayList.add("km_KH");
        arrayList.add("ko");
        arrayList.add("ku");
        arrayList.add("lt");
        arrayList.add("lrc");
        arrayList.add("lv");
        arrayList.add("ml");
        arrayList.add("mr");
        arrayList.add("ms_MY");
        arrayList.add("my_MM");
        arrayList.add("nl");
        arrayList.add("no");
        arrayList.add("pl");
        arrayList.add("pt");
        arrayList.add("pt_rBR");
        arrayList.add("ro");
        arrayList.add("ru");
        arrayList.add("si");
        arrayList.add("sk");
        arrayList.add("sl");
        arrayList.add("sr");
        arrayList.add("sv");
        arrayList.add("th");
        arrayList.add("tl");
        arrayList.add("tl_PH");
        arrayList.add("tr");
        arrayList.add("ug");
        arrayList.add("uk_UA");
        arrayList.add("ur");
        arrayList.add("uz");
        arrayList.add("vi");
        arrayList.add("zh_CN");
        arrayList.add("zh_HK");
        arrayList.add("zh_TW");
        C2913 c2913 = new C2913(f9259);
        c2913.m7862(new C3261(f9259, R.layout.contextmenu, arrayList), new C3266());
        c2913.m7851().show();
    }

    public void m8054() {
        f9326 = true;
        f9325.clear();
        TextView textView = (TextView) f9259.findViewById(R.id.line_hide_horisontal);
        TextView textView2 = (TextView) f9259.findViewById(R.id.line_hide_vertical);
        textView.setVisibility(0);
        textView2.setVisibility(0);
        TextView textView3 = (TextView) f9259.findViewById(R.id.title_list);
        textView3.setVisibility(0);
        Button button = (Button) f9259.findViewById(R.id.title_button);
        button.setText(C2500.m7007(R.string.button_all));
        m7942(Integer.valueOf(f9327));
        int i = f9327;
        switch (i) {
            case R.string.button_backup_apk_apps:
                textView3.setText(C2500.m7007(R.string.title_for_select_backup_apk_package));
                f9317 = 0;
                button.setOnClickListener(new ViewOnClickListenerC3071());
                break;
            case R.string.button_backup_settings_apps:
                textView3.setText(C2500.m7007(R.string.title_for_select_backup_settings_package));
                f9317 = 0;
                button.setOnClickListener(new ViewOnClickListenerC3068());
                break;
            case R.string.button_block_internet:
                textView3.setText(C2500.m7007(R.string.title_for_block_internet));
                f9317 = 1931;
                button.setOnClickListener(new ViewOnClickListenerC3059());
                break;
            case R.string.button_disable_package:
                m7942("found" + f9327);
                textView3.setText(C2500.m7007(R.string.title_for_select_disable_package));
                f9317 = 333;
                button.setOnClickListener(new ViewOnClickListenerC3050());
                break;
            case R.string.button_enable_package:
                m7942("found" + f9327);
                textView3.setText(C2500.m7007(R.string.title_for_select_enable_package));
                f9317 = R.id.filter10;
                button.setOnClickListener(new ViewOnClickListenerC3053());
                break;
            default:
                switch (i) {
                    case R.string.button_integrate_update_apps:
                        textView3.setText(C2500.m7007(R.string.title_for_select_integrate_update_apps));
                        f9317 = R.id.filter8;
                        button.setOnClickListener(new ViewOnClickListenerC3065());
                        break;
                    case R.string.button_move_to_internal:
                        m7942("found" + f9327);
                        textView3.setText(C2500.m7007(R.string.title_for_select_move_to_internal));
                        f9317 = R.id.filter6;
                        button.setOnClickListener(new ViewOnClickListenerC3042());
                        break;
                    case R.string.button_move_to_sdcard:
                        m7942("found" + f9327);
                        textView3.setText(C2500.m7007(R.string.title_for_select_move_to_sdcard));
                        f9317 = 1929;
                        button.setOnClickListener(new ViewOnClickListenerC3038());
                        break;
                    default:
                        switch (i) {
                            case R.string.button_unblock_internet:
                                textView3.setText(C2500.m7007(R.string.title_for_unblock_internet));
                                f9317 = 1932;
                                button.setOnClickListener(new ViewOnClickListenerC3062());
                                break;
                            case R.string.button_uninstall_apps:
                                textView3.setText(C2500.m7007(R.string.title_for_select_uninstall));
                                f9317 = 1930;
                                button.setOnClickListener(new ViewOnClickListenerC3056());
                                break;
                        }
                }
        }
        button.setVisibility(0);
        if (f9252 != null) {
            m7957(true);
        }
    }

    public void m8055() {
        new AsyncTaskC3255().execute(new Void[0]);
    }

    void m8056() {
        String str = "/system/bin/dalvikvm";
        if (!new File("/system/bin/dalvikvm").exists()) {
            str = "";
        }
        if (new File("/system/bin/dalvikvm32").exists()) {
            str = "/system/bin/dalvikvm32";
        }
        if (str.equals("")) {
            File file = new File(m7929().getFilesDir() + "/dalvikvm");
            if (!file.exists()) {
                if (C2500.m6984(R.raw.dalvikvm_armv7a, file)) {
                    C2500.m7093("chmod 777 " + file.getAbsolutePath());
                    C2500.m7093("chown 0.0 " + file.getAbsolutePath());
                    C2500.m7093("chown 0:0 " + file.getAbsolutePath());
                    file.getAbsolutePath();
                }
            } else {
                file.getAbsolutePath();
            }
        }
        if (f9299 >= 29 && !m7928().getBoolean("set_for_android_10_first_run", false)) {
            m7928().edit().putBoolean("set_for_android_10_first_run", true).commit();
            m7928().edit().putBoolean("use_app_process", true).commit();
            m7928().edit().putBoolean("force_use_app_process", true).commit();
        }
        f9284 = C2500.m6990();
        f9285 = C2500.m6991();
    }

    public void m8057() {
        m7928().edit().putInt("Install_location", 0).commit();
        if (f9283) {
            new C2500("").m7211("pm setInstallLocation 0", "skipOut");
            new C2500("").m7211("pm set-install-location 0", "skipOut");
        } else {
            C2500.m7019("pm setInstallLocation 0", "skipOut");
            C2500.m7019("pm set-install-location 0", "skipOut");
        }
    }

    public void m8058() {
        m7928().edit().putInt("Install_location", 1).commit();
        if (f9283) {
            new C2500("").m7211("pm setInstallLocation 1", "skipOut");
            new C2500("").m7211("pm set-install-location 1", "skipOut");
        } else {
            C2500.m7019("pm setInstallLocation 1", "skipOut");
            C2500.m7019("pm set-install-location 1", "skipOut");
        }
    }

    public void m8059() {
        m7928().edit().putInt("Install_location", 2).commit();
        if (f9283) {
            new C2500("").m7211("pm setInstallLocation 2", "skipOut");
            new C2500("").m7211("pm set-install-location 2", "skipOut");
        } else {
            C2500.m7019("pm setInstallLocation 2", "skipOut");
            C2500.m7019("pm set-install-location 2", "skipOut");
        }
    }

    public void m8060() {
        try {
            if (f9283 || f9348.booleanValue()) {
                for (String str : C2500.m6995()) {
                    if (!new File(str + InternalZipConstants.ZIP_FILE_SEPARATOR + f9355).exists()) {
                        m7942("Tools not found in /data. Try create.");
                        File file = new File(str + InternalZipConstants.ZIP_FILE_SEPARATOR + f9355);
                        if (!file.exists()) {
                            C2500.m7022();
                            if (f9283) {
                                new Thread(new RunnableC3099(str, file)).start();
                            } else {
                                C2500.m7101(file, f9250 + "%chelpus%" + f9299 + "%chelpus%" + f9246 + "%chelpus%" + f9247 + "%chelpus%" + C2500.m7171(f9295));
                            }
                        }
                    }
                }
            }
        } catch (Throwable th) {
            th.printStackTrace();
        }
    }

    public void m8061(boolean z) {
        PackageManager packageManager = m7929().getPackageManager();
        if (packageManager != null) {
            ComponentName componentName = new ComponentName(m7929(), (Class<?>) Widget2.class);
            int componentEnabledSetting = packageManager.getComponentEnabledSetting(componentName);
            ComponentName componentName2 = new ComponentName(m7929(), (Class<?>) Widget3.class);
            int componentEnabledSetting2 = packageManager.getComponentEnabledSetting(componentName2);
            ComponentName componentName3 = new ComponentName(m7929(), (Class<?>) Widget1.class);
            packageManager.getComponentEnabledSetting(componentName3);
            if (z) {
                if (componentEnabledSetting == 2 || componentEnabledSetting2 == 2) {
                    packageManager.setComponentEnabledSetting(componentName, 1, 1);
                    packageManager.setComponentEnabledSetting(componentName2, 1, 1);
                    packageManager.setComponentEnabledSetting(componentName3, 1, 1);
                    return;
                }
                return;
            }
            if (componentEnabledSetting == 1 || componentEnabledSetting2 == 1) {
                packageManager.setComponentEnabledSetting(componentName, 2, 1);
                packageManager.setComponentEnabledSetting(componentName2, 2, 1);
                packageManager.setComponentEnabledSetting(componentName3, 2, 1);
            }
        }
    }

    void m8062() {
        boolean z;
        String str;
        String str2;
        String str3;
        String str4;
        f9292 = Environment.getExternalStorageDirectory().getAbsolutePath();
        try {
            m7942("LuckyPatcher (env sdcard): " + f9292);
        } catch (Exception e) {
            e.printStackTrace();
        }
        f9251 = f9292 + "/LuckyPatcher";
        try {
            if (f9299 > 18) {
                f9251 = m7929().getExternalFilesDir("LuckyPatcher").getAbsolutePath();
            }
        } catch (Exception e2) {
            e2.printStackTrace();
            new File(f9292 + "/Android/data/" + f9279 + "/files/LuckyPatcher").mkdirs();
            f9251 = f9292 + "/Android/data/" + f9279 + "/files/LuckyPatcher";
        }
        m7942(f9251);
        if (!m7928().getBoolean(f9273, false)) {
            m7928().edit().putBoolean(f9273, true).commit();
        }
        m7942("LuckyPatcher (sd environment): " + f9251);
        if (m7928().getBoolean("manual_path", false)) {
            f9251 = m7928().getString("basepath", f9251);
            m7942("LuckyPatcher (saved sdcard): " + f9292);
            if (!f9283 || f9299 <= 16 || !f9251.startsWith("/storage/emulated/0/")) {
                str = "/LuckyPatcher";
                str2 = "LuckyPatcher: ";
                str3 = "LuckyPatcher: sdcard from Environment.getExternalStorageDirectory() error... Test ";
            } else {
                try {
                    str2 = "LuckyPatcher: ";
                    try {
                        StringBuilder sb = new StringBuilder();
                        str3 = "LuckyPatcher: sdcard from Environment.getExternalStorageDirectory() error... Test ";
                        try {
                            sb.append(f9251);
                            sb.append("/test.tmp");
                            new File(sb.toString()).createNewFile();
                            if (!new File(f9251 + "/test.tmp").exists()) {
                                str = "/LuckyPatcher";
                            } else {
                                f9248 = "";
                                C2500 c2500 = new C2500("");
                                String[] strArr = new String[1];
                                StringBuilder sb2 = new StringBuilder();
                                str = "/LuckyPatcher";
                                try {
                                    sb2.append(f9284);
                                    sb2.append(C1690.class.getName());
                                    sb2.append(" '");
                                    sb2.append(f9251);
                                    sb2.append("'");
                                    strArr[0] = sb2.toString();
                                    String m7211 = c2500.m7211(strArr);
                                    f9248 = m7211;
                                    Boolean bool = Boolean.FALSE;
                                    f9323 = bool;
                                    m7942(m7211);
                                    if (!f9248.contains("LuckyPatcher: Found test.tmp")) {
                                        if (new File(f9251 + "/test.tmp").exists()) {
                                            f9248 = "";
                                            String m72112 = new C2500("").m7211(f9284 + C1690.class.getName() + " '" + f9251.replace("/storage/emulated/0/", "/storage/emulated/legacy/") + "'");
                                            f9248 = m72112;
                                            f9323 = bool;
                                            m7942(m72112);
                                            if (f9248.contains("LuckyPatcher: Found test.tmp")) {
                                                if (!new File(f9251 + "/test.tmp").exists()) {
                                                    m7928().edit().putString("extStorageDirectory", f9292.replace("/storage/emulated/0/", "/storage/emulated/legacy/")).commit();
                                                    m7928().edit().putString("basepath", f9251.replace("/storage/emulated/0/", "/storage/emulated/legacy/")).commit();
                                                    m7928().edit().putString("path", f9251.replace("/storage/emulated/0/", "/storage/emulated/legacy/")).commit();
                                                    f9251 = f9251.replace("/storage/emulated/0/", "/storage/emulated/legacy/");
                                                }
                                            }
                                            new File(f9251 + "/test.tmp").delete();
                                        }
                                    }
                                } catch (Exception e3) {
                                    e = e3;
                                    e.printStackTrace();
                                    if (m7966(false)) {
                                    }
                                }
                            }
                        } catch (Exception e4) {
                            e = e4;
                            str = "/LuckyPatcher";
                        }
                    } catch (Exception e5) {
                        e = e5;
                        str = "/LuckyPatcher";
                        str3 = "LuckyPatcher: sdcard from Environment.getExternalStorageDirectory() error... Test ";
                        e.printStackTrace();
                        if (m7966(false)) {
                        }
                    }
                } catch (Exception e6) {
                    e = e6;
                    str = "/LuckyPatcher";
                    str2 = "LuckyPatcher: ";
                }
            }
            if (m7966(false)) {
                m7924(f9251, true);
                return;
            }
            new ArrayList();
            ArrayList<File> m7936 = m7936();
            if (m7936 != null && m7936.size() > 0) {
                Iterator<File> it = m7936.iterator();
                while (true) {
                    if (it.hasNext()) {
                        File next = it.next();
                        StringBuilder sb3 = new StringBuilder();
                        sb3.append(next.getAbsolutePath());
                        str4 = str;
                        sb3.append(str4);
                        f9251 = sb3.toString();
                        StringBuilder sb4 = new StringBuilder();
                        String str5 = str3;
                        sb4.append(str5);
                        sb4.append(f9251);
                        m7942(sb4.toString());
                        if (m7966(false)) {
                            Handler handler = f9312;
                            if (handler != null) {
                                handler.post(new RunnableC3452());
                            }
                            m7942(str2 + f9251 + " work... Use to LP.");
                        } else {
                            str = str4;
                            str3 = str5;
                        }
                    } else {
                        str4 = str;
                        break;
                    }
                }
                if (!m7966(false)) {
                    try {
                        f9292 = Environment.getExternalStorageDirectory().getAbsolutePath();
                        try {
                            f9251 = m7929().getExternalFilesDir("LuckyPatcher").getAbsolutePath();
                        } catch (Exception e7) {
                            e7.printStackTrace();
                            new File(f9292 + "/Android/data/" + f9279 + "/files/LuckyPatcher").mkdirs();
                            f9251 = f9292 + "/Android/data/" + f9279 + "/files/LuckyPatcher";
                        }
                    } catch (Exception e8) {
                        e8.printStackTrace();
                    }
                    if (!m7966(false)) {
                        Handler handler2 = f9312;
                        if (handler2 != null) {
                            handler2.post(new RunnableC3242());
                        }
                        String str6 = mo1874().getDir("sdcard", 0).getAbsolutePath() + str4;
                        f9251 = str6;
                        m7924(str6, true);
                        return;
                    }
                    m7928().edit().putString("extStorageDirectory", f9292).commit();
                    m7928().edit().putString("basepath", f9251).commit();
                    m7928().edit().putString("path", f9251).commit();
                    m7928().edit().putBoolean("manual_path", true).commit();
                    return;
                }
                m7924(f9251, true);
                return;
            }
            String str7 = str;
            Handler handler3 = f9312;
            if (handler3 != null) {
                handler3.post(new RunnableC3451());
            }
            String str8 = mo1874().getDir("sdcard", 0).getAbsolutePath() + str7;
            f9251 = str8;
            m7924(str8, true);
            return;
        }
        if (!m7966(false)) {
            m7942("LuckyPatcher (sdcard test faled): " + f9251);
            new ArrayList();
            ArrayList<File> m79362 = m7936();
            if (m79362.size() > 0) {
                Iterator<File> it2 = m79362.iterator();
                while (true) {
                    if (!it2.hasNext()) {
                        break;
                    }
                    File next2 = it2.next();
                    f9251 = next2.getAbsolutePath();
                    StringBuilder sb5 = new StringBuilder();
                    sb5.append("LuckyPatcher: sdcard from Environment.getExternalStorageDirectory() error... Test ");
                    Iterator<File> it3 = it2;
                    sb5.append(f9251);
                    m7942(sb5.toString());
                    if (m7966(false)) {
                        Handler handler4 = f9312;
                        if (handler4 != null) {
                            handler4.post(new RunnableC2995());
                        }
                        m7942("LuckyPatcher: " + f9251 + " work... Use to LP.");
                        f9292 = next2.getAbsolutePath();
                        f9251 = f9292 + "/LuckyPatcher";
                    } else {
                        it2 = it3;
                    }
                }
                if (!m7966(false)) {
                    try {
                        f9292 = Environment.getExternalStorageDirectory().getAbsolutePath();
                        try {
                            f9251 = m7929().getExternalFilesDir("LuckyPatcher").getAbsolutePath();
                        } catch (Exception e9) {
                            e9.printStackTrace();
                            new File(f9292 + "/Android/data/" + f9279 + "/files/LuckyPatcher").mkdirs();
                            f9251 = f9292 + "/Android/data/" + f9279 + "/files/LuckyPatcher";
                        }
                    } catch (Exception e10) {
                        e10.printStackTrace();
                    }
                    if (!m7966(false)) {
                        Handler handler5 = f9312;
                        if (handler5 != null) {
                            handler5.post(new RunnableC3008());
                        }
                        f9251 = mo1874().getDir("sdcard", 0).getAbsolutePath() + "/LuckyPatcher";
                    } else {
                        m7928().edit().putString("extStorageDirectory", f9292).commit();
                        m7928().edit().putString("basepath", f9251).commit();
                        m7928().edit().putString("path", f9251).commit();
                        m7928().edit().putBoolean("manual_path", true).commit();
                    }
                    z = true;
                } else {
                    m7928().edit().putString("extStorageDirectory", f9292).commit();
                    m7928().edit().putString("basepath", f9251).commit();
                    m7928().edit().putString("path", f9251).commit();
                    z = true;
                    m7928().edit().putBoolean("manual_path", true).commit();
                }
                m7924(f9251, z);
            } else {
                Handler handler6 = f9312;
                if (handler6 != null) {
                    handler6.post(new RunnableC3017());
                }
                f9251 = mo1874().getDir("sdcard", 0).getAbsolutePath() + "/LuckyPatcher";
            }
            m7924(f9251, true);
            return;
        }
        m7924(f9251, true);
        m7928().edit().putString("extStorageDirectory", f9292).commit();
        m7928().edit().putString("basepath", f9251).commit();
        m7928().edit().putString("path", f9251).commit();
        m7928().edit().putBoolean("manual_path", true).commit();
    }

    public void m8063(boolean z) {
        new Thread(new RunnableC3199(z)).start();
    }

    public void m8064() {
        if (m7966(true)) {
            DialogInterfaceOnClickListenerC3430 dialogInterfaceOnClickListenerC3430 = new DialogInterfaceOnClickListenerC3430();
            String m7007 = C2500.m7007(R.string.share_message);
            C3478 c3478 = f9253;
            if ((c3478 != null && C2500.m7047(c3478.f10046)) || (!f9282.equals("") && C2500.m7027(f9282))) {
                m7007 = m7007 + "\n\n" + C2500.m7007(R.string.warning) + ":\n" + C2500.m7009(R.string.warning_shared_apks, C2500.m7007(R.string.share_lucky_patcher));
            }
            C2500.m7125(C2500.m7007(R.string.warning), m7007, dialogInterfaceOnClickListenerC3430, dialogInterfaceOnClickListenerC3430, null);
        }
    }

    public void m8065() {
        LinearLayout linearLayout = (LinearLayout) View.inflate(f9259, R.layout.aboutdialog, null);
        LinearLayout linearLayout2 = (LinearLayout) linearLayout.findViewById(R.id.dialogbodyscroll).findViewById(R.id.dialogbody);
        String str = C2500.m7007(R.string.vers) + " " + f9273 + "\n";
        TextView textView = (TextView) linearLayout2.findViewById(R.id.intonlydesc);
        TextView textView2 = (TextView) linearLayout.findViewById(R.id.copyright);
        textView.setTextAppearance(m7929(), m7934());
        textView2.setTextAppearance(m7929(), m7934());
        textView.append(C2500.m6934(str, "#ffffffff", "bold"));
        textView.append(C2500.m6934("----------------------------------\n\n", "#ffffffff", "bold"));
        textView.append(C2500.m6934(C2500.m7007(R.string.package_name) + ": " + m7929().getPackageName() + "\n\n", "#ffffffff", "bold"));
        textView.append(C2500.m6934(C2500.m7007(R.string.about_working_dir) + " " + f9251 + "\n\n", "#ffffffff", "bold"));
        StringBuilder sb = new StringBuilder();
        sb.append(C2500.m7007(R.string.punkt1));
        sb.append("\n\n");
        textView.append(C2500.m6934(sb.toString(), "#ffff0000", "bold"));
        textView.append(C2500.m6934(C2500.m7007(R.string.aboutlp) + "\n", "#ffffff00", "bold"));
        textView.append(C2500.m6934("\n" + C2500.m7007(R.string.about_thanks_for_this_translation) + "\n\n", "#ffffffff", "bold"));
        textView.append(C2500.m6934("\nThanks to:\nBin@binmt.cc - provided source code for zipalign on java\nEnyby@4pda.ru - help for get android_id on Android 8\nUsed source code: pyler, Mikanoshi@4pda.ru\nm0rpheus@TeamURET, Site WebIconSet.com - Smile icons\nslycog@XDA - Custom Patch Help translate\nIcons to menu - Sergey Kamashki\nTemplate for ADS - And123\n", "#ffffffff", "bold"));
        textView2.setText(C2500.m6934("Translation project:\nhttps://www.transifex.com/chelpus/lucky-patcher-1 \n\nYoutube:\nhttps://www.youtube.com/c/LuckyPatcherVideo/playlists \n\nSupport by email: lp.chelpus@gmail.com \n\nHome site: www.luckypatchers.com \n\nwww.luckypatchers.com/download \n\nForum: www.luckypatchers.com/forum \n\nSubmit custom patch to LP: https://patch.chelpus.com/submit \n\nLatest added custom patches to LP: https://patch.chelpus.com \n\nGood Luck!\nChelpuS\n\nCopyright ©2011-" + Calendar.getInstance().get(1) + ", ChelpuS", "#ffffffff", "bold"));
        try {
            Linkify.addLinks(textView2, 3);
        } catch (Throwable th) {
            th.printStackTrace();
        }
        Dialog m7851 = new C2913(f9259, true).m7883().m7854(R.string.abouttitle).m7865(true).m7872(android.R.drawable.ic_dialog_info).m7875(C2500.m7007(R.string.ok), null).m7880("Changelog", new DialogInterfaceOnClickListenerC3254()).m7858(linearLayout).m7881(new DialogInterfaceOnCancelListenerC3253()).m7851();
        if (!m7928().getBoolean("remove_ads", false)) {
            try {
                C2500.m6912(linearLayout, null, null, null);
                m7851.show();
                return;
            } catch (Throwable th2) {
                th2.printStackTrace();
                m7851.show();
                return;
            }
        }
        m7851.show();
    }

    public void m8066() {
        f9334 = true;
        f9335.notifyDataSetChanged();
        f9333.setVisibility(0);
        ((LinearLayout) f9259.findViewById(R.id.listapps)).setVisibility(8);
    }

    public void m8067(C2597 c2597, boolean z) {
        if (c2597.f7325) {
            if (c2597.f7313 && c2597.f7286 == null) {
                f9245.m8003(z, c2597);
                return;
            }
            if (c2597.f7309 && c2597.f7318.equals("")) {
                C3549.m8175(z, c2597.f7329, c2597);
                return;
            }
            if (c2597.f7305 && c2597.f7320.equals("")) {
                C3549.m8173(z, c2597.f7329, c2597);
                return;
            }
            if (c2597.f7311 && c2597.f7324.equals("")) {
                C3549.m8195(z, c2597.f7329, c2597);
                return;
            }
            if (c2597.f7317 && c2597.f7284.size() == 0 && c2597.f7285.size() == 0) {
                C3549.m8169(R.string.context_crt_apk_permission, z, c2597.f7329, c2597);
                return;
            } else {
                c2597.f7342 = z;
                m7953(f9253, c2597);
                return;
            }
        }
        m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.warning_multipatch_not_select));
    }

    public void m8068() {
        if (m7928().getBoolean("vibration", false)) {
            Vibrator vibrator = (Vibrator) mo1874().getSystemService("vibrator");
            f9346 = vibrator;
            vibrator.vibrate(50L);
        }
        ArrayList arrayList = new ArrayList();
        C3478 c3478 = f9253;
        if (c3478.f10061 && c3478.f10067.startsWith("/data/app")) {
            arrayList.add(new C3727(R.string.uninstall_updates, 0, "", R.drawable.remove));
        }
        if (f9283 && f9299 >= 21) {
            C3478 c34782 = f9253;
            if (c34782.f10061 && !c34782.f10069) {
                arrayList.add(new C3727(R.string.delete_system_app_for_user, 0, "", R.drawable.remove));
            }
        }
        if (f9283 && f9253.f10061) {
            arrayList.add(new C3727(R.string.delete_system_app, 0, "", R.drawable.remove));
        }
        if (arrayList.size() > 1) {
            C3549.m8161(arrayList, false);
            return;
        }
        if (arrayList.size() == 1) {
            m8049(((C3727) arrayList.get(0)).f10494);
        }
        if (arrayList.size() == 0) {
            m8081(false);
        }
    }

    void m8069() {
        MainActivity mainActivity;
        if (m7928().getBoolean("firmware_changed_magisk_module_deleted", false) && (mainActivity = f9259) != null) {
            C2500.m7133(mainActivity, C2500.m7007(R.string.warning), C2500.m7007(R.string.info_about_deleted_magisk_module_after_change_firmware));
            m7928().edit().putBoolean("firmware_changed_magisk_module_deleted", false).commit();
        }
        if (m7928().getBoolean("warning_play_protect", true)) {
            try {
                Intent intent = new Intent("com.google.android.gms.settings.VERIFY_APPS_SETTINGS");
                List<ResolveInfo> queryIntentActivities = m7929().getPackageManager().queryIntentActivities(intent, 66048);
                if (queryIntentActivities != null && queryIntentActivities.size() > 0) {
                    int componentEnabledSetting = m7929().getPackageManager().getComponentEnabledSetting(new ComponentName(queryIntentActivities.get(0).activityInfo.packageName, queryIntentActivities.get(0).activityInfo.name));
                    if (componentEnabledSetting != 1 && componentEnabledSetting != 0) {
                        if (f9283) {
                            new Thread(new RunnableC3212(queryIntentActivities, intent)).start();
                        }
                    }
                    m7954(new RunnableC3147(intent));
                }
            } catch (Throwable unused) {
                m7942("Security exception occurred");
            }
        }
        if (!m7928().getBoolean("dont_show_old_package_warning", false)) {
            try {
                m7932().getPackageInfo("com.android.vending.billing.InAppBillingService.COIN", 0);
                C2500.m7129(C2500.m7007(R.string.information), C2500.m7007(R.string.message_old_app_version), new DialogInterfaceOnClickListenerC3237(), new DialogInterfaceOnClickListenerC3262(), null);
            } catch (PackageManager.NameNotFoundException unused2) {
            }
        }
        if (m7928().getBoolean("warning_china_muiu_phone", true)) {
            try {
                m7942(Build.MANUFACTURER.toLowerCase());
                Intent m6902 = C2500.m6902();
                if (m6902 != null) {
                    m7954(new RunnableC3263(m6902));
                }
            } catch (Throwable unused3) {
                m7942("Security exception occurred");
            }
        }
    }

    public void m8070() {
        if (m7928().getBoolean("vibration", false)) {
            Vibrator vibrator = (Vibrator) mo1874().getSystemService("vibrator");
            f9346 = vibrator;
            vibrator.vibrate(50L);
        }
        C2500.m7116(f9253.f10046);
        f9289 = true;
    }

    public boolean m8071(boolean z, String str) {
        m7942("test path.");
        try {
            if (!new File(str).exists()) {
                new File(str).mkdirs();
            }
            if (!new File(str).exists()) {
                m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.messagePath));
                return false;
            }
            if (new File(str + "/tmp.txt").createNewFile()) {
                new File(str + "/tmp.txt").delete();
                return true;
            }
            if (z) {
                m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.messagePath));
            }
            return false;
        } catch (IOException unused) {
            if (z) {
                m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.messagePath));
            }
            return false;
        }
    }

    public void m8072() {
        C2500.m7078("/system", InternalZipConstants.WRITE_MODE);
        C2500.m7093("chattr -ai /system/etc/hosts");
        new C2500("").m7211(f9284 + C1574.class.getName());
        C2500.m7078("/system", "ro");
        Toast.makeText(m7929(), C2500.m7007(R.string.hosts_default), 1).show();
    }

    public void m8073() {
        m7956(new RunnableC3322());
    }

    public void m8074() {
        m7956(new RunnableC3315());
    }

    public void m8075(C2939 c2939) {
        if (m7966(true)) {
            f9401 = C2500.m7044();
            DialogInterfaceOnClickListenerC2981 dialogInterfaceOnClickListenerC2981 = new DialogInterfaceOnClickListenerC2981(c2939);
            if (C2500.m7060()) {
                C2500.m7127(C2500.m7007(R.string.warning), C2500.m7007(R.string.move_to_system), C2500.m7007(R.string.option_magisk_module), new C2985(), f9401, dialogInterfaceOnClickListenerC2981, dialogInterfaceOnClickListenerC2981, null, false);
            } else {
                C2500.m7125(C2500.m7007(R.string.warning), C2500.m7007(R.string.move_to_system), dialogInterfaceOnClickListenerC2981, dialogInterfaceOnClickListenerC2981, null);
            }
            C2500.m7177();
        }
    }

    public void m8076(C2939 c2939, boolean z) {
        if (m7966(true)) {
            f9389 = c2939;
            C2500.m7125(c2939.f9152, C2500.m7007(R.string.integrate_dalvik_code_message) + " " + f9389.f9152 + "?", new DialogInterfaceOnClickListenerC3382(c2939), null, null);
        }
    }

    public void m8077(C2939 c2939) {
        if (m7966(true)) {
            if (!c2939.f9152.equals("Bad file") && !c2939.f9152.equals("")) {
                this.f9430 = true;
                C2500.m7127(C2500.m7007(R.string.context_uninstall_if_installed), C2500.m7009(R.string.message_for_uninstall_and_install, c2939.f9152), C2500.m7007(R.string.checkbox_uninstall_and_instal_backup_cache), new C3457(), true, new DialogInterfaceOnClickListenerC3462(c2939), null, null, false);
            } else {
                m7962(C2500.m7007(R.string.error), C2500.m7007(R.string.message_error_file_apk_for_install_corrupt));
            }
        }
        f9282 = "";
    }

    void m8078(String str) {
        f9360.add(str);
        if (f9283) {
            m7956(new RunnableC3391(str));
        } else {
            C2500.m7153(App.MainActivity, str, Integer.valueOf(f9399));
        }
    }

    void m8079() {
        List<ResolveInfo> queryIntentServices = m7932().queryIntentServices(new Intent("com.android.vending.billing.InAppBillingService.INST"), 131584);
        if (queryIntentServices != null && queryIntentServices.size() > 1) {
            m7956(new RunnableC3291(queryIntentServices));
        }
    }

    public void m8080(boolean z) {
        try {
            m7942("Start uninstall to " + f9280.f9225);
        } catch (Exception unused) {
        }
        try {
            C3478 c3478 = f9253;
            if (!c3478.f10061) {
                if (!f9283) {
                    C2500.m7153(f9259, c3478.f10046, null);
                } else {
                    m7956(new RunnableC3295());
                }
            } else if (f9283) {
                m7956(new RunnableC3298(z));
            } else {
                m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.root_needed));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        try {
            m7928().edit().remove(f9253.f10046).commit();
            f9252.m8119(f9253.f10046);
            f9252.notifyDataSetChanged();
        } catch (Exception unused2) {
        }
        m7951(6);
    }

    public void m8081(boolean z) {
        if (m7928().getBoolean("vibration", false)) {
            Vibrator vibrator = (Vibrator) mo1874().getSystemService("vibrator");
            f9346 = vibrator;
            vibrator.vibrate(50L);
        }
        boolean z2 = f9253.f10061;
        if (z2 && !f9283) {
            m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.root_needed));
            return;
        }
        boolean[] zArr = {false};
        if (z2 && C2500.m7060() && f9299 >= 23) {
            String str = f9253.f10047;
            C2500.m7127(str, C2500.m7009(R.string.uninstall, str), C2500.m7007(R.string.option_magisk_module), new C3288(zArr), false, new DialogInterfaceOnClickListenerC3289(zArr), null, null, false);
        } else {
            String str2 = f9253.f10047;
            C2500.m7125(str2, C2500.m7009(R.string.uninstall, str2), new DialogInterfaceOnClickListenerC3290(zArr), null, null);
        }
    }

    public void m8082() {
        C3478 c3478 = f9253;
        if (c3478.f10061) {
            if (!f9283) {
                m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.root_needed));
            } else {
                String str = c3478.f10047;
                C2500.m7125(str, C2500.m7009(R.string.delete_system_app_for_user_message, str), new DialogInterfaceOnClickListenerC3308(), null, null);
            }
        }
    }

    public void m8083() {
        C3478 c3478 = f9253;
        if (c3478.f10061) {
            String str = c3478.f10047;
            C2500.m7125(str, C2500.m7009(R.string.uninstall_updates_message, str), new DialogInterfaceOnClickListenerC3302(), null, null);
        }
    }

    void m8084() {
        String str;
        Handler handler;
        String[] split;
        C2975 c2975;
        String str2 = "none";
        try {
            try {
                str2 = m7932().getPackageInfo("eu.chainfire.supersu", ItemType.CLASS_DATA_ITEM).applicationInfo.dataDir;
            } catch (PackageManager.NameNotFoundException unused) {
            } catch (Exception e) {
                e.printStackTrace();
            }
            if (m7928().getBoolean("selinux_set_to_permissive", false)) {
                str = "set_permissive";
            } else {
                str = "skip_permissive";
            }
            String m7092 = C2500.m7092(C1678.class, m7929().getFilesDir().getAbsolutePath(), "" + f9299, f9246, str2, str, "" + C2500.m6905());
            f9323 = Boolean.FALSE;
            m7942(m7092);
            f9295 = C2500.m6931();
            f9297 = true;
            try {
                if (m7092.contains("selinux is enforcing!")) {
                    f9247 = "enforce";
                }
                if (m7092.contains("util not work correct")) {
                    m7928().edit().putBoolean("use_app_process", true).commit();
                    f9284 = C2500.m6990();
                    f9285 = C2500.m6991();
                } else if (m7928().getBoolean("use_app_process", false) && !m7928().getBoolean("force_use_app_process", false)) {
                    m7928().edit().putBoolean("use_app_process", false).commit();
                    f9284 = C2500.m6990();
                    f9285 = C2500.m6991();
                }
                if (!m7928().getBoolean("disable_removing_magisk_module_after_change_firmware", false) && m7092.contains("firmware updated: need clear magisk module android patches") && (c2975 = f9245) != null) {
                    C2500.m7134(c2975.mo1874(), C2500.m7007(R.string.warning), C2500.m7007(R.string.info_about_deleted_magisk_module_after_change_firmware_2), C2500.m7007(R.string.reboot), new DialogInterfaceOnClickListenerC3018());
                }
                if (m7092.contains("Unused ODEX in /data/app/ removed!") && (split = m7092.split("\n")) != null && split.length > 0) {
                    for (String str3 : split) {
                        if (str3.startsWith("UnusedOdexList:")) {
                            String replaceAll = str3.replaceAll("UnusedOdexList:", "").replaceAll("/data/app/", "");
                            m7942(replaceAll);
                            String[] split2 = replaceAll.split("\\|");
                            if (split2 != null && split2.length > 0) {
                                m7942("files:" + split2.length);
                                for (int i = 0; i < split2.length; i++) {
                                    m7942("show notify:" + split2[i]);
                                    C2500.m7136(i, "Lucky Patcher - " + C2500.m7007(R.string.unused_odex_delete), C2500.m7007(R.string.unused_odex_delete), split2[i]);
                                }
                            }
                        }
                    }
                }
                if (m7092.contains("Mount name space separation in SuperSu detected.")) {
                    m7928().edit().putBoolean("supersu_mount_namespace_separation", true).commit();
                    m7954(new RunnableC3046());
                } else {
                    m7928().edit().putBoolean("supersu_mount_namespace_separation", false).commit();
                }
            } catch (Exception e2) {
                e2.printStackTrace();
            }
            if (m7928().getInt("root_force", 0) == 0) {
                if (!m7092.contains("root found!")) {
                    f9283 = false;
                    Handler handler2 = f9312;
                    if (handler2 != null) {
                        handler2.post(new RunnableC3095());
                        return;
                    }
                    return;
                }
                if (m7092.contains("busybox not found!") && (handler = f9312) != null) {
                    handler.post(new RunnableC3098());
                }
            }
        } catch (Exception e3) {
            e3.printStackTrace();
        }
    }

    public void m8085(Uri uri, String str) {
        if (uri != null) {
            try {
                m7942("uri:" + uri.toString());
                m7956(new RunnableC3075(uri, str));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}