package cn.jiguang.al; import android.content.Context; import android.os.Bundle; import cn.jiguang.am.c; import cn.jiguang.an.b; import cn.jiguang.ao.e; import cn.jiguang.ao.f; import cn.jiguang.ao.j; import com.baidu.speech.asr.SpeechConstant; import java.io.File; import java.lang.reflect.Field; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; public class a { private static Map<Integer, Bundle> a = new ConcurrentHashMap(); static { a(); } public static File a(Context context, int i) { try { return a(context, b(context, i), true); } catch (Throwable th) { b.e("PH", "getIIf error:" + th.getMessage()); return null; } } public static File a(Context context, c cVar, boolean z) { if (cVar == null) { return null; } try { File a2 = b.a(context, cVar.s, cVar.m, cVar.o); b.b("PH", "pF:" + a2); if (b.a(a2, cVar, z)) { return a2; } return null; } catch (Throwable th) { b.b("PH", "gIF error:" + th.getMessage()); } } public static String a(int i, int i2) { String str; switch (i2) { case 0: str = "ic"; break; case 1: str = "if"; break; case 2: str = "iff"; break; case 3: str = "dc"; break; case 4: str = "code"; break; default: b.e("PH", "unkown type:" + i2); return ""; } return a.containsKey(Integer.valueOf(i)) ? a.get(Integer.valueOf(i)).getString(str) : ""; } private static void a() { try { b.b("PH", "[loadPinfo]"); a.putAll(f.a()); Bundle bundle = new Bundle(); bundle.putInt(SpeechConstant.PID, 1); bundle.putString("code", f.b() + ""); bundle.putString("ic", j.a("Y24ucC5qaWd1YW5nLkpDb3JlSGVscGVy")); Class<?> cls = Class.forName(j.a("Y24uamlndWFuZy5pbnRlcm5hbC5KQ29yZUludGVybmFsSGVscGVy")); bundle.putString("if", cls.getCanonicalName()); Field[] declaredFields = cls.getDeclaredFields(); int length = declaredFields.length; int i = 0; while (true) { if (i >= length) { break; } Field field = declaredFields[i]; Class<?> type = field.getType(); if (type.getCanonicalName().equals(j.a("Y24uamlndWFuZy5pbnRlcm5hbC5KQ29yZUhlbHBlckFjdGlvbg"))) { b.b("PH", "find filed name:" + field.getName()); bundle.putString("iff", field.getName()); break; } i++; } bundle.putString("dc", j.a("Y24ucC5qaWd1YW5nLkpDb3JlQ2xhc3NMb2FkZXI")); a.put(1, bundle); b.b("PH", "[loadPinfo] end:" + a); } catch (Throwable unused) { } } public static void a(Context context, int i, String str, boolean z) { e.a(context, i, "use", str, z); } public static void a(Context context, c cVar) { try { b.b("PH", "clearPlugin..."); e.a(context, cVar.m, "use", "", false); File a2 = b.a(context, cVar.s, cVar.m, cVar.o); if (a2.exists()) { a2.delete(); } } catch (Throwable unused) { } } public static c b(Context context, int i) { return c.a(e.a(context, i, "use")); } }