正版风暴黑马 v5.0版本的 MD5 值为:01425d13106471265483ee3782390bf1

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


package p0000oO008.p001ooo8o088.p002Oo0oo80;

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Build;
import android.os.Environment;
import com.android.launcher3.StringFog;
import com.gibb.App;
import com.gibb.WebService;
import com.gibb.abtest.testcase.service.MainService;
import com.hjq.toast.ToastUtils;
import com.tencent.smtt.sdk.TbsReaderView;
import java.io.File;
import java.io.IOException;
import org.json.JSONException;
import org.json.JSONObject;
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.opencv.videoio.Videoio;
import p0000oO008.p001ooo8o088.p002Oo0oo80.O80o00O;

public class o880O00 {

    private static o880O00 f2316LliiII;

    private C0880oOO8 f23201l;

    File f2321Lil1l;

    Context f2322lll;
    private static final String IIiL1 = "AutoUtil";

    private static final String f2317lIlilLL = "x800A0000-Octopus";
    String LLI1lI1 = null;

    File f2319lILLLIL = null;

    String f2318Li = "";
    String il = null;

    public o880O00(final Context context) {
        this.f2321Lil1l = null;
        this.f23201l = null;
        this.f2322lll = context;
        C09940OO.f3140lll = 1;
        this.f23201l = new C0880oOO8();
        File file = new File(context.getFilesDir(), "tmpagent");
        this.f2321Lil1l = file;
        if (file.exists()) {
            C0795o00OooO.m3508Lil1l(this.f2321Lil1l);
        }
        if (!this.f2321Lil1l.exists()) {
            this.f2321Lil1l.mkdirs();
        }
        File file2 = new File(this.f2321Lil1l, ".getRandomChar2d");
        this.f2321Lil1l = file2;
        file2.mkdirs();
        O80o00O.f1847lll = new O80o00O.oo() {
            @Override
            public int[] LLI1lI1() {
                String LLI1lI1;
                if (C0806o80.m3562IiiiIL().m3573LllL() != null && (LLI1lI1 = C0806o80.m3562IiiiIL().m3573LllL().LLI1lI1()) != null) {
                    String[] split = LLI1lI1.trim().split(",");
                    if (LLI1lI1 != null && split.length > 0) {
                        int[] iArr = new int[split.length];
                        for (int i = 0; i < split.length; i++) {
                            try {
                                iArr[i] = Integer.parseInt(split[i]);
                            } catch (Exception unused) {
                            }
                        }
                        return iArr;
                    }
                }
                return new int[19901];
            }

            @Override
            public String mo565lll() {
                return C0806o80.m3562IiiiIL().m3573LllL() != null ? C0806o80.m3562IiiiIL().m3573LllL().m2399Lil1l() : "";
            }
        };
        new Thread() {
            @Override
            public void run() {
                oOO8Oo.m4081lll(context);
            }
        }.start();
    }

    private void I1() {
        if (oOO8Oo.m4076Li()) {
            oOO8Oo.m4079lll("settings put secure enabled_accessibility_services ''");
            oOO8Oo.m4079lll("settings put secure accessibility_enabled '0'");
            StringBuilder m4838lll = new C0808o(this.f2322lll, this.f2322lll.getPackageName() + "/" + m3673IiiiIL()).m4838lll();
            if (m4838lll == null) {
                return;
            }
            oOO8Oo.m4079lll("settings put secure enabled_accessibility_services " + m4838lll.toString());
            oOO8Oo.m4079lll("settings put secure accessibility_enabled '1'");
        }
    }

    private String m3655I11ll() {
        String m4220lll = oOoOo0.m4220lll("TVc2Ym1hekxXbldBZmRrbU50OXBKRG5YI18jbjE2RmVLcS9mWFFYSzJzdGhB QjVJUT09");
        File file = new File(this.f2321Lil1l, m4220lll + ".apk");
        if (!C0795o00OooO.m3509Lil1l(this.f2322lll, m4220lll, file)) {
            return "[103]解压关键文件错误";
        }
        this.f2319lILLLIL = file;
        try {
            this.LLI1lI1 = Oo00O0O.m2991lll(file);
        } catch (IOException unused) {
        }
        try {
            Runtime.getRuntime().exec("chmod 0777 " + this.f2319lILLLIL.getAbsolutePath());
            return "";
        } catch (IOException e) {
            e.printStackTrace();
            return "";
        }
    }

    public static void LI11i() {
        String.format("am startservice --es fromAgent agent -n %s/%s", App.getContext().getPackageName(), MainService.class.getName());
    }

