脱壳之常用的加固样本特征

梆梆加固样本特征

清单文件入口

android:name=“com.SecShell.SecShell.ApplicationWrapper”

特征

  1. 免费版
    在这里插入图片描述
  2. meta-data
    meta-data
  3. 总结
    assets/secData0.jar
    lib/armeabi/libSecShell.so
    lib/armeabi/libSecShell-x86.so
    梆梆企业版
    assets/classes0.jar
    lib/armeabi-v7a/libDexHelper.so
    lib/armeabi-v7a/ libDexHelper-x86.so
    梆梆是把原dex文件加密放到了secData0.jar,所以直接拿到dex文件,修复配置文件的程序入口点就可以重打包完美运行。
    通过还原加密算法,解密secData0.jar,直接解压解密jar就是原dex。
    secData0.jar文件保存在.cache的classes.dex是加密的,主要是通过hook实现,打开时解密,关闭时加密(open、mmap)。
    /data/app/com.qianyu.helloworld-47o1HjF-eZJXXlpOoPX_nA==/lib/arm/libSecShell.so CC688000 1B6AB000

清单文件

package com.SecShell.SecShell;

import android.annotation.TargetApi;
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.res.Configuration;
import android.view.LayoutInflater;
import java.lang.reflect.Field;

/* loaded from: classes.dex */
public class ApplicationWrapper extends Application {
    public static Application realApplication = null;

    static {
        d.a();
        System.loadLibrary("SecShell");
        if (Helper.PPATH != null) {
            System.load(Helper.PPATH);
        }
        if (Helper.J2CNAME.equals("SECNEOJ2C")) {
            return;
        }
        System.loadLibrary(Helper.J2CNAME);
    }

    @Override // android.content.ContextWrapper
    protected void attachBaseContext(Context context) {
        super.attachBaseContext(context);
        if (Boolean.parseBoolean(Helper.ABCCHECK)) {
            e.a(context);
        }
        try {
            if (!"".equals(Helper.APPNAME)) {
                realApplication = (Application) getClassLoader().loadClass(Helper.APPNAME).newInstance();
            }
        } catch (Exception e) {
            realApplication = null;
        }
        Helper.attach(realApplication, context);
    }

    @Override // android.content.ContextWrapper, android.content.Context
    public boolean bindService(Intent intent, ServiceConnection serviceConnection, int i) {
        if (realApplication != null) {
            Helper.b(realApplication);
            return realApplication.bindService(intent, serviceConnection, i);
        }
        return super.bindService(intent, serviceConnection, i);
    }

    @Override // android.app.Application, android.content.ComponentCallbacks
    public void onConfigurationChanged(Configuration configuration) {
        super.onConfigurationChanged(configuration);
        if (realApplication != null) {
            realApplication.onConfigurationChanged(configuration);
        }
    }

    @Override // android.app.Application
    public void onCreate() {
        super.onCreate();
        try {
            Helper.c();
        } catch (Throwable th) {
        }
        if (realApplication != null) {
            Helper.attach(realApplication, null);
            realApplication.onCreate();
            LayoutInflater from = LayoutInflater.from(getApplicationContext());
            try {
                Field declaredField = LayoutInflater.class.getDeclaredField("mContext");
                declaredField.setAccessible(true);
                declaredField.set(from, realApplication);
            } catch (Exception e) {
            }
        }
    }

    @Override // android.app.Application, android.content.ComponentCallbacks
    public void onLowMemory() {
        super.onLowMemory();
        if (realApplication != null) {
            realApplication.onLowMemory();
        }
    }

    @Override // android.app.Application
    public void onTerminate() {
        super.onTerminate();
        if (realApplication != null) {
            realApplication.onTerminate();
        }
    }

    @Override // android.app.Application, android.content.ComponentCallbacks2
    @TargetApi(14)
    public void onTrimMemory(int i) {
        try {
            super.onTrimMemory(i);
            if (realApplication != null) {
                realApplication.onTrimMemory(i);
            }
        } catch (Exception e) {
        }
    }

    @Override // android.app.Application
    @TargetApi(14)
    public void registerActivityLifecycleCallbacks(Application.ActivityLifecycleCallbacks activityLifecycleCallbacks) {
        super.registerActivityLifecycleCallbacks(activityLifecycleCallbacks);
        if (realApplication != null) {
            realApplication.registerActivityLifecycleCallbacks(activityLifecycleCallbacks);
        }
    }
}

