熊盒子.apk(点击下载) / StubApp.java


package com.stub;

import android.app.Application;
import android.content.Context;
import android.content.res.AssetFileDescriptor;
import android.content.res.AssetManager;
import android.location.Location;
import android.location.LocationManager;
import android.os.Build;
import com.qihoo.util.c;
import dalvik.system.DexFile;
import java.io.File;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.util.Enumeration;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

public final class StubApp extends Application {
    private static Application a = null;
    private static Application b = null;
    private static String c = "libjiagu";
    private static Context d;
    private static String e = null;
    private static String f = null;
    private static String g = null;
    private static String h = null;
    private static String i = null;
    public static boolean isMcIsolated = false;
    private static Map<Integer, String> j = new ConcurrentHashMap();
    private static boolean loadFromLib = false;
    private static boolean needX86Bridge = false;
    private static boolean returnIntern = true;
    public static String strEntryApplication = "entryRunApplication";

    public static native void interface11(int i2);

    public static native Enumeration<String> interface12(DexFile dexFile);

    public static native long interface13(int i2, long j2, long j3, long j4, int i3, int i4, long j5);

    public static native String interface14(int i2);

    public static native AssetFileDescriptor interface17(AssetManager assetManager, String str);

    public static native InputStream interface18(Class cls, String str);

    public static native InputStream interface19(ClassLoader classLoader, String str);

    public static native void interface20();

    public static native void interface21(Application application);

    public static native void interface22(int i2, String[] strArr, int[] iArr);

    public static native ZipEntry interface30(ZipFile zipFile, String str);

    public static native void interface5(Application application);

    public static native String interface6(String str);

    public static native boolean interface7(Application application, Context context);

    public static native boolean interface8(Application application, Context context);

    public static native Location mark(LocationManager locationManager, String str);

    public static native void mark();

    public static native void mark(Location location);

    public static native synchronized Object n010333(Object obj, Object obj2);

    public static native void n0110();

    public static native int n0111();

    public static native int n0111111131(int i2, int i3, int i4, int i5, int i6, Object obj);

    public static native long n011122(int i2, long j2);

    public static native void n01120(long j2);

    public static native int n01121(long j2);

    public static native void n011210(long j2, int i2);

    public static native int n011211(long j2, int i2);

    public static native void n0112110(long j2, int i2, int i3);

    public static native void n0112130(long j2, int i2, Object obj);

    public static native long n01122(long j2);

    public static native Object n01123(long j2);

    public static native long n011232(long j2, Object obj);

    public static native void n0112330(long j2, Object obj, Object obj2);

    public static native int n0112331(long j2, Object obj, Object obj2);

    public static native Object n0113();

    public static native void n01130(Object obj);

    public static native boolean n01131(Object obj);

    public static native int n011311(Object obj, boolean z);

    public static native Object n011313(Object obj, boolean z);

    public static native void n0113130(Object obj, int i2, Object obj2);

    public static native Object n0113133(Object obj, int i2, Object obj2);

    public static native long n01132(Object obj);

    public static native void n0113220(Object obj, double d2, double d3);

    public static native Object n01133(Object obj);

    public static native void n011330(Object obj, Object obj2);

    public static native boolean n011331(Object obj, Object obj2);

    public static native Object n011333(Object obj, Object obj2);

    public static native void n0113330(Object obj, Object obj2, Object obj3);

    public static native Object n0113333(Object obj, Object obj2, Object obj3);

    public static native void pmark(Context context);

    public static native void rmark();

    public native synchronized void n1100();

    public native synchronized void n11030(Object obj);

    public native synchronized boolean n110331(Object obj, Object obj2);

    public native void n1110();

    public native boolean n1111();

    public native void n11110(int i2);

    public native boolean n11111(boolean z);

    public native void n111130(int i2, Object obj);

    public native boolean n11113311(int i2, Object obj, Object obj2, int i3);

    public native Object n1113();

    public native void n11130(Object obj);

    public native boolean n11131(Object obj);

    public native void n111310(Object obj, int i2);

    public native void n1113130(Object obj, int i2, Object obj2);

    public native Object n11133(Object obj);

    public native void n111330(Object obj, Object obj2);

    public native void n1113310(Object obj, Object obj2, boolean z);

    public native void n11133110(Object obj, Object obj2, boolean z, int i2);

    public native void n1113330(Object obj, Object obj2, Object obj3);

    public native boolean n1113331(Object obj, Object obj2, Object obj3);

    public native void n11133310(Object obj, Object obj2, Object obj3, int i2);

    public native Object n1113333(Object obj, Object obj2, Object obj3);

    public native boolean n11133331(Object obj, Object obj2, Object obj3, Object obj4);

    public static String getSoPath1() {
        return f;
    }

    public static String getSoPath2() {
        return g;
    }

    public static String getDir() {
        return h;
    }

    public static Context getAppContext() {
        return d;
    }

    public static Context getOrigApplicationContext(Context context) {
        if (context == a) {
            return b;
        }
        return context;
    }

