导航菜单

页面标题

页面副标题

jsgt v4.8.1 - MainActivity.java 源代码

正在查看: jsgt v4.8.1 应用的 MainActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.wind.im;

import android.content.Context;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Looper;
import android.text.TextUtils;
import android.util.Base64;
import android.webkit.WebSettings;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.lifecycle.Observer;
import b0.f;
import b0.i;
import b0.l;
import b0.m;
import b0.n;
import com.blankj.utilcode.util.ToastUtils;
import com.google.gson.Gson;
import com.jeremyliao.liveeventbus.LiveEventBus;
import com.just.agentweb.AgentWebConfig;
import com.tencent.mmkv.MMKV;
import com.wind.im.MainActivity;
import com.wind.imlib.WindClient;
import com.wind.imlib.api.response.w;
import dg.j;
import dg.k;
import dj.z;
import ig.d1;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.security.KeyStore;
import java.security.SecureRandom;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;
import qe.a;
import qh.v0;
import qi.o;
import qi.p;
import qk.d0;
import qk.e;
import qk.f0;
import qk.q;
import qk.v;
import qk.x;
import qk.y;
import tv.danmaku.ijk.media.exo2.BuildConfig;

public class MainActivity extends a {
    public static final int j = 0;
    public final CopyOnWriteArrayList<String> b = new CopyOnWriteArrayList<>();
    public int c = 0;
    public int d = 0;
    public final CopyOnWriteArrayList<String> e = new CopyOnWriteArrayList<>();
    public ArrayList f = new ArrayList();
    public boolean g = false;
    public boolean h = false;
    public final Timer i = new Timer();

    public class b implements e {
        public b() {
        }

        @Override
        public final void a(@NonNull x xVar, @NonNull IOException iOException) {
            boolean isEmpty = TextUtils.isEmpty(MMKV.p("MMKV_LAST_REQUEST_TIME").g("data"));
            MainActivity mainActivity = MainActivity.this;
            if (isEmpty) {
                String c = b0.e.c(b0.e.b(b0.e.a("gagn60XjEx6oNEb9NCUEyTwp79gF4bYKy6Bl47NsovEl1YLYAm0HJXrgBB3FkN539wugjJghVIdK45mRn+AAJ4LpaRM+4Fbm3PPX0SqYF/fJWD/+gw0netoT3tjd1S31Jrco4KpVJOHDNJTHdM+pyb/y+QKGcFk2E0K1TcajBUuPqBSmLTVltZMVJMOt17juFMZSkH3GLmmsHsSiQ2lwBQXswrvgrTnuXf1lGKFFs3h/6Hh/et33fOSG2WWhSI2JlT2ucmkegugvL7WlANGldFdnr9liGzALOEzDwzpdYA2ApIi6oNNEFMt6EtFzhNedBPMgCxmbOaio3nL30GLmwpr3LTweV7svTS4bNGptyrzF8uE8iwXtyUFqXg3MrPK4a8db7avBjB5Qppo8+xqiCMHA2yNRuSfqKx8MiiDQf7sWk0Po2Ni4BSD9yP5wy4nftb+VaM4zVH4EcmilloLgslMD3qg3+nQclM96/73uD80gM97U1m0w7LF8dMbRP5PLlY147MDS0g46puIej207Sk3owS4CwpAFS/EN1mWk5rENZ2uLsd7xXrbl1Zv8tO0IzS2GuTzdk1DhdpFD/2Dx53iB26LFoAIYmzJ4byf6CDQ/Ka29Wd7V+6WSwe92W75iKYuTy/yuDbm308KLOpRM6w==")));
                int i = MainActivity.j;
                mainActivity.L(c);
            } else {
                String g = MMKV.p("MMKV_LAST_REQUEST_TIME").g("data");
                int i2 = MainActivity.j;
                mainActivity.L(g);
            }
        }

