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

137 lines
6.6 KiB
Java

package com.google.android.gms.internal.fido;
import android.support.v4.media.session.PlaybackStateCompat;
import com.google.android.gms.common.ConnectionResult;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.TreeMap;
/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes3.dex */
public final class zzhq {
public static final zzhp a(zzhs zzhsVar) {
long j;
try {
zzhr b = zzhsVar.b();
if (b != null) {
try {
try {
byte b2 = b.f10334a;
byte b3 = b.b;
int i = 0;
if (b2 != Byte.MIN_VALUE) {
if (b2 != -96) {
if (b2 != -64) {
if (b2 != -32) {
if (b2 != 0 && b2 != 32) {
if (b2 != 64) {
if (b2 == 96) {
zzhsVar.i((byte) 96);
String str = new String(zzhsVar.k(), StandardCharsets.UTF_8);
b(b3, str.length());
return new zzhn(str);
}
throw new IOException("Unidentifiable major type: " + ((b2 >> 5) & 7));
}
zzhsVar.i((byte) 64);
byte[] k = zzhsVar.k();
int length = k.length;
b(b3, length);
return new zzhi(zzgx.s(k, length));
}
long zzb = zzhsVar.zzb();
if (zzb > 0) {
j = zzb;
} else {
j = ~zzb;
}
b(b3, j);
return new zzhk(zzb);
}
return new zzhh(zzhsVar.d());
}
throw new IOException("Tags are currently unsupported");
}
long zzc = zzhsVar.zzc();
if (zzc <= 1000) {
b(b3, zzc);
int i2 = (int) zzc;
zzhl[] zzhlVarArr = new zzhl[i2];
zzhp zzhpVar = null;
int i3 = 0;
while (i3 < zzc) {
zzhp a2 = a(zzhsVar);
if (zzhpVar != null && a2.compareTo(zzhpVar) <= 0) {
throw new IOException("Keys in CBOR Map not in strictly ascending natural order:\nPrevious key: " + zzhpVar.toString() + "\nCurrent key: " + a2.toString());
}
zzhlVarArr[i3] = new zzhl(a2, a(zzhsVar));
i3++;
zzhpVar = a2;
}
TreeMap treeMap = new TreeMap();
while (i < i2) {
zzhl zzhlVar = zzhlVarArr[i];
if (!treeMap.containsKey(zzhlVar.f10331a)) {
treeMap.put(zzhlVar.f10331a, zzhlVar.b);
i++;
} else {
throw new IOException("Attempted to add duplicate key to canonical CBOR Map.");
}
}
return new zzhm(zzcj.e(treeMap));
}
throw new IOException("Parser being asked to read a large CBOR map");
}
long a3 = zzhsVar.a();
if (a3 <= 1000) {
b(b3, a3);
zzhp[] zzhpVarArr = new zzhp[(int) a3];
while (i < a3) {
zzhpVarArr[i] = a(zzhsVar);
i++;
}
return new zzhg(zzcc.r(zzhpVarArr));
}
throw new IOException("Parser being asked to read a large CBOR array");
} catch (RuntimeException e) {
e = e;
throw new zzhj(e);
}
} catch (IOException | RuntimeException e2) {
e = e2;
throw new zzhj(e);
}
}
throw new IOException("Parser being asked to parse an empty input stream");
} catch (IOException e3) {
throw new zzhj(e3);
}
}
public static final void b(byte b, long j) {
switch (b) {
case ConnectionResult.API_DISABLED_FOR_CONNECTION /* 24 */:
if (j >= 24) {
return;
}
throw new IOException("Integer value " + j + " after add info could have been represented in 0 additional bytes, but used 1");
case 25:
if (j < 256) {
throw new IOException("Integer value " + j + " after add info could have been represented in 0-1 additional bytes, but used 2");
}
return;
case 26:
if (j < PlaybackStateCompat.ACTION_PREPARE_FROM_SEARCH) {
throw new IOException("Integer value " + j + " after add info could have been represented in 0-2 additional bytes, but used 4");
}
return;
case 27:
if (j < 4294967296L) {
throw new IOException("Integer value " + j + " after add info could have been represented in 0-4 additional bytes, but used 8");
}
return;
default:
return;
}
}
}