package l1; import android.content.ContentValues; import android.content.res.Resources; import android.util.Log; import busidol.mobile.tower.MainActivity; import com.android.billingclient.api.Purchase; import com.google.android.gms.ads.RequestConfiguration; import com.unity3d.services.core.request.metrics.AdOperationMetric; import i1.e; import i1.g; import i1.k; import i1.n; import i1.p; import j1.d; import java.util.ArrayList; import java.util.HashMap; import org.json.JSONArray; import org.json.JSONException; /* loaded from: classes.dex */ public class a { /* renamed from: b, reason: collision with root package name */ public MainActivity f11585b; /* renamed from: c, reason: collision with root package name */ public k f11586c; /* renamed from: d, reason: collision with root package name */ public g f11587d; /* renamed from: e, reason: collision with root package name */ public Resources f11588e; /* renamed from: f, reason: collision with root package name */ public e f11589f; /* renamed from: a, reason: collision with root package name */ public String f11584a = "define/"; /* renamed from: g, reason: collision with root package name */ public String f11590g = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED; /* renamed from: l1.a$a, reason: collision with other inner class name */ class C0177a extends p { C0177a() { } @Override // i1.p, java.lang.Runnable public void run() { super.run(); i1.a aVar = (i1.a) a("act"); if (aVar != null) { aVar.d(); } } } public a(k kVar) { this.f11586c = kVar; } public boolean a(Purchase purchase) { ContentValues contentValues = new ContentValues(); contentValues.put("mail", this.f11586c.f10750l.d()); contentValues.put("orderId", purchase.a()); contentValues.put("versionCode", e.f10644x); try { String f10 = f(e.F + "sub/check_duplication_sub.php", contentValues); if (f10 == null || f10.isEmpty()) { return false; } return f10.equals("yes"); } catch (g1.a e10) { e10.printStackTrace(); return false; } } public String b(String str) { return n.a(str); } public HashMap c(String str) { HashMap hashMap = new HashMap(); e.M = new ArrayList(); ContentValues contentValues = new ContentValues(); contentValues.put("id", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); try { JSONArray jSONArray = new JSONArray(f(e.F + str, contentValues)); for (int i10 = 0; i10 < jSONArray.length(); i10++) { d dVar = new d(jSONArray.getJSONObject(i10)); if (dVar.f11017c) { e.M.add(dVar); Log.d("shopSubDesign", dVar.f11015a); } else { hashMap.put(dVar.f11015a, dVar); } } Log.d("shopSubDesign", e.M.size() + RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED); } catch (g1.a e10) { e10.printStackTrace(); } catch (JSONException e11) { e11.printStackTrace(); } return hashMap; } public void d() { MainActivity mainActivity = this.f11586c.f10741c; this.f11585b = mainActivity; this.f11588e = mainActivity.getResources(); k kVar = this.f11586c; this.f11587d = kVar.f10743e; this.f11589f = kVar.f10740b; } public void e(String str) { String str2 = this.f11586c.f10750l.f11175m; ContentValues contentValues = new ContentValues(); contentValues.put("UNIQ_ID", b(str2)); contentValues.put("MESSAGE", "Detected abnormal access! so, You are blocked"); contentValues.put("ETC", str); contentValues.put("encGol", "#gol"); try { f(e.F + "put_blacklist.php", contentValues); } catch (g1.a e10) { e10.printStackTrace(); } this.f11586c.f10741c.finish(); } /* JADX WARN: Multi-variable type inference failed */ /* JADX WARN: Removed duplicated region for block: B:33:0x00e8 */ /* JADX WARN: Type inference failed for: r10v0, types: [java.lang.String] */ /* JADX WARN: Type inference failed for: r10v2 */ /* JADX WARN: Type inference failed for: r10v6, types: [java.net.HttpURLConnection] */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ public java.lang.String f(java.lang.String r10, android.content.ContentValues r11) { /* Method dump skipped, instructions count: 236 To view this dump change 'Code comments level' option to 'DEBUG' */ throw new UnsupportedOperationException("Method not decompiled: l1.a.f(java.lang.String, android.content.ContentValues):java.lang.String"); } public String g(String str) { String str2 = "TOWER_M_" + e.f10643w; ContentValues contentValues = new ContentValues(); contentValues.put("APPS_NAME", str2); contentValues.put("mail", str); contentValues.put("encGol", "#gol"); contentValues.put("versionCode", e.f10644x); return f(e.F + "CHECK_APP_VALIDATE.php", contentValues); } public void h(i1.a aVar) { C0177a c0177a = new C0177a(); c0177a.b("act", aVar); new Thread(c0177a).start(); } public void i(String str) { String str2 = this.f11586c.f10750l.f11175m; ContentValues contentValues = new ContentValues(); if (str2 != null) { contentValues.put("id", b(str2)); contentValues.put("encGol", "#gol"); } contentValues.put("etc", str); try { f(e.F + "put_log.php", contentValues); } catch (g1.a e10) { e10.printStackTrace(); } } public void j(Purchase purchase, String str) { String g10 = purchase.g(); String a10 = purchase.a(); if (g10.length() <= e.V || !a10.contains("GPA.")) { i("0" + purchase.c() + ":" + g10); return; } ContentValues contentValues = new ContentValues(); String str2 = this.f11586c.f10750l.f11175m; if (str2 != null) { contentValues.put("id", b(str2)); contentValues.put("encGol", "#gol"); } contentValues.put("id", this.f11586c.f10750l.f11175m); contentValues.put("orderId", a10); contentValues.put("token", g10); contentValues.put("subId", (String) purchase.d().get(0)); contentValues.put("purchaseTime", Long.valueOf(purchase.f())); contentValues.put(AdOperationMetric.INIT_STATE, Integer.valueOf(purchase.e())); contentValues.put("result", this.f11586c.f10742d.f10634d ? "yes" : "no"); contentValues.put("etc", str); contentValues.put("versionName", e.f10643w); contentValues.put("versionCode", e.f10644x); f(e.F + "sub/put_sub_success.php", contentValues); } public void k(String str) { ContentValues contentValues = new ContentValues(); String str2 = this.f11586c.f10750l.f11175m; if (str2 != null) { contentValues.put("id", b(str2)); contentValues.put("encGol", "#gol"); } contentValues.put("orderId", "--"); contentValues.put("token", "--"); contentValues.put("subId", "--"); contentValues.put("purchaseTime", "--"); contentValues.put(AdOperationMetric.INIT_STATE, "--"); contentValues.put("result", this.f11586c.f10742d.f10634d ? "yes" : "no"); contentValues.put("etc", str); contentValues.put("versionName", e.f10643w); contentValues.put("versionCode", e.f10644x); f(e.F + "sub/put_sub_success.php", contentValues); } }