soul-browser/app/smali/androidx/emoji2/text/MetadataRepo.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

447 lines
8.3 KiB
Smali

.class public final Landroidx/emoji2/text/MetadataRepo;
.super Ljava/lang/Object;
.source "SourceFile"
# annotations
.annotation build Landroidx/annotation/AnyThread;
.end annotation
.annotation build Landroidx/annotation/RequiresApi;
.end annotation
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/emoji2/text/MetadataRepo$Node;
}
.end annotation
# instance fields
.field public final a:Landroidx/emoji2/text/flatbuffer/MetadataList;
.field public final b:[C
.field public final c:Landroidx/emoji2/text/MetadataRepo$Node;
.field public final d:Landroid/graphics/Typeface;
# direct methods
.method public constructor <init>(Landroid/graphics/Typeface;Landroidx/emoji2/text/flatbuffer/MetadataList;)V
.locals 7
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 2
.line 3
.line 4
iput-object p1, p0, Landroidx/emoji2/text/MetadataRepo;->d:Landroid/graphics/Typeface;
.line 5
.line 6
iput-object p2, p0, Landroidx/emoji2/text/MetadataRepo;->a:Landroidx/emoji2/text/flatbuffer/MetadataList;
.line 7
.line 8
new-instance p1, Landroidx/emoji2/text/MetadataRepo$Node;
.line 9
.line 10
const/16 v0, 0x400
.line 11
.line 12
invoke-direct {p1, v0}, Landroidx/emoji2/text/MetadataRepo$Node;-><init>(I)V
.line 13
.line 14
.line 15
iput-object p1, p0, Landroidx/emoji2/text/MetadataRepo;->c:Landroidx/emoji2/text/MetadataRepo$Node;
.line 16
.line 17
const/4 p1, 0x6
.line 18
invoke-virtual {p2, p1}, Landroidx/emoji2/text/flatbuffer/Table;->a(I)I
.line 19
.line 20
.line 21
move-result v0
.line 22
const/4 v1, 0x0
.line 23
if-eqz v0, :cond_0
.line 24
.line 25
iget v2, p2, Landroidx/emoji2/text/flatbuffer/Table;->a:I
.line 26
.line 27
add-int/2addr v0, v2
.line 28
iget-object v2, p2, Landroidx/emoji2/text/flatbuffer/Table;->b:Ljava/nio/ByteBuffer;
.line 29
.line 30
invoke-virtual {v2, v0}, Ljava/nio/ByteBuffer;->getInt(I)I
.line 31
.line 32
.line 33
move-result v2
.line 34
add-int/2addr v2, v0
.line 35
iget-object v0, p2, Landroidx/emoji2/text/flatbuffer/Table;->b:Ljava/nio/ByteBuffer;
.line 36
.line 37
invoke-virtual {v0, v2}, Ljava/nio/ByteBuffer;->getInt(I)I
.line 38
.line 39
.line 40
move-result v0
.line 41
goto :goto_0
.line 42
:cond_0
move v0, v1
.line 43
:goto_0
mul-int/lit8 v0, v0, 0x2
.line 44
.line 45
new-array v0, v0, [C
.line 46
.line 47
iput-object v0, p0, Landroidx/emoji2/text/MetadataRepo;->b:[C
.line 48
.line 49
invoke-virtual {p2, p1}, Landroidx/emoji2/text/flatbuffer/Table;->a(I)I
.line 50
.line 51
.line 52
move-result p1
.line 53
if-eqz p1, :cond_1
.line 54
.line 55
iget v0, p2, Landroidx/emoji2/text/flatbuffer/Table;->a:I
.line 56
.line 57
add-int/2addr p1, v0
.line 58
iget-object v0, p2, Landroidx/emoji2/text/flatbuffer/Table;->b:Ljava/nio/ByteBuffer;
.line 59
.line 60
invoke-virtual {v0, p1}, Ljava/nio/ByteBuffer;->getInt(I)I
.line 61
.line 62
.line 63
move-result v0
.line 64
add-int/2addr v0, p1
.line 65
iget-object p1, p2, Landroidx/emoji2/text/flatbuffer/Table;->b:Ljava/nio/ByteBuffer;
.line 66
.line 67
invoke-virtual {p1, v0}, Ljava/nio/ByteBuffer;->getInt(I)I
.line 68
.line 69
.line 70
move-result p1
.line 71
goto :goto_1
.line 72
:cond_1
move p1, v1
.line 73
:goto_1
move p2, v1
.line 74
:goto_2
if-ge p2, p1, :cond_6
.line 75
.line 76
new-instance v0, Landroidx/emoji2/text/TypefaceEmojiRasterizer;
.line 77
.line 78
invoke-direct {v0, p0, p2}, Landroidx/emoji2/text/TypefaceEmojiRasterizer;-><init>(Landroidx/emoji2/text/MetadataRepo;I)V
.line 79
.line 80
.line 81
invoke-virtual {v0}, Landroidx/emoji2/text/TypefaceEmojiRasterizer;->b()Landroidx/emoji2/text/flatbuffer/MetadataItem;
.line 82
.line 83
.line 84
move-result-object v2
.line 85
const/4 v3, 0x4
.line 86
invoke-virtual {v2, v3}, Landroidx/emoji2/text/flatbuffer/Table;->a(I)I
.line 87
.line 88
.line 89
move-result v3
.line 90
if-eqz v3, :cond_2
.line 91
.line 92
iget-object v4, v2, Landroidx/emoji2/text/flatbuffer/Table;->b:Ljava/nio/ByteBuffer;
.line 93
.line 94
iget v2, v2, Landroidx/emoji2/text/flatbuffer/Table;->a:I
.line 95
.line 96
add-int/2addr v3, v2
.line 97
invoke-virtual {v4, v3}, Ljava/nio/ByteBuffer;->getInt(I)I
.line 98
.line 99
.line 100
move-result v2
.line 101
goto :goto_3
.line 102
:cond_2
move v2, v1
.line 103
:goto_3
iget-object v3, p0, Landroidx/emoji2/text/MetadataRepo;->b:[C
.line 104
.line 105
mul-int/lit8 v4, p2, 0x2
.line 106
.line 107
invoke-static {v2, v3, v4}, Ljava/lang/Character;->toChars(I[CI)I
.line 108
.line 109
.line 110
invoke-virtual {v0}, Landroidx/emoji2/text/TypefaceEmojiRasterizer;->b()Landroidx/emoji2/text/flatbuffer/MetadataItem;
.line 111
.line 112
.line 113
move-result-object v2
.line 114
const/16 v3, 0x10
.line 115
.line 116
invoke-virtual {v2, v3}, Landroidx/emoji2/text/flatbuffer/Table;->a(I)I
.line 117
.line 118
.line 119
move-result v4
.line 120
if-eqz v4, :cond_3
.line 121
.line 122
iget v5, v2, Landroidx/emoji2/text/flatbuffer/Table;->a:I
.line 123
.line 124
add-int/2addr v4, v5
.line 125
iget-object v5, v2, Landroidx/emoji2/text/flatbuffer/Table;->b:Ljava/nio/ByteBuffer;
.line 126
.line 127
invoke-virtual {v5, v4}, Ljava/nio/ByteBuffer;->getInt(I)I
.line 128
.line 129
.line 130
move-result v5
.line 131
add-int/2addr v5, v4
.line 132
iget-object v2, v2, Landroidx/emoji2/text/flatbuffer/Table;->b:Ljava/nio/ByteBuffer;
.line 133
.line 134
invoke-virtual {v2, v5}, Ljava/nio/ByteBuffer;->getInt(I)I
.line 135
.line 136
.line 137
move-result v2
.line 138
goto :goto_4
.line 139
:cond_3
move v2, v1
.line 140
:goto_4
const/4 v4, 0x1
.line 141
if-lez v2, :cond_4
.line 142
.line 143
move v2, v4
.line 144
goto :goto_5
.line 145
:cond_4
move v2, v1
.line 146
:goto_5
const-string v5, "invalid metadata codepoint length"
.line 147
.line 148
invoke-static {v5, v2}, Landroidx/core/util/Preconditions;->a(Ljava/lang/String;Z)V
.line 149
.line 150
.line 151
iget-object v2, p0, Landroidx/emoji2/text/MetadataRepo;->c:Landroidx/emoji2/text/MetadataRepo$Node;
.line 152
.line 153
invoke-virtual {v0}, Landroidx/emoji2/text/TypefaceEmojiRasterizer;->b()Landroidx/emoji2/text/flatbuffer/MetadataItem;
.line 154
.line 155
.line 156
move-result-object v5
.line 157
invoke-virtual {v5, v3}, Landroidx/emoji2/text/flatbuffer/Table;->a(I)I
.line 158
.line 159
.line 160
move-result v3
.line 161
if-eqz v3, :cond_5
.line 162
.line 163
iget v6, v5, Landroidx/emoji2/text/flatbuffer/Table;->a:I
.line 164
.line 165
add-int/2addr v3, v6
.line 166
iget-object v6, v5, Landroidx/emoji2/text/flatbuffer/Table;->b:Ljava/nio/ByteBuffer;
.line 167
.line 168
invoke-virtual {v6, v3}, Ljava/nio/ByteBuffer;->getInt(I)I
.line 169
.line 170
.line 171
move-result v6
.line 172
add-int/2addr v6, v3
.line 173
iget-object v3, v5, Landroidx/emoji2/text/flatbuffer/Table;->b:Ljava/nio/ByteBuffer;
.line 174
.line 175
invoke-virtual {v3, v6}, Ljava/nio/ByteBuffer;->getInt(I)I
.line 176
.line 177
.line 178
move-result v3
.line 179
goto :goto_6
.line 180
:cond_5
move v3, v1
.line 181
:goto_6
sub-int/2addr v3, v4
.line 182
invoke-virtual {v2, v0, v1, v3}, Landroidx/emoji2/text/MetadataRepo$Node;->a(Landroidx/emoji2/text/TypefaceEmojiRasterizer;II)V
.line 183
.line 184
.line 185
add-int/lit8 p2, p2, 0x1
.line 186
.line 187
goto :goto_2
.line 188
:cond_6
return-void
.end method