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

141 lines
5.2 KiB
Java

package com.google.android.gms.internal.ads;
import android.content.Context;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.text.TextUtils;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.nio.charset.StandardCharsets;
import java.util.concurrent.ExecutorService;
/* loaded from: classes.dex */
public final class zzgjq implements zzgje {
/* renamed from: a, reason: collision with root package name */
public final Context f8030a;
public final ExecutorService b;
/* renamed from: c, reason: collision with root package name */
public final zzgbc f8031c;
public final String d;
public final String e;
public final zzgnc f;
public final zzgjs g;
public zzgjq(Context context, ExecutorService executorService, zzgad zzgadVar, zzgbc zzgbcVar, zzgnc zzgncVar, zzgjs zzgjsVar) {
this.f8030a = context;
this.b = executorService;
this.f8031c = zzgbcVar;
this.f = zzgncVar;
this.g = zzgjsVar;
this.d = zzgadVar.J();
this.e = zzgadVar.P().F();
}
public static zzgcq a(int i) {
zzgcp G = zzgcq.G();
G.k();
((zzgcq) G.f).L(i);
return (zzgcq) G.m();
}
@Override // com.google.android.gms.internal.ads.zzgje
public final zzgye zza() {
int i;
zzbbl D = zzbbm.D();
byte[] a2 = zzatg.a();
zzhzl zzhzlVar = zzhzl.f;
zzhzl B = zzhzl.B(a2, 0, a2.length);
D.k();
((zzbbm) D.f).E(B);
long j = Build.VERSION.SDK_INT;
D.k();
((zzbbm) D.f).F(j);
String str = Build.MODEL;
D.k();
((zzbbm) D.f).G(str);
Context context = this.f8030a;
String packageName = context.getPackageName();
D.k();
((zzbbm) D.f).H(packageName);
try {
i = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionCode;
} catch (PackageManager.NameNotFoundException unused) {
i = -1;
}
D.k();
((zzbbm) D.f).I(i);
D.k();
((zzbbm) D.f).J(this.d);
byte[] h = ((zzbbm) D.m()).h();
zzgvx zzgvxVar = (zzgvx) zzgvy.b;
Character ch = zzgvxVar.e;
zzgvy zzgvyVar = zzgvxVar;
if (ch != null) {
zzgvyVar = zzgvxVar.i(zzgvxVar.d, null);
}
zzgye zzgyeVar = (zzgye) zzgym.i(zzgye.r(this.f8031c.zza(Uri.parse(this.e).buildUpon().appendQueryParameter("aspq", zzgvyVar.g(h, h.length)).build().toString())), new zzgpr() { // from class: com.google.android.gms.internal.ads.zzgjp
@Override // com.google.android.gms.internal.ads.zzgpr
public final Object apply(Object obj) {
zzgbb zzgbbVar = (zzgbb) obj;
zzgjq zzgjqVar = zzgjq.this;
zzgnc zzgncVar = zzgjqVar.f;
if (zzgbbVar.zza() != 200) {
zzgncVar.c(20003, new String(zzatg.a(), StandardCharsets.UTF_8));
return zzgjq.a(7);
}
try {
String zzb = zzgbbVar.zzb();
if (TextUtils.isEmpty(zzb)) {
zzgncVar.b(20004);
return zzgjq.a(8);
}
zzbbo E = zzbbo.E(zzgay.a(zzb, true), zziab.a());
if (E.D().F() && E.D().D()) {
if (!zzgjqVar.g.a(E)) {
zzgncVar.b(20006);
return zzgjq.a(12);
}
zzgcp G = zzgcq.G();
zzgcr H = zzgcs.H();
zzbbw E2 = E.D().E();
H.k();
((zzgcs) H.f).K(E2);
G.k();
((zzgcq) G.f).H((zzgcs) H.m());
zzhzl G2 = E.D().G();
G.k();
((zzgcq) G.f).I(G2);
G.k();
((zzgcq) G.f).L(2);
return (zzgcq) G.m();
}
zzgncVar.b(20004);
return zzgjq.a(8);
} catch (Throwable th) {
zzgncVar.d(20005, th);
return zzgjq.a(6);
}
}
}, this.b);
zzgpr zzgprVar = new zzgpr() { // from class: com.google.android.gms.internal.ads.zzgjn
@Override // com.google.android.gms.internal.ads.zzgpr
public final /* synthetic */ Object apply(Object obj) {
zzgjq.this.f.b(20007);
return zzgjq.a(13);
}
};
zzgyb zzgybVar = zzgyb.f8301c;
zzgye zzgyeVar2 = (zzgye) zzgym.e((zzgye) zzgym.e(zzgyeVar, UnknownHostException.class, zzgprVar, zzgybVar), SocketException.class, new zzgpr() { // from class: com.google.android.gms.internal.ads.zzgjo
@Override // com.google.android.gms.internal.ads.zzgpr
public final /* synthetic */ Object apply(Object obj) {
zzgjq.this.f.b(20008);
return zzgjq.a(13);
}
}, zzgybVar);
this.f.e(20002, zzgyeVar2);
return zzgyeVar2;
}
}