    private static Application a(Context context) {
        ClassLoader classLoader;
        Class<?> loadClass;
        try {
            if (!(b != null || (classLoader = context.getClassLoader()) == null || (loadClass = classLoader.loadClass(strEntryApplication)) == null)) {
                b = (Application) loadClass.newInstance();
            }
        } catch (Exception e2) {
        }
        return b;
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r5v1 */
    /* JADX WARN: Type inference failed for: r0v13, types: [java.lang.reflect.Method] */
    /* JADX WARN: Type inference failed for: r2v3, types: [java.lang.Object[]] */
    /* JADX WARN: Type inference failed for: r5v3 */
    /* JADX WARNING: Unknown variable types count: 2 */
    public final void onCreate() {
        System.currentTimeMillis();
        super.onCreate();
        if (!isMcIsolated) {
            try {
                interface7(b, a.getBaseContext());
            } catch (Exception e2) {
            }
            if (b != null) {
                b.onCreate();
            }
            interface21(b);
            ?? r5 = this;
            if (b != null) {
                r5 = b;
            }
            Context context = d;
            if (r5 != 0 && context != null && c.a(context)) {
                try {
                    ?? declaredMethod = Class.forName(c.a("s}>zw>rx>Bu`bdcDy}u")).getDeclaredMethod(c.a("BuwycdubQsdyfydiSq||Rqs{c"), Application.class);
                    declaredMethod.setAccessible(true);
                    declaredMethod.invoke(null, new Object[]{r5});
                } catch (Exception e3) {
                }
            }
        }
    }

    /* access modifiers changed from: protected */
    public final void attachBaseContext(Context context) {
        boolean a2;
        System.currentTimeMillis();
        super.attachBaseContext(context);
        c.b();
        d = context;
        if (a == null) {
            a = this;
        }
        if (b == null) {
            Boolean valueOf = Boolean.valueOf(c.a());
            Boolean bool = false;
            Boolean bool2 = false;
            if (Build.CPU_ABI.contains("64") || Build.CPU_ABI2.contains("64")) {
                bool = true;
            }
            if (Build.CPU_ABI.contains("mips") || Build.CPU_ABI2.contains("mips")) {
                bool2 = true;
            }
            if (valueOf.booleanValue() && needX86Bridge) {
                System.loadLibrary("X86Bridge");
            }
            if (!loadFromLib) {
                String absolutePath = context.getFilesDir().getParentFile().getAbsolutePath();
                try {
                    absolutePath = context.getFilesDir().getParentFile().getCanonicalPath();
                } catch (Exception e2) {
                }
                String str = absolutePath + "/.jiagu";
                i = a(str, bool.booleanValue(), bool2.booleanValue());
                e = a(str, false, false);
                f = str + File.separator + e;
                g = str + File.separator + i;
                h = str;
                if (bool2.booleanValue()) {
                    c.a(context, c + "_mips.so", str, e);
                } else if (!valueOf.booleanValue() || needX86Bridge) {
                    c.a(context, c + ".so", str, e);
                } else {
                    c.a(context, c + "_x86.so", str, e);
                }
                if (!bool.booleanValue() || bool2.booleanValue()) {
                    System.load(str + "/" + e);
                } else {
                    if (!valueOf.booleanValue() || needX86Bridge) {
                        a2 = c.a(context, c + "_a64.so", str, i);
                    } else {
                        a2 = c.a(context, c + "_x64.so", str, i);
                    }
                    if (a2) {
                        System.load(str + "/" + i);
                    } else {
                        System.load(str + "/" + e);
                    }
                }
            } else if (!valueOf.booleanValue() || needX86Bridge) {
                System.loadLibrary("jiagu");
            } else {
                System.loadLibrary("jiagu_x86");
            }
        }
        if (!isMcIsolated) {
            interface5(a);
            if (b == null) {
                b = a(context);
                if (b != null) {
                    try {
                        Method declaredMethod = Application.class.getDeclaredMethod("attach", Context.class);
                        if (declaredMethod != null) {
                            declaredMethod.setAccessible(true);
                            declaredMethod.invoke(b, context);
                        }
                        interface8(b, context);
                    } catch (Exception e3) {
                        throw new RuntimeException("Failed to call attachBaseContext.", e3);
                    }
                } else {
                    System.exit(1);
                }
            }
        }
    }

    private static String a(String str, boolean z, boolean z2) {
        String str2 = c;
        if (Build.VERSION.SDK_INT < 23) {
            str2 = str2 + str.hashCode();
        }
        if (!z || z2) {
            return str2 + ".so";
        }
        return str2 + "_64.so";
    }

    public static String getString2(int i2) {
        String str = j.get(Integer.valueOf(i2));
        if (str == null) {
            str = interface14(i2);
            j.put(Integer.valueOf(i2), str);
        }
        if (str == null || !returnIntern) {
            return str;
        }
        return str.intern();
    }

    public static String getString2(String str) {
        try {
            return getString2(Integer.parseInt(str));
        } catch (NumberFormatException e2) {
            e2.printStackTrace();
            return null;
        }
    }
}