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

136 lines
3.3 KiB
Java

package com.google.android.gms.internal.ads;
import java.nio.ByteOrder;
import java.util.Collections;
import kotlin.jvm.internal.ByteCompanionObject;
/* loaded from: classes.dex */
public final class zzafb {
/* renamed from: a, reason: collision with root package name */
public final int f3966a;
public final int b;
/* renamed from: c, reason: collision with root package name */
public final int f3967c;
public final int d;
public final int e;
public final int f;
public final int g;
public final int h;
public final int i;
public final long j;
public final zzafa k;
public final zzap l;
public zzafb(int i, int i2, int i3, int i4, int i5, int i6, int i7, long j, zzafa zzafaVar, zzap zzapVar) {
this.f3966a = i;
this.b = i2;
this.f3967c = i3;
this.d = i4;
this.e = i5;
this.f = c(i5);
this.g = i6;
this.h = i7;
this.i = d(i7);
this.j = j;
this.k = zzafaVar;
this.l = zzapVar;
}
public static int c(int i) {
switch (i) {
case 8000:
return 4;
case 16000:
return 5;
case 22050:
return 6;
case 24000:
return 7;
case 32000:
return 8;
case 44100:
return 9;
case 48000:
return 10;
case 88200:
return 1;
case 96000:
return 11;
case 176400:
return 2;
case 192000:
return 3;
default:
return -1;
}
}
public static int d(int i) {
if (i == 8) {
return 1;
}
if (i == 12) {
return 2;
}
if (i == 16) {
return 4;
}
if (i == 20) {
return 5;
}
if (i != 24) {
return i != 32 ? -1 : 7;
}
return 6;
}
public final long a() {
long j = this.j;
if (j == 0) {
return -9223372036854775807L;
}
return (j * 1000000) / this.e;
}
public final zzv b(byte[] bArr, zzap zzapVar) {
bArr[4] = ByteCompanionObject.MIN_VALUE;
zzap zzapVar2 = this.l;
if (zzapVar2 != null) {
zzapVar = zzapVar2.b(zzapVar);
}
zzt zztVar = new zzt();
zztVar.e("audio/flac");
int i = this.d;
if (i <= 0) {
i = -1;
}
zztVar.m = i;
zztVar.D = this.g;
zztVar.E = this.e;
zztVar.F = zzfj.y(this.h, ByteOrder.LITTLE_ENDIAN);
zztVar.o = Collections.singletonList(bArr);
zztVar.j = zzapVar;
return new zzv(zztVar);
}
public zzafb(byte[] bArr, int i) {
zzeq zzeqVar = new zzeq(bArr, bArr.length);
zzeqVar.d(i * 8);
this.f3966a = zzeqVar.h(16);
this.b = zzeqVar.h(16);
this.f3967c = zzeqVar.h(24);
this.d = zzeqVar.h(24);
int h = zzeqVar.h(20);
this.e = h;
this.f = c(h);
this.g = zzeqVar.h(3) + 1;
int h2 = zzeqVar.h(5) + 1;
this.h = h2;
this.i = d(h2);
this.j = zzeqVar.i(36);
this.k = null;
this.l = null;
}
}