PhotoRoom v4.8.2版本的 MD5 值为:c40a01bb3380c0f75c0cb6ac6760f295
以下内容为反编译后的 a.java 源代码,内容仅作参考
package com.photoroom.features.login.ui;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.webkit.WebResourceRequest;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.s;
import b10.o0;
import bu.j1;
import bu.r;
import com.appboy.Constants;
import g1.n;
import hy.l;
import hy.p;
import java.util.List;
import kotlin.Metadata;
import kotlin.coroutines.jvm.internal.m;
import kotlin.jvm.internal.k;
import kotlin.jvm.internal.t;
import kotlin.jvm.internal.v;
import kotlin.text.x;
import kotlin.text.y;
import lu.a0;
import lu.u0;
import px.f1;
import px.n0;
import t50.a;
import ux.d;
import vm.a2;
@n
@Metadata(d1 = {"\u0000b\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\f\b\u0007\u0018\u0000 52\u00020\u0001:\u00016B\u0007¢\u0006\u0004\b3\u00104J\b\u0010\u0003\u001a\u00020\u0002H\u0003J$\u0010\u000b\u001a\u00020\n2\u0006\u0010\u0005\u001a\u00020\u00042\b\u0010\u0007\u001a\u0004\u0018\u00010\u00062\b\u0010\t\u001a\u0004\u0018\u00010\bH\u0016J\b\u0010\f\u001a\u00020\u0002H\u0016J\u001a\u0010\u000e\u001a\u00020\u00022\u0006\u0010\r\u001a\u00020\n2\b\u0010\t\u001a\u0004\u0018\u00010\bH\u0016J\u0010\u0010\u0011\u001a\u00020\u00022\u0006\u0010\u0010\u001a\u00020\u000fH\u0016J\u0012\u0010\u0013\u001a\u00020\u00122\b\u0010\t\u001a\u0004\u0018\u00010\bH\u0016R\u0018\u0010\u0017\u001a\u0004\u0018\u00010\u00148\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u0015\u0010\u0016R*\u0010\u001d\u001a\u0016\u0012\u0004\u0012\u00020\u0019\u0012\u0004\u0012\u00020\u0002\u0018\u00010\u0018j\u0004\u0018\u0001`\u001a8\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u001b\u0010\u001cR\u0016\u0010 \u001a\u00020\u00198\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u001e\u0010\u001fR\u0016\u0010\"\u001a\u00020\u00198\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b!\u0010\u001fR0\u0010*\u001a\u0010\u0012\u0004\u0012\u00020\u0002\u0018\u00010#j\u0004\u0018\u0001`$8\u0006@\u0006X\u0086\u000e¢\u0006\u0012\n\u0004\b\u0013\u0010%\u001a\u0004\b&\u0010'\"\u0004\b(\u0010)R0\u0010/\u001a\u0010\u0012\u0004\u0012\u00020\u0002\u0018\u00010#j\u0004\u0018\u0001`+8\u0006@\u0006X\u0086\u000e¢\u0006\u0012\n\u0004\b,\u0010%\u001a\u0004\b-\u0010'\"\u0004\b.\u0010)R\u0014\u00102\u001a\u00020\u00148BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b0\u00101¨\u00067"}, d2 = {"Lcom/photoroom/features/login/ui/a;", "Lcom/google/android/material/bottomsheet/b;", "Lpx/f1;", "e0", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/os/Bundle;", "savedInstanceState", "Landroid/view/View;", "onCreateView", "onDestroy", "view", "onViewCreated", "Landroid/content/DialogInterface;", "dialog", "onDismiss", "Landroid/app/Dialog;", "K", "Lvm/a2;", "G", "Lvm/a2;", "_binding", "Lkotlin/Function1;", "", "Lcom/photoroom/features/login/ui/OnUserSigned;", "H", "Lhy/l;", "onUserSigned", "I", "Ljava/lang/String;", "hash", "J", "appleAuthCode", "Lkotlin/Function0;", "Lcom/photoroom/features/login/ui/OnAppleSignInDismiss;", "Lhy/a;", "getOnAppleSignInDismiss", "()Lhy/a;", "f0", "(Lhy/a;)V", "onAppleSignInDismiss", "Lcom/photoroom/features/login/ui/OnAppleSignInError;", "X", "d0", "g0", "onAppleSignInError", "c0", "()Lvm/a2;", "binding", "<init>", "()V", "Y", Constants.APPBOY_PUSH_CONTENT_KEY, "app_release"}, k = 1, mv = {1, 9, 0})
public final class a extends com.google.android.material.bottomsheet.b {
public static final C0554a Y = new C0554a(null);
public static final int Z = 8;
private a2 G;
private l H;
private String I = "";
private String J = "";
private hy.a K;
private hy.a X;
public static final class C0554a {
private C0554a() {
}
public C0554a(k kVar) {
this();
}
public final a a(String hash, l onUserSigned) {
t.i(hash, "hash");
t.i(onUserSigned, "onUserSigned");
a aVar = new a();
aVar.I = hash;
aVar.H = onUserSigned;
return aVar;
}
}
public static final class b extends v implements p {
b() {
super(2);
}
public final void a(androidx.core.graphics.b insets, int i11) {
List e11;
t.i(insets, "insets");
e11 = kotlin.collections.t.e(a.this.c0().getRoot());
j1.d(insets, null, null, e11, 3, null);
}
@Override
public Object invoke(Object obj, Object obj2) {
a((androidx.core.graphics.b) obj, ((Number) obj2).intValue());
return f1.f64673a;
}
}
public static final class c extends WebViewClient {
static final class C0555a extends m implements p {
int f35560h;
final a f35561i;
C0555a(a aVar, d dVar) {
super(2, dVar);
this.f35561i = aVar;
}
@Override
public final d create(Object obj, d dVar) {
return new C0555a(this.f35561i, dVar);
}
@Override
public final Object invoke(o0 o0Var, d dVar) {
return ((C0555a) create(o0Var, dVar)).invokeSuspend(f1.f64673a);
}
@Override
public final Object invokeSuspend(Object obj) {
vx.d.e();
if (this.f35560h == 0) {
n0.b(obj);
this.f35561i.F();
return f1.f64673a;
}
throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
}
}
c() {
}
private final void a(String str) {
Uri parse = Uri.parse(str);
if (!t.d(parse.getQueryParameter("success"), "true")) {
hy.a d02 = a.this.d0();
if (d02 != null) {
d02.invoke();
return;
}
return;
}
a aVar = a.this;
String queryParameter = parse.getQueryParameter("idt");
if (queryParameter == null) {
queryParameter = "";
}
aVar.J = queryParameter;
a.C2342a c2342a = t50.a.f72680a;
String str2 = a.this.J;
c2342a.a("Apple Code: + " + str2, new Object[0]);
l lVar = a.this.H;
if (lVar != null) {
lVar.invoke(a.this.J);
}
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
boolean H;
boolean M;
H = x.H(String.valueOf(webResourceRequest != null ? webResourceRequest.getUrl() : null), "https://www.photoroom.com/apple-auth-redirect", false, 2, null);
if (H) {
a(String.valueOf(webResourceRequest != null ? webResourceRequest.getUrl() : null));
M = y.M(String.valueOf(webResourceRequest != null ? webResourceRequest.getUrl() : null), "success=", false, 2, null);
if (M) {
a aVar = a.this;
a0.a(aVar, new C0555a(aVar, null));
return true;
}
return true;
}
return false;
}
}
public final a2 c0() {
a2 a2Var = this.G;
t.f(a2Var);
return a2Var;
}
private final void e0() {
int w11;
ConstraintLayout root = c0().getRoot();
t.h(root, "getRoot(...)");
Window window = requireActivity().getWindow();
t.h(window, "getWindow(...)");
j1.f(root, window, new b());
ViewGroup.LayoutParams layoutParams = c0().f76519b.getLayoutParams();
ConstraintLayout.b bVar = layoutParams instanceof ConstraintLayout.b ? (ConstraintLayout.b) layoutParams : null;
if (bVar != null) {
s activity = getActivity();
if (activity != null) {
t.f(activity);
w11 = u0.x(activity);
} else {
w11 = u0.w(720);
}
((ViewGroup.MarginLayoutParams) bVar).height = (int) (w11 * 0.6f);
}
c0().f76519b.setVerticalScrollBarEnabled(false);
c0().f76519b.setHorizontalScrollBarEnabled(false);
c0().f76519b.getSettings().setJavaScriptEnabled(true);
c0().f76519b.setWebViewClient(new c());
c0().f76519b.loadUrl("https://www.photoroom.com/apple_signin/");
}
@Override
public Dialog K(Bundle bundle) {
Context requireContext = requireContext();
t.h(requireContext, "requireContext(...)");
return r.b(requireContext, 0, 2, null);
}
public final hy.a d0() {
return this.X;
}
public final void f0(hy.a aVar) {
this.K = aVar;
}
public final void g0(hy.a aVar) {
this.X = aVar;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup viewGroup, Bundle bundle) {
t.i(inflater, "inflater");
this.G = a2.c(inflater, viewGroup, false);
ConstraintLayout root = c0().getRoot();
t.h(root, "getRoot(...)");
return root;
}
@Override
public void onDestroy() {
super.onDestroy();
this.G = null;
}
@Override
public void onDismiss(DialogInterface dialog) {
t.i(dialog, "dialog");
super.onDismiss(dialog);
hy.a aVar = this.K;
if (aVar != null) {
aVar.invoke();
}
}
@Override
public void onViewCreated(View view, Bundle bundle) {
t.i(view, "view");
super.onViewCreated(view, bundle);
e0();
}
}