soul-browser/app/smali_classes3/com/google/common/collect/CompactHashing.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

431 lines
6 KiB
Smali

.class final Lcom/google/common/collect/CompactHashing;
.super Ljava/lang/Object;
.source "SourceFile"
# annotations
.annotation build Lcom/google/common/annotations/GwtIncompatible;
.end annotation
# direct methods
.method public static a(I)Ljava/lang/Object;
.locals 2
.line 1
const/4 v0, 0x2
.line 2
if-lt p0, v0, :cond_2
.line 3
.line 4
const/high16 v0, 0x40000000 # 2.0f
.line 5
.line 6
if-gt p0, v0, :cond_2
.line 7
.line 8
invoke-static {p0}, Ljava/lang/Integer;->highestOneBit(I)I
.line 9
.line 10
.line 11
move-result v0
.line 12
if-ne v0, p0, :cond_2
.line 13
.line 14
const/16 v0, 0x100
.line 15
.line 16
if-gt p0, v0, :cond_0
.line 17
.line 18
new-array p0, p0, [B
.line 19
.line 20
return-object p0
.line 21
:cond_0
const/high16 v0, 0x10000
.line 22
.line 23
if-gt p0, v0, :cond_1
.line 24
.line 25
new-array p0, p0, [S
.line 26
.line 27
return-object p0
.line 28
:cond_1
new-array p0, p0, [I
.line 29
.line 30
return-object p0
.line 31
:cond_2
new-instance v0, Ljava/lang/IllegalArgumentException;
.line 32
.line 33
const-string v1, "must be power of 2 between 2^1 and 2^30: "
.line 34
.line 35
invoke-static {p0, v1}, Landroid/support/v4/media/a;->e(ILjava/lang/String;)Ljava/lang/String;
.line 36
.line 37
.line 38
move-result-object p0
.line 39
invoke-direct {v0, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
.line 40
.line 41
.line 42
throw v0
.end method
.method public static b(III)I
.locals 1
.line 1
not-int v0, p2
and-int/2addr p0, v0
and-int/2addr p1, p2
or-int/2addr p0, p1
return p0
.end method
.method public static c(I)I
.locals 1
.line 1
const/16 v0, 0x20
if-ge p0, v0, :cond_0
const/4 v0, 0x4
goto :goto_0
:cond_0
const/4 v0, 0x2
:goto_0
add-int/lit8 p0, p0, 0x1
mul-int/2addr p0, v0
return p0
.end method
.method public static d(Ljava/lang/Object;Ljava/lang/Object;ILjava/lang/Object;[I[Ljava/lang/Object;[Ljava/lang/Object;)I
.locals 9
.line 1
invoke-static {p0}, Lcom/google/common/collect/Hashing;->c(Ljava/lang/Object;)I
.line 2
.line 3
.line 4
move-result v0
.line 5
and-int v1, v0, p2
.line 6
.line 7
invoke-static {v1, p3}, Lcom/google/common/collect/CompactHashing;->e(ILjava/lang/Object;)I
.line 8
.line 9
.line 10
move-result v2
.line 11
const/4 v3, -0x1
.line 12
if-nez v2, :cond_0
.line 13
.line 14
goto :goto_1
.line 15
:cond_0
not-int v4, p2
.line 16
and-int/2addr v0, v4
.line 17
move v5, v3
.line 18
:goto_0
add-int/lit8 v2, v2, -0x1
.line 19
.line 20
aget v6, p4, v2
.line 21
.line 22
and-int v7, v6, v4
.line 23
.line 24
if-ne v7, v0, :cond_3
.line 25
.line 26
aget-object v7, p5, v2
.line 27
.line 28
invoke-static {p0, v7}, Lj$/util/Objects;->equals(Ljava/lang/Object;Ljava/lang/Object;)Z
.line 29
.line 30
.line 31
move-result v7
.line 32
if-eqz v7, :cond_3
.line 33
.line 34
if-eqz p6, :cond_1
.line 35
.line 36
aget-object v7, p6, v2
.line 37
.line 38
invoke-static {p1, v7}, Lj$/util/Objects;->equals(Ljava/lang/Object;Ljava/lang/Object;)Z
.line 39
.line 40
.line 41
move-result v7
.line 42
if-eqz v7, :cond_3
.line 43
.line 44
:cond_1
and-int p0, v6, p2
.line 45
.line 46
if-ne v5, v3, :cond_2
.line 47
.line 48
invoke-static {v1, p0, p3}, Lcom/google/common/collect/CompactHashing;->f(IILjava/lang/Object;)V
.line 49
.line 50
.line 51
return v2
.line 52
:cond_2
aget p1, p4, v5
.line 53
.line 54
invoke-static {p1, p0, p2}, Lcom/google/common/collect/CompactHashing;->b(III)I
.line 55
.line 56
.line 57
move-result p0
.line 58
aput p0, p4, v5
.line 59
.line 60
return v2
.line 61
:cond_3
and-int v5, v6, p2
.line 62
.line 63
if-nez v5, :cond_4
.line 64
.line 65
:goto_1
return v3
.line 66
:cond_4
move v8, v5
.line 67
move v5, v2
.line 68
move v2, v8
.line 69
goto :goto_0
.end method
.method public static e(ILjava/lang/Object;)I
.locals 1
.line 1
instance-of v0, p1, [B
.line 2
.line 3
if-eqz v0, :cond_0
.line 4
.line 5
check-cast p1, [B
.line 6
.line 7
aget-byte p0, p1, p0
.line 8
.line 9
and-int/lit16 p0, p0, 0xff
.line 10
.line 11
return p0
.line 12
:cond_0
instance-of v0, p1, [S
.line 13
.line 14
if-eqz v0, :cond_1
.line 15
.line 16
check-cast p1, [S
.line 17
.line 18
aget-short p0, p1, p0
.line 19
.line 20
const p1, 0xffff
.line 21
.line 22
.line 23
and-int/2addr p0, p1
.line 24
return p0
.line 25
:cond_1
check-cast p1, [I
.line 26
.line 27
aget p0, p1, p0
.line 28
.line 29
return p0
.end method
.method public static f(IILjava/lang/Object;)V
.locals 1
.line 1
instance-of v0, p2, [B
.line 2
.line 3
if-eqz v0, :cond_0
.line 4
.line 5
check-cast p2, [B
.line 6
.line 7
int-to-byte p1, p1
.line 8
aput-byte p1, p2, p0
.line 9
.line 10
return-void
.line 11
:cond_0
instance-of v0, p2, [S
.line 12
.line 13
if-eqz v0, :cond_1
.line 14
.line 15
check-cast p2, [S
.line 16
.line 17
int-to-short p1, p1
.line 18
aput-short p1, p2, p0
.line 19
.line 20
return-void
.line 21
:cond_1
check-cast p2, [I
.line 22
.line 23
aput p1, p2, p0
.line 24
.line 25
return-void
.end method