正在查看: Zepto v25.1.4 应用的 InAppNotificationActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Zepto v25.1.4 应用的 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.core.content.ContextCompat;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentTransaction;
import com.clevertap.android.sdk.inapp.CTInAppBaseFullFragment;
import com.clevertap.android.sdk.inapp.CTInAppHtmlCoverFragment;
import com.clevertap.android.sdk.inapp.CTInAppHtmlHalfInterstitialFragment;
import com.clevertap.android.sdk.inapp.CTInAppHtmlInterstitialFragment;
import com.clevertap.android.sdk.inapp.CTInAppNativeCoverFragment;
import com.clevertap.android.sdk.inapp.CTInAppNativeCoverImageFragment;
import com.clevertap.android.sdk.inapp.CTInAppNativeHalfInterstitialFragment;
import com.clevertap.android.sdk.inapp.CTInAppNativeHalfInterstitialImageFragment;
import com.clevertap.android.sdk.inapp.CTInAppNativeInterstitialFragment;
import com.clevertap.android.sdk.inapp.CTInAppNativeInterstitialImageFragment;
import com.clevertap.android.sdk.inapp.CTInAppNotification;
import com.clevertap.android.sdk.inapp.CTInAppNotificationButton;
import com.clevertap.android.sdk.inapp.CTInAppType;
import com.clevertap.android.sdk.inapp.InAppListener;
import com.clevertap.android.sdk.task.CTExecutorFactory;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import kotlin.jvm.internal.Intrinsics;
public final class InAppNotificationActivity extends FragmentActivity implements InAppListener, DidClickForHardPermissionListener {
public static boolean p = false;
public CleverTapInstanceConfig i;
public CTInAppNotification j;
public WeakReference k;
public WeakReference l;
public PushPermissionManager m;
public Bundle n = null;
public boolean o = false;
class AnonymousClass3 implements DialogInterface.OnClickListener {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
new Bundle();
throw null;
}
}
class AnonymousClass4 implements DialogInterface.OnClickListener {
@Override
public final void onClick(DialogInterface dialogInterface, int i) {
new Bundle();
throw null;
}
}
public static class AnonymousClass6 {
public static final int[] a;
static {
int[] iArr = new int[CTInAppType.values().length];
a = iArr;
try {
iArr[1] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[2] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[5] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[6] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[7] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
a[8] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
a[12] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
a[13] = 8;
} catch (NoSuchFieldError unused8) {
}
try {
a[14] = 9;
} catch (NoSuchFieldError unused9) {
}
try {
a[11] = 10;
} catch (NoSuchFieldError unused10) {
}
}
}
public interface PushPermissionResultCallback {
void b();
void c();
}
@Override
public final void d(CTInAppNotification cTInAppNotification) {
q();
}
@Override
public final void e(CTInAppNotification cTInAppNotification, Bundle bundle, HashMap hashMap) {
o(bundle, hashMap);
}
@Override
public final void f(Context context, CTInAppNotification cTInAppNotification, Bundle bundle) {
p(bundle);
}
public final void finish() {
super/*android.app.Activity*/.finish();
if (Build.VERSION.SDK_INT >= 34) {
androidx.privacysandbox.ads.adservices.topics.a.m(this);
} else {
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
}
if (this.o) {
return;
}
t();
}
@Override
public final void g(boolean z) {
u(z);
}
public final CTInAppBaseFullFragment n() {
AlertDialog alertDialog;
switch (this.j.r.ordinal()) {
case 1:
return new CTInAppHtmlCoverFragment();
case 2:
return new CTInAppHtmlInterstitialFragment();
case 3:
case 4:
case 9:
case 10:
default:
this.i.b().getClass();
int i = CleverTapAPI.e;
return null;
case 5:
return new CTInAppHtmlHalfInterstitialFragment();
case 6:
return new CTInAppNativeCoverFragment();
case 7:
return new CTInAppNativeInterstitialFragment();
case 8:
return new CTInAppNativeHalfInterstitialFragment();
case 11:
if (this.j.f.size() > 0) {
alertDialog = new AlertDialog.Builder(this, android.R.style.Theme.Material.Light.Dialog.Alert).setCancelable(false).setTitle(this.j.F).setMessage(this.j.A).setPositiveButton(((CTInAppNotificationButton) this.j.f.get(0)).h, new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i2) {
Bundle bundle = new Bundle();
InAppNotificationActivity inAppNotificationActivity = InAppNotificationActivity.this;
bundle.putString("wzrk_id", inAppNotificationActivity.j.g);
bundle.putString("wzrk_c2a", ((CTInAppNotificationButton) inAppNotificationActivity.j.f.get(0)).h);
inAppNotificationActivity.o(bundle, null);
String str = ((CTInAppNotificationButton) inAppNotificationActivity.j.f.get(0)).a;
if (str != null) {
inAppNotificationActivity.r(bundle, str);
return;
}
CTInAppNotification cTInAppNotification = inAppNotificationActivity.j;
if (cTInAppNotification.N) {
inAppNotificationActivity.u(cTInAppNotification.O);
} else if (((CTInAppNotificationButton) cTInAppNotification.f.get(0)).j == null || !((CTInAppNotificationButton) inAppNotificationActivity.j.f.get(0)).j.equalsIgnoreCase("rfp")) {
inAppNotificationActivity.p(bundle);
} else {
inAppNotificationActivity.u(((CTInAppNotificationButton) inAppNotificationActivity.j.f.get(0)).k);
}
}
}).create();
if (this.j.f.size() == 2) {
alertDialog.setButton(-2, ((CTInAppNotificationButton) this.j.f.get(1)).h, new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i2) {
Bundle bundle = new Bundle();
InAppNotificationActivity inAppNotificationActivity = InAppNotificationActivity.this;
bundle.putString("wzrk_id", inAppNotificationActivity.j.g);
bundle.putString("wzrk_c2a", ((CTInAppNotificationButton) inAppNotificationActivity.j.f.get(1)).h);
inAppNotificationActivity.o(bundle, null);
String str = ((CTInAppNotificationButton) inAppNotificationActivity.j.f.get(1)).a;
if (str != null) {
inAppNotificationActivity.r(bundle, str);
} else if (((CTInAppNotificationButton) inAppNotificationActivity.j.f.get(1)).j == null || !((CTInAppNotificationButton) inAppNotificationActivity.j.f.get(1)).j.equalsIgnoreCase("rfp")) {
inAppNotificationActivity.p(bundle);
} else {
inAppNotificationActivity.u(((CTInAppNotificationButton) inAppNotificationActivity.j.f.get(1)).k);
}
}
});
}
if (this.j.f.size() > 2) {
alertDialog.setButton(-3, ((CTInAppNotificationButton) this.j.f.get(2)).h, new DialogInterface.OnClickListener() {
@Override
public final void onClick(DialogInterface dialogInterface, int i2) {
Bundle bundle = new Bundle();
InAppNotificationActivity inAppNotificationActivity = InAppNotificationActivity.this;
bundle.putString("wzrk_id", inAppNotificationActivity.j.g);
bundle.putString("wzrk_c2a", ((CTInAppNotificationButton) inAppNotificationActivity.j.f.get(2)).h);
inAppNotificationActivity.o(bundle, null);
String str = ((CTInAppNotificationButton) inAppNotificationActivity.j.f.get(2)).a;
if (str != null) {
inAppNotificationActivity.r(bundle, str);
} else {
inAppNotificationActivity.p(bundle);
}
}
});
}
} else {
alertDialog = null;
}
if (alertDialog == null) {
this.i.b().getClass();
int i2 = CleverTapAPI.e;
return null;
}
alertDialog.show();
p = true;
q();
return null;
case 12:
return new CTInAppNativeCoverImageFragment();
case 13:
return new CTInAppNativeInterstitialImageFragment();
case 14:
return new CTInAppNativeHalfInterstitialImageFragment();
}
}
public final void o(Bundle bundle, HashMap hashMap) {
InAppListener s = s();
if (s != null) {
s.e(this.j, bundle, hashMap);
}
}
public final 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.j = (CTInAppNotification) extras.getParcelable("inApp");
boolean z = extras.getBoolean("displayHardPermissionDialog", false);
Bundle bundle2 = extras.getBundle("configBundle");
if (bundle2 != null) {
this.i = (CleverTapInstanceConfig) bundle2.getParcelable("config");
}
this.k = new WeakReference(CleverTapAPI.A(this, this.i, null).b.m);
this.l = new WeakReference(CleverTapAPI.A(this, this.i, null).b.m);
this.m = new PushPermissionManager(this, this.i);
if (z) {
u(extras.getBoolean("shouldShowFallbackSettings", false));
return;
}
CTInAppNotification cTInAppNotification = this.j;
if (cTInAppNotification == null) {
finish();
return;
}
boolean z2 = cTInAppNotification.t;
if (z2 && !cTInAppNotification.s && i == 2) {
finish();
p(null);
return;
}
if (!z2 && cTInAppNotification.s && i == 1) {
finish();
p(null);
return;
}
if (bundle != null) {
if (p) {
n();
return;
}
return;
}
CTInAppBaseFullFragment n = n();
if (n != null) {
Bundle bundle3 = new Bundle();
bundle3.putParcelable("inApp", this.j);
bundle3.putParcelable("config", this.i);
n.setArguments(bundle3);
FragmentTransaction d = getSupportFragmentManager().d();
d.m(android.R.animator.fade_in, android.R.animator.fade_out, 0, 0);
d.j(android.R.id.content, n, android.support.v4.media.a.s(new StringBuilder(), this.i.a, ":CT_INAPP_CONTENT_FRAGMENT"), 1);
d.f();
}
} catch (Throwable unused) {
int i2 = CleverTapAPI.e;
finish();
}
}
public final void onDestroy() {
super.onDestroy();
if (Build.VERSION.SDK_INT >= 34) {
androidx.privacysandbox.ads.adservices.topics.a.m(this);
} else {
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
}
if (this.o) {
return;
}
t();
}
public final void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
super.onRequestPermissionsResult(i, strArr, iArr);
CTPreferenceCache.a(this, this.i);
CTPreferenceCache.c = false;
CleverTapInstanceConfig cleverTapInstanceConfig = this.i;
Intrinsics.checkNotNullParameter(this, "context");
Intrinsics.checkNotNullParameter(cleverTapInstanceConfig, "config");
CTExecutorFactory.b(cleverTapInstanceConfig).a().c("updateCacheToDisk", new c(this, 0));
if (i == 102) {
if (iArr.length <= 0 || iArr[0] != 0) {
((PushPermissionResultCallback) this.l.get()).c();
} else {
((PushPermissionResultCallback) this.l.get()).b();
}
p(null);
}
}
public final void onResume() {
super.onResume();
if (!this.m.d || Build.VERSION.SDK_INT < 33) {
return;
}
if (ContextCompat.a(this, "android.permission.POST_NOTIFICATIONS") == 0) {
((PushPermissionResultCallback) this.l.get()).b();
} else {
((PushPermissionResultCallback) this.l.get()).c();
}
p(null);
}
public final void p(Bundle bundle) {
this.n = bundle;
finish();
}
public final void q() {
InAppListener s = s();
if (s != null) {
s.d(this.j);
}
}
public final void r(Bundle bundle, String str) {
try {
startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str.replace("\n", "").replace("\r", ""))));
} catch (Throwable unused) {
}
p(bundle);
}
public final InAppListener s() {
InAppListener inAppListener;
try {
inAppListener = (InAppListener) this.k.get();
} catch (Throwable unused) {
inAppListener = null;
}
if (inAppListener == null) {
Logger b = this.i.b();
String str = this.i.a;
String str2 = "InAppActivityListener is null for notification: " + this.j.w;
b.getClass();
Logger.f(str2);
}
return inAppListener;
}
public final void setTheme(int i) {
super/*android.app.Activity*/.setTheme(android.R.style.Theme.Translucent.NoTitleBar);
}
public final void t() {
if (p) {
p = false;
}
InAppListener s = s();
if (s != null && getBaseContext() != null && this.j != null) {
s.f(getBaseContext(), this.j, this.n);
}
this.o = true;
}
public final void u(boolean z) {
this.m.a(z, (PushPermissionResultCallback) this.l.get());
}
}