APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:JadiBUMN
版本号:2.1.3
包名称:id.jadibumn.app

MD5 校验值:328357c6f846d37b47ed4cc8f5415f3d

反编译源代码说明

o.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package d.e.a;

import android.app.Activity;
import android.app.Application;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import com.android.billingclient.api.Purchase;
import com.android.billingclient.api.PurchaseHistoryRecord;
import com.android.billingclient.api.SkuDetails;
import com.android.billingclient.api.b;
import com.android.billingclient.api.g;
import com.android.billingclient.api.i;
import com.android.billingclient.api.v;
import com.android.billingclient.api.w;
import h.a.d.a.k;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public final class o implements k.c, Application.ActivityLifecycleCallbacks {
    public static final a p = new a(null);
    private static ArrayList<SkuDetails> q = new ArrayList<>();
    private s r;
    private com.android.billingclient.api.d s;
    private Context t;
    private Activity u;
    private h.a.d.a.k v;
    private final com.android.billingclient.api.s w = new com.android.billingclient.api.s() {
        @Override
        public final void a(com.android.billingclient.api.h hVar, List list) {
            o.D(o.this, hVar, list);
        }
    };

    public static final class a {
        private a() {
        }

        public a(j.y.c.g gVar) {
            this();
        }
    }

    public static final class b implements com.android.billingclient.api.f {
        private boolean a;

        final s f3342b;

        final h.a.d.a.j f3343c;

        b(s sVar, h.a.d.a.j jVar) {
            this.f3342b = sVar;
            this.f3343c = jVar;
        }

        @Override
        public void a(com.android.billingclient.api.h hVar) {
            j.y.c.k.e(hVar, "billingResult");
            try {
                int b2 = hVar.b();
                if (b2 == 0) {
                    JSONObject jSONObject = new JSONObject();
                    jSONObject.put("connected", true);
                    this.f3342b.b("connection-updated", jSONObject.toString());
                    if (this.a) {
                        return;
                    }
                    this.a = true;
                    this.f3342b.success("Billing client ready");
                    return;
                }
                JSONObject jSONObject2 = new JSONObject();
                jSONObject2.put("connected", false);
                this.f3342b.b("connection-updated", jSONObject2.toString());
                if (this.a) {
                    return;
                }
                this.a = true;
                s sVar = this.f3342b;
                String str = this.f3343c.a;
                j.y.c.k.d(str, "call.method");
                sVar.error(str, j.y.c.k.j("responseCode: ", Integer.valueOf(b2)), "");
            } catch (JSONException e2) {
                e2.printStackTrace();
            }
        }

        @Override
        public void b() {
            try {
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("connected", false);
                this.f3342b.b("connection-updated", jSONObject.toString());
            } catch (JSONException e2) {
                e2.printStackTrace();
            }
        }
    }

    private final boolean B() {
        Uri parse = Uri.parse("https://play.google.com/store/account/subscriptions");
        j.y.c.k.d(parse, "parse(PLAY_STORE_URL)");
        return C(parse);
    }

    private final boolean C(Uri uri) {
        try {
            try {
                Activity activity = this.u;
                j.y.c.k.b(activity);
                Intent intent = new Intent("android.intent.action.VIEW");
                intent.setData(uri);
                activity.startActivity(intent);
                return true;
            } catch (ActivityNotFoundException unused) {
                Activity activity2 = this.u;
                j.y.c.k.b(activity2);
                activity2.startActivity(new Intent("android.intent.action.VIEW").setDataAndType(uri, "text/html").addCategory("android.intent.category.BROWSABLE"));
                return true;
            }
        } catch (ActivityNotFoundException unused2) {
            return false;
        }
    }

    public static final void D(o oVar, com.android.billingclient.api.h hVar, List list) {
        j.y.c.k.e(oVar, "this$0");
        j.y.c.k.e(hVar, "billingResult");
        try {
            if (hVar.b() != 0) {
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("responseCode", hVar.b());
                jSONObject.put("debugMessage", hVar.a());
                q a2 = p.a.a(hVar.b());
                jSONObject.put("code", a2.a());
                jSONObject.put("message", a2.b());
                s sVar = oVar.r;
                j.y.c.k.b(sVar);
                sVar.b("purchase-error", jSONObject.toString());
                return;
            }
            if (list == null) {
                JSONObject jSONObject2 = new JSONObject();
                jSONObject2.put("responseCode", hVar.b());
                jSONObject2.put("debugMessage", hVar.a());
                jSONObject2.put("code", p.a.a(hVar.b()).a());
                jSONObject2.put("message", "purchases returns null.");
                s sVar2 = oVar.r;
                j.y.c.k.b(sVar2);
                sVar2.b("purchase-error", jSONObject2.toString());
                return;
            }
            Iterator it = list.iterator();
            if (it.hasNext()) {
                Purchase purchase = (Purchase) it.next();
                JSONObject jSONObject3 = new JSONObject();
                jSONObject3.put("productId", purchase.k().get(0));
                jSONObject3.put("transactionId", purchase.c());
                jSONObject3.put("transactionDate", purchase.g());
                jSONObject3.put("transactionReceipt", purchase.d());
                jSONObject3.put("purchaseToken", purchase.h());
                jSONObject3.put("dataAndroid", purchase.d());
                jSONObject3.put("signatureAndroid", purchase.j());
                jSONObject3.put("purchaseStateAndroid", purchase.f());
                jSONObject3.put("autoRenewingAndroid", purchase.m());
                jSONObject3.put("isAcknowledgedAndroid", purchase.l());
                jSONObject3.put("packageNameAndroid", purchase.e());
                jSONObject3.put("developerPayloadAndroid", purchase.b());
                com.android.billingclient.api.a a3 = purchase.a();
                if (a3 != null) {
                    jSONObject3.put("obfuscatedAccountIdAndroid", a3.a());
                    jSONObject3.put("obfuscatedProfileIdAndroid", a3.b());
                }
                s sVar3 = oVar.r;
                j.y.c.k.b(sVar3);
                sVar3.b("purchase-updated", jSONObject3.toString());
            }
        } catch (JSONException e2) {
            s sVar4 = oVar.r;
            j.y.c.k.b(sVar4);
            sVar4.b("purchase-error", e2.getMessage());
        }
    }

    private final void H(final s sVar) {
        com.android.billingclient.api.k b2 = com.android.billingclient.api.k.b().a(2).b();
        j.y.c.k.d(b2, "newBuilder()\n           …NAL)\n            .build()");
        com.android.billingclient.api.d dVar = this.s;
        j.y.c.k.b(dVar);
        Activity activity = this.u;
        j.y.c.k.b(activity);
        dVar.o(activity, b2, new com.android.billingclient.api.l() {
            @Override
            public final void a(com.android.billingclient.api.m mVar) {
                o.I(s.this, mVar);
            }
        });
        sVar.success("show in app messages ready");
    }

    public static final void I(s sVar, com.android.billingclient.api.m mVar) {
        j.y.c.k.e(sVar, "$safeChannel");
        j.y.c.k.e(mVar, "inAppMessageResult");
        sVar.b("on-in-app-message", Integer.valueOf(mVar.a()));
    }

    private final void a(final h.a.d.a.j jVar, final s sVar) {
        String str = (String) jVar.a("token");
        b.a b2 = com.android.billingclient.api.b.b();
        j.y.c.k.b(str);
        com.android.billingclient.api.b a2 = b2.b(str).a();
        j.y.c.k.d(a2, "newBuilder()\n           …n!!)\n            .build()");
        com.android.billingclient.api.d dVar = this.s;
        j.y.c.k.b(dVar);
        dVar.a(a2, new com.android.billingclient.api.c() {
            @Override
            public final void a(com.android.billingclient.api.h hVar) {
                o.b(s.this, jVar, hVar);
            }
        });
    }

    public static final void b(s sVar, h.a.d.a.j jVar, com.android.billingclient.api.h hVar) {
        j.y.c.k.e(sVar, "$safeChannel");
        j.y.c.k.e(jVar, "$call");
        j.y.c.k.e(hVar, "billingResult");
        if (hVar.b() != 0) {
            q a2 = p.a.a(hVar.b());
            String str = jVar.a;
            j.y.c.k.d(str, "call.method");
            sVar.error(str, a2.a(), a2.b());
            return;
        }
        try {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("responseCode", hVar.b());
            jSONObject.put("debugMessage", hVar.a());
            q a3 = p.a.a(hVar.b());
            jSONObject.put("code", a3.a());
            jSONObject.put("message", a3.b());
            sVar.success(jSONObject.toString());
        } catch (JSONException e2) {
            e2.printStackTrace();
            sVar.error("InappPurchasePlugin", "E_BILLING_RESPONSE_JSON_PARSE_ERROR", e2.getMessage());
        }
    }

    private final void c(h.a.d.a.j jVar, s sVar) {
        String str;
        String str2 = j.y.c.k.a(jVar.a("type"), "subs") ? "subs" : "inapp";
        String str3 = (String) jVar.a("obfuscatedAccountId");
        String str4 = (String) jVar.a("obfuscatedProfileId");
        String str5 = (String) jVar.a("sku");
        Object a2 = jVar.a("prorationMode");
        j.y.c.k.b(a2);
        j.y.c.k.d(a2, "call.argument<Int>(\"prorationMode\")!!");
        int intValue = ((Number) a2).intValue();
        String str6 = (String) jVar.a("purchaseToken");
        g.a a3 = com.android.billingclient.api.g.a();
        j.y.c.k.d(a3, "newBuilder()");
        SkuDetails skuDetails = null;
        Iterator<SkuDetails> it = q.iterator();
        while (true) {
            if (!it.hasNext()) {
                break;
            }
            SkuDetails next = it.next();
            if (j.y.c.k.a(next.n(), str5)) {
                skuDetails = next;
                break;
            }
        }
        if (skuDetails != null) {
            a3.d(skuDetails);
            g.c.a a4 = g.c.a();
            j.y.c.k.d(a4, "newBuilder()");
            if (str6 != null) {
                a4.c(str6);
            }
            if (str3 != null) {
                a3.b(str3);
            }
            if (str4 != null) {
                a3.c(str4);
            }
            if (intValue != -1) {
                if (intValue != 1) {
                    if (intValue == 2) {
                        a4.e(2);
                        str = j.y.c.k.a(str2, "subs") ? "The sku was not found. Please fetch setObfuscatedAccountIdproducts first by calling getItems" : "IMMEDIATE_AND_CHARGE_PRORATED_PRICE for proration mode only works in subscription purchase.";
                    } else if (intValue != 3 && intValue != 4 && intValue != 5) {
                        a4.e(0);
                    }
                }
                a4.e(intValue);
            }
            if (str6 != null) {
                a3.e(a4.a());
            }
            if (this.u != null) {
                com.android.billingclient.api.d dVar = this.s;
                j.y.c.k.b(dVar);
                Activity activity = this.u;
                j.y.c.k.b(activity);
                dVar.g(activity, a3.a());
                return;
            }
            return;
        }
        sVar.error("InappPurchasePlugin", "buyItemByType", str);
    }

    private final void d(final s sVar, final h.a.d.a.j jVar) {
        try {
            final ArrayList arrayList = new ArrayList();
            com.android.billingclient.api.d dVar = this.s;
            j.y.c.k.b(dVar);
            dVar.m("inapp", new com.android.billingclient.api.r() {
                @Override
                public final void a(com.android.billingclient.api.h hVar, List list) {
                    o.e(s.this, jVar, this, arrayList, hVar, list);
                }
            });
        } catch (Error e2) {
            String str = jVar.a;
            j.y.c.k.d(str, "call.method");
            sVar.error(str, e2.getMessage(), "");
        }
    }

    public static final void e(final s sVar, h.a.d.a.j jVar, o oVar, final ArrayList arrayList, com.android.billingclient.api.h hVar, final List list) {
        j.y.c.k.e(sVar, "$safeChannel");
        j.y.c.k.e(jVar, "$call");
        j.y.c.k.e(oVar, "this$0");
        j.y.c.k.e(arrayList, "$array");
        j.y.c.k.e(hVar, "billingResult");
        j.y.c.k.e(list, "skuDetailsList");
        if (hVar.b() != 0) {
            String str = jVar.a;
            j.y.c.k.d(str, "call.method");
            sVar.error(str, "refreshItem", "No results for query");
        } else {
            if (list.size() == 0) {
                String str2 = jVar.a;
                j.y.c.k.d(str2, "call.method");
                sVar.error(str2, "refreshItem", "No purchases found");
                return;
            }
            Iterator it = list.iterator();
            while (it.hasNext()) {
                com.android.billingclient.api.i a2 = com.android.billingclient.api.i.b().b(((Purchase) it.next()).h()).a();
                j.y.c.k.d(a2, "newBuilder()\n           …                 .build()");
                com.android.billingclient.api.j jVar2 = new com.android.billingclient.api.j() {
                    @Override
                    public final void a(com.android.billingclient.api.h hVar2, String str3) {
                        o.f(arrayList, list, sVar, hVar2, str3);
                    }
                };
                com.android.billingclient.api.d dVar = oVar.s;
                j.y.c.k.b(dVar);
                dVar.b(a2, jVar2);
            }
        }
    }

    public static final void f(ArrayList arrayList, List list, s sVar, com.android.billingclient.api.h hVar, String str) {
        j.y.c.k.e(arrayList, "$array");
        j.y.c.k.e(list, "$skuDetailsList");
        j.y.c.k.e(sVar, "$safeChannel");
        j.y.c.k.e(hVar, "$noName_0");
        j.y.c.k.e(str, "outToken");
        arrayList.add(str);
        if (list.size() == arrayList.size()) {
            try {
                sVar.success(arrayList.toString());
            } catch (h.a.d.a.e e2) {
                String message = e2.getMessage();
                j.y.c.k.b(message);
                Log.e("InappPurchasePlugin", message);
            }
        }
    }

    private final void g(final h.a.d.a.j jVar, final s sVar) {
        String str = (String) jVar.a("token");
        i.a b2 = com.android.billingclient.api.i.b();
        j.y.c.k.b(str);
        com.android.billingclient.api.i a2 = b2.b(str).a();
        j.y.c.k.d(a2, "newBuilder()\n           …n!!)\n            .build()");
        com.android.billingclient.api.d dVar = this.s;
        j.y.c.k.b(dVar);
        dVar.b(a2, new com.android.billingclient.api.j() {
            @Override
            public final void a(com.android.billingclient.api.h hVar, String str2) {
                o.h(s.this, jVar, hVar, str2);
            }
        });
    }

    public static final void h(s sVar, h.a.d.a.j jVar, com.android.billingclient.api.h hVar, String str) {
        j.y.c.k.e(sVar, "$safeChannel");
        j.y.c.k.e(jVar, "$call");
        j.y.c.k.e(hVar, "billingResult");
        j.y.c.k.e(str, "$noName_1");
        if (hVar.b() != 0) {
            q a2 = p.a.a(hVar.b());
            String str2 = jVar.a;
            j.y.c.k.d(str2, "call.method");
            sVar.error(str2, a2.a(), a2.b());
            return;
        }
        try {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("responseCode", hVar.b());
            jSONObject.put("debugMessage", hVar.a());
            q a3 = p.a.a(hVar.b());
            jSONObject.put("code", a3.a());
            jSONObject.put("message", a3.b());
            sVar.success(jSONObject.toString());
        } catch (JSONException e2) {
            sVar.error("InappPurchasePlugin", "E_BILLING_RESPONSE_JSON_PARSE_ERROR", e2.getMessage());
        }
    }

    private final void i(s sVar) {
        try {
            com.android.billingclient.api.d dVar = this.s;
            if (dVar != null) {
                dVar.c();
            }
            this.s = null;
            if (sVar == null) {
                return;
            }
            sVar.success("Billing client has ended.");
        } catch (Exception e2) {
            if (sVar == null) {
                return;
            }
            sVar.error("client end connection", e2.getMessage(), "");
        }
    }

    static void j(o oVar, s sVar, int i2, Object obj) {
        if ((i2 & 1) != 0) {
            sVar = null;
        }
        oVar.i(sVar);
    }

    private final void k(final h.a.d.a.j jVar, final s sVar) {
        final String str = j.y.c.k.a(jVar.a("type"), "subs") ? "subs" : "inapp";
        final JSONArray jSONArray = new JSONArray();
        com.android.billingclient.api.d dVar = this.s;
        j.y.c.k.b(dVar);
        dVar.m(str, new com.android.billingclient.api.r() {
            @Override
            public final void a(com.android.billingclient.api.h hVar, List list) {
                o.l(str, jSONArray, sVar, jVar, hVar, list);
            }
        });
    }

    public static final void l(String str, JSONArray jSONArray, s sVar, h.a.d.a.j jVar, com.android.billingclient.api.h hVar, List list) {
        boolean m2;
        String str2;
        j.y.c.k.e(str, "$type");
        j.y.c.k.e(jSONArray, "$items");
        j.y.c.k.e(sVar, "$safeChannel");
        j.y.c.k.e(jVar, "$call");
        j.y.c.k.e(hVar, "billingResult");
        j.y.c.k.e(list, "skuDetailsList");
        if (hVar.b() != 0) {
            String str3 = jVar.a;
            j.y.c.k.d(str3, "call.method");
            sVar.error(str3, hVar.a(), j.y.c.k.j("responseCode:", Integer.valueOf(hVar.b())));
            return;
        }
        Iterator it = list.iterator();
        while (it.hasNext()) {
            Purchase purchase = (Purchase) it.next();
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("productId", purchase.k().get(0));
            jSONObject.put("transactionId", purchase.c());
            jSONObject.put("transactionDate", purchase.g());
            jSONObject.put("transactionReceipt", purchase.d());
            jSONObject.put("purchaseToken", purchase.h());
            jSONObject.put("signatureAndroid", purchase.j());
            jSONObject.put("purchaseStateAndroid", purchase.f());
            if (j.y.c.k.a(str, "inapp")) {
                m2 = purchase.l();
                str2 = "isAcknowledgedAndroid";
            } else if (j.y.c.k.a(str, "subs")) {
                m2 = purchase.m();
                str2 = "autoRenewingAndroid";
            } else {
                jSONArray.put(jSONObject);
            }
            jSONObject.put(str2, m2);
            jSONArray.put(jSONObject);
        }
        sVar.success(jSONArray.toString());
    }

    private final void m(String str, final h.a.d.a.j jVar, final s sVar) {
        Object a2 = jVar.a("skus");
        j.y.c.k.b(a2);
        j.y.c.k.d(a2, "call.argument<ArrayList<String>>(\"skus\")!!");
        ArrayList arrayList = (ArrayList) a2;
        ArrayList arrayList2 = new ArrayList();
        int size = arrayList.size();
        for (int i2 = 0; i2 < size; i2++) {
            arrayList2.add(arrayList.get(i2));
        }
        com.android.billingclient.api.d dVar = this.s;
        j.y.c.k.b(dVar);
        dVar.n(v.c().b(arrayList2).c(str).a(), new w() {
            @Override
            public final void a(com.android.billingclient.api.h hVar, List list) {
                o.n(s.this, jVar, hVar, list);
            }
        });
    }

    public static final void n(s sVar, h.a.d.a.j jVar, com.android.billingclient.api.h hVar, List list) {
        String str;
        String message;
        String localizedMessage;
        j.y.c.k.e(sVar, "$safeChannel");
        j.y.c.k.e(jVar, "$call");
        j.y.c.k.e(hVar, "billingResult");
        if (hVar.b() != 0) {
            q a2 = p.a.a(hVar.b());
            str = jVar.a;
            j.y.c.k.d(str, "call.method");
            message = a2.a();
            localizedMessage = a2.b();
        } else {
            j.y.c.k.b(list);
            Iterator it = list.iterator();
            while (it.hasNext()) {
                SkuDetails skuDetails = (SkuDetails) it.next();
                if (!q.contains(skuDetails)) {
                    q.add(skuDetails);
                }
            }
            try {
                JSONArray jSONArray = new JSONArray();
                Iterator it2 = list.iterator();
                while (it2.hasNext()) {
                    SkuDetails skuDetails2 = (SkuDetails) it2.next();
                    JSONObject jSONObject = new JSONObject();
                    jSONObject.put("productId", skuDetails2.n());
                    jSONObject.put("price", String.valueOf(((float) skuDetails2.l()) / 1000000.0f));
                    jSONObject.put("currency", skuDetails2.m());
                    jSONObject.put("type", skuDetails2.q());
                    jSONObject.put("localizedPrice", skuDetails2.k());
                    jSONObject.put("title", skuDetails2.p());
                    jSONObject.put("description", skuDetails2.a());
                    jSONObject.put("introductoryPrice", skuDetails2.d());
                    jSONObject.put("subscriptionPeriodAndroid", skuDetails2.o());
                    jSONObject.put("freeTrialPeriodAndroid", skuDetails2.b());
                    jSONObject.put("introductoryPriceCyclesAndroid", skuDetails2.f());
                    jSONObject.put("introductoryPricePeriodAndroid", skuDetails2.g());
                    jSONObject.put("iconUrl", skuDetails2.c());
                    jSONObject.put("originalJson", skuDetails2.h());
                    jSONObject.put("originalPrice", ((float) skuDetails2.l()) / 1000000.0f);
                    jSONArray.put(jSONObject);
                }
                sVar.success(jSONArray.toString());
                return;
            } catch (h.a.d.a.e e2) {
                str = jVar.a;
                j.y.c.k.d(str, "call.method");
                message = e2.getMessage();
                localizedMessage = e2.getLocalizedMessage();
            } catch (JSONException e3) {
                e3.printStackTrace();
                sVar.error("InappPurchasePlugin", "E_BILLING_RESPONSE_JSON_PARSE_ERROR", e3.getMessage());
                return;
            }
        }
        sVar.error(str, message, localizedMessage);
    }

    private final void o(final h.a.d.a.j jVar, final s sVar) {
        String str = j.y.c.k.a(jVar.a("type"), "subs") ? "subs" : "inapp";
        com.android.billingclient.api.d dVar = this.s;
        j.y.c.k.b(dVar);
        dVar.k(str, new com.android.billingclient.api.q() {
            @Override
            public final void a(com.android.billingclient.api.h hVar, List list) {
                o.p(s.this, jVar, hVar, list);
            }
        });
    }

    public static final void p(s sVar, h.a.d.a.j jVar, com.android.billingclient.api.h hVar, List list) {
        j.y.c.k.e(sVar, "$safeChannel");
        j.y.c.k.e(jVar, "$call");
        j.y.c.k.e(hVar, "billingResult");
        if (hVar.b() != 0) {
            q a2 = p.a.a(hVar.b());
            String str = jVar.a;
            j.y.c.k.d(str, "call.method");
            sVar.error(str, a2.a(), a2.b());
            return;
        }
        JSONArray jSONArray = new JSONArray();
        try {
            j.y.c.k.b(list);
            Iterator it = list.iterator();
            while (it.hasNext()) {
                PurchaseHistoryRecord purchaseHistoryRecord = (PurchaseHistoryRecord) it.next();
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("productId", purchaseHistoryRecord.g().get(0));
                jSONObject.put("transactionDate", purchaseHistoryRecord.c());
                jSONObject.put("transactionReceipt", purchaseHistoryRecord.b());
                jSONObject.put("purchaseToken", purchaseHistoryRecord.d());
                jSONObject.put("dataAndroid", purchaseHistoryRecord.b());
                jSONObject.put("signatureAndroid", purchaseHistoryRecord.f());
                jSONArray.put(jSONObject);
            }
            sVar.success(jSONArray.toString());
        } catch (JSONException e2) {
            e2.printStackTrace();
            sVar.error("InappPurchasePlugin", "E_BILLING_RESPONSE_JSON_PARSE_ERROR", e2.getMessage());
        }
    }

    private final boolean z(String str, String str2) {
        Uri parse = Uri.parse("https://play.google.com/store/account/subscriptions?sku=" + str + "&package=" + str2);
        j.y.c.k.d(parse, "parse(url)");
        return C(parse);
    }

    public final void A() {
        j(this, null, 1, null);
    }

    public final void E(Activity activity) {
        this.u = activity;
    }

    public final void F(h.a.d.a.k kVar) {
        this.v = kVar;
    }

    public final void G(Context context) {
        this.t = context;
    }

    @Override
    public void onActivityCreated(Activity activity, Bundle bundle) {
        j.y.c.k.e(activity, "activity");
    }

    @Override
    public void onActivityDestroyed(Activity activity) {
        Context context;
        j.y.c.k.e(activity, "activity");
        if (this.u != activity || (context = this.t) == null) {
            return;
        }
        Application application = (Application) context;
        j.y.c.k.b(application);
        application.unregisterActivityLifecycleCallbacks(this);
        j(this, null, 1, null);
    }

    @Override
    public void onActivityPaused(Activity activity) {
        j.y.c.k.e(activity, "activity");
    }

    @Override
    public void onActivityResumed(Activity activity) {
        j.y.c.k.e(activity, "activity");
    }

    @Override
    public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
        j.y.c.k.e(activity, "activity");
        j.y.c.k.e(bundle, "outState");
    }

    @Override
    public void onActivityStarted(Activity activity) {
        j.y.c.k.e(activity, "activity");
    }

    @Override
    public void onActivityStopped(Activity activity) {
        j.y.c.k.e(activity, "activity");
    }

    @Override
    public void onMethodCall(h.a.d.a.j jVar, k.d dVar) {
        String str;
        j.y.c.k.e(jVar, "call");
        j.y.c.k.e(dVar, "result");
        if (j.y.c.k.a(jVar.a, "getStore")) {
            dVar.success(r.p.b());
            return;
        }
        if (j.y.c.k.a(jVar.a, "manageSubscription")) {
            Object a2 = jVar.a("sku");
            j.y.c.k.b(a2);
            j.y.c.k.d(a2, "call.argument<String>(\"sku\")!!");
            Object a3 = jVar.a("packageName");
            j.y.c.k.b(a3);
            j.y.c.k.d(a3, "call.argument<String>(\"packageName\")!!");
            dVar.success(Boolean.valueOf(z((String) a2, (String) a3)));
            return;
        }
        if (j.y.c.k.a(jVar.a, "openPlayStoreSubscriptions")) {
            dVar.success(Boolean.valueOf(B()));
            return;
        }
        h.a.d.a.k kVar = this.v;
        j.y.c.k.b(kVar);
        this.r = new s(dVar, kVar);
        h.a.d.a.k kVar2 = this.v;
        j.y.c.k.b(kVar2);
        s sVar = new s(dVar, kVar2);
        if (j.y.c.k.a(jVar.a, "initConnection")) {
            if (this.s != null) {
                sVar.success("Already started. Call endConnection method if you want to start over.");
                return;
            }
            Context context = this.t;
            j.y.c.k.b(context);
            com.android.billingclient.api.d a4 = com.android.billingclient.api.d.i(context).c(this.w).b().a();
            this.s = a4;
            j.y.c.k.b(a4);
            a4.p(new b(sVar, jVar));
            return;
        }
        if (j.y.c.k.a(jVar.a, "endConnection")) {
            if (this.s == null) {
                sVar.success("Already ended.");
                return;
            } else {
                i(sVar);
                return;
            }
        }
        com.android.billingclient.api.d dVar2 = this.s;
        Boolean valueOf = dVar2 == null ? null : Boolean.valueOf(dVar2.f());
        if (j.y.c.k.a(jVar.a, "isReady")) {
            sVar.success(valueOf);
            return;
        }
        if (!j.y.c.k.a(valueOf, Boolean.TRUE)) {
            String str2 = jVar.a;
            j.y.c.k.d(str2, "call.method");
            sVar.error(str2, "E_NOT_PREPARED", "IAP not prepared. Check if Google Play service is available.");
            return;
        }
        String str3 = jVar.a;
        if (str3 != null) {
            switch (str3.hashCode()) {
                case -1880821827:
                    if (str3.equals("acknowledgePurchase")) {
                        a(jVar, sVar);
                        return;
                    }
                    break;
                case -1843395410:
                    if (str3.equals("getPurchaseHistoryByType")) {
                        o(jVar, sVar);
                        return;
                    }
                    break;
                case -1712232405:
                    if (str3.equals("showInAppMessages")) {
                        H(sVar);
                        return;
                    }
                    break;
                case -1665335621:
                    if (str3.equals("consumeAllItems")) {
                        d(sVar, jVar);
                        return;
                    }
                    break;
                case 62129226:
                    if (str3.equals("buyItemByType")) {
                        c(jVar, sVar);
                        return;
                    }
                    break;
                case 133641555:
                    if (str3.equals("consumeProduct")) {
                        g(jVar, sVar);
                        return;
                    }
                    break;
                case 869566272:
                    if (str3.equals("getSubscriptions")) {
                        str = "subs";
                        m(str, jVar, sVar);
                        return;
                    }
                    break;
                case 1069974014:
                    if (str3.equals("getAvailableItemsByType")) {
                        k(jVar, sVar);
                        return;
                    }
                    break;
                case 1074138842:
                    if (str3.equals("getProducts")) {
                        str = "inapp";
                        m(str, jVar, sVar);
                        return;
                    }
                    break;
            }
        }
        sVar.notImplemented();
    }
}