soul-browser/app/smali_classes4/kotlin/jvm/internal/CollectionToArray.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

698 lines
16 KiB
Smali

.class public final Lkotlin/jvm/internal/CollectionToArray;
.super Ljava/lang/Object;
.source "SourceFile"
# annotations
.annotation runtime Lkotlin/Metadata;
d1 = {
"\u00002\n\u0000\n\u0002\u0010\u0011\n\u0002\u0010\u0000\n\u0002\u0008\u0002\n\u0002\u0010\u0008\n\u0002\u0008\u0002\n\u0002\u0010\u001e\n\u0002\u0008\u0006\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0002\u001a#\u0010\u0006\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00020\u00012\n\u0010\u0007\u001a\u0006\u0012\u0002\u0008\u00030\u0008H\u0007\u00a2\u0006\u0004\u0008\t\u0010\n\u001a5\u0010\u0006\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00020\u00012\n\u0010\u0007\u001a\u0006\u0012\u0002\u0008\u00030\u00082\u0010\u0010\u000b\u001a\u000c\u0012\u0006\u0012\u0004\u0018\u00010\u0002\u0018\u00010\u0001H\u0007\u00a2\u0006\u0004\u0008\t\u0010\u000c\u001a~\u0010\r\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00020\u00012\n\u0010\u0007\u001a\u0006\u0012\u0002\u0008\u00030\u00082\u0014\u0010\u000e\u001a\u0010\u0012\u000c\u0012\n\u0012\u0006\u0012\u0004\u0018\u00010\u00020\u00010\u000f2\u001a\u0010\u0010\u001a\u0016\u0012\u0004\u0012\u00020\u0005\u0012\u000c\u0012\n\u0012\u0006\u0012\u0004\u0018\u00010\u00020\u00010\u00112(\u0010\u0012\u001a$\u0012\u000c\u0012\n\u0012\u0006\u0012\u0004\u0018\u00010\u00020\u0001\u0012\u0004\u0012\u00020\u0005\u0012\u000c\u0012\n\u0012\u0006\u0012\u0004\u0018\u00010\u00020\u00010\u0013H\u0082\u0008\u00a2\u0006\u0002\u0010\u0014\"\u0018\u0010\u0000\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00020\u0001X\u0082\u0004\u00a2\u0006\u0004\n\u0002\u0010\u0003\"\u000e\u0010\u0004\u001a\u00020\u0005X\u0082T\u00a2\u0006\u0002\n\u0000\u00a8\u0006\u0015"
}
d2 = {
"EMPTY",
"",
"",
"[Ljava/lang/Object;",
"MAX_SIZE",
"",
"collectionToArray",
"collection",
"",
"toArray",
"(Ljava/util/Collection;)[Ljava/lang/Object;",
"a",
"(Ljava/util/Collection;[Ljava/lang/Object;)[Ljava/lang/Object;",
"toArrayImpl",
"empty",
"Lkotlin/Function0;",
"alloc",
"Lkotlin/Function1;",
"trim",
"Lkotlin/Function2;",
"(Ljava/util/Collection;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;)[Ljava/lang/Object;",
"kotlin-stdlib"
}
k = 0x2
mv = {
0x2,
0x2,
0x0
}
xi = 0x30
.end annotation
.annotation build Lkotlin/jvm/JvmName;
name = "CollectionToArray"
.end annotation
.annotation build Lkotlin/jvm/internal/SourceDebugExtension;
value = {
"SMAP\nCollectionToArray.kt\nKotlin\n*S Kotlin\n*F\n+ 1 CollectionToArray.kt\nkotlin/jvm/internal/CollectionToArray\n*L\n1#1,88:1\n63#1,22:89\n63#1,22:111\n*S KotlinDebug\n*F\n+ 1 CollectionToArray.kt\nkotlin/jvm/internal/CollectionToArray\n*L\n22#1:89,22\n37#1:111,22\n*E\n"
}
.end annotation
# static fields
.field private static final EMPTY:[Ljava/lang/Object;
.annotation build Lorg/jetbrains/annotations/NotNull;
.end annotation
.end field
.field private static final MAX_SIZE:I = 0x7ffffffd
# direct methods
.method static constructor <clinit>()V
.locals 1
.line 1
const/4 v0, 0x0
.line 2
new-array v0, v0, [Ljava/lang/Object;
.line 3
.line 4
sput-object v0, Lkotlin/jvm/internal/CollectionToArray;->EMPTY:[Ljava/lang/Object;
.line 5
.line 6
return-void
.end method
.method public static final toArray(Ljava/util/Collection;)[Ljava/lang/Object;
.locals 4
.param p0 # Ljava/util/Collection;
.annotation build Lorg/jetbrains/annotations/NotNull;
.end annotation
.end param
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/Collection<",
"*>;)[",
"Ljava/lang/Object;"
}
.end annotation
.annotation runtime Lkotlin/Deprecated;
message = "This function will be made internal in a future release"
.end annotation
.annotation runtime Lkotlin/DeprecatedSinceKotlin;
errorSince = "2.1"
warningSince = "1.9"
.end annotation
.annotation build Lkotlin/jvm/JvmName;
name = "toArray"
.end annotation
.annotation build Lorg/jetbrains/annotations/NotNull;
.end annotation
const-string v0, "collection"
invoke-static {p0, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 16
invoke-interface {p0}, Ljava/util/Collection;->size()I
move-result v0
if-nez v0, :cond_0
.line 17
sget-object p0, Lkotlin/jvm/internal/CollectionToArray;->EMPTY:[Ljava/lang/Object;
return-object p0
.line 18
:cond_0
invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
move-result-object p0
.line 19
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-nez v1, :cond_1
.line 20
sget-object p0, Lkotlin/jvm/internal/CollectionToArray;->EMPTY:[Ljava/lang/Object;
return-object p0
.line 21
:cond_1
new-array v0, v0, [Ljava/lang/Object;
const/4 v1, 0x0
:goto_0
add-int/lit8 v2, v1, 0x1
.line 22
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v3
aput-object v3, v0, v1
.line 23
array-length v1, v0
const-string v3, "copyOf(...)"
if-lt v2, v1, :cond_6
.line 24
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-nez v1, :cond_2
return-object v0
:cond_2
mul-int/lit8 v1, v2, 0x3
add-int/lit8 v1, v1, 0x1
ushr-int/lit8 v1, v1, 0x1
if-gt v1, v2, :cond_4
const v1, 0x7ffffffd
if-ge v2, v1, :cond_3
goto :goto_1
.line 25
:cond_3
new-instance p0, Ljava/lang/OutOfMemoryError;
invoke-direct {p0}, Ljava/lang/OutOfMemoryError;-><init>()V
throw p0
.line 26
:cond_4
:goto_1
invoke-static {v0, v1}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;
move-result-object v0
invoke-static {v0, v3}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
:cond_5
move v1, v2
goto :goto_0
.line 27
:cond_6
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-nez v1, :cond_5
.line 28
invoke-static {v0, v2}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;
move-result-object p0
invoke-static {p0, v3}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
return-object p0
.end method
.method public static final toArray(Ljava/util/Collection;[Ljava/lang/Object;)[Ljava/lang/Object;
.locals 5
.param p0 # Ljava/util/Collection;
.annotation build Lorg/jetbrains/annotations/NotNull;
.end annotation
.end param
.param p1 # [Ljava/lang/Object;
.annotation build Lorg/jetbrains/annotations/Nullable;
.end annotation
.end param
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/Collection<",
"*>;[",
"Ljava/lang/Object;",
")[",
"Ljava/lang/Object;"
}
.end annotation
.annotation runtime Lkotlin/Deprecated;
message = "This function will be made internal in a future release"
.end annotation
.annotation runtime Lkotlin/DeprecatedSinceKotlin;
errorSince = "2.1"
warningSince = "1.9"
.end annotation
.annotation build Lkotlin/jvm/JvmName;
name = "toArray"
.end annotation
.annotation build Lorg/jetbrains/annotations/NotNull;
.end annotation
const-string v0, "collection"
invoke-static {p0, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 1
invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
.line 2
invoke-interface {p0}, Ljava/util/Collection;->size()I
move-result v0
const/4 v1, 0x0
const/4 v2, 0x0
if-nez v0, :cond_0
.line 3
array-length p0, p1
if-lez p0, :cond_1
aput-object v1, p1, v2
return-object p1
.line 4
:cond_0
invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
move-result-object p0
.line 5
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
move-result v3
if-nez v3, :cond_2
.line 6
array-length p0, p1
if-lez p0, :cond_1
aput-object v1, p1, v2
:cond_1
return-object p1
.line 7
:cond_2
array-length v3, p1
if-gt v0, v3, :cond_3
move-object v0, p1
goto :goto_0
:cond_3
invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/Class;->getComponentType()Ljava/lang/Class;
move-result-object v3
invoke-static {v3, v0}, Ljava/lang/reflect/Array;->newInstance(Ljava/lang/Class;I)Ljava/lang/Object;
move-result-object v0
const-string v3, "null cannot be cast to non-null type kotlin.Array<kotlin.Any?>"
invoke-static {v0, v3}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;Ljava/lang/String;)V
check-cast v0, [Ljava/lang/Object;
:goto_0
add-int/lit8 v3, v2, 0x1
.line 8
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v4
aput-object v4, v0, v2
.line 9
array-length v2, v0
const-string v4, "copyOf(...)"
if-lt v3, v2, :cond_8
.line 10
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-nez v2, :cond_4
return-object v0
:cond_4
mul-int/lit8 v2, v3, 0x3
add-int/lit8 v2, v2, 0x1
ushr-int/lit8 v2, v2, 0x1
if-gt v2, v3, :cond_6
const v2, 0x7ffffffd
if-ge v3, v2, :cond_5
goto :goto_1
.line 11
:cond_5
new-instance p0, Ljava/lang/OutOfMemoryError;
invoke-direct {p0}, Ljava/lang/OutOfMemoryError;-><init>()V
throw p0
.line 12
:cond_6
:goto_1
invoke-static {v0, v2}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;
move-result-object v0
invoke-static {v0, v4}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
:cond_7
move v2, v3
goto :goto_0
.line 13
:cond_8
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-nez v2, :cond_7
if-ne v0, p1, :cond_9
.line 14
aput-object v1, p1, v3
return-object p1
.line 15
:cond_9
invoke-static {v0, v3}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;
move-result-object p0
invoke-static {p0, v4}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
return-object p0
.end method
.method private static final toArrayImpl(Ljava/util/Collection;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;)[Ljava/lang/Object;
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/Collection<",
"*>;",
"Lkotlin/jvm/functions/Function0<",
"[",
"Ljava/lang/Object;",
">;",
"Lkotlin/jvm/functions/Function1<",
"-",
"Ljava/lang/Integer;",
"[",
"Ljava/lang/Object;",
">;",
"Lkotlin/jvm/functions/Function2<",
"-[",
"Ljava/lang/Object;",
"-",
"Ljava/lang/Integer;",
"[",
"Ljava/lang/Object;",
">;)[",
"Ljava/lang/Object;"
}
.end annotation
.line 1
invoke-interface {p0}, Ljava/util/Collection;->size()I
.line 2
.line 3
.line 4
move-result v0
.line 5
if-nez v0, :cond_0
.line 6
.line 7
invoke-interface {p1}, Lkotlin/jvm/functions/Function0;->invoke()Ljava/lang/Object;
.line 8
.line 9
.line 10
move-result-object p0
.line 11
check-cast p0, [Ljava/lang/Object;
.line 12
.line 13
return-object p0
.line 14
:cond_0
invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
.line 15
.line 16
.line 17
move-result-object p0
.line 18
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
.line 19
.line 20
.line 21
move-result v1
.line 22
if-nez v1, :cond_1
.line 23
.line 24
invoke-interface {p1}, Lkotlin/jvm/functions/Function0;->invoke()Ljava/lang/Object;
.line 25
.line 26
.line 27
move-result-object p0
.line 28
check-cast p0, [Ljava/lang/Object;
.line 29
.line 30
return-object p0
.line 31
:cond_1
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
.line 32
.line 33
.line 34
move-result-object p1
.line 35
invoke-interface {p2, p1}, Lkotlin/jvm/functions/Function1;->invoke(Ljava/lang/Object;)Ljava/lang/Object;
.line 36
.line 37
.line 38
move-result-object p1
.line 39
check-cast p1, [Ljava/lang/Object;
.line 40
.line 41
const/4 p2, 0x0
.line 42
:goto_0
add-int/lit8 v0, p2, 0x1
.line 43
.line 44
invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
.line 45
.line 46
.line 47
move-result-object v1
.line 48
aput-object v1, p1, p2
.line 49
.line 50
array-length p2, p1
.line 51
if-lt v0, p2, :cond_6
.line 52
.line 53
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
.line 54
.line 55
.line 56
move-result p2
.line 57
if-nez p2, :cond_2
.line 58
.line 59
return-object p1
.line 60
:cond_2
mul-int/lit8 p2, v0, 0x3
.line 61
.line 62
add-int/lit8 p2, p2, 0x1
.line 63
.line 64
ushr-int/lit8 p2, p2, 0x1
.line 65
.line 66
if-gt p2, v0, :cond_4
.line 67
.line 68
const p2, 0x7ffffffd
.line 69
.line 70
.line 71
if-ge v0, p2, :cond_3
.line 72
.line 73
goto :goto_1
.line 74
:cond_3
new-instance p0, Ljava/lang/OutOfMemoryError;
.line 75
.line 76
invoke-direct {p0}, Ljava/lang/OutOfMemoryError;-><init>()V
.line 77
.line 78
.line 79
throw p0
.line 80
:cond_4
:goto_1
invoke-static {p1, p2}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object;
.line 81
.line 82
.line 83
move-result-object p1
.line 84
const-string p2, "copyOf(...)"
.line 85
.line 86
invoke-static {p1, p2}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
.line 87
.line 88
.line 89
:cond_5
move p2, v0
.line 90
goto :goto_0
.line 91
:cond_6
invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z
.line 92
.line 93
.line 94
move-result p2
.line 95
if-nez p2, :cond_5
.line 96
.line 97
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
.line 98
.line 99
.line 100
move-result-object p0
.line 101
invoke-interface {p3, p1, p0}, Lkotlin/jvm/functions/Function2;->invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
.line 102
.line 103
.line 104
move-result-object p0
.line 105
check-cast p0, [Ljava/lang/Object;
.line 106
.line 107
return-object p0
.end method