        @Override
        public final void b(@NonNull x xVar, @NonNull d0 d0Var) throws IOException {
            String str;
            f0 f0Var = d0Var.g;
            if (f0Var == null) {
                return;
            }
            try {
                str = f0Var.t();
            } catch (Exception e) {
                ToastUtils.a("服务器开小差了");
                ol.a.c.e(e, new Object[0]);
                str = "gagn60XjEx6oNEb9NCUEyTwp79gF4bYKy6Bl47NsovEl1YLYAm0HJXrgBB3FkN539wugjJghVIdK45mRn+AAJ4LpaRM+4Fbm3PPX0SqYF/fJWD/+gw0netoT3tjd1S31Jrco4KpVJOHDNJTHdM+pyb/y+QKGcFk2E0K1TcajBUuPqBSmLTVltZMVJMOt17juFMZSkH3GLmmsHsSiQ2lwBQXswrvgrTnuXf1lGKFFs3h/6Hh/et33fOSG2WWhSI2JlT2ucmkegugvL7WlANGldFdnr9liGzALOEzDwzpdYA2ApIi6oNNEFMt6EtFzhNedBPMgCxmbOaio3nL30GLmwpr3LTweV7svTS4bNGptyrzF8uE8iwXtyUFqXg3MrPK4a8db7avBjB5Qppo8+xqiCMHA2yNRuSfqKx8MiiDQf7sWk0Po2Ni4BSD9yP5wy4nftb+VaM4zVH4EcmilloLgslMD3qg3+nQclM96/73uD80gM97U1m0w7LF8dMbRP5PLlY147MDS0g46puIej207Sk3owS4CwpAFS/EN1mWk5rENZ2uLsd7xXrbl1Zv8tO0IzS2GuTzdk1DhdpFD/2Dx53iB26LFoAIYmzJ4byf6CDQ/Ka29Wd7V+6WSwe92W75iKYuTy/yuDbm308KLOpRM6w==";
            }
            f0Var.close();
            String c = b0.e.c(b0.e.b(b0.e.a(str)));
            MMKV.p("MMKV_LAST_REQUEST_TIME").m("data", c);
            MMKV.p("MMKV_LAST_REQUEST_TIME").l("time", System.currentTimeMillis());
            int i = MainActivity.j;
            MainActivity.this.L(c);
        }
    }

    public class c implements o<Long> {
        public c() {
        }

        @Override
        public final void onComplete() {
        }

        @Override
        public final void onError(Throwable th2) {
        }

        @Override
        public final void onNext(Long l) {
            String R = a0.c.R();
            if (TextUtils.isEmpty(R)) {
                aa.a.q("/wind/login");
            } else {
                WindClient.m().b();
                ol.a.c("token:" + R + "  id:" + a0.c.S(), new Object[0]);
                r.a.b().getClass();
                r.a.a("/home/kit/").navigation();
            }
            MainActivity.this.finish();
        }

        @Override
        public final void onSubscribe(si.c cVar) {
        }
    }

    public class d implements e {
        public final boolean a;
        public final String b;
        public final f.a c;

        public d(boolean z, String str, f.a aVar) {
            this.a = z;
            this.b = str;
            this.c = aVar;
        }

        @Override
        public final void a(x xVar, IOException iOException) {
            MMKV.i().m("dns_server_result", "");
            int i = MainActivity.j;
            MainActivity.this.N(this.a);
        }

        @Override
        public final void b(x xVar, d0 d0Var) throws IOException {
            f0 f0Var = d0Var.g;
            boolean z = this.a;
            MainActivity mainActivity = MainActivity.this;
            if (f0Var == null || TextUtils.isEmpty(f0Var.toString())) {
                int i = MainActivity.j;
                mainActivity.N(z);
                return;
            }
            if (((w) new Gson().b(w.class, f0Var.t())).getCode() != 200) {
                int i2 = MainActivity.j;
                mainActivity.N(z);
                return;
            }
            MMKV.i().m("dns_server_result", this.b);
            n nVar = new n();
            n.a aVar = new n.a();
            nVar.data = aVar;
            f.a aVar2 = this.c;
            aVar.setFile((String) aVar2.h.get(0));
            nVar.data.setServer((String) aVar2.g.get(0));
            nVar.data.setPort(Integer.valueOf(aVar2.c));
            nVar.data.setIsSSL(Boolean.valueOf(aVar2.b == 1));
            nVar.setCode(200);
            String g = new Gson().g(nVar);
            int i3 = MainActivity.j;
            mainActivity.L(g);
        }
    }

    public static String E(CopyOnWriteArrayList<String> copyOnWriteArrayList) {
        HashMap hashMap = new HashMap();
        Iterator<String> it2 = copyOnWriteArrayList.iterator();
        while (it2.hasNext()) {
            String next = it2.next();
            if (hashMap.containsKey(next)) {
                hashMap.put(next, Integer.valueOf(((Integer) hashMap.get(next)).intValue() + 1));
            } else {
                hashMap.put(next, 1);
            }
        }
        int i = 0;
        String str = null;
        for (String str2 : hashMap.keySet()) {
            int intValue = ((Integer) hashMap.get(str2)).intValue();
            if (intValue > i) {
                str = str2;
                i = intValue;
            }
        }
        return str;
    }

