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

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


package p038;

import android.database.sqlite.SQLiteDatabase;
import android.util.Base64;
import com.unity3d.ads.metadata.MediationMetaData;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.RandomAccessFile;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Array;
import java.nio.BufferUnderflowException;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.Iterator;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import net.lingala.zip4j.util.InternalZipConstants;
import org.jf.dexlib2.analysis.RegisterType;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import p031.C2419;
import p031.C2420;
import p037.C2500;
import p039.C2604;
import p040.C2610;
import p040.C2611;
import p040.C2612;
import p040.C2615;
import p040.C2616;
import p040.C2617;
import p040.C2620;
import p040.C2621;
import p040.C2622;
import p040.C2625;
import p040.C2630;
import p040.C2631;
import p040.C2632;
import p040.C2633;
import p040.C2634;
import p085.C2932;
import p085.C2975;
import p086.C3549;
import ru.aaaaabbt.installer.R;
import sun.security.x509.PolicyMappingsExtension;

public class C2597 {

    public static String f7278 = "Error LP:";

    public boolean f7279 = false;

    public boolean f7305 = false;

    public boolean f7309 = false;

    public boolean f7311 = false;

    public boolean f7313 = false;

    public boolean f7315 = false;

    public boolean f7317 = false;

    public boolean f7319 = false;

    public boolean f7321 = false;

    public boolean f7323 = false;

    public boolean f7325 = false;

    public boolean f7327 = false;

    public File f7329 = null;

    public File[] f7331 = null;

    public File[] f7333 = null;

    public File[] f7335 = null;

    public ArrayList<File> f7337 = null;

    public ArrayList<File> f7339 = new ArrayList<>();

    public ArrayList<File> f7341 = new ArrayList<>();

    public String f7343 = "";

    public String f7345 = "";

    public String f7347 = "";

    public String f7349 = "";

    public File f7351 = null;

    public int f7353 = 0;

    public int f7354 = 0;

    public int f7338 = 0;

    public File f7340 = null;

    public String f7280 = "not_system";

    public String f7310 = "";

    public String f7307 = "";

    public String f7314 = "";

    public String f7312 = "";

    public String f7334 = "";

    public String f7316 = "";

    public String f7320 = "";

    public String f7318 = "";

    public String f7324 = "";

    public String f7322 = "";

    public String f7328 = "";

    public String f7326 = "";

    public boolean f7330 = false;

    public boolean f7344 = false;

    public boolean f7332 = false;

    public boolean f7342 = false;

    public ArrayList<File> f7346 = new ArrayList<>();

    public File f7348 = null;

    public String f7350 = "";

    public int f7336 = -1;

    public int f7352 = -1;

    public int f7281 = -1;

    public int f7282 = -1;

    public boolean f7283 = false;

    public ArrayList<String> f7284 = new ArrayList<>();

    public ArrayList<String> f7285 = new ArrayList<>();

    public File f7286 = null;

    public ArrayList<C2621> f7287 = new ArrayList<>();

    public String f7288 = "";

    public boolean f7289 = false;

    public boolean f7290 = false;

    public boolean f7291 = false;

    public boolean f7292 = false;

    public boolean f7293 = false;

    public boolean f7294 = false;

    public boolean f7295 = false;

    public boolean f7296 = false;

    public boolean f7297 = false;

    public boolean f7298 = false;

    public String f7299 = "";

    public boolean f7300 = false;

    public String f7301 = "";

    public boolean f7302 = false;

    public File f7303 = null;

    public boolean f7304 = false;

    public File f7306 = null;

    public ArrayList<C2630> f7308 = new ArrayList<>();

    public class RunnableC2598 implements Runnable {
        RunnableC2598() {
        }

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

    public class RunnableC2599 implements Runnable {
        RunnableC2599() {
        }

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

    void m7232(int i, ArrayList<String> arrayList, String str, String str2, String str3) {
        if (i >= arrayList.size()) {
            arrayList.add(i, "");
        }
        arrayList.set(i, arrayList.get(i).replace(str, str2) + str3);
    }

    public void m7233(String str) {
        try {
            C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_step6), "", 6, 6, false);
            if (this.f7286.getName().contains("patch.by.sanx_com.maxmpz.audioplayer")) {
                C2975.f9245.m8038();
            }
            if (this.f7286.getName().contains("patch_ren.by.ramzezzz_com.maxmpz.audioplayer.txt")) {
                C2975.f9245.m8039();
            }
            if (this.f7286.getName().contains("patch.by.sanx_com.emulator.fpse")) {
                C2975.f9245.m8012();
            }
            C2500.m7053(this.f7345);
        } catch (Exception e) {
            e.printStackTrace();
            C2975.m7942("luuuuu " + e);
        }
    }

