soul-browser/app/smali/androidx/work/impl/background/systemalarm/Alarms.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

366 lines
7.9 KiB
Smali

.class Landroidx/work/impl/background/systemalarm/Alarms;
.super Ljava/lang/Object;
.source "SourceFile"
# annotations
.annotation build Landroidx/annotation/RestrictTo;
.end annotation
# static fields
.field public static final a:Ljava/lang/String;
# direct methods
.method static constructor <clinit>()V
.locals 1
.line 1
const-string v0, "Alarms"
.line 2
.line 3
invoke-static {v0}, Landroidx/work/Logger;->e(Ljava/lang/String;)Ljava/lang/String;
.line 4
.line 5
.line 6
move-result-object v0
.line 7
sput-object v0, Landroidx/work/impl/background/systemalarm/Alarms;->a:Ljava/lang/String;
.line 8
.line 9
return-void
.end method
.method public static a(Landroid/content/Context;ILjava/lang/String;)V
.locals 4
.line 1
const-string v0, "alarm"
.line 2
.line 3
invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
.line 4
.line 5
.line 6
move-result-object v0
.line 7
check-cast v0, Landroid/app/AlarmManager;
.line 8
.line 9
invoke-static {p0, p2}, Landroidx/work/impl/background/systemalarm/CommandHandler;->a(Landroid/content/Context;Ljava/lang/String;)Landroid/content/Intent;
.line 10
.line 11
.line 12
move-result-object v1
.line 13
const/high16 v2, 0x24000000
.line 14
.line 15
invoke-static {p0, p1, v1, v2}, Landroid/app/PendingIntent;->getService(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;
.line 16
.line 17
.line 18
move-result-object p0
.line 19
if-eqz p0, :cond_0
.line 20
.line 21
if-eqz v0, :cond_0
.line 22
.line 23
invoke-static {}, Landroidx/work/Logger;->c()Landroidx/work/Logger;
.line 24
.line 25
.line 26
move-result-object v1
.line 27
new-instance v2, Ljava/lang/StringBuilder;
.line 28
.line 29
const-string v3, "Cancelling existing alarm with (workSpecId, systemId) ("
.line 30
.line 31
invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
.line 32
.line 33
.line 34
invoke-virtual {v2, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
.line 35
.line 36
.line 37
const-string p2, ", "
.line 38
.line 39
invoke-virtual {v2, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
.line 40
.line 41
.line 42
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
.line 43
.line 44
.line 45
const-string p1, ")"
.line 46
.line 47
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
.line 48
.line 49
.line 50
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
.line 51
.line 52
.line 53
move-result-object p1
.line 54
const/4 p2, 0x0
.line 55
new-array p2, p2, [Ljava/lang/Throwable;
.line 56
.line 57
sget-object v2, Landroidx/work/impl/background/systemalarm/Alarms;->a:Ljava/lang/String;
.line 58
.line 59
invoke-virtual {v1, v2, p1, p2}, Landroidx/work/Logger;->a(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Throwable;)V
.line 60
.line 61
.line 62
invoke-virtual {v0, p0}, Landroid/app/AlarmManager;->cancel(Landroid/app/PendingIntent;)V
.line 63
.line 64
.line 65
:cond_0
return-void
.end method
.method public static b(Landroid/content/Context;Landroidx/work/impl/WorkManagerImpl;Ljava/lang/String;J)V
.locals 5
.line 1
iget-object p1, p1, Landroidx/work/impl/WorkManagerImpl;->c:Landroidx/work/impl/WorkDatabase;
.line 2
.line 3
invoke-virtual {p1}, Landroidx/work/impl/WorkDatabase;->k()Landroidx/work/impl/model/SystemIdInfoDao;
.line 4
.line 5
.line 6
move-result-object v0
.line 7
invoke-interface {v0, p2}, Landroidx/work/impl/model/SystemIdInfoDao;->c(Ljava/lang/String;)Landroidx/work/impl/model/SystemIdInfo;
.line 8
.line 9
.line 10
move-result-object v1
.line 11
const/4 v2, 0x0
.line 12
const/high16 v3, 0xc000000
.line 13
.line 14
if-eqz v1, :cond_0
.line 15
.line 16
iget p1, v1, Landroidx/work/impl/model/SystemIdInfo;->b:I
.line 17
.line 18
invoke-static {p0, p1, p2}, Landroidx/work/impl/background/systemalarm/Alarms;->a(Landroid/content/Context;ILjava/lang/String;)V
.line 19
.line 20
.line 21
iget p1, v1, Landroidx/work/impl/model/SystemIdInfo;->b:I
.line 22
.line 23
const-string v0, "alarm"
.line 24
.line 25
invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
.line 26
.line 27
.line 28
move-result-object v0
.line 29
check-cast v0, Landroid/app/AlarmManager;
.line 30
.line 31
invoke-static {p0, p2}, Landroidx/work/impl/background/systemalarm/CommandHandler;->a(Landroid/content/Context;Ljava/lang/String;)Landroid/content/Intent;
.line 32
.line 33
.line 34
move-result-object p2
.line 35
invoke-static {p0, p1, p2, v3}, Landroid/app/PendingIntent;->getService(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;
.line 36
.line 37
.line 38
move-result-object p0
.line 39
if-eqz v0, :cond_1
.line 40
.line 41
invoke-virtual {v0, v2, p3, p4, p0}, Landroid/app/AlarmManager;->setExact(IJLandroid/app/PendingIntent;)V
.line 42
.line 43
.line 44
return-void
.line 45
:cond_0
new-instance v1, Landroidx/work/impl/utils/IdGenerator;
.line 46
.line 47
invoke-direct {v1, p1}, Landroidx/work/impl/utils/IdGenerator;-><init>(Landroidx/work/impl/WorkDatabase;)V
.line 48
.line 49
.line 50
const-class p1, Landroidx/work/impl/utils/IdGenerator;
.line 51
.line 52
monitor-enter p1
.line 53
:try_start_0
const-string v4, "next_alarm_manager_id"
.line 54
.line 55
invoke-virtual {v1, v4}, Landroidx/work/impl/utils/IdGenerator;->a(Ljava/lang/String;)I
.line 56
.line 57
.line 58
move-result v1
.line 59
monitor-exit p1
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 60
new-instance p1, Landroidx/work/impl/model/SystemIdInfo;
.line 61
.line 62
invoke-direct {p1, p2, v1}, Landroidx/work/impl/model/SystemIdInfo;-><init>(Ljava/lang/String;I)V
.line 63
.line 64
.line 65
invoke-interface {v0, p1}, Landroidx/work/impl/model/SystemIdInfoDao;->b(Landroidx/work/impl/model/SystemIdInfo;)V
.line 66
.line 67
.line 68
const-string p1, "alarm"
.line 69
.line 70
invoke-virtual {p0, p1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
.line 71
.line 72
.line 73
move-result-object p1
.line 74
check-cast p1, Landroid/app/AlarmManager;
.line 75
.line 76
invoke-static {p0, p2}, Landroidx/work/impl/background/systemalarm/CommandHandler;->a(Landroid/content/Context;Ljava/lang/String;)Landroid/content/Intent;
.line 77
.line 78
.line 79
move-result-object p2
.line 80
invoke-static {p0, v1, p2, v3}, Landroid/app/PendingIntent;->getService(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;
.line 81
.line 82
.line 83
move-result-object p0
.line 84
if-eqz p1, :cond_1
.line 85
.line 86
invoke-virtual {p1, v2, p3, p4, p0}, Landroid/app/AlarmManager;->setExact(IJLandroid/app/PendingIntent;)V
.line 87
.line 88
.line 89
:cond_1
return-void
.line 90
:catchall_0
move-exception p0
.line 91
:try_start_1
monitor-exit p1
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 92
throw p0
.end method