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

337 lines
7.1 KiB
Smali

.class public Landroidx/appcompat/widget/AppCompatImageHelper;
.super Ljava/lang/Object;
.source "SourceFile"
# annotations
.annotation build Landroidx/annotation/RestrictTo;
.end annotation
# instance fields
.field public final a:Landroid/widget/ImageView;
.field public b:Landroidx/appcompat/widget/TintInfo;
.field public c:I
# direct methods
.method public constructor <init>(Landroid/widget/ImageView;)V
.locals 1
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 2
.line 3
.line 4
const/4 v0, 0x0
.line 5
iput v0, p0, Landroidx/appcompat/widget/AppCompatImageHelper;->c:I
.line 6
.line 7
iput-object p1, p0, Landroidx/appcompat/widget/AppCompatImageHelper;->a:Landroid/widget/ImageView;
.line 8
.line 9
return-void
.end method
# virtual methods
.method public final a()V
.locals 3
.line 1
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatImageHelper;->a:Landroid/widget/ImageView;
.line 2
.line 3
invoke-virtual {v0}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;
.line 4
.line 5
.line 6
move-result-object v1
.line 7
if-eqz v1, :cond_0
.line 8
.line 9
invoke-static {v1}, Landroidx/appcompat/widget/DrawableUtils;->a(Landroid/graphics/drawable/Drawable;)V
.line 10
.line 11
.line 12
:cond_0
if-eqz v1, :cond_1
.line 13
.line 14
iget-object v2, p0, Landroidx/appcompat/widget/AppCompatImageHelper;->b:Landroidx/appcompat/widget/TintInfo;
.line 15
.line 16
if-eqz v2, :cond_1
.line 17
.line 18
invoke-virtual {v0}, Landroid/view/View;->getDrawableState()[I
.line 19
.line 20
.line 21
move-result-object v0
.line 22
invoke-static {v1, v2, v0}, Landroidx/appcompat/widget/AppCompatDrawableManager;->e(Landroid/graphics/drawable/Drawable;Landroidx/appcompat/widget/TintInfo;[I)V
.line 23
.line 24
.line 25
:cond_1
return-void
.end method
.method public final b(Landroid/util/AttributeSet;I)V
.locals 8
.line 1
iget-object v0, p0, Landroidx/appcompat/widget/AppCompatImageHelper;->a:Landroid/widget/ImageView;
.line 2
.line 3
invoke-virtual {v0}, Landroid/view/View;->getContext()Landroid/content/Context;
.line 4
.line 5
.line 6
move-result-object v1
.line 7
sget-object v2, Landroidx/appcompat/R$styleable;->AppCompatImageView:[I
.line 8
.line 9
invoke-static {v1, p1, v2, p2}, Landroidx/appcompat/widget/TintTypedArray;->e(Landroid/content/Context;Landroid/util/AttributeSet;[II)Landroidx/appcompat/widget/TintTypedArray;
.line 10
.line 11
.line 12
move-result-object v6
.line 13
iget-object v7, v6, Landroidx/appcompat/widget/TintTypedArray;->b:Landroid/content/res/TypedArray;
.line 14
.line 15
invoke-virtual {v0}, Landroid/view/View;->getContext()Landroid/content/Context;
.line 16
.line 17
.line 18
move-result-object v1
.line 19
sget-object v2, Landroidx/appcompat/R$styleable;->AppCompatImageView:[I
.line 20
.line 21
iget-object v4, v6, Landroidx/appcompat/widget/TintTypedArray;->b:Landroid/content/res/TypedArray;
.line 22
.line 23
move-object v3, p1
.line 24
move v5, p2
.line 25
invoke-static/range {v0 .. v5}, Landroidx/core/view/ViewCompat;->y(Landroid/view/View;Landroid/content/Context;[ILandroid/util/AttributeSet;Landroid/content/res/TypedArray;I)V
.line 26
.line 27
.line 28
:try_start_0
invoke-virtual {v0}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;
.line 29
.line 30
.line 31
move-result-object p1
.line 32
const/4 p2, -0x1
.line 33
if-nez p1, :cond_0
.line 34
.line 35
sget v1, Landroidx/appcompat/R$styleable;->AppCompatImageView_srcCompat:I
.line 36
.line 37
invoke-virtual {v7, v1, p2}, Landroid/content/res/TypedArray;->getResourceId(II)I
.line 38
.line 39
.line 40
move-result v1
.line 41
if-eq v1, p2, :cond_0
.line 42
.line 43
invoke-virtual {v0}, Landroid/view/View;->getContext()Landroid/content/Context;
.line 44
.line 45
.line 46
move-result-object p1
.line 47
invoke-static {p1, v1}, Landroidx/appcompat/content/res/AppCompatResources;->a(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;
.line 48
.line 49
.line 50
move-result-object p1
.line 51
if-eqz p1, :cond_0
.line 52
.line 53
invoke-virtual {v0, p1}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V
.line 54
.line 55
.line 56
goto :goto_0
.line 57
:catchall_0
move-exception v0
.line 58
move-object p1, v0
.line 59
goto :goto_1
.line 60
:cond_0
:goto_0
if-eqz p1, :cond_1
.line 61
.line 62
invoke-static {p1}, Landroidx/appcompat/widget/DrawableUtils;->a(Landroid/graphics/drawable/Drawable;)V
.line 63
.line 64
.line 65
:cond_1
sget p1, Landroidx/appcompat/R$styleable;->AppCompatImageView_tint:I
.line 66
.line 67
invoke-virtual {v7, p1}, Landroid/content/res/TypedArray;->hasValue(I)Z
.line 68
.line 69
.line 70
move-result p1
.line 71
if-eqz p1, :cond_2
.line 72
.line 73
sget p1, Landroidx/appcompat/R$styleable;->AppCompatImageView_tint:I
.line 74
.line 75
invoke-virtual {v6, p1}, Landroidx/appcompat/widget/TintTypedArray;->a(I)Landroid/content/res/ColorStateList;
.line 76
.line 77
.line 78
move-result-object p1
.line 79
invoke-virtual {v0, p1}, Landroid/widget/ImageView;->setImageTintList(Landroid/content/res/ColorStateList;)V
.line 80
.line 81
.line 82
:cond_2
sget p1, Landroidx/appcompat/R$styleable;->AppCompatImageView_tintMode:I
.line 83
.line 84
invoke-virtual {v7, p1}, Landroid/content/res/TypedArray;->hasValue(I)Z
.line 85
.line 86
.line 87
move-result p1
.line 88
if-eqz p1, :cond_3
.line 89
.line 90
sget p1, Landroidx/appcompat/R$styleable;->AppCompatImageView_tintMode:I
.line 91
.line 92
invoke-virtual {v7, p1, p2}, Landroid/content/res/TypedArray;->getInt(II)I
.line 93
.line 94
.line 95
move-result p1
.line 96
const/4 p2, 0x0
.line 97
invoke-static {p1, p2}, Landroidx/appcompat/widget/DrawableUtils;->c(ILandroid/graphics/PorterDuff$Mode;)Landroid/graphics/PorterDuff$Mode;
.line 98
.line 99
.line 100
move-result-object p1
.line 101
invoke-virtual {v0, p1}, Landroid/widget/ImageView;->setImageTintMode(Landroid/graphics/PorterDuff$Mode;)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 102
.line 103
.line 104
:cond_3
invoke-virtual {v6}, Landroidx/appcompat/widget/TintTypedArray;->f()V
.line 105
.line 106
.line 107
return-void
.line 108
:goto_1
invoke-virtual {v6}, Landroidx/appcompat/widget/TintTypedArray;->f()V
.line 109
.line 110
.line 111
throw p1
.end method