    public static String F(int i, boolean z, boolean z2) {
        char nextInt;
        SecureRandom secureRandom = new SecureRandom();
        StringBuilder sb = new StringBuilder();
        for (int i2 = 0; i2 < i; i2++) {
            StringBuilder sb2 = new StringBuilder();
            for (int i3 = 0; i3 < 5; i3++) {
                int i4 = z ? 65 : 97;
                if (!z2) {
                    nextInt = (char) (secureRandom.nextInt(26) + i4);
                } else if (secureRandom.nextBoolean()) {
                    nextInt = (char) (secureRandom.nextInt(26) + i4);
                    sb2.append(nextInt);
                } else {
                    sb2.append(secureRandom.nextInt(9) + 1);
                    nextInt = 0;
                }
                sb2.append(nextInt);
            }
            sb.append(",");
            sb.append((CharSequence) sb2);
        }
        return sb.toString().replaceFirst(",", "").replaceAll("\u0000", "");
    }

    public final List<String> H() {
        return this.f.size() == 0 ? Arrays.asList("aHR0cHM6Ly80My4xMzkuMjE3LjIyODoxMzk3OC9sb2dzL3drZHNqNmtzZmhzeg==", "aHR0cHM6Ly8xMTkuOTEuMjAyLjExMDoxMzk3OC9sb2dzL3drZHNqNmtzZmhzeg==") : this.f;
    }

    public final void I() {
        this.g = true;
        if (b0.c.a(getApplicationContext()) == -1) {
            L(TextUtils.isEmpty(MMKV.p("MMKV_LAST_REQUEST_TIME").g("data")) ? b0.e.c(b0.e.b(b0.e.a("gagn60XjEx6oNEb9NCUEyTwp79gF4bYKy6Bl47NsovEl1YLYAm0HJXrgBB3FkN539wugjJghVIdK45mRn+AAJ4LpaRM+4Fbm3PPX0SqYF/fJWD/+gw0netoT3tjd1S31Jrco4KpVJOHDNJTHdM+pyb/y+QKGcFk2E0K1TcajBUuPqBSmLTVltZMVJMOt17juFMZSkH3GLmmsHsSiQ2lwBQXswrvgrTnuXf1lGKFFs3h/6Hh/et33fOSG2WWhSI2JlT2ucmkegugvL7WlANGldFdnr9liGzALOEzDwzpdYA2ApIi6oNNEFMt6EtFzhNedBPMgCxmbOaio3nL30GLmwpr3LTweV7svTS4bNGptyrzF8uE8iwXtyUFqXg3MrPK4a8db7avBjB5Qppo8+xqiCMHA2yNRuSfqKx8MiiDQf7sWk0Po2Ni4BSD9yP5wy4nftb+VaM4zVH4EcmilloLgslMD3qg3+nQclM96/73uD80gM97U1m0w7LF8dMbRP5PLlY147MDS0g46puIej207Sk3owS4CwpAFS/EN1mWk5rENZ2uLsd7xXrbl1Zv8tO0IzS2GuTzdk1DhdpFD/2Dx53iB26LFoAIYmzJ4byf6CDQ/Ka29Wd7V+6WSwe92W75iKYuTy/yuDbm308KLOpRM6w=="))) : MMKV.p("MMKV_LAST_REQUEST_TIME").g("data"));
        } else {
            init();
        }
    }

    public final void K(String str, boolean z) {
        try {
            f.a a = f.a(str, "2A0419d61C319f58".getBytes(), "v31AC039w76E245a".getBytes());
            ArrayList arrayList = new ArrayList();
            if (a.a == 3) {
                v.b bVar = new v.b();
                TimeUnit timeUnit = TimeUnit.MILLISECONDS;
                bVar.b(6000L, timeUnit);
                bVar.c(12000L, timeUnit);
                bVar.e(12000L, timeUnit);
                bVar.a(new og.e());
                bVar.a(new og.d());
                bVar.a(b0.d.a);
                bVar.b = null;
                v vVar = new v(bVar);
                String str2 = (String) a.g.get(0);
                if (!str2.startsWith("http")) {
                    StringBuilder sb = new StringBuilder("http");
                    sb.append(String.valueOf((int) a.b).equals("1") ? "s" : "");
                    sb.append("://");
                    sb.append(str2);
                    sb.append(TextUtils.isEmpty(String.valueOf(a.c)) ? "" : ":" + a.c);
                    str2 = sb.toString();
                }
                String str3 = str2 + "/api/exclude/versionUpdate";
                y.a aVar = new y.a();
                aVar.e(str3);
                x.b(vVar, aVar.a(), false).C(new d(z, str, a));
            } else {
                for (String str4 : a.d) {
                    arrayList.add(((a.b == 1 ? "https://" + str4 : "http://" + str4) + ":" + a.c) + a.e);
                }
                if (a.a == 2) {
                    for (String str5 : a.f) {
                        arrayList.add(((a.b == 1 ? "https://" + str5 : "http://" + str5) + ":" + a.c) + a.e);
                    }
                }
                ArrayList arrayList2 = new ArrayList();
                Iterator it2 = arrayList.iterator();
                while (it2.hasNext()) {
                    arrayList2.add(Base64.encodeToString(((String) it2.next()).getBytes(), 0));
                }
                this.f = arrayList2;
                I();
            }
            this.g = true;
        } catch (Exception unused) {
            this.f.clear();
            MMKV.i().m("dns_server_result", "");
            N(z);
        }
    }

