导航菜单

页面标题

页面副标题

Oolka v2.4.42 - m5.java 源代码

正在查看: Oolka v2.4.42 应用的 m5.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package one.upswing.sdk;

import android.annotation.SuppressLint;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.location.LocationManager;
import android.net.Uri;
import android.provider.Settings;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.util.Base64;
import android.webkit.JavascriptInterface;
import android.widget.Toast;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.LifecycleCoroutineScope;
import androidx.lifecycle.c0;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import in.juspay.hypersdk.ota.Constants;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import kotlin.collections.ArraysKt___ArraysKt;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.collections.CollectionsKt__MutableCollectionsKt;
import kotlin.collections.MapsKt__MapsJVMKt;
import kotlin.io.ConstantsKt;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.Charsets;
import kotlin.text.StringsKt__StringsKt;
import one.upswing.sdk.location.UpswingGpsHelper;
import one.upswing.sdk.partnerprefconfig.domain.model.SDKRemoteConfigData;
import one.upswing.sdk.partnerprefconfig.util.PartnerPrefConfigDeserializer;
import one.upswing.sdk.util.CustomerHandler;
import one.upswing.sdk.util.PciListener;
import one.upswing.sdk.yesbank.data.YesBankRequestDataWrapper;
import org.bouncycastle.crypto.signers.Ed25519Signer;
import org.jetbrains.annotations.NotNull;

public final class m5 {
    public final FragmentActivity a;
    public final p2 b;
    public final s c;
    public final c3 d;
    public final o6 e;
    public final LifecycleCoroutineScope f;
    public final b0 g;
    public final v5 h;
    public final one.upswing.sdk.util.b i;
    public final f3 j;
    public final r k;
    public final UpswingGpsHelper l;
    public final r1 m;

    public m5(FragmentActivity fragmentActivity, p2 p2Var, s sVar, c3 c3Var, o6 o6Var, LifecycleCoroutineScope lifecycleCoroutineScope, b0 b0Var, v5 v5Var, one.upswing.sdk.util.b bVar, f3 f3Var, r rVar, UpswingGpsHelper upswingGpsHelper, r1 r1Var) {
        this.a = fragmentActivity;
        this.b = p2Var;
        this.c = sVar;
        this.d = c3Var;
        this.e = o6Var;
        this.f = lifecycleCoroutineScope;
        this.g = b0Var;
        this.h = v5Var;
        this.i = bVar;
        this.j = f3Var;
        this.k = rVar;
        this.l = upswingGpsHelper;
        this.m = r1Var;
    }

    public final void a() {
        kotlinx.coroutines.i.e(this.f, kotlinx.coroutines.x0.c(), null, new z3(this, null), 2, null);
    }

    @JavascriptInterface
    public final void askPermissionsFromSettings() {
        a();
        s sVar = this.c;
        sVar.getClass();
        Intent intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS");
        intent.setData(Uri.fromParts(Constants.PACKAGE_DIR_NAME, sVar.a.requireContext().getApplicationContext().getPackageName(), null));
        sVar.a.startActivity(intent);
    }

    @JavascriptInterface
    public final void askUserToEnableGPS() {
        a();
        if (isGPSEnabled()) {
            this.g.a("GPS is Already enabled", true);
        } else {
            this.l.a(new k3(this));
        }
    }

    @JavascriptInterface
    public final void authenticateUserViaDeviceLockOrBiometric() {
        a();
        kotlinx.coroutines.i.e(this.f, kotlinx.coroutines.x0.c(), null, new v3(this, null), 2, null);
    }

    @JavascriptInterface
    public final void clear() {
        a();
        kotlinx.coroutines.i.e(this.f, null, null, new d4(this, null), 3, null);
    }

    @JavascriptInterface
    public final void copySensitiveDataToClipboard(@NotNull String str) {
        a();
        z6.c(this.a, str);
    }

    @JavascriptInterface
    public final void createToast(@NotNull String str) {
        a();
        Toast.makeText((Context) this.a, (CharSequence) str, 0).show();
    }