Helper

package com.SecShell.SecShell;

import android.app.Application;
import android.content.Context;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.List;

/* loaded from: classes.dex */
public class Helper {
    public static ClassLoader cl;
    public static String PPATH = null;
    public static String JNIPPATH = null;
    public static String PKGNAME = "com.qianyu.helloworld";
    public static String APPNAME = "";
    public static String J2CNAME = "SECNEOJ2C";
    public static String ABCCHECK = "SECNEOCHECK";
    public static String ISMPASS = "SECNEOMPASS";

    public static native void attach(Application application, Context context);

    public static native void b(Application application);

    public static native void c();

    public static native String d(String str);

    public static native Object[] e(Object obj, List list, String str);

    public static void f(ClassLoader classLoader, String str, String str2) {
        b.a(classLoader, str, str2);
    }

    public static void g(Object obj) {
        b.a(obj);
    }

    public static Object h(ClassLoader classLoader) {
        return new f(":", classLoader);
    }

    public static boolean isInstalled(String str) {
        BufferedReader bufferedReader;
        String readLine;
        try {
            bufferedReader = new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec("pm path " + str).getInputStream()));
        } catch (IOException e) {
            e.printStackTrace();
        }
        do {
            readLine = bufferedReader.readLine();
            if (readLine == null) {
                return false;
            }
        } while (!readLine.startsWith("package:"));
        return true;
    }

    public static void stub() {
    }
}

a

public final class a {
    public static final String[] a = {"com.noshufou.android.su", "com.noshufou.android.su.elite", "eu.chainfire.supersu", "com.koushikdutta.superuser", "com.thirdparty.superuser", "com.yellowes.su"};
    public static final String[] b = {"com.koushikdutta.rommanager", "com.koushikdutta.rommanager.license", "com.dimonvideo.luckypatcher", "com.chelpus.lackypatch", "com.ramdroid.appquarantine", "com.ramdroid.appquarantinepro"};
    public static final String[] c = {"com.devadvance.rootcloak", "com.devadvance.rootcloakplus", "de.robv.android.xposed.installer", "com.saurik.substrate", "com.zachspong.temprootremovejb", "com.amphoras.hidemyroot", "com.amphoras.hidemyrootadfree", "com.formyhm.hiderootPremium", "com.formyhm.hideroot"};
    public static final String[] d = {"/data/local/", "/data/local/bin/", "/data/local/xbin/", "/sbin/", "/su/bin/", "/system/bin/", "/system/bin/.ext/", "/system/bin/failsafe/", "/system/sd/xbin/", "/system/usr/we-need-root/", "/system/xbin/"};
    public static final String[] e = {"/system", "/system/bin", "/system/sbin", "/system/xbin", "/vendor/bin", "/sbin", "/etc"};
}

b

