package com.pgyersdk.a; import android.content.Context; import android.os.Handler; import com.pgyersdk.f.c; import com.pgyersdk.utils.d; import java.lang.ref.WeakReference; import java.net.HttpURLConnection; import java.text.SimpleDateFormat; import java.util.HashMap; import java.util.Map; /* compiled from: Api */ public class a { /* renamed from: a reason: collision with root package name */ private static WeakReference<Context> f2712a; private static int b; private static SimpleDateFormat c = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss "); public static void a(final Context context) { f2712a = new WeakReference<>(context); com.pgyersdk.utils.a.a(new c<Void, Void, HashMap<String, String>>() { /* class com.pgyersdk.a.a.AnonymousClass1 */ /* renamed from: a reason: collision with root package name */ HttpURLConnection f2713a = null; HashMap<String, String> b = new HashMap<>(); /* access modifiers changed from: protected */ /* JADX WARNING: Code restructure failed: missing block: B:16:0x01e1, code lost: if (r6.f2713a != null) goto L_0x01ee; */ /* JADX WARNING: Code restructure failed: missing block: B:22:0x01ec, code lost: if (r6.f2713a == null) goto L_0x01f3; */ /* JADX WARNING: Code restructure failed: missing block: B:23:0x01ee, code lost: r6.f2713a.disconnect(); */ /* JADX WARNING: Code restructure failed: missing block: B:25:0x01f5, code lost: return r6.b; */ /* renamed from: a */ public HashMap<String, String> doInBackground(Void... voidArr) { try { HashMap hashMap = new HashMap(); hashMap.put("agKey", com.pgyersdk.c.a.l); hashMap.put("deviceId", com.pgyersdk.c.a.i); hashMap.put("osType", "2"); hashMap.put("deviceName", com.pgyersdk.c.a.g); hashMap.put("osVersion", com.pgyersdk.c.a.e); hashMap.put("sdkVersion", com.pgyersdk.c.a.k); hashMap.put("_api_key", "305092bc73c180b55c26012a94809131"); hashMap.put("versionCode", com.pgyersdk.c.a.b); hashMap.put("version", com.pgyersdk.c.a.d); hashMap.put("deviceModel", com.pgyersdk.c.a.f); hashMap.put("resolution", com.pgyersdk.c.a.j); hashMap.put("jailBroken", com.pgyersdk.c.a.a() ? "1" : "2"); String[] a2 = com.pgyersdk.d.a.a(); hashMap.put("freeSapce", a2[1] + "/" + a2[0]); if (com.pgyersdk.d.a.c()) { String[] b2 = com.pgyersdk.d.a.b(); hashMap.put("freeSdc", b2[1] + "/" + b2[0]); } String[] b3 = com.pgyersdk.d.a.b(context); String str = ""; if (b3.length == 2) { str = b3[1] + "/" + b3[0]; } hashMap.put("freeRam", str); hashMap.put("battery", com.pgyersdk.d.a.g(context)); hashMap.put("protrait", context.getResources().getConfiguration().orientation + ""); String str2 = ""; Map<String, String> a3 = com.pgyersdk.d.a.a(context); if (a3.containsKey("network_type")) { str2 = a3.get("network_type"); } hashMap.put("network", str2); hashMap.put("_appName", (String) ((Context) a.f2712a.get()).getPackageManager().getApplicationLabel(((Context) a.f2712a.get()).getApplicationInfo())); hashMap.put("_packageName", ((Context) a.f2712a.get()).getPackageName()); hashMap.put("_language", ((Context) a.f2712a.get()).getResources().getConfiguration().locale.getLanguage() + "-" + ((Context) a.f2712a.get()).getResources().getConfiguration().locale.getCountry()); this.f2713a = new d("https://www.pgyer.com/apiv1/sdkstat/launch").a("POST").a(hashMap, context, null, null).a(); this.f2713a.connect(); this.b.put("status", String.valueOf(this.f2713a.getResponseCode())); this.b.put("response", a(this.f2713a)); } catch (Exception e) { e.printStackTrace(); } catch (Throwable th) { if (this.f2713a != null) { this.f2713a.disconnect(); } throw th; } } /* access modifiers changed from: protected */ /* renamed from: a */ public void onPostExecute(HashMap<String, String> hashMap) { super.onPostExecute(hashMap); com.pgyersdk.d.a.f(context); } }); } public static void b(final Context context) { f2712a = new WeakReference<>(context); if (com.pgyersdk.d.a.b == null) { new com.pgyersdk.d.a().e(context); } new Handler().postDelayed(new Runnable() { /* class com.pgyersdk.a.a.AnonymousClass2 */ public void run() { a.a(context); } }, 5000); } }