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

326 lines
6.4 KiB
Smali

.class public abstract Landroidx/emoji2/text/EmojiSpan;
.super Landroid/text/style/ReplacementSpan;
.source "SourceFile"
# annotations
.annotation build Landroidx/annotation/RequiresApi;
.end annotation
# instance fields
.field public final c:Landroid/graphics/Paint$FontMetricsInt;
.field public final f:Landroidx/emoji2/text/TypefaceEmojiRasterizer;
.field public g:S
.field public h:F
# direct methods
.method public constructor <init>(Landroidx/emoji2/text/TypefaceEmojiRasterizer;)V
.locals 1
.line 1
invoke-direct {p0}, Landroid/text/style/ReplacementSpan;-><init>()V
.line 2
.line 3
.line 4
new-instance v0, Landroid/graphics/Paint$FontMetricsInt;
.line 5
.line 6
invoke-direct {v0}, Landroid/graphics/Paint$FontMetricsInt;-><init>()V
.line 7
.line 8
.line 9
iput-object v0, p0, Landroidx/emoji2/text/EmojiSpan;->c:Landroid/graphics/Paint$FontMetricsInt;
.line 10
.line 11
const/4 v0, -0x1
.line 12
iput-short v0, p0, Landroidx/emoji2/text/EmojiSpan;->g:S
.line 13
.line 14
const/high16 v0, 0x3f800000 # 1.0f
.line 15
.line 16
iput v0, p0, Landroidx/emoji2/text/EmojiSpan;->h:F
.line 17
.line 18
const-string v0, "rasterizer cannot be null"
.line 19
.line 20
invoke-static {p1, v0}, Landroidx/core/util/Preconditions;->c(Ljava/lang/Object;Ljava/lang/String;)V
.line 21
.line 22
.line 23
iput-object p1, p0, Landroidx/emoji2/text/EmojiSpan;->f:Landroidx/emoji2/text/TypefaceEmojiRasterizer;
.line 24
.line 25
return-void
.end method
# virtual methods
.method public final getSize(Landroid/graphics/Paint;Ljava/lang/CharSequence;IILandroid/graphics/Paint$FontMetricsInt;)I
.locals 4
.line 1
iget-object p2, p0, Landroidx/emoji2/text/EmojiSpan;->c:Landroid/graphics/Paint$FontMetricsInt;
.line 2
.line 3
invoke-virtual {p1, p2}, Landroid/graphics/Paint;->getFontMetricsInt(Landroid/graphics/Paint$FontMetricsInt;)I
.line 4
.line 5
.line 6
iget p1, p2, Landroid/graphics/Paint$FontMetricsInt;->descent:I
.line 7
.line 8
iget p3, p2, Landroid/graphics/Paint$FontMetricsInt;->ascent:I
.line 9
.line 10
sub-int/2addr p1, p3
.line 11
invoke-static {p1}, Ljava/lang/Math;->abs(I)I
.line 12
.line 13
.line 14
move-result p1
.line 15
int-to-float p1, p1
.line 16
const/high16 p3, 0x3f800000 # 1.0f
.line 17
.line 18
mul-float/2addr p1, p3
.line 19
iget-object p3, p0, Landroidx/emoji2/text/EmojiSpan;->f:Landroidx/emoji2/text/TypefaceEmojiRasterizer;
.line 20
.line 21
invoke-virtual {p3}, Landroidx/emoji2/text/TypefaceEmojiRasterizer;->b()Landroidx/emoji2/text/flatbuffer/MetadataItem;
.line 22
.line 23
.line 24
move-result-object p4
.line 25
const/16 v0, 0xe
.line 26
.line 27
invoke-virtual {p4, v0}, Landroidx/emoji2/text/flatbuffer/Table;->a(I)I
.line 28
.line 29
.line 30
move-result v1
.line 31
const/4 v2, 0x0
.line 32
if-eqz v1, :cond_0
.line 33
.line 34
iget-object v3, p4, Landroidx/emoji2/text/flatbuffer/Table;->b:Ljava/nio/ByteBuffer;
.line 35
.line 36
iget p4, p4, Landroidx/emoji2/text/flatbuffer/Table;->a:I
.line 37
.line 38
add-int/2addr v1, p4
.line 39
invoke-virtual {v3, v1}, Ljava/nio/ByteBuffer;->getShort(I)S
.line 40
.line 41
.line 42
move-result p4
.line 43
goto :goto_0
.line 44
:cond_0
move p4, v2
.line 45
:goto_0
int-to-float p4, p4
.line 46
div-float/2addr p1, p4
.line 47
iput p1, p0, Landroidx/emoji2/text/EmojiSpan;->h:F
.line 48
.line 49
invoke-virtual {p3}, Landroidx/emoji2/text/TypefaceEmojiRasterizer;->b()Landroidx/emoji2/text/flatbuffer/MetadataItem;
.line 50
.line 51
.line 52
move-result-object p1
.line 53
invoke-virtual {p1, v0}, Landroidx/emoji2/text/flatbuffer/Table;->a(I)I
.line 54
.line 55
.line 56
move-result p4
.line 57
if-eqz p4, :cond_1
.line 58
.line 59
iget-object v0, p1, Landroidx/emoji2/text/flatbuffer/Table;->b:Ljava/nio/ByteBuffer;
.line 60
.line 61
iget p1, p1, Landroidx/emoji2/text/flatbuffer/Table;->a:I
.line 62
.line 63
add-int/2addr p4, p1
.line 64
invoke-virtual {v0, p4}, Ljava/nio/ByteBuffer;->getShort(I)S
.line 65
.line 66
.line 67
:cond_1
invoke-virtual {p3}, Landroidx/emoji2/text/TypefaceEmojiRasterizer;->b()Landroidx/emoji2/text/flatbuffer/MetadataItem;
.line 68
.line 69
.line 70
move-result-object p1
.line 71
const/16 p3, 0xc
.line 72
.line 73
invoke-virtual {p1, p3}, Landroidx/emoji2/text/flatbuffer/Table;->a(I)I
.line 74
.line 75
.line 76
move-result p3
.line 77
if-eqz p3, :cond_2
.line 78
.line 79
iget-object p4, p1, Landroidx/emoji2/text/flatbuffer/Table;->b:Ljava/nio/ByteBuffer;
.line 80
.line 81
iget p1, p1, Landroidx/emoji2/text/flatbuffer/Table;->a:I
.line 82
.line 83
add-int/2addr p3, p1
.line 84
invoke-virtual {p4, p3}, Ljava/nio/ByteBuffer;->getShort(I)S
.line 85
.line 86
.line 87
move-result v2
.line 88
:cond_2
int-to-float p1, v2
.line 89
iget p3, p0, Landroidx/emoji2/text/EmojiSpan;->h:F
.line 90
.line 91
mul-float/2addr p1, p3
.line 92
float-to-int p1, p1
.line 93
int-to-short p1, p1
.line 94
iput-short p1, p0, Landroidx/emoji2/text/EmojiSpan;->g:S
.line 95
.line 96
if-eqz p5, :cond_3
.line 97
.line 98
iget p3, p2, Landroid/graphics/Paint$FontMetricsInt;->ascent:I
.line 99
.line 100
iput p3, p5, Landroid/graphics/Paint$FontMetricsInt;->ascent:I
.line 101
.line 102
iget p3, p2, Landroid/graphics/Paint$FontMetricsInt;->descent:I
.line 103
.line 104
iput p3, p5, Landroid/graphics/Paint$FontMetricsInt;->descent:I
.line 105
.line 106
iget p3, p2, Landroid/graphics/Paint$FontMetricsInt;->top:I
.line 107
.line 108
iput p3, p5, Landroid/graphics/Paint$FontMetricsInt;->top:I
.line 109
.line 110
iget p2, p2, Landroid/graphics/Paint$FontMetricsInt;->bottom:I
.line 111
.line 112
iput p2, p5, Landroid/graphics/Paint$FontMetricsInt;->bottom:I
.line 113
.line 114
:cond_3
return p1
.end method