    public final void L(String str) {
        File[] listFiles;
        n nVar = (n) new Gson().b(n.class, str);
        boolean z = true;
        if (nVar.code.intValue() == 200) {
            String str2 = nVar.getData().server;
            String str3 = nVar.getData().file;
            int intValue = nVar.getData().port.intValue();
            boolean booleanValue = nVar.getData().isSSL.booleanValue();
            if (str2.equals("127.0.0.1")) {
                MMKV.i().n("CHECK_NET_STATUS_LOGIN", false);
            } else {
                MMKV.i().n("CHECK_NET_STATUS_LOGIN", true);
            }
            WindClient m = WindClient.m();
            WindClient.c cVar = WindClient.c.a;
            m.g = cVar;
            m.a = str2;
            m.d = str3;
            m.f = intValue;
            m.h = booleanValue;
            j jVar = new j();
            HashMap hashMap = m.j;
            if (!hashMap.containsKey(cVar)) {
                hashMap.put(cVar, new com.wind.imlib.connect.http.a(m));
            }
            if (m.g != cVar) {
                WindClient.c cVar2 = WindClient.c.b;
                if (!hashMap.containsKey(cVar2)) {
                    hashMap.put(cVar2, new qg.a(m));
                }
            }
            m.e = jVar;
            Iterator it2 = hashMap.keySet().iterator();
            while (true) {
                if (!it2.hasNext()) {
                    break;
                }
                WindClient.c cVar3 = (WindClient.c) it2.next();
                com.wind.imlib.connect.comm.b bVar = (com.wind.imlib.connect.comm.b) hashMap.get(cVar3);
                if (bVar == null) {
                    hashMap.remove(cVar3);
                    m.e.b(new Throwable("连接创建失败"));
                    break;
                }
                bVar.connect(jVar);
            }
        } else {
            ToastUtils.a("与服务器链接超时...");
        }
        if ((getIntent().getFlags() & 4194304) != 0) {
            String R = a0.c.R();
            if (TextUtils.isEmpty(R)) {
                aa.a.q("/wind/login");
            } else {
                WindClient.m().b();
                ol.a.c("token:" + R + "  id:" + a0.c.S(), new Object[0]);
                r.a.b().getClass();
                r.a.a("/home/kit/").navigation();
            }
            finish();
            return;
        }
        z j2 = qi.j.j(3L, TimeUnit.SECONDS);
        p pVar = kj.a.c;
        j2.i(pVar).k(pVar).g(ri.a.a()).a(new c());
        ArrayList arrayList = i.a;
        if (arrayList != null && !arrayList.isEmpty()) {
            ((pg.c) aa.a.i(pg.c.class)).sendDNSResult(arrayList).b(com.wind.imlib.connect.http.transformer.a.handle_result()).i(pVar).k(pVar).g(ri.a.a()).a(new k());
        }
        StringBuilder sb = new StringBuilder();
        sb.append(getFilesDir());
        String str4 = File.separator;
        File file = new File(androidx.appcompat.graphics.drawable.a.i(sb, str4, "tombstones"));
        if (!file.isDirectory()) {
            throw new IllegalArgumentException("The given path is not a directory.");
        }
        File[] listFiles2 = file.listFiles(new FileFilter() {
            @Override
            public final boolean accept(File file2) {
                return true;
            }
        });
        if (listFiles2 != null && listFiles2.length != 0) {
            z = false;
        }
        if (z) {
            return;
        }
        File file2 = new File(getFilesDir() + str4 + "tombstones");
        if (!file2.isDirectory() || (listFiles = file2.listFiles()) == null) {
            return;
        }
        for (File file3 : listFiles) {
            String absolutePath = file3.getAbsolutePath();
            if (!file3.isDirectory()) {
                if (!absolutePath.endsWith(".txt")) {
                    String concat = absolutePath.concat(".txt");
                    File file4 = new File(absolutePath);
                    if (!file4.exists() || file4.isDirectory()) {
                        System.out.println("File does not exist: ".concat(absolutePath));
                    } else if (file4.renameTo(new File(concat))) {
                        System.out.println("File has been renamed.");
                    } else {
                        System.out.println("Error renmaing file");
                    }
                }
                File b2 = vg.e.b(this, Uri.fromFile(new File(absolutePath.concat(absolutePath.endsWith(".txt") ? "" : ".txt"))));
                ih.b bVar2 = new ih.b();
                if (b2.exists()) {
                    dj.b bVar3 = new dj.b(new ih.c(b2));
                    p pVar2 = kj.a.c;
                    bVar3.g(pVar2).i(pVar2).k(pVar2).g(ri.a.a()).a(bVar2);
                }
            }
        }
    }

