Luскy*Patcher v11.1.8版本的 MD5 值为:260a307cc4cd8550bbc248b8d7c0bddc

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


package javaroot.utils;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.io.RandomAccessFile;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import net.lingala.zip4j.core.ZipFile;
import net.lingala.zip4j.exception.ZipException;
import net.lingala.zip4j.util.InternalZipConstants;
import org.jf.dexlib2.analysis.RegisterType;
import org.jf.dexlib2.dexbacked.raw.ItemType;
import p064.C2880;
import p067.C3004;
import p112.C3286;
import p112.C3348;

public class C1954 {

    public static final byte[] f5555 = {100, 101, 121, 10, 48, 51, 53, 0};

    public static String f5581 = "";

    public static boolean f5607 = false;

    public static boolean f5633 = false;

    public static MappedByteBuffer f5659 = null;

    public static int f5685 = 0;

    public static byte[] f5711 = null;

    public static byte[] f5737 = null;

    public static byte[] f5763 = null;

    public static byte[] f5789 = null;

    public static byte[] f5815 = null;

    public static byte[] f5841 = null;

    public static byte[] f5867 = null;

    public static byte[] f5893 = null;

    public static byte[] f5919 = null;

    public static byte[] f5945 = null;

    public static byte[] f5971 = null;

    public static byte[] f5997 = null;

    public static byte[] f6023 = null;

    public static byte[] f6029 = null;

    public static byte[] f6031 = null;

    public static byte[] f6033 = null;

    public static byte[] f6035 = null;

    public static byte[] f6037 = null;

    public static byte[] f6039 = null;

    public static byte[] f6040 = null;

    public static byte[] f5988 = null;

    public static byte[] f6015 = null;

    public static byte[] f5556 = null;

    public static byte[] f5610 = null;

    public static byte[] f5583 = null;

    public static byte[] f5664 = null;

    public static byte[] f5637 = null;

    public static byte[] f5934 = null;

    public static byte[] f5691 = null;

    public static byte[] f5745 = null;

    public static byte[] f5718 = null;

    public static byte[] f5799 = null;

    public static byte[] f5772 = null;

    public static byte[] f5853 = null;

    public static byte[] f5826 = null;

    public static byte[] f5880 = null;

    public static byte[] f6030 = null;

    public static byte[] f5907 = null;

    public static byte[] f6028 = null;

    public static byte[] f6032 = null;

    public static byte[] f6034 = null;

    public static byte[] f6036 = null;

    public static byte[] f5961 = null;

    public static byte[] f6038 = null;

    public static byte[] f5557 = null;

    public static byte[] f5558 = null;

    public static byte[] f5559 = null;

    public static byte[] f5560 = null;

    public static byte[] f5561 = null;

    public static byte[] f5562 = null;

    public static byte[] f5563 = null;

    public static byte[] f5564 = null;

    public static byte[] f5565 = null;

    public static byte[] f5566 = null;

    public static byte[] f5567 = null;

    public static byte[] f5568 = null;

    public static byte[] f5569 = null;

    public static byte[] f5570 = null;

    public static byte[] f5571 = null;

    public static byte[] f5572 = null;

    public static byte[] f5573 = null;

    public static byte[] f5574 = null;

    public static byte[] f5575 = null;

    public static byte[] f5576 = null;

    public static byte[] f5577 = null;

    public static byte[] f5578 = null;

    public static byte[] f5579 = null;

    public static byte[] f5580 = null;

    public static byte[] f5582 = null;

    public static byte[] f5584 = null;

    public static byte[] f5585 = null;

    public static byte[] f5586 = null;

    public static byte[] f5587 = null;

    public static byte[] f5588 = null;

    public static byte[] f5589 = null;

    public static byte[] f5590 = null;

    public static byte[] f5591 = null;

    public static byte[] f5592 = null;

    public static byte[] f5593 = null;

    public static byte[] f5594 = null;

    public static byte[] f5595 = null;

    public static byte[] f5596 = null;

    public static byte[] f5597 = null;

    public static byte[] f5598 = null;

    public static byte[] f5599 = null;

    public static byte[] f5600 = null;

    public static byte[] f5601 = null;

    public static byte[] f5602 = null;

    public static byte[] f5603 = null;

    public static byte[] f5604 = null;

    public static byte[] f5605 = null;

    public static byte[] f5606 = null;

    public static byte[] f5608 = null;

    public static byte[] f5609 = null;

    public static byte[] f5611 = null;

    public static byte[] f5612 = null;

    public static byte[] f5613 = null;

    public static byte[] f5614 = null;

    public static byte[] f5615 = null;

    public static byte[] f5616 = null;

    public static byte[] f5617 = null;

    public static byte[] f5618 = null;

    public static byte[] f5619 = null;

    public static byte[] f5620 = null;

    public static byte[] f5621 = null;

    public static byte[] f5622 = null;

    public static byte[] f5623 = null;

    public static byte[] f5624 = null;

    public static byte[] f5625 = null;

    public static byte[] f5626 = null;

    public static byte[] f5627 = null;

    public static byte[] f5628 = null;

    public static byte[] f5629 = null;

    public static byte[] f5630 = null;

    public static byte[] f5631 = null;

    public static byte[] f5632 = null;

    public static byte[] f5634 = null;

    public static byte[] f5635 = null;

    public static byte[] f5636 = null;

    public static byte[] f5638 = null;

    public static byte[] f5639 = null;

    public static byte[] f5640 = null;

    public static byte[] f5641 = null;

    public static byte[] f5642 = null;

    public static byte[] f5643 = null;

    public static byte[] f5644 = null;

    public static byte[] f5645 = null;

    public static byte[] f5646 = null;

    public static byte[] f5647 = null;

    public static byte[] f5648 = null;

    public static byte[] f5649 = null;

    public static byte[] f5650 = null;

    public static byte[] f5651 = null;

    public static byte[] f5652 = null;

    public static byte[] f5653 = null;

    public static byte[] f5654 = null;

    public static byte[] f5655 = null;

    public static byte[] f5656 = null;

    public static byte[] f5657 = null;

    public static byte[] f5658 = null;

    public static byte[] f5660 = null;

    public static byte[] f5661 = null;

    public static byte[] f5662 = null;

    public static byte[] f5663 = null;

    public static byte[] f5665 = null;

    public static byte[] f5666 = null;

    public static byte[] f5667 = null;

    public static byte[] f5668 = null;

    public static byte[] f5669 = null;

    public static byte[] f5670 = null;

    public static byte[] f5671 = null;

    public static byte[] f5672 = null;

    public static byte[] f5673 = null;

    public static byte[] f5674 = null;

    public static byte[] f5675 = null;

    public static byte[] f5676 = null;

    public static byte[] f5677 = null;

    public static byte[] f5678 = null;

    public static byte[] f5679 = null;

    public static byte[] f5680 = null;

    public static byte[] f5681 = null;

    public static byte[] f5682 = null;

    public static byte[] f5683 = null;

    public static byte[] f5684 = null;

    public static byte[] f5686 = null;

    public static byte[] f5687 = null;

    public static byte[] f5688 = null;

    public static byte[] f5689 = null;

    public static byte[] f5690 = null;

    public static byte[] f5692 = null;

    public static byte[] f5693 = null;

    public static byte[] f5694 = null;

    public static byte[] f5695 = null;

    public static byte[] f5696 = null;

    public static byte[] f5697 = null;

    public static byte[] f5698 = null;

    public static byte[] f5699 = null;

    public static byte[] f5700 = null;

    public static byte[] f5701 = null;

    public static byte[] f5702 = null;

    public static byte[] f5703 = null;

    public static byte[] f5704 = null;

    public static byte[] f5705 = null;

    public static byte[] f5706 = null;

    public static byte[] f5707 = null;

    public static byte[] f5708 = null;

    public static byte[] f5709 = null;

    public static byte[] f5710 = null;

    public static byte[] f5712 = null;

    public static byte[] f5713 = null;

    public static byte[] f5714 = null;

    public static byte[] f5715 = null;

    public static byte[] f5716 = null;

    public static byte[] f5717 = null;

    public static byte[] f5719 = null;

    public static byte[] f5720 = null;

    public static byte[] f5721 = null;

    public static byte[] f5722 = null;

    public static byte[] f5723 = null;

    public static byte[] f5724 = null;

    public static byte[] f5725 = null;

    public static byte[] f5726 = null;

    public static byte[] f5727 = null;

    public static byte[] f5728 = null;

    public static byte[] f5729 = null;

    public static byte[] f5730 = null;

    public static byte[] f5731 = null;

    public static byte[] f5732 = null;

    public static byte[] f5733 = null;

    public static byte[] f5734 = null;

    public static byte[] f5735 = null;

    public static byte[] f5736 = null;

    public static byte[] f5738 = null;

    public static byte[] f5739 = null;

    public static byte[] f5740 = null;

    public static byte[] f5741 = null;

    public static byte[] f5742 = null;

    public static byte[] f5743 = null;

    public static byte[] f5744 = null;

    public static byte[] f5746 = null;

    public static byte[] f5747 = null;

    public static byte[] f5748 = null;

    public static byte[] f5749 = null;

    public static byte[] f5750 = null;

    public static byte[] f5751 = null;

    public static byte[] f5752 = null;

    public static byte[] f5753 = null;

    public static byte[] f5754 = null;

    public static byte[] f5755 = null;

    public static byte[] f5756 = null;

    public static byte[] f5757 = null;

    public static byte[] f5758 = null;

    public static byte[] f5759 = null;

    public static byte[] f5760 = null;

    public static byte[] f5761 = null;

    public static byte[] f5762 = null;

    public static byte[] f5764 = null;

    public static byte[] f5765 = null;

    public static byte[] f5766 = null;

    public static byte[] f5767 = null;

    public static byte[] f5768 = null;

    public static byte[] f5769 = null;

    public static byte[] f5770 = null;

    public static byte[] f5771 = null;

    public static byte[] f5773 = null;

    public static byte[] f5774 = null;

    public static byte[] f5775 = null;

    public static byte[] f5776 = null;

    public static byte[] f5777 = null;

    public static byte[] f5778 = null;

    public static byte[] f5779 = null;

    public static byte[] f5780 = null;

    public static byte[] f5781 = null;

    public static byte[] f5782 = null;

    public static byte[] f5783 = null;

    public static byte[] f5784 = null;

    public static byte[] f5785 = null;

    public static byte[] f5786 = null;

    public static byte[] f5787 = null;

    public static byte[] f5788 = null;

    public static byte[] f5790 = null;

    public static byte[] f5791 = null;

    public static byte[] f5792 = null;

    public static byte[] f5793 = null;

    public static byte[] f5794 = null;

    public static byte[] f5795 = null;

    public static byte[] f5796 = null;

    public static byte[] f5797 = null;

    public static byte[] f5798 = null;

    public static byte[] f5800 = null;

    public static byte[] f5801 = null;

    public static byte[] f5802 = null;

    public static byte[] f5803 = null;

    public static byte[] f5804 = null;

    public static byte[] f5805 = null;

    public static byte[] f5806 = null;

    public static byte[] f5807 = null;

    public static byte[] f5808 = null;

    public static byte[] f5809 = null;

    public static byte[] f5810 = null;

    public static byte[] f5811 = null;

    public static byte[] f5812 = null;

    public static byte[] f5813 = null;

    public static byte[] f5814 = null;

    public static byte[] f5816 = null;

    public static byte[] f5817 = null;

    public static byte[] f5818 = null;

    public static byte[] f5819 = null;

    public static byte[] f5820 = null;

    public static byte[] f5821 = null;

    public static byte[] f5822 = null;

    public static byte[] f5823 = null;

    public static byte[] f5824 = null;

    public static byte[] f5825 = null;

    public static byte[] f5827 = null;

    public static byte[] f5828 = null;

    public static byte[] f5829 = null;

    public static byte[] f5830 = null;

    public static byte[] f5831 = null;

    public static byte[] f5832 = null;

    public static byte[] f5833 = null;

    public static byte[] f5834 = null;

    public static byte[] f5835 = null;

    public static byte[] f5836 = null;

    public static byte[] f5837 = null;

    public static byte[] f5838 = null;

    public static byte[] f5839 = null;

    public static byte[] f5840 = null;

    public static byte[] f5842 = null;

    public static byte[] f5843 = null;

    public static byte[] f5844 = null;

    public static byte[] f5845 = null;

    public static byte[] f5846 = null;

    public static byte[] f5847 = null;

    public static byte[] f5848 = null;

    public static byte[] f5849 = null;

    public static byte[] f5850 = null;

    public static byte[] f5851 = null;

    public static byte[] f5852 = null;

    public static byte[] f5854 = null;

    public static byte[] f5855 = null;

    public static byte[] f5856 = null;

    public static byte[] f5857 = null;

    public static byte[] f5858 = null;

    public static byte[] f5859 = null;

    public static byte[] f5860 = null;

    public static byte[] f5861 = null;

    public static byte[] f5862 = null;

    public static byte[] f5863 = null;

    public static byte[] f5864 = null;

    public static byte[] f5865 = null;

    public static byte[] f5866 = null;

    public static byte[] f5868 = null;

    public static byte[] f5869 = null;

    public static byte[] f5870 = null;

    public static byte[] f5871 = null;

    public static byte[] f5872 = null;

    public static byte[] f5873 = null;

    public static byte[] f5874 = null;

    public static byte[] f5875 = null;

    public static byte[] f5876 = null;

    public static byte[] f5877 = null;

    public static byte[] f5878 = null;

    public static byte[] f5879 = null;

    public static byte[] f5881 = null;

    public static byte[] f5882 = null;

    public static byte[] f5883 = null;

    public static byte[] f5884 = null;

    public static byte[] f5885 = null;

    public static byte[] f5886 = null;

    public static byte[] f5887 = null;

    public static byte[] f5888 = null;

    public static byte[] f5889 = null;

    public static byte[] f5890 = null;

    public static byte[] f5891 = null;

    public static byte[] f5892 = null;

    public static byte[] f5894 = null;

    public static byte[] f5895 = null;

    public static byte[] f5896 = null;

    public static byte[] f5897 = null;

    public static byte[] f5898 = null;

    public static byte[] f5899 = null;

    public static byte[] f5900 = null;

    public static byte[] f5901 = null;

    public static byte[] f5902 = null;

    public static byte[] f5903 = null;

    public static byte[] f5904 = null;

    public static byte[] f5905 = null;

    public static byte[] f5906 = null;

    public static byte[] f5908 = null;

    public static byte[] f5909 = null;

    public static byte[] f5910 = null;

    public static byte[] f5911 = null;

    public static byte[] f5912 = null;

    public static byte[] f5913 = null;

    public static byte[] f5914 = null;

    public static byte[] f5915 = null;

    public static byte[] f5916 = null;

    public static byte[] f5917 = null;

    public static byte[] f5918 = null;

    public static byte[] f5920 = null;

    public static byte[] f5921 = null;

    public static byte[] f5922 = null;

    public static byte[] f5923 = null;

    public static byte[] f5924 = null;

    public static byte[] f5925 = null;

    public static byte[] f5926 = null;

    public static byte[] f5927 = null;

    public static byte[] f5928 = null;

    public static byte[] f5929 = null;

    public static byte[] f5930 = null;

    public static byte[] f5931 = null;

    public static byte[] f5932 = null;

    public static byte[] f5933 = null;

    public static byte[] f5935 = null;

    public static byte[] f5936 = null;

    public static byte[] f5937 = null;

    public static byte[] f5938 = null;

    public static byte[] f5939 = null;

    public static byte[] f5940 = null;

    public static byte[] f5941 = null;

    public static byte[] f5942 = null;

    public static byte[] f5943 = null;

    public static byte[] f5944 = null;

    public static byte[] f5946 = null;

    public static byte[] f5947 = null;

    public static byte[] f5948 = null;

    public static byte[] f5949 = null;

    public static byte[] f5950 = null;

    public static byte[] f5951 = null;

    public static byte[] f5952 = null;

    public static byte[] f5953 = null;

    public static byte[] f5954 = null;

    public static byte[] f5955 = null;

    public static byte[] f5956 = null;

    public static byte[] f5957 = null;

    public static byte[] f5958 = null;

    public static byte[] f5959 = null;

    public static byte[] f5960 = null;

    public static byte[] f5962 = null;

    public static byte[] f5963 = null;

    public static byte[] f5964 = null;

    public static byte[] f5965 = null;

    public static byte[] f5966 = null;

    public static byte[] f5967 = null;

    public static byte[] f5968 = null;

    public static byte[] f5969 = null;

    public static byte[] f5970 = null;

    public static byte[] f5972 = null;

    public static byte[] f5973 = null;

    public static byte[] f5974 = null;

    public static byte[] f5975 = null;

    public static byte[] f5976 = null;

    public static byte[] f5977 = null;

    public static byte[] f5978 = null;

    public static byte[] f5979 = null;

    public static byte[] f5980 = null;

    public static byte[] f5981 = null;

    public static byte[] f5982 = null;

    public static byte[] f5983 = null;

    public static byte[] f5984 = null;

    public static byte[] f5985 = null;

    public static byte[] f5986 = null;

    public static byte[] f5987 = null;

    public static byte[] f5989 = null;

    public static byte[] f5990 = null;

    public static byte[] f5991 = null;

    public static byte[] f5992 = null;

    public static byte[] f5993 = null;

    public static byte[] f5994 = null;

    public static byte[] f5995 = null;

    public static byte[] f5996 = null;

    public static byte[] f5998 = null;

    public static byte[] f5999 = null;

    public static byte[] f6000 = null;

    public static byte[] f6001 = null;

    public static byte[] f6002 = null;

    public static byte[] f6003 = null;

    public static byte[] f6004 = null;

    public static byte[] f6005 = null;

    public static byte[] f6006 = null;

    public static byte[] f6007 = null;

    public static byte[] f6008 = null;

    public static byte[] f6009 = null;

    public static byte[] f6010 = null;

    public static byte[] f6011 = null;

    public static byte[] f6012 = null;

    public static byte[] f6013 = null;

    public static byte[] f6014 = null;

    public static byte[] f6016 = null;

    public static byte[] f6017 = null;

    public static byte[] f6018 = null;

    public static byte[] f6019 = null;

    public static boolean f6020 = false;

    public static boolean f6021 = false;

    public static boolean f6022 = false;

    public static boolean f6024 = false;

    public static boolean f6025 = false;

    public static boolean f6026 = false;

    public static ArrayList<C3004> f6027 = null;

    public class C1955 extends ArrayList<C3004> {
        C1955() {
            add(new C3004(C1954.f5566, null, C1954.f5568, null, "", false));
            add(new C3004(C1954.f5570, null, C1954.f5572, null, "", false));
            add(new C3004(C1954.f5574, null, C1954.f5576, null, "", false));
            add(new C3004(C1954.f5578, null, C1954.f5580, null, "", false));
            add(new C3004(C1954.f5584, null, C1954.f5586, null, "", false));
            add(new C3004(C1954.f5640, null, C1954.f5642, null, "", false));
            add(new C3004(C1954.f5644, null, C1954.f5646, null, "", false));
            add(new C3004(C1954.f5666, null, C1954.f5668, null, "", false));
        }
    }

    public class C1956 extends ArrayList<String> {
        C1956() {
            add("boolean android.content.pm.PackageParser$SigningDetails.checkCapability(android.content.pm.PackageParser$SigningDetails, int)");
        }
    }

    public class C1957 extends ArrayList<String> {
        C1957() {
            add("boolean java.security.Signature.verify(byte[])");
            add("boolean java.security.Signature.verify(byte[], int, int)");
        }
    }

    class C1958 {
        C1958() {
        }
    }

    class C1959 extends ArrayList<C3004> {
        C1959() {
            add(new C3004(C1954.f5745, null, C1954.f5799, null, "", false));
            add(new C3004(C1954.f5853, null, C1954.f5880, null, "", false));
            add(new C3004(C1954.f5907, null, C1954.f6032, null, "", false));
            add(new C3004(C1954.f6036, null, C1954.f6038, null, "", false));
            add(new C3004(C1954.f5558, null, C1954.f5560, null, "", false));
            add(new C3004(C1954.f5562, null, C1954.f5564, null, "", false));
            add(new C3004(C1954.f5626, null, C1954.f5628, null, "", false));
            add(new C3004(C1954.f5630, null, C1954.f5632, null, "", false));
            add(new C3004(C1954.f5635, null, C1954.f5638, null, "", false));
            add(new C3004(C1954.f5661, null, C1954.f5663, null, "", false));
        }
    }

    public class C1960 extends ArrayList<String> {
        C1960() {
            add("boolean com.android.org.conscrypt.OpenSSLSignature.engineVerify(byte[])");
        }
    }

    public class C1961 extends ArrayList<String> {

        final boolean f6041;

        final boolean f6042;

        final boolean f6043;

        C1961(boolean z, boolean z2, boolean z3) {
            this.f6041 = z;
            this.f6042 = z2;
            this.f6043 = z3;
            if (z) {
                add("boolean java.security.MessageDigest.isEqual(byte[], byte[])");
            }
            if (!z2 && z3) {
                add("boolean com.android.org.conscrypt.OpenSSLSignature.engineVerify(byte[])");
            }
        }
    }

    public class C1962 extends ArrayList<C3004> {
        C1962() {
            add(new C3004(C1954.f5737, null, C1954.f5789, null, "", false));
            add(new C3004(C1954.f5841, null, C1954.f5893, null, "", false));
            add(new C3004(C1954.f5945, null, C1954.f5997, null, "", false));
            add(new C3004(C1954.f5600, null, C1954.f5602, null, "", false));
            add(new C3004(C1954.f5604, null, C1954.f5606, null, "", false));
            add(new C3004(C1954.f5609, null, C1954.f5612, null, "", false));
            add(new C3004(C1954.f5614, null, C1954.f5616, null, "", false));
            add(new C3004(C1954.f5648, null, C1954.f5650, null, "", false));
            add(new C3004(C1954.f5652, null, C1954.f5654, null, "", false));
            add(new C3004(C1954.f5670, null, C1954.f5672, null, "", false));
        }
    }

    public class C1963 extends ArrayList<String> {

