soul-browser/app/smali/com/google/android/gms/common/stats/ConnectionTracker.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

740 lines
17 KiB
Smali

.class public Lcom/google/android/gms/common/stats/ConnectionTracker;
.super Ljava/lang/Object;
.source "SourceFile"
# annotations
.annotation build Lcom/google/android/gms/common/annotation/KeepForSdk;
.end annotation
# static fields
.field private static final zzb:Ljava/lang/Object;
.field private static volatile zzc:Lcom/google/android/gms/common/stats/ConnectionTracker;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end field
# instance fields
.field public final zza:Lj$/util/concurrent/ConcurrentHashMap;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.annotation build Landroidx/annotation/VisibleForTesting;
.end annotation
.end field
# direct methods
.method static constructor <clinit>()V
.locals 1
new-instance v0, Ljava/lang/Object;
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
sput-object v0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzb:Ljava/lang/Object;
return-void
.end method
.method private constructor <init>()V
.locals 1
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 2
.line 3
.line 4
new-instance v0, Lj$/util/concurrent/ConcurrentHashMap;
.line 5
.line 6
invoke-direct {v0}, Lj$/util/concurrent/ConcurrentHashMap;-><init>()V
.line 7
.line 8
.line 9
iput-object v0, p0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zza:Lj$/util/concurrent/ConcurrentHashMap;
.line 10
.line 11
return-void
.end method
.method public static getInstance()Lcom/google/android/gms/common/stats/ConnectionTracker;
.locals 2
.annotation build Landroidx/annotation/NonNull;
.end annotation
.annotation build Lcom/google/android/gms/common/annotation/KeepForSdk;
.end annotation
.line 1
sget-object v0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzc:Lcom/google/android/gms/common/stats/ConnectionTracker;
.line 2
.line 3
if-nez v0, :cond_1
.line 4
.line 5
sget-object v0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzb:Ljava/lang/Object;
.line 6
.line 7
monitor-enter v0
.line 8
:try_start_0
sget-object v1, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzc:Lcom/google/android/gms/common/stats/ConnectionTracker;
.line 9
.line 10
if-nez v1, :cond_0
.line 11
.line 12
new-instance v1, Lcom/google/android/gms/common/stats/ConnectionTracker;
.line 13
.line 14
invoke-direct {v1}, Lcom/google/android/gms/common/stats/ConnectionTracker;-><init>()V
.line 15
.line 16
.line 17
sput-object v1, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzc:Lcom/google/android/gms/common/stats/ConnectionTracker;
.line 18
.line 19
goto :goto_0
.line 20
:catchall_0
move-exception v1
.line 21
goto :goto_1
.line 22
:cond_0
:goto_0
monitor-exit v0
.line 23
goto :goto_2
.line 24
:goto_1
monitor-exit v0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 25
throw v1
.line 26
:cond_1
:goto_2
sget-object v0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzc:Lcom/google/android/gms/common/stats/ConnectionTracker;
.line 27
.line 28
invoke-static {v0}, Lcom/google/android/gms/common/internal/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
.line 29
.line 30
.line 31
return-object v0
.end method
.method private final zzb(Landroid/content/Context;Ljava/lang/String;Landroid/content/Intent;Landroid/content/ServiceConnection;IZLjava/util/concurrent/Executor;)Z
.locals 4
.param p7 # Ljava/util/concurrent/Executor;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
.line 1
invoke-virtual {p3}, Landroid/content/Intent;->getComponent()Landroid/content/ComponentName;
.line 2
.line 3
.line 4
move-result-object p6
.line 5
const-string v0, "ConnectionTracker"
.line 6
.line 7
const/4 v1, 0x0
.line 8
if-nez p6, :cond_0
.line 9
.line 10
goto :goto_0
.line 11
:cond_0
invoke-virtual {p6}, Landroid/content/ComponentName;->getPackageName()Ljava/lang/String;
.line 12
.line 13
.line 14
move-result-object p6
.line 15
const-string v2, "com.google.android.gms"
.line 16
.line 17
invoke-virtual {v2, p6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
.line 18
.line 19
.line 20
:try_start_0
invoke-static {p1}, Lcom/google/android/gms/common/wrappers/Wrappers;->packageManager(Landroid/content/Context;)Lcom/google/android/gms/common/wrappers/PackageManagerWrapper;
.line 21
.line 22
.line 23
move-result-object v2
.line 24
invoke-virtual {v2, p6, v1}, Lcom/google/android/gms/common/wrappers/PackageManagerWrapper;->getApplicationInfo(Ljava/lang/String;I)Landroid/content/pm/ApplicationInfo;
.line 25
.line 26
.line 27
move-result-object p6
.line 28
iget p6, p6, Landroid/content/pm/ApplicationInfo;->flags:I
:try_end_0
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
.line 29
.line 30
const/high16 v2, 0x200000
.line 31
.line 32
and-int/2addr p6, v2
.line 33
if-eqz p6, :cond_1
.line 34
.line 35
const-string p1, "Attempted to bind to a service in a STOPPED package."
.line 36
.line 37
invoke-static {v0, p1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
.line 38
.line 39
.line 40
return v1
.line 41
:catch_0
:cond_1
:goto_0
invoke-static {p4}, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzc(Landroid/content/ServiceConnection;)Z
.line 42
.line 43
.line 44
move-result p6
.line 45
if-eqz p6, :cond_4
.line 46
.line 47
iget-object p6, p0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zza:Lj$/util/concurrent/ConcurrentHashMap;
.line 48
.line 49
invoke-virtual {p6, p4, p4}, Lj$/util/concurrent/ConcurrentHashMap;->putIfAbsent(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 50
.line 51
.line 52
move-result-object p6
.line 53
check-cast p6, Landroid/content/ServiceConnection;
.line 54
.line 55
if-eqz p6, :cond_2
.line 56
.line 57
if-eq p4, p6, :cond_2
.line 58
.line 59
invoke-virtual {p3}, Landroid/content/Intent;->getAction()Ljava/lang/String;
.line 60
.line 61
.line 62
move-result-object p6
.line 63
const/4 v2, 0x3
.line 64
new-array v2, v2, [Ljava/lang/Object;
.line 65
.line 66
aput-object p4, v2, v1
.line 67
.line 68
const/4 v3, 0x1
.line 69
aput-object p2, v2, v3
.line 70
.line 71
const/4 p2, 0x2
.line 72
aput-object p6, v2, p2
.line 73
.line 74
const-string p2, "Duplicate binding with the same ServiceConnection: %s, %s, %s."
.line 75
.line 76
invoke-static {p2, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
.line 77
.line 78
.line 79
move-result-object p2
.line 80
invoke-static {v0, p2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
.line 81
.line 82
.line 83
:cond_2
:try_start_1
invoke-static {p1, p3, p4, p5, p7}, Lcom/google/android/gms/common/stats/ConnectionTracker;->zze(Landroid/content/Context;Landroid/content/Intent;Landroid/content/ServiceConnection;ILjava/util/concurrent/Executor;)Z
.line 84
.line 85
.line 86
move-result p1
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 87
if-eqz p1, :cond_3
.line 88
.line 89
goto :goto_1
.line 90
:cond_3
iget-object p1, p0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zza:Lj$/util/concurrent/ConcurrentHashMap;
.line 91
.line 92
invoke-virtual {p1, p4, p4}, Lj$/util/concurrent/ConcurrentHashMap;->remove(Ljava/lang/Object;Ljava/lang/Object;)Z
.line 93
.line 94
.line 95
return v1
.line 96
:catchall_0
move-exception p1
.line 97
iget-object p2, p0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zza:Lj$/util/concurrent/ConcurrentHashMap;
.line 98
.line 99
invoke-virtual {p2, p4, p4}, Lj$/util/concurrent/ConcurrentHashMap;->remove(Ljava/lang/Object;Ljava/lang/Object;)Z
.line 100
.line 101
.line 102
throw p1
.line 103
:cond_4
invoke-static {p1, p3, p4, p5, p7}, Lcom/google/android/gms/common/stats/ConnectionTracker;->zze(Landroid/content/Context;Landroid/content/Intent;Landroid/content/ServiceConnection;ILjava/util/concurrent/Executor;)Z
.line 104
.line 105
.line 106
move-result p1
.line 107
:goto_1
return p1
.end method
.method private static zzc(Landroid/content/ServiceConnection;)Z
.locals 0
instance-of p0, p0, Lcom/google/android/gms/common/internal/zzr;
if-nez p0, :cond_0
const/4 p0, 0x1
return p0
:cond_0
const/4 p0, 0x0
return p0
.end method
.method private static zzd(Landroid/content/Context;Landroid/content/ServiceConnection;)V
.locals 0
.line 1
:try_start_0
invoke-virtual {p0, p1}, Landroid/content/Context;->unbindService(Landroid/content/ServiceConnection;)V
:try_end_0
.catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
.catch Ljava/lang/IllegalStateException; {:try_start_0 .. :try_end_0} :catch_0
.catch Ljava/util/NoSuchElementException; {:try_start_0 .. :try_end_0} :catch_0
.line 2
.line 3
.line 4
:catch_0
return-void
.end method
.method private static final zze(Landroid/content/Context;Landroid/content/Intent;Landroid/content/ServiceConnection;ILjava/util/concurrent/Executor;)Z
.locals 1
.param p4 # Ljava/util/concurrent/Executor;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
.line 1
if-nez p4, :cond_0
.line 2
.line 3
const/4 p4, 0x0
.line 4
:cond_0
invoke-static {}, Lcom/google/android/gms/common/util/PlatformVersion;->isAtLeastQ()Z
.line 5
.line 6
.line 7
move-result v0
.line 8
if-eqz v0, :cond_1
.line 9
.line 10
if-eqz p4, :cond_1
.line 11
.line 12
invoke-virtual {p0, p1, p3, p4, p2}, Landroid/content/Context;->bindService(Landroid/content/Intent;ILjava/util/concurrent/Executor;Landroid/content/ServiceConnection;)Z
.line 13
.line 14
.line 15
move-result p0
.line 16
return p0
.line 17
:cond_1
invoke-virtual {p0, p1, p2, p3}, Landroid/content/Context;->bindService(Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z
.line 18
.line 19
.line 20
move-result p0
.line 21
return p0
.end method
# virtual methods
.method public bindService(Landroid/content/Context;Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z
.locals 9
.param p1 # Landroid/content/Context;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Landroid/content/Intent;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p3 # Landroid/content/ServiceConnection;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Lcom/google/android/gms/common/annotation/KeepForSdk;
.end annotation
.line 1
invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
.line 2
.line 3
.line 4
move-result-object v0
.line 5
invoke-virtual {v0}, Ljava/lang/Class;->getName()Ljava/lang/String;
.line 6
.line 7
.line 8
move-result-object v3
.line 9
const/4 v7, 0x1
.line 10
const/4 v8, 0x0
.line 11
move-object v1, p0
.line 12
move-object v2, p1
.line 13
move-object v4, p2
.line 14
move-object v5, p3
.line 15
move v6, p4
.line 16
invoke-direct/range {v1 .. v8}, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzb(Landroid/content/Context;Ljava/lang/String;Landroid/content/Intent;Landroid/content/ServiceConnection;IZLjava/util/concurrent/Executor;)Z
.line 17
.line 18
.line 19
move-result p1
.line 20
return p1
.end method
.method public unbindService(Landroid/content/Context;Landroid/content/ServiceConnection;)V
.locals 2
.param p1 # Landroid/content/Context;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Landroid/content/ServiceConnection;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Lcom/google/android/gms/common/annotation/KeepForSdk;
.end annotation
.line 1
invoke-static {p2}, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzc(Landroid/content/ServiceConnection;)Z
.line 2
.line 3
.line 4
move-result v0
.line 5
if-eqz v0, :cond_0
.line 6
.line 7
iget-object v0, p0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zza:Lj$/util/concurrent/ConcurrentHashMap;
.line 8
.line 9
invoke-virtual {v0, p2}, Lj$/util/concurrent/ConcurrentHashMap;->containsKey(Ljava/lang/Object;)Z
.line 10
.line 11
.line 12
move-result v1
.line 13
if-eqz v1, :cond_0
.line 14
.line 15
:try_start_0
invoke-virtual {v0, p2}, Lj$/util/concurrent/ConcurrentHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
.line 16
.line 17
.line 18
move-result-object v0
.line 19
check-cast v0, Landroid/content/ServiceConnection;
.line 20
.line 21
invoke-static {p1, v0}, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzd(Landroid/content/Context;Landroid/content/ServiceConnection;)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 22
.line 23
.line 24
iget-object p1, p0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zza:Lj$/util/concurrent/ConcurrentHashMap;
.line 25
.line 26
invoke-virtual {p1, p2}, Lj$/util/concurrent/ConcurrentHashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
.line 27
.line 28
.line 29
return-void
.line 30
:catchall_0
move-exception p1
.line 31
iget-object v0, p0, Lcom/google/android/gms/common/stats/ConnectionTracker;->zza:Lj$/util/concurrent/ConcurrentHashMap;
.line 32
.line 33
invoke-virtual {v0, p2}, Lj$/util/concurrent/ConcurrentHashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
.line 34
.line 35
.line 36
throw p1
.line 37
:cond_0
invoke-static {p1, p2}, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzd(Landroid/content/Context;Landroid/content/ServiceConnection;)V
.line 38
.line 39
.line 40
return-void
.end method
.method public unbindServiceSafe(Landroid/content/Context;Landroid/content/ServiceConnection;)V
.locals 0
.param p1 # Landroid/content/Context;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Landroid/content/ServiceConnection;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Lcom/google/android/gms/common/annotation/KeepForSdk;
.end annotation
.line 1
:try_start_0
invoke-virtual {p0, p1, p2}, Lcom/google/android/gms/common/stats/ConnectionTracker;->unbindService(Landroid/content/Context;Landroid/content/ServiceConnection;)V
:try_end_0
.catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
.line 2
.line 3
.line 4
:catch_0
return-void
.end method
.method public final zza(Landroid/content/Context;Ljava/lang/String;Landroid/content/Intent;Landroid/content/ServiceConnection;ILjava/util/concurrent/Executor;)Z
.locals 8
.param p1 # Landroid/content/Context;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Ljava/lang/String;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p3 # Landroid/content/Intent;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p4 # Landroid/content/ServiceConnection;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p6 # Ljava/util/concurrent/Executor;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
.line 1
const/16 v5, 0x1081
.line 2
.line 3
const/4 v6, 0x1
.line 4
move-object v0, p0
.line 5
move-object v1, p1
.line 6
move-object v2, p2
.line 7
move-object v3, p3
.line 8
move-object v4, p4
.line 9
move-object v7, p6
.line 10
invoke-direct/range {v0 .. v7}, Lcom/google/android/gms/common/stats/ConnectionTracker;->zzb(Landroid/content/Context;Ljava/lang/String;Landroid/content/Intent;Landroid/content/ServiceConnection;IZLjava/util/concurrent/Executor;)Z
.line 11
.line 12
.line 13
move-result p1
.line 14
return p1
.end method