    boolean m7234(File file, FileChannel fileChannel, MappedByteBuffer mappedByteBuffer, byte[] bArr, int i, C2631[] c2631Arr, int i2, C2612 c2612) throws IOException {
        byte[] bArr2;
        int i3;
        byte b;
        int i4;
        byte b2;
        int i5;
        int i6;
        MappedByteBuffer mappedByteBuffer2 = mappedByteBuffer;
        int i7 = 0;
        byte b3 = bArr[i + 0];
        int i8 = 0;
        while (true) {
            C2631 c2631 = c2631Arr[i2];
            if (b3 != c2631.f7550[i8] && (i6 = c2631.f7551[i8]) != 1 && (i6 <= 1 || b3 != c2612.f7445.get(i6 - 2).byteValue())) {
                return false;
            }
            C2631 c26312 = c2631Arr[i2];
            byte[] bArr3 = c26312.f7552;
            if (i8 < bArr3.length) {
                byte[] bArr4 = c26312.f7553;
                bArr4[i8] = bArr3[i8];
                try {
                    i5 = c26312.f7554[i8];
                    if (i5 == 0) {
                        bArr4[i8] = b3;
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (i5 > 1 && i5 < 253) {
                    byte b4 = bArr3[i8];
                    if (b4 != 0) {
                        if (b4 != 1) {
                            if (b4 == 96) {
                                try {
                                    bArr4[i8] = c2612.f7445.get(i5 - 2).byteValue();
                                } catch (Exception unused) {
                                    int i9 = c2631Arr[i2].f7554[i8] - 2;
                                    c2612.m7269("Byte N" + i9 + " not found! Please edit search pattern for byte " + i9 + ".", file);
                                }
                            }
                        } else {
                            try {
                                bArr4[i8] = (byte) ((i5 - 2) + b3);
                            } catch (Exception e2) {
                                e2.printStackTrace();
                                c2612.m7269(f7278 + "Cannot read addition a number.", file);
                            }
                        }
                    } else {
                        try {
                            bArr4[i8] = (byte) (b3 - (i5 - 2));
                        } catch (Exception e3) {
                            e3.printStackTrace();
                            c2612.m7269(f7278 + "Cannot read subtract a number.", file);
                        }
                    }
                    e.printStackTrace();
                }
                C2631 c26313 = c2631Arr[i2];
                int i10 = c26313.f7554[i8];
                if (i10 == 253) {
                    byte[] bArr5 = c26313.f7553;
                    int i11 = b3 & RegisterType.DOUBLE_HI;
                    bArr5[i8] = (byte) (i11 + (i11 * 16));
                }
                if (i10 == 255) {
                    int i12 = c26313.f7555[i8];
                    if (b3 < 16) {
                        c26313.f7553[i8] = (byte) ((b3 & RegisterType.DOUBLE_HI) + (i12 * 16));
                    } else {
                        if (i8 >= 7 && (((b = (bArr2 = c26313.f7550)[i8 - 1]) == 10 || b == 12) && ((b2 = bArr2[i8 - 7]) == 110 || b2 == 111 || b2 == 113 || b2 == 114 || b2 == 116 || b2 == 117 || b2 == 118 || b2 == 119 || b2 == 120))) {
                            byte[] bArr6 = c26313.f7553;
                            bArr6[i4] = 0;
                            bArr6[i8 - 6] = 0;
                            bArr6[i8 - 5] = 0;
                            bArr6[i8 - 4] = 0;
                            bArr6[i8 - 3] = 19;
                            bArr6[i8 - 2] = b3;
                            bArr6[i3] = (byte) ((b3 & RegisterType.DOUBLE_HI) + (i12 * 16));
                            bArr6[i8] = 0;
                        }
                        byte b5 = c26313.f7550[i8 - 1];
                        if (b5 != 10 && b5 != 12) {
                            c26313.f7553[i8] = (byte) ((b3 & RegisterType.DOUBLE_HI) + (i12 * 16));
                        }
                    }
                }
            }
            i8++;
            C2631 c26314 = c2631Arr[i2];
            byte[] bArr7 = c26314.f7550;
            if (i8 == bArr7.length) {
                if (c26314.f7559 || c26314.f7552.length != bArr7.length) {
                    C2975.m7942("run insert logic patch");
                    try {
                        mappedByteBuffer2.position((i + i8) - 1);
                        int size = ((int) fileChannel.size()) - mappedByteBuffer.position();
                        byte[] bArr8 = new byte[size];
                        mappedByteBuffer2.get(bArr8, 0, size);
                        ByteBuffer wrap = ByteBuffer.wrap(bArr8);
                        C2631 c26315 = c2631Arr[i2];
                        int length = c26315.f7552.length;
                        int length2 = c26315.f7550.length;
                        if (length >= length2) {
                            while (true) {
                                C2631 c26316 = c2631Arr[i2];
                                byte[] bArr9 = c26316.f7552;
                                if (i8 >= bArr9.length) {
                                    break;
                                }
                                c26316.f7553[i8] = bArr9[i8];
                                i8++;
                            }
                            fileChannel.position(r0 + (length - length2));
                        } else {
                            i7 = length2 - length;
                            fileChannel.position(r0 - i7);
                        }
                        fileChannel.write(wrap);
                        fileChannel.truncate(fileChannel.size() - i7);
                        mappedByteBuffer2 = fileChannel.map(FileChannel.MapMode.READ_WRITE, 0L, (int) fileChannel.size());
                    } catch (Throwable th) {
                        th.printStackTrace();
                    }
                }
                fileChannel.position(i);
                fileChannel.write(ByteBuffer.wrap(c2631Arr[i2].f7553));
                mappedByteBuffer2.force();
                return true;
            }
            int i13 = i + i8;
            if (i13 >= bArr.length) {
                return false;
            }
            b3 = bArr[i13];
        }
    }

    public void m7235() {
        String m7143;
        ArrayList arrayList;
        ?? r2 = ";";
        C2500.m7053(this.f7345);
        try {
            C2500.m6875(this.f7351, new File(this.f7328 + InternalZipConstants.ZIP_FILE_SEPARATOR + this.f7345 + ".apk"));
            m7143 = C2500.m7143(this.f7345);
            arrayList = new ArrayList();
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (this.f7348.exists()) {
            int i = 0;
            Object obj = null;
            try {
            } catch (Exception e2) {
                e = e2;
            }
            try {
                if (!this.f7322.contains("DeepWork")) {
                    C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_progress_strings_analisis), "%1d/%2d", 3, 6, false);
                    String[] m7889 = new C2932().m7889(this.f7348);
                    String[] m7890 = new C2932().m7890(this.f7348);
                    if (m7889 != null && m7889.length > 0) {
                        for (String str : m7889) {
                            arrayList.add(str);
                        }
                    }
                    if (m7890 != null && m7890.length > 0) {
                        for (String str2 : m7890) {
                            arrayList.add(str2);
                        }
                    }
                    String[] strArr = (String[]) arrayList.toArray(new String[arrayList.size()]);
                    r2 = strArr;
                    if (!new C2932().m7887(this.f7348, this.f7345, m7143)) {
                        C2975.m7942("LP error: package name not changed:(");
                        r2 = strArr;
                    }
                } else {
                    String[] m78892 = new C2932().m7889(this.f7348);
                    String[] m78902 = new C2932().m7890(this.f7348);
                    C2932.m7884(this.f7348, this.f7345);
                    if (m78892 != null && m78892.length > 0) {
                        for (int i2 = 0; i2 < m78892.length; i2++) {
                            if (!m78892[i2].contains(this.f7345)) {
                                arrayList.add(m78892[i2]);
                            }
                        }
                    }
                    if (m78902 != null && m78902.length > 0) {
                        for (int i3 = 0; i3 < m78902.length; i3++) {
                            if (m78902[i3].contains(";")) {
                                String[] split = m78902[i3].split(";");
                                if (split != null && split.length > 0) {
                                    for (int i4 = 0; i4 < split.length; i4++) {
                                        if (!split[i4].contains(this.f7345)) {
                                            arrayList.add(split[i4]);
                                        }
                                    }
                                }
                            } else if (!m78902[i3].contains(this.f7345)) {
                                arrayList.add(m78902[i3]);
                            }
                        }
                    }
                    arrayList.add(this.f7345);
                    arrayList.add("Java_" + this.f7345.replaceAll("\\.", "_"));
                    arrayList.add(this.f7345.replaceAll("\\.", "\\/"));
                    String[] strArr2 = (String[]) arrayList.toArray(new String[arrayList.size()]);
                    C2500.m7084(this.f7348.getAbsolutePath(), strArr2);
                    r2 = strArr2;
                }
            } catch (Exception e3) {
                e = e3;
                obj = r2;
                e.printStackTrace();
                r2 = obj;
                if (!this.f7322.contains("DeepWork")) {
                }
                C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_step3), "%1d/%2d", 3, 6, false);
                if (!this.f7348.exists()) {
                }
            }
            if (!this.f7322.contains("DeepWork")) {
                C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_progress_strings_analisis), "%1d/%2d", 3, 6, false);
                for (File file : this.f7331) {
                    C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_progress_strings_analisis), "%1d/%2d", 3, 6, false);
                    C2975.m7942("String analysis.");
                    if (C2500.m7178(file.getAbsolutePath(), this.f7345, m7143) > 0) {
                        C2975.m7942("classes.dex changed!");
                    }
                    if (C2500.m7084(file.getAbsolutePath(), r2) > 0) {
                        C2975.m7942("global classes.dex changed!");
                    }
                    C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_step3), "%1d/%2d", 3, 6, false);
                    if (!this.f7341.contains(file)) {
                        this.f7341.add(file);
                    }
                }
                for (File file2 : this.f7333) {
                    if (C2500.m7084(file2.getAbsolutePath(), r2) > 0) {
                        C2975.m7942(file2.getName() + " resource changed!");
                        if (!this.f7341.contains(file2)) {
                            this.f7341.add(file2);
                        }
                    }
                }
                File[] fileArr = this.f7335;
                if (fileArr != null) {
                    int length = fileArr.length;
                    while (i < length) {
                        File file3 = fileArr[i];
                        if (C2500.m7084(file3.getAbsolutePath(), r2) > 0) {
                            C2975.m7942(file3.getName() + " lib changed!");
                            if (!this.f7341.contains(file3)) {
                                this.f7341.add(file3);
                            }
                        }
                        i++;
                    }
                }
            } else {
                File[] fileArr2 = this.f7331;
                int length2 = fileArr2.length;
                while (i < length2) {
                    File file4 = fileArr2[i];
                    C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_progress_strings_analisis), "%1d/%2d", 3, 6, false);
                    C2975.m7942("String analysis.");
                    if (C2500.m7084(file4.getAbsolutePath(), r2) > 0) {
                        C2975.m7942("classes.dex changed!");
                    }
                    C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_step3), "%1d/%2d", 3, 6, false);
                    if (!this.f7341.contains(file4)) {
                        this.f7341.add(file4);
                    }
                    i++;
                }
            }
            C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_step3), "%1d/%2d", 3, 6, false);
            if (!this.f7348.exists()) {
                C2975.m7942("Found androidmanifest");
                if (this.f7322.contains("ChangeSharedUserId")) {
                    try {
                        C2932.m7885(this.f7348);
                    } catch (IOException e4) {
                        throw new RuntimeException(e4);
                    }
                }
                if (!this.f7341.contains(this.f7348)) {
                    this.f7341.add(this.f7348);
                    return;
                }
                return;
            }
            return;
        }
        throw new FileNotFoundException();
    }

    public java.util.ArrayList<p040.C2632> m7236(p040.C2634 r41, java.io.File r42) {
        throw new UnsupportedOperationException("Method not decompiled: p038.C2597.m7236(ʼי.゙, java.io.File):java.util.ArrayList");
    }

    public void m7237() {
        if (!this.f7348.exists()) {
            if (C2975.f9245 != null) {
                C2975.m7954(new RunnableC2598());
                return;
            }
            return;
        }
        try {
            new C2932().m7888(this.f7348, this.f7284, this.f7285);
        } catch (IOException e) {
            e.printStackTrace();
        } catch (Exception e2) {
            e2.printStackTrace();
            if (C2975.f9245 != null) {
                C2975.m7954(new RunnableC2599());
                return;
            }
            return;
        }
        if (!this.f7341.contains(this.f7348)) {
            C2975.m7942("add androidManifest to patchedFiles.");
            this.f7341.add(this.f7348);
        }
    }

    public void m7238(String str) {
        String str2;
        Enumeration<C2419> enumeration;
        boolean z;
        InputStream m6613;
        C2597 c2597 = this;
        String str3 = "/arm/";
        ArrayList<File> arrayList = c2597.f7337;
        if (arrayList != null && arrayList.size() > 0) {
            Iterator<File> it = c2597.f7337.iterator();
            while (it.hasNext()) {
                try {
                    C2420 c2420 = new C2420(it.next());
                    Enumeration<C2419> m6611 = c2420.m6611();
                    while (m6611.hasMoreElements()) {
                        C2419 nextElement = m6611.nextElement();
                        String name = nextElement.getName();
                        if (name.startsWith("lib/")) {
                            StringBuilder sb = new StringBuilder();
                            enumeration = m6611;
                            sb.append(C2500.m6942(c2597.f7351).getAbsolutePath());
                            sb.append(InternalZipConstants.ZIP_FILE_SEPARATOR);
                            str2 = str3;
                            try {
                                sb.append(name.replace("/armeabi-v7a/", str3).replace("/armeabi/", str3).replace("/arm64-v8a/", "/arm64/"));
                                File file = new File(sb.toString());
                                if ((!file.exists() || file.length() == nextElement.getSize()) && file.exists()) {
                                    z = false;
                                    if (!nextElement.isDirectory() && z) {
                                        m6613 = c2420.m6613(nextElement);
                                        if (C2500.m6876(m6613, file)) {
                                            m6613.close();
                                        } else {
                                            m6613.close();
                                            C2500.m7098("chmod", "755", file.getAbsolutePath());
                                            C2500.m7098("chown", "1000.1000", file.getAbsolutePath());
                                            C2500.m7098("chown", "1000:1000", file.getAbsolutePath());
                                            new C2500("");
                                            C2500.m7110(str + "lib", file.getAbsolutePath(), "755", true);
                                            new C2500("");
                                            C2500.m7109(str + "lib", file.getAbsolutePath(), "1000:1000", true);
                                            new File(str + name);
                                            C2500.m7094("ln", file.getAbsolutePath(), new File(str + "lib/" + file.getName()).getAbsolutePath());
                                        }
                                    }
                                }
                                z = true;
                                if (!nextElement.isDirectory()) {
                                    m6613 = c2420.m6613(nextElement);
                                    if (C2500.m6876(m6613, file)) {
                                    }
                                }
                            } catch (IOException e) {
                                e = e;
                                e.printStackTrace();
                                c2597 = this;
                                str3 = str2;
                            }
                        } else {
                            enumeration = m6611;
                            str2 = str3;
                        }
                        c2597 = this;
                        m6611 = enumeration;
                        str3 = str2;
                    }
                    str2 = str3;
                    c2420.close();
                } catch (IOException e2) {
                    e = e2;
                    str2 = str3;
                }
                c2597 = this;
                str3 = str2;
            }
        }
    }

    public void m7239() {
        Iterator<File> it = this.f7341.iterator();
        while (it.hasNext()) {
            File next = it.next();
            if (next.getName().endsWith(".dex")) {
                if (!C2975.f9323.booleanValue()) {
                    C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_step3) + "\n" + next.getName(), "%1d/%2d", 3, 6, false);
                }
                C2500.m6908(next);
            }
        }
    }

    public void m7240() {
        throw new UnsupportedOperationException("Method not decompiled: p038.C2597.m7240():void");
    }

    public void m7241() {
        boolean z;
        boolean z2;
        String str;
        int i;
        boolean z3;
        Iterator<C2612> it;
        String str2;
        int i2;
        String str3;
        int i3;
        ArrayList<String> arrayList = new ArrayList<>();
        if (this.f7342) {
            this.f7316 += "SU Java-Code Running! javaroot.utils.custompatch\n";
        }
        String[] split = this.f7316.split("next_custom_patch_maker_for_split");
        this.f7316 = "";
        int i4 = 0;
        int i5 = 1;
        String[] strArr = split;
        boolean z4 = false;
        boolean z5 = true;
        int i6 = 0;
        int i7 = 0;
        while (i6 < this.f7287.size()) {
            C2621 c2621 = this.f7287.get(i6);
            if (!c2621.f7510) {
                z = false;
            } else {
                z = z5;
            }
            if (c2621.f7511) {
                z2 = true;
            } else {
                z2 = z4;
            }
            if (c2621.f7492 == 0) {
                m7232(c2621.f7509, arrayList, "", "", c2621.f7495);
            }
            if (c2621.f7492 == 12) {
                i7++;
                if (i6 + 1 != this.f7287.size()) {
                    String str4 = (("\n****************************************\n") + C2500.m7007(R.string.custom_patch_log_next_custom_patch) + ":\n") + "****************************************\n\n";
                    if (i7 >= strArr.length) {
                        ArrayList arrayList2 = new ArrayList();
                        for (String str5 : strArr) {
                            arrayList2.add(str5);
                        }
                        arrayList2.add("");
                        strArr = (String[]) arrayList2.toArray(new String[arrayList2.size()]);
                    }
                    str = ":\n";
                    m7232(c2621.f7509, arrayList, "", "", str4);
                    z = true;
                    z2 = false;
                    String str6 = "---------------------------------\n\n";
                    String str7 = "---------------------------------\n";
                    String str8 = " ";
                    if (c2621.f7492 == i5) {
                        C2612 c2612 = c2621.f7497.get(i4);
                        Iterator<File> it2 = c2612.f7442.iterator();
                        while (it2.hasNext()) {
                            File next = it2.next();
                            StringBuilder sb = new StringBuilder();
                            sb.append("" + str7);
                            sb.append(C2604.m7263("Patch for"));
                            sb.append(str8);
                            sb.append(next.getName());
                            String str9 = str;
                            sb.append(str9);
                            m7232(c2621.f7509, arrayList, "", "", ((sb.toString() + str6) + c2621.f7495) + c2612.m7270(next));
                            str8 = str8;
                            str6 = str6;
                            str = str9;
                            str7 = str7;
                            z = z;
                            strArr = strArr;
                            i7 = i7;
                            c2612 = c2612;
                        }
                    }
                    String str10 = str8;
                    String[] strArr2 = strArr;
                    int i8 = i7;
                    boolean z6 = z;
                    String str11 = str;
                    String str12 = str7;
                    String str13 = str6;
                    i = c2621.f7492;
                    int i9 = 11;
                    int i10 = 2;
                    if ((i != 2 || i == 6 || i == 7 || i == 11 || i == 8 || i == 27 || i == 9) && (z3 = this.f7342) && z3) {
                        it = c2621.f7497.iterator();
                        while (it.hasNext()) {
                            C2612 next2 = it.next();
                            Iterator<File> it3 = next2.f7442.iterator();
                            while (it3.hasNext()) {
                                File next3 = it3.next();
                                String str14 = "" + str12;
                                int i11 = c2621.f7492;
                                if (i11 != i10) {
                                    if (i11 != i9) {
                                        if (i11 != 27) {
                                            switch (i11) {
                                                case 6:
                                                    str14 = str14 + C2604.m7263("Patch for libraries") + " (armeabi)\n" + next3.getAbsolutePath().replace(this.f7328, "") + str11;
                                                    break;
                                                case 7:
                                                    str14 = str14 + C2604.m7263("Patch for libraries") + " (armeabi-v7a)\n" + next3.getAbsolutePath().replace(this.f7328, "") + str11;
                                                    break;
                                                case 8:
                                                    str14 = str14 + C2604.m7263("Patch for libraries") + " (MIPS)\n" + next3.getAbsolutePath().replace(this.f7328, "") + str11;
                                                    break;
                                                case 9:
                                                    str14 = str14 + C2604.m7263("Patch for libraries") + " (x86)\n" + next3.getAbsolutePath().replace(this.f7328, "") + str11;
                                                    break;
                                            }
                                        } else {
                                            str14 = str14 + C2604.m7263("Patch for libraries") + " (x86_64)\n" + next3.getAbsolutePath().replace(this.f7328, "") + str11;
                                        }
                                    } else {
                                        str14 = str14 + C2604.m7263("Patch for libraries") + " (arm64-v8a)\n" + next3.getAbsolutePath().replace(this.f7328, "") + str11;
                                    }
                                } else {
                                    str14 = str14 + C2604.m7263("Patch for libraries") + str10 + next3.getAbsolutePath().replace(this.f7328, "") + str11;
                                }
                                m7232(c2621.f7509, arrayList, "", "", ((str14 + str13) + c2621.f7495) + next2.m7270(next3));
                                next2 = next2;
                                i10 = 2;
                                i9 = 11;
                            }
                        }
                    }
                    String str15 = "---------------------------\n";
                    if (c2621.f7492 == 10) {
                        if (!this.f7342) {
                            str2 = "---------------------------\n";
                            m7232(c2621.f7509, arrayList, "", "", (((("" + str2) + "Patch for file from apk:\n") + "---------------------------\n\n") + "You must run rebuild for this application with custom patch, then patch will work.\n\n") + c2621.f7495);
                            if (c2621.f7492 == 24) {
                                if (this.f7342) {
                                    Iterator<C2610> it4 = c2621.f7502.iterator();
                                    while (it4.hasNext()) {
                                        C2610 next4 = it4.next();
                                        m7232(c2621.f7509, arrayList, "", "", ((("" + str2) + "Add file " + new File(next4.f7430).getName() + " to apk:\n") + "---------------------------\n\n") + c2621.f7495 + next4.f7432);
                                    }
                                } else {
                                    m7232(c2621.f7509, arrayList, "", "", (((("" + str2) + "Add file to apk:\n") + "---------------------------\n\n") + "You must run rebuild for this application with custom patch, then the file will be added.\n\n") + c2621.f7495);
                                }
                            }
                            if (c2621.f7492 == 25) {
                                if (this.f7342) {
                                    Iterator<C2616> it5 = c2621.f7503.iterator();
                                    while (it5.hasNext()) {
                                        C2616 next5 = it5.next();
                                        m7232(c2621.f7509, arrayList, "", "", ((("" + str2) + "Rename file " + next5.f7470 + str11) + "---------------------------\n\n") + c2621.f7495 + next5.f7472);
                                    }
                                } else {
                                    m7232(c2621.f7509, arrayList, "", "", (((("" + str2) + "Rename file to apk:\n") + "---------------------------\n\n") + "You must run rebuild for this application with custom patch, then the file will be renamed.\n\n") + c2621.f7495);
                                }
                            }
                            if (c2621.f7492 == 26) {
                                if (this.f7342) {
                                    Iterator<String> it6 = c2621.f7500.iterator();
                                    while (it6.hasNext()) {
                                        m7232(c2621.f7509, arrayList, "", "", (((("" + str2) + "Delete file " + it6.next() + str11) + "---------------------------\n\n") + "If the file was found, it is deleted.\n\n") + c2621.f7495);
                                    }
                                } else {
                                    m7232(c2621.f7509, arrayList, "", "", (((("" + str2) + "Delete file to apk:\n") + "---------------------------\n\n") + "You must run rebuild for this application with custom patch, then the file will be deleted.\n\n") + c2621.f7495);
                                }
                            }
                            if (c2621.f7492 == 28) {
                                if (this.f7342) {
                                    Iterator<String> it7 = c2621.f7501.iterator();
                                    while (it7.hasNext()) {
                                        m7232(c2621.f7509, arrayList, "", "", (((("" + str2) + "Delete folder " + it7.next() + str11) + "---------------------------\n\n") + "If the folder was found, it is deleted.\n\n") + c2621.f7495);
                                    }
                                } else {
                                    m7232(c2621.f7509, arrayList, "", "", (((("" + str2) + "Delete folder to apk:\n") + "---------------------------\n\n") + "You must run rebuild for this application with custom patch, then the folder will be deleted.\n\n") + c2621.f7495);
                                }
                            }
                            if (c2621.f7492 == 19 && !this.f7342) {
                                m7232(c2621.f7509, arrayList, "", "", (("" + str2) + C2500.m7007(R.string.custom_patch_log_add_custom_patch_to_boot_list) + "\n") + "---------------------------\n\n");
                            }
                            if (c2621.f7492 != 20 && !this.f7342) {
                                i2 = i6;
                                str3 = "\n\n";
                                m7232(c2621.f7509, arrayList, "", "", ((("" + str2) + C2500.m7007(R.string.custom_patch_log_change_components) + str11) + "---------------------------\n\n") + c2621.f7495);
                                if (c2621.f7505.size() > 0) {
                                    Iterator<C2620> it8 = c2621.f7505.iterator();
                                    while (it8.hasNext()) {
                                        C2620 next6 = it8.next();
                                        if (next6.f7491) {
                                            m7232(c2621.f7509, arrayList, "", "", C2500.m7007(R.string.enabled) + str11 + next6.f7490 + str3);
                                        } else {
                                            m7232(c2621.f7509, arrayList, "", "", C2500.m7007(R.string.disabled) + str11 + next6.f7490 + str3);
                                        }
                                    }
                                }
                            } else {
                                i2 = i6;
                                str3 = "\n\n";
                            }
                            if (c2621.f7492 == 21) {
                                m7232(c2621.f7509, arrayList, "", "", (("" + str2) + C2500.m7007(R.string.custom_patch_log_change_preferences) + str11) + "---------------------------\n\n");
                                if (c2621.f7507.size() > 0) {
                                    Iterator<C2615> it9 = c2621.f7507.iterator();
                                    while (it9.hasNext()) {
                                        C2615 next7 = it9.next();
                                        if (next7.f7468) {
                                            m7232(c2621.f7509, arrayList, "", "", next7.f7467 + "\n");
                                        } else {
                                            c2621.f7510 = false;
                                            m7232(c2621.f7509, arrayList, "", "", f7278 + C2500.m7007(R.string.custom_patch_log_change_preference_not_found_file) + str10 + next7.f7460 + str3);
                                        }
                                    }
                                }
                            }
                            if (c2621.f7492 == 17) {
                                Iterator<C2611> it10 = c2621.f7499.iterator();
                                while (it10.hasNext()) {
                                    C2611 next8 = it10.next();
                                    m7232(c2621.f7509, arrayList, "", "", ((("" + str2) + "Copy file " + next8.f7435 + " to:\n" + next8.f7436 + "\n") + "---------------------------\n\n") + c2621.f7495 + next8.f7437);
                                }
                            }
                            if (c2621.f7492 != 4) {
                                i3 = i2;
                                if (this.f7287.size() - 1 == i3) {
                                    if (c2621.f7492 == 12) {
                                    }
                                }
                                i6 = i3 + 1;
                                z4 = z2;
                                z5 = z6;
                                strArr = strArr2;
                                i7 = i8;
                                i4 = 0;
                                i5 = 1;
                            } else {
                                i3 = i2;
                            }
                            m7232(c2621.f7509, arrayList, "for_insert_result_end_" + c2621.f7509 + "\n", "", strArr2[c2621.f7509]);
                            if (!arrayList.get(c2621.f7509).contains(f7278)) {
                                m7232(c2621.f7509, arrayList, "for_insert_result_end_" + c2621.f7509, "", c2621.f7495);
                            } else {
                                m7232(c2621.f7509, arrayList, "for_insert_result_end_" + c2621.f7509, "", "");
                                if (arrayList.get(c2621.f7509).contains("for_insert_result_not_all_patch_" + c2621.f7509)) {
                                    m7232(c2621.f7509, arrayList, "for_insert_result_not_all_patch_" + c2621.f7509, C2500.m7007(R.string.custom_patch_result_not_all_patches_apply) + "\n" + C2500.m7007(R.string.custom_patch_result_all_dont_patch), "");
                                } else {
                                    if (arrayList.get(c2621.f7509).contains("for_insert_result_all_not_patch_" + c2621.f7509) && !z2) {
                                        m7232(c2621.f7509, arrayList, "for_insert_result_all_not_patch_" + c2621.f7509, C2500.m7007(R.string.custom_patch_result_all_dont_patch), "");
                                    } else {
                                        if (z2 && !z6) {
                                            m7232(c2621.f7509, arrayList, "for_insert_result_all_not_patch_" + c2621.f7509, "", C2500.m7007(R.string.custom_patch_result_not_all_patches_apply) + "\n" + C2500.m7007(R.string.custom_patch_result_all_dont_patch));
                                        }
                                        if (!z6 && !z2) {
                                            m7232(c2621.f7509, arrayList, "for_insert_result_all_not_patch_" + c2621.f7509, "", C2500.m7007(R.string.custom_patch_result_all_dont_patch));
                                        }
                                    }
                                }
                            }
                            m7232(c2621.f7509, arrayList, "", "", "\n");
                            i6 = i3 + 1;
                            z4 = z2;
                            z5 = z6;
                            strArr = strArr2;
                            i7 = i8;
                            i4 = 0;
                            i5 = 1;
                        } else {
                            Iterator<C2612> it11 = c2621.f7497.iterator();
                            while (it11.hasNext()) {
                                C2612 next9 = it11.next();
                                Iterator<File> it12 = next9.f7442.iterator();
                                while (it12.hasNext()) {
                                    File next10 = it12.next();
                                    m7232(c2621.f7509, arrayList, "", "", (((("" + str12) + C2604.m7263("Patch for") + str10 + next10.getName() + str11) + str13) + c2621.f7495) + next9.m7270(next10));
                                    str15 = str15;
                                    str13 = str13;
                                    next9 = next9;
                                }
                            }
                        }
                    }
                    str2 = str15;
                    if (c2621.f7492 == 24) {
                    }
                    if (c2621.f7492 == 25) {
                    }
                    if (c2621.f7492 == 26) {
                    }
                    if (c2621.f7492 == 28) {
                    }
                    if (c2621.f7492 == 19) {
                        m7232(c2621.f7509, arrayList, "", "", (("" + str2) + C2500.m7007(R.string.custom_patch_log_add_custom_patch_to_boot_list) + "\n") + "---------------------------\n\n");
                    }
                    if (c2621.f7492 != 20) {
                    }
                    i2 = i6;
                    str3 = "\n\n";
                    if (c2621.f7492 == 21) {
                    }
                    if (c2621.f7492 == 17) {
                    }
                    if (c2621.f7492 != 4) {
                    }
                    m7232(c2621.f7509, arrayList, "for_insert_result_end_" + c2621.f7509 + "\n", "", strArr2[c2621.f7509]);
                    if (!arrayList.get(c2621.f7509).contains(f7278)) {
                    }
                    m7232(c2621.f7509, arrayList, "", "", "\n");
                    i6 = i3 + 1;
                    z4 = z2;
                    z5 = z6;
                    strArr = strArr2;
                    i7 = i8;
                    i4 = 0;
                    i5 = 1;
                }
            }
            str = ":\n";
            String str62 = "---------------------------------\n\n";
            String str72 = "---------------------------------\n";
            String str82 = " ";
            if (c2621.f7492 == i5) {
            }
            String str102 = str82;
            String[] strArr22 = strArr;
            int i82 = i7;
            boolean z62 = z;
            String str112 = str;
            String str122 = str72;
            String str132 = str62;
            i = c2621.f7492;
            int i92 = 11;
            int i102 = 2;
            if (i != 2) {
            }
            it = c2621.f7497.iterator();
            while (it.hasNext()) {
            }
            String str152 = "---------------------------\n";
            if (c2621.f7492 == 10) {
            }
            str2 = str152;
            if (c2621.f7492 == 24) {
            }
            if (c2621.f7492 == 25) {
            }
            if (c2621.f7492 == 26) {
            }
            if (c2621.f7492 == 28) {
            }
            if (c2621.f7492 == 19) {
            }
            if (c2621.f7492 != 20) {
            }
            i2 = i6;
            str3 = "\n\n";
            if (c2621.f7492 == 21) {
            }
            if (c2621.f7492 == 17) {
            }
            if (c2621.f7492 != 4) {
            }
            m7232(c2621.f7509, arrayList, "for_insert_result_end_" + c2621.f7509 + "\n", "", strArr22[c2621.f7509]);
            if (!arrayList.get(c2621.f7509).contains(f7278)) {
            }
            m7232(c2621.f7509, arrayList, "", "", "\n");
            i6 = i3 + 1;
            z4 = z2;
            z5 = z62;
            strArr = strArr22;
            i7 = i82;
            i4 = 0;
            i5 = 1;
        }
        Iterator<String> it13 = arrayList.iterator();
        while (it13.hasNext()) {
            this.f7316 += it13.next();
        }
        this.f7316 = C2604.m7264(this.f7316);
    }

    public void m7242() {
        String str;
        String str2;
        this.f7316 = "SU Java-Code Running! javaroot.utils.custompatch\n";
        int i = 0;
        boolean z = false;
        boolean z2 = true;
        while (i < this.f7287.size()) {
            C2621 c2621 = this.f7287.get(i);
            if (c2621.f7511) {
                z = true;
            }
            if (!c2621.f7510) {
                z2 = false;
            }
            String str3 = "";
            if (c2621.f7492 == 12) {
                if (i + 1 != this.f7287.size()) {
                    this.f7316 += ("next_custom_patch_maker_for_split\n");
                }
                z = false;
                z2 = true;
            }
            int i2 = c2621.f7492;
            String str4 = "---------------------------------\n";
            if (i2 == 2 || i2 == 6 || i2 == 7 || i2 == 11 || i2 == 8 || i2 == 27 || i2 == 9) {
                Iterator<C2612> it = c2621.f7497.iterator();
                while (it.hasNext()) {
                    C2612 next = it.next();
                    Iterator<File> it2 = next.f7442.iterator();
                    while (true) {
                        Iterator<C2612> it3 = it;
                        int i3 = i;
                        boolean z3 = z2;
                        if (it2.hasNext()) {
                            Iterator<File> it4 = it2;
                            File next2 = it2.next();
                            boolean z4 = z;
                            String str5 = str3 + str4;
                            String str6 = str4;
                            int i4 = c2621.f7492;
                            String str7 = str3;
                            if (i4 != 2) {
                                if (i4 != 11) {
                                    if (i4 != 27) {
                                        switch (i4) {
                                            case 6:
                                                str5 = str5 + C2604.m7263("Patch for libraries") + " (armeabi)\n" + next2.getName() + ":\n";
                                                break;
                                            case 7:
                                                str5 = str5 + C2604.m7263("Patch for libraries") + " (armeabi-v7a)\n" + next2.getName() + ":\n";
                                                break;
                                            case 8:
                                                str5 = str5 + C2604.m7263("Patch for libraries") + " (MIPS)\n" + next2.getName() + ":\n";
                                                break;
                                            case 9:
                                                str5 = str5 + C2604.m7263("Patch for libraries") + " (x86)\n" + next2.getName() + ":\n";
                                                break;
                                        }
                                    } else {
                                        str5 = str5 + C2604.m7263("Patch for libraries") + " (x86_64)\n" + next2.getName() + ":\n";
                                    }
                                } else {
                                    str5 = str5 + C2604.m7263("Patch for libraries") + " (arm64-v8a)\n" + next2.getName() + ":\n";
                                }
                            } else {
                                str5 = str5 + C2604.m7263("Patch for libraries") + " " + next2.getName() + ":\n";
                            }
                            this.f7316 += (((str5 + "---------------------------------\n\n") + c2621.f7495) + next.m7270(next2));
                            z = z4;
                            it = it3;
                            i = i3;
                            z2 = z3;
                            it2 = it4;
                            str4 = str6;
                            str3 = str7;
                        } else {
                            boolean z5 = z;
                            String str8 = str3;
                            String str9 = str4;
                            if (next.f7442.size() == 0) {
                                StringBuilder sb = new StringBuilder();
                                str = str8;
                                sb.append(str);
                                sb.append(str9);
                                String sb2 = sb.toString();
                                int i5 = c2621.f7492;
                                if (i5 != 2) {
                                    if (i5 != 11) {
                                        if (i5 != 27) {
                                            switch (i5) {
                                                case 6:
                                                    sb2 = sb2 + C2604.m7263("Patch for libraries") + " (armeabi)\n" + next.f7438 + ":\n";
                                                    break;
                                                case 7:
                                                    sb2 = sb2 + C2604.m7263("Patch for libraries") + " (armeabi-v7a)\n" + next.f7438 + ":\n";
                                                    break;
                                                case 8:
                                                    sb2 = sb2 + C2604.m7263("Patch for libraries") + " (MIPS)\n" + next.f7438 + ":\n";
                                                    break;
                                                case 9:
                                                    sb2 = sb2 + C2604.m7263("Patch for libraries") + " (x86)\n" + next.f7438 + ":\n";
                                                    break;
                                            }
                                        } else {
                                            sb2 = sb2 + C2604.m7263("Patch for libraries") + " (x86_64)\n" + next.f7438 + ":\n";
                                        }
                                    } else {
                                        sb2 = sb2 + C2604.m7263("Patch for libraries") + " (arm64-v8a)\n" + next.f7438 + ":\n";
                                    }
                                } else {
                                    sb2 = sb2 + C2604.m7263("Patch for libraries") + " " + next.f7438 + ":\n";
                                }
                                this.f7316 += (((sb2 + "---------------------------------\n\n") + c2621.f7495) + next.f7452);
                            } else {
                                str = str8;
                            }
                            str3 = str;
                            z = z5;
                            it = it3;
                            i = i3;
                            z2 = z3;
                            str4 = str9;
                        }
                    }
                }
            }
            int i6 = i;
            boolean z6 = z;
            boolean z7 = z2;
            String str10 = str3;
            String str11 = str4;
            if (c2621.f7492 == 18) {
                Iterator<C2612> it5 = c2621.f7497.iterator();
                while (it5.hasNext()) {
                    C2612 next3 = it5.next();
                    Iterator<File> it6 = next3.f7442.iterator();
                    while (it6.hasNext()) {
                        File next4 = it6.next();
                        this.f7316 += (((((str10 + str11) + C2604.m7263("Patch for") + " " + next4.getName() + ":\n") + "---------------------------------\n\n") + c2621.f7495) + next3.m7270(next4));
                    }
                    String str12 = str11;
                    if (next3.f7442.size() == 0) {
                        this.f7316 += (((((str10 + str12) + C2604.m7263("Patch for") + " " + next3.f7438 + ":\n") + "---------------------------------\n\n") + c2621.f7495) + next3.f7452);
                    }
                    str11 = str12;
                }
            }
            String str13 = str11;
            if (c2621.f7492 == 22) {
                this.f7316 += ((((str10 + str13) + C2604.m7263("Patch for files from directory") + "\n") + "---------------------------------\n\n") + c2621.f7495);
                Iterator<C2612> it7 = c2621.f7497.iterator();
                while (it7.hasNext()) {
                    C2612 next5 = it7.next();
                    ArrayList<File> arrayList = next5.f7442;
                    if (arrayList == null || arrayList.size() == 0) {
                        this.f7316 += next5.f7452;
                    }
                    Iterator<File> it8 = next5.f7442.iterator();
                    while (it8.hasNext()) {
                        File next6 = it8.next();
                        this.f7316 += (((((str10 + str13) + C2604.m7263("Patch for") + " " + next6.getName() + ":\n") + "---------------------------------\n\n") + c2621.f7495) + next5.m7270(next6));
                    }
                }
            }
            if (c2621.f7492 == 23) {
                this.f7316 += ((((str10 + str13) + C2604.m7263("Blocking internet hosts") + ":\n") + "---------------------------------\n\n") + c2621.f7495);
            }
            if (c2621.f7492 == 14) {
                Iterator<C2612> it9 = c2621.f7497.iterator();
                while (it9.hasNext()) {
                    C2612 next7 = it9.next();
                    Iterator<File> it10 = next7.f7442.iterator();
                    while (it10.hasNext()) {
                        File next8 = it10.next();
                        this.f7316 += (((((str10 + str13) + C2604.m7263("Patch for") + " " + next8.getName() + ":\n") + "---------------------------------\n\n") + c2621.f7495) + next7.m7270(next8));
                    }
                }
            }
            if (c2621.f7492 == 16) {
                Iterator<C2617> it11 = c2621.f7498.iterator();
                while (it11.hasNext()) {
                    C2617 next9 = it11.next();
                    this.f7316 += ((((str10 + "---------------------------\n") + "Set permissions " + next9.f7474 + " for file:\n" + next9.f7473 + "\n") + "---------------------------\n\n") + c2621.f7495);
                }
            }
            if (c2621.f7492 == 17) {
                Iterator<C2611> it12 = c2621.f7499.iterator();
                while (it12.hasNext()) {
                    C2611 next10 = it12.next();
                    this.f7316 += (((((str10 + "---------------------------\n") + "Copy file " + next10.f7435 + " to:\n" + next10.f7436 + "\n") + "---------------------------\n\n") + c2621.f7495 + next10.f7437) + "\n");
                }
            }
            if (c2621.f7492 == 15) {
                Iterator<C2622> it13 = c2621.f7506.iterator();
                String str14 = str10;
                while (it13.hasNext()) {
                    C2622 next11 = it13.next();
                    if (!str14.equals(next11.f7512)) {
                        str14 = next11.f7512;
                        str2 = (((str10 + "---------------------------\n") + "Open SqLite database\n" + next11.f7512 + "\n") + "---------------------------\n\n") + c2621.f7495;
                    } else {
                        str2 = str10;
                    }
                    if (next11.f7514) {
                        str2 = str2 + "Execute:\n" + next11.f7513 + "\n";
                    }
                    this.f7316 += (str2 + "\n");
                }
            }
            if (c2621.f7492 == 21) {
                Iterator<C2615> it14 = c2621.f7507.iterator();
                String str15 = str10;
                while (it14.hasNext()) {
                    C2615 next12 = it14.next();
                    if (!str15.equals(next12.f7460)) {
                        String str16 = next12.f7460;
                        File file = next12.f7461;
                        if (file != null && file.exists()) {
                            this.f7316 += "\nfound_pref_file_for_edit_" + c2621.f7509 + "\n" + next12.f7461.getAbsolutePath() + "\n";
                        } else {
                            next12.f7468 = false;
                        }
                        str15 = str16;
                    }
                }
            }
            if (c2621.f7492 == 4) {
                if (z6 && !z7) {
                    this.f7316 += "for_insert_result_not_all_patch_" + c2621.f7509 + "\n";
                }
                if (!z7 && !z6) {
                    this.f7316 += "for_insert_result_all_not_patch_" + c2621.f7509 + "\n";
                }
            }
            i = i6 + 1;
            z = z6;
            z2 = z7;
        }
    }

    public C2633 m7243(C2621 c2621, String str, int i) {
        String str2;
        C2621 c26212;
        String str3;
        C2621 c26213 = c2621;
        int i2 = i;
        String str4 = "+";
        String trim = str.trim();
        String[] strArr = new String[trim.split("[ \t]+").length];
        String[] split = trim.split("[ \t]+");
        int[] iArr = new int[split.length];
        byte[] bArr = new byte[split.length];
        int[] iArr2 = new int[split.length];
        int i3 = 0;
        int i4 = 0;
        while (i4 < split.length) {
            iArr2[i4] = i3;
            if (split[i4].contains("*") && !split[i4].contains("**")) {
                ArrayList<C2612> arrayList = c26213.f7497;
                arrayList.get(arrayList.size() - 1).f7447 = true;
                split[i4] = "60";
            }
            byte[] bArr2 = bArr;
            if (i2 != 0) {
                str2 = str4;
                if (i2 != 1) {
                    if (i2 != 2) {
                        c26212 = c2621;
                    } else {
                        try {
                        } catch (Exception e) {
                            e = e;
                            str3 = str2;
                        }
                        try {
                            if (!split[i4].contains("**") && !split[i4].matches("\\?+")) {
                                iArr[i4] = 1;
                                if (split[i4].toLowerCase().contains("sq")) {
                                    split[i4] = "60";
                                    iArr[i4] = 253;
                                }
                                if (split[i4].toUpperCase().contains("S") && !split[i4].toUpperCase().contains("SQ")) {
                                    iArr[i4] = 255;
                                    iArr2[i4] = Integer.valueOf(split[i4].toUpperCase().replace("S", ""), 10).intValue();
                                    split[i4] = "60";
                                }
                                if (!split[i4].contains("W") || split[i4].contains("w") || split[i4].contains("R") || split[i4].contains("R")) {
                                    iArr[i4] = Integer.valueOf(split[i4].toLowerCase().replace("w", "").replace(InternalZipConstants.READ_MODE, "")).intValue() + 2;
                                    split[i4] = "60";
                                }
                                if (split[i4].contains("-")) {
                                    iArr[i4] = Integer.valueOf(split[i4].toLowerCase().replace("-", "")).intValue() + 2;
                                    split[i4] = "0";
                                }
                                str3 = str2;
                                if (split[i4].contains(str3)) {
                                    iArr[i4] = Integer.valueOf(split[i4].toLowerCase().replace(str3, "")).intValue() + 2;
                                    split[i4] = "1";
                                }
                                bArr2[i4] = Integer.valueOf(split[i4], 16).byteValue();
                                c26212 = c2621;
                            }
                            if (split[i4].contains(str3)) {
                            }
                            bArr2[i4] = Integer.valueOf(split[i4], 16).byteValue();
                            c26212 = c2621;
                        } catch (Exception e2) {
                            e = e2;
                            e.printStackTrace();
                            c26212 = c2621;
                            c26212.m7274("Exception " + e.toString());
                            str2 = str3;
                            i4++;
                            i2 = i;
                            c26213 = c26212;
                            bArr = bArr2;
                            str4 = str2;
                            i3 = 0;
                        }
                        split[i4] = "60";
                        iArr[i4] = 0;
                        if (split[i4].toLowerCase().contains("sq")) {
                        }
                        if (split[i4].toUpperCase().contains("S")) {
                            iArr[i4] = 255;
                            iArr2[i4] = Integer.valueOf(split[i4].toUpperCase().replace("S", ""), 10).intValue();
                            split[i4] = "60";
                        }
                        if (!split[i4].contains("W")) {
                        }
                        iArr[i4] = Integer.valueOf(split[i4].toLowerCase().replace("w", "").replace(InternalZipConstants.READ_MODE, "")).intValue() + 2;
                        split[i4] = "60";
                        if (split[i4].contains("-")) {
                        }
                        str3 = str2;
                    }
                } else {
                    c26212 = c2621;
                    str3 = str2;
                    try {
                        if (!split[i4].contains("**") && !split[i4].matches("\\?+")) {
                            iArr[i4] = 0;
                            if (split[i4].toUpperCase().contains("R")) {
                                iArr[i4] = Integer.valueOf(split[i4].replace("R", "")).intValue() + 2;
                                split[i4] = "60";
                            }
                            bArr2[i4] = Integer.valueOf(split[i4], 16).byteValue();
                        }
                        split[i4] = "60";
                        iArr[i4] = 1;
                        if (split[i4].toUpperCase().contains("R")) {
                        }
                        bArr2[i4] = Integer.valueOf(split[i4], 16).byteValue();
                    } catch (Exception e3) {
                        e3.printStackTrace();
                        c26212.m7274("search pattern read: " + e3);
                    }
                }
                str2 = str3;
            } else {
                str2 = str4;
                c26212 = c2621;
                try {
                    if (!split[i4].contains("**") && !split[i4].matches("\\?+")) {
                        try {
                            iArr[i4] = 0;
                        } catch (Exception e4) {
                            e = e4;
                            e.printStackTrace();
                            c26212.m7274(" " + e);
                            i4++;
                            i2 = i;
                            c26213 = c26212;
                            bArr = bArr2;
                            str4 = str2;
                            i3 = 0;
                        }
                    } else {
                        split[i4] = "60";
                        iArr[i4] = 1;
                    }
                    if (split[i4].contains("W") || split[i4].contains("w") || split[i4].contains("R") || split[i4].contains(InternalZipConstants.READ_MODE)) {
                        iArr[i4] = Integer.valueOf(split[i4].toLowerCase().replace("w", "").replace(InternalZipConstants.READ_MODE, "")).intValue() + 2;
                        split[i4] = "60";
                    }
                    bArr2[i4] = Integer.valueOf(split[i4], 16).byteValue();
                } catch (Exception e5) {
                    e = e5;
                }
            }
            i4++;
            i2 = i;
            c26213 = c26212;
            bArr = bArr2;
            str4 = str2;
            i3 = 0;
        }
        return new C2633(bArr, iArr, iArr2);
    }

    public ArrayList<File> m7244() {
        ArrayList<File> arrayList = new ArrayList<>();
        try {
            for (File file : new File(this.f7328).listFiles()) {
                if (file.getName().toLowerCase().startsWith("classes") && file.getName().endsWith(".dex")) {
                    arrayList.add(file);
                }
            }
        } catch (FileNotFoundException unused) {
            C2975.m7942(f7278 + " unzip classes.dex fault!\n\n");
        } catch (Exception e) {
            C2975.m7942("Extract classes.dex error: " + e.toString());
        }
        if (arrayList.size() != 0) {
            if (arrayList.size() > 0) {
                Iterator<File> it = arrayList.iterator();
                while (it.hasNext()) {
                    if (!it.next().exists()) {
                        throw new FileNotFoundException();
                    }
                }
            }
            C2975.m7942("get classes.dex " + arrayList.size());
            return arrayList;
        }
        throw new FileNotFoundException();
    }

    public String m7245(String str) {
        try {
            return new C2596(this.f7351, new File(this.f7328)).m7231(str);
        } catch (Exception e) {
            C2975.m7942("File select error: " + e.toString());
            return "";
        }
    }

    public boolean m7246() {
        Iterator<C2621> it = this.f7287.iterator();
        while (it.hasNext()) {
            int i = it.next().f7492;
            if (i == 2 || i == 6 || i == 7 || i == 9 || i == 27 || i == 8 || i == 11) {
                return true;
            }
        }
        return false;
    }

    public boolean m7247() {
        Iterator<C2621> it = this.f7287.iterator();
        while (it.hasNext()) {
            int i = it.next().f7492;
            if (i == 1 || i == 21 || i == 17 || this.f7292 || this.f7290) {
                return true;
            }
        }
        return false;
    }

    public boolean m7248(File file, C2621 c2621, C2612 c2612) {
        boolean z;
        String str;
        String str2;
        String str3;
        ArrayList arrayList;
        String str4;
        String str5;
        C2621 c26212;
        String str6;
        String str7;
        String str8;
        String str9;
        int i;
        MappedByteBuffer mappedByteBuffer;
        boolean z2;
        String str10;
        String str11;
        C2631[] c2631Arr;
        String str12;
        String str13;
        C2621 c26213;
        String str14;
        byte[] bArr;
        String str15;
        String str16;
        String str17;
        int i2;
        String str18;
        ArrayList arrayList2;
        String str19;
        String str20;
        C2631 c2631;
        String str21;
        String str22;
        byte b;
        C2621 c26214;
        int i3;
        String str23;
        String str24;
        int i4;
        String str25;
        String str26;
        String str27;
        C2621 c26215;
        boolean z3;
        int i5;
        int i6;
        int i7;
        C2631[] c2631Arr2;
        String str28;
        String str29;
        String str30;
        String str31;
        int i8;
        int i9;
        String str32;
        String str33;
        String str34;
        MappedByteBuffer mappedByteBuffer2;
        byte[] bArr2;
        String str35;
        int i10;
        int i11;
        int i12;
        C2621 c26216;
        int i13;
        byte[] bArr3;
        String str36;
        File file2 = file;
        C2621 c26217 = c2621;
        String str37 = "Pattern";
        C2975.m7942("patch file " + file.getName());
        String str38 = " ";
        if (C2975.f9323.booleanValue()) {
            C2500.m7104("Size file:" + file.length());
        } else {
            C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_step2) + " " + file.getName(), "%1d/%2d bytes", 0, (int) file.length(), false);
        }
        try {
            FileChannel channel = new RandomAccessFile(file2, InternalZipConstants.WRITE_MODE).getChannel();
            MappedByteBuffer map = channel.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel.size());
            Iterator<C2631> it = c2612.f7443.iterator();
            while (true) {
                str = "";
                if (!it.hasNext()) {
                    break;
                }
                try {
                    if (!it.next().f7565.equals("")) {
                        break;
                    }
                } catch (FileNotFoundException unused) {
                    z = true;
                    c2612.m7269(f7278 + " Program files are not found!\nMove Program to internal storage.", file2);
                    return z;
                } catch (BufferUnderflowException unused2) {
                    return true;
                } catch (Exception e) {
                    e = e;
                    z = true;
                    e.printStackTrace();
                    c2612.m7269("Exception e" + e.toString(), file2);
                    return z;
                }
            }
            map.position(0);
            byte[] m6945 = C2500.m6945(file);
            ArrayList arrayList3 = new ArrayList();
            ArrayList<C2631> arrayList4 = c2612.f7443;
            String str39 = ")\n";
            String str40 = " \n(";
            String str41 = ": ";
            String str42 = ":\n";
            String str43 = "\n";
            try {
                if (arrayList4 != null) {
                    try {
                        if (arrayList4.size() > 0) {
                            ArrayList<C2631> arrayList5 = c2612.f7443;
                            MappedByteBuffer mappedByteBuffer3 = map;
                            C2631[] c2631Arr3 = (C2631[]) arrayList5.toArray(new C2631[arrayList5.size()]);
                            byte[] bArr4 = m6945;
                            str2 = " N";
                            int i14 = 0;
                            int i15 = 0;
                            boolean z4 = false;
                            while (i15 < c2631Arr3.length) {
                                C2631 c26312 = c2631Arr3[i15];
                                String str44 = str42;
                                c26312.f7556 = false;
                                if (!c26312.f7558.equals(str)) {
                                    str10 = str40;
                                    if (c26312.f7558.toLowerCase().equals(file.getName().toLowerCase())) {
                                        arrayList3.add(c26312);
                                    }
                                } else {
                                    str10 = str40;
                                    arrayList3.add(c26312);
                                }
                                if (c26217.f7492 == 1 && c2612.f7449 && c26312.f7557.equals(str)) {
                                    C2631 c26313 = c2631Arr3[i15];
                                    StringBuilder sb = new StringBuilder();
                                    str11 = str39;
                                    sb.append("multi_");
                                    sb.append(i14);
                                    c26313.f7557 = sb.toString();
                                    i14++;
                                } else {
                                    str11 = str39;
                                }
                                int i16 = i14;
                                try {
                                    if (c26312.f7561 != -1) {
                                        try {
                                            C2631 c26314 = c2631Arr3[i15];
                                            byte[] bArr5 = c26312.f7552;
                                            int[] iArr = new int[bArr5.length];
                                            c26314.f7551 = iArr;
                                            c26314.f7550 = new byte[bArr5.length];
                                            try {
                                                Arrays.fill(iArr, 1);
                                                Arrays.fill(c2631Arr3[i15].f7550, (byte) -103);
                                                str14 = str37;
                                                byte[] bArr6 = bArr4;
                                                c2631 = c26312;
                                                c2631Arr = c2631Arr3;
                                                str21 = str10;
                                                str19 = str11;
                                                arrayList2 = arrayList3;
                                                str22 = str44;
                                                b = 0;
                                                str12 = str;
                                                str17 = str41;
                                                int i17 = i15;
                                                int i18 = i15;
                                                str20 = str38;
                                                try {
                                                    if (m7234(file, channel, mappedByteBuffer3, bArr6, c26312.f7561, c2631Arr, i17, c2612)) {
                                                        bArr = bArr6;
                                                        try {
                                                            if (bArr.length != channel.size()) {
                                                                mappedByteBuffer3 = channel.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel.size());
                                                                bArr = C2500.m6945(file);
                                                                C2975.m7942("re-read file to memory");
                                                            }
                                                            c2612.m7269(C2604.m7263("Offset") + str20 + Integer.toHexString(c2631.f7561) + str17 + C2604.m7263("Patch done!") + "\n", file2);
                                                            i3 = i18;
                                                            try {
                                                                c2612.f7443.get(i3).f7556 = true;
                                                                c26214 = c2621;
                                                            } catch (Throwable th) {
                                                                th = th;
                                                                c26213 = c2621;
                                                                i2 = i3;
                                                                str16 = str21;
                                                                str15 = str22;
                                                                z = true;
                                                                String str45 = str19;
                                                                str13 = str20;
                                                                str18 = str45;
                                                                try {
                                                                    th.printStackTrace();
                                                                    int i19 = i2 + 1;
                                                                    bArr4 = bArr;
                                                                    str40 = str16;
                                                                    str41 = str17;
                                                                    str39 = str18;
                                                                    str42 = str15;
                                                                    str37 = str14;
                                                                    c2631Arr3 = c2631Arr;
                                                                    arrayList3 = arrayList2;
                                                                    str38 = str13;
                                                                    i15 = i19;
                                                                    c26217 = c26213;
                                                                    i14 = i16;
                                                                    str = str12;
                                                                } catch (FileNotFoundException unused3) {
                                                                    c2612.m7269(f7278 + " Program files are not found!\nMove Program to internal storage.", file2);
                                                                    return z;
                                                                } catch (BufferUnderflowException unused4) {
                                                                    return z;
                                                                } catch (Exception e2) {
                                                                    e = e2;
                                                                    e.printStackTrace();
                                                                    c2612.m7269("Exception e" + e.toString(), file2);
                                                                    return z;
                                                                }
                                                            }
                                                        } catch (Throwable th2) {
                                                            th = th2;
                                                            c26213 = c2621;
                                                            i2 = i18;
                                                            str16 = str21;
                                                            str15 = str22;
                                                            z = true;
                                                            String str452 = str19;
                                                            str13 = str20;
                                                            str18 = str452;
                                                            th.printStackTrace();
                                                            int i192 = i2 + 1;
                                                            bArr4 = bArr;
                                                            str40 = str16;
                                                            str41 = str17;
                                                            str39 = str18;
                                                            str42 = str15;
                                                            str37 = str14;
                                                            c2631Arr3 = c2631Arr;
                                                            arrayList3 = arrayList2;
                                                            str38 = str13;
                                                            i15 = i192;
                                                            c26217 = c26213;
                                                            i14 = i16;
                                                            str = str12;
                                                        }
                                                        try {
                                                            c26214.f7511 = true;
                                                            z4 = true;
                                                        } catch (Throwable th3) {
                                                            th = th3;
                                                            c26213 = c26214;
                                                            i2 = i3;
                                                            str16 = str21;
                                                            str15 = str22;
                                                            z = true;
                                                            String str4522 = str19;
                                                            str13 = str20;
                                                            str18 = str4522;
                                                            th.printStackTrace();
                                                            int i1922 = i2 + 1;
                                                            bArr4 = bArr;
                                                            str40 = str16;
                                                            str41 = str17;
                                                            str39 = str18;
                                                            str42 = str15;
                                                            str37 = str14;
                                                            c2631Arr3 = c2631Arr;
                                                            arrayList3 = arrayList2;
                                                            str38 = str13;
                                                            i15 = i1922;
                                                            c26217 = c26213;
                                                            i14 = i16;
                                                            str = str12;
                                                        }
                                                    } else {
                                                        c26214 = c2621;
                                                        i3 = i18;
                                                        bArr = bArr6;
                                                    }
                                                } catch (Throwable th4) {
                                                    th = th4;
                                                    bArr = bArr6;
                                                }
                                            } catch (Throwable th5) {
                                                th = th5;
                                                c2631Arr = c2631Arr3;
                                                str12 = str;
                                                str14 = str37;
                                                bArr = bArr4;
                                                str19 = str11;
                                                arrayList2 = arrayList3;
                                                C2621 c26218 = c26217;
                                                str17 = str41;
                                                int i20 = i15;
                                                str20 = str38;
                                                c26213 = c26218;
                                                i2 = i20;
                                                str15 = str44;
                                                str16 = str10;
                                                z = true;
                                                String str45222 = str19;
                                                str13 = str20;
                                                str18 = str45222;
                                                th.printStackTrace();
                                                int i19222 = i2 + 1;
                                                bArr4 = bArr;
                                                str40 = str16;
                                                str41 = str17;
                                                str39 = str18;
                                                str42 = str15;
                                                str37 = str14;
                                                c2631Arr3 = c2631Arr;
                                                arrayList3 = arrayList2;
                                                str38 = str13;
                                                i15 = i19222;
                                                c26217 = c26213;
                                                i14 = i16;
                                                str = str12;
                                            }
                                        } catch (Throwable th6) {
                                            th = th6;
                                            c2631Arr = c2631Arr3;
                                            str12 = str;
                                            str14 = str37;
                                            bArr = bArr4;
                                            str19 = str11;
                                        }
                                    } else {
                                        c2631Arr = c2631Arr3;
                                        str12 = str;
                                        str14 = str37;
                                        str22 = str44;
                                        str19 = str11;
                                        str21 = str10;
                                        b = 0;
                                        c2631 = c26312;
                                        arrayList2 = arrayList3;
                                        bArr = bArr4;
                                        C2621 c26219 = c26217;
                                        str17 = str41;
                                        c26214 = c26219;
                                        int i21 = i15;
                                        str20 = str38;
                                        i3 = i21;
                                    }
                                } catch (Throwable th7) {
                                    th = th7;
                                    c2631Arr = c2631Arr3;
                                    str12 = str;
                                    str13 = str38;
                                    c26213 = c26217;
                                    str14 = str37;
                                    bArr = bArr4;
                                    str15 = str44;
                                    str16 = str10;
                                    str17 = str41;
                                    i2 = i15;
                                    str18 = str11;
                                    z = true;
                                    arrayList2 = arrayList3;
                                }
                                if (c2631.f7562 && file.getName().endsWith(".dex") && file.length() > 112) {
                                    C2975.m7942(c2631.f7565 + str20 + c2631.f7573);
                                    if (c2631Arr[i3].f7573) {
                                        MappedByteBuffer mappedByteBuffer4 = mappedByteBuffer3;
                                        int i22 = 0;
                                        while (i22 < c2631Arr[i3].f7568.size()) {
                                            try {
                                                C2631 c26315 = c2631Arr[i3];
                                                if (c26315.f7550 == null) {
                                                    try {
                                                        int intValue = c26315.f7569.get(i22).intValue();
                                                        byte[] bArr7 = new byte[intValue];
                                                        boolean z5 = false;
                                                        int i23 = 0;
                                                        while (i23 < intValue) {
                                                            int i24 = intValue - i23;
                                                            try {
                                                                byte[] bArr8 = c2631Arr[i3].f7552;
                                                                byte[] bArr9 = bArr;
                                                                try {
                                                                    if (i24 <= bArr8.length) {
                                                                        int length = bArr8.length;
                                                                        boolean z6 = z5;
                                                                        int i25 = i23;
                                                                        int i26 = 0;
                                                                        while (i26 < length) {
                                                                            bArr7[i25] = bArr8[i26];
                                                                            if (i25 < intValue) {
                                                                                i25++;
                                                                            }
                                                                            i26++;
                                                                            z6 = true;
                                                                        }
                                                                        i23 = i25;
                                                                        z5 = z6;
                                                                    } else {
                                                                        bArr7[i23] = b;
                                                                    }
                                                                    i23++;
                                                                    bArr = bArr9;
                                                                } catch (Throwable th8) {
                                                                    th = th8;
                                                                    c26213 = c26214;
                                                                    i2 = i3;
                                                                    bArr = bArr9;
                                                                    str16 = str21;
                                                                    str15 = str22;
                                                                    z = true;
                                                                    mappedByteBuffer3 = mappedByteBuffer4;
                                                                    String str452222 = str19;
                                                                    str13 = str20;
                                                                    str18 = str452222;
                                                                    th.printStackTrace();
                                                                    int i192222 = i2 + 1;
                                                                    bArr4 = bArr;
                                                                    str40 = str16;
                                                                    str41 = str17;
                                                                    str39 = str18;
                                                                    str42 = str15;
                                                                    str37 = str14;
                                                                    c2631Arr3 = c2631Arr;
                                                                    arrayList3 = arrayList2;
                                                                    str38 = str13;
                                                                    i15 = i192222;
                                                                    c26217 = c26213;
                                                                    i14 = i16;
                                                                    str = str12;
                                                                }
                                                            } catch (Throwable th9) {
                                                                th = th9;
                                                                c26213 = c26214;
                                                                i2 = i3;
                                                            }
                                                        }
                                                        byte[] bArr10 = bArr;
                                                        if (z5) {
                                                            try {
                                                                int intValue2 = c2631Arr[i3].f7570.get(i22).intValue();
                                                                if (intValue2 > 0) {
                                                                    C2975.m7942(5);
                                                                    mappedByteBuffer4.position(intValue2);
                                                                    byte[] bArr11 = new byte[2];
                                                                    bArr11[b] = b;
                                                                    bArr11[1] = b;
                                                                    mappedByteBuffer4.put(bArr11);
                                                                    mappedByteBuffer4.force();
                                                                    mappedByteBuffer4.position(c2631Arr[i3].f7571.get(i22).intValue());
                                                                    mappedByteBuffer4.put(C2500.m7187(c2631Arr[i3].f7569.get(i22).intValue() / 2));
                                                                    mappedByteBuffer4.force();
                                                                }
                                                                mappedByteBuffer4.position(c2631Arr[i3].f7568.get(i22).intValue());
                                                                mappedByteBuffer4.put(bArr7);
                                                                mappedByteBuffer4.force();
                                                                StringBuilder sb2 = new StringBuilder();
                                                                sb2.append(C2604.m7263("Method patch"));
                                                                str15 = str22;
                                                                try {
                                                                    sb2.append(str15);
                                                                    sb2.append(c2631Arr[i3].f7567);
                                                                    sb2.append("\n");
                                                                    sb2.append(C2604.m7263("Patch done!"));
                                                                    str23 = str21;
                                                                    try {
                                                                        sb2.append(str23);
                                                                        sb2.append(C2604.m7263("Offset"));
                                                                        sb2.append(str17);
                                                                        sb2.append(Integer.toHexString(c2631Arr[i3].f7568.get(i22).intValue()));
                                                                        str24 = str19;
                                                                        try {
                                                                            sb2.append(str24);
                                                                            c2612.m7269(sb2.toString(), file2);
                                                                            c2631Arr[i3].f7556 = true;
                                                                            c26214.f7511 = true;
                                                                            z4 = true;
                                                                        } catch (Throwable th10) {
                                                                            th = th10;
                                                                            i2 = i3;
                                                                            str13 = str20;
                                                                            bArr = bArr10;
                                                                            mappedByteBuffer3 = mappedByteBuffer4;
                                                                            str18 = str24;
                                                                            str16 = str23;
                                                                            c26213 = c26214;
                                                                            z = true;
                                                                            th.printStackTrace();
                                                                            int i1922222 = i2 + 1;
                                                                            bArr4 = bArr;
                                                                            str40 = str16;
                                                                            str41 = str17;
                                                                            str39 = str18;
                                                                            str42 = str15;
                                                                            str37 = str14;
                                                                            c2631Arr3 = c2631Arr;
                                                                            arrayList3 = arrayList2;
                                                                            str38 = str13;
                                                                            i15 = i1922222;
                                                                            c26217 = c26213;
                                                                            i14 = i16;
                                                                            str = str12;
                                                                        }
                                                                    } catch (Throwable th11) {
                                                                        th = th11;
                                                                        i2 = i3;
                                                                        bArr = bArr10;
                                                                        mappedByteBuffer3 = mappedByteBuffer4;
                                                                        str16 = str23;
                                                                        c26213 = c26214;
                                                                        z = true;
                                                                        String str4522222 = str19;
                                                                        str13 = str20;
                                                                        str18 = str4522222;
                                                                        th.printStackTrace();
                                                                        int i19222222 = i2 + 1;
                                                                        bArr4 = bArr;
                                                                        str40 = str16;
                                                                        str41 = str17;
                                                                        str39 = str18;
                                                                        str42 = str15;
                                                                        str37 = str14;
                                                                        c2631Arr3 = c2631Arr;
                                                                        arrayList3 = arrayList2;
                                                                        str38 = str13;
                                                                        i15 = i19222222;
                                                                        c26217 = c26213;
                                                                        i14 = i16;
                                                                        str = str12;
                                                                    }
                                                                } catch (Throwable th12) {
                                                                    th = th12;
                                                                    c26213 = c26214;
                                                                    i2 = i3;
                                                                    bArr = bArr10;
                                                                    str16 = str21;
                                                                    z = true;
                                                                    mappedByteBuffer3 = mappedByteBuffer4;
                                                                    String str45222222 = str19;
                                                                    str13 = str20;
                                                                    str18 = str45222222;
                                                                    th.printStackTrace();
                                                                    int i192222222 = i2 + 1;
                                                                    bArr4 = bArr;
                                                                    str40 = str16;
                                                                    str41 = str17;
                                                                    str39 = str18;
                                                                    str42 = str15;
                                                                    str37 = str14;
                                                                    c2631Arr3 = c2631Arr;
                                                                    arrayList3 = arrayList2;
                                                                    str38 = str13;
                                                                    i15 = i192222222;
                                                                    c26217 = c26213;
                                                                    i14 = i16;
                                                                    str = str12;
                                                                }
                                                            } catch (Throwable th13) {
                                                                th = th13;
                                                                str15 = str22;
                                                            }
                                                        } else {
                                                            str23 = str21;
                                                            str24 = str19;
                                                            str15 = str22;
                                                        }
                                                        i4 = i3;
                                                        str25 = str20;
                                                        bArr = bArr10;
                                                        str26 = str24;
                                                        str27 = str23;
                                                        c26215 = c26214;
                                                    } catch (Throwable th14) {
                                                        th = th14;
                                                        str15 = str22;
                                                        c26213 = c26214;
                                                        i2 = i3;
                                                    }
                                                } else {
                                                    byte[] bArr12 = bArr;
                                                    String str46 = str21;
                                                    String str47 = str19;
                                                    str15 = str22;
                                                    try {
                                                        int intValue3 = c26315.f7568.get(i22).intValue() - 1;
                                                        int intValue4 = (c2631Arr[i3].f7568.get(i22).intValue() + c2631Arr[i3].f7569.get(i22).intValue()) - c2631Arr[i3].f7552.length;
                                                        byte[] bArr13 = bArr12;
                                                        mappedByteBuffer3 = mappedByteBuffer4;
                                                        while (true) {
                                                            int i27 = intValue3 + 1;
                                                            if (i27 > intValue4) {
                                                                break;
                                                            }
                                                            byte[] bArr14 = bArr13;
                                                            int i28 = intValue4;
                                                            str13 = str20;
                                                            str18 = str47;
                                                            String str48 = str46;
                                                            i2 = i3;
                                                            try {
                                                                if (m7234(file, channel, mappedByteBuffer3, bArr14, i27, c2631Arr, i3, c2612)) {
                                                                    bArr = bArr14;
                                                                    try {
                                                                        if (bArr.length != channel.size()) {
                                                                            mappedByteBuffer3 = channel.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel.size());
                                                                            bArr = C2500.m6945(file);
                                                                            C2975.m7942("re-read file to memory");
                                                                        }
                                                                        bArr13 = bArr;
                                                                        try {
                                                                            str16 = str48;
                                                                            file2 = file;
                                                                            try {
                                                                                c2612.m7269(C2604.m7263("Method patch") + str15 + c2631Arr[i2].f7567 + "\n" + C2604.m7263("Patch done!") + str48 + C2604.m7263("Offset") + str17 + Integer.toHexString(i27) + str18, file2);
                                                                                z = true;
                                                                                try {
                                                                                    c2631Arr[i2].f7556 = true;
                                                                                    c26213 = c2621;
                                                                                    try {
                                                                                        c26213.f7511 = true;
                                                                                        c26214 = c26213;
                                                                                        str46 = str16;
                                                                                        str47 = str18;
                                                                                        i3 = i2;
                                                                                        intValue3 = i27;
                                                                                        intValue4 = i28;
                                                                                        str20 = str13;
                                                                                        z4 = true;
                                                                                    } catch (Throwable th15) {
                                                                                        th = th15;
                                                                                        bArr = bArr13;
                                                                                        th.printStackTrace();
                                                                                        int i1922222222 = i2 + 1;
                                                                                        bArr4 = bArr;
                                                                                        str40 = str16;
                                                                                        str41 = str17;
                                                                                        str39 = str18;
                                                                                        str42 = str15;
                                                                                        str37 = str14;
                                                                                        c2631Arr3 = c2631Arr;
                                                                                        arrayList3 = arrayList2;
                                                                                        str38 = str13;
                                                                                        i15 = i1922222222;
                                                                                        c26217 = c26213;
                                                                                        i14 = i16;
                                                                                        str = str12;
                                                                                    }
                                                                                } catch (Throwable th16) {
                                                                                    th = th16;
                                                                                    c26213 = c2621;
                                                                                }
                                                                            } catch (Throwable th17) {
                                                                                th = th17;
                                                                                c26213 = c2621;
                                                                                z = true;
                                                                            }
                                                                        } catch (Throwable th18) {
                                                                            th = th18;
                                                                            c26213 = c2621;
                                                                            str16 = str48;
                                                                            z = true;
                                                                            file2 = file;
                                                                        }
                                                                    } catch (Throwable th19) {
                                                                        th = th19;
                                                                        c26213 = c2621;
                                                                        str16 = str48;
                                                                        z = true;
                                                                        file2 = file;
                                                                        th.printStackTrace();
                                                                        int i19222222222 = i2 + 1;
                                                                        bArr4 = bArr;
                                                                        str40 = str16;
                                                                        str41 = str17;
                                                                        str39 = str18;
                                                                        str42 = str15;
                                                                        str37 = str14;
                                                                        c2631Arr3 = c2631Arr;
                                                                        arrayList3 = arrayList2;
                                                                        str38 = str13;
                                                                        i15 = i19222222222;
                                                                        c26217 = c26213;
                                                                        i14 = i16;
                                                                        str = str12;
                                                                    }
                                                                } else {
                                                                    c26214 = c2621;
                                                                    bArr13 = bArr14;
                                                                    str46 = str48;
                                                                    str47 = str18;
                                                                    i3 = i2;
                                                                    intValue3 = i27;
                                                                    intValue4 = i28;
                                                                    str20 = str13;
                                                                    file2 = file;
                                                                }
                                                            } catch (Throwable th20) {
                                                                th = th20;
                                                                c26213 = c2621;
                                                                str16 = str48;
                                                                bArr = bArr14;
                                                            }
                                                        }
                                                        bArr = bArr13;
                                                        i4 = i3;
                                                        str25 = str20;
                                                        str26 = str47;
                                                        str27 = str46;
                                                        c26215 = c26214;
                                                        mappedByteBuffer4 = mappedByteBuffer3;
                                                    } catch (Throwable th21) {
                                                        th = th21;
                                                        i2 = i3;
                                                        str13 = str20;
                                                        str18 = str47;
                                                        str16 = str46;
                                                        c26213 = c26214;
                                                        z = true;
                                                        bArr = bArr12;
                                                        mappedByteBuffer3 = mappedByteBuffer4;
                                                        th.printStackTrace();
                                                        int i192222222222 = i2 + 1;
                                                        bArr4 = bArr;
                                                        str40 = str16;
                                                        str41 = str17;
                                                        str39 = str18;
                                                        str42 = str15;
                                                        str37 = str14;
                                                        c2631Arr3 = c2631Arr;
                                                        arrayList3 = arrayList2;
                                                        str38 = str13;
                                                        i15 = i192222222222;
                                                        c26217 = c26213;
                                                        i14 = i16;
                                                        str = str12;
                                                    }
                                                }
                                                i22++;
                                                c26214 = c26215;
                                                str21 = str27;
                                                str22 = str15;
                                                i3 = i4;
                                                String str49 = str25;
                                                str19 = str26;
                                                str20 = str49;
                                            } catch (Throwable th22) {
                                                th = th22;
                                                c26213 = c26214;
                                                i2 = i3;
                                                str16 = str21;
                                                str15 = str22;
                                                z = true;
                                                String str50 = str19;
                                                str13 = str20;
                                                str18 = str50;
                                            }
                                        }
                                        c26213 = c26214;
                                        i2 = i3;
                                        str16 = str21;
                                        str15 = str22;
                                        String str51 = str19;
                                        str13 = str20;
                                        str18 = str51;
                                        mappedByteBuffer3 = mappedByteBuffer4;
                                        int i1922222222222 = i2 + 1;
                                        bArr4 = bArr;
                                        str40 = str16;
                                        str41 = str17;
                                        str39 = str18;
                                        str42 = str15;
                                        str37 = str14;
                                        c2631Arr3 = c2631Arr;
                                        arrayList3 = arrayList2;
                                        str38 = str13;
                                        i15 = i1922222222222;
                                        c26217 = c26213;
                                        i14 = i16;
                                        str = str12;
                                    }
                                }
                                c26213 = c26214;
                                i2 = i3;
                                str16 = str21;
                                str15 = str22;
                                String str52 = str19;
                                str13 = str20;
                                str18 = str52;
                                int i19222222222222 = i2 + 1;
                                bArr4 = bArr;
                                str40 = str16;
                                str41 = str17;
                                str39 = str18;
                                str42 = str15;
                                str37 = str14;
                                c2631Arr3 = c2631Arr;
                                arrayList3 = arrayList2;
                                str38 = str13;
                                i15 = i19222222222222;
                                c26217 = c26213;
                                i14 = i16;
                                str = str12;
                            }
                            str3 = str39;
                            arrayList = arrayList3;
                            str4 = str;
                            str5 = str38;
                            c26212 = c26217;
                            str6 = str37;
                            m6945 = bArr4;
                            str7 = str40;
                            str8 = str42;
                            str9 = str41;
                            i = 1;
                            mappedByteBuffer = mappedByteBuffer3;
                            z2 = z4;
                            C2631[] c2631Arr4 = new C2631[arrayList.toArray().length];
                            C2631[] c2631Arr5 = (C2631[]) arrayList.toArray(new C2631[arrayList.size()]);
                            z3 = z2;
                            i5 = -1;
                            i6 = 0;
                            while (true) {
                                i7 = i5 + 1;
                                try {
                                    if (i7 < m6945.length) {
                                        break;
                                    }
                                    int i29 = i6 + i;
                                    if (C2975.f9323.booleanValue()) {
                                        mappedByteBuffer2 = mappedByteBuffer;
                                        bArr2 = m6945;
                                        str35 = str5;
                                        if (i29 > 153600) {
                                            try {
                                                C2500.m7104("Progress size:" + i7);
                                                i10 = 0;
                                            } catch (IndexOutOfBoundsException unused5) {
                                                str5 = str35;
                                                c2631Arr2 = c2631Arr5;
                                                str28 = str43;
                                                str29 = str8;
                                                str30 = str2;
                                                c2612.m7269("Byte by search not found! Please edit pattern for search.\n", file2);
                                                channel.close();
                                                if (z3) {
                                                }
                                                i8 = 0;
                                                while (i8 < c2631Arr2.length) {
                                                }
                                                String str53 = str4;
                                                i9 = 0;
                                                z = true;
                                                while (i9 < c2631Arr2.length) {
                                                }
                                                return z;
                                            } catch (BufferUnderflowException | Exception unused6) {
                                                str5 = str35;
                                            }
                                        }
                                        i10 = i29;
                                    } else if (i29 > 153600) {
                                        String m7007 = C2500.m7007(R.string.wait);
                                        StringBuilder sb3 = new StringBuilder();
                                        sb3.append(C2500.m7007(R.string.patch_step2));
                                        String str54 = str5;
                                        try {
                                            sb3.append(str54);
                                            sb3.append(file.getName());
                                            String sb4 = sb3.toString();
                                            mappedByteBuffer2 = mappedByteBuffer;
                                            bArr2 = m6945;
                                            C3549.m8199(m7007, sb4, "%1d/%2d bytes", i7, (int) file.length(), false);
                                            str35 = str54;
                                            i10 = 0;
                                        } catch (IndexOutOfBoundsException unused7) {
                                            c2631Arr2 = c2631Arr5;
                                            str5 = str54;
                                            str28 = str43;
                                            str29 = str8;
                                            str30 = str2;
                                            c2612.m7269("Byte by search not found! Please edit pattern for search.\n", file2);
                                            channel.close();
                                            if (z3) {
                                            }
                                            i8 = 0;
                                            while (i8 < c2631Arr2.length) {
                                                try {
                                                } catch (FileNotFoundException unused8) {
                                                    z = true;
                                                    c2612.m7269(f7278 + " Program files are not found!\nMove Program to internal storage.", file2);
                                                    return z;
                                                } catch (BufferUnderflowException unused9) {
                                                    return true;
                                                } catch (Exception e3) {
                                                    e = e3;
                                                    z = true;
                                                    e.printStackTrace();
                                                    c2612.m7269("Exception e" + e.toString(), file2);
                                                    return z;
                                                }
                                            }
                                            String str532 = str4;
                                            i9 = 0;
                                            z = true;
                                            while (i9 < c2631Arr2.length) {
                                                try {
                                                } catch (FileNotFoundException unused10) {
                                                    c2612.m7269(f7278 + " Program files are not found!\nMove Program to internal storage.", file2);
                                                    return z;
                                                } catch (BufferUnderflowException unused11) {
                                                    return z;
                                                } catch (Exception e4) {
                                                    e = e4;
                                                    e.printStackTrace();
                                                    c2612.m7269("Exception e" + e.toString(), file2);
                                                    return z;
                                                }
                                            }
                                            return z;
                                        } catch (BufferUnderflowException | Exception unused12) {
                                            c2631Arr2 = c2631Arr5;
                                            str5 = str54;
                                        }
                                    } else {
                                        mappedByteBuffer2 = mappedByteBuffer;
                                        bArr2 = m6945;
                                        str35 = str5;
                                        i10 = i29;
                                    }
                                    boolean z7 = z3;
                                    byte[] bArr15 = bArr2;
                                    int i30 = 0;
                                    MappedByteBuffer mappedByteBuffer5 = mappedByteBuffer2;
                                    while (i30 < c2631Arr5.length) {
                                        try {
                                            C2631 c26316 = c2631Arr5[i30];
                                            str28 = str43;
                                            if (c26316.f7561 == -1) {
                                                try {
                                                    if (!c26316.f7562) {
                                                        i11 = i7;
                                                        C2631[] c2631Arr6 = c2631Arr5;
                                                        i12 = i30;
                                                        str5 = str35;
                                                        c26216 = c26212;
                                                        i13 = i10;
                                                        bArr3 = bArr15;
                                                        str29 = str8;
                                                        str36 = str7;
                                                        try {
                                                            try {
                                                                if (m7234(file, channel, mappedByteBuffer5, bArr15, i11, c2631Arr6, i12, c2612)) {
                                                                    if (bArr3.length != channel.size()) {
                                                                        try {
                                                                            mappedByteBuffer5 = channel.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel.size());
                                                                            bArr3 = C2500.m6945(file);
                                                                            C2975.m7942("re-read file to memory");
                                                                        } catch (IndexOutOfBoundsException unused13) {
                                                                            z3 = z7;
                                                                            str30 = str2;
                                                                            c2631Arr2 = c2631Arr6;
                                                                            c2612.m7269("Byte by search not found! Please edit pattern for search.\n", file2);
                                                                            channel.close();
                                                                            if (z3) {
                                                                            }
                                                                            i8 = 0;
                                                                            while (i8 < c2631Arr2.length) {
                                                                            }
                                                                            String str5322 = str4;
                                                                            i9 = 0;
                                                                            z = true;
                                                                            while (i9 < c2631Arr2.length) {
                                                                            }
                                                                            return z;
                                                                        } catch (BufferUnderflowException | Exception unused14) {
                                                                            z3 = z7;
                                                                            str30 = str2;
                                                                            c2631Arr2 = c2631Arr6;
                                                                        }
                                                                    }
                                                                    bArr15 = bArr3;
                                                                    StringBuilder sb5 = new StringBuilder();
                                                                    sb5.append(C2604.m7263(str6));
                                                                    str30 = str2;
                                                                    try {
                                                                        sb5.append(str30);
                                                                        sb5.append(i12 + 1);
                                                                        sb5.append(str9);
                                                                        sb5.append(C2604.m7263("Patch done!"));
                                                                        sb5.append(str36);
                                                                        sb5.append(C2604.m7263("Offset"));
                                                                        sb5.append(str9);
                                                                        sb5.append(Integer.toHexString(i11));
                                                                        sb5.append(str3);
                                                                        c2612.m7269(sb5.toString(), file2);
                                                                        c2631Arr2 = c2631Arr6;
                                                                        try {
                                                                            c2631Arr2[i12].f7556 = true;
                                                                            c26216.f7511 = true;
                                                                            z7 = true;
                                                                            i30 = i12 + 1;
                                                                            str2 = str30;
                                                                            c2631Arr5 = c2631Arr2;
                                                                            c26212 = c26216;
                                                                            str7 = str36;
                                                                            str43 = str28;
                                                                            i7 = i11;
                                                                            i10 = i13;
                                                                            str35 = str5;
                                                                            str8 = str29;
                                                                        } catch (IndexOutOfBoundsException unused15) {
                                                                            z3 = z7;
                                                                            c2612.m7269("Byte by search not found! Please edit pattern for search.\n", file2);
                                                                            channel.close();
                                                                            if (z3) {
                                                                            }
                                                                            i8 = 0;
                                                                            while (i8 < c2631Arr2.length) {
                                                                            }
                                                                            String str53222 = str4;
                                                                            i9 = 0;
                                                                            z = true;
                                                                            while (i9 < c2631Arr2.length) {
                                                                            }
                                                                            return z;
                                                                        } catch (BufferUnderflowException | Exception unused16) {
                                                                            z3 = z7;
                                                                            channel.close();
                                                                            if (z3) {
                                                                            }
                                                                            i8 = 0;
                                                                            while (i8 < c2631Arr2.length) {
                                                                            }
                                                                            String str532222 = str4;
                                                                            i9 = 0;
                                                                            z = true;
                                                                            while (i9 < c2631Arr2.length) {
                                                                            }
                                                                            return z;
                                                                        }
                                                                    } catch (IndexOutOfBoundsException unused17) {
                                                                        c2631Arr2 = c2631Arr6;
                                                                        z3 = z7;
                                                                        c2612.m7269("Byte by search not found! Please edit pattern for search.\n", file2);
                                                                        channel.close();
                                                                        if (z3) {
                                                                        }
                                                                        i8 = 0;
                                                                        while (i8 < c2631Arr2.length) {
                                                                        }
                                                                        String str5322222 = str4;
                                                                        i9 = 0;
                                                                        z = true;
                                                                        while (i9 < c2631Arr2.length) {
                                                                        }
                                                                        return z;
                                                                    } catch (BufferUnderflowException | Exception unused18) {
                                                                        c2631Arr2 = c2631Arr6;
                                                                        z3 = z7;
                                                                        channel.close();
                                                                        if (z3) {
                                                                        }
                                                                        i8 = 0;
                                                                        while (i8 < c2631Arr2.length) {
                                                                        }
                                                                        String str53222222 = str4;
                                                                        i9 = 0;
                                                                        z = true;
                                                                        while (i9 < c2631Arr2.length) {
                                                                        }
                                                                        return z;
                                                                    }
                                                                } else {
                                                                    str30 = str2;
                                                                    c2631Arr2 = c2631Arr6;
                                                                    bArr15 = bArr3;
                                                                    i30 = i12 + 1;
                                                                    str2 = str30;
                                                                    c2631Arr5 = c2631Arr2;
                                                                    c26212 = c26216;
                                                                    str7 = str36;
                                                                    str43 = str28;
                                                                    i7 = i11;
                                                                    i10 = i13;
                                                                    str35 = str5;
                                                                    str8 = str29;
                                                                }
                                                            } catch (BufferUnderflowException | Exception unused19) {
                                                                str30 = str2;
                                                            }
                                                        } catch (IndexOutOfBoundsException unused20) {
                                                            str30 = str2;
                                                        }
                                                    }
                                                } catch (IndexOutOfBoundsException unused21) {
                                                    str5 = str35;
                                                    c2631Arr2 = c2631Arr5;
                                                    str29 = str8;
                                                    str30 = str2;
                                                    z3 = z7;
                                                    c2612.m7269("Byte by search not found! Please edit pattern for search.\n", file2);
                                                    channel.close();
                                                    if (z3) {
                                                    }
                                                    i8 = 0;
                                                    while (i8 < c2631Arr2.length) {
                                                    }
                                                    String str532222222 = str4;
                                                    i9 = 0;
                                                    z = true;
                                                    while (i9 < c2631Arr2.length) {
                                                    }
                                                    return z;
                                                } catch (BufferUnderflowException | Exception unused22) {
                                                    str5 = str35;
                                                    c2631Arr2 = c2631Arr5;
                                                    str29 = str8;
                                                    str30 = str2;
                                                    z3 = z7;
                                                    channel.close();
                                                    if (z3) {
                                                    }
                                                    i8 = 0;
                                                    while (i8 < c2631Arr2.length) {
                                                    }
                                                    String str5322222222 = str4;
                                                    i9 = 0;
                                                    z = true;
                                                    while (i9 < c2631Arr2.length) {
                                                    }
                                                    return z;
                                                }
                                            }
                                            i13 = i10;
                                            str5 = str35;
                                            i11 = i7;
                                            c2631Arr2 = c2631Arr5;
                                            i12 = i30;
                                            c26216 = c26212;
                                            bArr3 = bArr15;
                                            str29 = str8;
                                            str30 = str2;
                                            str36 = str7;
                                            bArr15 = bArr3;
                                            i30 = i12 + 1;
                                            str2 = str30;
                                            c2631Arr5 = c2631Arr2;
                                            c26212 = c26216;
                                            str7 = str36;
                                            str43 = str28;
                                            i7 = i11;
                                            i10 = i13;
                                            str35 = str5;
                                            str8 = str29;
                                        } catch (IndexOutOfBoundsException unused23) {
                                            str5 = str35;
                                            c2631Arr2 = c2631Arr5;
                                            str28 = str43;
                                        } catch (BufferUnderflowException | Exception unused24) {
                                            str5 = str35;
                                            c2631Arr2 = c2631Arr5;
                                            str28 = str43;
                                        }
                                    }
                                    int i31 = i10;
                                    str5 = str35;
                                    m6945 = bArr15;
                                    mappedByteBuffer = mappedByteBuffer5;
                                    z3 = z7;
                                    i5 = i7;
                                    i6 = i31;
                                    i = 1;
                                } catch (IndexOutOfBoundsException unused25) {
                                } catch (BufferUnderflowException | Exception unused26) {
                                }
                            }
                            c2631Arr2 = c2631Arr5;
                            str28 = str43;
                            str29 = str8;
                            str30 = str2;
                            channel.close();
                            if (z3) {
                                str31 = str28;
                                try {
                                    if (!this.f7341.contains(file2)) {
                                        C2975.m7942("add patched file " + file.getName());
                                        this.f7341.add(file2);
                                    }
                                } catch (FileNotFoundException unused27) {
                                    z = true;
                                    c2612.m7269(f7278 + " Program files are not found!\nMove Program to internal storage.", file2);
                                    return z;
                                } catch (BufferUnderflowException unused28) {
                                    return true;
                                } catch (Exception e5) {
                                    e = e5;
                                    z = true;
                                    e.printStackTrace();
                                    c2612.m7269("Exception e" + e.toString(), file2);
                                    return z;
                                }
                            } else {
                                str31 = str28;
                            }
                            i8 = 0;
                            while (i8 < c2631Arr2.length) {
                                C2631 c26317 = c2631Arr2[i8];
                                if (c26317.f7556) {
                                    str34 = str4;
                                    if (!c26317.f7557.equals(str34)) {
                                        for (C2631 c26318 : c2631Arr2) {
                                            if (c26318.f7557.equals(c2631Arr2[i8].f7557)) {
                                                c26318.f7560 = true;
                                            }
                                        }
                                    }
                                } else {
                                    str34 = str4;
                                }
                                i8++;
                                str4 = str34;
                            }
                            String str53222222222 = str4;
                            i9 = 0;
                            z = true;
                            while (i9 < c2631Arr2.length) {
                                C2631 c26319 = c2631Arr2[i9];
                                if (!c26319.f7556) {
                                    if (!c26319.f7557.equals(str53222222222)) {
                                        if (!c2631Arr2[i9].f7560) {
                                            if (c2612.f7449) {
                                                ArrayList<File> arrayList6 = c2612.f7442;
                                                if (file2.equals(arrayList6.get(arrayList6.size() - 1))) {
                                                    if (c2631Arr2[i9].f7562) {
                                                        StringBuilder sb6 = new StringBuilder();
                                                        sb6.append(C2604.m7263("Method patch"));
                                                        str33 = str29;
                                                        sb6.append(str33);
                                                        sb6.append(c2631Arr2[i9].f7567);
                                                        sb6.append(str31);
                                                        sb6.append(f7278);
                                                        str32 = str5;
                                                        sb6.append(str32);
                                                        sb6.append(C2604.m7263("Pattern not found!"));
                                                        sb6.append(str31);
                                                        c2612.m7269(sb6.toString(), file2);
                                                    } else {
                                                        str32 = str5;
                                                        str33 = str29;
                                                        c2612.m7269(C2604.m7263(str6) + str30 + (i9 + 1) + str33 + f7278 + str32 + C2604.m7263("Pattern not found!") + str31 + C2604.m7263("or patch is already applied?!") + str31, file2);
                                                    }
                                                    z = false;
                                                    if (!c2612.f7448) {
                                                        ArrayList<File> arrayList7 = c2612.f7442;
                                                        if (file2.equals(arrayList7.get(arrayList7.size() - 1))) {
                                                            c2612.m7269(C2604.m7263(str6) + str30 + (i9 + 1) + str33 + f7278 + str32 + C2604.m7263("Pattern not found!") + str31 + C2604.m7263("or patch is already applied?!") + str31, file2);
                                                            z = false;
                                                        }
                                                    }
                                                    if (!c2612.f7449 && !c2612.f7448) {
                                                        if (c2631Arr2[i9].f7562) {
                                                            c2612.m7269(C2604.m7263(str6) + str30 + (i9 + 1) + str33 + f7278 + str32 + C2604.m7263("Pattern not found!") + str31 + C2604.m7263("or patch is already applied?!") + str31, file2);
                                                        } else {
                                                            c2612.m7269(C2604.m7263("Method patch") + str33 + c2631Arr2[i9].f7567 + str31 + f7278 + str32 + C2604.m7263("Pattern not found!") + str31, file2);
                                                        }
                                                    }
                                                    i9++;
                                                    str29 = str33;
                                                    str5 = str32;
                                                }
                                            }
                                            str32 = str5;
                                            str33 = str29;
                                            if (!c2612.f7448) {
                                            }
                                            if (!c2612.f7449) {
                                                if (c2631Arr2[i9].f7562) {
                                                }
                                            }
                                            i9++;
                                            str29 = str33;
                                            str5 = str32;
                                        }
                                    } else {
                                        str32 = str5;
                                        str33 = str29;
                                        if (c2631Arr2[i9].f7562) {
                                            c2612.m7269(C2604.m7263("Method patch") + str33 + c2631Arr2[i9].f7567 + str31 + f7278 + str32 + C2604.m7263("Pattern not found!") + str31, file2);
                                        } else {
                                            c2612.m7269(C2604.m7263(str6) + str30 + (i9 + 1) + str33 + f7278 + str32 + C2604.m7263("Pattern not found!") + str31 + C2604.m7263("or patch is already applied?!") + str31, file2);
                                        }
                                    }
                                    z = false;
                                    i9++;
                                    str29 = str33;
                                    str5 = str32;
                                }
                                str32 = str5;
                                str33 = str29;
                                i9++;
                                str29 = str33;
                                str5 = str32;
                            }
                            return z;
                        }
                    } catch (FileNotFoundException unused29) {
                        z = true;
                    } catch (BufferUnderflowException unused30) {
                        z = true;
                    } catch (Exception e6) {
                        e = e6;
                        z = true;
                    }
                }
                C2631[] c2631Arr42 = new C2631[arrayList.toArray().length];
                C2631[] c2631Arr52 = (C2631[]) arrayList.toArray(new C2631[arrayList.size()]);
                z3 = z2;
                i5 = -1;
                i6 = 0;
                while (true) {
                    i7 = i5 + 1;
                    if (i7 < m6945.length) {
                    }
                    int i312 = i10;
                    str5 = str35;
                    m6945 = bArr15;
                    mappedByteBuffer = mappedByteBuffer5;
                    z3 = z7;
                    i5 = i7;
                    i6 = i312;
                    i = 1;
                }
                c2631Arr2 = c2631Arr52;
                str28 = str43;
                str29 = str8;
                str30 = str2;
                channel.close();
                if (z3) {
                }
                i8 = 0;
                while (i8 < c2631Arr2.length) {
                }
                String str532222222222 = str4;
                i9 = 0;
                z = true;
                while (i9 < c2631Arr2.length) {
                }
                return z;
            } catch (FileNotFoundException unused31) {
            } catch (BufferUnderflowException unused32) {
            } catch (Exception e7) {
                e = e7;
            }
            arrayList = arrayList3;
            str4 = "";
            str5 = " ";
            c26212 = c26217;
            str2 = " N";
            str6 = "Pattern";
            str7 = " \n(";
            str3 = ")\n";
            str8 = ":\n";
            str9 = ": ";
            i = 1;
            mappedByteBuffer = map;
            z2 = false;
        } catch (FileNotFoundException unused33) {
        } catch (BufferUnderflowException unused34) {
        } catch (Exception e8) {
            e = e8;
        }
    }

    public void m7249(C2612 c2612) {
        File file;
        try {
            try {
                ArrayList arrayList = new ArrayList();
                arrayList.add("/data/data/");
                arrayList.add("/mnt/asec/");
                arrayList.add("/sd-ext/data/");
                arrayList.add("/data/sdext2/");
                arrayList.add("/data/sdext1/");
                arrayList.add("/data/sdext/");
                ArrayList arrayList2 = new ArrayList();
                arrayList2.add(this.f7345);
                arrayList2.add(this.f7345 + "-1");
                arrayList2.add(this.f7345 + "-2");
                if (c2612.f7438.trim().equals("*")) {
                    c2612.f7448 = true;
                    File[] listFiles = new File("/data/data/" + this.f7345 + "/lib/").listFiles();
                    long j = 0;
                    if (listFiles != null && listFiles.length > 0) {
                        int length = listFiles.length;
                        int i = 0;
                        while (i < length) {
                            File file2 = listFiles[i];
                            if (file2.length() > j && file2.getName().endsWith(".so")) {
                                C2500.m6961(file2, c2612.f7442);
                            }
                            i++;
                            j = 0;
                        }
                    }
                    String replace = this.f7351.getName().replace(this.f7345, "").replace(".apk", "");
                    if (new File("/data/app-lib").exists()) {
                        File[] listFiles2 = new File("/data/app-lib/" + this.f7345 + replace + InternalZipConstants.ZIP_FILE_SEPARATOR).listFiles();
                        if (listFiles2 != null && listFiles2.length > 0) {
                            for (File file3 : listFiles2) {
                                if (file3.length() > 0 && file3.getName().endsWith(".so")) {
                                    C2500.m6961(file3, c2612.f7442);
                                }
                            }
                        }
                    }
                    Iterator it = arrayList.iterator();
                    while (it.hasNext()) {
                        String str = (String) it.next();
                        File file4 = new File(str + this.f7345 + replace + InternalZipConstants.ZIP_FILE_SEPARATOR);
                        if (file4.exists()) {
                            C2500 c2500 = new C2500("sdf");
                            ArrayList<File> arrayList3 = new ArrayList<>();
                            String m7197 = c2500.m7197(file4, ".so", arrayList3);
                            if (!m7197.equals("") && arrayList3.size() > 0) {
                                Iterator<File> it2 = arrayList3.iterator();
                                while (it2.hasNext()) {
                                    C2500.m6961(it2.next(), c2612.f7442);
                                    c2612.m7268("Found lib:" + m7197);
                                }
                            }
                        }
                        File file5 = new File(str + this.f7345 + InternalZipConstants.ZIP_FILE_SEPARATOR);
                        if (file5.exists()) {
                            C2500 c25002 = new C2500("sdf");
                            ArrayList<File> arrayList4 = new ArrayList<>();
                            String m71972 = c25002.m7197(file5, ".so", arrayList4);
                            if (!m71972.equals("") && arrayList4.size() > 0) {
                                Iterator<File> it3 = arrayList4.iterator();
                                while (it3.hasNext()) {
                                    C2500.m6961(it3.next(), c2612.f7442);
                                    c2612.m7268("Found lib:" + m71972);
                                }
                            }
                        }
                    }
                    return;
                }
                file = new File("/data/data/" + this.f7345 + "/lib/" + c2612.f7438);
                try {
                    if (!file.exists()) {
                        Iterator it4 = arrayList.iterator();
                        while (it4.hasNext()) {
                            String str2 = (String) it4.next();
                            Iterator it5 = arrayList2.iterator();
                            while (it5.hasNext()) {
                                Iterator it6 = it4;
                                File file6 = new File(str2 + ((String) it5.next()));
                                if (file6.exists()) {
                                    String m7195 = new C2500("sdf").m7195(file6, c2612.f7438);
                                    if (m7195.equals("")) {
                                        continue;
                                    } else {
                                        File file7 = new File(m7195);
                                        try {
                                            C2500.m6961(file7, c2612.f7442);
                                            c2612.m7268("Found lib:" + m7195);
                                            file = file7;
                                        } catch (FileNotFoundException unused) {
                                            file = file7;
                                            c2612.m7268(f7278 + " " + file.getName() + " are not found!\n\nCheck the location libraries to solve problems!\n");
                                            return;
                                        }
                                    }
                                }
                                it4 = it6;
                            }
                        }
                    } else {
                        C2500.m6961(file, c2612.f7442);
                    }
                    File m6942 = C2500.m6942(this.f7351);
                    if (new File(m6942.getAbsoluteFile() + "/lib").exists()) {
                        File file8 = new File(m6942.getAbsoluteFile() + "/lib/" + c2612.f7438);
                        try {
                            if (file8.exists()) {
                                C2500.m6961(file8, c2612.f7442);
                            }
                            File file9 = new File(m6942.getAbsoluteFile() + "/lib/arm/" + c2612.f7438);
                            if (file9.exists()) {
                                C2500.m6961(file9, c2612.f7442);
                            }
                            File file10 = new File(m6942.getAbsoluteFile() + "/lib/arm64/" + c2612.f7438);
                            if (file10.exists()) {
                                C2500.m6961(file10, c2612.f7442);
                            }
                            File file11 = new File(m6942.getAbsoluteFile() + "/lib/x86/" + c2612.f7438);
                            if (file11.exists()) {
                                C2500.m6961(file11, c2612.f7442);
                            }
                            file8 = new File(m6942.getAbsoluteFile() + "/lib/x86_64/" + c2612.f7438);
                            if (file8.exists()) {
                                C2500.m6961(file8, c2612.f7442);
                            }
                            file = new File(m6942.getAbsoluteFile() + "/lib/mips/" + c2612.f7438);
                            if (file.exists()) {
                                C2500.m6961(file, c2612.f7442);
                            }
                        } catch (FileNotFoundException unused2) {
                            file = file8;
                            c2612.m7268(f7278 + " " + file.getName() + " are not found!\n\nCheck the location libraries to solve problems!\n");
                            return;
                        }
                    }
                    if (!file.exists()) {
                        new File("/system/lib/" + c2612.f7438);
                    }
                    if (c2612.f7442.size() != 0) {
                        String replace2 = this.f7351.getName().replace(this.f7345, "").replace(".apk", "");
                        if (new File("/data/app-lib/" + this.f7345 + replace2 + InternalZipConstants.ZIP_FILE_SEPARATOR + c2612.f7438).exists()) {
                            C2500.m6961(new File("/data/app-lib/" + this.f7345 + replace2 + InternalZipConstants.ZIP_FILE_SEPARATOR + c2612.f7438), c2612.f7442);
                            return;
                        }
                        return;
                    }
                    throw new FileNotFoundException();
                } catch (FileNotFoundException unused3) {
                }
            } catch (FileNotFoundException unused4) {
                file = null;
            }
        } catch (Exception e) {
            c2612.m7268("Exception e:" + e.toString());
        }
    }

    public C2632[] m7250(ArrayList<C2632> arrayList) {
        for (int size = arrayList.size() - 1; size >= 0; size--) {
            if (arrayList.get(size).f7604) {
                arrayList.remove(size);
            }
        }
        return (C2632[]) arrayList.toArray(new C2632[arrayList.size()]);
    }

    public void m7251() {
        Iterator<C2621> it;
        C2621 c2621;
        String str;
        String str2;
        String str3;
        String str4;
        String str5;
        String str6;
        String sb;
        String str7;
        String str8;
        String str9;
        String str10;
        C2621 c26212;
        ArrayList arrayList;
        ArrayList arrayList2;
        ArrayList arrayList3;
        String str11;
        String str12;
        int i;
        String str13;
        String str14;
        ArrayList arrayList4;
        Document parse;
        Iterator it2;
        C2621 c26213;
        String str15;
        Iterator<C2615> it3;
        Node node;
        NodeList nodeList;
        NodeList nodeList2;
        NodeList nodeList3;
        NodeList nodeList4;
        String str16;
        String[] strArr;
        File file;
        Iterator<C2621> it4;
        StringBuilder sb2;
        boolean z;
        boolean z2;
        boolean z3;
        C2597 c2597 = this;
        Iterator<C2621> it5 = c2597.f7287.iterator();
        while (it5.hasNext()) {
            C2621 next = it5.next();
            if (next.f7492 == 1) {
                ArrayList<C2612> arrayList5 = next.f7497;
                C2612 c2612 = arrayList5.get(arrayList5.size() - 1);
                ArrayList<File> arrayList6 = c2612.f7442;
                if (arrayList6 != null && arrayList6.size() == 0) {
                    ArrayList<File> m7244 = m7244();
                    c2612.f7442 = m7244;
                    if (m7244 != null && m7244.size() > 1) {
                        c2612.f7449 = true;
                    }
                }
                Iterator<File> it6 = c2612.f7442.iterator();
                while (it6.hasNext()) {
                    File next2 = it6.next();
                    ArrayList<C2625> arrayList7 = c2612.f7444;
                    if (arrayList7 != null && arrayList7.size() > 0 && !c2597.m7256(next2, next, c2612)) {
                        next.f7510 = false;
                    }
                    if (!(!c2612.f7450 ? c2597.m7248(next2, next, c2612) : false)) {
                        next.f7510 = false;
                    }
                }
            }
            int i2 = next.f7492;
            if ((i2 == 2 || i2 == 6 || i2 == 7 || i2 == 11 || i2 == 8 || i2 == 27 || i2 == 9) && c2597.f7342) {
                Iterator<C2612> it7 = next.f7497.iterator();
                while (it7.hasNext()) {
                    C2612 next3 = it7.next();
                    next.f7493 = next3.f7438;
                    c2597.m7258(next3, next);
                    ArrayList<File> arrayList8 = next3.f7442;
                    if (arrayList8 != null && arrayList8.size() > 0) {
                        Iterator<File> it8 = next3.f7442.iterator();
                        while (it8.hasNext()) {
                            File next4 = it8.next();
                            ArrayList<C2625> arrayList9 = next3.f7444;
                            if (arrayList9 != null && arrayList9.size() > 0 && !c2597.m7256(next4, next, next3)) {
                                next.f7510 = false;
                            }
                            if (!c2597.m7248(next4, next, next3)) {
                                next.f7510 = false;
                            }
                        }
                    }
                }
            }
            String str17 = "";
            if (next.f7492 == 10 && (z3 = c2597.f7342) && z3) {
                Iterator<C2612> it9 = next.f7497.iterator();
                while (it9.hasNext()) {
                    C2612 next5 = it9.next();
                    String m7245 = c2597.m7245(next5.f7438);
                    if (!m7245.equals("")) {
                        next5.f7442.add(new File(m7245));
                    }
                    ArrayList<C2625> arrayList10 = next5.f7444;
                    if (arrayList10 != null && arrayList10.size() > 0 && !c2597.m7256(new File(m7245), next, next5)) {
                        next.f7510 = false;
                    }
                    if (!c2597.m7248(new File(m7245), next, next5)) {
                        next.f7510 = false;
                    }
                }
            }
            int i3 = next.f7492;
            String str18 = " not found to dir\n";
            String str19 = " File ";
            String str20 = InternalZipConstants.ZIP_FILE_SEPARATOR;
            if (i3 == 24 && (z2 = c2597.f7342) && z2) {
                Iterator<C2610> it10 = next.f7502.iterator();
                while (it10.hasNext()) {
                    C2610 next6 = it10.next();
                    String str21 = next6.f7430;
                    next.f7493 = str21;
                    String str22 = (!str21.equals("") && new File(next.f7493).exists()) ? next.f7493 : c2597.f7326 + InternalZipConstants.ZIP_FILE_SEPARATOR + next.f7493;
                    if (!new File(str22).exists()) {
                        next6.f7433 = false;
                        next6.m7266(f7278 + " File " + next.f7493 + " not found to dir\n" + C2500.m6942(new File(str22)) + "\n\n");
                    } else {
                        next6.f7433 = true;
                        next6.f7430 = str22;
                        next6.m7266("The file was added to the apk file successfully.\n\n");
                    }
                }
            }
            if (next.f7492 == 25 && (z = c2597.f7342) && z) {
                Iterator<C2616> it11 = next.f7503.iterator();
                while (it11.hasNext()) {
                    it11.next().m7273("If the file was found, it is renamed.\n\n");
                }
            }
            if (next.f7492 != 15 || c2597.f7342 || next.f7506.size() <= 0) {
                it = it5;
            } else {
                Iterator<C2622> it12 = next.f7506.iterator();
                while (it12.hasNext()) {
                    C2622 next7 = it12.next();
                    File file2 = new File(next7.f7512);
                    String[] split = c2597.f7316.split("\n");
                    int i4 = 0;
                    while (i4 < split.length) {
                        if (split[i4].equals("Open SqLite database")) {
                            File file3 = new File(split[i4 + 1]);
                            if (file3.getName().equals(file2.getName())) {
                                try {
                                    C2500.m7105(c2597.f7328 + InternalZipConstants.ZIP_FILE_SEPARATOR + file3.getName());
                                    sb2 = new StringBuilder();
                                    it4 = it5;
                                } catch (Exception e) {
                                    e = e;
                                    it4 = it5;
                                }
                                try {
                                    sb2.append(c2597.f7328);
                                    sb2.append(InternalZipConstants.ZIP_FILE_SEPARATOR);
                                    sb2.append(file3.getName());
                                    if (new File(sb2.toString()).exists()) {
                                        next7.f7512 = file3.getAbsolutePath();
                                    }
                                    SQLiteDatabase openDatabase = SQLiteDatabase.openDatabase(c2597.f7328 + InternalZipConstants.ZIP_FILE_SEPARATOR + file3.getName(), null, 0);
                                    openDatabase.execSQL(next7.f7513);
                                    next7.f7514 = true;
                                    C2975.m7942(next7.f7513);
                                    openDatabase.close();
                                } catch (Exception e2) {
                                    e = e2;
                                    C2975.m7942("LuckyPatcher: SQL error - " + e);
                                    i4++;
                                    it5 = it4;
                                }
                                i4++;
                                it5 = it4;
                            }
                        }
                        it4 = it5;
                        i4++;
                        it5 = it4;
                    }
                }
                it = it5;
                Iterator<C2622> it13 = next.f7506.iterator();
                while (it13.hasNext()) {
                    C2622 next8 = it13.next();
                    if (next8.f7514) {
                        File file4 = new File(c2597.f7328 + InternalZipConstants.ZIP_FILE_SEPARATOR + new File(next8.f7512).getName());
                        if (file4.exists()) {
                            if (C2500.m6898(next8.f7512 + "-wal")) {
                                C2500.m7093("chmod 777 " + next8.f7512 + "-wal");
                                C2500.m7093("rm " + next8.f7512 + "-wal");
                            }
                            if (C2500.m6898(next8.f7512 + "-shm")) {
                                C2500.m7093("chmod 777 " + next8.f7512 + "-shm");
                                C2500.m7093("rm " + next8.f7512 + "-shm");
                            }
                            C2500.m6877(c2597.f7328 + InternalZipConstants.ZIP_FILE_SEPARATOR + new File(next8.f7512).getName(), next8.f7512, true, true);
                            file4.delete();
                        }
                    }
                }
            }
            String str23 = "%LP_Splitter%";
            String str24 = ":";
            if (next.f7492 != 21 || next.f7507.size() <= 0) {
                c2621 = next;
                str = "%LP_Splitter%";
                str2 = ":";
                str3 = " not found to dir\n";
                str4 = " File ";
                str5 = InternalZipConstants.ZIP_FILE_SEPARATOR;
            } else {
                ArrayList arrayList11 = new ArrayList();
                ArrayList arrayList12 = new ArrayList();
                String str25 = "string";
                String str26 = "=";
                String str27 = " ";
                if (!c2597.f7342) {
                    Iterator<C2615> it14 = next.f7507.iterator();
                    String str28 = "";
                    while (it14.hasNext()) {
                        String str29 = str23;
                        C2615 next9 = it14.next();
                        String str30 = str18;
                        String str31 = str19;
                        File file5 = new File(next9.f7460);
                        String str32 = str24;
                        if (new File(next9.f7460).getName().equals(new File(str28).getName())) {
                            File file6 = new File(str28);
                            StringBuilder sb3 = new StringBuilder();
                            str16 = str28;
                            sb3.append(c2597.f7328);
                            sb3.append(InternalZipConstants.ZIP_FILE_SEPARATOR);
                            sb3.append(file6.getName());
                            if (new File(sb3.toString()).exists()) {
                                next9.f7460 = c2597.f7328 + InternalZipConstants.ZIP_FILE_SEPARATOR + file6.getName();
                                next9.f7461 = file6;
                                next9.f7468 = true;
                            }
                        } else {
                            str16 = str28;
                            String[] split2 = c2597.f7316.split("\n");
                            int i5 = 0;
                            while (i5 < split2.length) {
                                String str33 = split2[i5];
                                String str34 = str26;
                                StringBuilder sb4 = new StringBuilder();
                                String str35 = str27;
                                sb4.append("found_pref_file_for_edit_");
                                sb4.append(next.f7509);
                                if (str33.equals(sb4.toString())) {
                                    File file7 = new File(split2[i5 + 1]);
                                    String absolutePath = file7.getAbsolutePath();
                                    strArr = split2;
                                    if (file7.getName().equals(file5.getName())) {
                                        try {
                                            String str36 = c2597.f7316;
                                            StringBuilder sb5 = new StringBuilder();
                                            file = file5;
                                            try {
                                                sb5.append("\nfound_pref_file_for_edit_");
                                                sb5.append(next.f7509);
                                                sb5.append("\n");
                                                sb5.append(file7);
                                                sb5.append("\n");
                                                c2597.f7316 = str36.replace(sb5.toString(), "");
                                                C2500.m7105(c2597.f7328 + InternalZipConstants.ZIP_FILE_SEPARATOR + file7.getName());
                                                if (new File(c2597.f7328 + InternalZipConstants.ZIP_FILE_SEPARATOR + file7.getName()).exists()) {
                                                    next9.f7460 = c2597.f7328 + InternalZipConstants.ZIP_FILE_SEPARATOR + file7.getName();
                                                }
                                                next9.f7461 = file7;
                                                next9.f7468 = true;
                                                C2500.m6961(new File(next9.f7460), arrayList11);
                                                C2500.m6961(next9.f7461, arrayList12);
                                            } catch (Exception e3) {
                                                e = e3;
                                                C2975.m7942("LuckyPatcher: SQL error - " + e);
                                                str16 = absolutePath;
                                                i5++;
                                                str26 = str34;
                                                str27 = str35;
                                                split2 = strArr;
                                                file5 = file;
                                            }
                                        } catch (Exception e4) {
                                            e = e4;
                                            file = file5;
                                        }
                                    } else {
                                        file = file5;
                                    }
                                    str16 = absolutePath;
                                } else {
                                    strArr = split2;
                                    file = file5;
                                }
                                i5++;
                                str26 = str34;
                                str27 = str35;
                                split2 = strArr;
                                file5 = file;
                            }
                        }
                        str28 = str16;
                        str18 = str30;
                        str23 = str29;
                        str19 = str31;
                        str24 = str32;
                        str26 = str26;
                        str27 = str27;
                    }
                    str = str23;
                    String str37 = str24;
                    str3 = str18;
                    str4 = str19;
                    String str38 = str27;
                    String str39 = str26;
                    ArrayList arrayList13 = new ArrayList();
                    ArrayList arrayList14 = new ArrayList();
                    ArrayList arrayList15 = new ArrayList();
                    ArrayList arrayList16 = new ArrayList();
                    ArrayList arrayList17 = new ArrayList();
                    Iterator<C2615> it15 = next.f7507.iterator();
                    while (true) {
                        str5 = str20;
                        str10 = "int";
                        if (!it15.hasNext()) {
                            break;
                        }
                        C2615 next10 = it15.next();
                        Iterator<C2615> it16 = it15;
                        if (next10.f7464.equals("string")) {
                            arrayList13.add(next10);
                        }
                        if (next10.f7464.equals("int")) {
                            arrayList14.add(next10);
                        }
                        if (next10.f7464.equals("long")) {
                            arrayList16.add(next10);
                        }
                        if (next10.f7464.equals("boolean")) {
                            arrayList15.add(next10);
                        }
                        if (next10.f7464.equals("float")) {
                            arrayList17.add(next10);
                        }
                        str20 = str5;
                        it15 = it16;
                    }
                    int i6 = 0;
                    while (i6 < arrayList11.size()) {
                        String str40 = str17;
                        File file8 = (File) arrayList11.get(i6);
                        StringBuilder sb6 = new StringBuilder();
                        ArrayList arrayList18 = arrayList11;
                        sb6.append(((File) arrayList11.get(i6)).getAbsolutePath());
                        sb6.append(".tmp");
                        File file9 = new File(sb6.toString());
                        C2500.m6875(file8, file9);
                        try {
                            parse = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new FileInputStream(file9));
                            it2 = arrayList13.iterator();
                        } catch (Throwable th) {
                            th = th;
                            c26212 = next;
                            arrayList = arrayList13;
                            arrayList2 = arrayList14;
                            arrayList3 = arrayList12;
                            str11 = str10;
                            str12 = str25;
                            i = i6;
                            str13 = str39;
                            str14 = str38;
                            arrayList4 = arrayList17;
                        }
                        while (true) {
                            arrayList = arrayList13;
                            if (!it2.hasNext()) {
                                break;
                            }
                            try {
                                C2615 c2615 = (C2615) it2.next();
                                Iterator it17 = it2;
                                NodeList elementsByTagName = parse.getElementsByTagName(str25);
                                arrayList3 = arrayList12;
                                i = i6;
                                int i7 = 0;
                                while (i7 < elementsByTagName.getLength()) {
                                    try {
                                        Node item = elementsByTagName.item(i7);
                                        NodeList nodeList5 = elementsByTagName;
                                        Element element = (Element) elementsByTagName.item(i7);
                                        str15 = str25;
                                        try {
                                            if (c2615.f7461 == null || element == null) {
                                                c26213 = next;
                                            } else {
                                                c26213 = next;
                                                try {
                                                    if (file8.getName().equals(c2615.f7461.getName()) && element.getAttribute(MediationMetaData.KEY_NAME).equals(c2615.f7465)) {
                                                        if (c2615.f7463) {
                                                            item.setTextContent(c2615.f7466);
                                                            item.normalize();
                                                            StringBuilder sb7 = new StringBuilder();
                                                            sb7.append(C2500.m7007(R.string.custom_patch_log_change_preference_insert));
                                                            sb7.append(":\n");
                                                            sb7.append(c2615.f7464);
                                                            str14 = str38;
                                                            try {
                                                                sb7.append(str14);
                                                                sb7.append(c2615.f7465);
                                                                str13 = str39;
                                                                try {
                                                                    sb7.append(str13);
                                                                    arrayList4 = arrayList17;
                                                                } catch (Throwable th2) {
                                                                    th = th2;
                                                                    arrayList4 = arrayList17;
                                                                    arrayList2 = arrayList14;
                                                                    str11 = str10;
                                                                    str12 = str15;
                                                                    c26212 = c26213;
                                                                    th.printStackTrace();
                                                                    ArrayList arrayList19 = arrayList3;
                                                                    int i8 = i;
                                                                    C2500.m6877(file8.getAbsolutePath(), ((File) arrayList19.get(i8)).getAbsolutePath(), true, true);
                                                                    i6 = i8 + 1;
                                                                    arrayList12 = arrayList19;
                                                                    str38 = str14;
                                                                    str17 = str40;
                                                                    arrayList17 = arrayList4;
                                                                    arrayList13 = arrayList;
                                                                    str10 = str11;
                                                                    next = c26212;
                                                                    str39 = str13;
                                                                    arrayList11 = arrayList18;
                                                                    str25 = str12;
                                                                    arrayList14 = arrayList2;
                                                                }
                                                            } catch (Throwable th3) {
                                                                th = th3;
                                                                str13 = str39;
                                                            }
                                                            try {
                                                                sb7.append(c2615.f7466);
                                                                c2615.m7272(sb7.toString());
                                                            } catch (Throwable th4) {
                                                                th = th4;
                                                                arrayList2 = arrayList14;
                                                                str11 = str10;
                                                                str12 = str15;
                                                                c26212 = c26213;
                                                                th.printStackTrace();
                                                                ArrayList arrayList192 = arrayList3;
                                                                int i82 = i;
                                                                C2500.m6877(file8.getAbsolutePath(), ((File) arrayList192.get(i82)).getAbsolutePath(), true, true);
                                                                i6 = i82 + 1;
                                                                arrayList12 = arrayList192;
                                                                str38 = str14;
                                                                str17 = str40;
                                                                arrayList17 = arrayList4;
                                                                arrayList13 = arrayList;
                                                                str10 = str11;
                                                                next = c26212;
                                                                str39 = str13;
                                                                arrayList11 = arrayList18;
                                                                str25 = str12;
                                                                arrayList14 = arrayList2;
                                                            }
                                                        } else {
                                                            str13 = str39;
                                                            str14 = str38;
                                                            arrayList4 = arrayList17;
                                                        }
                                                        if (c2615.f7462) {
                                                            item.getParentNode().removeChild(item);
                                                            c2615.m7272(C2500.m7007(R.string.custom_patch_log_change_preference_delete) + ":\n" + c2615.f7464 + str14 + c2615.f7465);
                                                        }
                                                        c2615.f7469 = true;
                                                        i7++;
                                                        str38 = str14;
                                                        arrayList17 = arrayList4;
                                                        elementsByTagName = nodeList5;
                                                        next = c26213;
                                                        str39 = str13;
                                                        str25 = str15;
                                                    }
                                                } catch (Throwable th5) {
                                                    th = th5;
                                                    str13 = str39;
                                                    str14 = str38;
                                                    arrayList4 = arrayList17;
                                                    arrayList2 = arrayList14;
                                                    str11 = str10;
                                                    str12 = str15;
                                                    c26212 = c26213;
                                                    th.printStackTrace();
                                                    ArrayList arrayList1922 = arrayList3;
                                                    int i822 = i;
                                                    C2500.m6877(file8.getAbsolutePath(), ((File) arrayList1922.get(i822)).getAbsolutePath(), true, true);
                                                    i6 = i822 + 1;
                                                    arrayList12 = arrayList1922;
                                                    str38 = str14;
                                                    str17 = str40;
                                                    arrayList17 = arrayList4;
                                                    arrayList13 = arrayList;
                                                    str10 = str11;
                                                    next = c26212;
                                                    str39 = str13;
                                                    arrayList11 = arrayList18;
                                                    str25 = str12;
                                                    arrayList14 = arrayList2;
                                                }
                                            }
                                            str13 = str39;
                                            str14 = str38;
                                            arrayList4 = arrayList17;
                                            i7++;
                                            str38 = str14;
                                            arrayList17 = arrayList4;
                                            elementsByTagName = nodeList5;
                                            next = c26213;
                                            str39 = str13;
                                            str25 = str15;
                                        } catch (Throwable th6) {
                                            th = th6;
                                            c26213 = next;
                                        }
                                    } catch (Throwable th7) {
                                        th = th7;
                                        c26213 = next;
                                        str15 = str25;
                                    }
                                }
                                arrayList13 = arrayList;
                                it2 = it17;
                                arrayList12 = arrayList3;
                                i6 = i;
                                str25 = str25;
                            } catch (Throwable th8) {
                                th = th8;
                                c26213 = next;
                                arrayList3 = arrayList12;
                                str15 = str25;
                                i = i6;
                            }
                            str11 = str10;
                            str12 = str15;
                            c26212 = c26213;
                            th.printStackTrace();
                            ArrayList arrayList19222 = arrayList3;
                            int i8222 = i;
                            C2500.m6877(file8.getAbsolutePath(), ((File) arrayList19222.get(i8222)).getAbsolutePath(), true, true);
                            i6 = i8222 + 1;
                            arrayList12 = arrayList19222;
                            str38 = str14;
                            str17 = str40;
                            arrayList17 = arrayList4;
                            arrayList13 = arrayList;
                            str10 = str11;
                            next = c26212;
                            str39 = str13;
                            arrayList11 = arrayList18;
                            str25 = str12;
                            arrayList14 = arrayList2;
                        }
                        c26213 = next;
                        arrayList3 = arrayList12;
                        str15 = str25;
                        i = i6;
                        str13 = str39;
                        str14 = str38;
                        arrayList4 = arrayList17;
                        Iterator it18 = arrayList14.iterator();
                        while (it18.hasNext()) {
                            C2615 c26152 = (C2615) it18.next();
                            NodeList elementsByTagName2 = parse.getElementsByTagName(str10);
                            Iterator it19 = it18;
                            int i9 = 0;
                            while (i9 < elementsByTagName2.getLength()) {
                                Node item2 = elementsByTagName2.item(i9);
                                arrayList2 = arrayList14;
                                try {
                                    Element element2 = (Element) elementsByTagName2.item(i9);
                                    str11 = str10;
                                    try {
                                        if (c26152.f7461 == null || element2 == null) {
                                            nodeList4 = elementsByTagName2;
                                        } else {
                                            nodeList4 = elementsByTagName2;
                                            if (file8.getName().equals(c26152.f7461.getName()) && element2.getAttribute(MediationMetaData.KEY_NAME).equals(c26152.f7465)) {
                                                if (c26152.f7463) {
                                                    item2.getAttributes().getNamedItem("value").setTextContent(c26152.f7466);
                                                    c26152.m7272(C2500.m7007(R.string.custom_patch_log_change_preference_insert) + ":\n" + c26152.f7464 + str14 + c26152.f7465 + str13 + c26152.f7466);
                                                }
                                                if (c26152.f7462) {
                                                    item2.getParentNode().removeChild(item2);
                                                    c26152.m7272(C2500.m7007(R.string.custom_patch_log_change_preference_delete) + ":\n" + c26152.f7464 + str14 + c26152.f7465);
                                                }
                                                c26152.f7469 = true;
                                            }
                                        }
                                        i9++;
                                        str10 = str11;
                                        arrayList14 = arrayList2;
                                        elementsByTagName2 = nodeList4;
                                    } catch (Throwable th9) {
                                        th = th9;
                                    }
                                } catch (Throwable th10) {
                                    th = th10;
                                }
                            }
                            it18 = it19;
                        }
                        arrayList2 = arrayList14;
                        str11 = str10;
                        Iterator it20 = arrayList16.iterator();
                        while (it20.hasNext()) {
                            C2615 c26153 = (C2615) it20.next();
                            NodeList elementsByTagName3 = parse.getElementsByTagName("long");
                            int i10 = 0;
                            while (i10 < elementsByTagName3.getLength()) {
                                Node item3 = elementsByTagName3.item(i10);
                                Element element3 = (Element) elementsByTagName3.item(i10);
                                Iterator it21 = it20;
                                if (c26153.f7461 == null || element3 == null) {
                                    nodeList3 = elementsByTagName3;
                                } else {
                                    nodeList3 = elementsByTagName3;
                                    if (file8.getName().equals(c26153.f7461.getName()) && element3.getAttribute(MediationMetaData.KEY_NAME).equals(c26153.f7465)) {
                                        if (c26153.f7463) {
                                            element3.getAttributeNode("value").setTextContent(c26153.f7466);
                                            c26153.m7272(C2500.m7007(R.string.custom_patch_log_change_preference_insert) + ":\n" + c26153.f7464 + str14 + c26153.f7465 + str13 + c26153.f7466);
                                        }
                                        if (c26153.f7462) {
                                            item3.getParentNode().removeChild(item3);
                                            c26153.m7272(C2500.m7007(R.string.custom_patch_log_change_preference_delete) + ":\n" + c26153.f7464 + str14 + c26153.f7465);
                                        }
                                        c26153.f7469 = true;
                                    }
                                }
                                i10++;
                                it20 = it21;
                                elementsByTagName3 = nodeList3;
                            }
                        }
                        Iterator it22 = arrayList15.iterator();
                        while (it22.hasNext()) {
                            C2615 c26154 = (C2615) it22.next();
                            NodeList elementsByTagName4 = parse.getElementsByTagName("boolean");
                            int i11 = 0;
                            while (i11 < elementsByTagName4.getLength()) {
                                Node item4 = elementsByTagName4.item(i11);
                                Element element4 = (Element) elementsByTagName4.item(i11);
                                Iterator it23 = it22;
                                if (c26154.f7461 == null || element4 == null) {
                                    nodeList2 = elementsByTagName4;
                                } else {
                                    nodeList2 = elementsByTagName4;
                                    if (file8.getName().equals(c26154.f7461.getName()) && element4.getAttribute(MediationMetaData.KEY_NAME).equals(c26154.f7465)) {
                                        if (c26154.f7463) {
                                            element4.getAttributeNode("value").setTextContent(c26154.f7466);
                                            c26154.m7272(C2500.m7007(R.string.custom_patch_log_change_preference_insert) + ":\n" + c26154.f7464 + str14 + c26154.f7465 + str13 + c26154.f7466);
                                        }
                                        if (c26154.f7462) {
                                            item4.getParentNode().removeChild(item4);
                                            c26154.m7272(C2500.m7007(R.string.custom_patch_log_change_preference_delete) + ":\n" + c26154.f7464 + str14 + c26154.f7465);
                                        }
                                        c26154.f7469 = true;
                                    }
                                }
                                i11++;
                                it22 = it23;
                                elementsByTagName4 = nodeList2;
                            }
                        }
                        Iterator it24 = arrayList4.iterator();
                        while (it24.hasNext()) {
                            C2615 c26155 = (C2615) it24.next();
                            NodeList elementsByTagName5 = parse.getElementsByTagName("float");
                            int i12 = 0;
                            while (i12 < elementsByTagName5.getLength()) {
                                Node item5 = elementsByTagName5.item(i12);
                                Element element5 = (Element) elementsByTagName5.item(i12);
                                Iterator it25 = it24;
                                if (c26155.f7461 == null || element5 == null) {
                                    nodeList = elementsByTagName5;
                                } else {
                                    nodeList = elementsByTagName5;
                                    if (file8.getName().equals(c26155.f7461.getName()) && element5.getAttribute(MediationMetaData.KEY_NAME).equals(c26155.f7465)) {
                                        if (c26155.f7463) {
                                            element5.getAttributeNode("value").setTextContent(c26155.f7466);
                                            c26155.m7272(C2500.m7007(R.string.custom_patch_log_change_preference_insert) + ":\n" + c26155.f7464 + str14 + c26155.f7465 + str13 + c26155.f7466);
                                        }
                                        if (c26155.f7462) {
                                            item5.getParentNode().removeChild(item5);
                                            c26155.m7272(C2500.m7007(R.string.custom_patch_log_change_preference_delete) + ":\n" + c26155.f7464 + str14 + c26155.f7465);
                                        }
                                        c26155.f7469 = true;
                                    }
                                }
                                i12++;
                                it24 = it25;
                                elementsByTagName5 = nodeList;
                            }
                        }
                        Node item6 = parse.getElementsByTagName(PolicyMappingsExtension.MAP).item(0);
                        c26212 = c26213;
                        for (Iterator<C2615> it26 = c26212.f7507.iterator(); it26.hasNext(); it26 = it3) {
                            C2615 next11 = it26.next();
                            if (!next11.f7463 || next11.f7469 || next11.f7461 == null || !file8.getName().equals(next11.f7461.getName())) {
                                it3 = it26;
                                str12 = str15;
                                node = item6;
                            } else {
                                Element createElement = parse.createElement(next11.f7464);
                                it3 = it26;
                                str12 = str15;
                                try {
                                    if (next11.f7464.equals(str12)) {
                                        createElement.setAttribute(MediationMetaData.KEY_NAME, next11.f7465);
                                        createElement.appendChild(parse.createTextNode(next11.f7466));
                                        createElement.normalize();
                                    } else {
                                        createElement.setAttribute(MediationMetaData.KEY_NAME, next11.f7465);
                                        createElement.setAttribute("value", next11.f7466);
                                    }
                                    item6.appendChild(createElement);
                                    item6.insertBefore(parse.createTextNode("\n    "), createElement);
                                    StringBuilder sb8 = new StringBuilder();
                                    node = item6;
                                    sb8.append(C2500.m7007(R.string.custom_patch_log_change_preference_insert));
                                    sb8.append(":\n");
                                    sb8.append(next11.f7464);
                                    sb8.append(str14);
                                    sb8.append(next11.f7465);
                                    sb8.append(str13);
                                    sb8.append(next11.f7466);
                                    next11.m7272(sb8.toString());
                                    next11.f7469 = true;
                                } catch (Throwable th11) {
                                    th = th11;
                                }
                            }
                            if (next11.f7469) {
                                c26212.f7511 = true;
                            }
                            item6 = node;
                            str15 = str12;
                        }
                        str12 = str15;
                        TransformerFactory.newInstance().newTransformer().transform(new DOMSource(parse), new StreamResult(file8));
                        ArrayList arrayList192222 = arrayList3;
                        int i82222 = i;
                        C2500.m6877(file8.getAbsolutePath(), ((File) arrayList192222.get(i82222)).getAbsolutePath(), true, true);
                        i6 = i82222 + 1;
                        arrayList12 = arrayList192222;
                        str38 = str14;
                        str17 = str40;
                        arrayList17 = arrayList4;
                        arrayList13 = arrayList;
                        str10 = str11;
                        next = c26212;
                        str39 = str13;
                        arrayList11 = arrayList18;
                        str25 = str12;
                        arrayList14 = arrayList2;
                    }
                    c2621 = next;
                    c2597 = this;
                    str2 = str37;
                } else {
                    c2621 = next;
                    str = "%LP_Splitter%";
                    String str41 = ":";
                    String str42 = "";
                    str3 = " not found to dir\n";
                    str4 = " File ";
                    str5 = InternalZipConstants.ZIP_FILE_SEPARATOR;
                    c2597.f7298 = true;
                    Iterator<C2615> it27 = c2621.f7507.iterator();
                    while (it27.hasNext()) {
                        C2615 next12 = it27.next();
                        next12.f7461 = new File(next12.f7460);
                        next12.f7468 = true;
                        String str43 = str42;
                        String str44 = !c2597.f7301.equals(str43) ? str : str43;
                        StringBuilder sb9 = new StringBuilder();
                        sb9.append(str44);
                        sb9.append(C2500.m7082(next12.f7460, ".xml", str43));
                        String str45 = str41;
                        sb9.append(str45);
                        String sb10 = sb9.toString();
                        if (next12.f7463) {
                            String str46 = ((sb10 + "+:") + next12.f7464 + str45) + next12.f7465 + str45;
                            String str47 = next12.f7466;
                            if (next12.f7464.equals("string")) {
                                try {
                                    str47 = Base64.encodeToString(next12.f7466.getBytes("UTF-8"), 0).replace("\n", str43);
                                } catch (UnsupportedEncodingException e5) {
                                    throw new RuntimeException(e5);
                                }
                            }
                            sb10 = str46 + str47;
                            next12.m7272(C2500.m7007(R.string.custom_patch_log_change_preference_insert) + ":\n" + next12.f7464 + " " + next12.f7465 + "=" + next12.f7466);
                        }
                        if (next12.f7462) {
                            sb10 = (sb10 + "-:") + next12.f7465;
                            next12.m7272(C2500.m7007(R.string.custom_patch_log_change_preference_delete) + ":\n" + next12.f7464 + " " + next12.f7465);
                        }
                        next12.f7469 = true;
                        c2597.f7301 += sb10;
                        str41 = str45;
                        str42 = str43;
                    }
                    str2 = str41;
                    str17 = str42;
                }
            }
            if (c2621.f7492 == 17 && c2597.f7342) {
                Iterator<C2611> it28 = c2621.f7499.iterator();
                while (it28.hasNext()) {
                    C2611 next13 = it28.next();
                    c2597.f7300 = true;
                    String str48 = next13.f7435;
                    c2621.f7493 = str48;
                    if (!str48.equals(str17) && new File(c2621.f7493).exists()) {
                        sb = c2621.f7493;
                        str6 = str5;
                    } else {
                        StringBuilder sb11 = new StringBuilder();
                        sb11.append(c2597.f7326);
                        str6 = str5;
                        sb11.append(str6);
                        sb11.append(c2621.f7493);
                        sb = sb11.toString();
                    }
                    if (!new File(sb).exists()) {
                        StringBuilder sb12 = new StringBuilder();
                        sb12.append(f7278);
                        str8 = str4;
                        sb12.append(str8);
                        sb12.append(c2621.f7493);
                        str7 = str3;
                        sb12.append(str7);
                        sb12.append(C2500.m6942(new File(sb)));
                        next13.m7267(sb12.toString());
                        str9 = str;
                    } else {
                        str7 = str3;
                        str8 = str4;
                        c2597.f7299 += sb + str2;
                        StringBuilder sb13 = new StringBuilder();
                        sb13.append(c2597.f7299);
                        sb13.append(next13.f7436);
                        str9 = str;
                        sb13.append(str9);
                        c2597.f7299 = sb13.toString();
                        next13.m7267("File copied success.");
                    }
                    str5 = str6;
                    str = str9;
                    str4 = str8;
                    str3 = str7;
                }
            }
            String str49 = str5;
            if (c2621.f7492 == 19 && !c2597.f7342 && c2597.f7286 != null) {
                try {
                    C2500.m6875(c2597.f7286, new File(C2975.f9245.mo1874().getDir("bootlist", 0) + str49 + c2597.f7345));
                } catch (Exception e6) {
                    e6.printStackTrace();
                }
            }
            if (c2621.f7492 == 20 && !c2597.f7342 && c2621.f7505.size() > 0) {
                Iterator<C2620> it29 = c2621.f7505.iterator();
                while (it29.hasNext()) {
                    C2620 next14 = it29.next();
                    try {
                        if (next14.f7491) {
                            C2500 c2500 = new C2500(str17);
                            try {
                                String[] strArr2 = new String[1];
                                strArr2[0] = "pm enable '" + c2597.f7345 + str49 + next14.f7490 + "'";
                                c2500.m7211(strArr2);
                            } catch (Exception e7) {
                                e = e7;
                                e.printStackTrace();
                            }
                        } else {
                            C2500 c25002 = new C2500(str17);
                            String[] strArr3 = new String[1];
                            try {
                                strArr3[0] = "pm disable '" + c2597.f7345 + str49 + next14.f7490 + "'";
                                c25002.m7211(strArr3);
                            } catch (Exception e8) {
                                e = e8;
                                e.printStackTrace();
                            }
                        }
                    } catch (Exception e9) {
                        e = e9;
                    }
                }
            }
            it5 = it;
        }
    }

    public void m7252(C2634 c2634, File file) {
        boolean z;
        File file2;
        File[] fileArr;
        int i;
        int i2;
        long j;
        int i3;
        int i4;
        int i5;
        int i6;
        boolean z2;
        C2632[] c2632Arr;
        int i7;
        int length;
        int i8;
        int i9;
        boolean z3;
        C2632[] c2632Arr2;
        byte[] bArr;
        MappedByteBuffer mappedByteBuffer;
        String str;
        ArrayList<C2632> arrayList;
        boolean z4;
        ArrayList<Boolean> arrayList2;
        C2634 c26342 = c2634;
        int i10 = 0;
        if (c26342 != null && (arrayList2 = c26342.f7623) != null && arrayList2.size() > 0) {
            Iterator<Boolean> it = c26342.f7623.iterator();
            while (it.hasNext()) {
                if (it.next().booleanValue()) {
                    z = true;
                    break;
                }
            }
        }
        z = false;
        if (z) {
            File[] fileArr2 = this.f7331;
            int length2 = fileArr2.length;
            int i11 = 0;
            while (i11 < length2) {
                File file3 = fileArr2[i11];
                if (file != null) {
                    file2 = file;
                } else {
                    file2 = file3;
                }
                C2975.m7942("patch fie:" + file2.getAbsolutePath());
                ArrayList<C2632> m7236 = m7236(c26342, file2);
                C2632[] c2632Arr3 = (C2632[]) m7236.toArray(new C2632[m7236.size()]);
                String str2 = " ";
                if (!C2975.f9323.booleanValue()) {
                    C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_step2) + " " + file2.getName(), "%1d/%2d bytes", 0, (int) file2.length(), false);
                }
                long length3 = file2.length();
                try {
                    FileChannel channel = new RandomAccessFile(file2, InternalZipConstants.WRITE_MODE).getChannel();
                    MappedByteBuffer map = channel.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel.size());
                    byte[] m6945 = C2500.m6945(file2);
                    if (file2.getName().endsWith(".dex") && file2.length() > 112) {
                        map.position(i10);
                        ArrayList arrayList3 = new ArrayList();
                        int i12 = 0;
                        while (i12 < c2632Arr3.length) {
                            C2632 c2632 = c2632Arr3[i12];
                            long j2 = length3;
                            if (c2632.f7617 && c2632.f7576) {
                                arrayList3.add(Integer.valueOf(i12));
                                int i13 = 0;
                                while (i13 < c2632.f7584.size()) {
                                    int intValue = c2632.f7582.get(i13).intValue();
                                    ArrayList arrayList4 = arrayList3;
                                    byte[] bArr2 = new byte[intValue];
                                    int i14 = 0;
                                    boolean z5 = false;
                                    while (i14 < intValue) {
                                        fileArr = fileArr2;
                                        int i15 = intValue - i14;
                                        i = length2;
                                        try {
                                            byte[] bArr3 = c2632.f7579;
                                            i2 = i11;
                                            try {
                                                try {
                                                    if (i15 <= bArr3.length) {
                                                        int length4 = bArr3.length;
                                                        int i16 = 0;
                                                        while (i16 < length4) {
                                                            bArr2[i14] = bArr3[i16];
                                                            if (i14 < intValue) {
                                                                i14++;
                                                            }
                                                            i16++;
                                                            z5 = true;
                                                        }
                                                    } else {
                                                        bArr2[i14] = 0;
                                                    }
                                                    i14++;
                                                    fileArr2 = fileArr;
                                                    length2 = i;
                                                    i11 = i2;
                                                } catch (Throwable th) {
                                                    th = th;
                                                    th.printStackTrace();
                                                    if (file != null) {
                                                    }
                                                }
                                            } catch (IOException e) {
                                                e = e;
                                                e.printStackTrace();
                                                if (file != null) {
                                                }
                                            }
                                        } catch (IOException e2) {
                                            e = e2;
                                            i2 = i11;
                                            e.printStackTrace();
                                            if (file != null) {
                                            }
                                        } catch (Throwable th2) {
                                            th = th2;
                                            i2 = i11;
                                            th.printStackTrace();
                                            if (file != null) {
                                            }
                                        }
                                    }
                                    File[] fileArr3 = fileArr2;
                                    int i17 = length2;
                                    int i18 = i11;
                                    if (z5) {
                                        map.position(c2632.f7584.get(i13).intValue());
                                        map.put(bArr2);
                                        map.force();
                                        this.f7343 += c2632.f7589 + "\n";
                                        C2632 c26322 = c2632Arr3[i12];
                                        c26322.f7585 = true;
                                        c26322.f7587 = false;
                                        if (!this.f7341.contains(file2)) {
                                            this.f7341.add(file2);
                                        }
                                    }
                                    c2632Arr3[i12].f7604 = true;
                                    i13++;
                                    arrayList3 = arrayList4;
                                    fileArr2 = fileArr3;
                                    length2 = i17;
                                    i11 = i18;
                                }
                            }
                            i12++;
                            length3 = j2;
                            arrayList3 = arrayList3;
                            fileArr2 = fileArr2;
                            length2 = length2;
                            i11 = i11;
                        }
                        j = length3;
                        fileArr = fileArr2;
                        i = length2;
                        i2 = i11;
                        C2632[] m7250 = m7250(m7236);
                        map.position(0);
                        try {
                            if (map.get() == 100 && map.get() == 101 && map.get() == 120 && map.get() == 10) {
                                map.position(56);
                                int m7185 = C2500.m7185(map.get(), map.get(), map.get(), map.get());
                                int m71852 = C2500.m7185(map.get(), map.get(), map.get(), map.get());
                                map.position(m71852);
                                long m71853 = C2500.m7185(map.get(), map.get(), map.get(), map.get());
                                map.position(((m7185 - 1) * 4) + m71852);
                                i4 = C2500.m7185(map.get(), map.get(), map.get(), map.get());
                                map.position(108);
                                int m71854 = C2500.m7185(map.get(), map.get(), map.get(), map.get());
                                if (m71854 == m71853) {
                                    try {
                                        m71853 = file2.length();
                                    } catch (Throwable th3) {
                                        th = th3;
                                        th.printStackTrace();
                                        C2975.m7962(C2500.m7007(R.string.warning), C2500.m7007(R.string.message_about_patched_file) + " " + file2.getName());
                                        map.position(0);
                                        c2632Arr3 = m7250;
                                        j = file2.length();
                                        i3 = 0;
                                        map.position(i3);
                                        i5 = 1;
                                        int i19 = i4 - 1;
                                        i6 = 0;
                                        z2 = false;
                                        c2632Arr = c2632Arr3;
                                        i7 = i19;
                                        while (true) {
                                            i7 += i5;
                                            try {
                                                if (i7 < m6945.length) {
                                                }
                                                c2632Arr = c2632Arr2;
                                                i6 = i9;
                                                z2 = r11;
                                                i5 = 1;
                                            } catch (Exception e3) {
                                                e = e3;
                                            }
                                        }
                                        channel.close();
                                        length = c2632Arr.length;
                                        i8 = 0;
                                        while (true) {
                                            if (i8 >= length) {
                                            }
                                            i8++;
                                        }
                                        if (file != null) {
                                        }
                                    }
                                } else {
                                    i4 = m71854;
                                }
                                map.position(i4);
                                j = m71853;
                            } else {
                                i4 = 0;
                            }
                            c2632Arr3 = m7250;
                        } catch (Throwable th4) {
                            th = th4;
                            i4 = 0;
                        }
                        i3 = 0;
                    } else {
                        j = length3;
                        fileArr = fileArr2;
                        i = length2;
                        i2 = i11;
                        i3 = 0;
                        i4 = 0;
                    }
                    map.position(i3);
                    i5 = 1;
                    int i192 = i4 - 1;
                    i6 = 0;
                    z2 = false;
                    c2632Arr = c2632Arr3;
                    i7 = i192;
                    while (true) {
                        i7 += i5;
                        if (i7 < m6945.length) {
                            break;
                        }
                        int i20 = i6 + i5;
                        if (i7 > j) {
                            break;
                        }
                        if (!C2975.f9323.booleanValue() && i20 > 153600) {
                            C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_step2) + str2 + file2.getName(), "%1d/%2d bytes", i7, (int) file2.length(), false);
                            i9 = 0;
                        } else {
                            i9 = i20;
                        }
                        if (z2) {
                            c2632Arr2 = m7250(m7236);
                            z3 = false;
                        } else {
                            z3 = z2;
                            c2632Arr2 = c2632Arr;
                        }
                        boolean z6 = z3;
                        int i21 = 0;
                        while (i21 < c2632Arr2.length) {
                            try {
                                C2632 c26323 = c2632Arr2[i21];
                                if (c26323.f7597) {
                                    int i22 = i7;
                                    while (true) {
                                        if (i22 > 0) {
                                            try {
                                                C2632 c26324 = c2632Arr2[i21];
                                                int i23 = c26324.f7615 + 1;
                                                c26324.f7615 = i23;
                                                if (i23 < c26324.f7616) {
                                                    bArr = m6945;
                                                    mappedByteBuffer = map;
                                                    str = str2;
                                                    arrayList = m7236;
                                                    m7254(map, m6945, c2632Arr2, c26323, i21, i22);
                                                    if (!c2632Arr2[i21].f7597) {
                                                        break;
                                                    }
                                                    i22--;
                                                    m6945 = bArr;
                                                    map = mappedByteBuffer;
                                                    str2 = str;
                                                    m7236 = arrayList;
                                                } else {
                                                    bArr = m6945;
                                                    mappedByteBuffer = map;
                                                    str = str2;
                                                    arrayList = m7236;
                                                    c26323.f7597 = false;
                                                    c26324.f7597 = false;
                                                    c26324.f7615 = 0;
                                                    break;
                                                }
                                            } catch (Exception e4) {
                                                e = e4;
                                                c2632Arr = c2632Arr2;
                                                try {
                                                    e.printStackTrace();
                                                    channel.close();
                                                    length = c2632Arr.length;
                                                    i8 = 0;
                                                    while (true) {
                                                        if (i8 >= length) {
                                                        }
                                                        i8++;
                                                    }
                                                } catch (IOException e5) {
                                                    e = e5;
                                                    e.printStackTrace();
                                                    if (file != null) {
                                                    }
                                                }
                                                if (file != null) {
                                                }
                                            }
                                        } else {
                                            bArr = m6945;
                                            mappedByteBuffer = map;
                                            str = str2;
                                            arrayList = m7236;
                                            break;
                                        }
                                    }
                                    c26323.f7597 = false;
                                    C2632 c26325 = c2632Arr2[i21];
                                    c26325.f7597 = false;
                                    c26325.f7615 = 0;
                                } else {
                                    bArr = m6945;
                                    mappedByteBuffer = map;
                                    str = str2;
                                    arrayList = m7236;
                                }
                                if (c26323.f7595) {
                                    C2632 c26326 = c2632Arr2[i21];
                                    int i24 = c26326.f7615 + 1;
                                    c26326.f7615 = i24;
                                    if (i24 < c26326.f7616) {
                                        m7254(mappedByteBuffer, bArr, c2632Arr2, c26323, i21, i7);
                                    } else {
                                        c26323.f7595 = false;
                                        c26326.f7595 = false;
                                        c26326.f7615 = 0;
                                    }
                                }
                                if (!c26323.f7595 && c26323.f7587 && (!(z4 = c26323.f7617) || !c26323.f7576)) {
                                    if (z4) {
                                        try {
                                            System.out.println("dex method running");
                                            if (c26323.f7608) {
                                                Iterator<Integer> it2 = c26323.f7584.iterator();
                                                while (it2.hasNext()) {
                                                    if (m7254(mappedByteBuffer, bArr, c2632Arr2, c26323, i21, it2.next().intValue()) && !this.f7341.contains(file2)) {
                                                        this.f7341.add(file2);
                                                    }
                                                }
                                                c2632Arr2[i21].f7587 = false;
                                            }
                                            if (c26323.f7580) {
                                                for (int i25 = 0; i25 < c26323.f7584.size(); i25++) {
                                                    int intValue2 = c26323.f7584.get(i25).intValue();
                                                    int i26 = intValue2;
                                                    while (true) {
                                                        if (i26 < c26323.f7582.get(i25).intValue() + intValue2) {
                                                            int i27 = i26;
                                                            m7254(mappedByteBuffer, bArr, c2632Arr2, c26323, i21, i26);
                                                            C2632 c26327 = c2632Arr2[i21];
                                                            if (c26327.f7585) {
                                                                c26327.f7587 = false;
                                                                if (!this.f7341.contains(file2)) {
                                                                    this.f7341.add(file2);
                                                                }
                                                            } else {
                                                                i26 = i27 + 1;
                                                            }
                                                        }
                                                    }
                                                }
                                                try {
                                                    try {
                                                        c2632Arr2[i21].f7587 = false;
                                                    } catch (Exception e6) {
                                                        e = e6;
                                                        c2632Arr = c2632Arr2;
                                                        e.printStackTrace();
                                                        channel.close();
                                                        length = c2632Arr.length;
                                                        i8 = 0;
                                                        while (true) {
                                                            if (i8 >= length) {
                                                            }
                                                            i8++;
                                                        }
                                                        if (file != null) {
                                                        }
                                                    }
                                                } catch (Throwable th5) {
                                                    th = th5;
                                                    th.printStackTrace();
                                                    if (file != null) {
                                                    }
                                                }
                                            }
                                            c2632Arr2[i21].f7604 = true;
                                            z6 = true;
                                        } catch (Exception e7) {
                                            e = e7;
                                        } catch (Throwable th6) {
                                            th = th6;
                                        }
                                    }
                                    try {
                                        if (!c26323.f7617) {
                                            try {
                                                try {
                                                    m7254(mappedByteBuffer, bArr, c2632Arr2, c26323, i21, i7);
                                                } catch (Exception e8) {
                                                    e = e8;
                                                    c2632Arr = c2632Arr2;
                                                    e.printStackTrace();
                                                    channel.close();
                                                    length = c2632Arr.length;
                                                    i8 = 0;
                                                    while (true) {
                                                        if (i8 >= length) {
                                                        }
                                                        i8++;
                                                    }
                                                    if (file != null) {
                                                    }
                                                }
                                            } catch (Throwable th7) {
                                                th = th7;
                                                th.printStackTrace();
                                                if (file != null) {
                                                }
                                            }
                                        }
                                    } catch (Exception e9) {
                                        e = e9;
                                    }
                                }
                                i21++;
                                m6945 = bArr;
                                map = mappedByteBuffer;
                                str2 = str;
                                m7236 = arrayList;
                            } catch (Exception e10) {
                                e = e10;
                            }
                        }
                        c2632Arr = c2632Arr2;
                        i6 = i9;
                        z2 = z6;
                        i5 = 1;
                    }
                    channel.close();
                    length = c2632Arr.length;
                    i8 = 0;
                    while (true) {
                        if (i8 >= length) {
                            break;
                        }
                        if (c2632Arr[i8].f7585) {
                            if (!this.f7341.contains(file2)) {
                                this.f7341.add(file2);
                            }
                        } else {
                            i8++;
                        }
                    }
                } catch (IOException e11) {
                    e = e11;
                    fileArr = fileArr2;
                    i = length2;
                } catch (Throwable th8) {
                    th = th8;
                    fileArr = fileArr2;
                    i = length2;
                }
                if (file != null) {
                    c26342 = c2634;
                    i11 = i2 + 1;
                    fileArr2 = fileArr;
                    length2 = i;
                    i10 = 0;
                } else {
                    return;
                }
            }
        }
    }

    public void m7253() {
        String str;
        ArrayList<String> arrayList;
        Iterator<C2621> it = this.f7287.iterator();
        while (it.hasNext()) {
            C2621 next = it.next();
            int i = next.f7492;
            if (i == 2 || i == 6 || i == 7 || i == 11 || i == 8 || i == 27 || i == 9) {
                Iterator<C2612> it2 = next.f7497.iterator();
                while (it2.hasNext()) {
                    C2612 next2 = it2.next();
                    m7249(next2);
                    ArrayList<File> arrayList2 = next2.f7442;
                    if (arrayList2 != null && arrayList2.size() > 0) {
                        Iterator<File> it3 = next2.f7442.iterator();
                        while (it3.hasNext()) {
                            File next3 = it3.next();
                            ArrayList<C2625> arrayList3 = next2.f7444;
                            if (arrayList3 != null && arrayList3.size() > 0 && !m7256(next3, next, next2)) {
                                next.f7510 = false;
                            }
                            if (!m7248(next3, next, next2)) {
                                next.f7510 = false;
                            }
                        }
                    }
                }
            }
            if (next.f7492 == 18) {
                Iterator<C2612> it4 = next.f7497.iterator();
                while (it4.hasNext()) {
                    C2612 next4 = it4.next();
                    next.f7493 = next4.f7438;
                    String str2 = next.f7495;
                    File m7257 = m7257(next);
                    next4.m7268(next.f7495);
                    next.f7495 = str2;
                    if (m7257 != null && m7257.exists()) {
                        next4.f7442.add(m7257);
                        ArrayList<C2625> arrayList4 = next4.f7444;
                        if (arrayList4 != null && arrayList4.size() > 0 && !m7256(m7257, next, next4)) {
                            next.f7510 = false;
                        }
                        if (!m7248(m7257, next, next4)) {
                            next.f7510 = false;
                        }
                    }
                }
            }
            if (next.f7492 == 14) {
                File file = new File(C2500.m6976(this.f7351.getAbsolutePath(), true));
                if (file.exists() && file.length() != 0) {
                    C2612 c2612 = next.f7497.get(0);
                    c2612.f7442.add(file);
                    ArrayList<C2625> arrayList5 = c2612.f7444;
                    if (arrayList5 != null && arrayList5.size() > 0 && !m7256(file, next, c2612)) {
                        next.f7510 = false;
                    }
                    if (!m7248(file, next, c2612)) {
                        next.f7510 = false;
                    }
                } else {
                    if (file.length() == 0) {
                        file.delete();
                    }
                    next.m7274("Odex not found! Please use befor other Patch, and after run Custom Patch!");
                }
            }
            String str3 = "";
            if (next.f7492 == 22) {
                Iterator<C2612> it5 = next.f7497.iterator();
                while (it5.hasNext()) {
                    C2612 next5 = it5.next();
                    if (!next5.f7438.equals("") && next5.f7438.contains(InternalZipConstants.ZIP_FILE_SEPARATOR)) {
                        if (new File(next5.f7438).exists() && new File(next5.f7438).isDirectory()) {
                            m7255(next5, next);
                            ArrayList<File> arrayList6 = next5.f7442;
                            if (arrayList6 != null && arrayList6.size() > 0) {
                                Iterator<File> it6 = next5.f7442.iterator();
                                while (it6.hasNext()) {
                                    File next6 = it6.next();
                                    ArrayList<C2625> arrayList7 = next5.f7444;
                                    if (arrayList7 != null && arrayList7.size() > 0 && !m7256(next6, next, next5)) {
                                        next.f7510 = false;
                                    }
                                    if (!m7248(next6, next, next5)) {
                                        next.f7510 = false;
                                    }
                                }
                            } else {
                                next5.m7268(f7278 + "  files for template \"" + next5.f7439 + "\"  not founds.\n");
                            }
                        } else {
                            next5.m7268(f7278 + "  \"" + next5.f7438 + "\"  for the patch is not exists.\n");
                            next.f7510 = false;
                        }
                    } else {
                        next5.m7268(f7278 + " \"" + next5.f7438 + "\" for the patch is not defined correctly.\n");
                        next.f7510 = false;
                    }
                }
            }
            if (next.f7492 == 23 && (arrayList = next.f7508) != null && arrayList.size() > 0) {
                String m6998 = C2500.m6998("/system/etc/hosts");
                if (m6998.equals("")) {
                    m6998 = "/data/data/hosts";
                }
                if (!new File(m6998).exists() || new File(m6998).length() != new File("/system/etc/hosts").length()) {
                    m6998 = "/system/etc/hosts";
                } else {
                    C2500.m7094("chmod", "777", "/data/data/hosts");
                    C2500.m7094("chattr", "-ai", "/data/data/hosts");
                }
                try {
                    C2500.m7078("/system", InternalZipConstants.WRITE_MODE);
                    C2500.m7094("chmod", "777", "/system/etc/hosts");
                    C2500.m7094("chattr", "-ai", "/system/etc/hosts");
                    ArrayList arrayList8 = new ArrayList();
                    Iterator<String> it7 = next.f7508.iterator();
                    while (it7.hasNext()) {
                        String next7 = it7.next();
                        if (C2500.m7102(new File(m6998), "127.0.0.1       " + next7 + "\n\n")) {
                            next.m7274("Internet host \"" + next7 + "\" is already blocked.\n");
                            next.f7511 = true;
                        } else {
                            arrayList8.add(next7);
                        }
                    }
                    Iterator it8 = arrayList8.iterator();
                    while (it8.hasNext()) {
                        String str4 = (String) it8.next();
                        if (!C2500.m7099(new File(m6998), "127.0.0.1       " + str4 + "\n\n")) {
                            next.m7274(f7278 + "Failed to block \"" + str4 + "\" in the hosts file.\n");
                            next.f7510 = false;
                        } else {
                            next.m7274("Blocking Internet host \"" + str4 + "\" successful.\n");
                            next.f7511 = true;
                        }
                    }
                } catch (Throwable th) {
                    th.printStackTrace();
                    next.f7510 = false;
                }
            }
            if (next.f7492 == 16) {
                Iterator<C2617> it9 = next.f7498.iterator();
                while (it9.hasNext()) {
                    C2617 next8 = it9.next();
                    next.f7493 = next8.f7473;
                    File m72572 = m7257(next);
                    if (m72572 != null && m72572.exists()) {
                        C2500.m7094("chmod", "" + next8.f7474, m72572.getAbsolutePath());
                    }
                }
            }
            if (next.f7492 == 17) {
                Iterator<C2611> it10 = next.f7499.iterator();
                while (it10.hasNext()) {
                    C2611 next9 = it10.next();
                    String str5 = next9.f7435;
                    next.f7493 = str5;
                    if (!str5.equals("") && new File(next.f7493).exists()) {
                        str = next.f7493;
                    } else {
                        str = this.f7326 + InternalZipConstants.ZIP_FILE_SEPARATOR + next.f7493;
                    }
                    File m6942 = C2500.m6942(new File(next9.f7436));
                    m6942.mkdirs();
                    C2500.m7094("chmod", "777", m6942.getAbsolutePath());
                    m6942.getAbsolutePath();
                    if (!new File(str).exists()) {
                        next9.m7267(f7278 + " File " + next.f7493 + " not found to dir\n" + C2500.m6942(new File(str)));
                    } else {
                        C2500.m6875(new File(str), new File(next9.f7436));
                        if (new File(next9.f7436).exists()) {
                            if (new File(next9.f7436).length() == new File(this.f7326 + InternalZipConstants.ZIP_FILE_SEPARATOR + next.f7493).length()) {
                                next9.m7267("File copied success.");
                                C2500.m7094("chmod", "777", next9.f7436);
                            }
                        }
                        next9.m7267(f7278 + "File copied with error. Try again.");
                        C2500.m7094("chmod", "777", next9.f7436);
                    }
                }
            }
            if (next.f7492 == 15 && next.f7506.size() > 0) {
                Iterator<C2622> it11 = next.f7506.iterator();
                String str6 = "";
                String str7 = str6;
                while (it11.hasNext()) {
                    C2622 next10 = it11.next();
                    File file2 = new File(next10.f7512);
                    if (!str6.equals(next10.f7512)) {
                        str6 = next10.f7512;
                        if (!file2.exists()) {
                            next.f7493 = file2.getName();
                            File m72573 = m7257(next);
                            if (m72573 != null && m72573.exists()) {
                                C2500.m7105(m72573.getAbsolutePath());
                                C2500.m6875(m72573, new File(this.f7328 + InternalZipConstants.ZIP_FILE_SEPARATOR + m72573.getName()));
                                next10.f7512 = m72573.getAbsolutePath();
                                next10.f7514 = true;
                                str7 = m72573.getAbsolutePath();
                            } else {
                                next10.f7512 = "database not found " + file2.getName();
                                str7 = "database not found " + file2.getName();
                            }
                        } else {
                            C2500.m6875(file2, new File(this.f7328 + InternalZipConstants.ZIP_FILE_SEPARATOR + file2.getName()));
                            C2500.m7105(file2.getAbsolutePath());
                            next10.f7512 = file2.getAbsolutePath();
                            next10.f7514 = true;
                            str7 = file2.getAbsolutePath();
                        }
                    } else {
                        next10.f7512 = str7;
                        if (!str7.contains("database not found ")) {
                            next10.f7514 = true;
                        }
                    }
                }
            }
            if (next.f7492 == 21) {
                Iterator<C2615> it12 = next.f7507.iterator();
                File file3 = null;
                while (it12.hasNext()) {
                    C2615 next11 = it12.next();
                    File file4 = new File(next11.f7460);
                    if (!str3.equals(next11.f7460)) {
                        str3 = next11.f7460;
                        if (file4.exists()) {
                            next11.f7461 = file4;
                        } else {
                            next.f7493 = next11.f7460;
                            File m72574 = m7257(next);
                            next11.f7467 = next.f7495;
                            if (m72574.exists()) {
                                next11.f7461 = m72574;
                                C2500.m7105(m72574.getAbsolutePath());
                                C2500.m6875(next11.f7461, new File(this.f7328 + InternalZipConstants.ZIP_FILE_SEPARATOR + next11.f7461.getName()));
                            }
                        }
                    } else {
                        next11.f7461 = file3;
                    }
                    File file5 = next11.f7461;
                    if (file5 != null && file5.exists()) {
                        next11.f7468 = true;
                        file3 = next11.f7461;
                    }
                }
            }
        }
    }

    boolean m7254(MappedByteBuffer mappedByteBuffer, byte[] bArr, C2632[] c2632Arr, C2632 c2632, int i, int i2) {
        int i3;
        int i4;
        byte b;
        byte[] bArr2;
        int i5;
        byte b2;
        int i6;
        byte b3;
        byte b4;
        if (i2 >= bArr.length) {
            return false;
        }
        byte b5 = bArr[i2];
        int i7 = 0;
        byte b6 = 0;
        boolean z = false;
        while (true) {
            int i8 = c2632.f7577[i7];
            if ((i8 != 255 || (b5 != 110 && b5 != 111 && b5 != 114)) && ((i8 != 254 || (b5 != 16 && b5 != 32 && b5 != 48 && b5 != 64 && b5 != 84)) && (!c2632.f7611 || (i7 != 2 && i7 != 3)))) {
                if (i8 != 255 && i8 != 254) {
                    if (b5 != c2632.f7575[i7] && i8 < 1 && (i3 = c2632.f7583[i7]) != 5 && i3 != 6) {
                        return z;
                    }
                } else {
                    return z;
                }
            }
            if (c2632.f7583[i7] == 1) {
                c2632.f7581[i7] = c2632.f7579[i7];
            }
            if (c2632.f7611 && (i7 == 2 || i7 == 3)) {
                if (i7 == 2) {
                    b6 = b5;
                }
                if (i7 == 3) {
                    int i9 = 0;
                    boolean z2 = false;
                    while (true) {
                        byte[][] bArr3 = c2632.f7600;
                        if (i9 >= bArr3.length) {
                            break;
                        }
                        byte[] bArr4 = (byte[]) Array.get(bArr3, i9);
                        if (b6 == bArr4[0] && b5 == bArr4[1]) {
                            z2 = true;
                        }
                        i9++;
                    }
                    if (!z2) {
                        return z;
                    }
                }
            }
            if (c2632.f7583[i7] != 5 || b5 != c2632.f7575[i7]) {
                if (c2632.f7577[i7] == 3) {
                    int i10 = 0;
                    boolean z3 = false;
                    while (true) {
                        int[] iArr = c2632.f7577;
                        if (i10 < iArr.length) {
                            if (iArr[i10] == 2) {
                                byte[] bArr5 = c2632.f7575;
                                if (bArr5[i10] == bArr5[i7]) {
                                    b4 = bArr[i10 + i2];
                                    break;
                                }
                            }
                            if (c2632.f7583[i10] == 2 && c2632.f7581[i10] == c2632.f7575[i7]) {
                                b4 = bArr[i10 + i2];
                                break;
                            }
                            i10++;
                            z3 = true;
                        } else {
                            b4 = -1;
                            break;
                        }
                    }
                    z3 = false;
                    if (z3) {
                        C2975.m7942("orig not read register for write byte");
                        return z;
                    }
                    if (b5 != b4) {
                        return z;
                    }
                }
                int i11 = c2632.f7583[i7];
                if (i11 >= 20 && i11 < 30) {
                    if (b5 < 16) {
                        c2632.f7581[i7] = (byte) ((b5 & RegisterType.DOUBLE_HI) + ((i11 - 20) * 16));
                    } else {
                        if (i7 >= 7 && (((b2 = (bArr2 = c2632.f7575)[i7 - 1]) == 10 || b2 == 12) && ((b3 = bArr2[i7 - 7]) == 110 || b3 == 111 || b3 == 113 || b3 == 114 || b3 == 116 || b3 == 117 || b3 == 118 || b3 == 119 || b3 == 120))) {
                            byte[] bArr6 = c2632.f7581;
                            bArr6[i6] = 0;
                            bArr6[i7 - 6] = 0;
                            bArr6[i7 - 5] = 0;
                            bArr6[i7 - 4] = 0;
                            bArr6[i7 - 3] = 19;
                            bArr6[i7 - 2] = b5;
                            bArr6[i5] = (byte) ((b5 & RegisterType.DOUBLE_HI) + ((i11 - 20) * 16));
                            bArr6[i7] = 0;
                        }
                        byte b7 = c2632.f7575[i7 - 1];
                        if (b7 != 10 && b7 != 12) {
                            c2632.f7581[i7] = (byte) ((b5 & RegisterType.DOUBLE_HI) + ((i11 - 20) * 16));
                        }
                    }
                }
                if (i11 == 250) {
                    byte[] bArr7 = c2632.f7581;
                    int i12 = b5 & RegisterType.DOUBLE_HI;
                    bArr7[i7] = (byte) (i12 + (i12 * 16));
                }
                if (i11 == 3) {
                    int i13 = 0;
                    boolean z4 = false;
                    while (true) {
                        int[] iArr2 = c2632.f7577;
                        if (i13 < iArr2.length) {
                            if (iArr2[i13] == 2 && c2632.f7575[i13] == c2632.f7581[i7]) {
                                b = bArr[i13 + i2];
                                break;
                            }
                            if (c2632.f7583[i13] == 2) {
                                byte[] bArr8 = c2632.f7581;
                                if (bArr8[i13] == bArr8[i7]) {
                                    b = bArr[i13 + i2];
                                    break;
                                }
                            }
                            i13++;
                            z4 = true;
                        } else {
                            b = -1;
                            break;
                        }
                    }
                    z4 = false;
                    if (z4) {
                        C2975.m7942("repl not read register for write byte");
                        return z;
                    }
                    int i14 = c2632.f7581[i7] + 1;
                    while (c2632.f7601.size() < i14) {
                        c2632.f7601.add((byte) -1);
                    }
                    c2632.f7601.set(c2632.f7581[i7], Byte.valueOf(b));
                }
                int i15 = c2632.f7583[i7];
                if (i15 != 0 && i15 != 5) {
                    i4 = 6;
                } else {
                    i4 = 6;
                }
                c2632.f7581[i7] = b5;
                if (i15 == i4 && b5 == c2632.f7575[i7]) {
                    c2632.f7581[i7] = RegisterType.REFERENCE;
                }
                i7++;
                if (i7 == c2632.f7575.length) {
                    mappedByteBuffer.position(i2);
                    if (c2632.f7601.size() > 0) {
                        byte[] bArr9 = c2632.f7581;
                        byte[] copyOf = Arrays.copyOf(bArr9, bArr9.length);
                        for (int i16 = 0; i16 < copyOf.length; i16++) {
                            if (c2632.f7583[i16] == 3) {
                                copyOf[i16] = c2632.f7601.get(c2632.f7581[i16]).byteValue();
                            }
                        }
                        mappedByteBuffer.put(copyOf);
                    } else {
                        mappedByteBuffer.put(c2632.f7581);
                    }
                    mappedByteBuffer.force();
                    this.f7343 += c2632.f7589 + "\n";
                    c2632.f7585 = true;
                    C2632 c26322 = c2632Arr[i];
                    c26322.f7585 = true;
                    if (c2632.f7597) {
                        c2632.f7597 = false;
                        c26322.f7597 = false;
                        for (C2632 c26323 : c2632Arr) {
                            if (c26323.f7593.equals(c2632.f7593)) {
                                c26323.f7597 = false;
                            }
                        }
                        c2632Arr[i].f7615 = 0;
                    } else {
                        boolean z5 = c2632.f7595;
                        if (z5) {
                            c2632.f7595 = false;
                            c26322.f7595 = true;
                            for (C2632 c26324 : c2632Arr) {
                                if (c26324.f7591.equals(c2632.f7591)) {
                                    c26324.f7595 = false;
                                }
                            }
                            c2632Arr[i].f7615 = 0;
                        } else if (!z5) {
                            if (!c2632.f7591.equals("")) {
                                for (int i17 = 0; i17 < c2632Arr.length; i17++) {
                                    if (c2632Arr[i17].f7591.equals(c2632.f7591)) {
                                        C2632 c26325 = c2632Arr[i17];
                                        if (!c26325.f7602) {
                                            c26325.f7595 = true;
                                            c26325.f7615 = 0;
                                        }
                                    }
                                }
                            }
                            if (!c2632.f7593.equals("")) {
                                for (int i18 = 0; i18 < c2632Arr.length; i18++) {
                                    if (c2632Arr[i18].f7593.equals(c2632.f7593)) {
                                        C2632 c26326 = c2632Arr[i18];
                                        if (!c26326.f7602) {
                                            c26326.f7597 = true;
                                            c26326.f7615 = 0;
                                        }
                                    }
                                }
                            }
                        } else {
                            z = true;
                        }
                    }
                }
                int i19 = i2 + i7;
                if (i19 < bArr.length) {
                    b5 = bArr[i19];
                } else {
                    return z;
                }
            } else {
                return z;
            }
        }
    }

    public void m7255(C2612 c2612, C2621 c2621) {
        try {
            new C2500("").m7199(c2612.f7442, new File(c2612.f7438), c2612.f7439);
        } catch (Throwable th) {
            th.printStackTrace();
            c2621.m7274(f7278 + "no access to directory.");
        }
    }

    public boolean m7256(File file, C2621 c2621, C2612 c2612) {
        boolean z;
        int i;
        int i2;
        C2975.m7942("search to file " + file.getName());
        c2612.f7445.clear();
        ArrayList<C2625> arrayList = c2612.f7444;
        int i3 = 1;
        char c = 0;
        if (arrayList != null && arrayList.size() > 0) {
            Iterator<C2625> it = c2612.f7444.iterator();
            int i4 = 0;
            while (it.hasNext()) {
                C2625 next = it.next();
                next.f7525 = false;
                if (c2621.f7492 == 1 && c2612.f7449 && next.f7526.equals("")) {
                    next.f7526 = "multi_" + i4;
                    i4++;
                }
            }
        }
        if (!C2975.f9323.booleanValue()) {
            C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_step2) + " " + file.getName(), "%1d/%2d bytes", 0, (int) file.length(), false);
        } else {
            C2500.m7104("Size file:" + file.length());
        }
        ArrayList<C2625> arrayList2 = c2612.f7444;
        if (arrayList2 != null && arrayList2.size() > 0) {
            Iterator<C2625> it2 = arrayList2.iterator();
            while (it2.hasNext()) {
                it2.next().f7525 = false;
            }
        }
        try {
            FileChannel channel = new RandomAccessFile(file, InternalZipConstants.WRITE_MODE).getChannel();
            MappedByteBuffer map = channel.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel.size());
            C2625[] c2625Arr = new C2625[arrayList2.toArray().length];
            C2625[] c2625Arr2 = (C2625[]) arrayList2.toArray(new C2625[arrayList2.size()]);
            int i5 = 0;
            while (map.hasRemaining()) {
                try {
                    int i6 = i5 + i3;
                    if (!C2975.f9323.booleanValue()) {
                        if (i6 > 153600) {
                            C3549.m8199(C2500.m7007(R.string.wait), C2500.m7007(R.string.patch_step2) + " " + file.getName(), "%1d/%2d bytes", map.position(), (int) file.length(), false);
                            i6 = 0;
                            int position = map.position();
                            byte b = map.get();
                            i = 0;
                            while (i < c2625Arr2.length) {
                                map.position(position);
                                C2625 c2625 = c2625Arr2[i];
                                if (!c2625.f7525 && (b == c2625.f7522[c] || c2625.f7523[c] != 0)) {
                                    if (c2625.f7523[c] != 0) {
                                        c2625.f7524[c] = b;
                                    }
                                    map.position(position + 1);
                                    if (!map.hasRemaining()) {
                                        break;
                                    }
                                    byte b2 = map.get();
                                    int i7 = 1;
                                    while (true) {
                                        C2625 c26252 = c2625Arr2[i];
                                        i2 = i6;
                                        if ((c26252.f7525 || b2 != c26252.f7522[i7]) && c26252.f7523[i7] == 0) {
                                            break;
                                        }
                                        if (c26252.f7523[i7] > 0) {
                                            c26252.f7524[i7] = b2;
                                        }
                                        i7++;
                                        if (i7 == c26252.f7522.length) {
                                            c26252.f7525 = true;
                                            c2621.f7511 = true;
                                            break;
                                        }
                                        if (!map.hasRemaining()) {
                                            break;
                                        }
                                        b2 = map.get();
                                        i6 = i2;
                                    }
                                } else {
                                    i2 = i6;
                                }
                                i++;
                                i6 = i2;
                                c = 0;
                            }
                            int i8 = i6;
                            map.position(position + 1);
                            i5 = i8;
                            i3 = 1;
                            c = 0;
                        } else {
                            int position2 = map.position();
                            byte b3 = map.get();
                            i = 0;
                            while (i < c2625Arr2.length) {
                            }
                            int i82 = i6;
                            map.position(position2 + 1);
                            i5 = i82;
                            i3 = 1;
                            c = 0;
                        }
                    } else {
                        if (i6 > 153600) {
                            map.position();
                            C2500.m7104("Progress size:" + map.position());
                            i6 = 0;
                        }
                        int position22 = map.position();
                        byte b32 = map.get();
                        i = 0;
                        while (i < c2625Arr2.length) {
                        }
                        int i822 = i6;
                        map.position(position22 + 1);
                        i5 = i822;
                        i3 = 1;
                        c = 0;
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                    c2612.m7269(f7278 + "Search byte error: " + e, file);
                }
            }
            channel.close();
            for (int i9 = 0; i9 < c2625Arr2.length; i9++) {
                try {
                    C2625 c26253 = c2625Arr2[i9];
                    if (c26253.f7525 && !c26253.f7526.equals("")) {
                        for (C2625 c26254 : c2625Arr2) {
                            if (c26254.f7526.equals(c2625Arr2[i9].f7526)) {
                                c26254.f7527 = true;
                            }
                        }
                    }
                } catch (FileNotFoundException unused) {
                    z = true;
                    c2612.m7269(f7278 + " Program files are not found!\nMove Program to internal storage.\n", file);
                    return z;
                } catch (BufferUnderflowException e2) {
                    e = e2;
                    z = true;
                    c2612.m7269("Exception e" + e.toString(), file);
                    return z;
                } catch (Exception e3) {
                    e = e3;
                    z = true;
                    e.printStackTrace();
                    c2612.m7269("Exception e" + e.toString(), file);
                    return z;
                }
            }
            z = true;
            for (int i10 = 0; i10 < c2625Arr2.length; i10++) {
                try {
                    C2625 c26255 = c2625Arr2[i10];
                    if (!c26255.f7525) {
                        if (!c26255.f7526.equals("")) {
                            if (!c2625Arr2[i10].f7527) {
                                if (c2612.f7449) {
                                    ArrayList<File> arrayList3 = c2612.f7442;
                                    if (file.equals(arrayList3.get(arrayList3.size() - 1))) {
                                        c2612.m7269(C2604.m7263("Bytes by serach") + " N" + (i10 + 1) + ":\n" + f7278 + " " + C2604.m7263("Bytes not found!"), file);
                                        z = false;
                                    }
                                }
                                if (c2612.f7448) {
                                    ArrayList<File> arrayList4 = c2612.f7442;
                                    if (file.equals(arrayList4.get(arrayList4.size() - 1))) {
                                        c2612.m7269(C2604.m7263("Bytes by serach") + " N" + (i10 + 1) + ":\n" + f7278 + " " + C2604.m7263("Bytes not found!"), file);
                                        z = false;
                                    }
                                }
                                if (!c2612.f7449 && !c2612.f7448) {
                                    c2612.m7269(C2604.m7263("Bytes by serach") + " N" + (i10 + 1) + ":\n" + f7278 + " " + C2604.m7263("Bytes not found!"), file);
                                }
                            }
                        } else {
                            c2612.m7269(C2604.m7263("Bytes by serach") + " N" + (i10 + 1) + ":\n" + f7278 + " " + C2604.m7263("Bytes not found!"), file);
                        }
                        z = false;
                    }
                } catch (FileNotFoundException unused2) {
                    c2612.m7269(f7278 + " Program files are not found!\nMove Program to internal storage.\n", file);
                    return z;
                } catch (BufferUnderflowException e4) {
                    e = e4;
                    c2612.m7269("Exception e" + e.toString(), file);
                    return z;
                } catch (Exception e5) {
                    e = e5;
                    e.printStackTrace();
                    c2612.m7269("Exception e" + e.toString(), file);
                    return z;
                }
            }
            for (int i11 = 0; i11 < c2625Arr2.length; i11++) {
                if (c2625Arr2[i11].f7525) {
                    c2612.m7269(C2604.m7263("Bytes by serach") + " N" + (i11 + 1) + ":", file);
                }
                String str = "";
                int i12 = 0;
                while (true) {
                    C2625 c26256 = c2625Arr2[i11];
                    int[] iArr = c26256.f7523;
                    if (i12 >= iArr.length) {
                        break;
                    }
                    int i13 = iArr[i12];
                    if (i13 > 1) {
                        int i14 = i13 - 2;
                        try {
                            c2612.f7445.set(i14, Byte.valueOf(c26256.f7524[i12]));
                        } catch (Exception unused3) {
                            c2612.f7445.add(i14, Byte.valueOf(c2625Arr2[i11].f7524[i12]));
                        }
                        if (c2625Arr2[i11].f7525) {
                            str = str + "R" + i14 + "=" + C2500.m7161(new byte[]{c2612.f7445.get(i14).byteValue()}).toUpperCase() + " ";
                            i12++;
                        }
                    }
                    i12++;
                }
                if (!str.equals("")) {
                    c2612.m7269(str + "\n", file);
                }
            }
        } catch (FileNotFoundException unused4) {
        } catch (BufferUnderflowException e6) {
            e = e6;
        } catch (Exception e7) {
            e = e7;
        }
        return z;
    }

    public File m7257(C2621 c2621) {
        File file;
        File file2 = null;
        try {
        } catch (FileNotFoundException unused) {
        } catch (Exception e) {
            e = e;
        }
        if (new File(c2621.f7493).exists() && !c2621.f7493.startsWith("/mnt/sdcard")) {
            return new File(c2621.f7493);
        }
        if (!c2621.f7493.startsWith("/mnt/sdcard") && !c2621.f7493.startsWith("/sdcard")) {
            ?? startsWith = c2621.f7493.startsWith("/data/data/" + this.f7345 + "/shared_prefs/");
            String str = "";
            try {
            } catch (FileNotFoundException unused2) {
                file2 = startsWith;
                c2621.m7274(f7278 + " " + c2621.f7493 + " are not found!\n\nRun the application file to appear in the folder with the data.!\n");
                return file2;
            } catch (Exception e2) {
                file2 = startsWith;
                e = e2;
                c2621.m7274("Exception e:" + e.toString());
                return file2;
            }
            if (startsWith == 0) {
                if (!c2621.f7493.startsWith("/dbdata/databases/" + this.f7345 + "/shared_prefs/") && !c2621.f7493.startsWith("/shared_prefs/")) {
                    File file3 = new File("/data/data/" + this.f7345 + c2621.f7493);
                    if (!file3.exists()) {
                        file2 = new File("/mnt/asec/" + this.f7345 + "-1" + c2621.f7493);
                    } else {
                        file2 = file3;
                    }
                    if (!file2.exists()) {
                        file2 = new File("/mnt/asec/" + this.f7345 + "-2" + c2621.f7493);
                    }
                    if (!file2.exists()) {
                        file2 = new File("/mnt/asec/" + this.f7345 + c2621.f7493);
                    }
                    if (!file2.exists()) {
                        file2 = new File("/sd-ext/data/" + this.f7345 + c2621.f7493);
                    }
                    if (!file2.exists()) {
                        file2 = new File("/data/sdext2/" + this.f7345 + c2621.f7493);
                    }
                    if (!file2.exists()) {
                        file2 = new File("/data/sdext1/" + this.f7345 + c2621.f7493);
                    }
                    if (!file2.exists()) {
                        file2 = new File("/data/sdext/" + this.f7345 + c2621.f7493);
                    }
                    if (!file2.exists()) {
                        String m7195 = new C2500("fgh").m7195(new File("/data/data/" + this.f7345), new File(c2621.f7493).getName());
                        if (!m7195.equals("")) {
                            file2 = new File(m7195);
                        }
                    }
                    if (!file2.exists()) {
                        throw new FileNotFoundException();
                    }
                    return file2;
                }
            }
            if (c2621.f7493.startsWith("/data/data/" + this.f7345 + "/shared_prefs/")) {
                str = "/data/data/" + this.f7345 + "/shared_prefs/";
            }
            if (c2621.f7493.startsWith("/dbdata/databases/" + this.f7345 + "/shared_prefs/")) {
                str = "/dbdata/databases/" + this.f7345 + "/shared_prefs/";
            }
            if (c2621.f7493.startsWith("/shared_prefs/")) {
                str = "/shared_prefs/";
            }
            File file4 = new File(c2621.f7493.replace(str, "/data/data/" + this.f7345 + "/shared_prefs/"));
            if (!file4.exists()) {
                file2 = new File(c2621.f7493.replace(str, "/dbdata/databases/" + this.f7345 + "/shared_prefs/"));
            } else {
                file2 = file4;
            }
            if (!file2.exists()) {
                throw new FileNotFoundException();
            }
            return file2;
        }
        ArrayList arrayList = new ArrayList();
        arrayList.add("/mnt/sdcard/");
        arrayList.add("/storage/emulated/legacy/");
        arrayList.add("/storage/emulated/0/");
        arrayList.add("/storage/sdcard0/");
        arrayList.add("/storage/sdcard/");
        arrayList.add("/storage/sdcard1/");
        arrayList.add("/sdcard/");
        Iterator it = arrayList.iterator();
        while (it.hasNext()) {
            String str2 = (String) it.next();
            File file5 = new File(c2621.f7493.replace("/mnt/sdcard/", str2));
            try {
                if (file5.exists()) {
                    try {
                        new File(str2 + "test.tmp").createNewFile();
                    } catch (Exception e3) {
                        e3.printStackTrace();
                        file = new File("/figjvaja_papka");
                    }
                    if (new File(str2 + "test.tmp").exists()) {
                        new File(str2 + "test.tmp").delete();
                        file2 = file5;
                        break;
                    }
                    file = new File("/figjvaja_papka");
                    file2 = file;
                } else {
                    file2 = file5;
                }
            } catch (FileNotFoundException unused3) {
                file2 = file5;
                c2621.m7274(f7278 + " " + c2621.f7493 + " are not found!\n\nRun the application file to appear in the folder with the data.!\n");
                return file2;
            } catch (Exception e4) {
                e = e4;
                file2 = file5;
                c2621.m7274("Exception e:" + e.toString());
                return file2;
            }
        }
        if (!file2.exists()) {
            throw new FileNotFoundException();
        }
        return file2;
    }

    public void m7258(C2612 c2612, C2621 c2621) {
        try {
            if (c2612.f7438.trim().equals("*")) {
                c2612.f7448 = true;
                ArrayList<File> arrayList = new ArrayList<>();
                new C2500("").m7197(new File(this.f7328 + "/lib/"), ".so", arrayList);
                if (arrayList.size() > 0) {
                    Iterator<File> it = arrayList.iterator();
                    while (it.hasNext()) {
                        File next = it.next();
                        if (next.length() > 0) {
                            c2612.f7442.add(next);
                        }
                    }
                    return;
                }
                return;
            }
            int i = c2621.f7492;
            if (i != 2) {
                if (i != 11) {
                    if (i != 27) {
                        switch (i) {
                            case 6:
                                c2612.f7442.clear();
                                String str = this.f7328 + "/lib/armeabi/" + c2612.f7438;
                                if (new File(this.f7328 + "/lib/armeabi/" + c2612.f7438).exists()) {
                                    c2612.f7442.add(new File(str));
                                    return;
                                }
                                throw new FileNotFoundException();
                            case 7:
                                c2612.f7442.clear();
                                String str2 = this.f7328 + "/lib/armeabi-v7a/" + c2612.f7438;
                                if (new File(this.f7328 + "/lib/armeabi-v7a/" + c2612.f7438).exists()) {
                                    c2612.f7442.add(new File(str2));
                                    return;
                                }
                                throw new FileNotFoundException();
                            case 8:
                                c2612.f7442.clear();
                                String str3 = this.f7328 + "/lib/mips/" + c2612.f7438;
                                if (new File(this.f7328 + "/lib/mips/" + c2612.f7438).exists()) {
                                    c2612.f7442.add(new File(str3));
                                    return;
                                }
                                throw new FileNotFoundException();
                            case 9:
                                c2612.f7442.clear();
                                String str4 = this.f7328 + "/lib/x86/" + c2612.f7438;
                                if (new File(this.f7328 + "/lib/x86/" + c2612.f7438).exists()) {
                                    c2612.f7442.add(new File(str4));
                                    return;
                                }
                                throw new FileNotFoundException();
                            default:
                                return;
                        }
                    }
                    c2612.f7442.clear();
                    String str5 = this.f7328 + "/lib/x86_64/" + c2612.f7438;
                    if (new File(this.f7328 + "/lib/x86_64/" + c2612.f7438).exists()) {
                        c2612.f7442.add(new File(str5));
                        return;
                    }
                    throw new FileNotFoundException();
                }
                c2612.f7442.clear();
                String str6 = this.f7328 + "/lib/arm64-v8a/" + c2612.f7438;
                if (new File(this.f7328 + "/lib/arm64-v8a/" + c2612.f7438).exists()) {
                    c2612.f7442.add(new File(str6));
                    return;
                }
                throw new FileNotFoundException();
            }
            String str7 = this.f7328 + "/lib/armeabi/" + c2612.f7438;
            if (new File(str7).exists()) {
                c2612.f7442.add(new File(str7));
            }
            String str8 = this.f7328 + "/lib/armeabi-v7a/" + c2612.f7438;
            if (new File(str8).exists()) {
                c2612.f7442.add(new File(str8));
            }
            String str9 = this.f7328 + "/lib/mips/" + c2612.f7438;
            if (new File(str9).exists()) {
                c2612.f7442.add(new File(str9));
            }
            String str10 = this.f7328 + "/lib/x86/" + c2612.f7438;
            if (new File(str10).exists()) {
                c2612.f7442.add(new File(str10));
            }
            String str11 = this.f7328 + "/lib/x86_64/" + c2612.f7438;
            if (new File(str11).exists()) {
                c2612.f7442.add(new File(str11));
            }
            String str12 = this.f7328 + "/lib/arm64-v8a/" + c2612.f7438;
            if (new File(str12).exists()) {
                c2612.f7442.add(new File(str12));
            }
        } catch (FileNotFoundException e) {
            C2975.m7942(f7278 + "Lib not found!" + e.toString());
        } catch (Exception e2) {
            C2975.m7942(f7278 + "Lib select error: " + e2.toString());
        }
    }
}