package cn.jiguang.ac; import android.content.Context; import android.os.Build; import java.lang.reflect.Method; import org.json.JSONObject; public class a { /* JADX WARNING: Can't wrap try/catch for region: R(6:3|(1:5)(1:6)|(3:10|11|12)|13|14|15) */ /* JADX WARNING: Code restructure failed: missing block: B:16:0x0029, code lost: r5 = move-exception; */ /* JADX WARNING: Code restructure failed: missing block: B:17:0x002a, code lost: cn.jiguang.af.a.d("IdProvider", java.lang.String.format("loadClass fail hasContext= %s, errMsg = %s", java.lang.Boolean.valueOf(r2), r5.getLocalizedMessage())); */ /* JADX WARNING: Code restructure failed: missing block: B:18:0x004b, code lost: throw new java.lang.ClassNotFoundException("loadClass fail ", r5); */ /* JADX WARNING: Failed to process nested try/catch */ /* JADX WARNING: Missing exception handler attribute for start block: B:13:0x0024 */ private static Class<?> a(Context context, String str) { if (str == null || str.trim().length() == 0) { throw new ClassNotFoundException("class is empty"); } boolean z = context != null; if (z && Build.VERSION.SDK_INT >= 29) { return context.getClassLoader().loadClass(str); } return Class.forName(str); } public static String a(Context context) { try { Class<?> a = a(context, "com.android.id.impl.IdProviderImpl"); Object newInstance = a.newInstance(); a.getMethod("getUDID", Context.class); Method method = a.getMethod("getOAID", Context.class); Method method2 = a.getMethod("getVAID", Context.class); Object invoke = a.getMethod("getAAID", Context.class).invoke(newInstance, context); Object invoke2 = method2.invoke(newInstance, context); Object invoke3 = method.invoke(newInstance, context); JSONObject jSONObject = new JSONObject(); jSONObject.put("oaid", invoke3); jSONObject.put("vaid", invoke2); jSONObject.put("aaid", invoke); return jSONObject.toString(); } catch (Throwable th) { cn.jiguang.af.a.e("IdProvider", "getIds failed:" + th.getMessage()); return ""; } } }