soul-browser/app/smali/com/google/android/gms/common/util/zzf.smali
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

269 lines
4.7 KiB
Smali

.class final Lcom/google/android/gms/common/util/zzf;
.super Ljava/lang/Object;
.source "SourceFile"
# static fields
.field private static final zza:Ljava/util/regex/Pattern;
# direct methods
.method static constructor <clinit>()V
.locals 1
const-string v0, "\\\\u[0-9a-fA-F]{4}"
invoke-static {v0}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;
move-result-object v0
sput-object v0, Lcom/google/android/gms/common/util/zzf;->zza:Ljava/util/regex/Pattern;
return-void
.end method
.method public static zza(Ljava/lang/String;)Ljava/lang/String;
.locals 7
.line 1
invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
.line 2
.line 3
.line 4
move-result v0
.line 5
if-nez v0, :cond_7
.line 6
.line 7
sget-object v0, Lcom/google/android/gms/common/util/zzf;->zza:Ljava/util/regex/Pattern;
.line 8
.line 9
invoke-virtual {v0, p0}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
.line 10
.line 11
.line 12
move-result-object v0
.line 13
const/4 v1, 0x0
.line 14
const/4 v2, 0x0
.line 15
:cond_0
:goto_0
invoke-virtual {v0}, Ljava/util/regex/Matcher;->find()Z
.line 16
.line 17
.line 18
move-result v3
.line 19
if-eqz v3, :cond_4
.line 20
.line 21
if-nez v1, :cond_1
.line 22
.line 23
new-instance v1, Ljava/lang/StringBuilder;
.line 24
.line 25
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
.line 26
.line 27
.line 28
:cond_1
invoke-virtual {v0}, Ljava/util/regex/Matcher;->start()I
.line 29
.line 30
.line 31
move-result v3
.line 32
move v4, v3
.line 33
:goto_1
const/16 v5, 0x5c
.line 34
.line 35
if-ltz v4, :cond_2
.line 36
.line 37
invoke-virtual {p0, v4}, Ljava/lang/String;->charAt(I)C
.line 38
.line 39
.line 40
move-result v6
.line 41
if-ne v6, v5, :cond_2
.line 42
.line 43
add-int/lit8 v4, v4, -0x1
.line 44
.line 45
goto :goto_1
.line 46
:cond_2
sub-int/2addr v3, v4
.line 47
const/4 v4, 0x2
.line 48
rem-int/2addr v3, v4
.line 49
if-eqz v3, :cond_0
.line 50
.line 51
invoke-virtual {v0}, Ljava/util/regex/Matcher;->group()Ljava/lang/String;
.line 52
.line 53
.line 54
move-result-object v3
.line 55
invoke-virtual {v3, v4}, Ljava/lang/String;->substring(I)Ljava/lang/String;
.line 56
.line 57
.line 58
move-result-object v3
.line 59
const/16 v4, 0x10
.line 60
.line 61
invoke-static {v3, v4}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;I)I
.line 62
.line 63
.line 64
move-result v3
.line 65
invoke-virtual {v0}, Ljava/util/regex/Matcher;->start()I
.line 66
.line 67
.line 68
move-result v4
.line 69
invoke-virtual {v1, p0, v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/CharSequence;II)Ljava/lang/StringBuilder;
.line 70
.line 71
.line 72
if-ne v3, v5, :cond_3
.line 73
.line 74
const-string v2, "\\\\"
.line 75
.line 76
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
.line 77
.line 78
.line 79
goto :goto_2
.line 80
:cond_3
invoke-static {v3}, Ljava/lang/Character;->toChars(I)[C
.line 81
.line 82
.line 83
move-result-object v2
.line 84
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append([C)Ljava/lang/StringBuilder;
.line 85
.line 86
.line 87
:goto_2
invoke-virtual {v0}, Ljava/util/regex/Matcher;->end()I
.line 88
.line 89
.line 90
move-result v2
.line 91
goto :goto_0
.line 92
:cond_4
if-nez v1, :cond_5
.line 93
.line 94
goto :goto_3
.line 95
:cond_5
invoke-virtual {v0}, Ljava/util/regex/Matcher;->regionEnd()I
.line 96
.line 97
.line 98
move-result v3
.line 99
if-ge v2, v3, :cond_6
.line 100
.line 101
invoke-virtual {v0}, Ljava/util/regex/Matcher;->regionEnd()I
.line 102
.line 103
.line 104
move-result v0
.line 105
invoke-virtual {v1, p0, v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/CharSequence;II)Ljava/lang/StringBuilder;
.line 106
.line 107
.line 108
:cond_6
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
.line 109
.line 110
.line 111
move-result-object p0
.line 112
:cond_7
:goto_3
return-object p0
.end method