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

485 lines
9.9 KiB
Smali

.class public final Landroidx/appcompat/widget/AppCompatDrawableManager;
.super Ljava/lang/Object;
.source "SourceFile"
# annotations
.annotation build Landroidx/annotation/RestrictTo;
.end annotation
# static fields
.field public static final b:Landroid/graphics/PorterDuff$Mode;
.field public static c:Landroidx/appcompat/widget/AppCompatDrawableManager;
# instance fields
.field public a:Landroidx/appcompat/widget/ResourceManagerInternal;
# direct methods
.method static constructor <clinit>()V
.locals 1
.line 1
sget-object v0, Landroid/graphics/PorterDuff$Mode;->SRC_IN:Landroid/graphics/PorterDuff$Mode;
.line 2
.line 3
sput-object v0, Landroidx/appcompat/widget/AppCompatDrawableManager;->b:Landroid/graphics/PorterDuff$Mode;
.line 4
.line 5
return-void
.end method
.method public static declared-synchronized a()Landroidx/appcompat/widget/AppCompatDrawableManager;
.locals 2
.line 1
const-class v0, Landroidx/appcompat/widget/AppCompatDrawableManager;
.line 2
.line 3
monitor-enter v0
.line 4
:try_start_0
sget-object v1, Landroidx/appcompat/widget/AppCompatDrawableManager;->c:Landroidx/appcompat/widget/AppCompatDrawableManager;
.line 5
.line 6
if-nez v1, :cond_0
.line 7
.line 8
invoke-static {}, Landroidx/appcompat/widget/AppCompatDrawableManager;->d()V
.line 9
.line 10
.line 11
goto :goto_0
.line 12
:catchall_0
move-exception v1
.line 13
goto :goto_1
.line 14
:cond_0
:goto_0
sget-object v1, Landroidx/appcompat/widget/AppCompatDrawableManager;->c:Landroidx/appcompat/widget/AppCompatDrawableManager;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 15
.line 16
monitor-exit v0
.line 17
return-object v1
.line 18
:goto_1
:try_start_1
monitor-exit v0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 19
throw v1
.end method
.method public static declared-synchronized c(ILandroid/graphics/PorterDuff$Mode;)Landroid/graphics/PorterDuffColorFilter;
.locals 1
.line 1
const-class v0, Landroidx/appcompat/widget/AppCompatDrawableManager;
.line 2
.line 3
monitor-enter v0
.line 4
:try_start_0
invoke-static {p0, p1}, Landroidx/appcompat/widget/ResourceManagerInternal;->g(ILandroid/graphics/PorterDuff$Mode;)Landroid/graphics/PorterDuffColorFilter;
.line 5
.line 6
.line 7
move-result-object p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 8
monitor-exit v0
.line 9
return-object p0
.line 10
:catchall_0
move-exception p0
.line 11
:try_start_1
monitor-exit v0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 12
throw p0
.end method
.method public static declared-synchronized d()V
.locals 3
.line 1
const-class v0, Landroidx/appcompat/widget/AppCompatDrawableManager;
.line 2
.line 3
monitor-enter v0
.line 4
:try_start_0
sget-object v1, Landroidx/appcompat/widget/AppCompatDrawableManager;->c:Landroidx/appcompat/widget/AppCompatDrawableManager;
.line 5
.line 6
if-nez v1, :cond_0
.line 7
.line 8
new-instance v1, Landroidx/appcompat/widget/AppCompatDrawableManager;
.line 9
.line 10
invoke-direct {v1}, Ljava/lang/Object;-><init>()V
.line 11
.line 12
.line 13
sput-object v1, Landroidx/appcompat/widget/AppCompatDrawableManager;->c:Landroidx/appcompat/widget/AppCompatDrawableManager;
.line 14
.line 15
invoke-static {}, Landroidx/appcompat/widget/ResourceManagerInternal;->c()Landroidx/appcompat/widget/ResourceManagerInternal;
.line 16
.line 17
.line 18
move-result-object v2
.line 19
iput-object v2, v1, Landroidx/appcompat/widget/AppCompatDrawableManager;->a:Landroidx/appcompat/widget/ResourceManagerInternal;
.line 20
.line 21
sget-object v1, Landroidx/appcompat/widget/AppCompatDrawableManager;->c:Landroidx/appcompat/widget/AppCompatDrawableManager;
.line 22
.line 23
iget-object v1, v1, Landroidx/appcompat/widget/AppCompatDrawableManager;->a:Landroidx/appcompat/widget/ResourceManagerInternal;
.line 24
.line 25
new-instance v2, Landroidx/appcompat/widget/AppCompatDrawableManager$1;
.line 26
.line 27
invoke-direct {v2}, Landroidx/appcompat/widget/AppCompatDrawableManager$1;-><init>()V
.line 28
.line 29
.line 30
invoke-virtual {v1, v2}, Landroidx/appcompat/widget/ResourceManagerInternal;->l(Landroidx/appcompat/widget/ResourceManagerInternal$ResourceManagerHooks;)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 31
.line 32
.line 33
goto :goto_0
.line 34
:catchall_0
move-exception v1
.line 35
goto :goto_1
.line 36
:cond_0
:goto_0
monitor-exit v0
.line 37
return-void
.line 38
:goto_1
:try_start_1
monitor-exit v0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 39
throw v1
.end method
.method public static e(Landroid/graphics/drawable/Drawable;Landroidx/appcompat/widget/TintInfo;[I)V
.locals 4
.line 1
sget-object v0, Landroidx/appcompat/widget/ResourceManagerInternal;->h:Landroid/graphics/PorterDuff$Mode;
.line 2
.line 3
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->getState()[I
.line 4
.line 5
.line 6
move-result-object v0
.line 7
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->mutate()Landroid/graphics/drawable/Drawable;
.line 8
.line 9
.line 10
move-result-object v1
.line 11
if-ne v1, p0, :cond_8
.line 12
.line 13
instance-of v1, p0, Landroid/graphics/drawable/LayerDrawable;
.line 14
.line 15
const/4 v2, 0x0
.line 16
if-eqz v1, :cond_0
.line 17
.line 18
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->isStateful()Z
.line 19
.line 20
.line 21
move-result v1
.line 22
if-eqz v1, :cond_0
.line 23
.line 24
new-array v1, v2, [I
.line 25
.line 26
invoke-virtual {p0, v1}, Landroid/graphics/drawable/Drawable;->setState([I)Z
.line 27
.line 28
.line 29
invoke-virtual {p0, v0}, Landroid/graphics/drawable/Drawable;->setState([I)Z
.line 30
.line 31
.line 32
:cond_0
iget-boolean v0, p1, Landroidx/appcompat/widget/TintInfo;->d:Z
.line 33
.line 34
if-nez v0, :cond_2
.line 35
.line 36
iget-boolean v1, p1, Landroidx/appcompat/widget/TintInfo;->c:Z
.line 37
.line 38
if-eqz v1, :cond_1
.line 39
.line 40
goto :goto_0
.line 41
:cond_1
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->clearColorFilter()V
.line 42
.line 43
.line 44
goto :goto_4
.line 45
:cond_2
:goto_0
const/4 v1, 0x0
.line 46
if-eqz v0, :cond_3
.line 47
.line 48
iget-object v0, p1, Landroidx/appcompat/widget/TintInfo;->a:Landroid/content/res/ColorStateList;
.line 49
.line 50
goto :goto_1
.line 51
:cond_3
move-object v0, v1
.line 52
:goto_1
iget-boolean v3, p1, Landroidx/appcompat/widget/TintInfo;->c:Z
.line 53
.line 54
if-eqz v3, :cond_4
.line 55
.line 56
iget-object p1, p1, Landroidx/appcompat/widget/TintInfo;->b:Landroid/graphics/PorterDuff$Mode;
.line 57
.line 58
goto :goto_2
.line 59
:cond_4
sget-object p1, Landroidx/appcompat/widget/ResourceManagerInternal;->h:Landroid/graphics/PorterDuff$Mode;
.line 60
.line 61
:goto_2
if-eqz v0, :cond_6
.line 62
.line 63
if-nez p1, :cond_5
.line 64
.line 65
goto :goto_3
.line 66
:cond_5
invoke-virtual {v0, p2, v2}, Landroid/content/res/ColorStateList;->getColorForState([II)I
.line 67
.line 68
.line 69
move-result p2
.line 70
invoke-static {p2, p1}, Landroidx/appcompat/widget/ResourceManagerInternal;->g(ILandroid/graphics/PorterDuff$Mode;)Landroid/graphics/PorterDuffColorFilter;
.line 71
.line 72
.line 73
move-result-object v1
.line 74
:cond_6
:goto_3
invoke-virtual {p0, v1}, Landroid/graphics/drawable/Drawable;->setColorFilter(Landroid/graphics/ColorFilter;)V
.line 75
.line 76
.line 77
:goto_4
sget p1, Landroid/os/Build$VERSION;->SDK_INT:I
.line 78
.line 79
const/16 p2, 0x17
.line 80
.line 81
if-gt p1, p2, :cond_7
.line 82
.line 83
invoke-virtual {p0}, Landroid/graphics/drawable/Drawable;->invalidateSelf()V
.line 84
.line 85
.line 86
:cond_7
return-void
.line 87
:cond_8
const-string p0, "ResourceManagerInternal"
.line 88
.line 89
const-string p1, "Mutated drawable is not the same instance as the input."
.line 90
.line 91
invoke-static {p0, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 92
.line 93
.line 94
return-void
.end method
# virtual methods
.method public final declared-synchronized b(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;
.locals 1
.line 1
monitor-enter p0
.line 2
:try_start_0
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatDrawableManager;->a:Landroidx/appcompat/widget/ResourceManagerInternal;
.line 3
.line 4
invoke-virtual {v0, p1, p2}, Landroidx/appcompat/widget/ResourceManagerInternal;->e(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;
.line 5
.line 6
.line 7
move-result-object p1
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 8
monitor-exit p0
.line 9
return-object p1
.line 10
:catchall_0
move-exception p1
.line 11
:try_start_1
monitor-exit p0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 12
throw p1
.end method