APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:GENIEX Service
版本号:2.2.062
包名称:com.geniex.vsimhelper

MD5 校验值:13dc6b335e0f136597784161f314cd8e

反编译源代码说明

j.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package d2;

import android.content.Context;
import android.database.Cursor;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.ServiceManager;
import android.telephony.TelephonyManager;
import android.util.Log;
import androidx.activity.m;
import androidx.window.layout.q;
import com.android.internal.telephony.ITelephony;
import com.skyroam.javattlv.SysServiceManager;
import com.skyroam.javattlv.utils.SPUtils;
import com.skyroam.javattlv.utils.SystemPropertiesEx;
import com.skyroam.javattlv.utils.ThreadUtil;
import com.skyroam.silverhelper.MyApplication;
import com.skyroam.silverhelper.entity.UserConfigEntity;
import java.net.HttpURLConnection;
import java.net.URL;

public final class j {

    public static final int f2271n = 0;

    public int f2273b;

    public int f2274c;

    public int f2275d;

    public int f2277f;

    public boolean f2278g;

    public boolean f2279h;

    public long f2280i;

    public long f2281j;

    public long f2282k;

    public long f2283l;

    public long f2284m;

    public final TelephonyManager f2276e = SysServiceManager.getInstance().getTelephonyManager();

    public boolean f2272a = true;

    public class a implements Runnable {

        public final String f2285c;

        public a(String str) {
            this.f2285c = str;
        }

        @Override
        public final void run() {
            HttpURLConnection httpURLConnection;
            int responseCode;
            boolean z3;
            String str = this.f2285c;
            int i4 = com.google.gson.internal.c.f2124a;
            f.a("c", "checkNetWork");
            boolean z4 = false;
            try {
                httpURLConnection = (HttpURLConnection) new URL(str).openConnection();
                httpURLConnection.setConnectTimeout(3000);
                httpURLConnection.setReadTimeout(3000);
                httpURLConnection.setInstanceFollowRedirects(false);
                httpURLConnection.connect();
                responseCode = httpURLConnection.getResponseCode();
            } catch (Throwable unused) {
                f.a("c", "checkNetWork异常");
            }
            if (responseCode == 200) {
                f.a("c", "checkNetWork = 200, success");
            } else {
                if (responseCode != 204) {
                    f.a("c", "checkNetWork无响应 = " + responseCode);
                    z3 = false;
                    httpURLConnection.disconnect();
                    z4 = z3;
                    int i5 = j.f2271n;
                    StringBuilder a4 = androidx.activity.result.a.a("url ");
                    a4.append(this.f2285c);
                    a4.append(" result ");
                    a4.append(z4);
                    f.a("j", a4.toString());
                    synchronized (j.this) {
                        if (z4) {
                            j.this.f2278g = true;
                        }
                        j.this.notifyAll();
                    }
                    return;
                }
                f.a("c", "checkNetWork = 204, success");
            }
            z3 = true;
            httpURLConnection.disconnect();
            z4 = z3;
            int i52 = j.f2271n;
            StringBuilder a42 = androidx.activity.result.a.a("url ");
            a42.append(this.f2285c);
            a42.append(" result ");
            a42.append(z4);
            f.a("j", a42.toString());
            synchronized (j.this) {
            }
        }
    }

