soul-browser/app/smali/androidx/work/impl/WorkDatabaseMigrations$WorkMigration9To10.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

421 lines
8.4 KiB
Smali

.class public Landroidx/work/impl/WorkDatabaseMigrations$WorkMigration9To10;
.super Landroidx/room/migration/Migration;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Landroidx/work/impl/WorkDatabaseMigrations;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x9
name = "WorkMigration9To10"
.end annotation
# instance fields
.field public final c:Landroid/content/Context;
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 2
.line 1
const/16 v0, 0x9
.line 2
.line 3
const/16 v1, 0xa
.line 4
.line 5
invoke-direct {p0, v0, v1}, Landroidx/room/migration/Migration;-><init>(II)V
.line 6
.line 7
.line 8
iput-object p1, p0, Landroidx/work/impl/WorkDatabaseMigrations$WorkMigration9To10;->c:Landroid/content/Context;
.line 9
.line 10
return-void
.end method
# virtual methods
.method public final a(Landroidx/sqlite/db/SupportSQLiteDatabase;)V
.locals 12
.line 1
const-string v0, "CREATE TABLE IF NOT EXISTS `Preference` (`key` TEXT NOT NULL, `long_value` INTEGER, PRIMARY KEY(`key`))"
.line 2
.line 3
invoke-interface {p1, v0}, Landroidx/sqlite/db/SupportSQLiteDatabase;->s(Ljava/lang/String;)V
.line 4
.line 5
.line 6
iget-object v0, p0, Landroidx/work/impl/WorkDatabaseMigrations$WorkMigration9To10;->c:Landroid/content/Context;
.line 7
.line 8
const-string v1, "androidx.work.util.preferences"
.line 9
.line 10
const/4 v2, 0x0
.line 11
invoke-virtual {v0, v1, v2}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
.line 12
.line 13
.line 14
move-result-object v1
.line 15
const-string v3, "reschedule_needed"
.line 16
.line 17
invoke-interface {v1, v3}, Landroid/content/SharedPreferences;->contains(Ljava/lang/String;)Z
.line 18
.line 19
.line 20
move-result v4
.line 21
const/4 v5, 0x1
.line 22
const/4 v6, 0x2
.line 23
const-string v7, "last_cancel_all_time_ms"
.line 24
.line 25
if-nez v4, :cond_0
.line 26
.line 27
invoke-interface {v1, v7}, Landroid/content/SharedPreferences;->contains(Ljava/lang/String;)Z
.line 28
.line 29
.line 30
move-result v4
.line 31
if-eqz v4, :cond_2
.line 32
.line 33
:cond_0
const-wide/16 v8, 0x0
.line 34
.line 35
invoke-interface {v1, v7, v8, v9}, Landroid/content/SharedPreferences;->getLong(Ljava/lang/String;J)J
.line 36
.line 37
.line 38
move-result-wide v10
.line 39
invoke-interface {v1, v3, v2}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z
.line 40
.line 41
.line 42
move-result v4
.line 43
if-eqz v4, :cond_1
.line 44
.line 45
const-wide/16 v8, 0x1
.line 46
.line 47
:cond_1
invoke-interface {p1}, Landroidx/sqlite/db/SupportSQLiteDatabase;->p()V
.line 48
.line 49
.line 50
:try_start_0
invoke-static {v10, v11}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
.line 51
.line 52
.line 53
move-result-object v4
.line 54
new-array v10, v6, [Ljava/lang/Object;
.line 55
.line 56
aput-object v7, v10, v2
.line 57
.line 58
aput-object v4, v10, v5
.line 59
.line 60
invoke-interface {p1, v10}, Landroidx/sqlite/db/SupportSQLiteDatabase;->J([Ljava/lang/Object;)V
.line 61
.line 62
.line 63
invoke-static {v8, v9}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
.line 64
.line 65
.line 66
move-result-object v4
.line 67
new-array v7, v6, [Ljava/lang/Object;
.line 68
.line 69
aput-object v3, v7, v2
.line 70
.line 71
aput-object v4, v7, v5
.line 72
.line 73
invoke-interface {p1, v7}, Landroidx/sqlite/db/SupportSQLiteDatabase;->J([Ljava/lang/Object;)V
.line 74
.line 75
.line 76
invoke-interface {v1}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
.line 77
.line 78
.line 79
move-result-object v1
.line 80
invoke-interface {v1}, Landroid/content/SharedPreferences$Editor;->clear()Landroid/content/SharedPreferences$Editor;
.line 81
.line 82
.line 83
move-result-object v1
.line 84
invoke-interface {v1}, Landroid/content/SharedPreferences$Editor;->apply()V
.line 85
.line 86
.line 87
invoke-interface {p1}, Landroidx/sqlite/db/SupportSQLiteDatabase;->K()V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_1
.line 88
.line 89
.line 90
invoke-interface {p1}, Landroidx/sqlite/db/SupportSQLiteDatabase;->V()V
.line 91
.line 92
.line 93
:cond_2
const-string v1, "androidx.work.util.id"
.line 94
.line 95
invoke-virtual {v0, v1, v2}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
.line 96
.line 97
.line 98
move-result-object v0
.line 99
const-string v1, "next_job_scheduler_id"
.line 100
.line 101
invoke-interface {v0, v1}, Landroid/content/SharedPreferences;->contains(Ljava/lang/String;)Z
.line 102
.line 103
.line 104
move-result v3
.line 105
if-nez v3, :cond_4
.line 106
.line 107
invoke-interface {v0, v1}, Landroid/content/SharedPreferences;->contains(Ljava/lang/String;)Z
.line 108
.line 109
.line 110
move-result v3
.line 111
if-eqz v3, :cond_3
.line 112
.line 113
goto :goto_0
.line 114
:cond_3
return-void
.line 115
:cond_4
:goto_0
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I
.line 116
.line 117
.line 118
move-result v3
.line 119
const-string v4, "next_alarm_manager_id"
.line 120
.line 121
invoke-interface {v0, v4, v2}, Landroid/content/SharedPreferences;->getInt(Ljava/lang/String;I)I
.line 122
.line 123
.line 124
move-result v7
.line 125
invoke-interface {p1}, Landroidx/sqlite/db/SupportSQLiteDatabase;->p()V
.line 126
.line 127
.line 128
:try_start_1
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
.line 129
.line 130
.line 131
move-result-object v3
.line 132
new-array v8, v6, [Ljava/lang/Object;
.line 133
.line 134
aput-object v1, v8, v2
.line 135
.line 136
aput-object v3, v8, v5
.line 137
.line 138
invoke-interface {p1, v8}, Landroidx/sqlite/db/SupportSQLiteDatabase;->J([Ljava/lang/Object;)V
.line 139
.line 140
.line 141
invoke-static {v7}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
.line 142
.line 143
.line 144
move-result-object v1
.line 145
new-array v3, v6, [Ljava/lang/Object;
.line 146
.line 147
aput-object v4, v3, v2
.line 148
.line 149
aput-object v1, v3, v5
.line 150
.line 151
invoke-interface {p1, v3}, Landroidx/sqlite/db/SupportSQLiteDatabase;->J([Ljava/lang/Object;)V
.line 152
.line 153
.line 154
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
.line 155
.line 156
.line 157
move-result-object v0
.line 158
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->clear()Landroid/content/SharedPreferences$Editor;
.line 159
.line 160
.line 161
move-result-object v0
.line 162
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->apply()V
.line 163
.line 164
.line 165
invoke-interface {p1}, Landroidx/sqlite/db/SupportSQLiteDatabase;->K()V
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 166
.line 167
.line 168
invoke-interface {p1}, Landroidx/sqlite/db/SupportSQLiteDatabase;->V()V
.line 169
.line 170
.line 171
return-void
.line 172
:catchall_0
move-exception v0
.line 173
invoke-interface {p1}, Landroidx/sqlite/db/SupportSQLiteDatabase;->V()V
.line 174
.line 175
.line 176
throw v0
.line 177
:catchall_1
move-exception v0
.line 178
invoke-interface {p1}, Landroidx/sqlite/db/SupportSQLiteDatabase;->V()V
.line 179
.line 180
.line 181
throw v0
.end method