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.x6.jni.a; import com.kuaishou.weapon.p0.p0; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.HashMap; public class Native { public static final int DEF_NET_TYPE = -1; private static final String TAG = "Native"; public static int getBCS(Context context) { return 0; } public static int getBPE(Context context) { return 0; } public static String getDIDT(Context context) { return ""; } public static String getDIUC(Context context) { return ""; } public static String getDiz(Context context) { return ""; } public static String getHPM(Context context) { return ""; } public static int getHp() { return -1; } public static String getHt() { return ""; } public static int getHybird(Context context, byte[] bArr) { return -1; } public static String getNIF() { return ""; } public static int getNetWorkType(Context context) { return -1; } public static String getPAL(Context context) { return ""; } public static byte[] getPK(Context context) { return new byte[0]; } public static byte[] getPS(Context context) { return new byte[0]; } public static String getSP(Context context) { return "0x0"; } public static int getSST(Context context) { return 0; } public static String getSystemLanguage() { return ""; } public static String getUSAE(Context context) { return ""; } public static int getUSBDebug(Context context) { return 0; } public static String getWBS(Context context) { return null; } public static String getWN(Context context) { return null; } public static String getRS(Context context) { return new StringBuffer().toString(); } public static String getAccessibility(Context context) { return new StringBuffer().toString(); } public static String getAL(Context context) { return new StringBuffer().toString(); } public static String getAppKey(Context context) { return EngineImpl.sAppkey; } public static String getSS(Context context) { return new StringBuffer().toString(); } public static void namCall(int i) { try { if (EngineImpl.mContext != null) { a.a(EngineImpl.mContext).a(String.valueOf(i), 0, Integer.parseInt(a.a(EngineImpl.mContext).a(String.valueOf(i))[1])); } } catch (Throwable th) { e.a(th); } } public static int sof(Context context) { return com.baidu.liantian.g.a.a.a(context) ? 1 : 0; } public static String nativePrefControl(String str, int i, String str2) { b.a("native preferences, prefName: " + str + ", behavior: " + i + ", data: " + str2); if (EngineImpl.mContext == null) { return null; } return "200"; } public static String nativeGetSystemSettings(int i, String str) { b.a("native get setting, settingsType: " + i + ", key: " + str); return null; } public static String nativeShellControl(String str, int i) { b.a("native shell, cmd: " + str + ", max: " + i); return new StringBuilder().toString(); } public static int getAPH(String str, String str2, String str3) { Method method; b.a("getAPH===" + str + ";" + str2 + ";" + str3); try { Class<?> cls = Class.forName(str); if (cls != null) { if (!TextUtils.isEmpty(str3)) { String[] split = str3.split("#"); if (split == null || split.length <= 0) { method = cls.getDeclaredMethod(str2, new Class[0]); } else { Class<?>[] clsArr = new Class[split.length]; for (int i = 0; i < split.length; i++) { clsArr[i] = Class.forName(split[i]); } method = cls.getDeclaredMethod(str2, clsArr); } } else { method = cls.getDeclaredMethod(str2, new Class[0]); } if (method != null && Modifier.isNative(method.getModifiers())) { return 1; } } } catch (Throwable th) { e.a(th); } try { Field declaredField = Class.forName(p0.a, true, ClassLoader.getSystemClassLoader()).getDeclaredField("methodCache"); declaredField.setAccessible(true); StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append(str); stringBuffer.append("#"); stringBuffer.append(str2); for (String str4 : ((HashMap) declaredField.get(null)).keySet()) { if (str4.contains(stringBuffer.toString())) { return 1; } } } catch (Throwable th2) { e.a(th2); b.a("getAPH exe===" + th2); } return 0; } }