    public j(boolean z3) {
        int i4;
        int i5;
        int h4;
        String str;
        long d4;
        boolean z4;
        Throwable th;
        int i6 = 0;
        this.f2279h = false;
        this.f2280i = 86400000L;
        this.f2281j = 5242880L;
        this.f2282k = 14400000L;
        this.f2283l = 600000L;
        this.f2284m = 2L;
        Context context = MyApplication.f2189c;
        this.f2273b = l.f();
        this.f2274c = 0;
        this.f2275d = 0;
        UserConfigEntity c4 = MyApplication.c();
        if (c4 != null && c4.getSimCardUsableSwitch()) {
            this.f2284m = c4.getSimCardUsableSignal() / 20;
            this.f2280i = c4.getSimCardUsableTrafficThresholdDuration() * 1000;
            this.f2281j = c4.getSimCardUsableTrafficThreshold() * 1024 * 1024;
            this.f2282k = c4.getSimCardUsableDoubleFailDuration() * 1000;
            this.f2283l = c4.getSimCardUsableNoFailDuration() * 1000;
        }
        StringBuilder a4 = androidx.activity.result.a.a("simCardNum = ");
        a4.append(this.f2273b);
        a4.append(" ping = ");
        a4.append(true);
        f.a("j", a4.toString());
        if (!z3 || this.f2273b <= 0) {
            c();
        } else {
            i4 = 2;
            if (m1.k.g()) {
                int i7 = this.f2273b;
                if (1 == i7) {
                    if (this.f2272a) {
                        if (l.k(1)) {
                            this.f2275d = 0;
                        } else {
                            this.f2275d = 1;
                        }
                    } else if (l.k(1)) {
                        this.f2275d = 1;
                    }
                } else if (2 == i7 && l.l(1)) {
                    this.f2275d = 1;
                }
                this.f2274c = 1;
                SPUtils.putInt(SPUtils.SP_IS_START_VSIM_SLOT_TYPE, 1);
                d();
            } else {
                this.f2275d = -1;
                int i8 = -1;
                i5 = 0;
                while (true) {
                    if (i5 >= i4) {
                        break;
                    }
                    h4 = l.h(i5);
                    if (h4 != i8) {
                        try {
                            if (this.f2276e.createForSubscriptionId(h4).getServiceStateForSubscriber(h4).getDataRegState() == 0) {
                                f.a("j", "subId " + h4 + " strength = " + ITelephony.Stub.asInterface(ServiceManager.getService("phone")).getSignalStrength(h4).getLevel());
                            }
                        } catch (Throwable unused) {
                        }
                        z4 = false;
                        if (z4) {
                            this.f2275d = i5;
                            this.f2274c = 1;
                            break;
                        }
                    }
                    i5++;
                    i6 = 0;
                    i8 = -1;
                }
                if (this.f2274c == 0) {
                    this.f2275d = 0;
                    c();
                }
                SPUtils.putInt(SPUtils.SP_IS_START_VSIM_SLOT_TYPE, this.f2274c);
                d();
            }
        }
        if (this.f2273b <= 0 || !"open".equals(SystemPropertiesEx.get("persist.sys.skyroam.boce"))) {
            return;
        }
        f.a("j", "boce is active");
        if (!l.k(0) && l.o(0) && l.l(0)) {
            this.f2275d = 0;
            this.f2274c = 1;
            return;
        } else {
            if (!l.k(1) && l.o(1) && l.l(1)) {
                this.f2275d = 1;
                this.f2274c = 1;
                return;
            }
            return;
        }
        String subscriberId = SysServiceManager.getInstance().getTelephonyManager().getSubscriberId(h4);
        long currentTimeMillis = System.currentTimeMillis();
        try {
            Cursor A = m.A(subscriberId, h4, currentTimeMillis - this.f2282k, i5);
            if (A != null) {
                try {
                    int columnIndex = A.getColumnIndex("end");
                    int columnIndex2 = A.getColumnIndex("success");
                    int columnIndex3 = A.getColumnIndex("error");
                    while (A.moveToNext()) {
                        long j4 = A.getLong(columnIndex);
                        int i9 = A.getInt(columnIndex2);
                        String string = A.getString(columnIndex3);
                        if (i9 != 0) {
                            str = subscriberId;
                            i6 = 0;
                        } else if (String.valueOf(51380230L).equals(string)) {
                            str = subscriberId;
                            try {
                                if (Math.abs(currentTimeMillis - j4) < this.f2283l) {
                                    f.a("j", "0x03100006");
                                    i4 = 2;
                                    try {
                                        A.close();
                                        z4 = false;
                                        break;
                                    } catch (Exception e4) {
                                        e = e4;
                                        StringBuilder a5 = androidx.activity.result.a.a("");
                                        a5.append(e.getMessage());
                                        f.b("j", a5.toString());
                                        d4 = c2.b.c().d(this.f2280i, str);
                                        f.a("j", "total usage " + d4);
                                        if (d4 <= this.f2281j) {
                                            z4 = true;
                                        } else {
                                            synchronized (this) {
                                                try {
                                                    Cursor t4 = m.t(h4);
                                                    if (t4 != null) {
                                                        try {
                                                            if (t4.moveToFirst()) {
                                                                long j5 = t4.getLong(t4.getColumnIndex("end"));
                                                                int i10 = t4.getInt(t4.getColumnIndex("success"));
                                                                if (Math.abs(System.currentTimeMillis() - j5) < 86400000) {
                                                                    z4 = i10 == 1;
                                                                    t4.close();
                                                                }
                                                            }
                                                        } finally {
                                                            break;
                                                        }
                                                    }
                                                    if (t4 != null) {
                                                        t4.close();
                                                    }
                                                } catch (Exception unused2) {
                                                }
                                                boolean dataEnabled = SysServiceManager.getInstance().getTelephonyManager().getDataEnabled(h4);
                                                Log.d("j", "checkNetWork  isDataEnabled " + dataEnabled);
                                                this.f2277f = 3;
                                                this.f2278g = false;
                                                if (dataEnabled && l.c() == h4) {
                                                    int i11 = com.google.gson.internal.c.f2124a;
                                                    e("http://captive.apple.com/hotspot-detect.html");
                                                    e("http://connectivitycheck.platform.hicloud.com/generate_204");
                                                    e("http://connectivitycheck.gstatic.com/generate_204");
                                                } else {
                                                    this.f2279h = false;
                                                    l.b(h4);
                                                    l.u(h4, true);
                                                    ConnectivityManager connectivityManager = SysServiceManager.getInstance().getConnectivityManager();
                                                    h hVar = new h(this, connectivityManager);
                                                    ThreadUtil.runOnBackgroundDelay(new q(connectivityManager, 1, hVar), 1000L);
                                                    v1.b bVar = new v1.b();
                                                    bVar.c();
                                                    bVar.a();
                                                    bVar.b();
                                                    s1.a.b().a(bVar, new i(this, connectivityManager, hVar));
                                                }
                                                while (this.f2277f > 0) {
                                                    try {
                                                        f.a("j", "waiting ");
                                                        wait(22000L);
                                                        f.a("j", "mCheckThreadCount " + this.f2277f);
                                                        f.a("j", "mIsNetworkValid " + this.f2278g);
                                                        this.f2277f = this.f2277f - 1;
                                                        if (this.f2278g) {
                                                            break;
                                                        }
                                                    } catch (Exception unused3) {
                                                    }
                                                }
                                                m.R(h4, this.f2278g, System.currentTimeMillis());
                                                z4 = this.f2278g;
                                            }
                                        }
                                        if (z4) {
                                        }
                                    }
                                } else {
                                    i6++;
                                }
                            } catch (Throwable th2) {
                                th = th2;
                                i4 = 2;
                                try {
                                    A.close();
                                } catch (Throwable th3) {
                                    th.addSuppressed(th3);
                                }
                                throw th;
                                break;
                            }
                        } else {
                            str = subscriberId;
                        }
                        i4 = 2;
                        if (i6 >= 2) {
                            try {
                                f.a("j", "failedCount >= 2");
                                A.close();
                                z4 = false;
                                break;
                            } catch (Throwable th4) {
                                th = th4;
                                th = th;
                                A.close();
                                throw th;
                                break;
                                break;
                            }
                        }
                        subscriberId = str;
                    }
                } catch (Throwable th5) {
                    th = th5;
                    str = subscriberId;
                }
            }
            str = subscriberId;
            if (A != null) {
                A.close();
            }
        } catch (Exception e5) {
            e = e5;
            str = subscriberId;
        }
        d4 = c2.b.c().d(this.f2280i, str);
        f.a("j", "total usage " + d4);
        if (d4 <= this.f2281j) {
        }
        if (z4) {
        }
    }

