翰林优商.apk(点击下载) / Engine.java


package com.baidu.liantian.x0.jni;

import android.content.Context;
import android.text.TextUtils;
import com.baidu.liantian.x0.EngineImpl;
import com.baidu.liantian.x0.a.b;
import com.baidu.liantian.x0.a.e;
import com.baidu.liantian.x0.a.g;
import com.baidu.liantian.x0.f.a;
import com.baidu.liantian.x6.jni.EmulatorAcquisition;
import java.io.File;

public class Engine {
    public static final int JNI_CMD_BASEPROP = 1114139;
    public static final int JNI_CMD_COLLECTCMDLINE = 1114129;
    public static final int JNI_CMD_CPUINFOHASH = 1114140;
    public static final int JNI_CMD_DEBUG = 1114114;
    public static final int JNI_CMD_DECRYPT = 1114136;
    public static final int JNI_CMD_GETARP = 1114138;
    public static final int JNI_CMD_HYBIRD = 1114135;
    public static final int JNI_CMD_INIT_STAT = 1114141;
    public static final int JNI_CMD_INJECT = 1114115;
    public static final int JNI_CMD_INJECT_BY_MAPS = 1114116;
    public static final int JNI_CMD_JANUS = 1114117;
    public static final int JNI_CMD_NATIVE_INIT = 1114112;
    public static final int JNI_CMD_NET = 1114120;
    public static final int JNI_CMD_POST = 1114118;
    public static final int JNI_CMD_ROOT = 1114131;
    public static final int JNI_CMD_STAT_STAT = 1114142;
    public static final int JNI_CMD_TDID_AES_KEY = 1114133;
    public static final int JNI_CMD_TRACEROUTE = 1114137;
    public static final int JNI_CMD_USER_POLICY = 1114134;
    public static final int JNI_CMD_XPOSED = 1114130;
    private static final String TAG = "Engine";
    protected static boolean loadSoFailed = true;
    private LoadEngineHelper loadLibHelper;
    private Context mContext;
    protected a pref;
    protected com.baidu.liantian.x6.jni.a preferences;

    protected static native byte[] ac(byte[] bArr, byte[] bArr2);

    protected static native byte[] ar(byte[] bArr, byte[] bArr2);

    protected static native byte[] dc(byte[] bArr, byte[] bArr2);

    protected static native byte[] dr(byte[] bArr, byte[] bArr2);

    /* access modifiers changed from: protected */
    public native Object jnictl(int i, Object obj, Object obj2, Object obj3);

    protected Engine(Context context) {
        try {
            this.mContext = context.getApplicationContext();
            this.preferences = com.baidu.liantian.x6.jni.a.a(context);
            this.pref = new a(context);
        } catch (Throwable th) {
            e.a(th);
        }
    }

    /* access modifiers changed from: protected */
    public synchronized void loadLib(int i) {
        try {
            if (!EngineImpl.isUnload) {
                this.loadLibHelper = new LoadEngineHelper();
                if (!limitLoadSo()) {
                    String libName = getLibName(i);
                    try {
                        this.loadLibHelper.setLoadSoEndTime(this.mContext, 0);
                        if (i == 0) {
                            System.loadLibrary(libName);
                        } else if (i == 1) {
                            System.load(libName);
                        }
                        this.loadLibHelper.setLoadSoEndTime(this.mContext, 1);
                        loadSoFailed = false;
                    } catch (Throwable th) {
                        this.loadLibHelper.setLoadSoEndTime(this.mContext, 1);
                        e.a(th);
                        loadSoFailed = true;
                    }
                    EmulatorAcquisition.a = loadSoFailed;
                    return;
                }
                return;
            }
            return;
        } catch (Throwable th2) {
            e.a(th2);
        }
    }

    private boolean limitLoadSo() {
        LoadEngineHelper loadEngineHelper;
        try {
            if (!this.preferences.c() || (loadEngineHelper = this.loadLibHelper) == null || !loadEngineHelper.isFailedOverTime(this.mContext)) {
                return false;
            }
            return true;
        } catch (Throwable th) {
            e.a(th);
            return false;
        }
    }

    private String getLibName(int i) {
        String str = "";
        try {
            String replace = EngineImpl.sLoadVersion.replace(".", str);
            b.a("versionName : " + replace);
            if (i == 0) {
                str = "liantiansec";
            } else if (i == 1) {
                String c = this.pref.c();
                b.a("sv" + c);
                if (true ^ TextUtils.isEmpty(c)) {
                    String a = g.a(this.mContext);
                    str = new File(a, "libliantiansec" + c + ".so").getAbsolutePath();
                }
            }
            b.a("sotype:" + i + " libname:" + str);
        } catch (Throwable th) {
            e.a(th);
        }
        return str;
    }

    private void reportErr(Throwable th, int i, String str, int i2) {
        try {
            b.a("versionName :  err " + i);
        } catch (Throwable th2) {
            e.a(th2);
        }
    }
}