package com.appsflyer.internal;

import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageItemInfo;
import android.content.pm.PackageManager;
import android.hardware.SensorManager;
import android.os.Build;
import com.appsflyer.AFLogger;
import com.appsflyer.BuildConfig;
import com.facebook.appevents.AppEventsConstants;
import java.lang.reflect.InvocationTargetException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public final class d {

    /* renamed from: ˊ  reason: contains not printable characters */
    public static int f2060 = 0;

    /* renamed from: ˋ  reason: contains not printable characters */
    public static char[] f2061 = {'a', 26883, 53950, 15413, 42459, 3912, 30954, 57813, 19228, 46256, 7726, 34762, 61804, 23265, 50073, 11533, 38569, 19, 27134, 54130, 15592, 42388, 3886, 30883, 57943, 19403, 46443, 7730, 34701, 61751, 23207, 50260, 11717, 38783, 33638, 22598, 63051, 40742, 9361, 51724, 21419, 63838, 36593, 6116, 48446, 17027, 59439, 29141, 1894, 44246, 13737, 56098, 24721, 63061, 'b', 26892, 53944, 15394, 42453, 3908, 30910, 57806, 19281, 46257, 7799, 34716, 61821, 23275, 50127, 11600, 38628, '[', 27038, 54130, 15536, 42388, 3946, 30971, 57948, 19356, 46371, 7705, 34782, 61801, 23287, 50178, 'a', 26883, 53950, 15413, 42459, 3912, 30954, 57813, 19207, 46246, 7788, 34797, 61821, 23293, 50050, 11526, 38562, 'D', 27111, 54134, 15594, 42384, 3897, 30894, 57930, 13186, 23264, 57693, 4054, 38456, 15531, 19209, 53814, 30947, 34647, 11731, 46120, 49800, 26891, 61543, 7909, 42269, 13197, 23084, 57498, 3860, 38525, 15567, 46156, 56622, 26259, 34840, 4598, 47973, 52423, 22008, 65322, 139, 43585, 13251, 17730, 61149, 30645, 39213, 8873, 46193, 56820, 26449, 'a', 26883, 53950, 15413, 42459, 3912, 30954, 57813, 19206, 46256, 7734, 34689, 61769, 23291, 50079, 61669, '\\', 26947, 'j', 26892, 53932, 15398, 42394, 3912, 30945, 57813, 19228, 46264, 7730, 34763, 61813, 23291, '/', 26894, 53947, 15396, 42460, 3908, '.', 26951, 54005, 15387, 42439, 3851, 30886, 57813, 19266, 46332, 4070, 26272, 56602, 13185, 43642, 247, 30558, 60979, 17544, 47880, 4484, 34927, 65225, 21848, 52282, 8873, 39195, 54689, 48363, 1876, 59852, 28726, 55970, 44361, 13416, 40672, 24850, 52162, 21037, 9359, 36686, 5746, 63717, 17236, 54706, 48168, 1744, 59667, 28791, 56013, 44356, 14335, 40501, 24732, 52204, 21091, 9374, 36676, 4524, 63524, 17039, 54765, 48244, 1754, 59721, 29607, 55878, 44239, 'g', 26888, 53934, 15374, 42458, 3922, 30970, 57754, 19204, 46265, 7719, 34763, 61789, 23289, 50054, 11535, 38585, '^', 27083, 54115, 15597, 42398, 3888, 30904, 'C', 26885, 53951, 15396, 42463, 3922, 30971, 57750, 19258, 46256, 7716, 34755, 61817, 23274, 50050, 11558, 38568, '^', 27087, 54119, 15600, 42392, 3889, 30885, 'F', 26892, 53939, 15403, 42449, 3909, 30894, 57746, 19206, 46243, 7725, 34756, 61817, 23209, 50052, 11526, 38582, 'Q', 27087, 54132, 15600, 42388, 3898, 30955, 57941, 19392, 46438, 7703, 34691, 61757, 23270, 50244, 11721, 38777, 18, 27079, 54065, 15545, 42573, 4094, 31096, 57857, 19339, 46368, 7890, 34835, 61878};

    /* renamed from: ˎ  reason: contains not printable characters */
    public static long f2062 = -3054750443639641747L;

    /* renamed from: ˏ  reason: contains not printable characters */
    public static int f2063 = 1;

    /* renamed from: com.appsflyer.internal.d$d  reason: collision with other inner class name */
    public static class C0329d extends HashMap<String, Object> {

        /* renamed from: ˊ  reason: contains not printable characters */
        public static long f2064 = -626218374803194285L;

        /* renamed from: ˋ  reason: contains not printable characters */
        public static char[] f2065 = {'a', 32309, 64761, 31373, 63781, 30706, 62871, 29750, 62188, 28810, 61267, 28129, 'b', 32289, 64711, 31383, 63784, 'N', 32284, 64761, 31419, 63774, 30686, 62908, 29697, 'k', 32310, 64704, 28376, 4236, 37489, 5163, 38807, 6469, 39788, 6812, 40003, 7739, 33253, 861, 34107, 1277, 34397, 2061, 35817, 3357, 36611, 3826, 45220, 12881, 46583, 14254, 47375, 14469, 47783, 15382, 49118, 8625, 41764, 8918, 42150, 9838, 43485, 11159, 44390, 12072, 44675, 20597, 53884, 21973, 50172, 48545, 16215, 47447, 15074, 46129, 13916, 1493, 31625, 63847, 32569, 64651, 29280, 61472, 29059, 63301, 30011, 60133, 26726, 60982, 28656, 60764, '5', 32381, 64662, 31447, 63868, 26585, 6613, 39729, 7459, 40594, 'f', 32306, 64719, 31381, 63785, 30715, 62930, 29730, 62205, 28805, 61275, 28131, 60293, 27203, 59619, 26291, 58711, 25507, 57789, 24652, 56858, 23791, 56148, 22804, 55204, 22126, 54283, 21217, 53603, 20238, 52686, 19557, 51776, 18646, 51070, 17722, 50121, 16783, 49190, 16076, 48279, 15141, 47524, 14289, 'b', 32306, 64708, 31388, 63789, 30714, 62914, 29808, 62124, 28891, 61274, 28072, 60373, 27217, 59576, 26349, 58625, 25531, 'a', 32317, 64706, 31371, 63779, 30710, 62870, 29803, 62193, 28805, 61258, 28148, 60298, 27203, 59556, 26300, 58707, 25591, 57791, 24646, 56850, 23777, 56160, 22836, 55196, 22095, 54315, 21139, 53581, 20280, 52729, 19525, 51745, 18685, 51009, 17692, 50152, 54537, 43851, 10678, 45044, 11348, 41616, 8430, 41292, 10128, 42468, 14886, 'x', 32363, 64656, 's', 32310, 64712, 31370, 63779, 30701, 14288, 10500, 22281, 35171, 63333, '&', 32291, 'f', 32355, 64727, 31433, 63805, 30638, 62850, 29812, 62184, 28889, 61196, 28146, 60300, 27203, 59627, 26288};

        /* renamed from: ˏ  reason: contains not printable characters */
        public static int f2066 = 0;

        /* renamed from: ᐝ  reason: contains not printable characters */
        public static int f2067 = 1;

        /* renamed from: ˎ  reason: contains not printable characters */
        public final Context f2068;

        /* renamed from: ॱ  reason: contains not printable characters */
        public final Map<String, Object> f2069;

        /* renamed from: com.appsflyer.internal.d$d$d  reason: collision with other inner class name */
        public static class C0330d {

            /* renamed from: ˋ  reason: contains not printable characters */
            public final Object f2070;

            /* renamed from: ˎ  reason: contains not printable characters */
            public long f2071;

            /* renamed from: ॱ  reason: contains not printable characters */
            public String f2072;

            public C0330d() {
            }

            /* renamed from: ˊ  reason: contains not printable characters */
            public static byte[] m1222(byte[] bArr) throws Exception {
                for (int i = 0; i < bArr.length; i++) {
                    bArr[i] = (byte) (bArr[i] ^ ((i % 2) + 42));
                }
                return bArr;
            }

            /* renamed from: ˋ  reason: contains not printable characters */
            public static String m1224(byte[] bArr) throws Exception {
                StringBuilder sb = new StringBuilder();
                for (byte b : bArr) {
                    String hexString = Integer.toHexString(b);
                    if (hexString.length() == 1) {
                        hexString = AppEventsConstants.EVENT_PARAM_VALUE_NO.concat(hexString);
                    }
                    sb.append(hexString);
                }
                return sb.toString();
            }

            public final String toString() {
                StringBuilder sb = new StringBuilder();
                sb.append(this.f2071);
                sb.append(",");
                sb.append(this.f2072);
                return sb.toString();
            }

            /* renamed from: ॱ  reason: contains not printable characters */
            public final boolean m1225(long j, String str) {
                synchronized (this.f2070) {
                    if (str != null) {
                        if (!str.equals(this.f2072)) {
                            if (j - this.f2071 > 2000) {
                                this.f2071 = j;
                                this.f2072 = str;
                                return true;
                            }
                        }
                    }
                    return false;
                }
            }

            public C0330d(long j, String str) {
                this.f2070 = new Object();
                this.f2071 = 0;
                this.f2072 = "";
                this.f2071 = j;
                this.f2072 = str;
            }

            /* renamed from: ˋ  reason: contains not printable characters */
            public static C0330d m1223(String str) {
                if (str == null) {
                    return new C0330d(0, "");
                }
                String[] split = str.split(",");
                if (split.length < 2) {
                    return new C0330d(0, "");
                }
                return new C0330d(Long.parseLong(split[0]), split[1]);
            }
        }

        public C0329d(Map<String, Object> map, Context context) {
            this.f2069 = map;
            this.f2068 = context;
            put(m1218(), m1220());
        }

        /* renamed from: ˋ  reason: contains not printable characters */
        private String m1218() {
            int i = f2066 + 11;
            f2067 = i % 128;
            int i2 = i % 2;
            try {
                String num = Integer.toString(Build.VERSION.SDK_INT);
                String obj = this.f2069.get(m1219(12, 0, 0).intern()).toString();
                String obj2 = this.f2069.get(m1219(5, 12, 0).intern()).toString();
                if (!(obj2 != null)) {
                    obj2 = m1219(8, 17, 0).intern();
                }
                StringBuilder sb = new StringBuilder(obj);
                sb.reverse();
                StringBuilder r0 = m1221(num, obj2, sb.toString());
                int length = r0.length();
                if (length > 4) {
                    r0.delete(4, length);
                    int i3 = f2066 + 81;
                    f2067 = i3 % 128;
                    if (i3 % 2 == 0) {
                    }
                } else {
                    while (true) {
                        if ((length < 4 ? '7' : 6) != '7') {
                            break;
                        }
                        length++;
                        r0.append('1');
                    }
                }
                r0.insert(0, m1219(3, 25, 0).intern());
                return r0.toString();
            } catch (Exception e) {
                StringBuilder sb2 = new StringBuilder();
                sb2.append(m1219(42, 28, 28350).intern());
                sb2.append(e);
                AFLogger.afRDLog(sb2.toString());
                return m1219(7, 70, 50071).intern();
            }
        }

        /* renamed from: ˎ  reason: contains not printable characters */
        public static String m1219(int i, int i2, char c) {
            char[] cArr = new char[i];
            int i3 = 0;
            while (true) {
                if ((i3 < i ? '#' : 15) != '#') {
                    return new String(cArr);
                }
                int i4 = f2067 + 121;
                f2066 = i4 % 128;
                int i5 = i4 % 2;
                cArr[i3] = (char) ((int) ((((long) f2065[i2 + i3]) ^ (((long) i3) * f2064)) ^ ((long) c)));
                i3++;
                int i6 = f2067 + 103;
                f2066 = i6 % 128;
                int i7 = i6 % 2;
            }
        }

        /* renamed from: ˏ  reason: contains not printable characters */
        private String m1220() {
            String str;
            int i;
            try {
                String obj = this.f2069.get(m1219(12, 0, 0).intern()).toString();
                String obj2 = this.f2069.get(m1219(15, 77, 1459).intern()).toString();
                String replaceAll = m1219(5, 92, 0).intern().replaceAll(m1219(5, 97, 26612).intern(), "");
                StringBuilder sb = new StringBuilder();
                sb.append(obj);
                sb.append(obj2);
                sb.append(replaceAll);
                String r5 = ai.m1196(sb.toString());
                StringBuilder sb2 = new StringBuilder();
                sb2.append("");
                sb2.append(r5.substring(0, 16));
                str = sb2.toString();
            } catch (Exception e) {
                StringBuilder sb3 = new StringBuilder();
                sb3.append(m1219(44, 102, 0).intern());
                sb3.append(e);
                AFLogger.afRDLog(sb3.toString());
                StringBuilder sb4 = new StringBuilder();
                sb4.append("");
                sb4.append(m1219(18, 146, 0).intern());
                str = sb4.toString();
            }
            try {
                Intent registerReceiver = this.f2068.registerReceiver(null, new IntentFilter(m1219(37, 164, 0).intern()));
                int i2 = -2700;
                if ((registerReceiver != null ? 19 : '9') == 19) {
                    i2 = registerReceiver.getIntExtra(m1219(11, 201, 54653).intern(), -2700);
                    int i3 = f2067 + 85;
                    f2066 = i3 % 128;
                    int i4 = i3 % 2;
                }
                String str2 = this.f2068.getApplicationInfo().nativeLibraryDir;
                if ((str2 != null ? ',' : '-') == ',') {
                    int i5 = f2067 + 109;
                    f2066 = i5 % 128;
                    int i6 = i5 % 2;
                    if (str2.contains(m1219(3, 212, 0).intern())) {
                        i = 1;
                        int size = ((SensorManager) this.f2068.getSystemService(m1219(6, 215, 0).intern())).getSensorList(-1).size();
                        StringBuilder sb5 = new StringBuilder();
                        sb5.append(m1219(1, 221, 14258).intern());
                        sb5.append(i2);
                        sb5.append(m1219(2, 222, 10530).intern());
                        sb5.append(i);
                        sb5.append(m1219(2, 224, 35141).intern());
                        sb5.append(size);
                        sb5.append(m1219(2, 226, 0).intern());
                        sb5.append(this.f2069.size());
                        String obj3 = sb5.toString();
                        StringBuilder sb6 = new StringBuilder();
                        sb6.append(str);
                        sb6.append(C0330d.m1224(C0330d.m1222(obj3.getBytes())));
                        return sb6.toString();
                    }
                }
                i = 0;
                int size2 = ((SensorManager) this.f2068.getSystemService(m1219(6, 215, 0).intern())).getSensorList(-1).size();
                StringBuilder sb52 = new StringBuilder();
                sb52.append(m1219(1, 221, 14258).intern());
                sb52.append(i2);
                sb52.append(m1219(2, 222, 10530).intern());
                sb52.append(i);
                sb52.append(m1219(2, 224, 35141).intern());
                sb52.append(size2);
                sb52.append(m1219(2, 226, 0).intern());
                sb52.append(this.f2069.size());
                String obj32 = sb52.toString();
                StringBuilder sb62 = new StringBuilder();
                sb62.append(str);
                sb62.append(C0330d.m1224(C0330d.m1222(obj32.getBytes())));
                return sb62.toString();
            } catch (Exception e2) {
                StringBuilder sb7 = new StringBuilder();
                sb7.append(m1219(44, 102, 0).intern());
                sb7.append(e2);
                AFLogger.afRDLog(sb7.toString());
                StringBuilder sb8 = new StringBuilder();
                sb8.append(str);
                sb8.append(m1219(16, 228, 0).intern());
                return sb8.toString();
            }
        }

        /* JADX WARNING: Code restructure failed: missing block: B:29:0x0082, code lost:
            r2.append(java.lang.Integer.toHexString(r7.intValue()));
            r3 = r3 + 1;
         */
        /* renamed from: ॱ  reason: contains not printable characters */
        public static StringBuilder m1221(String... strArr) throws Exception {
            ArrayList arrayList = new ArrayList();
            int i = 0;
            while (true) {
                if ((i < 3 ? 'C' : 'V') == 'V') {
                    break;
                }
                arrayList.add(Integer.valueOf(strArr[i].length()));
                i++;
                int i2 = f2066 + 111;
                f2067 = i2 % 128;
                if (i2 % 2 == 0) {
                }
            }
            Collections.sort(arrayList);
            int intValue = ((Integer) arrayList.get(0)).intValue();
            StringBuilder sb = new StringBuilder();
            int i3 = 0;
            while (i3 < intValue) {
                Integer num = null;
                int i4 = 0;
                while (true) {
                    if ((i4 < 3 ? '3' : 'F') == 'F') {
                        break;
                    }
                    int i5 = f2066 + 9;
                    f2067 = i5 % 128;
                    if (i5 % 2 != 0) {
                        int charAt = strArr[i4].charAt(i3);
                        if (num != null) {
                            charAt ^= num.intValue();
                        }
                        num = Integer.valueOf(charAt);
                        i4++;
                    } else {
                        strArr[i4].charAt(i3);
                        throw null;
                    }
                }
            }
            return sb;
        }
    }

    /* renamed from: ˊ  reason: contains not printable characters */
    public static String m1210(Context context) {
        int i = f2063 + 9;
        f2060 = i % 128;
        int i2 = i % 2;
        if ((System.getProperties().containsKey(m1212(14, 172, 0).intern()) ? '!' : 'P') != '!') {
            return null;
        }
        try {
            Matcher matcher = Pattern.compile(m1212(10, 192, 0).intern()).matcher(context.getCacheDir().getPath().replace(m1212(6, 186, 0).intern(), ""));
            if (!(matcher.find())) {
                return null;
            }
            int i3 = f2063 + 119;
            f2060 = i3 % 128;
            int i4 = i3 % 2;
            return matcher.group(1);
        } catch (Exception e) {
            if (ae.f1979 == null) {
                ae.f1979 = new ae();
                int i5 = f2063 + 49;
                f2060 = i5 % 128;
                int i6 = i5 % 2;
            }
            ae aeVar = ae.f1979;
            String intern = m1212(17, 202, 4005).intern();
            StringBuilder sb = new StringBuilder();
            sb.append(m1212(41, 219, 54759).intern());
            sb.append(e);
            aeVar.m1180(null, intern, sb.toString());
            int i7 = f2060 + 79;
            f2063 = i7 % 128;
            int i8 = i7 % 2;
            return null;
        }
    }

    /* renamed from: ˋ  reason: contains not printable characters */
    public static String m1212(int i, int i2, char c) {
        int i3 = f2060 + 69;
        f2063 = i3 % 128;
        int i4 = i3 % 2;
        char[] cArr = new char[i];
        int i5 = 0;
        while (true) {
            if (!(i5 < i)) {
                return new String(cArr);
            }
            cArr[i5] = (char) ((int) ((((long) f2061[i2 + i5]) ^ (((long) i5) * f2062)) ^ ((long) c)));
            i5++;
            int i6 = f2060 + 55;
            f2063 = i6 % 128;
            if (i6 % 2 == 0) {
            }
        }
    }

    /* renamed from: ˎ  reason: contains not printable characters */
    public static String m1213(String str, Long l) {
        if (str == null || l == null || str.length() != 32) {
            return m1212(32, 54, 0).intern();
        }
        StringBuilder sb = new StringBuilder(str);
        String obj = l.toString();
        long j = 0;
        int i = 0;
        int i2 = 0;
        while (true) {
            if ((i < obj.length() ? '`' : 27) != '`') {
                break;
            }
            int i3 = f2060 + 35;
            f2063 = i3 % 128;
            int i4 = i3 % 2;
            i2 += Character.getNumericValue(obj.charAt(i));
            i++;
        }
        String hexString = Integer.toHexString(i2);
        sb.replace(7, hexString.length() + 7, hexString);
        int i5 = 0;
        while (true) {
            if ((i5 < sb.length() ? 'Q' : 'S') == 'S') {
                break;
            }
            int i6 = f2060 + 69;
            f2063 = i6 % 128;
            int i7 = i6 % 2;
            j += (long) Character.getNumericValue(sb.charAt(i5));
            i5++;
        }
        while (true) {
            if (!(j > 100)) {
                break;
            }
            j %= 100;
        }
        sb.insert(23, (int) j);
        if (j < 10) {
            int i8 = f2060 + 3;
            f2063 = i8 % 128;
            if ((i8 % 2 == 0 ? '>' : 'P') != 'P') {
                sb.insert(121, m1212(0, 18, 22646).intern());
            } else {
                sb.insert(23, m1212(1, 35, 22646).intern());
            }
        }
        String obj2 = sb.toString();
        int i9 = f2060 + 65;
        f2063 = i9 % 128;
        if ((i9 % 2 == 0 ? '\b' : '@') == '@') {
            return obj2;
        }
        int i10 = 69 / 0;
        return obj2;
    }

    /* JADX WARNING: Removed duplicated region for block: B:13:0x007b  */
    /* JADX WARNING: Removed duplicated region for block: B:21:0x00a3  */
    /* JADX WARNING: Removed duplicated region for block: B:24:0x00b9  */
    /* JADX WARNING: Removed duplicated region for block: B:25:0x00bc  */
    /* JADX WARNING: Removed duplicated region for block: B:27:0x00c0  */
    /* JADX WARNING: Removed duplicated region for block: B:28:0x00cf  */
    /* JADX WARNING: Removed duplicated region for block: B:34:0x0132  */
    /* JADX WARNING: Removed duplicated region for block: B:35:0x0137  */
    /* JADX WARNING: Removed duplicated region for block: B:38:0x0156  */
    /* JADX WARNING: Removed duplicated region for block: B:39:0x015b  */
    /* JADX WARNING: Removed duplicated region for block: B:42:0x017b  */
    /* JADX WARNING: Removed duplicated region for block: B:43:0x0180  */
    /* JADX WARNING: Removed duplicated region for block: B:46:0x019d  */
    /* JADX WARNING: Removed duplicated region for block: B:47:0x01a2  */
    /* renamed from: ˏ  reason: contains not printable characters */
    public static String m1215(Context context, long j) {
        String str;
        String r12;
        String r122;
        String str2;
        StringBuilder sb = new StringBuilder();
        StringBuilder sb2 = new StringBuilder();
        StringBuilder sb3 = new StringBuilder();
        if (m1214(m1212(34, 0, 0).intern())) {
            int i = f2060 + 39;
            f2063 = i % 128;
            if ((i % 2 == 0 ? 'X' : 'R') != 'R') {
                str = m1212(1, 110, 33623).intern();
                sb2.append(str);
                StringBuilder sb4 = new StringBuilder();
                String packageName = context.getPackageName();
                String r123 = m1216(packageName);
                sb2.append(m1212(1, 34, 33623).intern());
                sb4.append(r123);
                if (m1210(context) != null) {
                    int i2 = f2063 + 11;
                    f2060 = i2 % 128;
                    if ((i2 % 2 != 0 ? 'V' : '7') != '7') {
                        r122 = m1212(0, 2, 22646);
                    } else {
                        r122 = m1212(1, 35, 22646);
                    }
                    sb2.append(r122.intern());
                    sb4.append(packageName);
                } else {
                    sb2.append(m1212(1, 34, 33623).intern());
                    sb4.append(packageName);
                }
                r12 = m1217(context);
                if ((r12 != null ? '8' : '&') == '8') {
                    sb2.append(m1212(1, 34, 33623).intern());
                    sb4.append(r12);
                } else {
                    sb2.append(m1212(1, 35, 22646).intern());
                    sb4.append(packageName);
                }
                sb4.append(m1211(context, packageName));
                sb.append(sb4.toString());
                sb.append(new SimpleDateFormat(m1212(18, 36, 63026).intern(), Locale.US).format(new Date(context.getPackageManager().getPackageInfo(context.getPackageName(), 0).firstInstallTime)));
                sb.append(j);
                sb3.append((!m1214(m1212(25, 86, 0).intern()) ? m1212(1, 34, 33623) : m1212(1, 35, 22646)).intern());
                sb3.append((!m1214(m1212(23, 111, 13283).intern()) ? m1212(1, 34, 33623) : m1212(1, 35, 22646)).intern());
                sb3.append((!m1214(m1212(20, 134, 46125).intern()) ? m1212(1, 34, 33623) : m1212(1, 35, 22646)).intern());
                sb3.append((!m1214(m1212(15, 154, 0).intern()) ? m1212(1, 34, 33623) : m1212(1, 35, 22646)).intern());
                String r0 = ai.m1199(ai.m1196(sb.toString()));
                String obj = sb2.toString();
                StringBuilder sb5 = new StringBuilder(r0);
                sb5.setCharAt(17, Integer.toString(Integer.parseInt(obj, 2), 16).charAt(0));
                String obj2 = sb5.toString();
                String obj3 = sb3.toString();
                StringBuilder sb6 = new StringBuilder(obj2);
                sb6.setCharAt(27, Integer.toString(Integer.parseInt(obj3, 2), 16).charAt(0));
                return m1213(sb6.toString(), Long.valueOf(j));
            }
            str2 = m1212(1, 34, 33623);
        } else {
            str2 = m1212(1, 35, 22646);
        }
        str = str2.intern();
        sb2.append(str);
        StringBuilder sb42 = new StringBuilder();
        String packageName2 = context.getPackageName();
        String r1232 = m1216(packageName2);
        sb2.append(m1212(1, 34, 33623).intern());
        sb42.append(r1232);
        if (m1210(context) != null) {
        }
        r12 = m1217(context);
        if ((r12 != null ? '8' : '&') == '8') {
        }
        sb42.append(m1211(context, packageName2));
        sb.append(sb42.toString());
        try {
            sb.append(new SimpleDateFormat(m1212(18, 36, 63026).intern(), Locale.US).format(new Date(context.getPackageManager().getPackageInfo(context.getPackageName(), 0).firstInstallTime)));
            sb.append(j);
            sb3.append((!m1214(m1212(25, 86, 0).intern()) ? m1212(1, 34, 33623) : m1212(1, 35, 22646)).intern());
            sb3.append((!m1214(m1212(23, 111, 13283).intern()) ? m1212(1, 34, 33623) : m1212(1, 35, 22646)).intern());
            sb3.append((!m1214(m1212(20, 134, 46125).intern()) ? m1212(1, 34, 33623) : m1212(1, 35, 22646)).intern());
            sb3.append((!m1214(m1212(15, 154, 0).intern()) ? m1212(1, 34, 33623) : m1212(1, 35, 22646)).intern());
            String r02 = ai.m1199(ai.m1196(sb.toString()));
            String obj4 = sb2.toString();
            StringBuilder sb52 = new StringBuilder(r02);
            sb52.setCharAt(17, Integer.toString(Integer.parseInt(obj4, 2), 16).charAt(0));
            String obj22 = sb52.toString();
            String obj32 = sb3.toString();
            StringBuilder sb62 = new StringBuilder(obj22);
            sb62.setCharAt(27, Integer.toString(Integer.parseInt(obj32, 2), 16).charAt(0));
            return m1213(sb62.toString(), Long.valueOf(j));
        } catch (PackageManager.NameNotFoundException unused) {
            return m1212(32, 54, 0).intern();
        }
    }

    /* renamed from: ॱ  reason: contains not printable characters */
    public static String m1217(Context context) {
        int i = f2060 + 29;
        f2063 = i % 128;
        int i2 = i % 2;
        try {
            boolean z = false;
            String str = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).packageName;
            int i3 = f2063 + 121;
            f2060 = i3 % 128;
            if (i3 % 2 == 0) {
                z = true;
            }
            if (z) {
                return str;
            }
            throw null;
        } catch (PackageManager.NameNotFoundException unused) {
            return null;
        }
    }

    /* renamed from: ˊ  reason: contains not printable characters */
    public static String m1211(Context context, String str) {
        int i = f2060 + 95;
        f2063 = i % 128;
        int i2 = i % 2;
        try {
            Iterator it2 = ((List) PackageManager.class.getDeclaredMethod(m1212(24, BuildConfig.VERSION_CODE, 0).intern(), Integer.TYPE).invoke(context.getPackageManager(), 0)).iterator();
            int i3 = f2060 + 45;
            while (true) {
                f2063 = i3 % 128;
                int i4 = i3 % 2;
                if (!it2.hasNext()) {
                    break;
                }
                if (((PackageItemInfo) ((ApplicationInfo) it2.next())).packageName.equals(str)) {
                    return Boolean.TRUE.toString();
                }
                i3 = f2060 + 21;
            }
        } catch (IllegalAccessException e) {
            if (ae.f1979 == null) {
                ae.f1979 = new ae();
            }
            ae aeVar = ae.f1979;
            String intern = m1212(24, 284, 0).intern();
            StringBuilder sb = new StringBuilder();
            sb.append(m1212(47, 308, 0).intern());
            sb.append(e);
            aeVar.m1180(null, intern, sb.toString());
        } catch (NoSuchMethodException e2) {
            if (ae.f1979 == null) {
                ae.f1979 = new ae();
            }
            ae aeVar2 = ae.f1979;
            String intern2 = m1212(24, 284, 0).intern();
            StringBuilder sb2 = new StringBuilder();
            sb2.append(m1212(47, 308, 0).intern());
            sb2.append(e2);
            aeVar2.m1180(null, intern2, sb2.toString());
        } catch (InvocationTargetException e3) {
            if (ae.f1979 == null) {
                ae.f1979 = new ae();
                int i5 = f2060 + 23;
                f2063 = i5 % 128;
                int i6 = i5 % 2;
            }
            ae aeVar3 = ae.f1979;
            String intern3 = m1212(24, 284, 0).intern();
            StringBuilder sb3 = new StringBuilder();
            sb3.append(m1212(47, 308, 0).intern());
            sb3.append(e3);
            aeVar3.m1180(null, intern3, sb3.toString());
        }
        return Boolean.FALSE.toString();
    }

    /* renamed from: ˎ  reason: contains not printable characters */
    public static boolean m1214(String str) {
        int i = f2060 + 125;
        f2063 = i % 128;
        int i2 = i % 2;
        try {
            Class.forName(str);
            int i3 = f2063 + 59;
            f2060 = i3 % 128;
            int i4 = i3 % 2;
            return true;
        } catch (ClassNotFoundException unused) {
            return false;
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:10:0x003c, code lost:
        r10 = r10.split(m1212(2, 170, 0).intern());
        r0 = r10.length;
        r6 = new java.lang.StringBuilder();
        r0 = r0 - 1;
        r6.append(r10[r0]);
        r6.append(m1212(1, 169, 61643).intern());
        r7 = com.appsflyer.internal.d.f2063 + 75;
        com.appsflyer.internal.d.f2060 = r7 % 128;
        r7 = r7 % 2;
        r7 = 1;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:12:0x006d, code lost:
        if (r7 >= r0) goto L_0x0072;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:13:0x006f, code lost:
        r9 = 'G';
     */
    /* JADX WARNING: Code restructure failed: missing block: B:14:0x0072, code lost:
        r9 = 'O';
     */
    /* JADX WARNING: Code restructure failed: missing block: B:15:0x0074, code lost:
        if (r9 == 'O') goto L_0x0092;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:16:0x0076, code lost:
        r8 = com.appsflyer.internal.d.f2060 + 65;
        com.appsflyer.internal.d.f2063 = r8 % 128;
        r8 = r8 % 2;
        r6.append(r10[r7]);
        r6.append(m1212(1, 169, 61643).intern());
        r7 = r7 + 1;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:17:0x0092, code lost:
        r6.append(r10[0]);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:18:0x009b, code lost:
        return r6.toString();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:6:0x002a, code lost:
        if ((!r10.contains(m1212(0, 28808, 61643).intern()) ? '7' : 11) != '7') goto L_0x003c;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:8:0x0039, code lost:
        if (r10.contains(m1212(1, 169, 61643).intern()) == false) goto L_0x003b;
     */
    /* renamed from: ˏ  reason: contains not printable characters */
    public static String m1216(String str) {
        int i = f2063 + 37;
        f2060 = i % 128;
        if (i % 2 != 0) {
        }
        return str;
    }
}
