soul-browser/app/smali/androidx/appcompat/widget/DrawableUtils$Api18Impl.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

314 lines
6.6 KiB
Smali

.class Landroidx/appcompat/widget/DrawableUtils$Api18Impl;
.super Ljava/lang/Object;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Landroidx/appcompat/widget/DrawableUtils;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x9
name = "Api18Impl"
.end annotation
# static fields
.field public static final a:Z
.field public static final b:Ljava/lang/reflect/Method;
.field public static final c:Ljava/lang/reflect/Field;
.field public static final d:Ljava/lang/reflect/Field;
.field public static final e:Ljava/lang/reflect/Field;
.field public static final f:Ljava/lang/reflect/Field;
# direct methods
.method static constructor <clinit>()V
.locals 9
.line 1
const/4 v0, 0x1
.line 2
const/4 v1, 0x0
.line 3
const/4 v2, 0x0
.line 4
:try_start_0
const-string v3, "android.graphics.Insets"
.line 5
.line 6
invoke-static {v3}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
.line 7
.line 8
.line 9
move-result-object v3
.line 10
const-class v4, Landroid/graphics/drawable/Drawable;
.line 11
.line 12
const-string v5, "getOpticalInsets"
.line 13
.line 14
invoke-virtual {v4, v5, v1}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
.line 15
.line 16
.line 17
move-result-object v4
:try_end_0
.catch Ljava/lang/NoSuchMethodException; {:try_start_0 .. :try_end_0} :catch_9
.catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_8
.catch Ljava/lang/NoSuchFieldException; {:try_start_0 .. :try_end_0} :catch_7
.line 18
:try_start_1
const-string v5, "left"
.line 19
.line 20
invoke-virtual {v3, v5}, Ljava/lang/Class;->getField(Ljava/lang/String;)Ljava/lang/reflect/Field;
.line 21
.line 22
.line 23
move-result-object v5
:try_end_1
.catch Ljava/lang/NoSuchMethodException; {:try_start_1 .. :try_end_1} :catch_6
.catch Ljava/lang/ClassNotFoundException; {:try_start_1 .. :try_end_1} :catch_5
.catch Ljava/lang/NoSuchFieldException; {:try_start_1 .. :try_end_1} :catch_4
.line 24
:try_start_2
const-string v6, "top"
.line 25
.line 26
invoke-virtual {v3, v6}, Ljava/lang/Class;->getField(Ljava/lang/String;)Ljava/lang/reflect/Field;
.line 27
.line 28
.line 29
move-result-object v6
:try_end_2
.catch Ljava/lang/NoSuchMethodException; {:try_start_2 .. :try_end_2} :catch_3
.catch Ljava/lang/ClassNotFoundException; {:try_start_2 .. :try_end_2} :catch_2
.catch Ljava/lang/NoSuchFieldException; {:try_start_2 .. :try_end_2} :catch_1
.line 30
:try_start_3
const-string v7, "right"
.line 31
.line 32
invoke-virtual {v3, v7}, Ljava/lang/Class;->getField(Ljava/lang/String;)Ljava/lang/reflect/Field;
.line 33
.line 34
.line 35
move-result-object v7
:try_end_3
.catch Ljava/lang/NoSuchMethodException; {:try_start_3 .. :try_end_3} :catch_0
.catch Ljava/lang/ClassNotFoundException; {:try_start_3 .. :try_end_3} :catch_0
.catch Ljava/lang/NoSuchFieldException; {:try_start_3 .. :try_end_3} :catch_0
.line 36
:try_start_4
const-string v8, "bottom"
.line 37
.line 38
invoke-virtual {v3, v8}, Ljava/lang/Class;->getField(Ljava/lang/String;)Ljava/lang/reflect/Field;
.line 39
.line 40
.line 41
move-result-object v3
:try_end_4
.catch Ljava/lang/NoSuchMethodException; {:try_start_4 .. :try_end_4} :catch_a
.catch Ljava/lang/ClassNotFoundException; {:try_start_4 .. :try_end_4} :catch_a
.catch Ljava/lang/NoSuchFieldException; {:try_start_4 .. :try_end_4} :catch_a
.line 42
move v8, v0
.line 43
goto :goto_5
.line 44
:catch_0
move-object v7, v1
.line 45
goto :goto_4
.line 46
:catch_1
move-object v6, v1
.line 47
:goto_0
move-object v7, v6
.line 48
goto :goto_4
.line 49
:catch_2
move-object v6, v1
.line 50
goto :goto_0
.line 51
:catch_3
move-object v6, v1
.line 52
goto :goto_0
.line 53
:catch_4
move-object v5, v1
.line 54
:goto_1
move-object v6, v5
.line 55
goto :goto_0
.line 56
:catch_5
move-object v5, v1
.line 57
:goto_2
move-object v6, v5
.line 58
goto :goto_0
.line 59
:catch_6
move-object v5, v1
.line 60
:goto_3
move-object v6, v5
.line 61
goto :goto_0
.line 62
:catch_7
move-object v4, v1
.line 63
move-object v5, v4
.line 64
goto :goto_1
.line 65
:catch_8
move-object v4, v1
.line 66
move-object v5, v4
.line 67
goto :goto_2
.line 68
:catch_9
move-object v4, v1
.line 69
move-object v5, v4
.line 70
goto :goto_3
.line 71
:catch_a
:goto_4
move-object v3, v1
.line 72
move v8, v2
.line 73
:goto_5
if-eqz v8, :cond_0
.line 74
.line 75
sput-object v4, Landroidx/appcompat/widget/DrawableUtils$Api18Impl;->b:Ljava/lang/reflect/Method;
.line 76
.line 77
sput-object v5, Landroidx/appcompat/widget/DrawableUtils$Api18Impl;->c:Ljava/lang/reflect/Field;
.line 78
.line 79
sput-object v6, Landroidx/appcompat/widget/DrawableUtils$Api18Impl;->d:Ljava/lang/reflect/Field;
.line 80
.line 81
sput-object v7, Landroidx/appcompat/widget/DrawableUtils$Api18Impl;->e:Ljava/lang/reflect/Field;
.line 82
.line 83
sput-object v3, Landroidx/appcompat/widget/DrawableUtils$Api18Impl;->f:Ljava/lang/reflect/Field;
.line 84
.line 85
sput-boolean v0, Landroidx/appcompat/widget/DrawableUtils$Api18Impl;->a:Z
.line 86
.line 87
goto :goto_6
.line 88
:cond_0
sput-object v1, Landroidx/appcompat/widget/DrawableUtils$Api18Impl;->b:Ljava/lang/reflect/Method;
.line 89
.line 90
sput-object v1, Landroidx/appcompat/widget/DrawableUtils$Api18Impl;->c:Ljava/lang/reflect/Field;
.line 91
.line 92
sput-object v1, Landroidx/appcompat/widget/DrawableUtils$Api18Impl;->d:Ljava/lang/reflect/Field;
.line 93
.line 94
sput-object v1, Landroidx/appcompat/widget/DrawableUtils$Api18Impl;->e:Ljava/lang/reflect/Field;
.line 95
.line 96
sput-object v1, Landroidx/appcompat/widget/DrawableUtils$Api18Impl;->f:Ljava/lang/reflect/Field;
.line 97
.line 98
sput-boolean v2, Landroidx/appcompat/widget/DrawableUtils$Api18Impl;->a:Z
.line 99
.line 100
:goto_6
return-void
.end method