    public final boolean M(String str) {
        try {
            byte b2 = f.a(str, "2A0419d61C319f58".getBytes(), "v31AC039w76E245a".getBytes()).a;
            return b2 == 1 || b2 == 2 || b2 == 3;
        } catch (Exception unused) {
            d1 d1Var = new d1();
            d1Var.setDomain(str.toString());
            d1Var.setVpn(i.b(this) ? "是" : "否");
            d1Var.setErrorMsg("解析失败");
            d1Var.setNetType(b0.c.a(this) == 0 ? "MOBILE" : "WIFI");
            d1Var.setAppVer(vg.b.b());
            d1Var.setErrorTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
            d1Var.setOsType("android");
            d1Var.setOsVer(Build.VERSION.SDK_INT);
            d1Var.setUserId(a0.c.S());
            i.a.add(d1Var);
            return false;
        }
    }

    public final void N(boolean z) {
        MMKV.i().m("dns_server_result", "");
        if (z) {
            i.a(this, true);
        } else {
            if (Arrays.asList(new String[0]).size() > 0) {
                i.a(this, false);
                return;
            }
            this.f.clear();
            MMKV.i().m("dns_server_result", "");
            I();
        }
    }

    public final void init() {
        X509TrustManager x509TrustManager;
        String str;
        int i;
        TrustManager[] trustManagers;
        v.b bVar = new v.b();
        TimeUnit timeUnit = TimeUnit.SECONDS;
        bVar.c(3L, timeUnit);
        bVar.e(3L, timeUnit);
        bVar.b(15L, timeUnit);
        bVar.t = false;
        bVar.s = false;
        bVar.b = null;
        bVar.a(new b0.k(H().get(0), H(), H().size() - 1));
        try {
            SSLContext sSLContext = SSLContext.getInstance("SSL");
            sSLContext.init(null, new TrustManager[]{new m()}, new SecureRandom());
            SSLSocketFactory socketFactory = sSLContext.getSocketFactory();
            try {
                TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
                trustManagerFactory.init((KeyStore) null);
                trustManagers = trustManagerFactory.getTrustManagers();
            } catch (Exception e) {
                e.printStackTrace();
                x509TrustManager = null;
            }
            if (trustManagers.length == 1) {
                TrustManager trustManager = trustManagers[0];
                if (trustManager instanceof X509TrustManager) {
                    x509TrustManager = (X509TrustManager) trustManager;
                    bVar.d(socketFactory, x509TrustManager);
                    bVar.m = new l();
                    v vVar = new v(bVar);
                    HashMap hashMap = new HashMap();
                    hashMap.put("jsv", "2.5.8");
                    hashMap.put("appKey", "0123456789");
                    hashMap.put("sign", "" + vg.b.c(String.valueOf(System.currentTimeMillis())));
                    hashMap.put("api", "mtop.taobao.idle.awesome." + F(1, true, false));
                    hashMap.put("v", BuildConfig.VERSION_NAME);
                    hashMap.put("dataType", "protobuf3");
                    hashMap.put("valueType", "string");
                    hashMap.put("send-type", "json");
                    hashMap.put("data", "[" + F(20, false, true) + "]");
                    hashMap.put("source", "mobile");
                    hashMap.put("client", "Android");
                    hashMap.put("aid", "" + vg.b.c(String.valueOf(new Random().nextLong() & 65535)));
                    hashMap.put("brand", "" + Build.BRAND);
                    hashMap.put("model", "" + Build.MODEL);
                    hashMap.put("os-version", "" + Build.VERSION.RELEASE);
                    hashMap.put("app-code", "" + vg.b.a());
                    hashMap.put("app-versio", "" + vg.b.b());
                    StringBuilder sb = new StringBuilder();
                    if (Looper.myLooper() == null) {
                        Looper.prepare();
                    }
                    String[] strArr = {null};
                    runOnUiThread(new dg.l(this, strArr));
                    while (true) {
                        str = strArr[0];
                        if (str != null) {
                            break;
                        }
                        try {
                            Thread.sleep(100L);
                        } catch (InterruptedException e2) {
                            e2.printStackTrace();
                        }
                    }
                    sb.append(str);
                    Random random = new Random();
                    int i2 = 3;
                    int nextInt = random.nextInt(3) + 1;
                    StringBuilder sb2 = new StringBuilder();
                    int i3 = 0;
                    while (i3 < nextInt) {
                        StringBuilder sb3 = new StringBuilder();
                        int nextInt2 = random.nextInt(6) + i2;
                        int i4 = 0;
                        while (true) {
                            i = 26;
                            if (i4 >= nextInt2) {
                                break;
                            }
                            sb3.append((char) (random.nextInt(26) + 65));
                            i4++;
                        }
                        StringBuilder sb4 = new StringBuilder();
                        int nextInt3 = random.nextInt(6) + 5;
                        int i5 = 0;
                        while (i5 < nextInt3) {
                            if (random.nextBoolean()) {
                                sb4.append((char) (random.nextInt(i) + 97));
                            } else {
                                sb4.append(random.nextInt(9) + 1);
                            }
                            i5++;
                            i = 26;
                        }
                        sb2.append(sb3.toString());
                        sb2.append("/");
                        sb2.append(sb4.toString());
                        if (i3 < nextInt - 1) {
                            sb2.append("  ");
                        }
                        i3++;
                        i2 = 3;
                    }
                    sb.append(sb2.toString());
                    sb.append(" safe360-fpjeroi/IK2018922582 ORT-DD/v3.5 UCoreBrowser/11.0.2.1001 TmallApp(TBUnionSDK/10.0.1.2001) baiduminiapp/15.0.1.4101");
                    hashMap.put("User-Agent", sb.toString());
                    String[] strArr2 = new String[hashMap.size() * 2];
                    int i6 = 0;
                    for (Map.Entry entry : hashMap.entrySet()) {
                        if (entry.getKey() == null || entry.getValue() == null) {
                            throw new IllegalArgumentException("Headers cannot be null");
                        }
                        String trim = ((String) entry.getKey()).trim();
                        String trim2 = ((String) entry.getValue()).trim();
                        q.a(trim);
                        q.b(trim2, trim);
                        strArr2[i6] = trim;
                        strArr2[i6 + 1] = trim2;
                        i6 += 2;
                    }
                    y.a aVar = new y.a();
                    aVar.e(new String(u.c.a(H().get(0))));
                    aVar.c.c("User-Agent");
                    q.a aVar2 = new q.a();
                    Collections.addAll(aVar2.a, strArr2);
                    aVar.c = aVar2;
                    x b2 = x.b(vVar, aVar.a(), false);
                    if ((System.currentTimeMillis() - MMKV.p("MMKV_LAST_REQUEST_TIME").f("time") > 300000) || TextUtils.isEmpty(MMKV.p("MMKV_LAST_REQUEST_TIME").g("data"))) {
                        b2.C(new b());
                        return;
                    } else {
                        L(MMKV.p("MMKV_LAST_REQUEST_TIME").g("data"));
                        return;
                    }
                }
            }
            throw new IllegalStateException("Unexpected default trust managers:" + Arrays.toString(trustManagers));
        } catch (Exception e3) {
            throw new RuntimeException(e3);
        }
    }

