package com.linksure.browser.update; import android.os.AsyncTask; import android.os.Handler; import android.os.Looper; import com.appara.feed.constant.TTParam; import com.bluefay.b.a; import com.lantern.core.WkLocalConfig; import com.lantern.core.WkSSLHttp; import com.linksure.browser.BrowserApp; import java.util.HashMap; import org.json.JSONException; import org.json.JSONObject; /* compiled from: UpgradeTask */ public final class e extends AsyncTask<String, Integer, Integer> { /* renamed from: a reason: collision with root package name */ private a f7363a; /* renamed from: b reason: collision with root package name */ private String f7364b; private com.linksure.browser.update.bean.a c; /* Return type fixed from 'java.lang.Object' to match base method */ /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object[]] */ /* access modifiers changed from: protected */ @Override // android.os.AsyncTask public final /* synthetic */ Integer doInBackground(String[] strArr) { return b(); } /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */ /* access modifiers changed from: protected */ @Override // android.os.AsyncTask public final /* synthetic */ void onPostExecute(Integer num) { Integer num2 = num; a aVar = this.f7363a; if (aVar != null) { aVar.run(num2.intValue(), this.f7364b, this.c); } } /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object[]] */ /* access modifiers changed from: protected */ @Override // android.os.AsyncTask public final /* synthetic */ void onProgressUpdate(Integer[] numArr) { a aVar; Integer[] numArr2 = numArr; super.onProgressUpdate(numArr2); this.c = null; if (numArr2 != null && numArr2.length == 1 && numArr2[0].intValue() == -1 && (aVar = this.f7363a) != null) { aVar.run(0, "13", this.c); this.f7363a = null; } } public e(a aVar) { this.f7363a = aVar; } /* JADX WARN: Type inference failed for: r0v14, types: [boolean, int] */ /* JADX WARNING: Unknown variable types count: 1 */ private Integer b() { String str; HashMap<String, String> hashMap; char c2; com.bluefay.b.e.a("doInBackground"); if (!com.bluefay.a.a.c(com.bluefay.c.a.a())) { return 10; } new Thread() { /* class com.linksure.browser.update.e.AnonymousClass1 */ public final void run() { Looper.prepare(); final Handler handler = new Handler(); handler.postDelayed(new Runnable() { /* class com.linksure.browser.update.e.AnonymousClass1.AnonymousClass1 */ public final void run() { if (!(e.this == null || e.this.getStatus() == AsyncTask.Status.FINISHED)) { com.bluefay.b.e.a("Cancel task"); e.this.publishProgress(new Integer[]{-1}); e.this.cancel(true); } handler.removeCallbacks(this); Looper.myLooper().quit(); } }, 10000); Looper.loop(); } }.start(); String appHost = WkLocalConfig.getAppHost(); if (appHost != null) { str = String.format("%s%s", appHost, "/app/fa.sec"); } else { str = String.format("%s%s", "https://app.51y5.net", "/app/fa.sec"); } com.bluefay.c.a.a(); if (BrowserApp.j() != null) { HashMap<String, String> publicParams = BrowserApp.j().getPublicParams(); publicParams.put("imei1", BrowserApp.j().getmIMEI1()); publicParams.put("imei2", BrowserApp.j().getmIMEI2()); publicParams.put("meid", BrowserApp.j().getmMEID()); publicParams.put("pid", "00600104"); hashMap = BrowserApp.j().signParams("00600104", publicParams); } else { hashMap = new HashMap<>(); } if (hashMap.isEmpty()) { return 1000; } String postMap = WkSSLHttp.postMap(str, hashMap); if (postMap == null || postMap.length() == 0) { return 10; } com.bluefay.b.e.a("JSON:".concat(String.valueOf(postMap)), new Object[0]); try { JSONObject jSONObject = new JSONObject(postMap); ?? equals = "0".equals(jSONObject.getString("retCd")); if (jSONObject.has("retMsg")) { this.f7364b = jSONObject.getString("retMsg"); } com.bluefay.b.e.a("retcode=%s,retmsg=%s", Integer.valueOf((int) equals), this.f7364b); c2 = equals; if (equals == 1) { c2 = equals; if (jSONObject.has("verName")) { this.c = new com.linksure.browser.update.bean.a(); this.c.f7358a = jSONObject.optString("verName"); this.c.f7359b = jSONObject.optString(TTParam.KEY_desc); this.c.c = jSONObject.optString(TTParam.KEY_md5); this.c.d = jSONObject.optString("url"); this.c.g = jSONObject.optInt("ver"); this.c.f = jSONObject.optString("dlType"); this.c.e = jSONObject.optString("stat"); this.c.h = jSONObject.optString("pkgname"); this.c.i = jSONObject.optString("sha1"); c2 = equals; } } } catch (JSONException e) { com.bluefay.b.e.a(e); c2 = 30; } return Integer.valueOf(c2 == 1 ? 1 : 0); } public final void a() { cancel(true); this.f7363a = null; } }