    @JavascriptInterface
    public final void disableScreenCapture() {
        a();
        kotlinx.coroutines.i.e(this.f, kotlinx.coroutines.x0.c(), null, new f4(this, null), 2, null);
    }

    @JavascriptInterface
    public final void enableScreenCapture() {
        a();
        kotlinx.coroutines.i.e(this.f, kotlinx.coroutines.x0.c(), null, new j4(this, null), 2, null);
    }

    @JavascriptInterface
    public final void existSdk() {
        a();
        p2 p2Var = this.b;
        kotlinx.coroutines.i.e(androidx.lifecycle.o.a(p2Var.getViewLifecycleOwner()), null, null, new y4(p2Var, null), 3, null);
        p2Var.requireActivity().finish();
    }

    @JavascriptInterface
    public final void fetchLocationData() {
        a();
        this.m.e(new m4(this));
    }

    @JavascriptInterface
    @NotNull
    public final String fetchManifestDeclaredPermissions() {
        List emptyList;
        a();
        s sVar = this.c;
        sVar.getClass();
        Gson gson = new Gson();
        try {
            String[] strArr = sVar.a.requireContext().getApplicationContext().getPackageManager().getPackageInfo(sVar.a.requireContext().getApplicationContext().getPackageName(), ConstantsKt.DEFAULT_BLOCK_SIZE).requestedPermissions;
            if (strArr == null || (emptyList = ArraysKt___ArraysKt.toList(strArr)) == null) {
                emptyList = CollectionsKt__CollectionsKt.emptyList();
            }
        } catch (Exception e) {
            e.getMessage();
            emptyList = CollectionsKt__CollectionsKt.emptyList();
        }
        return gson.toJson(emptyList);
    }

    @JavascriptInterface
    @NotNull
    public final String generateSignature(@NotNull String str) {
        a();
        byte[] bytes = str.getBytes(Charsets.UTF_8);
        Intrinsics.checkNotNullExpressionValue(bytes, "this as java.lang.String).getBytes(charset)");
        LinkedHashMap linkedHashMap = h3.a;
        p4 p4Var = new p4(this);
        LinkedHashMap linkedHashMap2 = h3.a;
        Object obj = linkedHashMap2.get("PVT_KEY");
        if (obj == null) {
            obj = p4Var.invoke();
            linkedHashMap2.put("PVT_KEY", obj);
        }
        Intrinsics.checkNotNull(obj, "null cannot be cast to non-null type org.bouncycastle.crypto.params.Ed25519PrivateKeyParameters");
        Ed25519Signer ed25519Signer = new Ed25519Signer();
        ed25519Signer.a(true, (org.bouncycastle.crypto.params.l0) obj);
        ed25519Signer.d(bytes, 0, bytes.length);
        return StringsKt__StringsKt.trim((CharSequence) Base64.encodeToString(ed25519Signer.c(), 10)).toString();
    }

    @JavascriptInterface
    @NotNull
    public final String getAppInformation() {
        a();
        return new Gson().toJson(c4.a(this.a));
    }

    @JavascriptInterface
    @NotNull
    public final String getAppListUsingUpswingSdk() {
        Map mapOf;
        a();
        p2 p2Var = this.b;
        FragmentActivity fragmentActivity = this.a;
        p2Var.getClass();
        mapOf = MapsKt__MapsJVMKt.mapOf(kotlin.k.a("availableAppsUsingUpswingSdk", z6.b(fragmentActivity, Uri.parse("upswing://analytics.app.packages"))));
        return new Gson().toJson(mapOf);
    }

    @JavascriptInterface
    @NotNull
    public final String getAvailableSimCardList() {
        Map mapOf;
        a();
        mapOf = MapsKt__MapsJVMKt.mapOf(kotlin.k.a("simCardList", this.j.a()));
        return new Gson().toJson(mapOf);
    }

