soul-browser/app/smali/com/google/android/gms/cast/CastRemoteDisplayLocalService.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

386 lines
8.3 KiB
Smali

.class public abstract Lcom/google/android/gms/cast/CastRemoteDisplayLocalService;
.super Landroid/app/Service;
.source "SourceFile"
# annotations
.annotation build Landroid/annotation/SuppressLint;
value = {
"ForegroundServiceType"
}
.end annotation
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/google/android/gms/cast/CastRemoteDisplayLocalService$Options;,
Lcom/google/android/gms/cast/CastRemoteDisplayLocalService$NotificationSettings;,
Lcom/google/android/gms/cast/CastRemoteDisplayLocalService$Callbacks;
}
.end annotation
.annotation runtime Ljava/lang/Deprecated;
.end annotation
# static fields
.field public static final c:Lcom/google/android/gms/cast/internal/Logger;
.field public static final f:Ljava/lang/Object;
.field public static final g:Ljava/util/concurrent/atomic/AtomicBoolean;
# direct methods
.method static constructor <clinit>()V
.locals 3
.line 1
new-instance v0, Lcom/google/android/gms/cast/internal/Logger;
.line 2
.line 3
const-string v1, "CastRDLocalService"
.line 4
.line 5
const/4 v2, 0x0
.line 6
invoke-direct {v0, v1, v2}, Lcom/google/android/gms/cast/internal/Logger;-><init>(Ljava/lang/String;Ljava/lang/String;)V
.line 7
.line 8
.line 9
sput-object v0, Lcom/google/android/gms/cast/CastRemoteDisplayLocalService;->c:Lcom/google/android/gms/cast/internal/Logger;
.line 10
.line 11
new-instance v0, Ljava/lang/Object;
.line 12
.line 13
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
.line 14
.line 15
.line 16
sput-object v0, Lcom/google/android/gms/cast/CastRemoteDisplayLocalService;->f:Ljava/lang/Object;
.line 17
.line 18
new-instance v0, Ljava/util/concurrent/atomic/AtomicBoolean;
.line 19
.line 20
const/4 v1, 0x0
.line 21
invoke-direct {v0, v1}, Ljava/util/concurrent/atomic/AtomicBoolean;-><init>(Z)V
.line 22
.line 23
.line 24
sput-object v0, Lcom/google/android/gms/cast/CastRemoteDisplayLocalService;->g:Ljava/util/concurrent/atomic/AtomicBoolean;
.line 25
.line 26
return-void
.end method
.method public static a()V
.locals 5
.line 1
sget-object v0, Lcom/google/android/gms/cast/CastRemoteDisplayLocalService;->c:Lcom/google/android/gms/cast/internal/Logger;
.line 2
.line 3
const-string v1, "Stopping Service"
.line 4
.line 5
const/4 v2, 0x0
.line 6
new-array v3, v2, [Ljava/lang/Object;
.line 7
.line 8
invoke-virtual {v0, v1, v3}, Lcom/google/android/gms/cast/internal/Logger;->b(Ljava/lang/String;[Ljava/lang/Object;)V
.line 9
.line 10
.line 11
sget-object v1, Lcom/google/android/gms/cast/CastRemoteDisplayLocalService;->g:Ljava/util/concurrent/atomic/AtomicBoolean;
.line 12
.line 13
invoke-virtual {v1, v2}, Ljava/util/concurrent/atomic/AtomicBoolean;->set(Z)V
.line 14
.line 15
.line 16
sget-object v1, Lcom/google/android/gms/cast/CastRemoteDisplayLocalService;->f:Ljava/lang/Object;
.line 17
.line 18
monitor-enter v1
.line 19
:try_start_0
const-string v3, "Service is already being stopped"
.line 20
.line 21
new-array v2, v2, [Ljava/lang/Object;
.line 22
.line 23
iget-object v4, v0, Lcom/google/android/gms/cast/internal/Logger;->a:Ljava/lang/String;
.line 24
.line 25
invoke-virtual {v0, v3, v2}, Lcom/google/android/gms/cast/internal/Logger;->d(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
.line 26
.line 27
.line 28
move-result-object v0
.line 29
invoke-static {v4, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 30
.line 31
.line 32
monitor-exit v1
.line 33
return-void
.line 34
:catchall_0
move-exception v0
.line 35
monitor-exit v1
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 36
throw v0
.end method
# virtual methods
.method public final b(Ljava/lang/String;)V
.locals 2
.line 1
const/4 v0, 0x2
.line 2
new-array v0, v0, [Ljava/lang/Object;
.line 3
.line 4
const/4 v1, 0x0
.line 5
aput-object p0, v0, v1
.line 6
.line 7
const/4 v1, 0x1
.line 8
aput-object p1, v0, v1
.line 9
.line 10
const-string p1, "[Instance: %s] %s"
.line 11
.line 12
sget-object v1, Lcom/google/android/gms/cast/CastRemoteDisplayLocalService;->c:Lcom/google/android/gms/cast/internal/Logger;
.line 13
.line 14
invoke-virtual {v1, p1, v0}, Lcom/google/android/gms/cast/internal/Logger;->b(Ljava/lang/String;[Ljava/lang/Object;)V
.line 15
.line 16
.line 17
return-void
.end method
.method public final onBind(Landroid/content/Intent;)Landroid/os/IBinder;
.locals 0
.line 1
const-string p1, "onBind"
.line 2
.line 3
invoke-virtual {p0, p1}, Lcom/google/android/gms/cast/CastRemoteDisplayLocalService;->b(Ljava/lang/String;)V
.line 4
.line 5
.line 6
const/4 p1, 0x0
.line 7
return-object p1
.end method
.method public final onCreate()V
.locals 5
.line 1
const-string v0, "onCreate"
.line 2
.line 3
invoke-virtual {p0, v0}, Lcom/google/android/gms/cast/CastRemoteDisplayLocalService;->b(Ljava/lang/String;)V
.line 4
.line 5
.line 6
invoke-super {p0}, Landroid/app/Service;->onCreate()V
.line 7
.line 8
.line 9
new-instance v0, Lcom/google/android/gms/internal/cast/zzfk;
.line 10
.line 11
invoke-virtual {p0}, Landroid/content/Context;->getMainLooper()Landroid/os/Looper;
.line 12
.line 13
.line 14
move-result-object v1
.line 15
invoke-direct {v0, v1}, Lcom/google/android/gms/internal/cast/zzfk;-><init>(Landroid/os/Looper;)V
.line 16
.line 17
.line 18
new-instance v1, Lcom/google/android/gms/cast/zzac;
.line 19
.line 20
invoke-direct {v1, p0}, Lcom/google/android/gms/cast/zzac;-><init>(Lcom/google/android/gms/cast/CastRemoteDisplayLocalService;)V
.line 21
.line 22
.line 23
const-wide/16 v2, 0x64
.line 24
.line 25
invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
.line 26
.line 27
.line 28
invoke-static {}, Lcom/google/android/gms/common/util/PlatformVersion;->isAtLeastO()Z
.line 29
.line 30
.line 31
move-result v0
.line 32
if-nez v0, :cond_0
.line 33
.line 34
return-void
.line 35
:cond_0
const-class v0, Landroid/app/NotificationManager;
.line 36
.line 37
invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/Class;)Ljava/lang/Object;
.line 38
.line 39
.line 40
move-result-object v0
.line 41
check-cast v0, Landroid/app/NotificationManager;
.line 42
.line 43
new-instance v1, Landroid/app/NotificationChannel;
.line 44
.line 45
sget v1, Lcom/google/android/gms/cast/R$string;->cast_notification_default_channel_name:I
.line 46
.line 47
invoke-virtual {p0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;
.line 48
.line 49
.line 50
move-result-object v1
.line 51
new-instance v2, Landroid/app/NotificationChannel;
.line 52
.line 53
const-string v3, "cast_remote_display_local_service"
.line 54
.line 55
const/4 v4, 0x2
.line 56
invoke-direct {v2, v3, v1, v4}, Landroid/app/NotificationChannel;-><init>(Ljava/lang/String;Ljava/lang/CharSequence;I)V
.line 57
.line 58
.line 59
const/4 v1, 0x0
.line 60
invoke-virtual {v2, v1}, Landroid/app/NotificationChannel;->setShowBadge(Z)V
.line 61
.line 62
.line 63
invoke-virtual {v0, v2}, Landroid/app/NotificationManager;->createNotificationChannel(Landroid/app/NotificationChannel;)V
.line 64
.line 65
.line 66
return-void
.end method
.method public final onStartCommand(Landroid/content/Intent;II)I
.locals 0
.line 1
const-string p1, "onStartCommand"
.line 2
.line 3
invoke-virtual {p0, p1}, Lcom/google/android/gms/cast/CastRemoteDisplayLocalService;->b(Ljava/lang/String;)V
.line 4
.line 5
.line 6
const/4 p1, 0x2
.line 7
return p1
.end method