导航菜单

页面标题

页面副标题

Kickcash v16.1 - InAppNotificationActivity.java 源代码

正在查看: Kickcash v16.1 应用的 InAppNotificationActivity.java JAVA 源代码文件

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


package com.clevertap.android.sdk;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import androidx.annotation.NonNull;
import com.clevertap.android.sdk.inapp.CTInAppNotification;
import com.clevertap.android.sdk.inapp.r;
import java.lang.ref.WeakReference;
import java.util.HashMap;

public final class InAppNotificationActivity extends androidx.fragment.app.d implements com.microsoft.clarity.e7.l, com.microsoft.clarity.w6.z {
    private static boolean I0 = false;
    private WeakReference<e> E0;
    private x F0;
    private Bundle G0 = null;
    private boolean H0 = false;
    private CleverTapInstanceConfig X;
    private CTInAppNotification Y;
    private WeakReference<com.microsoft.clarity.e7.l> Z;

    class a implements DialogInterface.OnClickListener {
        a() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            Bundle bundle = new Bundle();
            bundle.putString("wzrk_id", InAppNotificationActivity.this.Y.h());
            bundle.putString("wzrk_c2a", InAppNotificationActivity.this.Y.g().get(0).g());
            InAppNotificationActivity.this.S(bundle, null);
            String a = InAppNotificationActivity.this.Y.g().get(0).a();
            if (a != null) {
                InAppNotificationActivity.this.V(a, bundle);
                return;
            }
            if (InAppNotificationActivity.this.Y.V()) {
                InAppNotificationActivity inAppNotificationActivity = InAppNotificationActivity.this;
                inAppNotificationActivity.c0(inAppNotificationActivity.Y.c());
            } else if (InAppNotificationActivity.this.Y.g().get(0).j() == null || !InAppNotificationActivity.this.Y.g().get(0).j().equalsIgnoreCase("rfp")) {
                InAppNotificationActivity.this.T(bundle);
            } else {
                InAppNotificationActivity inAppNotificationActivity2 = InAppNotificationActivity.this;
                inAppNotificationActivity2.c0(inAppNotificationActivity2.Y.g().get(0).l());
            }
        }
    }

    class b implements DialogInterface.OnClickListener {
        b() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            Bundle bundle = new Bundle();
            bundle.putString("wzrk_id", InAppNotificationActivity.this.Y.h());
            bundle.putString("wzrk_c2a", InAppNotificationActivity.this.Y.g().get(1).g());
            InAppNotificationActivity.this.S(bundle, null);
            String a = InAppNotificationActivity.this.Y.g().get(1).a();
            if (a != null) {
                InAppNotificationActivity.this.V(a, bundle);
            } else if (InAppNotificationActivity.this.Y.g().get(1).j() == null || !InAppNotificationActivity.this.Y.g().get(1).j().equalsIgnoreCase("rfp")) {
                InAppNotificationActivity.this.T(bundle);
            } else {
                InAppNotificationActivity inAppNotificationActivity = InAppNotificationActivity.this;
                inAppNotificationActivity.c0(inAppNotificationActivity.Y.g().get(1).l());
            }
        }
    }

    class c implements DialogInterface.OnClickListener {
        c() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            Bundle bundle = new Bundle();
            bundle.putString("wzrk_id", InAppNotificationActivity.this.Y.h());
            bundle.putString("wzrk_c2a", InAppNotificationActivity.this.Y.g().get(2).g());
            InAppNotificationActivity.this.S(bundle, null);
            String a = InAppNotificationActivity.this.Y.g().get(2).a();
            if (a != null) {
                InAppNotificationActivity.this.V(a, bundle);
            } else {
                InAppNotificationActivity.this.T(bundle);
            }
        }
    }

    static class d {
        static final int[] a;

        static {
            int[] iArr = new int[com.clevertap.android.sdk.inapp.s.values().length];
            a = iArr;
            try {
                iArr[com.clevertap.android.sdk.inapp.s.CTInAppTypeCoverHTML.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                a[com.clevertap.android.sdk.inapp.s.CTInAppTypeInterstitialHTML.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                a[com.clevertap.android.sdk.inapp.s.CTInAppTypeHalfInterstitialHTML.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                a[com.clevertap.android.sdk.inapp.s.CTInAppTypeCover.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                a[com.clevertap.android.sdk.inapp.s.CTInAppTypeInterstitial.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                a[com.clevertap.android.sdk.inapp.s.CTInAppTypeHalfInterstitial.ordinal()] = 6;
            } catch (NoSuchFieldError unused6) {
            }
            try {
                a[com.clevertap.android.sdk.inapp.s.CTInAppTypeCoverImageOnly.ordinal()] = 7;
            } catch (NoSuchFieldError unused7) {
            }
            try {
                a[com.clevertap.android.sdk.inapp.s.CTInAppTypeInterstitialImageOnly.ordinal()] = 8;
            } catch (NoSuchFieldError unused8) {
            }
            try {
                a[com.clevertap.android.sdk.inapp.s.CTInAppTypeHalfInterstitialImageOnly.ordinal()] = 9;
            } catch (NoSuchFieldError unused9) {
            }
            try {
                a[com.clevertap.android.sdk.inapp.s.CTInAppTypeAlert.ordinal()] = 10;
            } catch (NoSuchFieldError unused10) {
            }
        }
    }

    public interface e {
        void b();

        void c();
    }

    private com.clevertap.android.sdk.inapp.b R() {
        AlertDialog alertDialog;
        com.clevertap.android.sdk.inapp.s s = this.Y.s();
        switch (d.a[s.ordinal()]) {
            case 1:
                return new com.clevertap.android.sdk.inapp.h();
            case 2:
                return new com.microsoft.clarity.e7.e();
            case 3:
                return new com.microsoft.clarity.e7.d();
            case 4:
                return new com.clevertap.android.sdk.inapp.k();
            case 5:
                return new com.clevertap.android.sdk.inapp.q();
            case 6:
                return new com.clevertap.android.sdk.inapp.n();
            case 7:
                return new com.clevertap.android.sdk.inapp.l();
            case 8:
                return new r();
            case 9:
                return new com.clevertap.android.sdk.inapp.o();
            case 10:
                if (this.Y.g().size() > 0) {
                    alertDialog = new AlertDialog.Builder(this, android.R.style.Theme.Material.Light.Dialog.Alert).setCancelable(false).setTitle(this.Y.C()).setMessage(this.Y.x()).setPositiveButton(this.Y.g().get(0).g(), new a()).create();
                    if (this.Y.g().size() == 2) {
                        alertDialog.setButton(-2, this.Y.g().get(1).g(), new b());
                    }
                    if (this.Y.g().size() > 2) {
                        alertDialog.setButton(-3, this.Y.g().get(2).g(), new c());
                    }
                } else {
                    alertDialog = null;
                }
                if (alertDialog == null) {
                    this.X.o().h("InAppNotificationActivity: Alert Dialog is null, not showing Alert InApp");
                    return null;
                }
                alertDialog.show();
                I0 = true;
                U(null);
                return null;
            default:
                this.X.o().a("InAppNotificationActivity: Unhandled InApp Type: " + s);
                return null;
        }
    }

    private String W() {
        return this.X.d() + ":CT_INAPP_CONTENT_FRAGMENT";
    }

    private void Y() {
        if (I0) {
            I0 = false;
        }
        com.microsoft.clarity.e7.l X = X();
        if (X != null && getBaseContext() != null && this.Y != null) {
            X.g(getBaseContext(), this.Y, this.G0);
        }
        this.H0 = true;
    }

    @Override
    public void C(CTInAppNotification cTInAppNotification, Bundle bundle, HashMap<String, String> hashMap) {
        S(bundle, hashMap);
    }

    @Override
    public void I(boolean z) {
        c0(z);
    }

    void S(Bundle bundle, HashMap<String, String> hashMap) {
        com.microsoft.clarity.e7.l X = X();
        if (X != null) {
            X.C(this.Y, bundle, hashMap);
        }
    }

    void T(Bundle bundle) {
        this.G0 = bundle;
        finish();
    }

    void U(Bundle bundle) {
        com.microsoft.clarity.e7.l X = X();
        if (X != null) {
            X.u(this.Y, bundle);
        }
    }

    void V(String str, Bundle bundle) {
        try {
            startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str.replace("\n", "").replace("\r", ""))));
        } catch (Throwable unused) {
        }
        T(bundle);
    }

    com.microsoft.clarity.e7.l X() {
        com.microsoft.clarity.e7.l lVar;
        try {
            lVar = this.Z.get();
        } catch (Throwable unused) {
            lVar = null;
        }
        if (lVar == null) {
            this.X.o().v(this.X.d(), "InAppActivityListener is null for notification: " + this.Y.t());
        }
        return lVar;
    }

    public void Z() {
        this.E0.get().b();
    }

    void a0(com.microsoft.clarity.e7.l lVar) {
        this.Z = new WeakReference<>(lVar);
    }

    public void b0(e eVar) {
        this.E0 = new WeakReference<>(eVar);
    }

    public void c0(boolean z) {
        this.F0.i(z, this.E0.get());
    }

    public void finish() {
        super/*android.app.Activity*/.finish();
        if (Build.VERSION.SDK_INT >= 34) {
            overrideActivityTransition(1, android.R.anim.fade_in, android.R.anim.fade_out);
        } else {
            overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
        }
        if (this.H0) {
            return;
        }
        Y();
    }

    @Override
    public void g(Context context, CTInAppNotification cTInAppNotification, Bundle bundle) {
        T(bundle);
    }

    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        int i = getResources().getConfiguration().orientation;
        if (i == 2) {
            getWindow().addFlags(1024);
        }
        try {
            Bundle extras = getIntent().getExtras();
            if (extras == null) {
                throw new IllegalArgumentException();
            }
            this.Y = (CTInAppNotification) extras.getParcelable("inApp");
            boolean z = extras.getBoolean("displayHardPermissionDialog", false);
            Bundle bundle2 = extras.getBundle("configBundle");
            if (bundle2 != null) {
                this.X = (CleverTapInstanceConfig) bundle2.getParcelable("config");
            }
            a0(h.F0(this, this.X).Z().n());
            b0(h.F0(this, this.X).Z().n());
            this.F0 = new x(this, this.X);
            if (z) {
                c0(extras.getBoolean("shouldShowFallbackSettings", false));
                return;
            }
            CTInAppNotification cTInAppNotification = this.Y;
            if (cTInAppNotification == null) {
                finish();
                return;
            }
            if (cTInAppNotification.W() && !this.Y.U()) {
                if (i == 2) {
                    v.d("App in Landscape, dismissing portrait InApp Notification");
                    finish();
                    T(null);
                    return;
                }
                v.d("App in Portrait, displaying InApp Notification anyway");
            }
            if (!this.Y.W() && this.Y.U()) {
                if (i == 1) {
                    v.d("App in Portrait, dismissing landscape InApp Notification");
                    finish();
                    T(null);
                    return;
                }
                v.d("App in Landscape, displaying InApp Notification anyway");
            }
            if (bundle != null) {
                if (I0) {
                    R();
                    return;
                }
                return;
            }
            com.clevertap.android.sdk.inapp.b R = R();
            if (R != null) {
                Bundle bundle3 = new Bundle();
                bundle3.putParcelable("inApp", this.Y);
                bundle3.putParcelable("config", this.X);
                R.O1(bundle3);
                getSupportFragmentManager().m().t(android.R.animator.fade_in, android.R.animator.fade_out).c(android.R.id.content, R, W()).k();
            }
        } catch (Throwable th) {
            v.u("Cannot find a valid notification bundle to show!", th);
            finish();
        }
    }

    protected void onDestroy() {
        super.onDestroy();
        if (Build.VERSION.SDK_INT >= 34) {
            overrideActivityTransition(1, android.R.anim.fade_in, android.R.anim.fade_out);
        } else {
            overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
        }
        if (this.H0) {
            return;
        }
        Y();
    }

    public void onRequestPermissionsResult(int i, @NonNull String[] strArr, @NonNull int[] iArr) {
        super.onRequestPermissionsResult(i, strArr, iArr);
        boolean z = false;
        com.microsoft.clarity.w6.i.c(this, this.X).e(false);
        com.microsoft.clarity.w6.i.f(this, this.X);
        if (i == 102) {
            if (iArr.length > 0 && iArr[0] == 0) {
                z = true;
            }
            if (z) {
                this.E0.get().c();
            } else {
                this.E0.get().b();
            }
            T(null);
        }
    }

    protected void onResume() {
        super.onResume();
        if (!this.F0.c() || Build.VERSION.SDK_INT < 33) {
            return;
        }
        if (androidx.core.content.a.a(this, "android.permission.POST_NOTIFICATIONS") == 0) {
            this.E0.get().c();
        } else {
            this.E0.get().b();
        }
        T(null);
    }

    public void setTheme(int i) {
        super/*android.content.ContextWrapper*/.setTheme(android.R.style.Theme.Translucent.NoTitleBar);
    }

    @Override
    public void u(CTInAppNotification cTInAppNotification, Bundle bundle) {
        U(bundle);
    }
}