/* loaded from: classes.dex */
public class b {
    private static ArrayList a = new ArrayList();

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes.dex */
    public static final class a {
        private static Object[] a(Object obj, ArrayList arrayList, File file) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
            return (Object[]) b.b(obj, "makeDexElements", ArrayList.class, File.class).invoke(obj, arrayList, file);
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static void b(ClassLoader classLoader, List list, File file) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, InvocationTargetException, NoSuchMethodException {
            Object obj = b.b(classLoader, "pathList").get(classLoader);
            b.b(obj, "dexElements", a(obj, new ArrayList(list), file));
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* renamed from: com.SecShell.SecShell.b$b  reason: collision with other inner class name */
    /* loaded from: classes.dex */
    public static final class C0000b {
        /* JADX INFO: Access modifiers changed from: private */
        public static void b(ClassLoader classLoader, List list, File file) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, InvocationTargetException, NoSuchMethodException {
            IOException[] iOExceptionArr;
            Object obj = b.b(classLoader, "pathList").get(classLoader);
            ArrayList arrayList = new ArrayList();
            b.b(obj, "dexElements", b(obj, new ArrayList(list), file, arrayList), Build.VERSION.SDK_INT < 28);
            if (arrayList.size() > 0) {
                Iterator it = arrayList.iterator();
                while (it.hasNext()) {
                    IOException iOException = (IOException) it.next();
                }
                Field b = b.b(classLoader, "dexElementsSuppressedExceptions");
                IOException[] iOExceptionArr2 = (IOException[]) b.get(classLoader);
                if (iOExceptionArr2 == null) {
                    iOExceptionArr = (IOException[]) arrayList.toArray(new IOException[arrayList.size()]);
                } else {
                    IOException[] iOExceptionArr3 = new IOException[arrayList.size() + iOExceptionArr2.length];
                    arrayList.toArray(iOExceptionArr3);
                    System.arraycopy(iOExceptionArr2, 0, iOExceptionArr3, arrayList.size(), iOExceptionArr2.length);
                    iOExceptionArr = iOExceptionArr3;
                }
                b.set(classLoader, iOExceptionArr);
            }
        }

        /* JADX INFO: Access modifiers changed from: private */
        public static Object[] b(Object obj, ArrayList arrayList, File file, ArrayList arrayList2) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
            Method method = null;
            try {
                method = b.b(obj, "makeDexElements", ArrayList.class, File.class, ArrayList.class);
            } catch (Exception e) {
            }
            if (method == null) {
                try {
                    method = b.b(obj, "makePathElements", List.class, File.class, List.class);
                } catch (Exception e2) {
                }
            }
            return (Object[]) method.invoke(obj, arrayList, file, arrayList2);
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes.dex */
    public static final class c {
        /* JADX INFO: Access modifiers changed from: private */
        public static void b(ClassLoader classLoader, List list) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, IOException {
            int size = list.size();
            Field b = b.b(classLoader, "path");
            StringBuilder sb = new StringBuilder((String) b.get(classLoader));
            String[] strArr = new String[size];
            File[] fileArr = new File[size];
            ZipFile[] zipFileArr = new ZipFile[size];
            DexFile[] dexFileArr = new DexFile[size];
            ListIterator listIterator = list.listIterator();
            while (listIterator.hasNext()) {
                File file = (File) listIterator.next();
                String absolutePath = file.getAbsolutePath();
                sb.append(':').append(absolutePath);
                int previousIndex = listIterator.previousIndex();
                strArr[previousIndex] = absolutePath;
                fileArr[previousIndex] = file;
                zipFileArr[previousIndex] = new ZipFile(file);
                dexFileArr[previousIndex] = DexFile.loadDex(absolutePath, absolutePath + ".dex", 0);
            }
            b.set(classLoader, sb.toString());
            b.b(classLoader, "mPaths", strArr);
            b.b(classLoader, "mFiles", fileArr);
            b.b(classLoader, "mZips", zipFileArr);
            b.b(classLoader, "mDexs", dexFileArr);
        }
    }

    private static void a(ClassLoader classLoader, File file, List list) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, InvocationTargetException, NoSuchMethodException, IOException {
        if (list.isEmpty()) {
            return;
        }
        if ((Build.VERSION.RELEASE.equals("P") || Build.VERSION.SDK_INT >= 28) && !Boolean.parseBoolean(Helper.ISMPASS)) {
            a(classLoader, ((File) list.get(0)).getAbsolutePath());
        } else if (Build.VERSION.SDK_INT >= 19) {
            C0000b.b(classLoader, list, file);
        } else if (Build.VERSION.SDK_INT >= 14) {
            a.b(classLoader, list, file);
        } else {
            c.b(classLoader, list);
        }
    }

    private static void a(ClassLoader classLoader, String str) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, InvocationTargetException, NoSuchMethodException {
        IOException[] iOExceptionArr;
        Object obj = b(classLoader, "pathList").get(classLoader);
        ArrayList arrayList = new ArrayList();
        b(obj, "dexElements", Helper.e(obj, arrayList, str), false);
        if (arrayList.size() > 0) {
            Iterator it = arrayList.iterator();
            while (it.hasNext()) {
                ((IOException) it.next()).printStackTrace(System.out);
            }
            Field b = b(classLoader, "dexElementsSuppressedExceptions");
            IOException[] iOExceptionArr2 = (IOException[]) b.get(classLoader);
            if (iOExceptionArr2 == null) {
                iOExceptionArr = (IOException[]) arrayList.toArray(new IOException[arrayList.size()]);
            } else {
                IOException[] iOExceptionArr3 = new IOException[arrayList.size() + iOExceptionArr2.length];
                arrayList.toArray(iOExceptionArr3);
                System.arraycopy(iOExceptionArr2, 0, iOExceptionArr3, arrayList.size(), iOExceptionArr2.length);
                iOExceptionArr = iOExceptionArr3;
            }
            b.set(classLoader, iOExceptionArr);
        }
    }

    public static void a(ClassLoader classLoader, String str, String str2) {
        try {
            a(classLoader, new File(str2), Arrays.asList(new File(str)));
        } catch (Exception e) {
        }
    }

    public static void a(Object obj) {
        Object[] objArr;
        try {
            ArrayList arrayList = new ArrayList();
            Field b = b(obj, "dexElements");
            for (Object obj2 : (Object[]) b.get(obj)) {
                DexFile dexFile = (DexFile) b(obj2, "dexFile").get(obj2);
                if (dexFile != null) {
                    arrayList.add(new File(dexFile.getName()));
                    a.add(dexFile);
                }
            }
            b.set(obj, C0000b.b(obj, arrayList, null, new ArrayList()));
        } catch (Exception e) {
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static Field b(Object obj, String str) throws NoSuchFieldException {
        for (Class<?> cls = obj.getClass(); cls != null; cls = cls.getSuperclass()) {
            try {
                Field declaredField = cls.getDeclaredField(str);
                if (!declaredField.isAccessible()) {
                    declaredField.setAccessible(true);
                }
                return declaredField;
            } catch (NoSuchFieldException e) {
            }
        }
        throw new NoSuchFieldException("Field " + str + " not found in " + obj.getClass());
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static Method b(Object obj, String str, Class... clsArr) throws NoSuchMethodException {
        for (Class<?> cls = obj.getClass(); cls != null; cls = cls.getSuperclass()) {
            try {
                Method declaredMethod = cls.getDeclaredMethod(str, clsArr);
                if (!declaredMethod.isAccessible()) {
                    declaredMethod.setAccessible(true);
                }
                return declaredMethod;
            } catch (NoSuchMethodException e) {
            }
        }
        throw new NoSuchMethodException("Method " + str + " with parameters " + Arrays.asList(clsArr) + " not found in " + obj.getClass());
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static void b(Object obj, String str, Object[] objArr) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
        b(obj, str, objArr, true);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static void b(Object obj, String str, Object[] objArr, boolean z) throws NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
        Field b = b(obj, str);
        Object[] objArr2 = (Object[]) b.get(obj);
        Object[] objArr3 = (Object[]) Array.newInstance(objArr2.getClass().getComponentType(), objArr2.length + objArr.length);
        if (z) {
            System.arraycopy(objArr2, 0, objArr3, objArr.length, objArr2.length);
            System.arraycopy(objArr, 0, objArr3, 0, objArr.length);
        } else {
            System.arraycopy(objArr2, 0, objArr3, 0, objArr2.length);
            System.arraycopy(objArr, 0, objArr3, objArr2.length, objArr.length);
        }
        b.set(obj, objArr3);
    }
}

c

/* loaded from: classes.dex */
public class c {
    public static int a(String[] strArr) {
        try {
            int i = 0;
            for (String str : strArr) {
                try {
                    if (b(str)) {
                        i++;
                    }
                } catch (Throwable th) {
                    return i;
                }
            }
            return i;
        } catch (Throwable th2) {
            return 0;
        }
    }

    public static boolean a(String str) {
        try {
            return new File(str).exists();
        } catch (Exception e) {
            return false;
        }
    }

    public static boolean b(String str) {
        try {
            return a(str);
        } catch (Throwable th) {
            th.printStackTrace();
            return false;
        }
    }
}

d

/* loaded from: classes.dex */
public class d extends FileObserver {
    private static d a;
    private static Object b = new Object();
    private static boolean c = true;

    public d(String str, int i) {
        super(str, i);
    }

    public static void a() {
        Thread[] threadArr = new Thread[20];
        int enumerate = Thread.currentThread().getThreadGroup().enumerate(threadArr);
        boolean z = false;
        for (int i = 0; i < enumerate; i++) {
            if ("FileObserver".equals(threadArr[i].getName())) {
                z = true;
            }
        }
        if (z) {
            String b2 = b();
            new File(b2, "miui_notify" + Process.myPid()).delete();
            a = new d(b2, 256);
            a.startWatching();
            try {
                new File(b2, "miui_notify" + Process.myPid()).createNewFile();
            } catch (IOException e) {
            }
            synchronized (b) {
                try {
                    if (c) {
                        b.wait(1000L);
                    }
                } catch (InterruptedException e2) {
                }
            }
            new File(b2, "miui_notify" + Process.myPid()).delete();
        }
    }

    private static String b() {
        try {
            Class<?> cls = Class.forName("android.app.ActivityThread");
            Method method = cls.getMethod("currentActivityThread", new Class[0]);
            Field declaredField = cls.getDeclaredField("mBoundApplication");
            boolean isAccessible = declaredField.isAccessible();
            declaredField.setAccessible(true);
            Object obj = declaredField.get(method.invoke(null, new Object[0]));
            declaredField.setAccessible(isAccessible);
            Field declaredField2 = obj.getClass().getDeclaredField("appInfo");
            boolean isAccessible2 = declaredField2.isAccessible();
            declaredField2.setAccessible(true);
            declaredField2.setAccessible(isAccessible2);
            return ((ApplicationInfo) declaredField2.get(obj)).dataDir;
        } catch (Exception e) {
            return "/data/data/" + Helper.PKGNAME;
        }
    }

    @Override // android.os.FileObserver
    public void onEvent(int i, String str) {
        stopWatching();
        synchronized (b) {
            c = false;
            b.notify();
        }
        try {
            Thread.sleep(3000L);
        } catch (InterruptedException e) {
        }
    }
}

e

/* loaded from: classes.dex */
public class e {
    private final Context a;
    private boolean b = true;

    public e(Context context) {
        this.a = context;
    }

    public static void a(Context context) {
        if (new e(context).a()) {
            System.exit(0);
        }
    }

    private boolean a(List list) {
        boolean z = false;
        PackageManager packageManager = this.a.getPackageManager();
        Iterator it = list.iterator();
        while (true) {
            boolean z2 = z;
            if (!it.hasNext()) {
                return z2;
            }
            try {
                packageManager.getPackageInfo((String) it.next(), 0);
                z = true;
            } catch (PackageManager.NameNotFoundException e) {
                z = z2;
            }
        }
    }

    public boolean a() {
        return b() || c() || a("su") || d() || e() || f() || h();
    }

    public boolean a(String str) {
        String[] strArr;
        int length = a.d.length;
        boolean z = false;
        for (int i = 0; i < length; i++) {
            if (new File(strArr[i] + str).exists()) {
                z = true;
            }
        }
        return z;
    }

    public boolean a(String[] strArr) {
        ArrayList arrayList = new ArrayList();
        arrayList.addAll(Arrays.asList(a.a));
        if (strArr != null && strArr.length > 0) {
            arrayList.addAll(Arrays.asList(strArr));
        }
        return a(arrayList);
    }

    public boolean b() {
        return a((String[]) null);
    }

    public boolean b(String[] strArr) {
        ArrayList arrayList = new ArrayList();
        arrayList.addAll(Arrays.asList(a.b));
        if (strArr != null && strArr.length > 0) {
            arrayList.addAll(Arrays.asList(strArr));
        }
        return a(arrayList);
    }

    public boolean c() {
        return b(null);
    }

    /* JADX WARN: Code restructure failed: missing block: B:14:0x0072, code lost:
        if (r3.equals("0") != false) goto L18;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct code enable 'Show inconsistent code' option in preferences
    */
    public boolean d() {
        /*
            r8 = this;
            r4 = 0
            r0 = 1
            r2 = 0
            java.lang.ProcessBuilder r1 = new java.lang.ProcessBuilder     // Catch: java.lang.Exception -> L78 java.lang.Throwable -> L82
            r3 = 2
            java.lang.String[] r3 = new java.lang.String[r3]     // Catch: java.lang.Exception -> L78 java.lang.Throwable -> L82
            r5 = 0
            java.lang.String r6 = "getprop"
            r3[r5] = r6     // Catch: java.lang.Exception -> L78 java.lang.Throwable -> L82
            r5 = 1
            java.lang.String r6 = "ro.debuggable"
            r3[r5] = r6     // Catch: java.lang.Exception -> L78 java.lang.Throwable -> L82
            r1.<init>(r3)     // Catch: java.lang.Exception -> L78 java.lang.Throwable -> L82
            r3 = 1
            r1.redirectErrorStream(r3)     // Catch: java.lang.Exception -> L78 java.lang.Throwable -> L82
            java.lang.Process r1 = r1.start()     // Catch: java.lang.Exception -> L78 java.lang.Throwable -> L82
            java.io.BufferedReader r3 = new java.io.BufferedReader     // Catch: java.lang.Exception -> L78 java.lang.Throwable -> L82
            java.io.InputStreamReader r5 = new java.io.InputStreamReader     // Catch: java.lang.Exception -> L78 java.lang.Throwable -> L82
            java.io.InputStream r1 = r1.getInputStream()     // Catch: java.lang.Exception -> L78 java.lang.Throwable -> L82
            r5.<init>(r1)     // Catch: java.lang.Exception -> L78 java.lang.Throwable -> L82
            r3.<init>(r5)     // Catch: java.lang.Exception -> L78 java.lang.Throwable -> L82
            java.lang.String r1 = ""
            java.lang.String r1 = r3.readLine()     // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8d
            if (r1 == 0) goto L97
            java.lang.String r2 = "1"
            boolean r1 = r1.equals(r2)     // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8d
            if (r1 == 0) goto L97
            r1 = r0
        L3c:
            if (r1 != 0) goto L94
            java.lang.ProcessBuilder r2 = new java.lang.ProcessBuilder     // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8d
            r5 = 2
            java.lang.String[] r5 = new java.lang.String[r5]     // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8d
            r6 = 0
            java.lang.String r7 = "getprop"
            r5[r6] = r7     // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8d
            r6 = 1
            java.lang.String r7 = "ro.secure"
            r5[r6] = r7     // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8d
            r2.<init>(r5)     // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8d
            r5 = 1
            r2.redirectErrorStream(r5)     // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8d
            java.lang.Process r5 = r2.start()     // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8d
            java.io.BufferedReader r2 = new java.io.BufferedReader     // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8d
            java.io.InputStreamReader r6 = new java.io.InputStreamReader     // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8d
            java.io.InputStream r5 = r5.getInputStream()     // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8d
            r6.<init>(r5)     // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8d
            r2.<init>(r6)     // Catch: java.lang.Throwable -> L88 java.lang.Exception -> L8d
            java.lang.String r3 = r2.readLine()     // Catch: java.lang.Throwable -> L8a java.lang.Exception -> L8f
            if (r3 == 0) goto L92
            java.lang.String r5 = "0"
            boolean r3 = r3.equals(r5)     // Catch: java.lang.Throwable -> L8a java.lang.Exception -> L8f
            if (r3 == 0) goto L92
        L74:
            com.SecShell.SecShell.g.a(r2)
        L77:
            return r0
        L78:
            r0 = move-exception
            r3 = r2
        L7a:
            r0.printStackTrace()     // Catch: java.lang.Throwable -> L88
            com.SecShell.SecShell.g.a(r3)
            r0 = r4
            goto L77
        L82:
            r0 = move-exception
            r3 = r2
        L84:
            com.SecShell.SecShell.g.a(r3)
            throw r0
        L88:
            r0 = move-exception
            goto L84
        L8a:
            r0 = move-exception
            r3 = r2
            goto L84
        L8d:
            r0 = move-exception
            goto L7a
        L8f:
            r0 = move-exception
            r3 = r2
            goto L7a
        L92:
            r0 = r1
            goto L74
        L94:
            r0 = r1
            r2 = r3
            goto L74
        L97:
            r1 = r4
            goto L3c
        */
        throw new UnsupportedOperationException("Method not decompiled: com.SecShell.SecShell.e.d():boolean");
    }

    public boolean e() {
        BufferedReader bufferedReader;
        BufferedReader bufferedReader2 = null;
        try {
            ProcessBuilder processBuilder = new ProcessBuilder("mount");
            processBuilder.redirectErrorStream(true);
            Process start = processBuilder.start();
            bufferedReader = new BufferedReader(new InputStreamReader(start.getInputStream()));
            boolean z = false;
            while (true) {
                try {
                    String readLine = bufferedReader.readLine();
                    if (readLine == null) {
                        start.waitFor();
                        g.a(bufferedReader);
                        return z;
                    }
                    String[] split = readLine.split(" ");
                    if (split.length >= 4) {
                        String str = split[1];
                        String str2 = split[3];
                        for (String str3 : a.e) {
                            if (str.equalsIgnoreCase(str3)) {
                                String[] split2 = str2.split(",");
                                int length = split2.length;
                                int i = 0;
                                while (true) {
                                    if (i >= length) {
                                        break;
                                    } else if (split2[i].equalsIgnoreCase("rw")) {
                                        z = true;
                                        break;
                                    } else {
                                        i++;
                                    }
                                }
                            }
                        }
                    }
                } catch (Exception e) {
                    bufferedReader2 = bufferedReader;
                    g.a(bufferedReader2);
                    return false;
                } catch (Throwable th) {
                    th = th;
                    g.a(bufferedReader);
                    throw th;
                }
            }
        } catch (Exception e2) {
        } catch (Throwable th2) {
            th = th2;
            bufferedReader = null;
        }
    }

    public boolean f() {
        BufferedReader bufferedReader;
        Process start;
        BufferedReader bufferedReader2;
        try {
            ProcessBuilder processBuilder = new ProcessBuilder("which", "su");
            processBuilder.redirectErrorStream(false);
            start = processBuilder.start();
            bufferedReader2 = new BufferedReader(new InputStreamReader(start.getInputStream()));
        } catch (Throwable th) {
            bufferedReader = null;
        }
        try {
            String readLine = bufferedReader2.readLine();
            start.waitFor();
            g.a(bufferedReader2);
            if (readLine != null) {
                if (readLine.endsWith("su")) {
                    return true;
                }
            }
            return false;
        } catch (Throwable th2) {
            bufferedReader = bufferedReader2;
            if (bufferedReader != null) {
                g.a(bufferedReader);
            }
            return false;
        }
    }

    public boolean g() {
        return true;
    }

    public boolean h() {
        if (g()) {
            String[] strArr = new String[a.d.length];
            for (int i = 0; i < strArr.length; i++) {
                strArr[i] = a.d[i] + "su";
            }
            return c.a(strArr) > 0;
        }
        return false;
    }
}

f

/* loaded from: classes.dex */
class f extends PathClassLoader {
    private final ClassLoader a;

    public f(String str, ClassLoader classLoader) {
        super(str, classLoader.getParent());
        this.a = classLoader;
    }

    @Override // dalvik.system.BaseDexClassLoader, java.lang.ClassLoader
    public Class findClass(String str) throws ClassNotFoundException {
        return (str == null || !str.equals(Helper.class.getName())) ? super.findClass(str) : this.a.loadClass(str);
    }
}

g


/* loaded from: classes.dex */
public class g {
    public static void a(Closeable closeable) {
        if (closeable != null) {
            try {
                closeable.close();
            } catch (Exception e) {
            }
        }
    }
}

乐谷加固样本特征(ELF区段加密和案例)

主要看assets文件夹和lib文件夹

so文件

lib-shell.so

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-30 12:42:03       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-30 12:42:03       100 阅读
  3. 在Django里面运行非项目文件

    2024-03-30 12:42:03       82 阅读
  4. Python语言-面向对象

    2024-03-30 12:42:03       91 阅读

热门阅读

  1. 了解监控易(13):数据库监控-功能模块解析

    2024-03-30 12:42:03       43 阅读
  2. python基础语法

    2024-03-30 12:42:03       38 阅读
  3. #设计模式#4.6 Flyweight(享元) 对象结构型模式

    2024-03-30 12:42:03       35 阅读
  4. 2024最新华为OD机试试题库全 -【跳马】- C卷

    2024-03-30 12:42:03       41 阅读
  5. Golang基础-3

    2024-03-30 12:42:03       36 阅读
  6. kanzi 3d知识点

    2024-03-30 12:42:03       42 阅读
  7. 了解HTTP安全标头(HTTP Security Headers)

    2024-03-30 12:42:03       42 阅读
  8. C++之常函数、常对象

    2024-03-30 12:42:03       41 阅读
  9. C 传递指针给函数

    2024-03-30 12:42:03       37 阅读
  10. Django vs Flask:选择最适合你的Python Web框架

    2024-03-30 12:42:03       36 阅读
  11. 应急响应流程与挖矿病毒排查流程

    2024-03-30 12:42:03       37 阅读
  12. <商务世界>《第28课 商务旅行的注意事项》

    2024-03-30 12:42:03       43 阅读
  13. 【神经网络模型】——AI大模型学习

    2024-03-30 12:42:03       40 阅读
  14. CC攻击l

    2024-03-30 12:42:03       34 阅读