soul-browser/app/smali/com/caverock/androidsvg/SVGAndroidRenderer$PathTextDrawer.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

189 lines
4.9 KiB
Smali

.class Lcom/caverock/androidsvg/SVGAndroidRenderer$PathTextDrawer;
.super Lcom/caverock/androidsvg/SVGAndroidRenderer$PlainTextDrawer;
.source "SourceFile"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/caverock/androidsvg/SVGAndroidRenderer;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x1
name = "PathTextDrawer"
.end annotation
# instance fields
.field public final d:Landroid/graphics/Path;
.field public final synthetic e:Lcom/caverock/androidsvg/SVGAndroidRenderer;
# direct methods
.method public constructor <init>(Lcom/caverock/androidsvg/SVGAndroidRenderer;Landroid/graphics/Path;F)V
.locals 1
.line 1
iput-object p1, p0, Lcom/caverock/androidsvg/SVGAndroidRenderer$PathTextDrawer;->e:Lcom/caverock/androidsvg/SVGAndroidRenderer;
.line 2
.line 3
const/4 v0, 0x0
.line 4
invoke-direct {p0, p1, p3, v0}, Lcom/caverock/androidsvg/SVGAndroidRenderer$PlainTextDrawer;-><init>(Lcom/caverock/androidsvg/SVGAndroidRenderer;FF)V
.line 5
.line 6
.line 7
iput-object p2, p0, Lcom/caverock/androidsvg/SVGAndroidRenderer$PathTextDrawer;->d:Landroid/graphics/Path;
.line 8
.line 9
return-void
.end method
# virtual methods
.method public final b(Ljava/lang/String;)V
.locals 16
.line 1
move-object/from16 v0, p0
.line 2
.line 3
iget-object v1, v0, Lcom/caverock/androidsvg/SVGAndroidRenderer$PathTextDrawer;->e:Lcom/caverock/androidsvg/SVGAndroidRenderer;
.line 4
.line 5
invoke-virtual {v1}, Lcom/caverock/androidsvg/SVGAndroidRenderer;->V()Z
.line 6
.line 7
.line 8
move-result v2
.line 9
if-eqz v2, :cond_1
.line 10
.line 11
iget-object v2, v1, Lcom/caverock/androidsvg/SVGAndroidRenderer;->d:Lcom/caverock/androidsvg/SVGAndroidRenderer$RendererState;
.line 12
.line 13
iget-boolean v3, v2, Lcom/caverock/androidsvg/SVGAndroidRenderer$RendererState;->b:Z
.line 14
.line 15
if-eqz v3, :cond_0
.line 16
.line 17
iget-object v4, v1, Lcom/caverock/androidsvg/SVGAndroidRenderer;->a:Landroid/graphics/Canvas;
.line 18
.line 19
iget v7, v0, Lcom/caverock/androidsvg/SVGAndroidRenderer$PlainTextDrawer;->a:F
.line 20
.line 21
iget v8, v0, Lcom/caverock/androidsvg/SVGAndroidRenderer$PlainTextDrawer;->b:F
.line 22
.line 23
iget-object v9, v2, Lcom/caverock/androidsvg/SVGAndroidRenderer$RendererState;->d:Landroid/graphics/Paint;
.line 24
.line 25
iget-object v6, v0, Lcom/caverock/androidsvg/SVGAndroidRenderer$PathTextDrawer;->d:Landroid/graphics/Path;
.line 26
.line 27
move-object/from16 v5, p1
.line 28
.line 29
invoke-virtual/range {v4 .. v9}, Landroid/graphics/Canvas;->drawTextOnPath(Ljava/lang/String;Landroid/graphics/Path;FFLandroid/graphics/Paint;)V
.line 30
.line 31
.line 32
:cond_0
iget-object v2, v1, Lcom/caverock/androidsvg/SVGAndroidRenderer;->d:Lcom/caverock/androidsvg/SVGAndroidRenderer$RendererState;
.line 33
.line 34
iget-boolean v3, v2, Lcom/caverock/androidsvg/SVGAndroidRenderer$RendererState;->c:Z
.line 35
.line 36
if-eqz v3, :cond_1
.line 37
.line 38
iget-object v10, v1, Lcom/caverock/androidsvg/SVGAndroidRenderer;->a:Landroid/graphics/Canvas;
.line 39
.line 40
iget v13, v0, Lcom/caverock/androidsvg/SVGAndroidRenderer$PlainTextDrawer;->a:F
.line 41
.line 42
iget v14, v0, Lcom/caverock/androidsvg/SVGAndroidRenderer$PlainTextDrawer;->b:F
.line 43
.line 44
iget-object v15, v2, Lcom/caverock/androidsvg/SVGAndroidRenderer$RendererState;->e:Landroid/graphics/Paint;
.line 45
.line 46
iget-object v12, v0, Lcom/caverock/androidsvg/SVGAndroidRenderer$PathTextDrawer;->d:Landroid/graphics/Path;
.line 47
.line 48
move-object/from16 v11, p1
.line 49
.line 50
invoke-virtual/range {v10 .. v15}, Landroid/graphics/Canvas;->drawTextOnPath(Ljava/lang/String;Landroid/graphics/Path;FFLandroid/graphics/Paint;)V
.line 51
.line 52
.line 53
:cond_1
iget v2, v0, Lcom/caverock/androidsvg/SVGAndroidRenderer$PlainTextDrawer;->a:F
.line 54
.line 55
iget-object v1, v1, Lcom/caverock/androidsvg/SVGAndroidRenderer;->d:Lcom/caverock/androidsvg/SVGAndroidRenderer$RendererState;
.line 56
.line 57
iget-object v1, v1, Lcom/caverock/androidsvg/SVGAndroidRenderer$RendererState;->d:Landroid/graphics/Paint;
.line 58
.line 59
move-object/from16 v5, p1
.line 60
.line 61
invoke-virtual {v1, v5}, Landroid/graphics/Paint;->measureText(Ljava/lang/String;)F
.line 62
.line 63
.line 64
move-result v1
.line 65
add-float/2addr v1, v2
.line 66
iput v1, v0, Lcom/caverock/androidsvg/SVGAndroidRenderer$PlainTextDrawer;->a:F
.line 67
.line 68
return-void
.end method