    @JavascriptInterface
    @NotNull
    public final String getAvailableUPIApps() {
        Map mapOf;
        a();
        p2 p2Var = this.b;
        FragmentActivity fragmentActivity = this.a;
        p2Var.getClass();
        mapOf = MapsKt__MapsJVMKt.mapOf(kotlin.k.a("availableUpiApps", z6.b(fragmentActivity, Uri.parse("upi://pay"))));
        return new Gson().toJson(mapOf);
    }

    @JavascriptInterface
    @NotNull
    public final String getDeviceId() {
        a();
        return this.e.a();
    }

    @JavascriptInterface
    @NotNull
    public final String getDeviceSpecs() {
        a();
        return new Gson().toJson(this.e.b());
    }

    @JavascriptInterface
    public final String getItem(@NotNull String str) {
        a();
        j3 j3Var = (j3) this.d;
        if (ArraysKt___ArraysKt.contains(j3Var.d, str)) {
            return null;
        }
        return ((m2) ((u2) j3Var.b.getValue())).a(str);
    }

    @JavascriptInterface
    @NotNull
    public final String getPartnerUid() {
        a();
        return ((j3) this.d).d();
    }

    @JavascriptInterface
    public final void getPhoneStatePermission() {
        a();
        if (hasReadPhoneStatePermission()) {
            return;
        }
        s sVar = this.c;
        CollectionsKt__MutableCollectionsKt.addAll(sVar.c, new b[]{C0084z0.b});
        sVar.a(new s4(this));
    }

    @JavascriptInterface
    @NotNull
    public final String getSDKFlavor() {
        return "prodWithoutTink";
    }

    @JavascriptInterface
    @SuppressLint({"MissingPermission"})
    public final int getSimSubscriptionIdFromSlot(int i) {
        List<SubscriptionInfo> activeSubscriptionInfoList;
        SubscriptionInfo subscriptionInfo;
        a();
        Object systemService = this.a.getSystemService("telephony_subscription_service");
        Intrinsics.checkNotNull(systemService, "null cannot be cast to non-null type android.telephony.SubscriptionManager");
        SubscriptionManager subscriptionManager = (SubscriptionManager) systemService;
        if (!this.c.e("android.permission.READ_PHONE_STATE") || (activeSubscriptionInfoList = subscriptionManager.getActiveSubscriptionInfoList()) == null || (subscriptionInfo = activeSubscriptionInfoList.get(i)) == null) {
            return -1;
        }
        return subscriptionInfo.getSubscriptionId();
    }

    @JavascriptInterface
    public final void getSmsAndReadPhoneStatePermissions() {
        a();
        s sVar = this.c;
        CollectionsKt__MutableCollectionsKt.addAll(sVar.c, new b[]{A0.b, C0084z0.b});
        sVar.a(new a5(this));
    }

    @JavascriptInterface
    public final void getSmsPermission() {
        a();
        if (hasSmsPermission()) {
            return;
        }
        s sVar = this.c;
        CollectionsKt__MutableCollectionsKt.addAll(sVar.c, new b[]{A0.b});
        sVar.a(new e5(this));
    }

    @JavascriptInterface
    @NotNull
    public final String getWebViewVersion() {
        a();
        return this.b.A();
    }

    @JavascriptInterface
    public final void getYesBankDeviceToken(@NotNull String str, @NotNull String str2, String str3, @NotNull String str4, @NotNull String str5, @NotNull String str6) {
        a();
        this.b.y(new YesBankRequestDataWrapper(str, str2, str3, str4, str5, str6, false, 64, null));
    }

    @JavascriptInterface
    public final boolean hasNotificationEnabled() {
        a();
        return this.c.d();
    }

    @JavascriptInterface
    public final boolean hasReadPhoneStatePermission() {
        a();
        return this.c.e("android.permission.READ_PHONE_STATE");
    }

    @JavascriptInterface
    public final boolean hasSmsPermission() {
        a();
        return this.c.e("android.permission.SEND_SMS");
    }