    private boolean LLI1lI1(int i) {
        try {
            Thread.sleep(2000L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        int i2 = 0;
        boolean z = false;
        while (i2 <= i) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException unused) {
            }
            i2 += 1000;
            z = il();
            if (z) {
                break;
            }
        }
        return z;
    }

    public static boolean LLI1lI1(Context context) {
        Intent intent = new Intent("android.settings.ACCESSIBILITY_SETTINGS");
        intent.addFlags(Videoio.CAP_INTELPERC_IMAGE_GENERATOR);
        try {
            context.startActivity(intent);
            return true;
        } catch (Exception unused) {
            return false;
        }
    }

    public static String m3656LliiII() {
        String str;
        PackageManager packageManager = App.getContext().getPackageManager();
        Intent intent = new Intent();
        intent.setAction("android.accessibilityservice.AccessibilityService");
        for (ResolveInfo resolveInfo : packageManager.queryIntentServices(intent, 0)) {
            if (resolveInfo.serviceInfo != null && (str = resolveInfo.serviceInfo.packageName) != null && str.equals(App.getContext().getPackageName())) {
                System.out.println("findAccClsName ResolveInfo " + resolveInfo.serviceInfo);
                System.out.println("findAccClsName s.resolvePackageName " + resolveInfo.toString());
                System.out.println("findAccClsName s.s.serviceInfo.packageName " + resolveInfo.serviceInfo.packageName);
                System.out.println("findAccClsName s.serviceInfo " + resolveInfo.serviceInfo.name);
                return resolveInfo.serviceInfo.name;
            }
        }
        return "";
    }

    private String m3657LllL() {
        String m4220lll = oOoOo0.m4220lll("RTVXRjYyOHZnVTdjZU5uc2hBTG1UUzVFI18jYXJKMDlSZXBsUkR5RGI5Rzhv elpnajZTVWlSU1luNDU=");
        String m4220lll2 = oOoOo0.m4220lll("YW1FU3l3c3hnc3MzeTNiVDhEQzJlS3NGI18jSmxKeDUxc0o4eVRXRVZuOHJz RDNIYXZ4OERtcThTQ25xcDFvYzhPNjhKZz0=");
        String m4220lll3 = oOoOo0.m4220lll("YUJUc2RHVW1lVVJwc3l6YXR0YXh6MzF4I18jTGJzQm11ZzBnaGx6bmEzdkR2 MFQxU1gwY0J2dVV0a0hKU1Y0S3YvTHNXST0=");
        return new File(m4220lll).exists() ? m4220lll : new File(m4220lll2).exists() ? m4220lll2 : new File(m4220lll3).exists() ? m4220lll3 : oOoOo0.m4220lll("WnVZTkNiWjBzMGd4ZFhHblV2TUpSUHJuI18jaGV6Wkx1R0FOa2g2bnZBT0dY enlvQT09");
    }

    private void m3658iIIlli() {
        if (oOO8Oo.m4076Li()) {
            oOO8Oo.m4079lll("settings put secure enabled_accessibility_services ''");
            oOO8Oo.m4079lll("settings put secure accessibility_enabled '0'");
        }
    }

    private String m3659iI1i1() {
        String str = o8o08Oo.m3816lll(10) + ".apk";
        File file = new File(Environment.getExternalStorageDirectory(), str);
        if (file.exists()) {
            file.delete();
        }
        C0795o00OooO.m3518lll(this.f2319lILLLIL, file);
        if (!file.exists() || file.length() <= 0) {
            file = new File("/sdcard/", str);
            C0795o00OooO.m3518lll(this.f2319lILLLIL, file);
        }
        File file2 = new File("/data/local/tmp/", this.f2319lILLLIL.getName());
        if (file2.exists()) {
            oOO8Oo.m4079lll("rm " + file2.getAbsolutePath());
        }
        oOO8Oo.m4079lll("cp " + file.getAbsolutePath() + " " + file2.getAbsolutePath());
        if (!file2.exists() || file2.length() <= 0) {
            oOO8Oo.m4079lll("cp /sdcard/" + str + " " + file2.getAbsolutePath());
        }
        OoooO8o.f1985IiiiIL = OoooO8o.LLI1lI1();
        try {
            C0795o00OooO.m3519lll(App.getContext().getFileStreamPath("httpserverport"), "" + OoooO8o.f1985IiiiIL);
        } catch (Exception unused) {
        }
        OoooO8o.f1978LL1I1I = OoooO8o.f1985IiiiIL;
        RunnableC0891oo0Oo0.f2629lll = OoooO8o.f1985IiiiIL;
        String packageName = this.f2322lll.getPackageName();
        int i = C09940OO.f3140lll;
        String str2 = OoooO8o.Lil + "-5-" + OoooO8o.lLLiil + "-5-" + this.LLI1lI1 + "-5-" + OoooO8o.f1985IiiiIL + "-5-" + packageName + "-5-" + file2.getAbsolutePath() + "-5-" + C0OO.m4932lll(this.f2322lll) + "-5-" + packageName + "-5-" + i;
        String m3816lll = o8o08Oo.m3816lll(o8o08Oo.m3814lll(10, 20));
        String format = String.format(OoooO8o.f1974I11ll, m3657LllL(), file2.getAbsolutePath(), "" + m3816lll, str2);
        file.delete();
        new File("/sdcard/", str).delete();
        return format;
    }

