soul-browser/app/smali/androidx/credentials/CredentialProviderFactory.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

352 lines
6.7 KiB
Smali

.class public final Landroidx/credentials/CredentialProviderFactory;
.super Ljava/lang/Object;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/credentials/CredentialProviderFactory$Companion;
}
.end annotation
.annotation runtime Lkotlin/Metadata;
d1 = {
"\u0000\u000c\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0008\u0002\u0008\u0000\u0018\u00002\u00020\u0001:\u0001\u0002\u00a8\u0006\u0003"
}
d2 = {
"Landroidx/credentials/CredentialProviderFactory;",
"",
"Companion",
"credentials_release"
}
k = 0x1
mv = {
0x1,
0x8,
0x0
}
xi = 0x30
.end annotation
# instance fields
.field public final a:Landroid/content/Context;
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 1
.line 1
const-string v0, "context"
.line 2
.line 3
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 4
.line 5
.line 6
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 7
.line 8
.line 9
iput-object p1, p0, Landroidx/credentials/CredentialProviderFactory;->a:Landroid/content/Context;
.line 10
.line 11
return-void
.end method
# virtual methods
.method public final a()Landroidx/credentials/CredentialProvider;
.locals 9
.line 1
iget-object v0, p0, Landroidx/credentials/CredentialProviderFactory;->a:Landroid/content/Context;
.line 2
.line 3
invoke-virtual {v0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
.line 4
.line 5
.line 6
move-result-object v1
.line 7
invoke-virtual {v0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
.line 8
.line 9
.line 10
move-result-object v2
.line 11
const/16 v3, 0x84
.line 12
.line 13
invoke-virtual {v1, v2, v3}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
.line 14
.line 15
.line 16
move-result-object v1
.line 17
new-instance v2, Ljava/util/ArrayList;
.line 18
.line 19
invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V
.line 20
.line 21
.line 22
iget-object v1, v1, Landroid/content/pm/PackageInfo;->services:[Landroid/content/pm/ServiceInfo;
.line 23
.line 24
const/4 v3, 0x0
.line 25
if-eqz v1, :cond_1
.line 26
.line 27
invoke-static {v1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
.line 28
.line 29
.line 30
array-length v4, v1
.line 31
move v5, v3
.line 32
:goto_0
if-ge v5, v4, :cond_1
.line 33
.line 34
aget-object v6, v1, v5
.line 35
.line 36
iget-object v6, v6, Landroid/content/pm/ServiceInfo;->metaData:Landroid/os/Bundle;
.line 37
.line 38
if-eqz v6, :cond_0
.line 39
.line 40
const-string v7, "androidx.credentials.CREDENTIAL_PROVIDER_KEY"
.line 41
.line 42
invoke-virtual {v6, v7}, Landroid/os/BaseBundle;->getString(Ljava/lang/String;)Ljava/lang/String;
.line 43
.line 44
.line 45
move-result-object v6
.line 46
if-eqz v6, :cond_0
.line 47
.line 48
invoke-virtual {v2, v6}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 49
.line 50
.line 51
:cond_0
add-int/lit8 v5, v5, 0x1
.line 52
.line 53
goto :goto_0
.line 54
:cond_1
invoke-static {v2}, Lkotlin/collections/CollectionsKt;->toList(Ljava/lang/Iterable;)Ljava/util/List;
.line 55
.line 56
.line 57
move-result-object v1
.line 58
invoke-interface {v1}, Ljava/util/List;->isEmpty()Z
.line 59
.line 60
.line 61
move-result v2
.line 62
const/4 v4, 0x0
.line 63
if-eqz v2, :cond_2
.line 64
.line 65
return-object v4
.line 66
:cond_2
invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
.line 67
.line 68
.line 69
move-result-object v1
.line 70
move-object v2, v4
.line 71
:catchall_0
:cond_3
:goto_1
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
.line 72
.line 73
.line 74
move-result v5
.line 75
if-eqz v5, :cond_5
.line 76
.line 77
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
.line 78
.line 79
.line 80
move-result-object v5
.line 81
check-cast v5, Ljava/lang/String;
.line 82
.line 83
:try_start_0
invoke-static {v5}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
.line 84
.line 85
.line 86
move-result-object v5
.line 87
const/4 v6, 0x1
.line 88
new-array v7, v6, [Ljava/lang/Class;
.line 89
.line 90
const-class v8, Landroid/content/Context;
.line 91
.line 92
aput-object v8, v7, v3
.line 93
.line 94
invoke-virtual {v5, v7}, Ljava/lang/Class;->getConstructor([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
.line 95
.line 96
.line 97
move-result-object v5
.line 98
new-array v6, v6, [Ljava/lang/Object;
.line 99
.line 100
aput-object v0, v6, v3
.line 101
.line 102
invoke-virtual {v5, v6}, Ljava/lang/reflect/Constructor;->newInstance([Ljava/lang/Object;)Ljava/lang/Object;
.line 103
.line 104
.line 105
move-result-object v5
.line 106
const-string v6, "null cannot be cast to non-null type androidx.credentials.CredentialProvider"
.line 107
.line 108
invoke-static {v5, v6}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;Ljava/lang/String;)V
.line 109
.line 110
.line 111
check-cast v5, Landroidx/credentials/CredentialProvider;
.line 112
.line 113
invoke-interface {v5}, Landroidx/credentials/CredentialProvider;->isAvailableOnDevice()Z
.line 114
.line 115
.line 116
move-result v6
.line 117
if-eqz v6, :cond_3
.line 118
.line 119
if-eqz v2, :cond_4
.line 120
.line 121
const-string v5, "CredProviderFactory"
.line 122
.line 123
const-string v6, "Only one active OEM CredentialProvider allowed"
.line 124
.line 125
invoke-static {v5, v6}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 126
.line 127
.line 128
goto :goto_2
.line 129
:cond_4
move-object v2, v5
.line 130
goto :goto_1
.line 131
:cond_5
move-object v4, v2
.line 132
:goto_2
return-object v4
.end method