soul-browser/app/smali_classes2/j$/util/Base64$Encoder.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

467 lines
6.7 KiB
Smali

.class public Lj$/util/Base64$Encoder;
.super Ljava/lang/Object;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lj$/util/Base64;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x9
name = "Encoder"
.end annotation
# static fields
.field public static final a:[C
.field public static final b:[C
.field public static final c:Lj$/util/Base64$Encoder;
# direct methods
.method static constructor <clinit>()V
.locals 1
const/16 v0, 0x40
.line 215
new-array v0, v0, [C
fill-array-data v0, :array_0
sput-object v0, Lj$/util/Base64$Encoder;->a:[C
const/16 v0, 0x40
.line 228
new-array v0, v0, [C
fill-array-data v0, :array_1
sput-object v0, Lj$/util/Base64$Encoder;->b:[C
.line 239
new-instance v0, Lj$/util/Base64$Encoder;
.line 203
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
.line 239
sput-object v0, Lj$/util/Base64$Encoder;->c:Lj$/util/Base64$Encoder;
return-void
:array_0
.array-data 2
0x41s
0x42s
0x43s
0x44s
0x45s
0x46s
0x47s
0x48s
0x49s
0x4as
0x4bs
0x4cs
0x4ds
0x4es
0x4fs
0x50s
0x51s
0x52s
0x53s
0x54s
0x55s
0x56s
0x57s
0x58s
0x59s
0x5as
0x61s
0x62s
0x63s
0x64s
0x65s
0x66s
0x67s
0x68s
0x69s
0x6as
0x6bs
0x6cs
0x6ds
0x6es
0x6fs
0x70s
0x71s
0x72s
0x73s
0x74s
0x75s
0x76s
0x77s
0x78s
0x79s
0x7as
0x30s
0x31s
0x32s
0x33s
0x34s
0x35s
0x36s
0x37s
0x38s
0x39s
0x2bs
0x2fs
.end array-data
:array_1
.array-data 2
0x41s
0x42s
0x43s
0x44s
0x45s
0x46s
0x47s
0x48s
0x49s
0x4as
0x4bs
0x4cs
0x4ds
0x4es
0x4fs
0x50s
0x51s
0x52s
0x53s
0x54s
0x55s
0x56s
0x57s
0x58s
0x59s
0x5as
0x61s
0x62s
0x63s
0x64s
0x65s
0x66s
0x67s
0x68s
0x69s
0x6as
0x6bs
0x6cs
0x6ds
0x6es
0x6fs
0x70s
0x71s
0x72s
0x73s
0x74s
0x75s
0x76s
0x77s
0x78s
0x79s
0x7as
0x30s
0x31s
0x32s
0x33s
0x34s
0x35s
0x36s
0x37s
0x38s
0x39s
0x2ds
0x5fs
.end array-data
.end method
# virtual methods
.method public encodeToString([B)Ljava/lang/String;
.locals 16
move-object/from16 v0, p1
.line 267
array-length v1, v0
add-int/lit8 v1, v1, 0x2
.line 246
div-int/lit8 v1, v1, 0x3
mul-int/lit8 v1, v1, 0x4
.line 268
new-array v2, v1, [B
.line 269
array-length v3, v0
.line 414
div-int/lit8 v4, v3, 0x3
mul-int/lit8 v4, v4, 0x3
const/4 v5, 0x0
move v6, v5
move v7, v6
.line 419
:goto_0
sget-object v8, Lj$/util/Base64$Encoder;->a:[C
if-ge v6, v4, :cond_3
add-int v9, v6, v4
.line 420
invoke-static {v9, v4}, Ljava/lang/Math;->min(II)I
move-result v9
move v10, v6
move v11, v7
:goto_1
if-ge v10, v9, :cond_0
add-int/lit8 v12, v10, 0x1
.line 401
aget-byte v13, v0, v10
and-int/lit16 v13, v13, 0xff
shl-int/lit8 v13, v13, 0x10
add-int/lit8 v14, v10, 0x2
aget-byte v12, v0, v12
and-int/lit16 v12, v12, 0xff
shl-int/lit8 v12, v12, 0x8
or-int/2addr v12, v13
add-int/lit8 v10, v10, 0x3
aget-byte v13, v0, v14
and-int/lit16 v13, v13, 0xff
or-int/2addr v12, v13
add-int/lit8 v13, v11, 0x1
ushr-int/lit8 v14, v12, 0x12
and-int/lit8 v14, v14, 0x3f
.line 404
aget-char v14, v8, v14
int-to-byte v14, v14
aput-byte v14, v2, v11
add-int/lit8 v14, v11, 0x2
ushr-int/lit8 v15, v12, 0xc
and-int/lit8 v15, v15, 0x3f
.line 405
aget-char v15, v8, v15
int-to-byte v15, v15
aput-byte v15, v2, v13
add-int/lit8 v13, v11, 0x3
ushr-int/lit8 v15, v12, 0x6
and-int/lit8 v15, v15, 0x3f
.line 406
aget-char v15, v8, v15
int-to-byte v15, v15
aput-byte v15, v2, v14
add-int/lit8 v11, v11, 0x4
and-int/lit8 v12, v12, 0x3f
.line 407
aget-char v12, v8, v12
int-to-byte v12, v12
aput-byte v12, v2, v13
goto :goto_1
:cond_0
sub-int v6, v9, v6
.line 422
div-int/lit8 v6, v6, 0x3
mul-int/lit8 v6, v6, 0x4
add-int/2addr v7, v6
const/4 v8, -0x1
if-ne v6, v8, :cond_2
if-lt v9, v3, :cond_1
goto :goto_2
:cond_1
const/4 v0, 0x0
.line 426
throw v0
:cond_2
:goto_2
move v6, v9
goto :goto_0
:cond_3
if-ge v6, v3, :cond_5
add-int/lit8 v4, v6, 0x1
.line 432
aget-byte v6, v0, v6
and-int/lit16 v6, v6, 0xff
add-int/lit8 v9, v7, 0x1
shr-int/lit8 v10, v6, 0x2
.line 433
aget-char v10, v8, v10
int-to-byte v10, v10
aput-byte v10, v2, v7
const/16 v10, 0x3d
if-ne v4, v3, :cond_4
add-int/lit8 v0, v7, 0x2
shl-int/lit8 v3, v6, 0x4
and-int/lit8 v3, v3, 0x3f
.line 435
aget-char v3, v8, v3
int-to-byte v3, v3
aput-byte v3, v2, v9
add-int/lit8 v3, v7, 0x3
.line 437
aput-byte v10, v2, v0
add-int/lit8 v7, v7, 0x4
.line 438
aput-byte v10, v2, v3
goto :goto_3
.line 441
:cond_4
aget-byte v0, v0, v4
and-int/lit16 v0, v0, 0xff
add-int/lit8 v3, v7, 0x2
shl-int/lit8 v4, v6, 0x4
and-int/lit8 v4, v4, 0x3f
shr-int/lit8 v6, v0, 0x4
or-int/2addr v4, v6
.line 442
aget-char v4, v8, v4
int-to-byte v4, v4
aput-byte v4, v2, v9
add-int/lit8 v4, v7, 0x3
shl-int/lit8 v0, v0, 0x2
and-int/lit8 v0, v0, 0x3f
.line 443
aget-char v0, v8, v0
int-to-byte v0, v0
aput-byte v0, v2, v3
add-int/lit8 v7, v7, 0x4
.line 445
aput-byte v10, v2, v4
:cond_5
:goto_3
if-eq v7, v1, :cond_6
.line 271
invoke-static {v2, v7}, Ljava/util/Arrays;->copyOf([BI)[B
move-result-object v2
.line 322
:cond_6
new-instance v0, Ljava/lang/String;
array-length v1, v2
invoke-direct {v0, v2, v5, v5, v1}, Ljava/lang/String;-><init>([BIII)V
return-object v0
.end method