soul-browser/app/smali/com/google/android/gms/drive/events/DriveEventService.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

555 lines
12 KiB
Smali

.class public Lcom/google/android/gms/drive/events/DriveEventService;
.super Landroid/app/Service;
# interfaces
.implements Lcom/google/android/gms/drive/events/ChangeListener;
.implements Lcom/google/android/gms/drive/events/CompletionListener;
.implements Lcom/google/android/gms/drive/events/zzd;
.implements Lcom/google/android/gms/drive/events/zzi;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/google/android/gms/drive/events/DriveEventService$zzb;,
Lcom/google/android/gms/drive/events/DriveEventService$zza;
}
.end annotation
# static fields
.field public static final i:Lcom/google/android/gms/common/internal/GmsLogger;
# instance fields
.field public c:Ljava/util/concurrent/CountDownLatch;
.field public f:Lcom/google/android/gms/drive/events/DriveEventService$zza;
.field public g:Z
.field public h:I
# direct methods
.method static constructor <clinit>()V
.locals 3
.line 1
new-instance v0, Lcom/google/android/gms/common/internal/GmsLogger;
.line 2
.line 3
const-string v1, "DriveEventService"
.line 4
.line 5
const-string v2, ""
.line 6
.line 7
invoke-direct {v0, v1, v2}, Lcom/google/android/gms/common/internal/GmsLogger;-><init>(Ljava/lang/String;Ljava/lang/String;)V
.line 8
.line 9
.line 10
sput-object v0, Lcom/google/android/gms/drive/events/DriveEventService;->i:Lcom/google/android/gms/common/internal/GmsLogger;
.line 11
.line 12
return-void
.end method
# virtual methods
.method public final a(Lcom/google/android/gms/drive/events/zzb;)V
.locals 3
.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
const/4 v2, 0x0
.line 6
aput-object v1, v0, v2
.line 7
.line 8
const/4 v1, 0x1
.line 9
aput-object p1, v0, v1
.line 10
.line 11
sget-object p1, Lcom/google/android/gms/drive/events/DriveEventService;->i:Lcom/google/android/gms/common/internal/GmsLogger;
.line 12
.line 13
const-string v1, "DriveEventService"
.line 14
.line 15
const-string v2, "Unhandled changes available event in %s: %s"
.line 16
.line 17
invoke-virtual {p1, v1, v2, v0}, Lcom/google/android/gms/common/internal/GmsLogger;->wfmt(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
.line 18
.line 19
.line 20
return-void
.end method
.method public final b(Lcom/google/android/gms/drive/events/CompletionEvent;)V
.locals 3
.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
const/4 v2, 0x0
.line 6
aput-object v1, v0, v2
.line 7
.line 8
const/4 v1, 0x1
.line 9
aput-object p1, v0, v1
.line 10
.line 11
sget-object p1, Lcom/google/android/gms/drive/events/DriveEventService;->i:Lcom/google/android/gms/common/internal/GmsLogger;
.line 12
.line 13
const-string v1, "DriveEventService"
.line 14
.line 15
const-string v2, "Unhandled completion event in %s: %s"
.line 16
.line 17
invoke-virtual {p1, v1, v2, v0}, Lcom/google/android/gms/common/internal/GmsLogger;->wfmt(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
.line 18
.line 19
.line 20
return-void
.end method
.method public final d(Lcom/google/android/gms/drive/events/ChangeEvent;)V
.locals 3
.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
const/4 v2, 0x0
.line 6
aput-object v1, v0, v2
.line 7
.line 8
const/4 v1, 0x1
.line 9
aput-object p1, v0, v1
.line 10
.line 11
sget-object p1, Lcom/google/android/gms/drive/events/DriveEventService;->i:Lcom/google/android/gms/common/internal/GmsLogger;
.line 12
.line 13
const-string v1, "DriveEventService"
.line 14
.line 15
const-string v2, "Unhandled change event in %s: %s"
.line 16
.line 17
invoke-virtual {p1, v1, v2, v0}, Lcom/google/android/gms/common/internal/GmsLogger;->wfmt(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
.line 18
.line 19
.line 20
return-void
.end method
.method public final declared-synchronized onBind(Landroid/content/Intent;)Landroid/os/IBinder;
.locals 3
.line 1
monitor-enter p0
.line 2
:try_start_0
const-string v0, "com.google.android.gms.drive.events.HANDLE_EVENT"
.line 3
.line 4
invoke-virtual {p1}, Landroid/content/Intent;->getAction()Ljava/lang/String;
.line 5
.line 6
.line 7
move-result-object p1
.line 8
invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
.line 9
.line 10
.line 11
move-result p1
.line 12
if-eqz p1, :cond_1
.line 13
.line 14
iget-object p1, p0, Lcom/google/android/gms/drive/events/DriveEventService;->f:Lcom/google/android/gms/drive/events/DriveEventService$zza;
.line 15
.line 16
if-nez p1, :cond_0
.line 17
.line 18
iget-boolean p1, p0, Lcom/google/android/gms/drive/events/DriveEventService;->g:Z
.line 19
.line 20
if-nez p1, :cond_0
.line 21
.line 22
const/4 p1, 0x1
.line 23
iput-boolean p1, p0, Lcom/google/android/gms/drive/events/DriveEventService;->g:Z
.line 24
.line 25
new-instance v0, Ljava/util/concurrent/CountDownLatch;
.line 26
.line 27
invoke-direct {v0, p1}, Ljava/util/concurrent/CountDownLatch;-><init>(I)V
.line 28
.line 29
.line 30
new-instance v1, Ljava/util/concurrent/CountDownLatch;
.line 31
.line 32
invoke-direct {v1, p1}, Ljava/util/concurrent/CountDownLatch;-><init>(I)V
.line 33
.line 34
.line 35
iput-object v1, p0, Lcom/google/android/gms/drive/events/DriveEventService;->c:Ljava/util/concurrent/CountDownLatch;
.line 36
.line 37
new-instance p1, Lcom/google/android/gms/drive/events/zzh;
.line 38
.line 39
invoke-direct {p1, p0, v0}, Lcom/google/android/gms/drive/events/zzh;-><init>(Lcom/google/android/gms/drive/events/DriveEventService;Ljava/util/concurrent/CountDownLatch;)V
.line 40
.line 41
.line 42
invoke-virtual {p1}, Ljava/lang/Thread;->start()V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 43
.line 44
.line 45
:try_start_1
sget-object p1, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
.line 46
.line 47
const-wide/16 v1, 0x1388
.line 48
.line 49
invoke-virtual {v0, v1, v2, p1}, Ljava/util/concurrent/CountDownLatch;->await(JLjava/util/concurrent/TimeUnit;)Z
.line 50
.line 51
.line 52
move-result p1
.line 53
if-nez p1, :cond_0
.line 54
.line 55
sget-object p1, Lcom/google/android/gms/drive/events/DriveEventService;->i:Lcom/google/android/gms/common/internal/GmsLogger;
.line 56
.line 57
const-string v0, "DriveEventService"
.line 58
.line 59
const-string v1, "Failed to synchronously initialize event handler."
.line 60
.line 61
invoke-virtual {p1, v0, v1}, Lcom/google/android/gms/common/internal/GmsLogger;->e(Ljava/lang/String;Ljava/lang/String;)V
:try_end_1
.catch Ljava/lang/InterruptedException; {:try_start_1 .. :try_end_1} :catch_0
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 62
.line 63
.line 64
goto :goto_0
.line 65
:catchall_0
move-exception p1
.line 66
goto :goto_1
.line 67
:catch_0
move-exception p1
.line 68
:try_start_2
new-instance v0, Ljava/lang/RuntimeException;
.line 69
.line 70
const-string v1, "Unable to start event handler"
.line 71
.line 72
invoke-direct {v0, v1, p1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
.line 73
.line 74
.line 75
throw v0
.line 76
:cond_0
:goto_0
new-instance p1, Lcom/google/android/gms/drive/events/DriveEventService$zzb;
.line 77
.line 78
invoke-direct {p1, p0}, Lcom/google/android/gms/drive/events/DriveEventService$zzb;-><init>(Lcom/google/android/gms/drive/events/DriveEventService;)V
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
.line 79
.line 80
.line 81
monitor-exit p0
.line 82
return-object p1
.line 83
:cond_1
monitor-exit p0
.line 84
const/4 p1, 0x0
.line 85
return-object p1
.line 86
:goto_1
:try_start_3
monitor-exit p0
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
.line 87
throw p1
.end method
.method public final declared-synchronized onDestroy()V
.locals 5
.line 1
monitor-enter p0
.line 2
:try_start_0
iget-object v0, p0, Lcom/google/android/gms/drive/events/DriveEventService;->f:Lcom/google/android/gms/drive/events/DriveEventService$zza;
.line 3
.line 4
if-eqz v0, :cond_1
.line 5
.line 6
sget v1, Lcom/google/android/gms/drive/events/DriveEventService$zza;->b:I
.line 7
.line 8
const/4 v1, 0x2
.line 9
invoke-virtual {v0, v1}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;
.line 10
.line 11
.line 12
move-result-object v0
.line 13
iget-object v1, p0, Lcom/google/android/gms/drive/events/DriveEventService;->f:Lcom/google/android/gms/drive/events/DriveEventService$zza;
.line 14
.line 15
invoke-virtual {v1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
.line 16
.line 17
.line 18
const/4 v0, 0x0
.line 19
iput-object v0, p0, Lcom/google/android/gms/drive/events/DriveEventService;->f:Lcom/google/android/gms/drive/events/DriveEventService$zza;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 20
.line 21
:try_start_1
iget-object v1, p0, Lcom/google/android/gms/drive/events/DriveEventService;->c:Ljava/util/concurrent/CountDownLatch;
.line 22
.line 23
sget-object v2, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
.line 24
.line 25
const-wide/16 v3, 0x1388
.line 26
.line 27
invoke-virtual {v1, v3, v4, v2}, Ljava/util/concurrent/CountDownLatch;->await(JLjava/util/concurrent/TimeUnit;)Z
.line 28
.line 29
.line 30
move-result v1
.line 31
if-nez v1, :cond_0
.line 32
.line 33
sget-object v1, Lcom/google/android/gms/drive/events/DriveEventService;->i:Lcom/google/android/gms/common/internal/GmsLogger;
.line 34
.line 35
const-string v2, "DriveEventService"
.line 36
.line 37
const-string v3, "Failed to synchronously quit event handler. Will quit itself"
.line 38
.line 39
invoke-virtual {v1, v2, v3}, Lcom/google/android/gms/common/internal/GmsLogger;->w(Ljava/lang/String;Ljava/lang/String;)V
:try_end_1
.catch Ljava/lang/InterruptedException; {:try_start_1 .. :try_end_1} :catch_0
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 40
.line 41
.line 42
goto :goto_0
.line 43
:catchall_0
move-exception v0
.line 44
goto :goto_1
.line 45
:catch_0
:cond_0
:goto_0
:try_start_2
iput-object v0, p0, Lcom/google/android/gms/drive/events/DriveEventService;->c:Ljava/util/concurrent/CountDownLatch;
.line 46
.line 47
:cond_1
invoke-super {p0}, Landroid/app/Service;->onDestroy()V
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
.line 48
.line 49
.line 50
monitor-exit p0
.line 51
return-void
.line 52
:goto_1
:try_start_3
monitor-exit p0
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_0
.line 53
throw v0
.end method
.method public final onUnbind(Landroid/content/Intent;)Z
.locals 0
const/4 p1, 0x1
return p1
.end method