soul-browser/app/smali/androidx/core/app/ActivityCompat.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

295 lines
5.5 KiB
Smali

.class public Landroidx/core/app/ActivityCompat;
.super Landroidx/core/content/ContextCompat;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/core/app/ActivityCompat$PermissionCompatDelegate;,
Landroidx/core/app/ActivityCompat$Api21Impl;,
Landroidx/core/app/ActivityCompat$Api22Impl;,
Landroidx/core/app/ActivityCompat$Api28Impl;,
Landroidx/core/app/ActivityCompat$SharedElementCallback21Impl;,
Landroidx/core/app/ActivityCompat$RequestPermissionsRequestCodeValidator;,
Landroidx/core/app/ActivityCompat$Api23Impl;,
Landroidx/core/app/ActivityCompat$OnRequestPermissionsResultCallback;,
Landroidx/core/app/ActivityCompat$Api32Impl;,
Landroidx/core/app/ActivityCompat$Api31Impl;,
Landroidx/core/app/ActivityCompat$Api30Impl;
}
.end annotation
# direct methods
.method public static h(Landroid/app/Activity;[Ljava/lang/String;I)V
.locals 6
.line 1
new-instance v0, Ljava/util/HashSet;
.line 2
.line 3
invoke-direct {v0}, Ljava/util/HashSet;-><init>()V
.line 4
.line 5
.line 6
const/4 v1, 0x0
.line 7
move v2, v1
.line 8
:goto_0
array-length v3, p1
.line 9
if-ge v2, v3, :cond_2
.line 10
.line 11
aget-object v3, p1, v2
.line 12
.line 13
invoke-static {v3}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
.line 14
.line 15
.line 16
move-result v3
.line 17
if-nez v3, :cond_1
.line 18
.line 19
sget v3, Landroid/os/Build$VERSION;->SDK_INT:I
.line 20
.line 21
const/16 v4, 0x21
.line 22
.line 23
if-ge v3, v4, :cond_0
.line 24
.line 25
aget-object v3, p1, v2
.line 26
.line 27
const-string v4, "android.permission.POST_NOTIFICATIONS"
.line 28
.line 29
invoke-static {v3, v4}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z
.line 30
.line 31
.line 32
move-result v3
.line 33
if-eqz v3, :cond_0
.line 34
.line 35
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
.line 36
.line 37
.line 38
move-result-object v3
.line 39
invoke-virtual {v0, v3}, Ljava/util/HashSet;->add(Ljava/lang/Object;)Z
.line 40
.line 41
.line 42
:cond_0
add-int/lit8 v2, v2, 0x1
.line 43
.line 44
goto :goto_0
.line 45
:cond_1
new-instance p0, Ljava/lang/IllegalArgumentException;
.line 46
.line 47
new-instance p2, Ljava/lang/StringBuilder;
.line 48
.line 49
const-string v0, "Permission request for permissions "
.line 50
.line 51
invoke-direct {p2, v0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
.line 52
.line 53
.line 54
invoke-static {p1}, Ljava/util/Arrays;->toString([Ljava/lang/Object;)Ljava/lang/String;
.line 55
.line 56
.line 57
move-result-object p1
.line 58
const-string v0, " must not contain null or empty values"
.line 59
.line 60
invoke-static {p2, p1, v0}, Landroid/support/v4/media/a;->p(Ljava/lang/StringBuilder;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
.line 61
.line 62
.line 63
move-result-object p1
.line 64
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
.line 65
.line 66
.line 67
throw p0
.line 68
:cond_2
invoke-virtual {v0}, Ljava/util/HashSet;->size()I
.line 69
.line 70
.line 71
move-result v2
.line 72
if-lez v2, :cond_3
.line 73
.line 74
array-length v3, p1
.line 75
sub-int/2addr v3, v2
.line 76
new-array v3, v3, [Ljava/lang/String;
.line 77
.line 78
goto :goto_1
.line 79
:cond_3
move-object v3, p1
.line 80
:goto_1
if-lez v2, :cond_6
.line 81
.line 82
array-length v4, p1
.line 83
if-ne v2, v4, :cond_4
.line 84
.line 85
return-void
.line 86
:cond_4
move v2, v1
.line 87
:goto_2
array-length v4, p1
.line 88
if-ge v1, v4, :cond_6
.line 89
.line 90
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
.line 91
.line 92
.line 93
move-result-object v4
.line 94
invoke-virtual {v0, v4}, Ljava/util/HashSet;->contains(Ljava/lang/Object;)Z
.line 95
.line 96
.line 97
move-result v4
.line 98
if-nez v4, :cond_5
.line 99
.line 100
add-int/lit8 v4, v2, 0x1
.line 101
.line 102
aget-object v5, p1, v1
.line 103
.line 104
aput-object v5, v3, v2
.line 105
.line 106
move v2, v4
.line 107
:cond_5
add-int/lit8 v1, v1, 0x1
.line 108
.line 109
goto :goto_2
.line 110
:cond_6
instance-of v0, p0, Landroidx/core/app/ActivityCompat$RequestPermissionsRequestCodeValidator;
.line 111
.line 112
if-eqz v0, :cond_7
.line 113
.line 114
move-object v0, p0
.line 115
check-cast v0, Landroidx/core/app/ActivityCompat$RequestPermissionsRequestCodeValidator;
.line 116
.line 117
invoke-virtual {v0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
.line 118
.line 119
.line 120
:cond_7
invoke-virtual {p0, p1, p2}, Landroid/app/Activity;->requestPermissions([Ljava/lang/String;I)V
.line 121
.line 122
.line 123
return-void
.end method