    @JavascriptInterface
    public final void initiateCustomer() {
        a();
        p2 p2Var = this.b;
        e0 e0Var = p2Var.B;
        if (e0Var == null) {
            Intrinsics.throwUninitializedPropertyAccessException("upswingEventTrackerProvider");
            e0Var = null;
        }
        ((z2) e0Var.b.getValue()).a("", "", "INITIATED", "BEFORE");
        IUpswingInitiateCustomer iUpswingInitiateCustomer = r6.a;
        if (iUpswingInitiateCustomer != null) {
            iUpswingInitiateCustomer.initiateCustomer(new l5(p2Var));
        }
    }

    @JavascriptInterface
    public final void initiateUPIIntent(@NotNull String str, @NotNull String str2) {
        a();
        p2 p2Var = this.b;
        p2Var.getClass();
        try {
            p2Var.H.b(new t4(Uri.parse(str), str2));
        } catch (ActivityNotFoundException e) {
            p2Var.requireContext();
            throw e;
        }
    }

    @JavascriptInterface
    public final boolean isAppInstalled(@NotNull String str) {
        a();
        return z6.e(this.a, str);
    }

    @JavascriptInterface
    public final boolean isCustomerInitialized() {
        a();
        return !StringsKt__StringsKt.isBlank(((m2) ((u2) ((j3) this.d).b.getValue())).a("pvtKey"));
    }

    @JavascriptInterface
    public final boolean isDeveloperModeEnabled() {
        a();
        return Settings.Secure.getInt(this.a.getContentResolver(), "development_settings_enabled", 0) != 0;
    }

    @JavascriptInterface
    public final boolean isDeviceLockOrBiometricAvailable() {
        a();
        return this.i.a.b();
    }

    @JavascriptInterface
    public final boolean isDeviceRooted() {
        a();
        LinkedHashMap linkedHashMap = h3.a;
        n0 n0Var = n0.c;
        LinkedHashMap linkedHashMap2 = h3.a;
        Object obj = linkedHashMap2.get("ROOT_CHECK");
        if (obj == null) {
            obj = n0Var.invoke();
            linkedHashMap2.put("ROOT_CHECK", obj);
        }
        Intrinsics.checkNotNull(obj, "null cannot be cast to non-null type kotlin.Boolean");
        return ((Boolean) obj).booleanValue();
    }

    @JavascriptInterface
    public final boolean isGPSEnabled() {
        a();
        Object systemService = this.l.a.getSystemService("location");
        Intrinsics.checkNotNull(systemService, "null cannot be cast to non-null type android.location.LocationManager");
        return ((LocationManager) systemService).isProviderEnabled("gps");
    }

    @JavascriptInterface
    public final boolean isPciSubmitHandlerEnabled() {
        a();
        return CustomerHandler.INSTANCE.getPciListener() != null;
    }

    @JavascriptInterface
    public final boolean isPermissionGranted(@NotNull String str) {
        a();
        return this.c.e(str);
    }

    @JavascriptInterface
    public final boolean isPersistentStorageLoaded() {
        a();
        return true;
    }

    @JavascriptInterface
    public final void launchExternalUri(@NotNull String str) {
        a();
        Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
        if (intent.resolveActivity(this.a.getPackageManager()) != null) {
            this.a.startActivity(intent);
            return;
        }
        ((i0) ((g2) this.g.d.getValue())).b(k0.r, "{}");
    }

    @JavascriptInterface
    public final void launchInternalUri(@NotNull String str) {
        a();
        FragmentActivity fragmentActivity = this.a;
        i6 i6Var = new i6(fragmentActivity);
        String d = androidx.browser.customtabs.b.d(fragmentActivity, (List) null);
        if (d == null ? false : androidx.browser.customtabs.b.a(fragmentActivity, d, new d6(i6Var))) {
            i6Var.a(Uri.parse(str));
        } else {
            ((i0) ((g2) this.g.d.getValue())).b(k0.r, "{}");
        }
    }