    @Override
    public final void onCreate(Bundle bundle) {
        String property;
        super.onCreate(bundle);
        setContentView(2131558462);
        findViewById(2131363039).setVisibility(8);
        ((ImageView) findViewById(2131361921)).setBackgroundResource(2131755012);
        if (!TextUtils.isEmpty("")) {
            ((TextView) findViewById(2131361928)).setText("");
        }
        MMKV.i().m("dns_server_result", "");
        Context applicationContext = getApplicationContext();
        ArrayList arrayList = new ArrayList();
        arrayList.add("https://m.immomo.com/inc/android/agreement.html?v=5968");
        arrayList.add("https://cosmos-lua.immomo.com/v1/api/index/patch");
        arrayList.add("https://cosmos-lua.immomo.com/v1/api/index/limit");
        arrayList.add("https://cosmos-open.immomo.com/login/index/logs");
        arrayList.add("https://cosmos-compass-api.immomo.com/uploadCodeStart");
        android.support.v4.media.a.q(arrayList, "https://s3.pstatp.com/bytecom/resource/tetris/pi.ad6e3a13.js", "https://ip.taobao.com/service/getIpInfo.php?ip=myip", "https://api.weibo.cn/2/hot/hours_spotlight?wm=3333_2001", "https://api.weibo.cn/2/guest/login?wm=3333_2001");
        android.support.v4.media.a.q(arrayList, "https://api.weibo.cn/2/client/get_grayfeature", "https://baichuan-sdk.alicdn.com/4.0.1.10/23208668/1.0.0/ios/rule.htm", "https://sdkapp.uve.weibo.com/interface/sdk/sdkconfig.php?platform=ipad&version=7", "https://userlink.alicdn.com/smart_link/ios/alsl_switch_config.json");
        android.support.v4.media.a.q(arrayList, "https://userlink.alicdn.com/matrix_app/ios/matrix_app_config.json", "https://dp.im.weibo.cn/entrance", "https://sdkapp.uve.weibo.com/interface/sdk/sdkconfig.php?platform=ipad&version=11", "https://new-service.biliapi.net/chat-sdk/sdk/user/v1/config.action?appId=3cf3af32ac5049369af06fabb87a36d1&from=3&version=2.8.2");
        android.support.v4.media.a.q(arrayList, "https://amonsul.douban.com/check2?app_name=Frodo_iPhone&apikey=0ab215a8b1977939201640fa14c66bab&sdkVersion=1.9.0", "https://frodo.douban.com/frodo_rexxar/api/routes?device_id=", "https://m.douban.com/", "https://i.gtimg.cn/ams-web/page-performance/page-performance.min.js?v=1");
        android.support.v4.media.a.q(arrayList, "https://kepler.jd.com/console/admin/getConfigNew", "https://mapi.m.jd.com/ksdk/updlist.json", "https://api.zhihu.com/zst/events/p", "https://zhihu-web-analytics.zhihu.com/api/v1/server_tsp");
        android.support.v4.media.a.q(arrayList, "https://m-cloud.zhihu.com/api/apm/sampling/get?appKey=XoO7so", "https://api.zhihu.com/market/popovers_v2", "https://api.zhihu.com/api/v4/ecom_data/config", "https://api.zhihu.com/account/toggle");
        android.support.v4.media.a.q(arrayList, "https://api.zhihu.com/moments/tab_v2?feed_type=recommend", "https://m-cloud.zhihu.com/api/app/monitor/sampling/sync?appKey=XoO7so", "https://qzs.gdtimg.com/union/res/union_temp_v2/page/ANTempMob/tempMob.1659340444417.package.json", "https://iface2.iqiyi.com/fusion/3.0/switch/ext?content=dfp_config&platform_id=12");
        android.support.v4.media.a.q(arrayList, "https://api.iqiyi.com/3f4/emoticon-sns.iqiyi.com/jaguar-core/query_config?bussiness=feedStatic&agenttype=268&version=3.8.10", "https://sf6-fe-tos.pglstatp-toutiao.com/obj/ad-pattern/renderer/6259e2/package.json?aid=5000546&version_code=5.4.0.5&device_platform=ipad", "https://data.video.iqiyi.com/t", "https://lf-cdn-tos.bytescm.com/obj/static/ad/play-comp/playable-component-sdk/package.ugen.json?aid=5000546&version_code=5.4.0.5&device_platform=ipad");
        android.support.v4.media.a.q(arrayList, "https://sf3-fe-tos.pglstatp-toutiao.com/obj/ad-pattern/renderer/6259e2/fallback.js", "https://lf1-cdn-tos.bytegoofy.com/goofy/fe/ies/bridge/bytedance/jsbridge-2.2.10.umd.js", "https://api.iqiyi.com/keepalive", "https://acs.m.taobao.com/gw/mtop.common.getTimestamp/*");
        android.support.v4.media.a.q(arrayList, "https://zconfig.alibabausercontent.com/zconfig/23569910/11.0.50/0~0/~", "https://sealine.youku.com/sdkconfig_60.xml", "https://gw.m.163.com/nc/api/v1/search/hot-word", "https://gw.m.163.com/nc-notify/api/v5/notify/homeunreadnum");
        android.support.v4.media.a.q(arrayList, "https://gw.m.163.com/commons-user-incentive/api/v1/commons/incentive/taskConfig", "https://gw.m.163.com/nc/api/v1/local/city.html", "https://gw.m.163.com/nc-gateway/api/v1/topicset/ios/topicsetList", "https://gw.m.163.com/commons-user-main/api/v1/commons/main/anonymous/allFollowList");
        android.support.v4.media.a.q(arrayList, "https://cloud.xdrig.com/configcloud/rest/sdk/gdprCheck", "https://t2.xiaohongshu.com/api/collect", "https://edith.xiaohongshu.com/api/sns/v1/system_service/config?launchtimes=9", "https://edith.xiaohongshu.com/api/sns/v1/search/placeholder?is_new_user=true");
        android.support.v4.media.a.q(arrayList, "https://www.xiaohongshu.com/api/im/users/following/all", "https://cc.map.qq.com/?desc_c", "https://43.129.255.160:8081", "https://cgi.connect.qq.com/qqconnectopen/openapi/policy_conf");
        android.support.v4.media.a.q(arrayList, "https://183.232.58.240:21004", "https://118.26.252.225:5222", "https://120.46.157.112:7002", "https://49.51.177.180:5333");
        android.support.v4.media.a.q(arrayList, "https://183.134.98.111:5224", "https://183.134.98.34:5224", "https://183.134.98.75:5224", "https://login.sina.com.cn/visitor/signin");
        android.support.v4.media.a.q(arrayList, "https://sdk-open-phone.getui.com/api.php?format=json&t=1", "https://tsis.jpush.cn/", "https://ali-stats.jpush.cn", "https://49.233.102.113:5333");
        android.support.v4.media.a.q(arrayList, "https://124.71.10.22:7002", "https://175.24.251.189:5333", "https://103.102.200.38:80", "https://118.26.252.225:5222");
        android.support.v4.media.a.q(arrayList, "http://p5.a.yximgs.com/uhead/AB/2022/05/22/01/BMjAyMjA1MjIwMTUzMjdfMjI5NzUxOTU2OV8xX2hkNDc0XzE0OQ==_s.jpg", "https://api2.e.kuaishou.com/rest/e/load/styleTemplate", "https://apidns.kwd.inkuai.com/label_resolve?label=kwai-api&biz=aegon-android", "https://yoda.kwd.inkuai.com");
        android.support.v4.media.a.q(arrayList, "http://httpdns.bcelive.com/?dns=bd-origin.pull.yximgs.com,bd-adaptive-pull.live-voip.com,bd-adaptive-pull.video-voip.com,bd-adaptive.pull.yximgs.com,bd-origin-pull.live-voip.com,bd-origin-pull.video-voip.com,bd-p2p-pull.live-voip.com,bd-p2p-pull.video-voip.com,bd-p2p.pull.yximgs.com,bd-proxy.pull.yximgs.com,bd-pull.live-voip.com,bd-pull.video-voip.com,bd.pull.yximgs.com,bd.push.yximgs.com,d5-ks.a.kwimgs.com,p5-live.a.yximgs.com,p5.a.yximgs.com,v5-skvod.kwaicdn.com,v5.kwaicdn.com&type=a", "https://static.yximgs.com/bs2/adminBlock/treasure-1675409076903-xYWwjlqm.png", "https://43.226.164.41", "http://p2.a.yximgs.com/uhead/AB/2021/08/16/17/");
        Collections.shuffle(arrayList);
        int nextInt = new Random().nextInt(6) + 3;
        v vVar = new v();
        int i = 0;
        int i2 = 0;
        while (i2 < nextInt && !arrayList.isEmpty()) {
            String str = (String) arrayList.remove(i);
            y.a aVar = new y.a();
            aVar.c.c("User-Agent");
            try {
                property = WebSettings.getDefaultUserAgent(applicationContext);
            } catch (Exception unused) {
                property = System.getProperty("http.agent");
            }
            StringBuffer stringBuffer = new StringBuffer();
            int length = property.length();
            for (int i3 = 0; i3 < length; i3++) {
                char charAt = property.charAt(i3);
                if (charAt <= 31 || charAt >= 127) {
                    stringBuffer.append(String.format("\\u%04x", Integer.valueOf(charAt)));
                } else {
                    stringBuffer.append(charAt);
                }
            }
            aVar.c.a("User-Agent", stringBuffer.toString() + " ");
            aVar.e(str);
            x.b(vVar, aVar.a(), false).C(new b0.a());
            i2++;
            i = 0;
        }
        LiveEventBus.get("get_dns_reset", String.class).observe(this, new Observer() {
            public final void onChanged(Object obj) {
                String str2 = (String) obj;
                MainActivity mainActivity = MainActivity.this;
                mainActivity.c++;
                boolean isEmpty = TextUtils.isEmpty(str2);
                CopyOnWriteArrayList<String> copyOnWriteArrayList = mainActivity.b;
                if (!isEmpty && mainActivity.M(str2)) {
                    copyOnWriteArrayList.add(str2);
                }
                if (mainActivity.c != v0.V().size() * Arrays.asList(new String[0]).size() || mainActivity.h) {
                    return;
                }
                mainActivity.h = true;
                mainActivity.i.cancel();
                mainActivity.K(MainActivity.E(copyOnWriteArrayList), false);
            }
        });
        LiveEventBus.get("get_dns_reset_v3", String.class).observe(this, new Observer() {
            public final void onChanged(Object obj) {
                String str2 = (String) obj;
                MainActivity mainActivity = MainActivity.this;
                mainActivity.d++;
                boolean isEmpty = TextUtils.isEmpty(str2);
                CopyOnWriteArrayList<String> copyOnWriteArrayList = mainActivity.e;
                if (!isEmpty && mainActivity.M(str2)) {
                    copyOnWriteArrayList.add(str2);
                }
                if (mainActivity.d != v0.V().size() * v0.Y().size() || mainActivity.h) {
                    return;
                }
                mainActivity.h = true;
                mainActivity.i.cancel();
                mainActivity.K(MainActivity.E(copyOnWriteArrayList), false);
            }
        });
        TimerTask aVar2 = new a(this);
        AgentWebConfig.clearDiskCache(getApplicationContext());
        if (!TextUtils.isEmpty(MMKV.i().g("dns_server_result"))) {
            K(MMKV.i().g("dns_server_result"), true);
        } else {
            this.f.clear();
            i.a(this, true);
        }
        this.i.schedule(aVar2, 5000L, 5000L);
    }
}