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

204 lines
5.6 KiB
Java

package com.google.android.gms.internal.ads;
import android.util.Pair;
/* loaded from: classes.dex */
public abstract class zzbf {
/* renamed from: a, reason: collision with root package name */
public static final zzbf f4601a = new Object();
/* JADX WARN: Type inference failed for: r0v0, types: [java.lang.Object, com.google.android.gms.internal.ads.zzbf] */
static {
String str = zzfj.f7405a;
Integer.toString(0, 36);
Integer.toString(1, 36);
Integer.toString(2, 36);
}
public abstract int a();
public abstract zzbe b(int i, zzbe zzbeVar, long j);
public abstract int c();
public abstract zzbd d(int i, zzbd zzbdVar, boolean z);
public abstract int e(Object obj);
public final boolean equals(Object obj) {
int j;
if (this != obj) {
if (obj instanceof zzbf) {
zzbf zzbfVar = (zzbf) obj;
if (zzbfVar.a() == a() && zzbfVar.c() == c()) {
zzbe zzbeVar = new zzbe();
zzbd zzbdVar = new zzbd();
zzbe zzbeVar2 = new zzbe();
zzbd zzbdVar2 = new zzbd();
int i = 0;
while (true) {
if (i < a()) {
if (!b(i, zzbeVar, 0L).equals(zzbfVar.b(i, zzbeVar2, 0L))) {
break;
}
i++;
} else {
int i2 = 0;
while (true) {
if (i2 < c()) {
if (!d(i2, zzbdVar, true).equals(zzbfVar.d(i2, zzbdVar2, true))) {
break;
}
i2++;
} else {
int k = k(true);
if (k == zzbfVar.k(true) && (j = j(true)) == zzbfVar.j(true)) {
while (k != j) {
int h = h(k, 0, true);
if (h == zzbfVar.h(k, 0, true)) {
k = h;
}
}
}
}
}
}
}
}
}
return false;
}
return true;
}
public abstract Object f(int i);
public final boolean g() {
if (a() == 0) {
return true;
}
return false;
}
public int h(int i, int i2, boolean z) {
if (i2 != 0) {
if (i2 != 1) {
if (i2 == 2) {
if (i == j(z)) {
return k(z);
}
return i + 1;
}
throw new IllegalStateException();
}
return i;
}
if (i == j(z)) {
return -1;
}
return i + 1;
}
public final int hashCode() {
int i;
zzbe zzbeVar = new zzbe();
zzbd zzbdVar = new zzbd();
int a2 = a() + 217;
int i2 = 0;
while (true) {
i = a2 * 31;
if (i2 >= a()) {
break;
}
a2 = i + b(i2, zzbeVar, 0L).hashCode();
i2++;
}
int c2 = c() + i;
for (int i3 = 0; i3 < c(); i3++) {
c2 = (c2 * 31) + d(i3, zzbdVar, true).hashCode();
}
int k = k(true);
while (k != -1) {
c2 = (c2 * 31) + k;
k = h(k, 0, true);
}
return c2;
}
public int i(int i) {
if (i == k(false)) {
return -1;
}
return i - 1;
}
public int j(boolean z) {
if (g()) {
return -1;
}
return a() - 1;
}
public int k(boolean z) {
if (g()) {
return -1;
}
return 0;
}
public final int l(int i, zzbd zzbdVar, zzbe zzbeVar, int i2, boolean z) {
int i3 = d(i, zzbdVar, false).f4558c;
if (b(i3, zzbeVar, 0L).l == i) {
int h = h(i3, i2, z);
if (h == -1) {
return -1;
}
return b(h, zzbeVar, 0L).k;
}
return i + 1;
}
public final Pair m(zzbe zzbeVar, zzbd zzbdVar, int i, long j) {
Pair n = n(zzbeVar, zzbdVar, i, j, 0L);
n.getClass();
return n;
}
public final Pair n(zzbe zzbeVar, zzbd zzbdVar, int i, long j, long j2) {
zzgqa.i(i, a());
b(i, zzbeVar, j2);
if (j == -9223372036854775807L) {
zzbeVar.getClass();
j = 0;
}
int i2 = zzbeVar.k;
d(i2, zzbdVar, false);
while (i2 < zzbeVar.l) {
zzbdVar.getClass();
if (j == 0) {
break;
}
int i3 = i2 + 1;
d(i3, zzbdVar, false).getClass();
if (j < 0) {
break;
}
i2 = i3;
}
d(i2, zzbdVar, true);
zzbdVar.getClass();
long j3 = zzbdVar.d;
if (j3 != -9223372036854775807L) {
j = Math.min(j, j3 - 1);
}
long max = Math.max(0L, j);
Object obj = zzbdVar.b;
obj.getClass();
return Pair.create(obj, Long.valueOf(max));
}
public zzbd o(Object obj, zzbd zzbdVar) {
return d(e(obj), zzbdVar, true);
}
}