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

116 lines
2.9 KiB
Java

package com.google.android.gms.internal.ads;
import android.net.Uri;
import java.util.Map;
/* loaded from: classes.dex */
final class zzchn implements zzhb {
/* renamed from: a, reason: collision with root package name */
public final zzgw f5153a;
public final long b;
/* renamed from: c, reason: collision with root package name */
public final zzhb f5154c;
public long d;
public Uri e;
public zzchn(zzgw zzgwVar, int i, zzhb zzhbVar) {
this.f5153a = zzgwVar;
this.b = i;
this.f5154c = zzhbVar;
}
@Override // com.google.android.gms.internal.ads.zzhb
public final long a(zzhf zzhfVar) {
zzhf zzhfVar2;
long j;
zzhf zzhfVar3;
zzhf zzhfVar4;
long j2;
Uri uri = zzhfVar.f8483a;
long j3 = zzhfVar.d;
this.e = uri;
long j4 = zzhfVar.f8484c;
long j5 = this.b;
if (j4 >= j5) {
zzhfVar2 = null;
} else {
long j6 = j5 - j4;
if (j3 != -1) {
j6 = Math.min(j3, j6);
}
zzhfVar2 = new zzhf(uri, j4, j6);
}
if (j3 != -1 && j4 + j3 <= j5) {
zzhfVar3 = zzhfVar2;
zzhfVar4 = null;
} else {
long max = Math.max(j5, j4);
if (j3 != -1) {
j = Math.min(j3, (j4 + j3) - j5);
} else {
j = -1;
}
zzhfVar3 = zzhfVar2;
zzhfVar4 = new zzhf(uri, max, j);
}
long j7 = 0;
if (zzhfVar3 != null) {
j2 = this.f5153a.a(zzhfVar3);
} else {
j2 = 0;
}
if (zzhfVar4 != null) {
j7 = this.f5154c.a(zzhfVar4);
}
this.d = j4;
if (j2 == -1 || j7 == -1) {
return -1L;
}
return j2 + j7;
}
@Override // com.google.android.gms.internal.ads.zzj
public final int b(byte[] bArr, int i, int i2) {
int i3;
long j = this.d;
long j2 = this.b;
if (j < j2) {
int b = this.f5153a.b(bArr, i, (int) Math.min(i2, j2 - j));
long j3 = this.d + b;
this.d = j3;
i3 = b;
j = j3;
} else {
i3 = 0;
}
if (j >= j2) {
int b2 = this.f5154c.b(bArr, i + i3, i2 - i3);
int i4 = i3 + b2;
this.d += b2;
return i4;
}
return i3;
}
@Override // com.google.android.gms.internal.ads.zzhb
public final void c(zzhz zzhzVar) {
}
@Override // com.google.android.gms.internal.ads.zzhb
public final Uri zzc() {
return this.e;
}
@Override // com.google.android.gms.internal.ads.zzhb
public final void zzd() {
this.f5153a.zzd();
this.f5154c.zzd();
}
@Override // com.google.android.gms.internal.ads.zzhb
public final Map zzj() {
return zzgvd.k;
}
}