        final boolean f6044;

        final boolean f6045;

        final boolean f6046;

        C1963(boolean z, boolean z2, boolean z3) {
            this.f6044 = z;
            this.f6045 = z2;
            this.f6046 = z3;
            if (z) {
                add("boolean java.security.MessageDigest.isEqual(byte[], byte[])");
            }
            if (!z2 && z3) {
                add("boolean com.android.org.conscrypt.OpenSSLSignature.engineVerify(byte[])");
            }
        }
    }

    public class C1964 extends ArrayList<C3004> {
        C1964() {
            add(new C3004(C1954.f5737, null, C1954.f5789, null, "", false));
            add(new C3004(C1954.f5841, null, C1954.f5893, null, "", false));
            add(new C3004(C1954.f5945, null, C1954.f5997, null, "", false));
            add(new C3004(C1954.f5600, null, C1954.f5602, null, "", false));
            add(new C3004(C1954.f5604, null, C1954.f5606, null, "", false));
            add(new C3004(C1954.f5609, null, C1954.f5612, null, "", false));
            add(new C3004(C1954.f5614, null, C1954.f5616, null, "", false));
            add(new C3004(C1954.f5648, null, C1954.f5650, null, "", false));
            add(new C3004(C1954.f5652, null, C1954.f5654, null, "", false));
            add(new C3004(C1954.f5670, null, C1954.f5672, null, "", false));
        }
    }

    public class C1965 extends ArrayList<String> {
        C1965() {
            add("int com.android.server.pm.PackageManagerServiceUtils.compareSignatures(android.content.pm.Signature[], android.content.pm.Signature[])");
            add("int com.android.server.pm.PackageManagerService.compareSignatures(android.content.pm.Signature[], android.content.pm.Signature[])");
            add("void com.android.server.pm.PackageManagerService.checkDowngrade(android.content.pm.PackageParser$Package, android.content.pm.PackageInfoLite)");
            add("android.content.pm.PackageParser$Package com.android.server.pm.PackageManagerService.scanPackageDirtyLI(android.content.pm.PackageParser$Package, int, int, long, android.os.UserHandle)");
        }
    }

    public class C1966 extends ArrayList<C3004> {
        C1966() {
            add(new C3004(C1954.f6029, null, C1954.f6033, null, "", false));
            add(new C3004(C1954.f6037, null, C1954.f6040, null, "", false));
            add(new C3004(C1954.f6015, null, C1954.f5610, null, "", false));
            add(new C3004(C1954.f5664, null, C1954.f5934, null, "", false));
            add(new C3004(C1954.f5622, null, C1954.f5624, null, "", false));
            add(new C3004(C1954.f5618, null, C1954.f5620, null, "", false));
            add(new C3004(C1954.f5656, null, C1954.f5658, null, "", false));
        }
    }