    public static void d() {
        StringBuilder a4 = androidx.activity.result.a.a("isEmptySim 1 = ");
        a4.append(l.k(0));
        Log.d("j", a4.toString());
        Log.d("j", "isEmptySim 2 = " + l.k(1));
        Log.d("j", "isMasterCard 1 = " + l.l(0));
        Log.d("j", "isMasterCard 2 = " + l.l(1));
        Log.d("j", "isMasterCard 3 = " + l.l(2));
        Log.d("j", "isUsedCard 1 = " + l.o(0));
        Log.d("j", "isUsedCard 2 = " + l.o(1));
        StringBuilder sb = new StringBuilder();
        sb.append("isMobileConnected = ");
        Context context = MyApplication.f2189c;
        int i4 = g.f2265b;
        context.getApplicationContext();
        NetworkInfo networkInfo = SysServiceManager.getInstance().getConnectivityManager().getNetworkInfo(0);
        sb.append(networkInfo != null ? networkInfo.isConnected() : false);
        Log.d("j", sb.toString());
    }

    public final int a() {
        StringBuilder a4 = androidx.activity.result.a.a("r_slotId = ");
        a4.append(this.f2275d);
        Log.d("j", a4.toString());
        return this.f2275d;
    }

    public final int b() {
        StringBuilder a4 = androidx.activity.result.a.a("type = ");
        a4.append(this.f2274c);
        Log.d("j", a4.toString());
        return this.f2274c;
    }

    public final void c() {
        Context context = MyApplication.f2189c;
        if (m1.k.f()) {
            int i4 = this.f2273b;
            if (1 == i4) {
                if (l.k(1)) {
                    this.f2275d = 1;
                } else {
                    this.f2275d = 0;
                }
            } else if (2 == i4) {
                if (l.q(0)) {
                    this.f2275d = 1;
                } else {
                    this.f2275d = 0;
                }
            }
        } else if (l.k(1)) {
            this.f2275d = 0;
        } else {
            this.f2275d = 1;
        }
        d();
    }

    public final void e(String str) {
        ThreadUtil.runLongTaskOnBackground(new a(str));
    }
}