    private boolean m3660LiIILLL() {
        return this.f2322lll.checkCallingOrSelfPermission("android.permission.WRITE_SECURE_SETTINGS") == 0;
    }

    public static synchronized o880O00 m3661lll(Context context) {
        o880O00 o880o00;
        synchronized (o880O00.class) {
            if (f2316LliiII == null) {
                f2316LliiII = new o880O00(context);
            }
            o880o00 = f2316LliiII;
        }
        return o880o00;
    }

    public static void m3662lll() {
        new Thread() {
            @Override
            public void run() {
                if (C0806o80.m3562IiiiIL().Lil()) {
                    o880O00.m3661lll(App.getContext()).m3674Lil1l();
                }
            }
        }.start();
    }

    private boolean m3663lll(int i) {
        int i2 = 0;
        boolean z = false;
        while (i2 <= i) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException unused) {
            }
            i2 += 1000;
            z = C0724O8O0.m2880Lil1l().m2885lILLLIL();
            if (z) {
                break;
            }
        }
        return z;
    }

    public boolean m3664I1l() {
        if (WebService.LLI1lI1() != null) {
            try {
                if (Build.VERSION.SDK_INT >= 24) {
                    WebService.LLI1lI1().disableSelf();
                }
            } catch (Exception unused) {
            }
        }
        if (m3660LiIILLL()) {
            m3667Li();
        }
        if (!oOO8Oo.m4077lILLLIL()) {
            return false;
        }
        m3658iIIlli();
        return false;
    }

    String IIiL1() {
        String il = this.f23201l.il();
        if (il != null && il.trim().startsWith("{")) {
            try {
                this.il = new JSONObject(il).optString("md5");
            } catch (JSONException unused) {
            }
        }
        return il;
    }

    public boolean m3665Ii1L1L() {
        m3674Lil1l();
        O8OO8.LLI1lI1().m1919lILLLIL();
        if (!C0724O8O0.m2880Lil1l().m2885lILLLIL() && m3660LiIILLL()) {
            m3670lILLLIL();
            m3663lll(TbsReaderView.ReaderCallback.GET_BAR_ANIMATING);
        }
        if (!C0724O8O0.m2880Lil1l().m2885lILLLIL() && oOO8Oo.m4077lILLLIL()) {
            I1();
            m3663lll(10000);
        }
        if (C0724O8O0.m2880Lil1l().m2885lILLLIL()) {
            MainService.m605lll(this.f2322lll);
            if (oo80o0.LLI1lI1 == null) {
                return true;
            }
            oo80o0.LLI1lI1.m6546lll();
            return true;
        }
        StringBuilder sb = new StringBuilder();
        sb.append("请开启");
        Context context = this.f2322lll;
        sb.append(C0OO.m4930Lil1l(context, context.getPackageName()));
        sb.append("助手服务");
        String sb2 = sb.toString();
        C0806o80.m3562IiiiIL().m3594lll(sb2);
        C0794o00.m3495lll("i", sb2);
        if (oo80o0.LLI1lI1 != null) {
            oo80o0.LLI1lI1.LLI1lI1(sb2);
        }
        LLI1lI1(this.f2322lll);
        return false;
    }

    public void LLI1lI1() {
        int i = 0;
        try {
            i = Integer.parseInt(C0795o00OooO.LLI1lI1(App.getContext().getFileStreamPath("httpserverport")));
            System.out.println("stopHttp port " + i);
        } catch (Exception unused) {
        }
        if (i <= 0) {
            i = OoooO8o.f1985IiiiIL;
        }
        try {
            this.f23201l.LI11i();
            String str = "http://127.0.0.1:" + i + "/stop";
            C0712O00.m2754lll("StopAgent", "stop url " + str);
            Jsoup.connect(str).timeout(2000).method(Connection.Method.POST).execute();
        } catch (Exception unused2) {
        }
    }

    public boolean Lil() {
        return m3677lll(true);
    }

    public boolean m3666LL1I1I() {
        String IIiL12 = IIiL1();
        return IIiL12 != null && IIiL12.length() > 0;
    }

    public void m3667Li() {
        if (m3660LiIILLL()) {
            new C0808o(this.f2322lll, this.f2322lll.getPackageName() + "/" + m3673IiiiIL()).m4837Lil1l();
        }
    }

    public void m3668iIlI() {
    }

    public boolean m3669iiii() {
        if (WebService.LLI1lI1() != null) {
            try {
                if (Build.VERSION.SDK_INT >= 24) {
                    WebService.LLI1lI1().disableSelf();
                }
            } catch (Exception unused) {
            }
        }
        if (m3660LiIILLL()) {
            m3667Li();
            m3663lll(2000);
        }
        if (!C0724O8O0.m2880Lil1l().m2885lILLLIL()) {
            return true;
        }
        if (oOO8Oo.m4077lILLLIL()) {
            m3658iIIlli();
            m3663lll(2000);
        }
        return !C0724O8O0.m2880Lil1l().m2885lILLLIL();
    }

    public boolean il() {
        String str;
        String IIiL12 = IIiL1();
        return IIiL12 != null && IIiL12.length() > 0 && (str = this.il) != null && str.equalsIgnoreCase(this.LLI1lI1);
    }

    public boolean l1() {
        return WebService.LLI1lI1() != null;
    }

    public void m3670lILLLIL() {
        if (!m3660LiIILLL()) {
            I1();
            return;
        }
        new C0808o(this.f2322lll, this.f2322lll.getPackageName() + "/" + m3673IiiiIL()).LLI1lI1();
    }

    public boolean lLLiil() {
        boolean m3665Ii1L1L;
        if (C0806o80.m3562IiiiIL().m3578iIlI()) {
            m3664I1l();
            O8OO8.LLI1lI1().m1918Li();
            if (!il()) {
                m3671lIlilLL();
                m3665Ii1L1L = m3676iil();
                oo80o0.IIiL1().m6540lILLLIL();
                return m3665Ii1L1L;
            }
            MainService.m605lll(this.f2322lll);
        } else {
            if (!C0806o80.m3562IiiiIL().Lil()) {
                return false;
            }
            if (!C0724O8O0.m2880Lil1l().m2885lILLLIL()) {
                m3665Ii1L1L = m3665Ii1L1L();
                oo80o0.IIiL1().m6540lILLLIL();
                return m3665Ii1L1L;
            }
            MainService.m605lll(this.f2322lll);
        }
    }

    public void m3671lIlilLL() {
        int m2404lll = C0806o80.m3562IiiiIL().m3573LllL().m2404lll();
        if (m2404lll > 1024) {
            OoooO8o.f1985IiiiIL = m2404lll;
        }
        m3655I11ll();
        if (il()) {
            return;
        }
        C0712O00.m2751lILLLIL(IIiL1, "agent server not ok,close");
        m3674Lil1l();
    }

    public void m36721l() {
        C0712O00.m2751lILLLIL(IIiL1, "daemonAccEnv startup.... ");
        if (Build.VERSION.SDK_INT < 24) {
            return;
        }
        if (!C0724O8O0.m2880Lil1l().m2885lILLLIL() && m3660LiIILLL()) {
            m3670lILLLIL();
            m3663lll(TbsReaderView.ReaderCallback.GET_BAR_ANIMATING);
        }
        if (!C0724O8O0.m2880Lil1l().m2885lILLLIL() && oOO8Oo.m4077lILLLIL()) {
            I1();
            m3663lll(10000);
        }
        C0712O00.m2751lILLLIL(IIiL1, "daemonAccEnv startup acc result-> " + C0724O8O0.m2880Lil1l().m2885lILLLIL());
    }

    public String m3673IiiiIL() {
        String str = this.f2318Li;
        if (str == null || str.trim().length() <= 0) {
            this.f2318Li = m3656LliiII();
        }
        System.out.println("accClsName " + this.f2318Li);
        return this.f2318Li;
    }

    public void m3674Lil1l() {
        LLI1lI1();
        LLI1lI1();
        File file = new File(Environment.getExternalStorageDirectory(), f2317lIlilLL);
        try {
            file.createNewFile();
            oOO8Oo.m4079lll("cp " + file.getAbsolutePath() + " /data/local/tmp/" + f2317lIlilLL);
            try {
                Thread.sleep(2000L);
            } catch (InterruptedException unused) {
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
        file.delete();
    }

    public void m3675iII11() {
        File file;
        O8OO8.LLI1lI1().m1918Li();
        LI11i();
        C0712O00.m2751lILLLIL(IIiL1, "daemonAgentEnv startup.... ");
        if (!il() && (file = this.f2319lILLLIL) != null && file.exists() && this.f2319lILLLIL.length() > 0) {
            m3674Lil1l();
            String m3659iI1i1 = m3659iI1i1();
            C0712O00.m2751lILLLIL(IIiL1, "daemonAgentEnv startup-> " + m3659iI1i1);
            oOO8Oo.m4079lll(m3659iI1i1);
            boolean LLI1lI1 = LLI1lI1(20000);
            if (LLI1lI1) {
                m3664I1l();
                LI11i();
            }
            C0712O00.m2751lILLLIL(IIiL1, "daemonAgentEnv startup agent result-> " + LLI1lI1);
        }
    }

    public boolean m3676iil() {
        System.out.println("prepareAgentEnv ");
        if (il()) {
            MainService.m605lll(this.f2322lll);
            if (oo80o0.LLI1lI1 != null) {
                oo80o0.LLI1lI1.m6546lll();
            }
            LI11i();
            return true;
        }
        boolean m4082lll = oOO8Oo.m4082lll();
        boolean LLI1lI1 = oOO8Oo.LLI1lI1();
        boolean m4078Lil1l = oOO8Oo.m4078Lil1l();
        C0712O00.m2754lll(IIiL1, "prepareAgentEnv-> agent " + m4082lll + " sudo " + LLI1lI1 + " shizukuOk:" + m4078Lil1l);
        if (!oOO8Oo.m4077lILLLIL()) {
            C0806o80.m3562IiiiIL().m3594lll("[10001]没有运行时环境权限,请激活设备");
            C0794o00.m3495lll("e", "[10001]没有运行时环境权限,请激活设备");
            if (oo80o0.LLI1lI1 == null) {
                return false;
            }
            oo80o0.LLI1lI1.LLI1lI1("[10001]没有运行时环境权限,请激活设备");
            return false;
        }
        C0806o80.m3562IiiiIL().m3594lll("正在初始化环境...");
        C0794o00.m3495lll("i", "正在初始化环境...");
        if (oo80o0.LLI1lI1 != null) {
            oo80o0.LLI1lI1.m6547lll("正在初始化环境...");
        }
        String m3659iI1i1 = m3659iI1i1();
        C0712O00.m2751lILLLIL(IIiL1, "startup-> " + m3659iI1i1);
        oOO8Oo.m4079lll(m3659iI1i1);
        C0806o80.m3562IiiiIL().m3594lll("正在启动环境,请稍等");
        C0794o00.m3495lll(StringFog.decrypt("KQ=="), "正在启动环境,请稍等");
        if (oo80o0.LLI1lI1 != null) {
            oo80o0.LLI1lI1.m6547lll("正在启动环境,请稍等");
        }
        boolean LLI1lI12 = LLI1lI1(10000);
        System.out.println("startOk " + LLI1lI12);
        if (LLI1lI12) {
            m3664I1l();
            C0794o00.m3495lll(StringFog.decrypt("KQ=="), "启动环境成功");
            MainService.m605lll(this.f2322lll);
        }
        if (oo80o0.LLI1lI1 != null) {
            if (LLI1lI12) {
                oo80o0.LLI1lI1.m6546lll();
            } else {
                C0806o80.m3562IiiiIL().m3594lll("[10006]环境服务未准备好");
                C0794o00.m3495lll(StringFog.decrypt("JQ=="), "[10006]环境服务未准备好");
                oo80o0.LLI1lI1.LLI1lI1("[10006]环境服务未准备好");
            }
        }
        if (LLI1lI12) {
            LI11i();
        }
        return LLI1lI12;
    }

    public boolean m3677lll(boolean z) {
        if (!C0806o80.m3562IiiiIL().m3568Ii1L1L()) {
            return true;
        }
        if (C0806o80.m3562IiiiIL().m3578iIlI()) {
            m3674Lil1l();
        }
        if (!C0806o80.m3562IiiiIL().Lil() || m3669iiii() || !z) {
            return !C0806o80.m3562IiiiIL().m3568Ii1L1L();
        }
        StringBuilder sb = new StringBuilder();
        sb.append("请关闭");
        Context context = this.f2322lll;
        sb.append(C0OO.m4930Lil1l(context, context.getPackageName()));
        sb.append("助手服务");
        ToastUtils.show((CharSequence) sb.toString());
        LLI1lI1(this.f2322lll);
        return false;
    }
}