    public static void main(String[] strArr) {
        boolean z;
        boolean z2;
        boolean z3;
        boolean z4;
        boolean z5;
        String str;
        boolean z6;
        ArrayList arrayList;
        String str2;
        ?? r33;
        Exception exc;
        FileNotFoundException fileNotFoundException;
        ArrayList arrayList2;
        ArrayList arrayList3;
        ?? contains;
        ArrayList arrayList4;
        boolean z7;
        Iterator it;
        ArrayList arrayList5;
        File file;
        Exception exc2;
        boolean z8;
        FileChannel fileChannel;
        int position;
        boolean z9;
        String str3;
        String str4;
        String str5;
        String str6;
        String str7;
        File file2;
        Exception exc3;
        char c;
        int i;
        ArrayList arrayList6;
        int i2;
        String str8;
        String str9;
        Exception exc4;
        boolean z10;
        boolean z11;
        String str10;
        String str11;
        String str12;
        String str13;
        String str14;
        String str15;
        boolean z12;
        String str16;
        String str17;
        String str18;
        String str19;
        String str20;
        ArrayList arrayList7;
        String str21;
        Iterator it2;
        Iterator it3;
        String str22;
        String str23;
        String str24;
        boolean z13;
        Exception exc5;
        String str25;
        String str26;
        String str27;
        String str28;
        String str29;
        String str30;
        Exception exc6;
        String[] strArr2;
        boolean z14;
        int i3;
        int position2;
        byte b;
        String str31;
        StringBuilder sb;
        boolean z15;
        FileChannel fileChannel2;
        String str32;
        Exception exc7;
        boolean z16;
        C2880.m11554(new C1958());
        try {
            System.out.println(strArr[0]);
            System.out.println(strArr[1]);
            System.out.println(strArr[2]);
            System.out.println(strArr[3]);
            System.out.println(strArr[4]);
            String str33 = strArr[4];
            if (str33 != null && str33.equals("OnlyDalvik")) {
                f5607 = true;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        String str34 = strArr[3];
        if (str34 != null) {
            f5581 = str34;
        }
        if (!strArr[4].equals("framework") && !strArr[4].equals("OnlyDalvik")) {
            C2880.m11492("/system", InternalZipConstants.WRITE_MODE);
        }
        if ((strArr[1].contains("core.odex") || strArr[1].contains("core.jar") || strArr[1].contains("core-libart.jar") || strArr[1].contains("conscrypt.jar") || strArr[1].contains("core-oj.jar") || strArr[1].contains("boot.oat") || strArr[1].contains("core-libart.odex")) && strArr[4].equals("framework")) {
            if (strArr[1].contains("core-oj.jar")) {
                z = false;
            } else if (strArr[1].contains("conscrypt.jar")) {
                z = true;
                z2 = false;
                C3348.f9948 = Boolean.FALSE;
                strArr[0] = "patch";
                new C1983();
            } else {
                z = true;
            }
            z2 = true;
            C3348.f9948 = Boolean.FALSE;
            strArr[0] = "patch";
            new C1983();
        } else {
            z = false;
            z2 = false;
        }
        if ((strArr[1].contains("services.jar") || strArr[1].contains("services.odex")) && strArr[4].equals("framework")) {
            C3348.f9948 = Boolean.FALSE;
            strArr[0] = "patch";
            new C1983();
            z3 = true;
        } else {
            z3 = false;
        }
        if (strArr[0].contains("patch")) {
            if (strArr[0].contains("_patch1")) {
                z = true;
            }
            if (strArr[0].contains("_patch2")) {
                z2 = true;
            }
            if (strArr[0].contains("_patch3")) {
                z3 = true;
            }
            z4 = strArr[0].contains("_patch4");
            new C1983();
        } else {
            z4 = false;
        }
        if (strArr[0].contains("restore")) {
            if (strArr[0].contains("restoreCore")) {
                z = true;
                z2 = true;
            }
            if (strArr[0].contains("restoreServices")) {
                z3 = true;
                z4 = true;
            }
            new C1986();
        }
        f6027 = new C1959();
        if (strArr[0].contains("restore") || strArr[0].contains("patch") || strArr[0].contains("all")) {
            ArrayList arrayList8 = new ArrayList();
            arrayList8.clear();
            String str35 = "";
            if (z || z2) {
                ArrayList arrayList9 = new ArrayList();
                String str36 = "Oat Core1uni patched!\n";
                String str37 = "Oat Core1uni restored!\n";
                String str38 = "Oat Core2 restored!\n";
                String str39 = "Oat Core2 patched!\n";
                z5 = z4;
                try {
                    try {
                        try {
                            if (strArr[4].equals("framework")) {
                                str = "Oat Core1uni restored!\n";
                                z6 = z3;
                                arrayList = arrayList8;
                            } else {
                                if (f5607) {
                                    z6 = z3;
                                    arrayList = arrayList8;
                                    String[] strArr3 = {"/data/dalvik-cache/x86/system@framework@boot.oat", "/data/dalvik-cache/x86_64/system@framework@boot.oat", "/data/dalvik-cache/arm64/system@framework@boot.oat", "/data/dalvik-cache/arm/system@framework@boot.oat", "/data/dalvik-cache/oat/x86/system@framework@boot.oat", "/data/dalvik-cache/oat/x86_64/system@framework@boot.oat", "/data/dalvik-cache/oat/arm64/system@framework@boot.oat", "/data/dalvik-cache/oat/arm/system@framework@boot.oat", "/data/dalvik-cache/x86/system@framework@boot-conscrypt.oat", "/data/dalvik-cache/x86_64/system@framework@boot-conscrypt.oat", "/data/dalvik-cache/arm64/system@framework@boot-conscrypt.oat", "/data/dalvik-cache/arm/system@framework@boot-conscrypt.oat", "/data/dalvik-cache/oat/x86/system@framework@boot-conscrypt.oat", "/data/dalvik-cache/oat/x86_64/system@framework@boot-conscrypt.oat", "/data/dalvik-cache/oat/arm64/system@framework@boot-conscrypt.oat", "/data/dalvik-cache/oat/arm/system@framework@boot-conscrypt.oat", "/data/dalvik-cache/x86/system@framework@boot-core-oj.oat", "/data/dalvik-cache/x86_64/system@framework@boot-core-oj.oat", "/data/dalvik-cache/arm64/system@framework@boot-core-oj.oat", "/data/dalvik-cache/arm/system@framework@boot-core-oj.oat", "/data/dalvik-cache/oat/x86/system@framework@boot-core-oj.oat", "/data/dalvik-cache/oat/x86_64/system@framework@boot-core-oj.oat", "/data/dalvik-cache/oat/arm64/system@framework@boot-core-oj.oat", "/data/dalvik-cache/oat/arm/system@framework@boot-core-oj.oat"};
                                    int i4 = 0;
                                    for (int i5 = 24; i4 < i5; i5 = 24) {
                                        String str40 = strArr3[i4];
                                        String[] strArr4 = strArr3;
                                        if (new File(str40).exists()) {
                                            arrayList9.add(new File(str40));
                                            try {
                                                if (!C2880.m11414(str40).equals("")) {
                                                    C2880.m11492("/system", "RW");
                                                }
                                            } catch (Throwable th) {
                                                th.printStackTrace();
                                            }
                                        }
                                        i4++;
                                        strArr3 = strArr4;
                                    }
                                } else {
                                    z6 = z3;
                                    String[] strArr5 = {"/system/framework/x86/boot.oat", "/system/framework/x86_64/boot.oat", "/system/framework/arm64/boot.oat", "/system/framework/arm/boot.oat", "/system/framework/oat/x86/boot.oat", "/system/framework/oat/x86_64/boot.oat", "/system/framework/oat/arm64/boot.oat", "/system/framework/oat/arm/boot.oat", "/system/framework/x86/boot-conscrypt.oat", "/system/framework/x86_64/boot-conscrypt.oat", "/system/framework/arm64/boot-conscrypt.oat", "/system/framework/arm/boot-conscrypt.oat", "/system/framework/oat/x86/boot-conscrypt.oat", "/system/framework/oat/x86_64/boot-conscrypt.oat", "/system/framework/oat/arm64/boot-conscrypt.oat", "/system/framework/oat/arm/boot-conscrypt.oat", "/system/framework/x86/boot-core-oj.oat", "/system/framework/x86_64/boot-core-oj.oat", "/system/framework/arm64/boot-core-oj.oat", "/system/framework/arm/boot-core-oj.oat", "/system/framework/oat/x86/boot-core-oj.oat", "/system/framework/oat/x86_64/boot-core-oj.oat", "/system/framework/oat/arm64/boot-core-oj.oat", "/system/framework/oat/arm/boot-core-oj.oat"};
                                    arrayList = arrayList8;
                                    int i6 = 0;
                                    for (int i7 = 24; i6 < i7; i7 = 24) {
                                        String str41 = strArr5[i6];
                                        String[] strArr6 = strArr5;
                                        if (new File(str41).exists()) {
                                            arrayList9.add(new File(str41));
                                            try {
                                                if (!C2880.m11414(str41).equals("")) {
                                                    C2880.m11492("/system", "RW");
                                                }
                                            } catch (Throwable th2) {
                                                th2.printStackTrace();
                                            }
                                        }
                                        i6++;
                                        strArr5 = strArr6;
                                    }
                                }
                                System.out.println("check cache");
                                if (arrayList9.size() > 0 && C3348.f9924 >= 24) {
                                    C2880.m11492("/system", "RW");
                                    System.out.println("found cache android 7");
                                    if (z2) {
                                        m8655(strArr, z2);
                                    }
                                    m8654(arrayList9, strArr, z, z2);
                                }
                                if (arrayList9.size() <= 0 || (i = C3348.f9924) < 21 || i > 23) {
                                    str = "Oat Core1uni restored!\n";
                                } else {
                                    System.out.println("found cache");
                                    if (z2) {
                                        m8655(strArr, z2);
                                    }
                                    m8654(arrayList9, strArr, z, z2);
                                    if ((!z || f6021) && (!z2 || f6022)) {
                                        str = "Oat Core1uni restored!\n";
                                        arrayList6 = arrayList9;
                                        str2 = "";
                                        i2 = 0;
                                    } else {
                                        if (f6021) {
                                            z = false;
                                        }
                                        if (f6022) {
                                            z2 = false;
                                        }
                                        Iterator it4 = arrayList9.iterator();
                                        i2 = 0;
                                        while (it4.hasNext()) {
                                            File file3 = (File) it4.next();
                                            int i8 = i2 + 1;
                                            Iterator it5 = it4;
                                            PrintStream printStream = System.out;
                                            StringBuilder sb2 = new StringBuilder();
                                            ArrayList arrayList10 = arrayList9;
                                            sb2.append("oat file for patch:");
                                            sb2.append(file3.getAbsolutePath());
                                            printStream.println(sb2.toString());
                                            try {
                                                long currentTimeMillis = System.currentTimeMillis();
                                                FileChannel channel = new RandomAccessFile(file3, InternalZipConstants.WRITE_MODE).getChannel();
                                                str9 = str35;
                                                try {
                                                    MappedByteBuffer map = channel.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel.size());
                                                    f5659 = map;
                                                    map.position(4120);
                                                    int m11592 = C2880.m11592(f5659.get(), f5659.get(), f5659.get(), f5659.get());
                                                    System.out.println("Start position:" + m11592);
                                                    f5659.position(m11592);
                                                    boolean z17 = false;
                                                    boolean z18 = false;
                                                    boolean z19 = false;
                                                    boolean z20 = false;
                                                    r33 = r33;
                                                    while (true) {
                                                        try {
                                                            if (!f5659.hasRemaining()) {
                                                                str8 = str37;
                                                                break;
                                                            }
                                                            boolean z21 = z17;
                                                            int position3 = f5659.position();
                                                            byte b2 = f5659.get();
                                                            boolean z22 = z;
                                                            if (m8653(position3, b2, f5678, f5679, f5680, f5681, z22)) {
                                                                try {
                                                                    if (strArr[0].contains("patch")) {
                                                                        System.out.println("position:" + position3);
                                                                        System.out.println("Oat Core1uni patched!\n");
                                                                    }
                                                                    if (strArr[0].contains("restore")) {
                                                                        System.out.println(str37);
                                                                    }
                                                                    f6020 = true;
                                                                    z18 = true;
                                                                    z19 = true;
                                                                    z21 = true;
                                                                } catch (Exception e2) {
                                                                    exc4 = e2;
                                                                    str8 = str37;
                                                                    r33 = z22;
                                                                    try {
                                                                        System.out.println(str9 + exc4);
                                                                        channel.close();
                                                                        System.out.println("time=" + (System.currentTimeMillis() - currentTimeMillis));
                                                                    } catch (IOException e3) {
                                                                        e = e3;
                                                                        e.printStackTrace();
                                                                        str35 = str9;
                                                                        it4 = it5;
                                                                        i2 = i8;
                                                                        arrayList9 = arrayList10;
                                                                        str37 = str8;
                                                                    }
                                                                    str35 = str9;
                                                                    it4 = it5;
                                                                    i2 = i8;
                                                                    arrayList9 = arrayList10;
                                                                    str37 = str8;
                                                                }
                                                            }
                                                            if (m8653(position3, b2, f5682, f5683, f5684, f5686, z)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("position:" + position3);
                                                                    System.out.println("Oat Core1uni patched!\n");
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str37);
                                                                }
                                                                f6020 = true;
                                                                z18 = true;
                                                                z19 = true;
                                                                z21 = true;
                                                            }
                                                            if (m8653(position3, b2, f5687, f5688, f5689, f5690, z)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    z10 = z19;
                                                                    System.out.println("position:" + position3);
                                                                    System.out.println("Oat Core11 patched!\n");
                                                                } else {
                                                                    z10 = z19;
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println("Oat Core11 restored!\n");
                                                                }
                                                                f6021 = true;
                                                                z18 = true;
                                                            } else {
                                                                z10 = z19;
                                                            }
                                                            if (m8653(position3, b2, f5708, f5709, f5710, f5712, z)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("position:" + position3);
                                                                    System.out.println("Oat Core1uni patched!\n");
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str37);
                                                                }
                                                                f6021 = true;
                                                                z18 = true;
                                                                z21 = true;
                                                                z10 = true;
                                                            }
                                                            if (m8653(position3, b2, f5713, f5714, f5715, f5716, z)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("position:" + position3);
                                                                    System.out.println("Oat Core1uni patched!\n");
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str37);
                                                                }
                                                                f6021 = true;
                                                                z18 = true;
                                                                z21 = true;
                                                                z10 = true;
                                                            }
                                                            if (m8653(position3, b2, f5717, f5719, f5720, f5721, z)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("position:" + position3);
                                                                    System.out.println("Oat Core1uni patched!\n");
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str37);
                                                                }
                                                                f6021 = true;
                                                                z18 = true;
                                                                z21 = true;
                                                                z10 = true;
                                                            }
                                                            if (m8653(position3, b2, f5722, f5723, f5724, f5725, z)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("position:" + position3);
                                                                    System.out.println("Oat Core1uni patched!\n");
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str37);
                                                                }
                                                                f6021 = true;
                                                                z18 = true;
                                                                z21 = true;
                                                                z10 = true;
                                                            }
                                                            if (m8653(position3, b2, f5726, f5727, f5728, f5729, z)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("position:" + position3);
                                                                    System.out.println("Oat Core11 patched!\n");
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println("Oat Core11 restored!\n");
                                                                }
                                                                f6021 = true;
                                                                z18 = true;
                                                            }
                                                            if (m8653(position3, b2, f5692, f5693, f5694, f5695, z)) {
                                                                z11 = z20;
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("Oat Core12 patched!\n");
                                                                    System.out.println("position:" + position3);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println("Oat Core12 restored!\n");
                                                                }
                                                                f6022 = true;
                                                                z10 = true;
                                                            } else {
                                                                z11 = z20;
                                                            }
                                                            if (m8653(position3, b2, f5730, f5731, f5732, f5733, z)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("Oat Core12 patched!\n");
                                                                    System.out.println("position:" + position3);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println("Oat Core12 restored!\n");
                                                                }
                                                                f6022 = true;
                                                                z19 = true;
                                                            } else {
                                                                z19 = z10;
                                                            }
                                                            r33 = z2;
                                                            if (m8653(position3, b2, f5696, f5697, f5698, f5699, r33)) {
                                                                str8 = str37;
                                                                try {
                                                                    if (strArr[0].contains("patch")) {
                                                                        System.out.println("Oat Core2 patched!\n");
                                                                        System.out.println("position:" + position3);
                                                                    }
                                                                    if (strArr[0].contains("restore")) {
                                                                        System.out.println("Oat Core2 restored!\n");
                                                                    }
                                                                    f6024 = true;
                                                                    z11 = true;
                                                                } catch (Exception e4) {
                                                                    e = e4;
                                                                    exc4 = e;
                                                                    r33 = r33;
                                                                    System.out.println(str9 + exc4);
                                                                    channel.close();
                                                                    System.out.println("time=" + (System.currentTimeMillis() - currentTimeMillis));
                                                                    str35 = str9;
                                                                    it4 = it5;
                                                                    i2 = i8;
                                                                    arrayList9 = arrayList10;
                                                                    str37 = str8;
                                                                }
                                                            } else {
                                                                str8 = str37;
                                                            }
                                                            if (m8653(position3, b2, f5700, f5701, f5702, f5703, z2)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("Oat Core2 patched!\n");
                                                                    System.out.println("position:" + position3);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println("Oat Core2 restored!\n");
                                                                }
                                                                f6024 = true;
                                                                z11 = true;
                                                            }
                                                            if (m8653(position3, b2, f5704, f5705, f5706, f5707, z2)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("Oat Core2 patched!\n");
                                                                    System.out.println("position:" + position3);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println("Oat Core2 restored!\n");
                                                                }
                                                                f6024 = true;
                                                                z11 = true;
                                                            }
                                                            if (m8653(position3, b2, f5734, f5735, f5736, f5738, z2)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("Oat Core2 patched!\n");
                                                                    System.out.println("position:" + position3);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println("Oat Core2 restored!\n");
                                                                }
                                                                f6024 = true;
                                                                z11 = true;
                                                            }
                                                            if (m8653(position3, b2, f5739, f5740, f5741, f5742, z2)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("Oat Core2 patched!\n");
                                                                    System.out.println("position:" + position3);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println("Oat Core2 restored!\n");
                                                                }
                                                                f6024 = true;
                                                                z11 = true;
                                                            }
                                                            if (m8653(position3, b2, f5743, f5744, f5746, f5747, z2)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("Oat Core2 patched!\n");
                                                                    System.out.println("position:" + position3);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println("Oat Core2 restored!\n");
                                                                }
                                                                f6024 = true;
                                                                z11 = true;
                                                            }
                                                            r33 = z2;
                                                            if (m8653(position3, b2, f5748, f5749, f5750, f5751, r33)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("Oat Core2 patched!\n");
                                                                    System.out.println("position:" + position3);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println("Oat Core2 restored!\n");
                                                                }
                                                                f6024 = true;
                                                                z20 = true;
                                                            } else {
                                                                z20 = z11;
                                                            }
                                                            if ((z && z2 && z21 && z20) || ((z && z2 && z21 && z18 && z19 && z20) || ((z && !z2 && z21) || ((z && !z2 && z21 && z18 && z19) || (!z && z2 && z20))))) {
                                                                break;
                                                            }
                                                            f5659.position(position3 + 1);
                                                            z17 = z21;
                                                            str37 = str8;
                                                            r33 = r33;
                                                        } catch (Exception e5) {
                                                            e = e5;
                                                            str8 = str37;
                                                        }
                                                    }
                                                    channel.close();
                                                    System.out.println("time=" + (System.currentTimeMillis() - currentTimeMillis));
                                                } catch (IOException e6) {
                                                    e = e6;
                                                    str8 = str37;
                                                }
                                            } catch (IOException e7) {
                                                e = e7;
                                                str8 = str37;
                                                str9 = str35;
                                            }
                                            str35 = str9;
                                            it4 = it5;
                                            i2 = i8;
                                            arrayList9 = arrayList10;
                                            str37 = str8;
                                        }
                                        str = str37;
                                        arrayList6 = arrayList9;
                                        str2 = str35;
                                    }
                                    if ((f6020 || f6021 || f6022 || f6024) && i2 == arrayList6.size()) {
                                        if (!f5607) {
                                            new File("/data/dalvik-cache/arm/system@framework@boot.oat").delete();
                                            new File("/data/dalvik-cache/arm/system@framework@boot.art").delete();
                                            new File("/data/dalvik-cache/arm64/system@framework@boot.oat").delete();
                                            new File("/data/dalvik-cache/arm64/system@framework@boot.art").delete();
                                            new File("/data/dalvik-cache/x86/system@framework@boot.oat").delete();
                                            new File("/data/dalvik-cache/x86/system@framework@boot.art").delete();
                                            new File("/data/dalvik-cache/x86_64/system@framework@boot.oat").delete();
                                            new File("/data/dalvik-cache/x86_64/system@framework@boot.art").delete();
                                            new File("/data/dalvik-cache/oat/arm/system@framework@boot.oat").delete();
                                            new File("/data/dalvik-cache/oat/arm/system@framework@boot.art").delete();
                                            new File("/data/dalvik-cache/oat/arm64/system@framework@boot.oat").delete();
                                            new File("/data/dalvik-cache/oat/arm64/system@framework@boot.art").delete();
                                            new File("/data/dalvik-cache/oat/x86/system@framework@boot.oat").delete();
                                            new File("/data/dalvik-cache/oat/x86/system@framework@boot.art").delete();
                                            new File("/data/dalvik-cache/oat/x86_64/system@framework@boot.oat").delete();
                                            new File("/data/dalvik-cache/oat/x86_64/system@framework@boot.art").delete();
                                        }
                                        System.out.println("patched cache " + C3348.f9875 + "/reboot");
                                        C2880.m11487();
                                        C2880.m11316();
                                    }
                                    contains = strArr[4].contains("framework");
                                    String str42 = "/system/framework/core-libart.jar";
                                    if (contains == 0) {
                                        try {
                                            if (!strArr[1].contains("core.jar")) {
                                                if (!strArr[1].contains("core-libart.jar")) {
                                                    if (!strArr[1].contains("core-oj.jar")) {
                                                        if (strArr[1].contains("conscrypt.jar")) {
                                                        }
                                                        arrayList4 = arrayList;
                                                        c = 1;
                                                        if (!strArr[c].contains("core.odex") || strArr[c].contains("core-libart.odex") || strArr[c].contains("boot.oat")) {
                                                            arrayList4.add(new File(strArr[1]));
                                                        }
                                                    }
                                                }
                                            }
                                            c = 1;
                                            if (C2880.m11360(new File(strArr[1]))) {
                                                File file4 = new File(strArr[1]);
                                                m8658(file4, C2880.m11357(file4).getAbsolutePath());
                                                File file5 = new File(C2880.m11357(file4).getAbsolutePath() + "/classes.dex");
                                                if (file5.exists()) {
                                                    arrayList4 = arrayList;
                                                    arrayList4.add(file5);
                                                    c = 1;
                                                    if (!strArr[c].contains("core.odex")) {
                                                    }
                                                    arrayList4.add(new File(strArr[1]));
                                                }
                                                arrayList4 = arrayList;
                                                c = 1;
                                                if (!strArr[c].contains("core.odex")) {
                                                }
                                                arrayList4.add(new File(strArr[1]));
                                            } else {
                                                arrayList4 = arrayList;
                                                if (!strArr[c].contains("core.odex")) {
                                                }
                                                arrayList4.add(new File(strArr[1]));
                                            }
                                        } catch (FileNotFoundException e8) {
                                            fileNotFoundException = e8;
                                            arrayList3 = arrayList;
                                            fileNotFoundException.printStackTrace();
                                            System.out.println("Error: core.odex not found!\n\nPlease Odex core.jar and try again!");
                                            arrayList5 = arrayList3;
                                            if (!z6) {
                                            }
                                            System.out.println("Start patch for services.jar");
                                            if (!f5607) {
                                            }
                                            if (str15.equals(str2)) {
                                            }
                                            z12 = z6;
                                            String str43 = "Core4 restored!FixForCM\n";
                                            String str44 = "Core4 patched!FixForCM\n";
                                            String str45 = "Core4 restored!InstallLocationPolice\n";
                                            if (str15.equals(str2)) {
                                            }
                                            try {
                                                String str46 = "/system/framework/services.jar";
                                                if (!strArr[4].contains("framework")) {
                                                }
                                                str21 = str18;
                                                it2 = arrayList7.iterator();
                                                while (it2.hasNext()) {
                                                }
                                            } catch (FileNotFoundException unused) {
                                                System.out.println("Error: services.odex not found!\n\nPlease Odex services.jar and try again!");
                                            } catch (Exception e9) {
                                                System.out.println("Exception e" + e9.toString());
                                            }
                                            C2880.m11316();
                                        } catch (Exception e10) {
                                            exc = e10;
                                            arrayList2 = arrayList;
                                            exc.printStackTrace();
                                            System.out.println("Exception e" + exc.toString());
                                            arrayList5 = arrayList2;
                                            if (!z6) {
                                            }
                                            System.out.println("Start patch for services.jar");
                                            if (!f5607) {
                                            }
                                            if (str15.equals(str2)) {
                                            }
                                            z12 = z6;
                                            String str432 = "Core4 restored!FixForCM\n";
                                            String str442 = "Core4 patched!FixForCM\n";
                                            String str452 = "Core4 restored!InstallLocationPolice\n";
                                            if (str15.equals(str2)) {
                                            }
                                            String str462 = "/system/framework/services.jar";
                                            if (!strArr[4].contains("framework")) {
                                            }
                                            str21 = str18;
                                            it2 = arrayList7.iterator();
                                            while (it2.hasNext()) {
                                            }
                                            C2880.m11316();
                                        }
                                    } else {
                                        arrayList4 = arrayList;
                                        if (strArr[4].contains("ART")) {
                                            if (new File("/system/framework/core-libart.odex").exists() && new File("/system/framework/core-libart.odex").length() != 0) {
                                                arrayList4.add(new File("/system/framework/core-libart.odex"));
                                            }
                                            if (C2880.m11360(new File("/system/framework/core-libart.jar"))) {
                                                m8658(new File("/system/framework/core-libart.jar"), "/data/app");
                                                File file6 = new File("/data/app/classes.dex");
                                                if (file6.exists()) {
                                                    arrayList4.add(file6);
                                                }
                                            }
                                        } else {
                                            if (f5607) {
                                                PrintStream printStream2 = System.out;
                                                StringBuilder sb3 = new StringBuilder();
                                                sb3.append("OnlyDalvik: add for patch ");
                                                z7 = z;
                                                sb3.append(strArr[1]);
                                                printStream2.println(sb3.toString());
                                                File file7 = new File(strArr[1]);
                                                if (file7.exists()) {
                                                    arrayList4.add(file7);
                                                } else {
                                                    throw new FileNotFoundException();
                                                }
                                            } else {
                                                z7 = z;
                                                File file8 = new File(strArr[1]);
                                                if (file8.exists()) {
                                                    if (file8.toString().contains("system@framework@core.jar@classes.dex")) {
                                                        File file9 = new File("/system/framework/core.odex");
                                                        if (file9.exists() && file9.length() == 0) {
                                                            file9.delete();
                                                        }
                                                    }
                                                    arrayList4.add(file8);
                                                    if (file8.toString().contains("/system/framework/core.odex") && C3348.f9924 < 20 && !C3348.f9871.contains("ART")) {
                                                        File file10 = new File("/system/framework/core-libart.odex");
                                                        if (file10.exists()) {
                                                            if (file10.length() == 0) {
                                                                file10.delete();
                                                            } else {
                                                                arrayList4.add(file10);
                                                            }
                                                        }
                                                    }
                                                } else {
                                                    throw new FileNotFoundException();
                                                }
                                            }
                                            it = arrayList4.iterator();
                                            boolean z23 = z2;
                                            boolean z24 = z7;
                                            while (it.hasNext()) {
                                                File file11 = (File) it.next();
                                                PrintStream printStream3 = System.out;
                                                Iterator it6 = it;
                                                StringBuilder sb4 = new StringBuilder();
                                                r33 = arrayList4;
                                                sb4.append("file for patch: ");
                                                sb4.append(file11.getAbsolutePath());
                                                sb4.append(" size:");
                                                String str47 = str42;
                                                String str48 = str38;
                                                sb4.append(file11.length());
                                                printStream3.println(sb4.toString());
                                                FileChannel channel2 = new RandomAccessFile(file11, InternalZipConstants.WRITE_MODE).getChannel();
                                                String str49 = str39;
                                                f5659 = channel2.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel2.size());
                                                if (!file11.getName().contains("boot.oat")) {
                                                    try {
                                                        ArrayList arrayList11 = new ArrayList();
                                                        arrayList11.add(file11);
                                                        if (!file11.getName().contains("core-oj.oat")) {
                                                            try {
                                                            } catch (Exception e11) {
                                                                exc2 = e11;
                                                                file = file11;
                                                                z8 = false;
                                                                exc2.printStackTrace();
                                                                fileChannel = channel2;
                                                                str3 = str;
                                                                fileChannel.close();
                                                                if (!strArr[4].contains("framework")) {
                                                                }
                                                                str42 = str7;
                                                                str = str3;
                                                                it = it6;
                                                                str38 = str4;
                                                                str36 = str5;
                                                                str39 = str6;
                                                                arrayList4 = r33;
                                                            }
                                                        }
                                                        m8654(arrayList11, strArr, z24, z23);
                                                        if ((!z24 || f6021) && (!z23 || f6022)) {
                                                            file = file11;
                                                            z8 = false;
                                                        } else {
                                                            if (f6021) {
                                                                z24 = false;
                                                            }
                                                            if (f6022) {
                                                                z23 = false;
                                                            }
                                                            f5659 = channel2.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel2.size());
                                                            boolean z25 = false;
                                                            while (f5659.hasRemaining()) {
                                                                try {
                                                                    position = f5659.position();
                                                                    byte b3 = f5659.get();
                                                                    if (m8653(position, b3, f5674, f5675, f5676, f5677, z24)) {
                                                                        z8 = z25;
                                                                        try {
                                                                            if (strArr[0].contains("patch")) {
                                                                                file = file11;
                                                                                try {
                                                                                    System.out.println("Core patched!\n");
                                                                                } catch (Exception e12) {
                                                                                    e = e12;
                                                                                    exc2 = e;
                                                                                    exc2.printStackTrace();
                                                                                    fileChannel = channel2;
                                                                                    str3 = str;
                                                                                    fileChannel.close();
                                                                                    if (!strArr[4].contains("framework")) {
                                                                                    }
                                                                                    str42 = str7;
                                                                                    str = str3;
                                                                                    it = it6;
                                                                                    str38 = str4;
                                                                                    str36 = str5;
                                                                                    str39 = str6;
                                                                                    arrayList4 = r33;
                                                                                }
                                                                            } else {
                                                                                file = file11;
                                                                            }
                                                                            if (strArr[0].contains("restore")) {
                                                                                System.out.println("Core restored!\n");
                                                                            }
                                                                            z9 = true;
                                                                        } catch (Exception e13) {
                                                                            e = e13;
                                                                            file = file11;
                                                                            exc2 = e;
                                                                            exc2.printStackTrace();
                                                                            fileChannel = channel2;
                                                                            str3 = str;
                                                                            fileChannel.close();
                                                                            if (!strArr[4].contains("framework")) {
                                                                            }
                                                                            str42 = str7;
                                                                            str = str3;
                                                                            it = it6;
                                                                            str38 = str4;
                                                                            str36 = str5;
                                                                            str39 = str6;
                                                                            arrayList4 = r33;
                                                                        }
                                                                    } else {
                                                                        z9 = z25;
                                                                        file = file11;
                                                                    }
                                                                    if (m8653(position, b3, f5921, f5922, f5923, f5924, z24)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f5925, f5926, f5927, f5928, z23)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core unsigned install patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core unsigned install restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f5929, f5930, f5931, f5932, z23)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core unsigned install patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core unsigned install restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f5933, f5935, f5936, f5937, z24)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f5938, f5939, f5940, f5941, z24)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core 2 patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core 2 restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f5942, f5943, f5944, f5946, z24)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core 2 patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core 2 restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f5947, f5948, f5949, f5950, z24)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core 2 patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core 2 restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f5951, f5952, f5953, f5954, z24)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f5955, f5956, f5957, f5958, z24)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f5959, f5960, f5962, f5963, z24)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f5964, f5965, f5966, f5967, z23)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core unsigned install patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core unsigned install restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f5968, f5969, f5970, f5972, z23)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core unsigned install patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core unsigned install restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f5973, f5974, f5975, f5976, z23)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core unsigned install patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core unsigned install restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f6003, f6004, f6005, f6006, z23)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core unsigned install patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core unsigned install restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f6007, f6008, f6009, f6010, z24)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f6011, f6012, f6013, f6014, z24)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f5977, f5978, f5979, f5980, z24)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f5981, f5982, f5983, f5984, z24)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core 2 patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core 2 restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f5985, f5986, f5987, f5989, z24)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core 2 patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core 2 restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f5990, f5991, f5992, f5993, z24)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core 2 patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core 2 restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f5994, f5995, f5996, f5998, z24)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core 2 patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core 2 restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f5999, f6000, f6001, f6002, z24)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core 2 patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core 2 restored!\n");
                                                                        }
                                                                        z9 = true;
                                                                    }
                                                                    if (m8653(position, b3, f6016, f6017, f6018, f6019, z24)) {
                                                                        if (strArr[0].contains("patch")) {
                                                                            System.out.println("Core 2 patched!\n");
                                                                        }
                                                                        if (strArr[0].contains("restore")) {
                                                                            System.out.println("Core 2 restored!\n");
                                                                        }
                                                                        z25 = true;
                                                                    } else {
                                                                        z25 = z9;
                                                                    }
                                                                } catch (Exception e14) {
                                                                    e = e14;
                                                                    z8 = z25;
                                                                }
                                                                try {
                                                                    f5659.position(position + 1);
                                                                    file11 = file;
                                                                } catch (Exception e15) {
                                                                    e = e15;
                                                                    z8 = z25;
                                                                    exc2 = e;
                                                                    exc2.printStackTrace();
                                                                    fileChannel = channel2;
                                                                    str3 = str;
                                                                    fileChannel.close();
                                                                    if (!strArr[4].contains("framework")) {
                                                                    }
                                                                    str42 = str7;
                                                                    str = str3;
                                                                    it = it6;
                                                                    str38 = str4;
                                                                    str36 = str5;
                                                                    str39 = str6;
                                                                    arrayList4 = r33;
                                                                }
                                                            }
                                                            z8 = z25;
                                                            file = file11;
                                                        }
                                                    } catch (Exception e16) {
                                                        file = file11;
                                                        exc2 = e16;
                                                    }
                                                    fileChannel = channel2;
                                                } else {
                                                    file = file11;
                                                    f5659.position(4120);
                                                    int m115922 = C2880.m11592(f5659.get(), f5659.get(), f5659.get(), f5659.get());
                                                    System.out.println("Start position:" + m115922);
                                                    f5659.position(m115922);
                                                    boolean z26 = false;
                                                    while (f5659.hasRemaining()) {
                                                        try {
                                                            int position4 = f5659.position();
                                                            byte b4 = f5659.get();
                                                            if (m8653(position4, b4, f5678, f5679, f5680, f5681, z24)) {
                                                                z8 = z26;
                                                                try {
                                                                    if (strArr[0].contains("patch")) {
                                                                        try {
                                                                            System.out.println("position:" + position4);
                                                                            System.out.println(str36);
                                                                        } catch (Exception e17) {
                                                                            e = e17;
                                                                            fileChannel = channel2;
                                                                            str3 = str;
                                                                            exc3 = e;
                                                                            System.out.println(str2 + exc3);
                                                                            fileChannel.close();
                                                                            if (!strArr[4].contains("framework")) {
                                                                            }
                                                                            str42 = str7;
                                                                            str = str3;
                                                                            it = it6;
                                                                            str38 = str4;
                                                                            str36 = str5;
                                                                            str39 = str6;
                                                                            arrayList4 = r33;
                                                                        }
                                                                    }
                                                                    if (strArr[0].contains("restore")) {
                                                                        str3 = str;
                                                                        try {
                                                                            System.out.println(str3);
                                                                        } catch (Exception e18) {
                                                                            e = e18;
                                                                            fileChannel = channel2;
                                                                            exc3 = e;
                                                                            System.out.println(str2 + exc3);
                                                                            fileChannel.close();
                                                                            if (!strArr[4].contains("framework")) {
                                                                            }
                                                                            str42 = str7;
                                                                            str = str3;
                                                                            it = it6;
                                                                            str38 = str4;
                                                                            str36 = str5;
                                                                            str39 = str6;
                                                                            arrayList4 = r33;
                                                                        }
                                                                    } else {
                                                                        str3 = str;
                                                                    }
                                                                    f6021 = true;
                                                                    z8 = true;
                                                                } catch (Exception e19) {
                                                                    e = e19;
                                                                    str3 = str;
                                                                    fileChannel = channel2;
                                                                    exc3 = e;
                                                                    System.out.println(str2 + exc3);
                                                                    fileChannel.close();
                                                                    if (!strArr[4].contains("framework")) {
                                                                    }
                                                                    str42 = str7;
                                                                    str = str3;
                                                                    it = it6;
                                                                    str38 = str4;
                                                                    str36 = str5;
                                                                    str39 = str6;
                                                                    arrayList4 = r33;
                                                                }
                                                            } else {
                                                                z8 = z26;
                                                                str3 = str;
                                                            }
                                                            if (m8653(position4, b4, f5682, f5683, f5684, f5686, z24)) {
                                                                fileChannel = channel2;
                                                                try {
                                                                    if (strArr[0].contains("patch")) {
                                                                        System.out.println("position:" + position4);
                                                                        System.out.println(str36);
                                                                    }
                                                                    if (strArr[0].contains("restore")) {
                                                                        System.out.println(str3);
                                                                    }
                                                                    f6021 = true;
                                                                    z8 = true;
                                                                } catch (Exception e20) {
                                                                    e = e20;
                                                                    exc3 = e;
                                                                    System.out.println(str2 + exc3);
                                                                    fileChannel.close();
                                                                    if (!strArr[4].contains("framework")) {
                                                                    }
                                                                    str42 = str7;
                                                                    str = str3;
                                                                    it = it6;
                                                                    str38 = str4;
                                                                    str36 = str5;
                                                                    str39 = str6;
                                                                    arrayList4 = r33;
                                                                }
                                                            } else {
                                                                fileChannel = channel2;
                                                            }
                                                            if (m8653(position4, b4, f5687, f5688, f5689, f5690, z24)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("position:" + position4);
                                                                    System.out.println("Oat Core11 patched!\n");
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println("Oat Core11 restored!\n");
                                                                }
                                                                f6021 = true;
                                                                z8 = true;
                                                            }
                                                            if (m8653(position4, b4, f5708, f5709, f5710, f5712, z24)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("position:" + position4);
                                                                    System.out.println(str36);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str3);
                                                                }
                                                                f6021 = true;
                                                                z8 = true;
                                                            }
                                                            if (m8653(position4, b4, f5713, f5714, f5715, f5716, z24)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("position:" + position4);
                                                                    System.out.println(str36);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str3);
                                                                }
                                                                f6021 = true;
                                                                z8 = true;
                                                            }
                                                            if (m8653(position4, b4, f5717, f5719, f5720, f5721, z24)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("position:" + position4);
                                                                    System.out.println(str36);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str3);
                                                                }
                                                                f6021 = true;
                                                                z8 = true;
                                                            }
                                                            if (m8653(position4, b4, f5722, f5723, f5724, f5725, z24)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("position:" + position4);
                                                                    System.out.println(str36);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str3);
                                                                }
                                                                f6021 = true;
                                                                z8 = true;
                                                            }
                                                            if (m8653(position4, b4, f5726, f5727, f5728, f5729, z24)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("position:" + position4);
                                                                    System.out.println("Oat Core11 patched!\n");
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println("Oat Core11 restored!\n");
                                                                }
                                                                f6021 = true;
                                                                z8 = true;
                                                            }
                                                            if (m8653(position4, b4, f5692, f5693, f5694, f5695, z24)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("Oat Core12 patched!\n");
                                                                    System.out.println("position:" + position4);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println("Oat Core12 restored!\n");
                                                                }
                                                                f6022 = true;
                                                                z8 = true;
                                                            }
                                                            if (m8653(position4, b4, f5730, f5731, f5732, f5733, z24)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("Oat Core12 patched!\n");
                                                                    System.out.println("position:" + position4);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println("Oat Core12 restored!\n");
                                                                }
                                                                f6022 = true;
                                                                z8 = true;
                                                            }
                                                            if (m8653(position4, b4, f5696, f5697, f5698, f5699, z23)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println(str49);
                                                                    System.out.println("position:" + position4);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str48);
                                                                }
                                                                f6024 = true;
                                                                z8 = true;
                                                            }
                                                            if (m8653(position4, b4, f5700, f5701, f5702, f5703, z23)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println(str49);
                                                                    System.out.println("position:" + position4);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str48);
                                                                }
                                                                f6024 = true;
                                                                z8 = true;
                                                            }
                                                            if (m8653(position4, b4, f5704, f5705, f5706, f5707, z23)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println(str49);
                                                                    System.out.println("position:" + position4);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str48);
                                                                }
                                                                f6024 = true;
                                                                z8 = true;
                                                            }
                                                            if (m8653(position4, b4, f5734, f5735, f5736, f5738, z23)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println(str49);
                                                                    System.out.println("position:" + position4);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str48);
                                                                }
                                                                f6024 = true;
                                                                z8 = true;
                                                            }
                                                            if (m8653(position4, b4, f5739, f5740, f5741, f5742, z23)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println(str49);
                                                                    System.out.println("position:" + position4);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str48);
                                                                }
                                                                f6024 = true;
                                                                z8 = true;
                                                            }
                                                            if (m8653(position4, b4, f5743, f5744, f5746, f5747, z23)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println(str49);
                                                                    System.out.println("position:" + position4);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str48);
                                                                }
                                                                f6024 = true;
                                                                z8 = true;
                                                            }
                                                            if (m8653(position4, b4, f5748, f5749, f5750, f5751, z23)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println(str49);
                                                                    System.out.println("position:" + position4);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str48);
                                                                }
                                                                f6024 = true;
                                                                z26 = true;
                                                            } else {
                                                                z26 = z8;
                                                            }
                                                            if (z24) {
                                                                try {
                                                                    if ((f6020 & z23) && f6021 && f6022 && f6024) {
                                                                        z8 = true;
                                                                        break;
                                                                    }
                                                                } catch (Exception e21) {
                                                                    exc3 = e21;
                                                                    z8 = z26;
                                                                    System.out.println(str2 + exc3);
                                                                    fileChannel.close();
                                                                    if (!strArr[4].contains("framework")) {
                                                                    }
                                                                    str42 = str7;
                                                                    str = str3;
                                                                    it = it6;
                                                                    str38 = str4;
                                                                    str36 = str5;
                                                                    str39 = str6;
                                                                    arrayList4 = r33;
                                                                }
                                                            }
                                                            if (!z24 && z23 && f6024) {
                                                                z8 = true;
                                                                break;
                                                            } else {
                                                                f5659.position(position4 + 1);
                                                                str = str3;
                                                                channel2 = fileChannel;
                                                            }
                                                        } catch (Exception e22) {
                                                            e = e22;
                                                            fileChannel = channel2;
                                                            z8 = z26;
                                                        }
                                                    }
                                                    fileChannel = channel2;
                                                    z8 = z26;
                                                }
                                                str3 = str;
                                                fileChannel.close();
                                                if (!strArr[4].contains("framework")) {
                                                    if (file.toString().endsWith("/classes.dex")) {
                                                        f5633 = false;
                                                        C2880.m11324(file);
                                                        if (z8) {
                                                            String replace = strArr[1].replace(".jar", "-patched.jar");
                                                            String str50 = strArr[1];
                                                            new File(replace).delete();
                                                            ArrayList arrayList12 = new ArrayList();
                                                            str4 = str48;
                                                            System.out.println("add files");
                                                            String absolutePath = file.getAbsolutePath();
                                                            str5 = str36;
                                                            StringBuilder sb5 = new StringBuilder();
                                                            str6 = str49;
                                                            sb5.append(C2880.m11357(file).getAbsolutePath());
                                                            sb5.append(InternalZipConstants.ZIP_FILE_SEPARATOR);
                                                            arrayList12.add(new C3286(absolutePath, sb5.toString()));
                                                            try {
                                                                C2880.m11405(str50, replace, arrayList12);
                                                                System.out.println("add files finish");
                                                                new File(str50).delete();
                                                            } catch (Exception e23) {
                                                                e23.printStackTrace();
                                                                new File(replace).delete();
                                                            }
                                                        } else {
                                                            str4 = str48;
                                                            str5 = str36;
                                                            str6 = str49;
                                                            f5633 = true;
                                                        }
                                                    } else {
                                                        str4 = str48;
                                                        str5 = str36;
                                                        str6 = str49;
                                                    }
                                                    if (!file.toString().endsWith("/core.odex") && !file.toString().endsWith("/core-libart.odex")) {
                                                        file2 = file;
                                                        if (file2.toString().endsWith("/boot.oat") && z8) {
                                                            file2.renameTo(new File(file2.getAbsolutePath().replace("/boot.oat", "/boot-patched.oat")));
                                                        }
                                                        str7 = str47;
                                                    }
                                                    file2 = file;
                                                    C2880.m11325(file2, null);
                                                    if (z8) {
                                                        if (file2.toString().endsWith("/core.odex")) {
                                                            file2.renameTo(new File(file2.getAbsolutePath().replace("/core.odex", "/core-patched.odex")));
                                                        }
                                                        if (file2.toString().endsWith("/core-libart.odex")) {
                                                            file2.renameTo(new File(file2.getAbsolutePath().replace("/core-libart.odex", "/core-libart-patched.odex")));
                                                        }
                                                    }
                                                    if (file2.toString().endsWith("/boot.oat")) {
                                                        file2.renameTo(new File(file2.getAbsolutePath().replace("/boot.oat", "/boot-patched.oat")));
                                                    }
                                                    str7 = str47;
                                                } else {
                                                    str4 = str48;
                                                    str5 = str36;
                                                    str6 = str49;
                                                    File file12 = file;
                                                    if (file12.toString().endsWith("/classes.dex")) {
                                                        C2880.m11324(file12);
                                                    } else {
                                                        C2880.m11325(file12, "/system/framework/core.jar");
                                                    }
                                                    if (strArr[4].contains("ART")) {
                                                        if (file12.toString().contains("/classes.dex") && z8) {
                                                            System.out.println("start");
                                                            str7 = str47;
                                                            if (C2880.m11294(str7, "/system/framework/core-libart.backup", true, false)) {
                                                                System.out.println("good space");
                                                                new File("/system/framework/core-libart.backup").delete();
                                                                ArrayList arrayList13 = new ArrayList();
                                                                System.out.println("add files");
                                                                arrayList13.add(new C3286("/data/app/classes.dex", "/data/app/"));
                                                                try {
                                                                    C2880.m11405(str7, "/system/framework/core-libart.backup", arrayList13);
                                                                    System.out.println("add files finish");
                                                                    C2880.m11508("chmod", "0644", "/system/framework/core-libart.backup");
                                                                    C2880.m11508("chown", "0:0", "/system/framework/core-libart.backup");
                                                                    C2880.m11508("chmod", "0.0", "/system/framework/core-libart.backup");
                                                                    C2880.m11508("rm", str7);
                                                                    if (new File(str7).exists()) {
                                                                        new File(str7).delete();
                                                                    }
                                                                    C2880.m11508("mv", "/system/framework/core.backup", str7);
                                                                    if (!new File(str7).exists()) {
                                                                        new File("/system/framework/core-libart.backup").renameTo(new File(str7));
                                                                    }
                                                                    C2880.m11508("chmod", "0644", str7);
                                                                    C2880.m11508("chown", "0:0", str7);
                                                                    C2880.m11508("chmod", "0.0", str7);
                                                                    File m11363 = C2880.m11363(str7);
                                                                    if (m11363 != null) {
                                                                        C2880.m11508("rm", m11363.getAbsolutePath());
                                                                        if (m11363.exists()) {
                                                                            m11363.delete();
                                                                        }
                                                                    }
                                                                    new File("/data/dalvik-cache/arm/system@framework@arm@boot.oat").delete();
                                                                    new File("/data/dalvik-cache/arm/system@framework@arm@boot.art").delete();
                                                                    new File("/data/dalvik-cache/arm64/system@framework@arm@boot.oat").delete();
                                                                    new File("/data/dalvik-cache/arm64/system@framework@arm@boot.art").delete();
                                                                    new File("/data/dalvik-cache/x86/system@framework@arm@boot.oat").delete();
                                                                    new File("/data/dalvik-cache/x86/system@framework@arm@boot.art").delete();
                                                                    new File("/data/dalvik-cache/x86_64/system@framework@arm@boot.oat").delete();
                                                                    new File("/data/dalvik-cache/x86_64/system@framework@arm@boot.art").delete();
                                                                } catch (Exception e24) {
                                                                    e24.printStackTrace();
                                                                    System.out.println("LuckyPatcher: odex not equal lenght patched! Not enougth space in /system/!");
                                                                    new File("/system/framework/core.backup").delete();
                                                                }
                                                                System.out.println("finish");
                                                            } else {
                                                                new File("/system/framework/core-libart.backup").delete();
                                                                System.out.println("LuckyPatcher: odex not equal lenght patched! Not enougth space in /system/!");
                                                            }
                                                        }
                                                        str7 = str47;
                                                    } else {
                                                        str7 = str47;
                                                        if (!f5607) {
                                                            if (file12.toString().contains("system@framework@core.jar@classes.dex") && z8) {
                                                                System.out.println("LuckyPatcher: dalvik-cache patched! ");
                                                                File file13 = new File("/system/framework/core.patched");
                                                                if (C2880.m11294(file12.getAbsolutePath(), "/system/framework/core.patched", true, false)) {
                                                                    C2880.m11508("chmod", "0644", "/system/framework/core.patched");
                                                                    C2880.m11508("chown", "0.0", "/system/framework/core.patched");
                                                                    C2880.m11508("chown", "0:0", "/system/framework/core.patched");
                                                                } else {
                                                                    file13.delete();
                                                                    System.out.println("LuckyPatcher: not space to system for odex core.jar! ");
                                                                    System.out.println("LuckyPatcher: odex not equal lenght patched! Not enougth space in /system/!");
                                                                }
                                                            }
                                                            if (new File("/system/framework/core.patched").exists()) {
                                                                System.out.println("LuckyPatcher: root found core.patched! ");
                                                            }
                                                            if (new File("/system/framework/core.odex").exists()) {
                                                                System.out.println("LuckyPatcher: root found core.odex! ");
                                                            }
                                                        }
                                                    }
                                                }
                                                str42 = str7;
                                                str = str3;
                                                it = it6;
                                                str38 = str4;
                                                str36 = str5;
                                                str39 = str6;
                                                arrayList4 = r33;
                                            }
                                            arrayList5 = arrayList4;
                                        }
                                    }
                                    z7 = z;
                                    it = arrayList4.iterator();
                                    boolean z232 = z2;
                                    boolean z242 = z7;
                                    while (it.hasNext()) {
                                    }
                                    arrayList5 = arrayList4;
                                }
                            }
                            if (contains == 0) {
                            }
                            z7 = z;
                            it = arrayList4.iterator();
                            boolean z2322 = z2;
                            boolean z2422 = z7;
                            while (it.hasNext()) {
                            }
                            arrayList5 = arrayList4;
                        } catch (FileNotFoundException e25) {
                            e = e25;
                            r33 = contains;
                            fileNotFoundException = e;
                            arrayList3 = r33;
                            fileNotFoundException.printStackTrace();
                            System.out.println("Error: core.odex not found!\n\nPlease Odex core.jar and try again!");
                            arrayList5 = arrayList3;
                            if (!z6) {
                            }
                            System.out.println("Start patch for services.jar");
                            if (!f5607) {
                            }
                            if (str15.equals(str2)) {
                            }
                            z12 = z6;
                            String str4322 = "Core4 restored!FixForCM\n";
                            String str4422 = "Core4 patched!FixForCM\n";
                            String str4522 = "Core4 restored!InstallLocationPolice\n";
                            if (str15.equals(str2)) {
                            }
                            String str4622 = "/system/framework/services.jar";
                            if (!strArr[4].contains("framework")) {
                            }
                            str21 = str18;
                            it2 = arrayList7.iterator();
                            while (it2.hasNext()) {
                            }
                            C2880.m11316();
                        } catch (Exception e26) {
                            e = e26;
                            r33 = contains;
                            exc = e;
                            arrayList2 = r33;
                            exc.printStackTrace();
                            System.out.println("Exception e" + exc.toString());
                            arrayList5 = arrayList2;
                            if (!z6) {
                            }
                            System.out.println("Start patch for services.jar");
                            if (!f5607) {
                            }
                            if (str15.equals(str2)) {
                            }
                            z12 = z6;
                            String str43222 = "Core4 restored!FixForCM\n";
                            String str44222 = "Core4 patched!FixForCM\n";
                            String str45222 = "Core4 restored!InstallLocationPolice\n";
                            if (str15.equals(str2)) {
                            }
                            String str46222 = "/system/framework/services.jar";
                            if (!strArr[4].contains("framework")) {
                            }
                            str21 = str18;
                            it2 = arrayList7.iterator();
                            while (it2.hasNext()) {
                            }
                            C2880.m11316();
                        }
                    } catch (FileNotFoundException e27) {
                        e = e27;
                        fileNotFoundException = e;
                        arrayList3 = r33;
                        fileNotFoundException.printStackTrace();
                        System.out.println("Error: core.odex not found!\n\nPlease Odex core.jar and try again!");
                        arrayList5 = arrayList3;
                        if (!z6) {
                        }
                        System.out.println("Start patch for services.jar");
                        if (!f5607) {
                        }
                        if (str15.equals(str2)) {
                        }
                        z12 = z6;
                        String str432222 = "Core4 restored!FixForCM\n";
                        String str442222 = "Core4 patched!FixForCM\n";
                        String str452222 = "Core4 restored!InstallLocationPolice\n";
                        if (str15.equals(str2)) {
                        }
                        String str462222 = "/system/framework/services.jar";
                        if (!strArr[4].contains("framework")) {
                        }
                        str21 = str18;
                        it2 = arrayList7.iterator();
                        while (it2.hasNext()) {
                        }
                        C2880.m11316();
                    } catch (Exception e28) {
                        e = e28;
                        exc = e;
                        arrayList2 = r33;
                        exc.printStackTrace();
                        System.out.println("Exception e" + exc.toString());
                        arrayList5 = arrayList2;
                        if (!z6) {
                        }
                        System.out.println("Start patch for services.jar");
                        if (!f5607) {
                        }
                        if (str15.equals(str2)) {
                        }
                        z12 = z6;
                        String str4322222 = "Core4 restored!FixForCM\n";
                        String str4422222 = "Core4 patched!FixForCM\n";
                        String str4522222 = "Core4 restored!InstallLocationPolice\n";
                        if (str15.equals(str2)) {
                        }
                        String str4622222 = "/system/framework/services.jar";
                        if (!strArr[4].contains("framework")) {
                        }
                        str21 = str18;
                        it2 = arrayList7.iterator();
                        while (it2.hasNext()) {
                        }
                        C2880.m11316();
                    }
                    contains = strArr[4].contains("framework");
                    String str422 = "/system/framework/core-libart.jar";
                } catch (FileNotFoundException e29) {
                    e = e29;
                    r33 = arrayList;
                } catch (Exception e30) {
                    e = e30;
                    r33 = arrayList;
                }
                str2 = "";
            } else {
                z6 = z3;
                z5 = z4;
                arrayList5 = arrayList8;
                str2 = "";
            }
            if (!z6 || z5) {
                System.out.println("Start patch for services.jar");
                if (!f5607) {
                    str15 = new File("/system/framework/arm/services.odex").exists() ? "/arm" : str2;
                    if (new File("/system/framework/arm64/services.odex").exists()) {
                        str15 = "/arm64";
                    }
                    if (new File("/system/framework/x86/services.odex").exists()) {
                        str15 = "/x86";
                    }
                    if (new File("/system/framework/x86_64/services.odex").exists()) {
                        str15 = "/x86_64";
                    }
                    if (new File("/system/framework/arm/services.odex.xz").exists()) {
                        str15 = "/arm";
                    }
                    if (new File("/system/framework/arm64/services.odex.xz").exists()) {
                        str15 = "/arm64";
                    }
                    if (new File("/system/framework/x86/services.odex.xz").exists()) {
                        str15 = "/x86";
                    }
                    if (new File("/system/framework/x86_64/services.odex.xz").exists()) {
                        str15 = "/x86_64";
                    }
                    if (new File("/system/framework/oat/arm/services.odex").exists()) {
                        str15 = "/oat/arm";
                    }
                    if (new File("/system/framework/oat/arm64/services.odex").exists()) {
                        str15 = "/oat/arm64";
                    }
                    if (new File("/system/framework/oat/x86/services.odex").exists()) {
                        str15 = "/oat/x86";
                    }
                    if (new File("/system/framework/oat/x86_64/services.odex").exists()) {
                        str15 = "/oat/x86_64";
                    }
                    if (new File("/system/framework/oat/arm/services.odex.xz").exists()) {
                        str15 = "/oat/arm";
                    }
                    if (new File("/system/framework/oat/arm64/services.odex.xz").exists()) {
                        str15 = "/oat/arm64";
                    }
                    if (new File("/system/framework/oat/x86/services.odex.xz").exists()) {
                        str15 = "/oat/x86";
                    }
                    str14 = "/system/framework";
                    str13 = "/services.odex";
                    if (new File("/system/framework/oat/x86_64/services.odex.xz").exists()) {
                        str15 = "/oat/x86_64";
                    }
                } else {
                    if (new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.dex").exists()) {
                        str10 = "/data/dalvik-cache";
                        str11 = "/arm";
                        str12 = "/system@framework@services.jar@classes.dex";
                    } else {
                        str10 = str2;
                        str11 = str10;
                        str12 = str11;
                    }
                    if (new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.dex").exists()) {
                        str10 = "/data/dalvik-cache";
                        str11 = "/arm64";
                        str12 = "/system@framework@services.jar@classes.dex";
                    }
                    if (new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.dex").exists()) {
                        str10 = "/data/dalvik-cache";
                        str11 = "/x86";
                        str12 = "/system@framework@services.jar@classes.dex";
                    }
                    if (new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.dex").exists()) {
                        str10 = "/data/dalvik-cache";
                        str11 = "/x86_64";
                        str12 = "/system@framework@services.jar@classes.dex";
                    }
                    if (new File("/data/dalvik-cache/oat/arm/system@framework@services.jar@classes.dex").exists()) {
                        str10 = "/data/dalvik-cache/oat";
                        str11 = "/arm";
                        str12 = "/system@framework@services.jar@classes.dex";
                    }
                    if (new File("/data/dalvik-cache/oat/arm64/system@framework@services.jar@classes.dex").exists()) {
                        str10 = "/data/dalvik-cache/oat";
                        str11 = "/arm64";
                        str12 = "/system@framework@services.jar@classes.dex";
                    }
                    if (new File("/data/dalvik-cache/oat/x86/system@framework@services.jar@classes.dex").exists()) {
                        str10 = "/data/dalvik-cache/oat";
                        str11 = "/x86";
                        str12 = "/system@framework@services.jar@classes.dex";
                    }
                    str13 = str12;
                    str14 = str10;
                    str15 = str11;
                    if (new File("/data/dalvik-cache/oat/x86_64/system@framework@services.jar@classes.dex").exists()) {
                        str14 = "/data/dalvik-cache/oat";
                        str15 = "/x86_64";
                        str13 = "/system@framework@services.jar@classes.dex";
                    }
                }
                if (!str15.equals(str2) || C3348.f9924 < 24) {
                    z12 = z6;
                } else {
                    File file14 = new File(str14 + str15 + str13);
                    try {
                        if (!C2880.m11414(file14.getAbsolutePath()).equals(str2)) {
                            C2880.m11492("/system", "RW");
                        }
                    } catch (Throwable th3) {
                        th3.printStackTrace();
                    }
                    if (new File(str14 + str15 + "/services.odex.xz").exists()) {
                        System.out.println("try unpack services.odex.xz");
                        if (C2880.m11287(new File(str14 + str15 + "/services.odex.xz"), "/system/framework" + str15)) {
                            C2880.m11508("chmod", "644", str14 + str15 + str13);
                            C2880.m11508("chown", "0:0", str14 + str15 + str13);
                            C2880.m11508("chown", "0.0", str14 + str15 + str13);
                        } else {
                            new File(str14 + str15 + str13).delete();
                            System.out.println("not enought space for unpack services.odex.xz");
                            z16 = false;
                            if (!z16 && z6) {
                                z12 = z6;
                                if (C3348.f9924 >= 28 && m8657(strArr, z12)) {
                                    m8656(file14, strArr, z12);
                                } else {
                                    m8656(file14, strArr, z12);
                                }
                            } else {
                                z12 = z6;
                                System.out.println("LuckyPatcher: odex not equal lenght patched! Not enougth space in /system/!");
                            }
                            if ((!f6021 || f6022 || f6026) && !f5607) {
                                new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.dex").delete();
                                new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.art").delete();
                                new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.dex").delete();
                                new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.art").delete();
                                new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.dex").delete();
                                new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.art").delete();
                                new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.dex").delete();
                                new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.art").delete();
                            }
                            C2880.m11487();
                            C2880.m11316();
                        }
                    }
                    z16 = true;
                    if (!z16) {
                    }
                    z12 = z6;
                    System.out.println("LuckyPatcher: odex not equal lenght patched! Not enougth space in /system/!");
                    if (!f6021) {
                    }
                    new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.dex").delete();
                    new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.art").delete();
                    new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.dex").delete();
                    new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.art").delete();
                    new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.dex").delete();
                    new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.art").delete();
                    new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.dex").delete();
                    new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.art").delete();
                    C2880.m11487();
                    C2880.m11316();
                }
                String str43222222 = "Core4 restored!FixForCM\n";
                String str44222222 = "Core4 patched!FixForCM\n";
                String str45222222 = "Core4 restored!InstallLocationPolice\n";
                if (str15.equals(str2)) {
                    str16 = "Core4 restored!\n";
                    str17 = str2;
                    str18 = "Core4 restored!FixForCM\n";
                    str19 = "Core4 patched!\n";
                } else {
                    int i9 = C3348.f9924;
                    String str51 = "Core4 patched!\n";
                    if (i9 < 21 || i9 > 23) {
                        str16 = "Core4 restored!\n";
                        str17 = str2;
                        str18 = "Core4 restored!FixForCM\n";
                        str19 = str51;
                    } else {
                        File file15 = new File(str14 + str15 + str13);
                        try {
                            if (C2880.m11414(file15.getAbsolutePath()).equals(str2)) {
                                str31 = str2;
                            } else {
                                str31 = str2;
                                try {
                                    C2880.m11492("/system", "RW");
                                } catch (Throwable th4) {
                                    th = th4;
                                    th.printStackTrace();
                                    sb = new StringBuilder();
                                    sb.append(str14);
                                    sb.append(str15);
                                    String str52 = "Core4 restored!\n";
                                    sb.append("/services.odex.xz");
                                    if (new File(sb.toString()).exists()) {
                                    }
                                    z15 = true;
                                    if (z15) {
                                    }
                                    if (!f6021) {
                                    }
                                    new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.dex").delete();
                                    new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.art").delete();
                                    new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.dex").delete();
                                    new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.art").delete();
                                    new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.dex").delete();
                                    new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.art").delete();
                                    new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.dex").delete();
                                    new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.art").delete();
                                    C2880.m11487();
                                    C2880.m11316();
                                    String str46222222 = "/system/framework/services.jar";
                                    if (!strArr[4].contains("framework")) {
                                    }
                                    str21 = str18;
                                    it2 = arrayList7.iterator();
                                    while (it2.hasNext()) {
                                    }
                                    C2880.m11316();
                                }
                            }
                        } catch (Throwable th5) {
                            th = th5;
                            str31 = str2;
                        }
                        sb = new StringBuilder();
                        sb.append(str14);
                        sb.append(str15);
                        String str522 = "Core4 restored!\n";
                        sb.append("/services.odex.xz");
                        if (new File(sb.toString()).exists()) {
                            System.out.println("try unpack services.odex.xz");
                            if (C2880.m11287(new File(str14 + str15 + "/services.odex.xz"), "/system/framework" + str15)) {
                                C2880.m11508("chmod", "644", str14 + str15 + str13);
                                C2880.m11508("chown", "0:0", str14 + str15 + str13);
                                C2880.m11508("chown", "0.0", str14 + str15 + str13);
                            } else {
                                new File(str14 + str15 + str13).delete();
                                System.out.println("not enought space for unpack services.odex.xz");
                                z15 = false;
                                if (z15) {
                                    m8656(file15, strArr, z12);
                                    if ((f6021 || !z12) && (f6022 || !z12)) {
                                        str18 = "Core4 restored!FixForCM\n";
                                        str19 = str51;
                                        str17 = str31;
                                        str16 = str522;
                                    } else {
                                        try {
                                            FileChannel channel3 = new RandomAccessFile(file15, InternalZipConstants.WRITE_MODE).getChannel();
                                            MappedByteBuffer map2 = channel3.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel3.size());
                                            f5659 = map2;
                                            map2.position(4120);
                                            int m115923 = C2880.m11592(f5659.get(), f5659.get(), f5659.get(), f5659.get());
                                            System.out.println("Start position:" + m115923);
                                            f5659.position(m115923);
                                            while (true) {
                                                try {
                                                    if (!f5659.hasRemaining()) {
                                                        fileChannel2 = channel3;
                                                        str18 = str43222222;
                                                        str19 = str51;
                                                        str32 = str31;
                                                        str16 = str522;
                                                        break;
                                                    }
                                                    int position5 = f5659.position();
                                                    byte b5 = f5659.get();
                                                    fileChannel2 = channel3;
                                                    String str53 = str43222222;
                                                    str19 = str51;
                                                    str32 = str31;
                                                    str16 = str522;
                                                    try {
                                                        if (m8653(position5, b5, f5752, f5753, f5754, f5755, z12)) {
                                                            try {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println(str19);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str16);
                                                                }
                                                                f6021 = true;
                                                            } catch (Exception e31) {
                                                                exc7 = e31;
                                                                str18 = str53;
                                                                try {
                                                                    PrintStream printStream4 = System.out;
                                                                    StringBuilder sb6 = new StringBuilder();
                                                                    str17 = str32;
                                                                } catch (IOException e32) {
                                                                    e = e32;
                                                                    str17 = str32;
                                                                    e.printStackTrace();
                                                                    if (!f6021) {
                                                                    }
                                                                    new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.dex").delete();
                                                                    new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.art").delete();
                                                                    new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.dex").delete();
                                                                    new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.art").delete();
                                                                    new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.dex").delete();
                                                                    new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.art").delete();
                                                                    new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.dex").delete();
                                                                    new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.art").delete();
                                                                    C2880.m11487();
                                                                    C2880.m11316();
                                                                    String str462222222 = "/system/framework/services.jar";
                                                                    if (!strArr[4].contains("framework")) {
                                                                    }
                                                                    str21 = str18;
                                                                    it2 = arrayList7.iterator();
                                                                    while (it2.hasNext()) {
                                                                    }
                                                                    C2880.m11316();
                                                                }
                                                                try {
                                                                    sb6.append(str17);
                                                                    sb6.append(exc7);
                                                                    printStream4.println(sb6.toString());
                                                                    fileChannel2.close();
                                                                } catch (IOException e33) {
                                                                    e = e33;
                                                                    e.printStackTrace();
                                                                    if (!f6021) {
                                                                    }
                                                                    new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.dex").delete();
                                                                    new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.art").delete();
                                                                    new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.dex").delete();
                                                                    new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.art").delete();
                                                                    new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.dex").delete();
                                                                    new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.art").delete();
                                                                    new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.dex").delete();
                                                                    new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.art").delete();
                                                                    C2880.m11487();
                                                                    C2880.m11316();
                                                                    String str4622222222 = "/system/framework/services.jar";
                                                                    if (!strArr[4].contains("framework")) {
                                                                    }
                                                                    str21 = str18;
                                                                    it2 = arrayList7.iterator();
                                                                    while (it2.hasNext()) {
                                                                    }
                                                                    C2880.m11316();
                                                                }
                                                                if (!f6021) {
                                                                }
                                                                new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.dex").delete();
                                                                new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.art").delete();
                                                                new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.dex").delete();
                                                                new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.art").delete();
                                                                new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.dex").delete();
                                                                new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.art").delete();
                                                                new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.dex").delete();
                                                                new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.art").delete();
                                                                C2880.m11487();
                                                                C2880.m11316();
                                                                String str46222222222 = "/system/framework/services.jar";
                                                                if (!strArr[4].contains("framework")) {
                                                                }
                                                                str21 = str18;
                                                                it2 = arrayList7.iterator();
                                                                while (it2.hasNext()) {
                                                                }
                                                                C2880.m11316();
                                                            }
                                                        }
                                                        if (m8653(position5, b5, f5756, f5757, f5758, f5759, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println(str19);
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println(str16);
                                                            }
                                                            f6021 = true;
                                                        }
                                                        if (m8653(position5, b5, f5760, f5761, f5762, f5764, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println(str19);
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println(str16);
                                                            }
                                                            f6021 = true;
                                                        }
                                                        if (m8653(position5, b5, f5765, f5766, f5767, f5768, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println("Core4 patched!InstallLocationPolice\n");
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println("Core4 restored!InstallLocationPolice\n");
                                                            }
                                                            f6022 = true;
                                                        }
                                                        if (m8653(position5, b5, f5782, f5783, f5784, f5785, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println("Core4 patched!InstallLocationPolice\n");
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println("Core4 restored!InstallLocationPolice\n");
                                                            }
                                                            f6022 = true;
                                                        }
                                                        if (m8653(position5, b5, f5786, f5787, f5788, f5790, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println("Core4 patched!InstallLocationPolice\n");
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println("Core4 restored!InstallLocationPolice\n");
                                                            }
                                                            f6022 = true;
                                                        }
                                                        if (m8653(position5, b5, f5791, f5792, f5793, f5794, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println("Core4 patched!InstallLocationPolice\n");
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println("Core4 restored!InstallLocationPolice\n");
                                                            }
                                                            f6022 = true;
                                                        }
                                                        if (m8653(position5, b5, f5795, f5796, f5797, f5798, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println("Core4 patched!InstallLocationPolice\n");
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println("Core4 restored!InstallLocationPolice\n");
                                                            }
                                                            f6022 = true;
                                                        }
                                                        if (m8653(position5, b5, f5800, f5801, f5802, f5803, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println("Core4 patched!InstallLocationPolice\n");
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println("Core4 restored!InstallLocationPolice\n");
                                                            }
                                                            f6022 = true;
                                                        }
                                                        if (m8653(position5, b5, f5804, f5805, f5806, f5807, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println("Core4 patched!FixForCM\n");
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                str18 = str53;
                                                                try {
                                                                    System.out.println(str18);
                                                                } catch (Exception e34) {
                                                                    e = e34;
                                                                    exc7 = e;
                                                                    PrintStream printStream42 = System.out;
                                                                    StringBuilder sb62 = new StringBuilder();
                                                                    str17 = str32;
                                                                    sb62.append(str17);
                                                                    sb62.append(exc7);
                                                                    printStream42.println(sb62.toString());
                                                                    fileChannel2.close();
                                                                    if (!f6021) {
                                                                    }
                                                                    new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.dex").delete();
                                                                    new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.art").delete();
                                                                    new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.dex").delete();
                                                                    new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.art").delete();
                                                                    new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.dex").delete();
                                                                    new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.art").delete();
                                                                    new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.dex").delete();
                                                                    new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.art").delete();
                                                                    C2880.m11487();
                                                                    C2880.m11316();
                                                                    String str462222222222 = "/system/framework/services.jar";
                                                                    if (!strArr[4].contains("framework")) {
                                                                    }
                                                                    str21 = str18;
                                                                    it2 = arrayList7.iterator();
                                                                    while (it2.hasNext()) {
                                                                    }
                                                                    C2880.m11316();
                                                                }
                                                            } else {
                                                                str18 = str53;
                                                            }
                                                            f6026 = true;
                                                        } else {
                                                            str18 = str53;
                                                        }
                                                        if (m8653(position5, b5, f5808, f5809, f5810, f5811, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println("Core4 patched!FixForCM\n");
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println(str18);
                                                            }
                                                            f6026 = true;
                                                        }
                                                        if (m8653(position5, b5, f5812, f5813, f5814, f5816, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println("Core4 patched!FixForCM\n");
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println(str18);
                                                            }
                                                            f6026 = true;
                                                        }
                                                        if (m8653(position5, b5, f5769, f5770, f5771, f5773, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println("Core4 patched!FixForCM\n");
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println(str18);
                                                            }
                                                            f6026 = true;
                                                        }
                                                        if (m8653(position5, b5, f5774, f5775, f5776, f5777, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println("Core4 patched!FixForCM\n");
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println(str18);
                                                            }
                                                            f6026 = true;
                                                        }
                                                        if (m8653(position5, b5, f5778, f5779, f5780, f5781, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println("Core4 patched!FixForCM\n");
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println(str18);
                                                            }
                                                            f6026 = true;
                                                        }
                                                        if (m8653(position5, b5, f5817, f5818, f5819, f5820, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println(str19);
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println(str16);
                                                            }
                                                            f6021 = true;
                                                        }
                                                        if (m8653(position5, b5, f5821, f5822, f5823, f5824, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println(str19);
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println(str16);
                                                            }
                                                            f6021 = true;
                                                        }
                                                        if (m8653(position5, b5, f5825, f5827, f5828, f5829, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println(str19);
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println(str16);
                                                            }
                                                            f6021 = true;
                                                        }
                                                        if (m8653(position5, b5, f5830, f5831, f5832, f5833, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println("Core4 patched!InstallLocationPolice\n");
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println("Core4 restored!InstallLocationPolice\n");
                                                            }
                                                            f6022 = true;
                                                        }
                                                        if (m8653(position5, b5, f5834, f5835, f5836, f5837, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println("Core4 patched!InstallLocationPolice\n");
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println("Core4 restored!InstallLocationPolice\n");
                                                            }
                                                            f6022 = true;
                                                        }
                                                        if (m8653(position5, b5, f5843, f5844, f5845, f5846, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println("Core4 patched!InstallLocationPolice\n");
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println("Core4 restored!InstallLocationPolice\n");
                                                            }
                                                            f6022 = true;
                                                        }
                                                        if (m8653(position5, b5, f5838, f5839, f5840, f5842, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println("Core4 patched!InstallLocationPolice\n");
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println("Core4 restored!InstallLocationPolice\n");
                                                            }
                                                            f6022 = true;
                                                        }
                                                        if (m8653(position5, b5, f5869, f5870, f5871, f5872, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println("Core4 patched!InstallLocationPolice\n");
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println("Core4 restored!InstallLocationPolice\n");
                                                            }
                                                            f6022 = true;
                                                        }
                                                        if (m8653(position5, b5, f5873, f5874, f5875, f5876, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println("Core4 patched!InstallLocationPolice\n");
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println("Core4 restored!InstallLocationPolice\n");
                                                            }
                                                            f6022 = true;
                                                        }
                                                        if (m8653(position5, b5, f5847, f5848, f5849, f5850, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println(str19);
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println(str16);
                                                            }
                                                            f6021 = true;
                                                        }
                                                        if (m8653(position5, b5, f5851, f5852, f5854, f5855, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println(str19);
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println(str16);
                                                            }
                                                            f6021 = true;
                                                        }
                                                        if (m8653(position5, b5, f5856, f5857, f5858, f5859, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println(str19);
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println(str16);
                                                            }
                                                            f6021 = true;
                                                        }
                                                        if (m8653(position5, b5, f5860, f5861, f5862, f5863, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println(str19);
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println(str16);
                                                            }
                                                            f6021 = true;
                                                        }
                                                        if (m8653(position5, b5, f5864, f5865, f5866, f5868, z12)) {
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println(str19);
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println(str16);
                                                            }
                                                            f6021 = true;
                                                        }
                                                        if (z12 && f6021 && f6022 && f6026) {
                                                            break;
                                                        }
                                                        f5659.position(position5 + 1);
                                                        str522 = str16;
                                                        str51 = str19;
                                                        str43222222 = str18;
                                                        channel3 = fileChannel2;
                                                        str31 = str32;
                                                    } catch (Exception e35) {
                                                        e = e35;
                                                        str18 = str53;
                                                    }
                                                } catch (Exception e36) {
                                                    e = e36;
                                                    fileChannel2 = channel3;
                                                    str18 = str43222222;
                                                    str19 = str51;
                                                    str32 = str31;
                                                    str16 = str522;
                                                }
                                            }
                                            str17 = str32;
                                            fileChannel2.close();
                                        } catch (IOException e37) {
                                            e = e37;
                                            str18 = "Core4 restored!FixForCM\n";
                                            str19 = str51;
                                            str17 = str31;
                                            str16 = str522;
                                        }
                                    }
                                } else {
                                    str18 = "Core4 restored!FixForCM\n";
                                    str19 = str51;
                                    str17 = str31;
                                    str16 = str522;
                                    System.out.println("LuckyPatcher: odex not equal lenght patched! Not enougth space in /system/!");
                                }
                                if ((!f6021 || f6022 || f6026) && !f5607) {
                                    new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.dex").delete();
                                    new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.art").delete();
                                    new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.dex").delete();
                                    new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.art").delete();
                                    new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.dex").delete();
                                    new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.art").delete();
                                    new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.dex").delete();
                                    new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.art").delete();
                                }
                                C2880.m11487();
                                C2880.m11316();
                            }
                        }
                        z15 = true;
                        if (z15) {
                        }
                        if (!f6021) {
                        }
                        new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.dex").delete();
                        new File("/data/dalvik-cache/arm/system@framework@services.jar@classes.art").delete();
                        new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.dex").delete();
                        new File("/data/dalvik-cache/arm64/system@framework@services.jar@classes.art").delete();
                        new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.dex").delete();
                        new File("/data/dalvik-cache/x86/system@framework@services.jar@classes.art").delete();
                        new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.dex").delete();
                        new File("/data/dalvik-cache/x86_64/system@framework@services.jar@classes.art").delete();
                        C2880.m11487();
                        C2880.m11316();
                    }
                }
                String str4622222222222 = "/system/framework/services.jar";
                if (!strArr[4].contains("framework")) {
                    char c2 = 1;
                    if (strArr[1].contains("services.jar") && C2880.m11360(new File(strArr[1]))) {
                        File file16 = new File(strArr[1]);
                        m8658(file16, C2880.m11357(file16).getAbsolutePath());
                        File file17 = new File(C2880.m11357(file16).getAbsolutePath() + "/classes.dex");
                        if (file17.exists()) {
                            arrayList7 = arrayList5;
                            arrayList7.add(file17);
                        } else {
                            arrayList7 = arrayList5;
                        }
                        c2 = 1;
                    } else {
                        arrayList7 = arrayList5;
                    }
                    if (strArr[c2].contains("services.odex")) {
                        str20 = str17;
                        arrayList7.add(new File(strArr[1]));
                    } else {
                        str20 = str17;
                    }
                } else {
                    str20 = str17;
                    arrayList7 = arrayList5;
                    if (strArr[4].contains("ART")) {
                        if (new File("/system/framework/services.odex").exists() && new File("/system/framework/services.odex").length() != 0) {
                            System.out.println("Add services.odex for patch");
                            arrayList7.add(new File("/system/framework/services.odex"));
                        }
                        if (C2880.m11360(new File("/system/framework/services.jar"))) {
                            System.out.println("services.jar contain classes,dex");
                            m8658(new File("/system/framework/services.jar"), "/data/app");
                            File file18 = new File("/data/app/classes.dex");
                            if (file18.exists()) {
                                System.out.println("Add classes.dex for patch");
                                arrayList7.add(file18);
                            }
                        }
                    } else if (f5607) {
                        File file19 = new File(strArr[2]);
                        if (file19.exists()) {
                            arrayList7.add(file19);
                        } else {
                            throw new FileNotFoundException();
                        }
                    } else {
                        PrintStream printStream5 = System.out;
                        StringBuilder sb7 = new StringBuilder();
                        sb7.append("Vhodjashij file ");
                        str21 = str18;
                        sb7.append(strArr[2]);
                        printStream5.println(sb7.toString());
                        File file20 = new File(strArr[2]);
                        if (file20.exists()) {
                            if (file20.toString().contains("system@framework@services.jar@classes.dex")) {
                                System.out.println("Vhodjashij file byl dalvick-cache " + strArr[2]);
                                m8658(new File("/system/framework/services.jar"), "/data/app");
                                file20 = new File("/data/app/classes.dex");
                                if (!file20.exists()) {
                                    file20 = file20;
                                }
                                File file21 = new File("/system/framework/services.odex");
                                if (file21.exists() && file21.length() == 0) {
                                    file21.delete();
                                }
                            }
                            System.out.println("Add file for patch " + file20.toString());
                            arrayList7.add(file20);
                            it2 = arrayList7.iterator();
                            while (it2.hasNext()) {
                                File file22 = (File) it2.next();
                                System.out.println("Start patch for " + file22.toString());
                                boolean m11450 = C2880.m11450(file22);
                                FileChannel channel4 = new RandomAccessFile(file22, InternalZipConstants.WRITE_MODE).getChannel();
                                f5659 = channel4.map(FileChannel.MapMode.READ_WRITE, 0L, (long) ((int) channel4.size()));
                                if (!m11450) {
                                    f5711 = null;
                                    f5685 = 0;
                                    boolean z27 = false;
                                    while (f5659.hasRemaining()) {
                                        try {
                                            position2 = f5659.position();
                                            b = f5659.get();
                                            it3 = it2;
                                            str22 = str20;
                                        } catch (Exception e38) {
                                            e = e38;
                                            it3 = it2;
                                            str22 = str20;
                                        }
                                        try {
                                            if (m8653(position2, b, f5877, f5878, f5879, f5881, z12)) {
                                                if (strArr[0].contains("patch")) {
                                                    System.out.println(str19);
                                                }
                                                if (strArr[0].contains("restore")) {
                                                    System.out.println(str16);
                                                }
                                                z27 = true;
                                            }
                                            if (m8653(position2, b, f5890, f5891, f5892, f5894, z12)) {
                                                if (strArr[0].contains("patch")) {
                                                    System.out.println(str19);
                                                }
                                                if (strArr[0].contains("restore")) {
                                                    System.out.println(str16);
                                                }
                                                z27 = true;
                                            }
                                            if (m8653(position2, b, f5916, f5917, f5918, f5920, z12)) {
                                                if (strArr[0].contains("patch")) {
                                                    System.out.println(str19);
                                                }
                                                if (strArr[0].contains("restore")) {
                                                    System.out.println(str16);
                                                }
                                                z27 = true;
                                            }
                                            if (m8653(position2, b, f5895, f5896, f5897, f5898, z12)) {
                                                if (strArr[0].contains("patch")) {
                                                    System.out.println("Core4 patched!checkUpgradeKeySetLP\n");
                                                }
                                                if (strArr[0].contains("restore")) {
                                                    System.out.println("Core4 restored!checkUpgradeKeySetLP\n");
                                                }
                                                z27 = true;
                                            }
                                            if (m8653(position2, b, f5899, f5900, f5901, f5902, z12)) {
                                                if (strArr[0].contains("patch")) {
                                                    System.out.println("Core4 patched!\nCM12");
                                                }
                                                if (strArr[0].contains("restore")) {
                                                    System.out.println("Core4 restored!\nCM12");
                                                }
                                                z27 = true;
                                            }
                                            if (m8653(position2, b, f5903, f5904, f5905, f5906, z12)) {
                                                if (strArr[0].contains("patch")) {
                                                    System.out.println("Core4 patched!\nCM12");
                                                }
                                                if (strArr[0].contains("restore")) {
                                                    System.out.println("Core4 restored!\nCM12");
                                                }
                                                z27 = true;
                                            }
                                            if (m8653(position2, b, f5882, f5883, f5884, f5885, z12)) {
                                                if (strArr[0].contains("patch")) {
                                                    System.out.println("Core4 patched!\nCM11");
                                                }
                                                if (strArr[0].contains("restore")) {
                                                    System.out.println("Core4 restored!\nCM11");
                                                }
                                                z27 = true;
                                            }
                                            if (m8653(position2, b, f5886, f5887, f5888, f5889, z12)) {
                                                if (strArr[0].contains("patch")) {
                                                    System.out.println("Core4 policy patched!\n");
                                                }
                                                if (strArr[0].contains("restore")) {
                                                    System.out.println("Core4 policy restored!\n");
                                                }
                                                z27 = true;
                                            }
                                            if (m8653(position2, b, f5908, f5909, f5910, f5911, z12)) {
                                                if (strArr[0].contains("patch")) {
                                                    System.out.println("Core4 policy patched!\n");
                                                }
                                                if (strArr[0].contains("restore")) {
                                                    System.out.println("Core4 policy restored!\n");
                                                }
                                                z27 = true;
                                            }
                                            if (m8653(position2, b, f5912, f5913, f5914, f5915, z12)) {
                                                if (strArr[0].contains("patch")) {
                                                    System.out.println("Core4 policy patched!\n");
                                                }
                                                if (strArr[0].contains("restore")) {
                                                    System.out.println("Core4 policy restored!\n");
                                                }
                                                z27 = true;
                                            }
                                            f5659.position(position2 + 1);
                                            str20 = str22;
                                            it2 = it3;
                                        } catch (Exception e39) {
                                            e = e39;
                                            Exception exc8 = e;
                                            exc8.printStackTrace();
                                            z14 = z27;
                                            System.out.println(str22 + exc8);
                                            i3 = f5685;
                                            if (i3 > 0) {
                                                f5659.position(i3);
                                                f5659.put(f5711);
                                                f5659.force();
                                            }
                                            str23 = str4622222222222;
                                            str24 = str21;
                                            z13 = z14;
                                            channel4.close();
                                            if (strArr[4].contains("framework")) {
                                            }
                                        }
                                    }
                                    it3 = it2;
                                    str22 = str20;
                                    z14 = z27;
                                    i3 = f5685;
                                    if (i3 > 0 && f5711 != null) {
                                        f5659.position(i3);
                                        f5659.put(f5711);
                                        f5659.force();
                                    }
                                    str23 = str4622222222222;
                                    str24 = str21;
                                    z13 = z14;
                                } else {
                                    it3 = it2;
                                    str22 = str20;
                                    m8656(file22, strArr, z12);
                                    if ((f6021 || !z12) && (f6022 || !z12)) {
                                        str23 = str4622222222222;
                                        str24 = str21;
                                        z13 = false;
                                    } else {
                                        MappedByteBuffer map3 = channel4.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel4.size());
                                        f5659 = map3;
                                        map3.position(4120);
                                        str23 = str4622222222222;
                                        int m115924 = C2880.m11592(f5659.get(), f5659.get(), f5659.get(), f5659.get());
                                        System.out.println("Start position:" + m115924);
                                        f5659.position(m115924);
                                        boolean z28 = false;
                                        while (true) {
                                            try {
                                                if (!f5659.hasRemaining()) {
                                                    String str54 = str21;
                                                    z13 = z28;
                                                    str24 = str54;
                                                    break;
                                                }
                                                int position6 = f5659.position();
                                                byte b6 = f5659.get();
                                                if (m8653(position6, b6, f5752, f5753, f5754, f5755, z12)) {
                                                    try {
                                                        if (strArr[0].contains("patch")) {
                                                            System.out.println(str19);
                                                        }
                                                        if (strArr[0].contains("restore")) {
                                                            System.out.println(str16);
                                                        }
                                                        f6021 = true;
                                                        z28 = true;
                                                    } catch (Exception e40) {
                                                        exc5 = e40;
                                                        String str55 = str21;
                                                        z13 = z28;
                                                        str24 = str55;
                                                        System.out.println(str22 + exc5);
                                                        channel4.close();
                                                        if (strArr[4].contains("framework")) {
                                                        }
                                                    }
                                                }
                                                try {
                                                    if (m8653(position6, b6, f5756, f5757, f5758, f5759, z12)) {
                                                        if (strArr[0].contains("patch")) {
                                                            System.out.println(str19);
                                                        }
                                                        if (strArr[0].contains("restore")) {
                                                            System.out.println(str16);
                                                        }
                                                        f6021 = true;
                                                        z28 = true;
                                                    }
                                                    if (m8653(position6, b6, f5760, f5761, f5762, f5764, z12)) {
                                                        if (strArr[0].contains("patch")) {
                                                            System.out.println(str19);
                                                        }
                                                        if (strArr[0].contains("restore")) {
                                                            System.out.println(str16);
                                                        }
                                                        f6021 = true;
                                                        z28 = true;
                                                    }
                                                    if (m8653(position6, b6, f5765, f5766, f5767, f5768, z12)) {
                                                        if (strArr[0].contains("patch")) {
                                                            System.out.println("Core4 patched!InstallLocationPolice\n");
                                                        }
                                                        if (strArr[0].contains("restore")) {
                                                            System.out.println(str45222222);
                                                        }
                                                        f6022 = true;
                                                        z28 = true;
                                                    }
                                                    if (m8653(position6, b6, f5782, f5783, f5784, f5785, z12)) {
                                                        if (strArr[0].contains("patch")) {
                                                            System.out.println("Core4 patched!InstallLocationPolice\n");
                                                        }
                                                        if (strArr[0].contains("restore")) {
                                                            System.out.println(str45222222);
                                                        }
                                                        f6022 = true;
                                                        z28 = true;
                                                    }
                                                    if (m8653(position6, b6, f5786, f5787, f5788, f5790, z12)) {
                                                        if (strArr[0].contains("patch")) {
                                                            System.out.println("Core4 patched!InstallLocationPolice\n");
                                                        }
                                                        if (strArr[0].contains("restore")) {
                                                            System.out.println(str45222222);
                                                        }
                                                        f6022 = true;
                                                        z28 = true;
                                                    }
                                                    if (m8653(position6, b6, f5791, f5792, f5793, f5794, z12)) {
                                                        if (strArr[0].contains("patch")) {
                                                            System.out.println("Core4 patched!InstallLocationPolice\n");
                                                        }
                                                        if (strArr[0].contains("restore")) {
                                                            System.out.println(str45222222);
                                                        }
                                                        f6022 = true;
                                                        z28 = true;
                                                    }
                                                    if (m8653(position6, b6, f5795, f5796, f5797, f5798, z12)) {
                                                        if (strArr[0].contains("patch")) {
                                                            System.out.println("Core4 patched!InstallLocationPolice\n");
                                                        }
                                                        if (strArr[0].contains("restore")) {
                                                            System.out.println(str45222222);
                                                        }
                                                        f6022 = true;
                                                        z28 = true;
                                                    }
                                                    if (m8653(position6, b6, f5800, f5801, f5802, f5803, z12)) {
                                                        if (strArr[0].contains("patch")) {
                                                            System.out.println("Core4 patched!InstallLocationPolice\n");
                                                        }
                                                        if (strArr[0].contains("restore")) {
                                                            System.out.println(str45222222);
                                                        }
                                                        f6022 = true;
                                                        z28 = true;
                                                    }
                                                    if (m8653(position6, b6, f5804, f5805, f5806, f5807, z12)) {
                                                        if (strArr[0].contains("patch")) {
                                                            System.out.println(str44222222);
                                                        }
                                                        if (strArr[0].contains("restore")) {
                                                            str25 = str21;
                                                            try {
                                                                System.out.println(str25);
                                                            } catch (Exception e41) {
                                                                exc5 = e41;
                                                                z13 = z28;
                                                                str24 = str25;
                                                                System.out.println(str22 + exc5);
                                                                channel4.close();
                                                                if (strArr[4].contains("framework")) {
                                                                }
                                                            }
                                                        } else {
                                                            str25 = str21;
                                                        }
                                                        f6026 = true;
                                                        z28 = true;
                                                    } else {
                                                        str25 = str21;
                                                    }
                                                    try {
                                                        z13 = z28;
                                                        str24 = str25;
                                                        try {
                                                            if (m8653(position6, b6, f5808, f5809, f5810, f5811, z12)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println(str44222222);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str24);
                                                                }
                                                                f6026 = true;
                                                                z13 = true;
                                                            }
                                                            if (m8653(position6, b6, f5812, f5813, f5814, f5816, z12)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println(str44222222);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str24);
                                                                }
                                                                f6026 = true;
                                                                z13 = true;
                                                            }
                                                            if (m8653(position6, b6, f5769, f5770, f5771, f5773, z12)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println(str44222222);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str24);
                                                                }
                                                                f6026 = true;
                                                                z13 = true;
                                                            }
                                                            if (m8653(position6, b6, f5774, f5775, f5776, f5777, z12)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println(str44222222);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str24);
                                                                }
                                                                f6026 = true;
                                                                z13 = true;
                                                            }
                                                            if (m8653(position6, b6, f5778, f5779, f5780, f5781, z12)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println(str44222222);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str24);
                                                                }
                                                                f6026 = true;
                                                                z13 = true;
                                                            }
                                                            if (m8653(position6, b6, f5817, f5818, f5819, f5820, z12)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println(str19);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str16);
                                                                }
                                                                f6021 = true;
                                                                z13 = true;
                                                            }
                                                            if (m8653(position6, b6, f5821, f5822, f5823, f5824, z12)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println(str19);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str16);
                                                                }
                                                                f6021 = true;
                                                                z13 = true;
                                                            }
                                                            if (m8653(position6, b6, f5825, f5827, f5828, f5829, z12)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println(str19);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str16);
                                                                }
                                                                f6021 = true;
                                                                z13 = true;
                                                            }
                                                            if (m8653(position6, b6, f5847, f5848, f5849, f5850, z12)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println(str19);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str16);
                                                                }
                                                                f6021 = true;
                                                                z13 = true;
                                                            }
                                                            if (m8653(position6, b6, f5851, f5852, f5854, f5855, z12)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println(str19);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str16);
                                                                }
                                                                f6021 = true;
                                                                z13 = true;
                                                            }
                                                            if (m8653(position6, b6, f5856, f5857, f5858, f5859, z12)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println(str19);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str16);
                                                                }
                                                                f6021 = true;
                                                                z13 = true;
                                                            }
                                                            if (m8653(position6, b6, f5860, f5861, f5862, f5863, z12)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println(str19);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str16);
                                                                }
                                                                f6021 = true;
                                                                z13 = true;
                                                            }
                                                            if (m8653(position6, b6, f5864, f5865, f5866, f5868, z12)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println(str19);
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str16);
                                                                }
                                                                f6021 = true;
                                                                z13 = true;
                                                            }
                                                            if (m8653(position6, b6, f5830, f5831, f5832, f5833, z12)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("Core4 patched!InstallLocationPolice\n");
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str45222222);
                                                                }
                                                                f6022 = true;
                                                                z13 = true;
                                                            }
                                                            if (m8653(position6, b6, f5834, f5835, f5836, f5837, z12)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("Core4 patched!InstallLocationPolice\n");
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str45222222);
                                                                }
                                                                f6022 = true;
                                                                z13 = true;
                                                            }
                                                            if (m8653(position6, b6, f5843, f5844, f5845, f5846, z12)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("Core4 patched!InstallLocationPolice\n");
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str45222222);
                                                                }
                                                                f6022 = true;
                                                                z13 = true;
                                                            }
                                                            if (m8653(position6, b6, f5838, f5839, f5840, f5842, z12)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("Core4 patched!InstallLocationPolice\n");
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str45222222);
                                                                }
                                                                f6022 = true;
                                                                z13 = true;
                                                            }
                                                            if (m8653(position6, b6, f5869, f5870, f5871, f5872, z12)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("Core4 patched!InstallLocationPolice\n");
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str45222222);
                                                                }
                                                                f6022 = true;
                                                                z13 = true;
                                                            }
                                                            if (m8653(position6, b6, f5873, f5874, f5875, f5876, z12)) {
                                                                if (strArr[0].contains("patch")) {
                                                                    System.out.println("Core4 patched!InstallLocationPolice\n");
                                                                }
                                                                if (strArr[0].contains("restore")) {
                                                                    System.out.println(str45222222);
                                                                }
                                                                f6022 = true;
                                                                z13 = true;
                                                            }
                                                            if (z12 && f6021 && f6022 && f6026) {
                                                                break;
                                                            }
                                                            f5659.position(position6 + 1);
                                                            boolean z29 = z13;
                                                            str21 = str24;
                                                            z28 = z29;
                                                        } catch (Exception e42) {
                                                            e = e42;
                                                            exc5 = e;
                                                            System.out.println(str22 + exc5);
                                                            channel4.close();
                                                            if (strArr[4].contains("framework")) {
                                                            }
                                                        }
                                                    } catch (Exception e43) {
                                                        e = e43;
                                                        z13 = z28;
                                                        str24 = str25;
                                                    }
                                                } catch (Exception e44) {
                                                    e = e44;
                                                    boolean z30 = z28;
                                                    str24 = str21;
                                                    z13 = z30;
                                                }
                                            } catch (Exception e45) {
                                                e = e45;
                                                String str56 = str21;
                                                z13 = z28;
                                                str24 = str56;
                                            }
                                        }
                                    }
                                }
                                channel4.close();
                                if (strArr[4].contains("framework")) {
                                    System.out.println("Rebuild file!");
                                    if (file22.toString().endsWith("/classes.dex")) {
                                        C2880.m11324(file22);
                                        if (z13) {
                                            f5633 = false;
                                            String replace2 = strArr[1].replace("/services.jar", "/services-patched.jar");
                                            String str57 = strArr[1];
                                            new File(replace2).delete();
                                            ArrayList arrayList14 = new ArrayList();
                                            str26 = str22;
                                            str27 = str24;
                                            System.out.println("add files");
                                            String absolutePath2 = file22.getAbsolutePath();
                                            str28 = str44222222;
                                            StringBuilder sb8 = new StringBuilder();
                                            str29 = str45222222;
                                            sb8.append(C2880.m11357(file22).getAbsolutePath());
                                            sb8.append(InternalZipConstants.ZIP_FILE_SEPARATOR);
                                            arrayList14.add(new C3286(absolutePath2, sb8.toString()));
                                            try {
                                                C2880.m11405(str57, replace2, arrayList14);
                                                System.out.println("add files finish");
                                                new File(str57).delete();
                                            } catch (Exception e46) {
                                                e46.printStackTrace();
                                                new File(replace2).delete();
                                            }
                                        } else {
                                            str26 = str22;
                                            str27 = str24;
                                            str28 = str44222222;
                                            str29 = str45222222;
                                            f5633 = true;
                                        }
                                    } else {
                                        str26 = str22;
                                        str27 = str24;
                                        str28 = str44222222;
                                        str29 = str45222222;
                                    }
                                    if (file22.toString().endsWith("/services.odex")) {
                                        if (!C2880.m11450(file22)) {
                                            C2880.m11325(file22, null);
                                        }
                                        if (z13) {
                                            file22.renameTo(new File(file22.getAbsolutePath().replace("/services.odex", "/services-patched.odex")));
                                        }
                                    }
                                    str30 = str23;
                                    str4622222222222 = str30;
                                    str20 = str26;
                                    str21 = str27;
                                    str44222222 = str28;
                                    str45222222 = str29;
                                    it2 = it3;
                                } else {
                                    str26 = str22;
                                    str27 = str24;
                                    str28 = str44222222;
                                    str29 = str45222222;
                                    if (file22.toString().endsWith("/classes.dex")) {
                                        C2880.m11324(file22);
                                        str30 = str23;
                                    } else {
                                        str30 = str23;
                                        C2880.m11325(file22, str30);
                                    }
                                    if (file22.toString().contains("system@framework@services.jar@classes.dex") && z13) {
                                        System.out.println("LuckyPatcher: dalvik-cache patched! ");
                                    }
                                    if (file22.toString().contains("/classes.dex") && z13) {
                                        System.out.println("start");
                                        if (C2880.m11294(str30, "/system/framework/services.backup", true, false)) {
                                            System.out.println("good space");
                                            new File("/system/framework/services.backup").delete();
                                            ArrayList arrayList15 = new ArrayList();
                                            System.out.println("add files");
                                            arrayList15.add(new C3286("/data/app/classes.dex", "/data/app/"));
                                            try {
                                                C2880.m11405(str30, "/system/framework/services.backup", arrayList15);
                                                System.out.println("add files finish");
                                                C2880.m11508("chmod", "0644", "/system/framework/services.backup");
                                                C2880.m11508("chown", "0:0", "/system/framework/services.backup");
                                                C2880.m11508("chmod", "0.0", "/system/framework/services.backup");
                                                File file23 = new File("/system/framework/services.odex");
                                                File m113632 = C2880.m11363(str30);
                                                if (file23.exists()) {
                                                    try {
                                                        System.out.println("fix odex na osnove rebuild services");
                                                        C2880.m11325(file23, "/system/framework/services.backup");
                                                    } catch (Exception e47) {
                                                        exc6 = e47;
                                                        exc6.printStackTrace();
                                                        System.out.println("LuckyPatcher: odex not equal lenght patched! Not enougth space in /system/!");
                                                        new File("/system/framework/services.backup").delete();
                                                        System.out.println("finish");
                                                        if (!f5607) {
                                                        }
                                                        str4622222222222 = str30;
                                                        str20 = str26;
                                                        str21 = str27;
                                                        str44222222 = str28;
                                                        str45222222 = str29;
                                                        it2 = it3;
                                                    }
                                                }
                                                new File(C3348.f9875 + "/ClearDalvik.on").createNewFile();
                                                new File(str30).delete();
                                                C2880.m11508("rm", str30);
                                                new File("/system/framework/services.backup").renameTo(new File(str30));
                                                if (!new File(str30).exists()) {
                                                    try {
                                                        String[] strArr7 = new String[3];
                                                        strArr7[0] = "mv";
                                                        try {
                                                            strArr7[1] = "/system/framework/services.backup";
                                                            strArr7[2] = str30;
                                                            C2880.m11508(strArr7);
                                                        } catch (Exception e48) {
                                                            e = e48;
                                                            exc6 = e;
                                                            exc6.printStackTrace();
                                                            System.out.println("LuckyPatcher: odex not equal lenght patched! Not enougth space in /system/!");
                                                            new File("/system/framework/services.backup").delete();
                                                            System.out.println("finish");
                                                            if (!f5607) {
                                                            }
                                                            str4622222222222 = str30;
                                                            str20 = str26;
                                                            str21 = str27;
                                                            str44222222 = str28;
                                                            str45222222 = str29;
                                                            it2 = it3;
                                                        }
                                                    } catch (Exception e49) {
                                                        exc6 = e49;
                                                        exc6.printStackTrace();
                                                        System.out.println("LuckyPatcher: odex not equal lenght patched! Not enougth space in /system/!");
                                                        new File("/system/framework/services.backup").delete();
                                                        System.out.println("finish");
                                                        if (!f5607) {
                                                        }
                                                        str4622222222222 = str30;
                                                        str20 = str26;
                                                        str21 = str27;
                                                        str44222222 = str28;
                                                        str45222222 = str29;
                                                        it2 = it3;
                                                    }
                                                }
                                                if (m113632 != null) {
                                                    try {
                                                        strArr2 = new String[2];
                                                        strArr2[0] = "rm";
                                                    } catch (Exception e50) {
                                                        e = e50;
                                                    }
                                                    try {
                                                        strArr2[1] = m113632.getAbsolutePath();
                                                        C2880.m11508(strArr2);
                                                        if (m113632.exists()) {
                                                            m113632.delete();
                                                        }
                                                    } catch (Exception e51) {
                                                        e = e51;
                                                        e.printStackTrace();
                                                        C2880.m11411();
                                                        System.out.println("finish");
                                                        if (!f5607) {
                                                        }
                                                        str4622222222222 = str30;
                                                        str20 = str26;
                                                        str21 = str27;
                                                        str44222222 = str28;
                                                        str45222222 = str29;
                                                        it2 = it3;
                                                    }
                                                }
                                                new File("/data/dalvik-cache/arm/system@framework@arm@boot.oat").delete();
                                                new File("/data/dalvik-cache/arm/system@framework@arm@boot.art").delete();
                                                new File("/data/dalvik-cache/arm64/system@framework@arm@boot.oat").delete();
                                                new File("/data/dalvik-cache/arm64/system@framework@arm@boot.art").delete();
                                                new File("/data/dalvik-cache/x86/system@framework@arm@boot.oat").delete();
                                                new File("/data/dalvik-cache/x86/system@framework@arm@boot.art").delete();
                                                new File("/data/dalvik-cache/x86_64/system@framework@arm@boot.oat").delete();
                                                new File("/data/dalvik-cache/x86_64/system@framework@arm@boot.art").delete();
                                                C2880.m11411();
                                            } catch (Exception e52) {
                                                e = e52;
                                            }
                                            System.out.println("finish");
                                        } else {
                                            new File("/system/framework/services.backup").delete();
                                            File file24 = new File(strArr[2]);
                                            FileChannel channel5 = new RandomAccessFile(file24, InternalZipConstants.WRITE_MODE).getChannel();
                                            f5659 = channel5.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel5.size());
                                            f5711 = null;
                                            f5685 = 0;
                                            while (f5659.hasRemaining()) {
                                                try {
                                                    int position7 = f5659.position();
                                                    byte b7 = f5659.get();
                                                    if (m8653(position7, b7, f5877, f5878, f5879, f5881, z12)) {
                                                        if (strArr[0].contains("patch")) {
                                                            System.out.println(str19);
                                                        }
                                                        if (strArr[0].contains("restore")) {
                                                            System.out.println(str16);
                                                        }
                                                    }
                                                    if (m8653(position7, b7, f5890, f5891, f5892, f5894, z12)) {
                                                        if (strArr[0].contains("patch")) {
                                                            System.out.println(str19);
                                                        }
                                                        if (strArr[0].contains("restore")) {
                                                            System.out.println(str16);
                                                        }
                                                    }
                                                    if (m8653(position7, b7, f5916, f5917, f5918, f5920, z12)) {
                                                        if (strArr[0].contains("patch")) {
                                                            System.out.println(str19);
                                                        }
                                                        if (strArr[0].contains("restore")) {
                                                            System.out.println(str16);
                                                        }
                                                    }
                                                    if (m8653(position7, b7, f5895, f5896, f5897, f5898, z12)) {
                                                        if (strArr[0].contains("patch")) {
                                                            System.out.println("Core4 patched!checkUpgradeKeySetLP\n");
                                                        }
                                                        if (strArr[0].contains("restore")) {
                                                            System.out.println("Core4 restored!checkUpgradeKeySetLP\n");
                                                        }
                                                    }
                                                    if (m8653(position7, b7, f5899, f5900, f5901, f5902, z12)) {
                                                        if (strArr[0].contains("patch")) {
                                                            System.out.println("Core4 patched!\nCM12");
                                                        }
                                                        if (strArr[0].contains("restore")) {
                                                            System.out.println("Core4 restored!\nCM12");
                                                        }
                                                    }
                                                    if (m8653(position7, b7, f5903, f5904, f5905, f5906, z12)) {
                                                        if (strArr[0].contains("patch")) {
                                                            System.out.println("Core4 patched!\nCM12");
                                                        }
                                                        if (strArr[0].contains("restore")) {
                                                            System.out.println("Core4 restored!\nCM12");
                                                        }
                                                    }
                                                    if (m8653(position7, b7, f5882, f5883, f5884, f5885, z12)) {
                                                        if (strArr[0].contains("patch")) {
                                                            System.out.println("Core4 patched!\nCM11");
                                                        }
                                                        if (strArr[0].contains("restore")) {
                                                            System.out.println("Core4 restored!\nCM11");
                                                        }
                                                    }
                                                    if (m8653(position7, b7, f5886, f5887, f5888, f5889, z12)) {
                                                        if (strArr[0].contains("patch")) {
                                                            System.out.println("Core4 policy patched!\n");
                                                        }
                                                        if (strArr[0].contains("restore")) {
                                                            System.out.println("Core4 policy restored!\n");
                                                        }
                                                    }
                                                    if (m8653(position7, b7, f5912, f5913, f5914, f5915, z12)) {
                                                        if (strArr[0].contains("patch")) {
                                                            System.out.println("Core4 policy patched!\n");
                                                        }
                                                        if (strArr[0].contains("restore")) {
                                                            System.out.println("Core4 policy restored!\n");
                                                        }
                                                    }
                                                    f5659.position(position7 + 1);
                                                } catch (Exception e53) {
                                                    e53.printStackTrace();
                                                }
                                            }
                                            int i10 = f5685;
                                            if (i10 > 0 && f5711 != null) {
                                                f5659.position(i10);
                                                f5659.put(f5711);
                                                f5659.force();
                                            }
                                            channel5.close();
                                            if (file24.toString().endsWith("/classes.dex")) {
                                                C2880.m11324(file24);
                                            } else {
                                                C2880.m11325(file24, str30);
                                            }
                                            System.out.println("LuckyPatcher: odex not equal lenght patched! Not enougth space in /system/!");
                                        }
                                    }
                                    if (!f5607) {
                                        if (new File("/system/framework/services.patched").exists()) {
                                            System.out.println("LuckyPatcher: root found services.patched! ");
                                        }
                                        if (new File("/system/framework/services.odex").exists()) {
                                            System.out.println("LuckyPatcher: root found services.odex! ");
                                        }
                                        if (strArr[0].contains("restore")) {
                                            new File("/system/framework/patch3.done").delete();
                                        }
                                    }
                                    str4622222222222 = str30;
                                    str20 = str26;
                                    str21 = str27;
                                    str44222222 = str28;
                                    str45222222 = str29;
                                    it2 = it3;
                                }
                            }
                        } else {
                            throw new FileNotFoundException();
                        }
                    }
                }
                str21 = str18;
                it2 = arrayList7.iterator();
                while (it2.hasNext()) {
                }
            }
        }
        C2880.m11316();
    }

    private static boolean m8653(int i, byte b, byte[] bArr, byte[] bArr2, byte[] bArr3, byte[] bArr4, boolean z) {
        if (bArr != null && b == bArr[0] && z) {
            try {
                f5659.position((bArr.length - 1) + i);
                if (f5659.get() == bArr[bArr.length - 1] || bArr2[bArr.length - 1] == 1) {
                    if (bArr4[0] == 0) {
                        bArr3[0] = b;
                    }
                    f5659.position(i + 1);
                    byte b2 = f5659.get();
                    int i2 = 1;
                    while (true) {
                        if (b2 != bArr[i2] && bArr2[i2] != 1) {
                            f5659.position(i);
                            break;
                        }
                        if (bArr4[i2] == 0) {
                            bArr3[i2] = b2;
                        }
                        if (bArr4[i2] == 3) {
                            bArr3[i2] = (byte) (b2 & RegisterType.DOUBLE_HI);
                        }
                        if (bArr4[i2] == 2) {
                            int i3 = b2 & RegisterType.DOUBLE_HI;
                            bArr3[i2] = (byte) (i3 + (i3 * 16));
                        }
                        if (bArr4[i2] == 20) {
                            bArr3[i2] = (byte) (b2 & RegisterType.DOUBLE_HI);
                        }
                        if (bArr4[i2] == 21) {
                            bArr3[i2] = (byte) ((b2 & RegisterType.DOUBLE_HI) + 16);
                        }
                        i2++;
                        if (i2 == bArr.length) {
                            f5659.position(i);
                            f5659.put(bArr3);
                            f5659.force();
                            return true;
                        }
                        b2 = f5659.get();
                    }
                }
            } catch (IllegalArgumentException unused) {
            }
        }
        return false;
    }

    static void m8654(ArrayList<File> arrayList, String[] strArr, boolean z, boolean z2) {
        boolean z3;
        Iterator<File> it;
        int i;
        Iterator<C2880.C2886> it2;
        Iterator<C2880.C2886> it3;
        Iterator<C2880.C2886> it4;
        Iterator<C2880.C2886> it5;
        Iterator<C3004> it6;
        Iterator<C3004> it7;
        Iterator<C2880.C2886> it8;
        int i2;
        boolean z4 = z;
        try {
            Iterator<File> it9 = arrayList.iterator();
            boolean z5 = false;
            boolean z6 = false;
            while (it9.hasNext()) {
                File next = it9.next();
                if (next.exists()) {
                    if (next.getAbsolutePath().contains("conscrypt")) {
                        z5 = true;
                    }
                    if (next.getAbsolutePath().contains("core-oj")) {
                        z6 = true;
                    }
                }
            }
            Iterator<File> it10 = arrayList.iterator();
            int i3 = 0;
            while (it10.hasNext()) {
                File next2 = it10.next();
                boolean contains = next2.getAbsolutePath().toLowerCase().contains("boot.oat");
                boolean contains2 = next2.getAbsolutePath().toLowerCase().contains("conscrypt");
                boolean contains3 = next2.getAbsolutePath().toLowerCase().contains("core-oj");
                int i4 = i3 + 1;
                System.out.println("oat file for patch:" + next2.getAbsolutePath());
                int i5 = 10;
                if (contains2 && z4 && z5) {
                    C2880.C2887 m11616 = new C2880("").m11616(next2, new C1960());
                    System.out.println(m11616.f7734);
                    try {
                        Iterator<C2880.C2886> it11 = m11616.f7735.iterator();
                        while (it11.hasNext()) {
                            C2880.C2886 next3 = it11.next();
                            System.out.println(next3.f7730);
                            try {
                                if (next3.f7731 != 0 && next2.canWrite()) {
                                    FileChannel channel = new RandomAccessFile(next2, InternalZipConstants.WRITE_MODE).getChannel();
                                    z3 = z5;
                                    try {
                                        f5659 = channel.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel.size());
                                        Iterator<C3004> it12 = f6027.iterator();
                                        while (it12.hasNext()) {
                                            C3004 next4 = it12.next();
                                            int[] iArr = new int[i5];
                                            iArr[0] = 4090;
                                            iArr[1] = 4091;
                                            iArr[2] = 4092;
                                            iArr[3] = 4093;
                                            iArr[4] = 4094;
                                            iArr[5] = 4095;
                                            iArr[6] = 4096;
                                            iArr[7] = 4097;
                                            iArr[8] = 4098;
                                            iArr[9] = 4099;
                                            Iterator<C3004> it13 = it12;
                                            int i6 = 0;
                                            while (true) {
                                                if (i6 < i5) {
                                                    int i7 = iArr[i6];
                                                    it = it10;
                                                    try {
                                                        f5659.position(next3.f7731 + i7);
                                                        byte[] bArr = next4.f8166;
                                                        int length = bArr.length;
                                                        it8 = it11;
                                                        int i8 = 0;
                                                        boolean z7 = true;
                                                        while (i8 < length) {
                                                            i = i4;
                                                            try {
                                                                byte[] bArr2 = bArr;
                                                                if (f5659.get() != bArr[i8]) {
                                                                    z7 = false;
                                                                }
                                                                i8++;
                                                                i4 = i;
                                                                bArr = bArr2;
                                                            } catch (Exception e) {
                                                                e = e;
                                                                try {
                                                                    e.printStackTrace();
                                                                    it10 = it;
                                                                    it11 = it8;
                                                                    z5 = z3;
                                                                    i4 = i;
                                                                    i5 = 10;
                                                                } catch (Exception e2) {
                                                                    e = e2;
                                                                    e.printStackTrace();
                                                                    if (!contains) {
                                                                    }
                                                                    z5 = z3;
                                                                    if (contains3) {
                                                                        C2880.C2887 m116162 = new C2880("").m11616(next2, new C1963(z2, z5, z4));
                                                                        System.out.println(m116162.f7734);
                                                                        try {
                                                                            it2 = m116162.f7735.iterator();
                                                                            while (it2.hasNext()) {
                                                                            }
                                                                        } catch (Exception e3) {
                                                                            e = e3;
                                                                        }
                                                                    }
                                                                    z4 = z;
                                                                    it10 = it;
                                                                    i3 = i;
                                                                }
                                                            }
                                                        }
                                                        i2 = i4;
                                                        if (z7) {
                                                            f5659.position(next3.f7731 + i7);
                                                            f5659.put(next4.f8168);
                                                            f5659.force();
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println("Oat Core1uni patched!\n");
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println("Oat Core1uni restored!\n");
                                                            }
                                                            f6021 = true;
                                                        } else {
                                                            i6++;
                                                            it10 = it;
                                                            it11 = it8;
                                                            i4 = i2;
                                                            i5 = 10;
                                                        }
                                                    } catch (Exception e4) {
                                                        e = e4;
                                                        it8 = it11;
                                                        i = i4;
                                                        e.printStackTrace();
                                                        it10 = it;
                                                        it11 = it8;
                                                        z5 = z3;
                                                        i4 = i;
                                                        i5 = 10;
                                                    }
                                                } else {
                                                    it = it10;
                                                    it8 = it11;
                                                    i2 = i4;
                                                    break;
                                                }
                                            }
                                            it12 = it13;
                                            it10 = it;
                                            it11 = it8;
                                            i4 = i2;
                                            i5 = 10;
                                        }
                                        it = it10;
                                        it8 = it11;
                                        i = i4;
                                        channel.close();
                                    } catch (Exception e5) {
                                        e = e5;
                                        it = it10;
                                        it8 = it11;
                                        i = i4;
                                        e.printStackTrace();
                                        it10 = it;
                                        it11 = it8;
                                        z5 = z3;
                                        i4 = i;
                                        i5 = 10;
                                    }
                                } else {
                                    z3 = z5;
                                    it = it10;
                                    it8 = it11;
                                    i = i4;
                                }
                            } catch (Exception e6) {
                                e = e6;
                                z3 = z5;
                            }
                            it10 = it;
                            it11 = it8;
                            z5 = z3;
                            i4 = i;
                            i5 = 10;
                        }
                    } catch (Exception e7) {
                        e = e7;
                        z3 = z5;
                        it = it10;
                        i = i4;
                    }
                }
                z3 = z5;
                it = it10;
                i = i4;
                if ((!contains && z2 && z3) || (contains && !z3 && (z4 || z2))) {
                    z5 = z3;
                    C2880.C2887 m116163 = new C2880("").m11616(next2, new C1961(z2, z5, z4));
                    System.out.println(m116163.f7734);
                    try {
                        Iterator<C2880.C2886> it14 = m116163.f7735.iterator();
                        while (it14.hasNext()) {
                            C2880.C2886 next5 = it14.next();
                            System.out.println(next5.f7730);
                            if (next5.f7730.equals("boolean java.security.MessageDigest.isEqual(byte[], byte[])")) {
                                System.out.println(next5.f7730);
                                System.out.println(next5.f7731);
                                try {
                                } catch (Exception e8) {
                                    e = e8;
                                    it5 = it14;
                                }
                                if (next5.f7731 != 0 && next2.canWrite()) {
                                    FileChannel channel2 = new RandomAccessFile(next2, InternalZipConstants.WRITE_MODE).getChannel();
                                    f5659 = channel2.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel2.size());
                                    Iterator<C3004> it15 = new C1962().iterator();
                                    while (it15.hasNext()) {
                                        C3004 next6 = it15.next();
                                        int[] iArr2 = {4090, 4091, 4092, 4093, 4094, 4095, 4096, ItemType.TYPE_LIST, ItemType.ANNOTATION_SET_REF_LIST, ItemType.ANNOTATION_SET_ITEM};
                                        int i9 = 0;
                                        while (true) {
                                            if (i9 < 10) {
                                                int i10 = iArr2[i9];
                                                it5 = it14;
                                                try {
                                                    f5659.position(next5.f7731 + i10);
                                                    byte[] bArr3 = next6.f8166;
                                                    int length2 = bArr3.length;
                                                    it7 = it15;
                                                    int i11 = 0;
                                                    boolean z8 = true;
                                                    while (i11 < length2) {
                                                        int[] iArr3 = iArr2;
                                                        byte[] bArr4 = bArr3;
                                                        if (f5659.get() != bArr3[i11]) {
                                                            z8 = false;
                                                        }
                                                        i11++;
                                                        iArr2 = iArr3;
                                                        bArr3 = bArr4;
                                                    }
                                                    int[] iArr4 = iArr2;
                                                    if (z8) {
                                                        f5659.position(next5.f7731 + i10);
                                                        f5659.put(next6.f8168);
                                                        f5659.force();
                                                        if (strArr[0].contains("patch")) {
                                                            System.out.println("Oat Core2 patched!\n");
                                                        }
                                                        if (strArr[0].contains("restore")) {
                                                            System.out.println("Oat Core2 restored!\n");
                                                        }
                                                        f6022 = true;
                                                    } else {
                                                        i9++;
                                                        it14 = it5;
                                                        it15 = it7;
                                                        iArr2 = iArr4;
                                                    }
                                                } catch (Exception e9) {
                                                    e = e9;
                                                    e.printStackTrace();
                                                    if (next5.f7730.equals("boolean com.android.org.conscrypt.OpenSSLSignature.engineVerify(byte[])")) {
                                                    }
                                                    it14 = it5;
                                                }
                                            } else {
                                                it5 = it14;
                                                it7 = it15;
                                                break;
                                            }
                                        }
                                        it14 = it5;
                                        it15 = it7;
                                    }
                                    it5 = it14;
                                    channel2.close();
                                    if (next5.f7730.equals("boolean com.android.org.conscrypt.OpenSSLSignature.engineVerify(byte[])")) {
                                        System.out.println(next5.f7730);
                                        System.out.println(next5.f7731);
                                        if (next5.f7731 != 0 && next2.canWrite()) {
                                            FileChannel channel3 = new RandomAccessFile(next2, InternalZipConstants.WRITE_MODE).getChannel();
                                            f5659 = channel3.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel3.size());
                                            Iterator<C3004> it16 = f6027.iterator();
                                            while (it16.hasNext()) {
                                                C3004 next7 = it16.next();
                                                int[] iArr5 = {4090, 4091, 4092, 4093, 4094, 4095, 4096, ItemType.TYPE_LIST, ItemType.ANNOTATION_SET_REF_LIST, ItemType.ANNOTATION_SET_ITEM};
                                                int i12 = 0;
                                                while (true) {
                                                    if (i12 < 10) {
                                                        int i13 = iArr5[i12];
                                                        f5659.position(next5.f7731 + i13);
                                                        byte[] bArr5 = next7.f8166;
                                                        int length3 = bArr5.length;
                                                        it6 = it16;
                                                        int i14 = 0;
                                                        boolean z9 = true;
                                                        while (i14 < length3) {
                                                            int[] iArr6 = iArr5;
                                                            byte[] bArr6 = bArr5;
                                                            if (f5659.get() != bArr5[i14]) {
                                                                z9 = false;
                                                            }
                                                            i14++;
                                                            iArr5 = iArr6;
                                                            bArr5 = bArr6;
                                                        }
                                                        int[] iArr7 = iArr5;
                                                        if (z9) {
                                                            f5659.position(next5.f7731 + i13);
                                                            f5659.put(next7.f8168);
                                                            f5659.force();
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println("Oat Core1uni patched!\n");
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println("Oat Core1uni restored!\n");
                                                            }
                                                            f6021 = true;
                                                        } else {
                                                            i12++;
                                                            it16 = it6;
                                                            iArr5 = iArr7;
                                                        }
                                                    } else {
                                                        it6 = it16;
                                                        break;
                                                    }
                                                }
                                                it16 = it6;
                                            }
                                            channel3.close();
                                        }
                                    }
                                    it14 = it5;
                                }
                            }
                            it5 = it14;
                            if (next5.f7730.equals("boolean com.android.org.conscrypt.OpenSSLSignature.engineVerify(byte[])")) {
                            }
                            it14 = it5;
                        }
                    } catch (Exception e10) {
                        e10.printStackTrace();
                    }
                } else {
                    z5 = z3;
                }
                if (contains3 && z2 && z6) {
                    C2880.C2887 m1161622 = new C2880("").m11616(next2, new C1963(z2, z5, z4));
                    System.out.println(m1161622.f7734);
                    it2 = m1161622.f7735.iterator();
                    while (it2.hasNext()) {
                        C2880.C2886 next8 = it2.next();
                        System.out.println(next8.f7730);
                        if (next8.f7730.equals("boolean java.security.MessageDigest.isEqual(byte[], byte[])")) {
                            System.out.println(next8.f7730);
                            System.out.println(next8.f7731);
                            if (next8.f7731 != 0 && next2.canWrite()) {
                                FileChannel channel4 = new RandomAccessFile(next2, InternalZipConstants.WRITE_MODE).getChannel();
                                f5659 = channel4.map(FileChannel.MapMode.READ_WRITE, 0L, (int) channel4.size());
                                Iterator<C3004> it17 = new C1964().iterator();
                                while (it17.hasNext()) {
                                    C3004 next9 = it17.next();
                                    int[] iArr8 = {4090, 4091, 4092, 4093, 4094, 4095, 4096, ItemType.TYPE_LIST, ItemType.ANNOTATION_SET_REF_LIST, ItemType.ANNOTATION_SET_ITEM};
                                    int i15 = 0;
                                    int i16 = 10;
                                    while (true) {
                                        if (i15 < i16) {
                                            int i17 = iArr8[i15];
                                            f5659.position(next8.f7731 + i17);
                                            byte[] bArr7 = next9.f8166;
                                            int length4 = bArr7.length;
                                            int i18 = 0;
                                            boolean z10 = true;
                                            while (i18 < length4) {
                                                Iterator<C2880.C2886> it18 = it2;
                                                if (f5659.get() != bArr7[i18]) {
                                                    z10 = false;
                                                }
                                                i18++;
                                                it2 = it18;
                                            }
                                            it4 = it2;
                                            if (z10) {
                                                break;
                                            }
                                            i15++;
                                            it2 = it4;
                                            i16 = 10;
                                        } else {
                                            it4 = it2;
                                            break;
                                        }
                                    }
                                    it2 = it4;
                                }
                                it3 = it2;
                                channel4.close();
                                it2 = it3;
                            }
                        }
                        it3 = it2;
                        it2 = it3;
                    }
                }
                z4 = z;
                it10 = it;
                i3 = i;
            }
            if ((f6021 || f6022) && i3 == arrayList.size() && C3348.f9924 >= 24) {
                System.out.println("patched cache " + C3348.f9875 + "/reboot");
                C2880.m11487();
                C2880.m11316();
            }
        } catch (Exception e11) {
            e11.printStackTrace();
        }
    }

    static boolean m8655(String[] strArr, boolean z) {
        ArrayList arrayList = new ArrayList();
        int i = 10;
        char c = 4;
        char c2 = 3;
        char c3 = 2;
        char c4 = 1;
        char c5 = 0;
        if (arrayList.size() == 0) {
            String[] strArr2 = {"/system/framework/x86/boot.oat", "/system/framework/x86_64/boot.oat", "/system/framework/arm64/boot.oat", "/system/framework/arm/boot.oat", "/system/framework/oat/x86/boot.oat", "/system/framework/oat/x86_64/boot.oat", "/system/framework/oat/arm64/boot.oat", "/system/framework/oat/arm/boot.oat", "/data/dalvik-cache/x86/system@framework@boot.oat", "/data/dalvik-cache/x86_64/system@framework@boot.oat", "/data/dalvik-cache/arm64/system@framework@boot.oat", "/data/dalvik-cache/arm/system@framework@boot.oat", "/data/dalvik-cache/oat/x86/system@framework@boot.oat", "/data/dalvik-cache/oat/x86_64/system@framework@boot.oat", "/data/dalvik-cache/oat/arm64/system@framework@boot.oat", "/data/dalvik-cache/oat/arm/system@framework@boot.oat"};
            int i2 = 0;
            for (int i3 = 16; i2 < i3; i3 = 16) {
                String str = strArr2[i2];
                if (C2880.m11315(str)) {
                    arrayList.add(new File(str));
                }
                i2++;
            }
        }
        Iterator it = arrayList.iterator();
        boolean z2 = false;
        while (it.hasNext()) {
            File file = (File) it.next();
            try {
                Iterator<C2880.C2886> it2 = new C2880("").m11616(file, new C1957()).f7735.iterator();
                while (it2.hasNext()) {
                    C2880.C2886 next = it2.next();
                    System.out.println(next.f7730);
                    if (next.f7730.equals("boolean java.security.Signature.verify(byte[])")) {
                        System.out.println(next.f7730);
                        System.out.println(next.f7731);
                        if (next.f7731 != 0 && file.canWrite()) {
                            try {
                                FileChannel channel = new RandomAccessFile(file, InternalZipConstants.WRITE_MODE).getChannel();
                                f5659 = channel.map(FileChannel.MapMode.READ_WRITE, 0L, channel.size());
                                Iterator<C3004> it3 = f6027.iterator();
                                while (it3.hasNext()) {
                                    C3004 next2 = it3.next();
                                    int[] iArr = new int[i];
                                    iArr[c5] = 4090;
                                    iArr[c4] = 4091;
                                    iArr[c3] = 4092;
                                    iArr[c2] = 4093;
                                    iArr[c] = 4094;
                                    iArr[5] = 4095;
                                    iArr[6] = 4096;
                                    iArr[7] = 4097;
                                    iArr[8] = 4098;
                                    iArr[9] = 4099;
                                    int i4 = 0;
                                    while (true) {
                                        if (i4 < i) {
                                            int i5 = iArr[i4];
                                            f5659.position(next.f7731 + i5);
                                            boolean z3 = true;
                                            for (byte b : next2.f8166) {
                                                if (f5659.get() != b) {
                                                    z3 = false;
                                                }
                                            }
                                            if (z3) {
                                                f5659.position(next.f7731 + i5);
                                                f5659.put(next2.f8168);
                                                f5659.force();
                                                if (strArr[0].contains("patch")) {
                                                    System.out.println("Core4 patched!coreHard\n");
                                                }
                                                if (strArr[0].contains("restore")) {
                                                    System.out.println("Core4 restored!coreHard\n");
                                                }
                                                z2 = true;
                                            } else {
                                                i4++;
                                                i = 10;
                                            }
                                        }
                                    }
                                    i = 10;
                                    c = 4;
                                    c2 = 3;
                                    c3 = 2;
                                    c4 = 1;
                                    c5 = 0;
                                }
                                channel.close();
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                        }
                    }
                    if (next.f7730.equals("boolean java.security.Signature.verify(byte[], int, int)")) {
                        System.out.println(next.f7730);
                        System.out.println(next.f7731);
                        if (next.f7731 != 0 && file.canWrite()) {
                            try {
                                FileChannel channel2 = new RandomAccessFile(file, InternalZipConstants.WRITE_MODE).getChannel();
                                f5659 = channel2.map(FileChannel.MapMode.READ_WRITE, 0L, channel2.size());
                                Iterator<C3004> it4 = f6027.iterator();
                                while (it4.hasNext()) {
                                    C3004 next3 = it4.next();
                                    int[] iArr2 = new int[10];
                                    iArr2[0] = 4090;
                                    iArr2[1] = 4091;
                                    iArr2[2] = 4092;
                                    iArr2[3] = 4093;
                                    iArr2[4] = 4094;
                                    iArr2[5] = 4095;
                                    iArr2[6] = 4096;
                                    try {
                                        iArr2[7] = 4097;
                                    } catch (Exception e2) {
                                        e = e2;
                                        try {
                                            e.printStackTrace();
                                            i = 10;
                                            c = 4;
                                            c2 = 3;
                                            c3 = 2;
                                            c4 = 1;
                                            c5 = 0;
                                        } catch (Exception e3) {
                                            e = e3;
                                            e.printStackTrace();
                                            i = 10;
                                            c = 4;
                                            c2 = 3;
                                            c3 = 2;
                                            c4 = 1;
                                            c5 = 0;
                                        }
                                    }
                                    try {
                                        iArr2[8] = 4098;
                                        try {
                                            iArr2[9] = 4099;
                                            int i6 = 0;
                                            int i7 = 10;
                                            while (true) {
                                                if (i6 < i7) {
                                                    int i8 = iArr2[i6];
                                                    f5659.position(next.f7731 + i8);
                                                    boolean z4 = true;
                                                    for (byte b2 : next3.f8166) {
                                                        if (f5659.get() != b2) {
                                                            z4 = false;
                                                        }
                                                    }
                                                    if (z4) {
                                                        break;
                                                    }
                                                    i6++;
                                                    i7 = 10;
                                                }
                                            }
                                        } catch (Exception e4) {
                                            e = e4;
                                        }
                                    } catch (Exception e5) {
                                        e = e5;
                                        e.printStackTrace();
                                        i = 10;
                                        c = 4;
                                        c2 = 3;
                                        c3 = 2;
                                        c4 = 1;
                                        c5 = 0;
                                    }
                                }
                                channel2.close();
                            } catch (Exception e6) {
                                e = e6;
                            }
                            i = 10;
                            c = 4;
                            c2 = 3;
                            c3 = 2;
                            c4 = 1;
                            c5 = 0;
                        }
                    }
                    i = 10;
                    c = 4;
                    c2 = 3;
                    c3 = 2;
                    c4 = 1;
                    c5 = 0;
                }
            } catch (Exception e7) {
                e = e7;
                e.printStackTrace();
                i = 10;
                c = 4;
                c2 = 3;
                c3 = 2;
                c4 = 1;
                c5 = 0;
            }
            i = 10;
            c = 4;
            c2 = 3;
            c3 = 2;
            c4 = 1;
            c5 = 0;
        }
        return z2;
    }

    static void m8656(File file, String[] strArr, boolean z) {
        C2880.C2887 m11616 = new C2880("").m11616(file, new C1965());
        System.out.println(m11616.f7734);
        try {
            Iterator<C2880.C2886> it = m11616.f7735.iterator();
            while (it.hasNext()) {
                C2880.C2886 next = it.next();
                System.out.println(next.f7730);
                int i = 4093;
                char c = 3;
                int i2 = 4092;
                char c2 = 2;
                int i3 = 4091;
                int i4 = 10;
                if (next.f7730.equals("int com.android.server.pm.PackageManagerService.compareSignatures(android.content.pm.Signature[], android.content.pm.Signature[])") || next.f7730.equals("int com.android.server.pm.PackageManagerServiceUtils.compareSignatures(android.content.pm.Signature[], android.content.pm.Signature[])")) {
                    System.out.println(next.f7730);
                    System.out.println(next.f7731);
                    if (next.f7731 != 0 && file.canWrite()) {
                        FileChannel channel = new RandomAccessFile(file, InternalZipConstants.WRITE_MODE).getChannel();
                        f5659 = channel.map(FileChannel.MapMode.READ_WRITE, 0L, channel.size());
                        Iterator<C3004> it2 = new C1966().iterator();
                        while (it2.hasNext()) {
                            C3004 next2 = it2.next();
                            int[] iArr = new int[i4];
                            iArr[0] = 4090;
                            iArr[1] = i3;
                            iArr[c2] = i2;
                            iArr[c] = i;
                            iArr[4] = 4094;
                            iArr[5] = 4095;
                            iArr[6] = 4096;
                            iArr[7] = 4097;
                            iArr[8] = 4098;
                            iArr[9] = 4099;
                            int i5 = 0;
                            while (true) {
                                if (i5 < i4) {
                                    int i6 = iArr[i5];
                                    f5659.position(next.f7731 + i6);
                                    boolean z2 = true;
                                    for (byte b : next2.f8166) {
                                        if (f5659.get() != b) {
                                            z2 = false;
                                        }
                                    }
                                    if (z2) {
                                        f5659.position(next.f7731 + i6);
                                        f5659.put(next2.f8168);
                                        f5659.force();
                                        if (strArr[0].contains("patch")) {
                                            System.out.println("Core4 patched!\n");
                                        }
                                        if (strArr[0].contains("restore")) {
                                            System.out.println("Core4 restored!\n");
                                        }
                                        f6021 = true;
                                    } else {
                                        i5++;
                                        i4 = 10;
                                    }
                                }
                            }
                            i4 = 10;
                            i = 4093;
                            c = 3;
                            i2 = 4092;
                            c2 = 2;
                            i3 = 4091;
                        }
                        channel.close();
                    }
                }
                if (next.f7730.equals("void com.android.server.pm.PackageManagerService.checkDowngrade(android.content.pm.PackageParser$Package, android.content.pm.PackageInfoLite)")) {
                    System.out.println(next.f7730);
                    System.out.println(next.f7731);
                    if (next.f7731 != 0 && file.canWrite()) {
                        FileChannel channel2 = new RandomAccessFile(file, InternalZipConstants.WRITE_MODE).getChannel();
                        f5659 = channel2.map(FileChannel.MapMode.READ_WRITE, 0L, channel2.size());
                        Iterator<C3004> it3 = new C1955().iterator();
                        while (it3.hasNext()) {
                            C3004 next3 = it3.next();
                            int[] iArr2 = {4090, 4091, 4092, 4093, 4094, 4095, 4096, ItemType.TYPE_LIST, ItemType.ANNOTATION_SET_REF_LIST, ItemType.ANNOTATION_SET_ITEM};
                            int i7 = 0;
                            int i8 = 10;
                            while (true) {
                                if (i7 < i8) {
                                    int i9 = iArr2[i7];
                                    f5659.position(next.f7731 + i9);
                                    boolean z3 = true;
                                    for (byte b2 : next3.f8166) {
                                        if (f5659.get() != b2) {
                                            z3 = false;
                                        }
                                    }
                                    if (z3) {
                                        f5659.position(next.f7731 + i9);
                                        f5659.put(next3.f8168);
                                        f5659.force();
                                        if (strArr[0].contains("patch")) {
                                            System.out.println("Core4 patched!InstallLocationPolice\n");
                                        }
                                        if (strArr[0].contains("restore")) {
                                            System.out.println("Core4 restored!InstallLocationPolice\n");
                                        }
                                        f6022 = true;
                                    } else {
                                        i7++;
                                        i8 = 10;
                                    }
                                }
                            }
                        }
                        channel2.close();
                    }
                }
                if (next.f7730.equals("android.content.pm.PackageParser$Package com.android.server.pm.PackageManagerService.scanPackageDirtyLI(android.content.pm.PackageParser$Package, int, int, long, android.os.UserHandle)")) {
                    System.out.println(next.f7730);
                    System.out.println(next.f7731);
                    System.out.println(next.f7732);
                    if (next.f7731 != 0 && file.canWrite()) {
                        FileChannel channel3 = new RandomAccessFile(file, InternalZipConstants.WRITE_MODE).getChannel();
                        f5659 = channel3.map(FileChannel.MapMode.READ_WRITE, next.f7731 + 4095, next.f7732);
                        while (f5659.hasRemaining()) {
                            int position = f5659.position();
                            byte b3 = f5659.get();
                            if (m8653(position, b3, f5588, f5589, f5590, f5591, z)) {
                                if (strArr[0].contains("patch")) {
                                    System.out.println("Core4 patched!FixForCM\n");
                                }
                                if (strArr[0].contains("restore")) {
                                    System.out.println("Core4 restored!FixForCM\n");
                                }
                                f6026 = true;
                            }
                            if (m8653(position, b3, f5592, f5593, f5594, f5595, z)) {
                                if (strArr[0].contains("patch")) {
                                    System.out.println("Core4 patched!FixForCM\n");
                                }
                                if (strArr[0].contains("restore")) {
                                    System.out.println("Core4 restored!FixForCM\n");
                                }
                                f6026 = true;
                            }
                            if (m8653(position, b3, f5596, f5597, f5598, f5599, z)) {
                                if (strArr[0].contains("patch")) {
                                    System.out.println("Core4 patched!FixForCM\n");
                                }
                                if (strArr[0].contains("restore")) {
                                    System.out.println("Core4 restored!FixForCM\n");
                                }
                                f6026 = true;
                            }
                            if (m8653(position, b3, f5804, f5805, f5806, f5807, z)) {
                                if (strArr[0].contains("patch")) {
                                    System.out.println("Core4 patched!FixForCM\n");
                                }
                                if (strArr[0].contains("restore")) {
                                    System.out.println("Core4 restored!FixForCM\n");
                                }
                                f6026 = true;
                            }
                            if (m8653(position, b3, f5808, f5809, f5810, f5811, z)) {
                                if (strArr[0].contains("patch")) {
                                    System.out.println("Core4 patched!FixForCM\n");
                                }
                                if (strArr[0].contains("restore")) {
                                    System.out.println("Core4 restored!FixForCM\n");
                                }
                                f6026 = true;
                            }
                            if (m8653(position, b3, f5812, f5813, f5814, f5816, z)) {
                                if (strArr[0].contains("patch")) {
                                    System.out.println("Core4 patched!FixForCM\n");
                                }
                                if (strArr[0].contains("restore")) {
                                    System.out.println("Core4 restored!FixForCM\n");
                                }
                                f6026 = true;
                            }
                            if (m8653(position, b3, f5769, f5770, f5771, f5773, z)) {
                                if (strArr[0].contains("patch")) {
                                    System.out.println("Core4 patched!FixForCM\n");
                                }
                                if (strArr[0].contains("restore")) {
                                    System.out.println("Core4 restored!FixForCM\n");
                                }
                                f6026 = true;
                            }
                            if (m8653(position, b3, f5774, f5775, f5776, f5777, z)) {
                                if (strArr[0].contains("patch")) {
                                    System.out.println("Core4 patched!FixForCM\n");
                                }
                                if (strArr[0].contains("restore")) {
                                    System.out.println("Core4 restored!FixForCM\n");
                                }
                                f6026 = true;
                            }
                            if (m8653(position, b3, f5778, f5779, f5780, f5781, z)) {
                                if (strArr[0].contains("patch")) {
                                    System.out.println("Core4 patched!FixForCM\n");
                                }
                                if (strArr[0].contains("restore")) {
                                    System.out.println("Core4 restored!FixForCM\n");
                                }
                                f6026 = true;
                            }
                            f5659.position(position + 1);
                        }
                        channel3.close();
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    static boolean m8657(String[] strArr, boolean z) {
        ArrayList arrayList = new ArrayList();
        char c = 1;
        char c2 = 2;
        char c3 = 3;
        char c4 = 4;
        char c5 = 5;
        String[] strArr2 = {"/system/framework/arm/boot-framework.oat", "/system/framework/arm64/boot-framework.oat", "/system/framework/x86/boot-framework.oat", "/system/framework/x86_64/boot-framework.oat", "/system/framework/oat/arm/boot-framework.oat", "/system/framework/oat/arm64/boot-framework.oat", "/system/framework/oat/x86/boot-framework.oat", "/system/framework/oat/x86_64/boot-framework.oat", "/system/framework/arm/framework.odex", "/system/framework/arm64/framework.odex", "/system/framework/x86/framework.odex", "/system/framework/x86_64/framework.odex", "/system/framework/oat/arm/framework.odex", "/system/framework/oat/arm64/framework.odex", "/system/framework/oat/x86/framework.odex", "/system/framework/oat/x86_64/framework.odex", "/data/dalvik-cache/arm/system@framework@framework.jar@classes.dex", "/data/dalvik-cache/arm64/system@framework@framework.jar@classes.dex", "/data/dalvik-cache/x86/system@framework@framework.jar@classes.dex", "/data/dalvik-cache/x86_64/system@framework@framework.jar@classes.dex", "/data/dalvik-cache/oat/arm/system@framework@framework.jar@classes.dex", "/data/dalvik-cache/oat/arm64/system@framework@framework.jar@classes.dex", "/data/dalvik-cache/oat/x86/system@framework@framework.jar@classes.dex", "/data/dalvik-cache/oat/x86_64/system@framework@framework.jar@classes.dex"};
        int i = 0;
        for (int i2 = 24; i < i2; i2 = 24) {
            String str = strArr2[i];
            if (C2880.m11315(str)) {
                arrayList.add(new File(str));
            }
            i++;
        }
        if (arrayList.size() == 0) {
            String[] strArr3 = {"/system/framework/x86/boot.oat", "/system/framework/x86_64/boot.oat", "/system/framework/arm64/boot.oat", "/system/framework/arm/boot.oat", "/system/framework/oat/x86/boot.oat", "/system/framework/oat/x86_64/boot.oat", "/system/framework/oat/arm64/boot.oat", "/system/framework/oat/arm/boot.oat", "/data/dalvik-cache/x86/system@framework@boot.oat", "/data/dalvik-cache/x86_64/system@framework@boot.oat", "/data/dalvik-cache/arm64/system@framework@boot.oat", "/data/dalvik-cache/arm/system@framework@boot.oat", "/data/dalvik-cache/oat/x86/system@framework@boot.oat", "/data/dalvik-cache/oat/x86_64/system@framework@boot.oat", "/data/dalvik-cache/oat/arm64/system@framework@boot.oat", "/data/dalvik-cache/oat/arm/system@framework@boot.oat"};
            for (int i3 = 0; i3 < 16; i3++) {
                String str2 = strArr3[i3];
                if (C2880.m11315(str2)) {
                    arrayList.add(new File(str2));
                }
            }
        }
        Iterator it = arrayList.iterator();
        boolean z2 = false;
        while (it.hasNext()) {
            File file = (File) it.next();
            try {
                C2880.C2887 m11616 = new C2880("").m11616(file, new C1956());
                System.out.println(m11616.f7734);
                Iterator<C2880.C2886> it2 = m11616.f7735.iterator();
                while (it2.hasNext()) {
                    C2880.C2886 next = it2.next();
                    System.out.println(next.f7730);
                    if (next.f7730.equals("boolean android.content.pm.PackageParser$SigningDetails.checkCapability(android.content.pm.PackageParser$SigningDetails, int)")) {
                        System.out.println(next.f7730);
                        System.out.println(next.f7731);
                        if (next.f7731 != 0 && file.canWrite()) {
                            FileChannel channel = new RandomAccessFile(file, InternalZipConstants.WRITE_MODE).getChannel();
                            f5659 = channel.map(FileChannel.MapMode.READ_WRITE, 0L, channel.size());
                            Iterator<C3004> it3 = f6027.iterator();
                            while (it3.hasNext()) {
                                C3004 next2 = it3.next();
                                int[] iArr = new int[10];
                                iArr[0] = 4090;
                                iArr[c] = 4091;
                                iArr[c2] = 4092;
                                iArr[c3] = 4093;
                                iArr[c4] = 4094;
                                iArr[c5] = 4095;
                                try {
                                    iArr[6] = 4096;
                                    try {
                                        iArr[7] = 4097;
                                        try {
                                            iArr[8] = 4098;
                                            try {
                                                iArr[9] = 4099;
                                                int i4 = 10;
                                                int i5 = 0;
                                                while (true) {
                                                    if (i5 < i4) {
                                                        int i6 = iArr[i5];
                                                        f5659.position(next.f7731 + i6);
                                                        boolean z3 = true;
                                                        for (byte b : next2.f8166) {
                                                            if (f5659.get() != b) {
                                                                z3 = false;
                                                            }
                                                        }
                                                        if (z3) {
                                                            f5659.position(next.f7731 + i6);
                                                            f5659.put(next2.f8168);
                                                            f5659.force();
                                                            if (strArr[0].contains("patch")) {
                                                                System.out.println("Core4 patched!android9 checkCapability\n");
                                                            }
                                                            if (strArr[0].contains("restore")) {
                                                                System.out.println("Core4 restored!android9 checkCapability\n");
                                                            }
                                                            z2 = true;
                                                        } else {
                                                            i5++;
                                                            i4 = 10;
                                                        }
                                                    }
                                                }
                                                c = 1;
                                                c2 = 2;
                                                c3 = 3;
                                                c4 = 4;
                                                c5 = 5;
                                            } catch (Throwable th) {
                                                th = th;
                                                th.printStackTrace();
                                                c = 1;
                                                c2 = 2;
                                                c3 = 3;
                                                c4 = 4;
                                                c5 = 5;
                                            }
                                        } catch (Throwable th2) {
                                            th = th2;
                                            th.printStackTrace();
                                            c = 1;
                                            c2 = 2;
                                            c3 = 3;
                                            c4 = 4;
                                            c5 = 5;
                                        }
                                    } catch (Throwable th3) {
                                        th = th3;
                                        th.printStackTrace();
                                        c = 1;
                                        c2 = 2;
                                        c3 = 3;
                                        c4 = 4;
                                        c5 = 5;
                                    }
                                } catch (Throwable th4) {
                                    th = th4;
                                }
                            }
                            channel.close();
                            c = 1;
                            c2 = 2;
                            c3 = 3;
                            c4 = 4;
                            c5 = 5;
                        }
                    }
                    c = 1;
                    c2 = 2;
                    c3 = 3;
                    c4 = 4;
                    c5 = 5;
                }
            } catch (Throwable th5) {
                th = th5;
            }
            c = 1;
            c2 = 2;
            c3 = 3;
            c4 = 4;
            c5 = 5;
        }
        return z2;
    }

    public static void m8658(File file, String str) {
        try {
            FileInputStream fileInputStream = new FileInputStream(file);
            ZipInputStream zipInputStream = new ZipInputStream(fileInputStream);
            boolean z = false;
            for (ZipEntry nextEntry = zipInputStream.getNextEntry(); nextEntry != null; nextEntry = zipInputStream.getNextEntry()) {
                if (nextEntry.getName().equals("classes.dex")) {
                    FileOutputStream fileOutputStream = new FileOutputStream(str + "/classes.dex");
                    byte[] bArr = new byte[InternalZipConstants.UFT8_NAMES_FLAG];
                    while (true) {
                        int read = zipInputStream.read(bArr);
                        if (read == -1) {
                            break;
                        } else {
                            fileOutputStream.write(bArr, 0, read);
                        }
                    }
                    C2880.m11508("chmod", "777", str + "/classes.dex");
                    C2880.m11508("chown", "0.0", str + "/classes.dex");
                    C2880.m11508("chown", "0:0", str + "/classes.dex");
                    zipInputStream.closeEntry();
                    fileOutputStream.close();
                    z = true;
                }
                if (z) {
                    break;
                }
            }
            zipInputStream.close();
            fileInputStream.close();
        } catch (Exception e) {
            try {
                new ZipFile(file).extractFile("classes.dex", str);
            } catch (ZipException e2) {
                System.out.println("Error classes.dex decompress! " + e2);
                System.out.println("Exception e1" + e.toString());
            } catch (Exception e3) {
                System.out.println("Error classes.dex decompress! " + e3);
                System.out.println("Exception e1" + e.toString());
            }
            System.out.println("Exception e" + e.toString());
        }
    }
}