    @JavascriptInterface
    public final void logout() {
        a();
        ((j3) this.d).a();
        p2 p2Var = this.b;
        kotlinx.coroutines.i.e(androidx.lifecycle.o.a(p2Var.getViewLifecycleOwner()), null, null, new y4(p2Var, null), 3, null);
        p2Var.requireActivity().finish();
    }

    @JavascriptInterface
    public final void onCopiedCardDetail(@NotNull String str) {
        a();
        if (Intrinsics.areEqual(str, "SUCCESS")) {
            r rVar = this.k;
            o oVar = o.a;
            rVar.getClass();
            kotlinx.coroutines.i.e(c0.a(rVar), null, null, new x5(rVar, oVar, null), 3, null);
            return;
        }
        r rVar2 = this.k;
        i5 i5Var = new i5(str);
        rVar2.getClass();
        kotlinx.coroutines.i.e(c0.a(rVar2), null, null, new x5(rVar2, i5Var, null), 3, null);
    }

    @JavascriptInterface
    public final void onGuestSessionPollingOver() {
        a();
        p2 p2Var = this.b;
        c3 c3Var = null;
        p2Var.t = null;
        p2Var.u = null;
        c3 c3Var2 = p2Var.v;
        if (c3Var2 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("sharedPreferenceStore");
        } else {
            c3Var = c3Var2;
        }
        ((m2) ((u2) ((j3) c3Var).b.getValue())).d("pvtKey");
    }

    @JavascriptInterface
    public final void pciSubmitHandler(@NotNull String str) {
        a();
        PciListener pciListener = CustomerHandler.INSTANCE.getPciListener();
        if (pciListener != null) {
            pciListener.onPciSubmitted(str);
        }
    }

    @JavascriptInterface
    public final void removeItem(@NotNull String str) {
        a();
        j3 j3Var = (j3) this.d;
        if (ArraysKt___ArraysKt.contains(j3Var.d, str)) {
            return;
        }
        ((m2) ((u2) j3Var.b.getValue())).d(str);
    }

    @JavascriptInterface
    public final void requestRuntimePermission(@NotNull String str) {
        a();
        s sVar = this.c;
        CollectionsKt__MutableCollectionsKt.addAll(sVar.c, new b[]{new u6(str)});
        sVar.a(new j5(this, str));
    }

    @JavascriptInterface
    public final void selectSIMCard() {
        a();
        this.j.e();
    }

    @JavascriptInterface
    public final void sendSms(int i, @NotNull String str, @NotNull String str2) {
        a();
        this.a.getApplicationContext();
        this.j.b(i, str, str2);
    }

    @JavascriptInterface
    public final void sendSmsViaIntent(@NotNull String str, @NotNull String str2) {
        Map mapOf;
        Map mapOf2;
        a();
        f3 f3Var = this.j;
        f3Var.getClass();
        Intent intent = new Intent("android.intent.action.SENDTO");
        intent.setData(Uri.parse("smsto:" + str));
        intent.putExtra("sms_body", str2);
        try {
            if (intent.resolveActivity(f3Var.a.getPackageManager()) != null) {
                f3Var.a.startActivity(intent);
            } else {
                b0 b0Var = f3Var.b;
                b0Var.getClass();
                mapOf2 = MapsKt__MapsJVMKt.mapOf(kotlin.k.a("error", "No app available to handle SMS intent"));
                ((i0) ((g2) b0Var.d.getValue())).b(k0.x, b0Var.c.toJson(mapOf2));
            }
        } catch (Exception e) {
            b0 b0Var2 = f3Var.b;
            String localizedMessage = e.getLocalizedMessage();
            if (localizedMessage == null) {
                localizedMessage = "Unknown Exception";
            }
            b0Var2.getClass();
            mapOf = MapsKt__MapsJVMKt.mapOf(kotlin.k.a("error", localizedMessage));
            ((i0) ((g2) b0Var2.d.getValue())).b(k0.x, b0Var2.c.toJson(mapOf));
        }
    }

