ChatOn v1.35.366360版本的 MD5 值为:cde28447b38d5467efa95e48e7076155
以下内容为反编译后的 a.java 源代码,内容仅作参考
package com.aiby.feature_html_webview.presentation;
import android.net.Uri;
import android.net.http.SslError;
import android.util.Log;
import android.webkit.SslErrorHandler;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import androidx.activity.h;
import androidx.lifecycle.SavedStateHandle;
import androidx.lifecycle.ViewModelKt;
import bc.g;
import bc.p;
import bc.s;
import com.aiby.feature_html_webview.analytics.Placement;
import com.aiby.feature_html_webview.presentation.model.HtmlType;
import com.google.android.gms.internal.consent_sdk.zzg;
import com.itextpdf.text.Annotation;
import com.itextpdf.text.pdf.PdfObject;
import com.itextpdf.text.xml.xmp.DublinCoreProperties;
import ec.o6;
import j2.d;
import j2.e;
import j2.f;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.q;
import x3.c;
import y3.k;
import y3.l;
import y3.m;
import y3.n;
import y3.o;
import y3.r;
import y3.t;
import y3.u;
public final class a extends WebViewClient {
public final int f3802a = 1;
public final Object f3803b;
public a(p pVar) {
this.f3803b = pVar;
}
public a(HtmlWebViewFragment htmlWebViewFragment) {
this.f3803b = htmlWebViewFragment;
}
@Override
public final void onLoadResource(WebView webView, String str) {
switch (this.f3802a) {
case 1:
p pVar = (p) this.f3803b;
int i10 = p.f1960n;
if (str == null || !str.startsWith("consent://")) {
return;
}
pVar.f1962e.d(str);
return;
default:
super.onLoadResource(webView, str);
return;
}
}
@Override
public final void onPageFinished(WebView webView, String url) {
int i10 = this.f3802a;
Object obj = this.f3803b;
switch (i10) {
case 0:
Intrinsics.checkNotNullParameter(url, "url");
b i11 = ((HtmlWebViewFragment) obj).i();
i11.getClass();
Intrinsics.checkNotNullParameter(url, "url");
km.b.f14012a.getClass();
km.a.b(new Object[0]);
i11.d(new c(new y3.a(h.m(new StringBuilder("javascript:WebViewDataInterface.onInjectData(JSON.stringify("), i11.f3807i.f19287a, "));"))));
return;
default:
p pVar = (p) obj;
if (pVar.f1963i) {
return;
}
Log.d("UserMessagingPlatform", "Wall html loaded.");
pVar.f1963i = true;
return;
}
}
@Override
public final void onReceivedError(WebView webView, int i10, String str, String str2) {
switch (this.f3802a) {
case 1:
s sVar = ((p) this.f3803b).f1962e;
sVar.getClass();
zzg zzgVar = new zzg(2, String.format(Locale.US, "WebResourceError(%d, %s): %s", Integer.valueOf(i10), str2, str));
g gVar = (g) ((bc.h) sVar.f1985y).f1926i.getAndSet(null);
if (gVar == null) {
return;
}
gVar.b(zzgVar.a());
return;
default:
super.onReceivedError(webView, i10, str, str2);
return;
}
}
@Override
public final void onReceivedError(WebView webView, WebResourceRequest request, WebResourceError error) {
switch (this.f3802a) {
case 0:
Intrinsics.checkNotNullParameter(request, "request");
Intrinsics.checkNotNullParameter(error, "error");
super.onReceivedError(webView, request, error);
String uri = request.getUrl().toString();
Intrinsics.checkNotNullExpressionValue(uri, "toString(...)");
if (q.p(uri, "favicon.ico", false)) {
return;
}
b i10 = ((HtmlWebViewFragment) this.f3803b).i();
String url = request.getUrl().toString();
Intrinsics.checkNotNullExpressionValue(url, "toString(...)");
int errorCode = error.getErrorCode();
CharSequence description = error.getDescription();
Intrinsics.checkNotNullExpressionValue(description, "getDescription(...)");
i10.getClass();
Intrinsics.checkNotNullParameter(url, "url");
Intrinsics.checkNotNullParameter(description, "description");
q3.a aVar = i10.f3805g;
aVar.getClass();
Intrinsics.checkNotNullParameter(url, "url");
Intrinsics.checkNotNullParameter(description, "description");
x6.a aVar2 = new x6.a("received_error");
x6.a.c(aVar2, Annotation.URL, url);
x6.a.c(aVar2, "error_code", String.valueOf(errorCode));
x6.a.c(aVar2, DublinCoreProperties.DESCRIPTION, description.toString());
((u6.c) aVar.f18405a).c(aVar2);
return;
default:
super.onReceivedError(webView, request, error);
return;
}
}
@Override
public final void onReceivedHttpError(WebView webView, WebResourceRequest request, WebResourceResponse errorResponse) {
switch (this.f3802a) {
case 0:
Intrinsics.checkNotNullParameter(request, "request");
Intrinsics.checkNotNullParameter(errorResponse, "errorResponse");
b i10 = ((HtmlWebViewFragment) this.f3803b).i();
String url = request.getUrl().toString();
Intrinsics.checkNotNullExpressionValue(url, "toString(...)");
int statusCode = errorResponse.getStatusCode();
String reasonPhrase = errorResponse.getReasonPhrase();
Intrinsics.checkNotNullExpressionValue(reasonPhrase, "getReasonPhrase(...)");
i10.getClass();
Intrinsics.checkNotNullParameter(url, "url");
Intrinsics.checkNotNullParameter(reasonPhrase, "reasonPhrase");
q3.a aVar = i10.f3805g;
aVar.getClass();
Intrinsics.checkNotNullParameter(url, "url");
Intrinsics.checkNotNullParameter(reasonPhrase, "reasonPhrase");
x6.a aVar2 = new x6.a("received_http_error");
x6.a.c(aVar2, Annotation.URL, url);
x6.a.c(aVar2, "statusCode", String.valueOf(statusCode));
x6.a.c(aVar2, "reasonPhrase", reasonPhrase.toString());
((u6.c) aVar.f18405a).c(aVar2);
return;
default:
super.onReceivedHttpError(webView, request, errorResponse);
return;
}
}
@Override
public final void onReceivedSslError(WebView webView, SslErrorHandler handler, SslError error) {
switch (this.f3802a) {
case 0:
Intrinsics.checkNotNullParameter(handler, "handler");
Intrinsics.checkNotNullParameter(error, "error");
super.onReceivedSslError(webView, handler, error);
b i10 = ((HtmlWebViewFragment) this.f3803b).i();
String url = error.getUrl();
Intrinsics.checkNotNullExpressionValue(url, "getUrl(...)");
int primaryError = error.getPrimaryError();
i10.getClass();
Intrinsics.checkNotNullParameter(url, "url");
q3.a aVar = i10.f3805g;
aVar.getClass();
Intrinsics.checkNotNullParameter(url, "url");
x6.a aVar2 = new x6.a("received_ssl_error");
x6.a.c(aVar2, Annotation.URL, url);
x6.a.c(aVar2, "primaryError", String.valueOf(primaryError));
((u6.c) aVar.f18405a).c(aVar2);
return;
default:
super.onReceivedSslError(webView, handler, error);
return;
}
}
@Override
public final WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
WebResourceResponse webResourceResponse;
switch (this.f3802a) {
case 0:
Intrinsics.checkNotNullParameter(view, "view");
Intrinsics.checkNotNullParameter(request, "request");
Uri url = request.getUrl();
Iterator it = ((f) ((HtmlWebViewFragment) this.f3803b).f3783v.getValue()).f13344a.iterator();
while (true) {
webResourceResponse = null;
r1 = null;
r1 = null;
r1 = null;
d dVar = null;
if (it.hasNext()) {
e eVar = (e) it.next();
eVar.getClass();
boolean equals = url.getScheme().equals("http");
String str = eVar.f13342c;
if ((!equals || eVar.f13340a) && ((url.getScheme().equals("http") || url.getScheme().equals("https")) && url.getAuthority().equals(eVar.f13341b) && url.getPath().startsWith(str))) {
dVar = eVar.f13343d;
}
if (dVar != null && (webResourceResponse = dVar.a(url.getPath().replaceFirst(str, PdfObject.NOTHING))) != null) {
}
}
}
return webResourceResponse;
default:
return super.shouldInterceptRequest(view, request);
}
}
@Override
public final boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest request) {
String uri;
o6 rVar;
o6 tVar;
int i10 = this.f3802a;
Object obj = this.f3803b;
switch (i10) {
case 0:
Intrinsics.checkNotNullParameter(request, "request");
b i11 = ((HtmlWebViewFragment) obj).i();
Uri uri2 = request.getUrl();
Intrinsics.checkNotNullExpressionValue(uri2, "getUrl(...)");
i11.getClass();
Intrinsics.checkNotNullParameter(uri2, "uri");
km.a aVar = km.b.f14012a;
Objects.toString(uri2);
aVar.getClass();
km.a.b(new Object[0]);
((r3.b) i11.f3806h).getClass();
Intrinsics.checkNotNullParameter(uri2, "uri");
String scheme = uri2.getScheme();
String str = PdfObject.NOTHING;
if (scheme == null) {
scheme = PdfObject.NOTHING;
}
String authority = uri2.getAuthority();
if (authority == null) {
authority = PdfObject.NOTHING;
}
List<String> list = r3.b.f18989a;
boolean z8 = list instanceof Collection;
if (!z8 || !list.isEmpty()) {
for (String str2 : list) {
if (kotlin.text.p.n(str2, scheme, false)) {
Intrinsics.checkNotNullParameter(uri2, "uri");
uri = uri2.toString();
Intrinsics.checkNotNullExpressionValue(uri, "toString(...)");
if (!q.p(uri, "statistic", false)) {
String queryParameter = uri2.getQueryParameter("amplitude_event_name");
if (queryParameter == null) {
queryParameter = PdfObject.NOTHING;
}
switch (queryParameter.hashCode()) {
case -1906855888:
if (queryParameter.equals("banner_show")) {
String queryParameter2 = uri2.getQueryParameter("banner_id");
if (queryParameter2 != null) {
str = queryParameter2;
}
tVar = new l(str);
break;
}
rVar = new y3.p(queryParameter);
tVar = rVar;
break;
case -1404661674:
if (queryParameter.equals("subscription_close")) {
String queryParameter3 = uri2.getQueryParameter("banner_id");
if (queryParameter3 != null) {
str = queryParameter3;
}
tVar = new k(str);
break;
}
rVar = new y3.p(queryParameter);
tVar = rVar;
break;
case -775062836:
if (queryParameter.equals("onboarding_screen_show")) {
String queryParameter4 = uri2.getQueryParameter("step");
if (queryParameter4 == null) {
queryParameter4 = PdfObject.NOTHING;
}
String queryParameter5 = uri2.getQueryParameter("banner_id");
if (queryParameter5 != null) {
str = queryParameter5;
}
tVar = new m(queryParameter4, str);
break;
}
rVar = new y3.p(queryParameter);
tVar = rVar;
break;
case 241028579:
if (queryParameter.equals("subscription_purchase")) {
String queryParameter6 = uri2.getQueryParameter("banner_id");
if (queryParameter6 == null) {
queryParameter6 = PdfObject.NOTHING;
}
String queryParameter7 = uri2.getQueryParameter("product_id");
if (queryParameter7 != null) {
str = queryParameter7;
}
tVar = new o(queryParameter6, str);
break;
}
rVar = new y3.p(queryParameter);
tVar = rVar;
break;
case 266327089:
if (queryParameter.equals("subscription_tap_product")) {
String queryParameter8 = uri2.getQueryParameter("banner_id");
if (queryParameter8 == null) {
queryParameter8 = PdfObject.NOTHING;
}
String queryParameter9 = uri2.getQueryParameter("product_id");
if (queryParameter9 != null) {
str = queryParameter9;
}
tVar = new n(queryParameter8, str);
break;
}
rVar = new y3.p(queryParameter);
tVar = rVar;
break;
case 1002352421:
if (queryParameter.equals("banner_close")) {
String queryParameter10 = uri2.getQueryParameter("banner_id");
if (queryParameter10 != null) {
str = queryParameter10;
}
tVar = new k(str);
break;
}
rVar = new y3.p(queryParameter);
tVar = rVar;
break;
case 1202087135:
if (queryParameter.equals("subscription_show")) {
String queryParameter11 = uri2.getQueryParameter("banner_id");
if (queryParameter11 != null) {
str = queryParameter11;
}
tVar = new l(str);
break;
}
rVar = new y3.p(queryParameter);
tVar = rVar;
break;
default:
rVar = new y3.p(queryParameter);
tVar = rVar;
break;
}
} else {
if (q.p(uri, "open", false)) {
String queryParameter12 = uri2.getQueryParameter("path");
if (queryParameter12 == null) {
queryParameter12 = PdfObject.NOTHING;
}
if (queryParameter12.length() > 0) {
String queryParameter13 = Uri.parse(queryParameter12).getQueryParameter("popup");
if (queryParameter13 != null) {
str = queryParameter13;
}
rVar = new y3.s(queryParameter12, str);
} else {
String uri3 = uri2.toString();
Intrinsics.checkNotNullExpressionValue(uri3, "toString(...)");
tVar = new t(uri3);
}
} else {
rVar = new r(uri);
}
tVar = rVar;
}
km.a aVar2 = km.b.f14012a;
uri2.toString();
tVar.toString();
aVar2.getClass();
km.a.b(new Object[0]);
if (!(tVar instanceof y3.q)) {
y3.q qVar = (y3.q) tVar;
boolean z10 = qVar instanceof m;
q3.a aVar3 = i11.f3805g;
if (z10) {
m mVar = (m) tVar;
aVar3.getClass();
String step = mVar.f21410a;
Intrinsics.checkNotNullParameter(step, "step");
String onboardingId = mVar.f21411b;
Intrinsics.checkNotNullParameter(onboardingId, "onboardingId");
x6.a aVar4 = new x6.a("onboarding_screen_show");
x6.a.c(aVar4, "step", step);
x6.a.c(aVar4, "onboarding_id", onboardingId);
((u6.c) aVar3.f18405a).c(aVar4);
} else {
boolean z11 = qVar instanceof l;
SavedStateHandle savedStateHandle = i11.f3804f;
if (z11) {
String type = b.h(savedStateHandle);
l lVar = (l) tVar;
Placement placement = i11.g().f20991b;
Boolean bool = (Boolean) savedStateHandle.get("is_embedded_banner_saved_state_key");
boolean booleanValue = bool != null ? bool.booleanValue() : false;
String placement2 = placement.f3750d;
if (booleanValue) {
placement2 = h.j(placement2, "_nat");
}
aVar3.getClass();
Intrinsics.checkNotNullParameter(type, "type");
String bannerId = lVar.f21409a;
Intrinsics.checkNotNullParameter(bannerId, "bannerId");
Intrinsics.checkNotNullParameter(placement2, "placement");
x6.a aVar5 = new x6.a("subscription_show");
x6.a.c(aVar5, DublinCoreProperties.TYPE, type);
x6.a.c(aVar5, "id", bannerId);
x6.a.c(aVar5, "placement", placement2);
((u6.c) aVar3.f18405a).c(aVar5);
} else if (qVar instanceof k) {
String type2 = b.h(savedStateHandle);
aVar3.getClass();
Intrinsics.checkNotNullParameter(type2, "type");
String bannerId2 = ((k) tVar).f21408a;
Intrinsics.checkNotNullParameter(bannerId2, "bannerId");
x6.a aVar6 = new x6.a("subscription_close");
x6.a.c(aVar6, DublinCoreProperties.TYPE, type2);
x6.a.c(aVar6, "id", bannerId2);
((u6.c) aVar3.f18405a).c(aVar6);
if (i11.g().f20990a == HtmlType.ONBOARDING) {
i11.d(x3.e.f20996a);
} else {
i11.d(new x3.b(false));
}
} else if (qVar instanceof o) {
ec.s.h(ViewModelKt.getViewModelScope(i11), null, new HtmlWebViewViewModel$handleWebViewCallbackAction$1(i11, tVar, null), 3);
} else if (qVar instanceof n) {
n nVar = (n) tVar;
aVar3.getClass();
String bannerId3 = nVar.f21412a;
Intrinsics.checkNotNullParameter(bannerId3, "bannerId");
String productId = nVar.f21413b;
Intrinsics.checkNotNullParameter(productId, "productId");
x6.a aVar7 = new x6.a("subscription_tap_product");
x6.a.c(aVar7, "id", bannerId3);
x6.a.c(aVar7, "product_id", productId);
((u6.c) aVar3.f18405a).c(aVar7);
}
}
} else if (tVar instanceof u) {
u uVar = (u) tVar;
if (uVar instanceof y3.s) {
i11.d(new x3.f(((y3.s) tVar).f21418a));
} else {
boolean z12 = uVar instanceof t;
}
} else {
boolean z13 = tVar instanceof r;
}
return true;
}
}
}
if (z8 && list.isEmpty()) {
return false;
}
for (String str3 : list) {
if (q.p(str3, authority, false)) {
Intrinsics.checkNotNullParameter(uri2, "uri");
uri = uri2.toString();
Intrinsics.checkNotNullExpressionValue(uri, "toString(...)");
if (!q.p(uri, "statistic", false)) {
}
km.a aVar22 = km.b.f14012a;
uri2.toString();
tVar.toString();
aVar22.getClass();
km.a.b(new Object[0]);
if (!(tVar instanceof y3.q)) {
}
return true;
}
}
return false;
default:
String uri4 = request.getUrl().toString();
p pVar = (p) obj;
int i12 = p.f1960n;
if (uri4 == null || !uri4.startsWith("consent://")) {
return false;
}
pVar.f1962e.d(uri4);
return true;
}
}
@Override
public final boolean shouldOverrideUrlLoading(WebView webView, String str) {
switch (this.f3802a) {
case 1:
p pVar = (p) this.f3803b;
int i10 = p.f1960n;
if (str == null || !str.startsWith("consent://")) {
return false;
}
pVar.f1962e.d(str);
return true;
default:
return super.shouldOverrideUrlLoading(webView, str);
}
}
}