soul-browser/sources/java/com/google/android/gms/internal/ads/zzciq.java
KaKi87 550ddb0413
Decompile and recreate Soul Browser v1.4.85 with APK CI builds (#1)
* Decompile and recreate Soul Browser v1.4.85 with APK CI builds

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Fix CI build: include bundled google.jks and remove PR trigger

The apktool build failed in CI because app/unknown/.../google.jks was
excluded by the *.jks gitignore rule. Whitelist app-bundled JKS files
and commit the missing resource.

Also remove the redundant pull_request workflow trigger.

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Change package ID to com.github.kaki87.soulbrowser

Rename the application ID so the rebuilt APK can be installed
alongside the original Soul Browser from Google Play.

- Update AndroidManifest package, permissions, providers, and actions
- Update R class references in smali (com/github/kaki87/soulbrowser/R)
- Update shortcuts.xml targetPackage
- Rename app label to "Soul Rebuild" for easy identification

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Fix install compatibility: remove split APK metadata and bundle native libs

The rebuilt APK still declared requiredSplitTypes and Play Store split
metadata, causing Android to reject standalone installs as incompatible.

- Remove requiredSplitTypes and split-related manifest meta-data
- Merge native libs from all ABI splits with uncompressed storage
- Page-align before signing for extractNativeLibs=false
- Add .so to apktool doNotCompress list

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Fix install failure: use apksigner v2/v3 and bundle arm64 native libs

Target SDK 36 requires APK Signature Scheme v2+, but jarsigner only
produces v1 signatures, causing Android to reject the install.

- Sign with apksigner (v1+v2+v3) instead of jarsigner
- Add arm64-v8a native libraries from universal Soul Browser 1.4.79
- Set extractNativeLibs=true for reliable sideload installs
- Commit stable debug keystore for consistent signatures across builds

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Add committed debug keystore for consistent APK signatures

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Fix startup crash: use original classes2.dex desugar libraries

Apktool recompiles smali_classes2 into a broken classes2.dex, causing
ClassNotFoundException for j$.com.android.tools.r8.a at ML Kit init.

Inject the original classes2.dex (Java 8+ desugar libs) after apktool
build instead of using the recompiled version.

Co-authored-by: KaKi87 <KaKi87@pm.me>

* Fix missing drawable resources from density split APKs

The base APK is an app bundle module; density-specific drawables like
seek_thumb_nor_b live in config.xhdpi.apk and were missing after rebuild,
causing Resources$NotFoundException at runtime.

- Merge non-9-patch resources from split APKs before apktool build
- Sync public.xml IDs from R smali only when backing files exist
- Add 713 density-specific resource IDs to public.xml

Co-authored-by: KaKi87 <KaKi87@pm.me>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-08-10 16:07:14 +02:00

278 lines
13 KiB
Java

package com.google.android.gms.internal.ads;
import android.R;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.os.Message;
import android.support.v4.media.session.PlaybackStateCompat;
import android.view.View;
import android.view.WindowManager;
import android.webkit.ConsoleMessage;
import android.webkit.JsPromptResult;
import android.webkit.JsResult;
import android.webkit.WebChromeClient;
import android.webkit.WebStorage;
import android.webkit.WebView;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
/* loaded from: classes.dex */
public final class zzciq extends WebChromeClient {
/* renamed from: a, reason: collision with root package name */
public final zzcjn f5181a;
public zzciq(zzcjn zzcjnVar) {
this.f5181a = zzcjnVar;
}
/* JADX WARN: Multi-variable type inference failed */
public static final Context b(WebView webView) {
if (!(webView instanceof zzcir)) {
return webView.getContext();
}
zzcir zzcirVar = (zzcir) webView;
Activity zzj = zzcirVar.zzj();
if (zzj != null) {
return zzj;
}
return zzcirVar.getContext();
}
public final boolean a(Context context, String str, String str2, String str3, String str4, JsResult jsResult, JsPromptResult jsPromptResult, boolean z) {
com.google.android.gms.ads.internal.zzb zzbVar;
try {
zzcjn zzcjnVar = this.f5181a;
if (zzcjnVar != null && zzcjnVar.D() != null && zzcjnVar.D().A != null && (zzbVar = zzcjnVar.D().A) != null && !zzbVar.zzb()) {
StringBuilder sb = new StringBuilder(str.length() + 9 + String.valueOf(str3).length() + 2);
sb.append("window.");
sb.append(str);
sb.append("('");
sb.append(str3);
sb.append("')");
zzbVar.zzc(sb.toString());
return false;
}
com.google.android.gms.ads.internal.zzt.zzc();
AlertDialog.Builder zzP = com.google.android.gms.ads.internal.util.zzs.zzP(context);
zzP.setTitle(str2);
if (z) {
LinearLayout linearLayout = new LinearLayout(context);
linearLayout.setOrientation(1);
TextView textView = new TextView(context);
textView.setText(str3);
EditText editText = new EditText(context);
editText.setText(str4);
linearLayout.addView(textView);
linearLayout.addView(editText);
zzP.setView(linearLayout).setPositiveButton(R.string.ok, new zzcio(jsPromptResult, editText)).setNegativeButton(R.string.cancel, new zzcin(jsPromptResult)).setOnCancelListener(new zzcim(jsPromptResult)).create().show();
return true;
}
zzP.setMessage(str3).setPositiveButton(R.string.ok, new zzcil(jsResult)).setNegativeButton(R.string.cancel, new zzcik(jsResult)).setOnCancelListener(new zzcij(jsResult)).create().show();
return true;
} catch (WindowManager.BadTokenException e) {
int i = com.google.android.gms.ads.internal.util.zze.zza;
com.google.android.gms.ads.internal.util.client.zzo.zzj("Fail to display Dialog.", e);
return true;
}
}
/* JADX WARN: Multi-variable type inference failed */
@Override // android.webkit.WebChromeClient
public final void onCloseWindow(WebView webView) {
if (!(webView instanceof zzcir)) {
int i = com.google.android.gms.ads.internal.util.zze.zza;
com.google.android.gms.ads.internal.util.client.zzo.zzi("Tried to close a WebView that wasn't an AdWebView.");
return;
}
com.google.android.gms.ads.internal.overlay.zzm zzL = ((zzcir) webView).zzL();
if (zzL == null) {
int i2 = com.google.android.gms.ads.internal.util.zze.zza;
com.google.android.gms.ads.internal.util.client.zzo.zzi("Tried to close an AdWebView not associated with an overlay.");
} else {
zzL.zzb();
}
}
@Override // android.webkit.WebChromeClient
public final boolean onConsoleMessage(ConsoleMessage consoleMessage) {
String message = consoleMessage.message();
String sourceId = consoleMessage.sourceId();
int lineNumber = consoleMessage.lineNumber();
int length = String.valueOf(message).length();
StringBuilder sb = new StringBuilder(android.support.v4.media.a.b(length + 6 + String.valueOf(sourceId).length(), 1, String.valueOf(lineNumber).length(), 1));
android.support.v4.media.a.z(sb, "JS: ", message, " (", sourceId);
String t = androidx.work.impl.workers.a.t(sb, ":", lineNumber, ")");
if (t.contains("Application Cache")) {
return super.onConsoleMessage(consoleMessage);
}
int i = zzcip.f5180a[consoleMessage.messageLevel().ordinal()];
if (i != 1) {
if (i != 2) {
if (i != 3 && i != 4) {
if (i != 5) {
int i2 = com.google.android.gms.ads.internal.util.zze.zza;
com.google.android.gms.ads.internal.util.client.zzo.zzh(t);
} else {
int i3 = com.google.android.gms.ads.internal.util.zze.zza;
com.google.android.gms.ads.internal.util.client.zzo.zzd(t);
}
} else {
int i4 = com.google.android.gms.ads.internal.util.zze.zza;
com.google.android.gms.ads.internal.util.client.zzo.zzh(t);
}
} else {
int i5 = com.google.android.gms.ads.internal.util.zze.zza;
com.google.android.gms.ads.internal.util.client.zzo.zzi(t);
}
} else {
int i6 = com.google.android.gms.ads.internal.util.zze.zza;
com.google.android.gms.ads.internal.util.client.zzo.zzf(t);
}
return super.onConsoleMessage(consoleMessage);
}
@Override // android.webkit.WebChromeClient
public final boolean onCreateWindow(WebView webView, boolean z, boolean z2, Message message) {
WebView.WebViewTransport webViewTransport = (WebView.WebViewTransport) message.obj;
WebView webView2 = new WebView(webView.getContext());
zzcjn zzcjnVar = this.f5181a;
if (((zzcju) zzcjnVar.f5204c).s0() != null) {
webView2.setWebViewClient(((zzcju) zzcjnVar.f5204c).s0());
}
webViewTransport.setWebView(webView2);
message.sendToTarget();
return true;
}
@Override // android.webkit.WebChromeClient
public final void onExceededDatabaseQuota(String str, String str2, long j, long j2, long j3, WebStorage.QuotaUpdater quotaUpdater) {
long j4 = 5242880 - j3;
if (j4 <= 0) {
quotaUpdater.updateQuota(j);
return;
}
if (j == 0) {
if (j2 > j4 || j2 > PlaybackStateCompat.ACTION_SET_CAPTIONING_ENABLED) {
j2 = 0;
}
} else if (j2 == 0) {
j2 = Math.min(Math.min(PlaybackStateCompat.ACTION_PREPARE_FROM_URI, j4) + j, PlaybackStateCompat.ACTION_SET_CAPTIONING_ENABLED);
} else {
if (j2 <= Math.min(PlaybackStateCompat.ACTION_SET_CAPTIONING_ENABLED - j, j4)) {
j += j2;
}
j2 = j;
}
quotaUpdater.updateQuota(j2);
}
/* JADX WARN: Removed duplicated region for block: B:12:0x0052 */
/* JADX WARN: Removed duplicated region for block: B:15:? A[RETURN, SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:16:0x003d */
/* JADX WARN: Removed duplicated region for block: B:9:0x0039 */
@Override // android.webkit.WebChromeClient
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void onGeolocationPermissionsShowPrompt(java.lang.String r6, android.webkit.GeolocationPermissions.Callback r7) {
/*
r5 = this;
if (r7 == 0) goto L59
com.google.android.gms.ads.internal.zzt.zzc()
com.google.android.gms.internal.ads.zzcjn r0 = r5.f5181a
android.content.Context r1 = r0.getContext()
java.lang.String r2 = "android.permission.ACCESS_FINE_LOCATION"
boolean r1 = com.google.android.gms.ads.internal.util.zzs.zzF(r1, r2)
r2 = 0
r3 = 1
if (r1 != 0) goto L24
com.google.android.gms.ads.internal.zzt.zzc()
android.content.Context r0 = r0.getContext()
java.lang.String r1 = "android.permission.ACCESS_COARSE_LOCATION"
boolean r0 = com.google.android.gms.ads.internal.util.zzs.zzF(r0, r1)
if (r0 == 0) goto L26
L24:
r0 = r3
goto L27
L26:
r0 = r2
L27:
com.google.android.gms.internal.ads.zzbgb r1 = com.google.android.gms.internal.ads.zzbgk.Ce
com.google.android.gms.internal.ads.zzbgi r4 = com.google.android.gms.ads.internal.client.zzbd.zzc()
java.lang.Object r1 = r4.a(r1)
java.lang.Boolean r1 = (java.lang.Boolean) r1
boolean r1 = r1.booleanValue()
if (r1 == 0) goto L3d
r7.invoke(r6, r2, r3)
goto L40
L3d:
r7.invoke(r6, r0, r3)
L40:
com.google.android.gms.internal.ads.zzbgb r6 = com.google.android.gms.internal.ads.zzbgk.De
com.google.android.gms.internal.ads.zzbgi r7 = com.google.android.gms.ads.internal.client.zzbd.zzc()
java.lang.Object r6 = r7.a(r6)
java.lang.Boolean r6 = (java.lang.Boolean) r6
boolean r6 = r6.booleanValue()
if (r6 == 0) goto L59
int r6 = com.google.android.gms.ads.internal.util.zze.zza
java.lang.String r6 = "AdWebChromeClient.onGeolocationPermissionsShowPrompt()"
com.google.android.gms.ads.internal.util.client.zzo.zzd(r6)
L59:
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.internal.ads.zzciq.onGeolocationPermissionsShowPrompt(java.lang.String, android.webkit.GeolocationPermissions$Callback):void");
}
@Override // android.webkit.WebChromeClient
public final void onHideCustomView() {
com.google.android.gms.ads.internal.overlay.zzm zzL = ((zzcju) this.f5181a.f5204c).zzL();
if (zzL == null) {
int i = com.google.android.gms.ads.internal.util.zze.zza;
com.google.android.gms.ads.internal.util.client.zzo.zzi("Could not get ad overlay when hiding custom view.");
} else {
zzL.zzc();
}
}
@Override // android.webkit.WebChromeClient
public final boolean onJsAlert(WebView webView, String str, String str2, JsResult jsResult) {
return a(b(webView), "alert", str, str2, null, jsResult, null, false);
}
@Override // android.webkit.WebChromeClient
public final boolean onJsBeforeUnload(WebView webView, String str, String str2, JsResult jsResult) {
return a(b(webView), "onBeforeUnload", str, str2, null, jsResult, null, false);
}
@Override // android.webkit.WebChromeClient
public final boolean onJsConfirm(WebView webView, String str, String str2, JsResult jsResult) {
return a(b(webView), "confirm", str, str2, null, jsResult, null, false);
}
@Override // android.webkit.WebChromeClient
public final boolean onJsPrompt(WebView webView, String str, String str2, String str3, JsPromptResult jsPromptResult) {
return a(b(webView), "prompt", str, str2, str3, null, jsPromptResult, true);
}
@Override // android.webkit.WebChromeClient
public final void onShowCustomView(View view, int i, WebChromeClient.CustomViewCallback customViewCallback) {
com.google.android.gms.ads.internal.overlay.zzm zzL = ((zzcju) this.f5181a.f5204c).zzL();
if (zzL == null) {
int i2 = com.google.android.gms.ads.internal.util.zze.zza;
com.google.android.gms.ads.internal.util.client.zzo.zzi("Could not get ad overlay when showing custom view.");
customViewCallback.onCustomViewHidden();
} else {
zzL.zzx(view, customViewCallback);
zzL.zzw(i);
}
}
@Override // android.webkit.WebChromeClient
public final void onShowCustomView(View view, WebChromeClient.CustomViewCallback customViewCallback) {
onShowCustomView(view, -1, customViewCallback);
}
}