    @JavascriptInterface
    public final void setAllowedUrlsForCameraAndLocationInWebView(@NotNull String str) {
        a();
        JsonArray asJsonArray = ((JsonObject) new Gson().fromJson(str, JsonObject.class)).getAsJsonArray("urlList");
        ArrayList arrayList = new ArrayList();
        Iterator it = asJsonArray.iterator();
        while (it.hasNext()) {
            String asString = ((JsonElement) it.next()).getAsString();
            if (asString != null) {
                arrayList.add(asString);
            }
        }
        z4.a.addAll(arrayList);
    }

    @JavascriptInterface
    public final void setExternalUrls(@NotNull String str) {
        a();
        JsonArray asJsonArray = ((JsonObject) new Gson().fromJson(str, JsonObject.class)).getAsJsonArray("urlList");
        ArrayList arrayList = new ArrayList();
        Iterator it = asJsonArray.iterator();
        while (it.hasNext()) {
            String asString = ((JsonElement) it.next()).getAsString();
            if (asString != null) {
                arrayList.add(asString);
            }
        }
        d5.a.addAll(arrayList);
    }

    @JavascriptInterface
    public final void setItem(@NotNull String str, @NotNull String str2) {
        a();
        j3 j3Var = (j3) this.d;
        if (ArraysKt___ArraysKt.contains(j3Var.d, str)) {
            return;
        }
        ((m2) ((u2) j3Var.b.getValue())).c(str, str2);
    }

    @JavascriptInterface
    public final void setSDKRemoteConfig(@NotNull String str) {
        SDKRemoteConfigData sDKRemoteConfigData;
        a();
        try {
            try {
                sDKRemoteConfigData = (SDKRemoteConfigData) new GsonBuilder().registerTypeAdapter(SDKRemoteConfigData.class, new PartnerPrefConfigDeserializer()).create().fromJson(str, SDKRemoteConfigData.class);
            } catch (Exception e) {
                e.getLocalizedMessage();
                sDKRemoteConfigData = null;
            }
            if (sDKRemoteConfigData != null) {
                ((j3) this.d).b(sDKRemoteConfigData);
            }
        } catch (Exception e2) {
            e2.getLocalizedMessage();
        }
    }

    @JavascriptInterface
    public final void validateGuestSessionToken(@NotNull String str) {
        a();
        p2 p2Var = this.b;
        String str2 = p2Var.s;
        c3 c3Var = null;
        if (str2 == null) {
            Intrinsics.throwUninitializedPropertyAccessException("guestSessionToken");
            str2 = null;
        }
        if (Intrinsics.areEqual(str2, str)) {
            c3 c3Var2 = p2Var.v;
            if (c3Var2 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("sharedPreferenceStore");
            } else {
                c3Var = c3Var2;
            }
            org.bouncycastle.crypto.params.l0 l0Var = p2Var.t;
            Intrinsics.checkNotNull(l0Var);
            ((m2) ((u2) ((j3) c3Var).b.getValue())).c("pvtKey", z6.a(l0Var.getEncoded()));
        }
    }

    @JavascriptInterface
    @NotNull
    public final String version() {
        a();
        return "1.2.5";
    }

    @JavascriptInterface
    public final void webAppLoaded() {
        a();
        this.b.E();
    }

    @JavascriptInterface
    public final void getYesBankDeviceToken(@NotNull String str, @NotNull String str2, String str3, @NotNull String str4, @NotNull String str5, @NotNull String str6, boolean z) {
        a();
        this.b.y(new YesBankRequestDataWrapper(str, str2, str3, str4, str5, str6, z));
    }

    @JavascriptInterface
    public final void getYesBankDeviceToken(String str, @NotNull String str2, @NotNull String str3, @NotNull String str4) {
        a();
        this.b.y(new YesBankRequestDataWrapper(null, null, str, str2, str3, str4, false, 64, null));
    }
}