正在查看: Crafto v9.3.3 应用的 P.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Crafto v9.3.3 应用的 P.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package f9;
import Eb.X0;
import L8.E0;
import Q8.X;
import W1.s0;
import android.app.ActionBar;
import android.content.Intent;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentViewModelLazyKt;
import androidx.lifecycle.v0;
import androidx.lifecycle.x0;
import androidx.lifecycle.y0;
import com.clevertap.android.sdk.Constants;
import com.crafto.android.data.model.User;
import com.crafto.android.data.model.membership.MembershipPaymentData;
import com.crafto.android.data.model.membership.MembershipPaymentOrderData;
import com.crafto.android.utility.PreferencesHelper;
import com.crafto.android.utility.a;
import com.google.android.material.appbar.AppBarLayout;
import do.a;
import e9.C2216g;
import java.util.HashMap;
import java.util.Locale;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Lambda;
import kotlin.jvm.internal.Reflection;
import kotlin.jvm.internal.SourceDebugExtension;
import kotlin.text.StringsKt;
import org.jetbrains.annotations.NotNull;
import t7.C3072d4;
import y2.a;
@Metadata
@SourceDebugExtension({"SMAP\nWebViewFragment.kt\nKotlin\n*S Kotlin\n*F\n+ 1 WebViewFragment.kt\ncom/crafto/android/ui/support/WebViewFragment\n+ 2 FragmentViewModelLazy.kt\nandroidx/fragment/app/FragmentViewModelLazyKt\n*L\n1#1,330:1\n106#2,15:331\n*S KotlinDebug\n*F\n+ 1 WebViewFragment.kt\ncom/crafto/android/ui/support/WebViewFragment\n*L\n66#1:331,15\n*E\n"})
public final class P extends AbstractC2254n<C3072d4> {
public int V1;
public String Y;
public String Z;
public WebView f2;
public String p1;
public PreferencesHelper x1;
@NotNull
public final Hk.k y1;
public static final class a extends WebViewClient {
public a() {
}
@Override
public final void onPageFinished(WebView webView, String str) {
ProgressBar progressBar;
ProgressBar progressBar2;
Intrinsics.checkNotNullParameter(webView, "view");
Intrinsics.checkNotNullParameter(str, Constants.KEY_URL);
super.onPageFinished(webView, str);
P p = P.this;
C3072d4 c3072d4 = (C3072d4) p.y;
if (c3072d4 != null && (progressBar2 = c3072d4.f) != null) {
progressBar2.setProgress(100);
}
C3072d4 c3072d42 = (C3072d4) p.y;
if (c3072d42 == null || (progressBar = c3072d42.e) == null) {
return;
}
X0.l(progressBar);
}
@Override
public final boolean shouldOverrideUrlLoading(WebView webView, String str) {
a.a aVar;
P p;
String stringExtra;
Intent intent;
Intrinsics.checkNotNullParameter(webView, "view");
Intrinsics.checkNotNullParameter(str, Constants.KEY_URL);
try {
com.crafto.android.ui.base.a.f0(P.this, "Log", "Webview", "About Us", str, "dlocal logs", 0, null, 992);
aVar = do.a.a;
aVar.c("shouldOverrideUrlLoading: url : " + str, new Object[0]);
String host = Uri.parse(str).getHost();
p = P.this;
if (host != null) {
if (!StringsKt.C(str, "tos", false) && !StringsKt.C(str, "privacy-policy", false) && !StringsKt.C(str, "pricing-and-refunds", false) && !StringsKt.C(str, "about-us", false)) {
if (Intrinsics.areEqual(p.p1, "Xendit Payment") || (!StringsKt.C(host, "kutumbapp.com", false) && !StringsKt.C(host, "primetrace.com", false) && !StringsKt.C(host, "crafto.app", false))) {
if (StringsKt.C(host, "send", false)) {
p.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
return true;
}
}
C2216g R = p.R();
AppCompatActivity a = Eb.E.a(p);
String str2 = p.Y;
R.getClass();
Intrinsics.checkNotNullParameter(a, "context");
if (str2 != null) {
Intent intent2 = new Intent();
intent2.setData(Uri.parse(str2));
intent = C2216g.w(R, a, intent2, false, true, null, 20);
} else {
intent = null;
}
if (intent != null) {
p.R().f(Eb.E.a(p), intent, true, null);
}
return true;
}
return false;
}
} catch (Exception e) {
do.a.a.e(e);
}
if (StringsKt.C(str, "https://pay.dlocal.com/gmf/mcallbacks", false)) {
FragmentActivity activity = p.getActivity();
Intent intent3 = activity != null ? activity.getIntent() : null;
FragmentActivity activity2 = p.getActivity();
if (activity2 != null) {
activity2.setResult(-1, intent3);
}
FragmentActivity activity3 = p.getActivity();
if (activity3 != null) {
activity3.onBackPressed();
}
return true;
}
if (kotlin.text.p.n(str, "intent://", false)) {
Intent parseUri = Intent.parseUri(str, 1);
if (parseUri == null || (stringExtra = parseUri.getStringExtra("browser_fallback_url")) == null) {
return false;
}
webView.loadUrl(stringExtra);
return true;
}
if (kotlin.text.p.n(str, "mailto:", false) || StringsKt.C(str, "facebook", false) || StringsKt.C(str, "play.google.com", false)) {
aVar.c("startsWith mailto", new Object[0]);
p.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
return true;
}
return false;
}
}
public static final class b extends Lambda implements Function0<Fragment> {
public final Fragment a;
public b(Fragment fragment) {
super(0);
this.a = fragment;
}
public final Object invoke() {
return this.a;
}
}
public static final class c extends Lambda implements Function0<y0> {
public final Function0 a;
public c(b bVar) {
super(0);
this.a = bVar;
}
public final Object invoke() {
return (y0) this.a.invoke();
}
}
public static final class d extends Lambda implements Function0<x0> {
public final Hk.k a;
public d(Hk.k kVar) {
super(0);
this.a = kVar;
}
public final Object invoke() {
return FragmentViewModelLazyKt.access$viewModels$lambda-1(this.a).getViewModelStore();
}
}
public static final class e extends Lambda implements Function0<y2.a> {
public final Hk.k a;
public e(Hk.k kVar) {
super(0);
this.a = kVar;
}
public final Object invoke() {
androidx.lifecycle.u uVar = FragmentViewModelLazyKt.access$viewModels$lambda-1(this.a);
androidx.lifecycle.u uVar2 = uVar instanceof androidx.lifecycle.u ? uVar : null;
return uVar2 != null ? uVar2.getDefaultViewModelCreationExtras() : a.a.b;
}
}
public static final class f extends Lambda implements Function0<v0.b> {
public final Fragment a;
public final Hk.k b;
public f(Fragment fragment, Hk.k kVar) {
super(0);
this.a = fragment;
this.b = kVar;
}
public final Object invoke() {
v0.b defaultViewModelProviderFactory;
androidx.lifecycle.u uVar = FragmentViewModelLazyKt.access$viewModels$lambda-1(this.b);
androidx.lifecycle.u uVar2 = uVar instanceof androidx.lifecycle.u ? uVar : null;
return (uVar2 == null || (defaultViewModelProviderFactory = uVar2.getDefaultViewModelProviderFactory()) == null) ? this.a.getDefaultViewModelProviderFactory() : defaultViewModelProviderFactory;
}
}
public P() {
Hk.k a2 = Hk.l.a(Hk.m.NONE, new c(new b(this)));
this.y1 = FragmentViewModelLazyKt.createViewModelLazy(this, Reflection.getOrCreateKotlinClass(T7.P.class), new d(a2), new e(a2), new f(this, a2));
}
@Override
public final i4.a J0(ViewGroup viewGroup) {
ConstraintLayout inflate = getLayoutInflater().inflate(2131558887, viewGroup, false);
int i = 2131362050;
Toolbar b2 = N4.e.b(2131362050, inflate);
if (b2 != null) {
i = 2131362583;
WebView webView = (WebView) N4.e.b(2131362583, inflate);
if (webView != null) {
i = 2131362741;
View b3 = N4.e.b(2131362741, inflate);
if (b3 != null) {
i = 2131363855;
ProgressBar progressBar = (ProgressBar) N4.e.b(2131363855, inflate);
if (progressBar != null) {
i = 2131364165;
ProgressBar progressBar2 = (ProgressBar) N4.e.b(2131364165, inflate);
if (progressBar2 != null) {
i = 2131365013;
if (N4.e.b(2131365013, inflate) != null) {
C3072d4 c3072d4 = new C3072d4(inflate, b2, webView, b3, progressBar, progressBar2);
Intrinsics.checkNotNullExpressionValue(c3072d4, "inflate(...)");
return c3072d4;
}
}
}
}
}
}
throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i)));
}
@Override
public final void N() {
do.a.a.c("location " + this.p1, new Object[0]);
if (Intrinsics.areEqual(this.p1, "Pix Payment") || Intrinsics.areEqual(this.p1, "Xendit Payment") || Intrinsics.areEqual(this.p1, "DLocale Payment")) {
P0();
}
}
public final void P0() {
MembershipPaymentData membershipPaymentData;
MembershipPaymentOrderData membershipPaymentOrderData;
String orderId;
MembershipPaymentData membershipPaymentData2;
MembershipPaymentOrderData membershipPaymentOrderData2;
MembershipPaymentData membershipPaymentData3;
String paymentMethod;
PreferencesHelper preferencesHelper = this.x1;
String str = null;
if (preferencesHelper == null) {
Intrinsics.throwUninitializedPropertyAccessException("preferencesHelper");
preferencesHelper = null;
}
User E = preferencesHelper.E();
if (E == null || (membershipPaymentData = E.getMembershipPaymentData()) == null || (membershipPaymentOrderData = membershipPaymentData.getMembershipPaymentOrderData()) == null || (orderId = membershipPaymentOrderData.getOrderId()) == null) {
return;
}
this.V1++;
PreferencesHelper preferencesHelper2 = this.x1;
if (preferencesHelper2 == null) {
Intrinsics.throwUninitializedPropertyAccessException("preferencesHelper");
preferencesHelper2 = null;
}
User E2 = preferencesHelper2.E();
if (E2 == null || (membershipPaymentData3 = E2.getMembershipPaymentData()) == null || (paymentMethod = membershipPaymentData3.getPaymentMethod()) == null) {
PreferencesHelper preferencesHelper3 = this.x1;
if (preferencesHelper3 == null) {
Intrinsics.throwUninitializedPropertyAccessException("preferencesHelper");
preferencesHelper3 = null;
}
User E3 = preferencesHelper3.E();
if (E3 != null && (membershipPaymentData2 = E3.getMembershipPaymentData()) != null && (membershipPaymentOrderData2 = membershipPaymentData2.getMembershipPaymentOrderData()) != null) {
str = membershipPaymentOrderData2.getPaymentMethod();
}
} else {
str = paymentMethod;
}
T7.P p = (T7.P) this.y1.getValue();
if (str == null) {
str = "";
}
p.getClass();
Intrinsics.checkNotNullParameter(orderId, "orderId");
Intrinsics.checkNotNullParameter(str, "pg");
Gb.f.a(p.b.getPaymentStatus(orderId, str, new HashMap<>()), new X(this, 3), new Function2() {
public final Object invoke(Object obj, Object obj2) {
ProgressBar progressBar;
Throwable th = (Throwable) obj;
P p2 = P.this;
Intrinsics.checkNotNullParameter(p2, "this$0");
Intrinsics.checkNotNullParameter(th, Constants.KEY_T);
Intrinsics.checkNotNullParameter((Db.a) obj2, "f");
do.a.a.e(th);
C3072d4 c3072d4 = (C3072d4) p2.y;
if (c3072d4 != null && (progressBar = c3072d4.e) != null) {
X0.l(progressBar);
}
return Unit.a;
}
}, false, 12);
}
public final boolean Q0() {
String country;
PreferencesHelper preferencesHelper = this.x1;
String str = null;
if (preferencesHelper == null) {
Intrinsics.throwUninitializedPropertyAccessException("preferencesHelper");
preferencesHelper = null;
}
User E = preferencesHelper.E();
if (E != null && (country = E.getCountry()) != null) {
str = country.toLowerCase(Locale.ROOT);
Intrinsics.checkNotNullExpressionValue(str, "toLowerCase(...)");
}
return B.O.c(a.e.L0, Locale.ROOT, "toLowerCase(...)", str);
}
@Override
public final int c0() {
return 2131558887;
}
@Override
public final void onCreate(Bundle bundle) {
f.B onBackPressedDispatcher;
FragmentActivity activity;
Resources resources;
ProgressBar progressBar;
try {
super.onCreate(bundle);
C3072d4 c3072d4 = (C3072d4) this.y;
if (c3072d4 != null && (progressBar = c3072d4.e) != null) {
X0.V(progressBar);
}
Bundle arguments = getArguments();
this.Y = (String) (arguments != null ? arguments.get("redirect_slug") : null);
Bundle arguments2 = getArguments();
this.Z = (String) (arguments2 != null ? arguments2.get("extra_title") : null);
Bundle arguments3 = getArguments();
this.p1 = (String) (arguments3 != null ? arguments3.get("location") : null);
String str = this.Z;
if (str != null && str.length() == 0 && (activity = getActivity()) != null && (resources = activity.getResources()) != null) {
resources.getString(2132017335);
}
FragmentActivity activity2 = getActivity();
if (activity2 == null || (onBackPressedDispatcher = activity2.getOnBackPressedDispatcher()) == null) {
return;
}
f.E.a(onBackPressedDispatcher, (androidx.lifecycle.I) null, new E0(this, 2), 3);
} catch (Exception e2) {
do.a.a.e(e2);
}
}
@Override
public final void onViewCreated(@NotNull final View view, Bundle bundle) {
WebView webView;
WebView webView2;
WebView webView3;
ActionBar actionBar;
ProgressBar progressBar;
Intrinsics.checkNotNullParameter(view, "view");
super.onViewCreated(view, bundle);
VB vb = this.y;
C3072d4 c3072d4 = (C3072d4) vb;
WebSettings webSettings = null;
this.f2 = c3072d4 != null ? c3072d4.c : null;
C3072d4 c3072d42 = (C3072d4) vb;
if (c3072d42 != null && (progressBar = c3072d42.e) != null) {
X0.V(progressBar);
}
try {
com.crafto.android.ui.base.a.B0(this, 2131100250);
C3072d4 c3072d43 = (C3072d4) this.y;
Toolbar toolbar = c3072d43 != null ? c3072d43.b : null;
if (toolbar != null) {
String str = this.Z;
if (str != null) {
toolbar.setTitle(str);
}
toolbar.setTitleTextColor(J1.a.getColor(toolbar.getContext(), 2131099943));
toolbar.setVisibility(0);
toolbar.setNavigationIcon(2131232483);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
P p = P.this;
Intrinsics.checkNotNullParameter(p, "this$0");
FragmentActivity activity = p.getActivity();
if (activity != null) {
activity.onBackPressed();
}
}
});
FragmentActivity activity = getActivity();
if (activity != null && (actionBar = activity.getActionBar()) != null) {
actionBar.setTitle("");
}
ViewGroup.LayoutParams layoutParams = toolbar.getLayoutParams();
ViewGroup.LayoutParams layoutParams2 = layoutParams instanceof AppBarLayout.LayoutParams ? (AppBarLayout.LayoutParams) layoutParams : null;
if (layoutParams2 != null) {
((AppBarLayout.LayoutParams) layoutParams2).a = 0;
}
if (layoutParams2 != null) {
toolbar.setLayoutParams(layoutParams2);
}
}
a aVar = new a();
C3072d4 c3072d44 = (C3072d4) this.y;
if (c3072d44 != null && (webView3 = c3072d44.c) != null) {
Intrinsics.checkNotNull(aVar, "null cannot be cast to non-null type android.webkit.WebViewClient");
webView3.setWebViewClient(aVar);
}
C3072d4 c3072d45 = (C3072d4) this.y;
if (c3072d45 != null && (webView2 = c3072d45.c) != null) {
webSettings = webView2.getSettings();
}
if (webSettings != null) {
webSettings.setDefaultFontSize(14);
}
if (webSettings != null) {
webSettings.setJavaScriptEnabled(true);
}
if (webSettings != null) {
webSettings.setDomStorageEnabled(true);
}
if (webSettings != null) {
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
}
if (webSettings != null) {
webSettings.setSupportMultipleWindows(true);
}
if (webSettings != null) {
webSettings.setMixedContentMode(0);
}
String str2 = this.Y;
if (str2 != null) {
do.a.a.c("mytag load ".concat(str2), new Object[0]);
C3072d4 c3072d46 = (C3072d4) this.y;
if (c3072d46 != null && (webView = c3072d46.c) != null) {
webView.loadUrl(str2);
}
}
} catch (Exception e2) {
do.a.a.e(e2);
}
AppCompatActivity requireActivity = requireActivity();
Intrinsics.checkNotNull(requireActivity, "null cannot be cast to non-null type androidx.appcompat.app.AppCompatActivity");
s0.a(requireActivity.getWindow(), false);
view.post(new Runnable() {
@Override
public final void run() {
View view2 = view;
Intrinsics.checkNotNullParameter(view2, "$view");
X0.a(view2, 0, 2);
}
});
}
@Override
public final String y0() {
return "Webview";
}
@Override
public final void a0() {
}
}