soul-browser/sources/java/com/google/android/gms/internal/ads/zzbdw.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

122 lines
4.7 KiB
Java

package com.google.android.gms.internal.ads;
import com.google.android.gms.ads.RequestConfiguration;
import java.io.IOException;
import java.text.Normalizer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Locale;
/* loaded from: classes.dex */
public final class zzbdw {
/* renamed from: a, reason: collision with root package name */
public final zzbdu f4582a;
public final int b;
/* renamed from: c, reason: collision with root package name */
public final int f4583c;
public zzbdw(int i, int i2, int i3) {
this.b = i;
i2 = (i2 > 64 || i2 < 0) ? 64 : i2;
if (i3 <= 0) {
this.f4583c = 1;
} else {
this.f4583c = i3;
}
this.f4582a = new zzbdu(i2);
}
/* JADX WARN: Type inference failed for: r2v0, types: [java.lang.Object, java.util.Comparator] */
public final String a(ArrayList arrayList, ArrayList arrayList2) {
int i;
String str;
Collections.sort(arrayList2, new Object());
HashSet hashSet = new HashSet();
loop0: for (int i2 = 0; i2 < arrayList2.size(); i2++) {
String[] split2 = Normalizer.normalize((CharSequence) arrayList.get(((zzbdl) arrayList2.get(i2)).e), Normalizer.Form.NFKC).toLowerCase(Locale.US).split("\n");
if (split2.length != 0) {
for (String str2 : split2) {
if (str2.contains("'")) {
StringBuilder sb = new StringBuilder(str2);
int i3 = 1;
boolean z = false;
while (true) {
int i4 = i3 + 2;
if (i4 > sb.length()) {
break;
}
if (sb.charAt(i3) == '\'') {
if (sb.charAt(i3 - 1) != ' ') {
int i5 = i3 + 1;
if ((sb.charAt(i5) == 's' || sb.charAt(i5) == 'S') && (i4 == sb.length() || sb.charAt(i4) == ' ')) {
sb.insert(i3, ' ');
i3 = i4;
z = true;
}
}
sb.setCharAt(i3, ' ');
z = true;
}
i3++;
}
if (z) {
str = sb.toString();
} else {
str = null;
}
if (str != null) {
str2 = str;
}
}
String[] b = zzbdq.b(str2, true);
int length = b.length;
int i6 = this.f4583c;
if (length >= i6) {
int i7 = 0;
while (true) {
int length2 = b.length;
i = this.b;
if (i7 >= length2) {
break;
}
String str3 = RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED;
for (int i8 = 0; i8 < i6; i8++) {
int i9 = i7 + i8;
if (i9 >= b.length) {
break;
}
if (i8 > 0) {
str3 = str3.concat(" ");
}
str3 = str3.concat(String.valueOf(b[i9]));
}
hashSet.add(str3);
if (hashSet.size() >= i) {
break loop0;
}
i7++;
}
if (hashSet.size() >= i) {
break loop0;
}
}
}
}
}
zzbdo zzbdoVar = new zzbdo();
Iterator it = hashSet.iterator();
while (it.hasNext()) {
try {
zzbdoVar.b.write(this.f4582a.b((String) it.next()));
} catch (IOException e) {
int i10 = com.google.android.gms.ads.internal.util.zze.zza;
com.google.android.gms.ads.internal.util.client.zzo.zzg("Error while writing hash to byteStream", e);
}
}
return zzbdoVar.toString();
}
}