soul-browser/app/smali/com/bumptech/glide/load/resource/bitmap/StreamBitmapDecoder.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

294 lines
7.3 KiB
Smali

.class public Lcom/bumptech/glide/load/resource/bitmap/StreamBitmapDecoder;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lcom/bumptech/glide/load/ResourceDecoder;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/bumptech/glide/load/resource/bitmap/StreamBitmapDecoder$UntrustedCallbacks;
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/lang/Object;",
"Lcom/bumptech/glide/load/ResourceDecoder<",
"Ljava/io/InputStream;",
"Landroid/graphics/Bitmap;",
">;"
}
.end annotation
# instance fields
.field public final a:Lcom/bumptech/glide/load/resource/bitmap/Downsampler;
.field public final b:Lcom/bumptech/glide/load/engine/bitmap_recycle/ArrayPool;
# direct methods
.method public constructor <init>(Lcom/bumptech/glide/load/resource/bitmap/Downsampler;Lcom/bumptech/glide/load/engine/bitmap_recycle/ArrayPool;)V
.locals 0
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 2
.line 3
.line 4
iput-object p1, p0, Lcom/bumptech/glide/load/resource/bitmap/StreamBitmapDecoder;->a:Lcom/bumptech/glide/load/resource/bitmap/Downsampler;
.line 5
.line 6
iput-object p2, p0, Lcom/bumptech/glide/load/resource/bitmap/StreamBitmapDecoder;->b:Lcom/bumptech/glide/load/engine/bitmap_recycle/ArrayPool;
.line 7
.line 8
return-void
.end method
# virtual methods
.method public final a(Ljava/lang/Object;Lcom/bumptech/glide/load/Options;)Z
.locals 0
.line 1
check-cast p1, Ljava/io/InputStream;
.line 2
.line 3
iget-object p1, p0, Lcom/bumptech/glide/load/resource/bitmap/StreamBitmapDecoder;->a:Lcom/bumptech/glide/load/resource/bitmap/Downsampler;
.line 4
.line 5
invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
.line 6
.line 7
.line 8
const/4 p1, 0x1
.line 9
return p1
.end method
.method public final b(Ljava/lang/Object;IILcom/bumptech/glide/load/Options;)Lcom/bumptech/glide/load/engine/Resource;
.locals 9
.line 1
check-cast p1, Ljava/io/InputStream;
.line 2
.line 3
instance-of v0, p1, Lcom/bumptech/glide/load/resource/bitmap/RecyclableBufferedInputStream;
.line 4
.line 5
if-eqz v0, :cond_0
.line 6
.line 7
check-cast p1, Lcom/bumptech/glide/load/resource/bitmap/RecyclableBufferedInputStream;
.line 8
.line 9
const/4 v0, 0x0
.line 10
move v1, v0
.line 11
goto :goto_0
.line 12
:cond_0
new-instance v0, Lcom/bumptech/glide/load/resource/bitmap/RecyclableBufferedInputStream;
.line 13
.line 14
iget-object v1, p0, Lcom/bumptech/glide/load/resource/bitmap/StreamBitmapDecoder;->b:Lcom/bumptech/glide/load/engine/bitmap_recycle/ArrayPool;
.line 15
.line 16
invoke-direct {v0, p1, v1}, Lcom/bumptech/glide/load/resource/bitmap/RecyclableBufferedInputStream;-><init>(Ljava/io/InputStream;Lcom/bumptech/glide/load/engine/bitmap_recycle/ArrayPool;)V
.line 17
.line 18
.line 19
const/4 p1, 0x1
.line 20
move v1, p1
.line 21
move-object p1, v0
.line 22
:goto_0
sget-object v2, Lcom/bumptech/glide/util/ExceptionPassthroughInputStream;->g:Ljava/util/ArrayDeque;
.line 23
.line 24
monitor-enter v2
.line 25
:try_start_0
invoke-virtual {v2}, Ljava/util/ArrayDeque;->poll()Ljava/lang/Object;
.line 26
.line 27
.line 28
move-result-object v0
.line 29
check-cast v0, Lcom/bumptech/glide/util/ExceptionPassthroughInputStream;
.line 30
.line 31
monitor-exit v2
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_1
.line 32
if-nez v0, :cond_1
.line 33
.line 34
new-instance v0, Lcom/bumptech/glide/util/ExceptionPassthroughInputStream;
.line 35
.line 36
invoke-direct {v0}, Ljava/io/InputStream;-><init>()V
.line 37
.line 38
.line 39
:cond_1
move-object v2, v0
.line 40
iput-object p1, v2, Lcom/bumptech/glide/util/ExceptionPassthroughInputStream;->c:Lcom/bumptech/glide/load/resource/bitmap/RecyclableBufferedInputStream;
.line 41
.line 42
new-instance v0, Lcom/bumptech/glide/util/MarkEnforcingInputStream;
.line 43
.line 44
invoke-direct {v0, v2}, Lcom/bumptech/glide/util/MarkEnforcingInputStream;-><init>(Lcom/bumptech/glide/util/ExceptionPassthroughInputStream;)V
.line 45
.line 46
.line 47
new-instance v8, Lcom/bumptech/glide/load/resource/bitmap/StreamBitmapDecoder$UntrustedCallbacks;
.line 48
.line 49
invoke-direct {v8, p1, v2}, Lcom/bumptech/glide/load/resource/bitmap/StreamBitmapDecoder$UntrustedCallbacks;-><init>(Lcom/bumptech/glide/load/resource/bitmap/RecyclableBufferedInputStream;Lcom/bumptech/glide/util/ExceptionPassthroughInputStream;)V
.line 50
.line 51
.line 52
:try_start_1
iget-object v3, p0, Lcom/bumptech/glide/load/resource/bitmap/StreamBitmapDecoder;->a:Lcom/bumptech/glide/load/resource/bitmap/Downsampler;
.line 53
.line 54
new-instance v4, Lcom/bumptech/glide/load/resource/bitmap/ImageReader$InputStreamImageReader;
.line 55
.line 56
iget-object v5, v3, Lcom/bumptech/glide/load/resource/bitmap/Downsampler;->d:Ljava/util/ArrayList;
.line 57
.line 58
iget-object v6, v3, Lcom/bumptech/glide/load/resource/bitmap/Downsampler;->c:Lcom/bumptech/glide/load/engine/bitmap_recycle/ArrayPool;
.line 59
.line 60
invoke-direct {v4, v0, v5, v6}, Lcom/bumptech/glide/load/resource/bitmap/ImageReader$InputStreamImageReader;-><init>(Lcom/bumptech/glide/util/MarkEnforcingInputStream;Ljava/util/ArrayList;Lcom/bumptech/glide/load/engine/bitmap_recycle/ArrayPool;)V
.line 61
.line 62
.line 63
move v5, p2
.line 64
move v6, p3
.line 65
move-object v7, p4
.line 66
invoke-virtual/range {v3 .. v8}, Lcom/bumptech/glide/load/resource/bitmap/Downsampler;->a(Lcom/bumptech/glide/load/resource/bitmap/ImageReader;IILcom/bumptech/glide/load/Options;Lcom/bumptech/glide/load/resource/bitmap/Downsampler$DecodeCallbacks;)Lcom/bumptech/glide/load/resource/bitmap/BitmapResource;
.line 67
.line 68
.line 69
move-result-object p2
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 70
invoke-virtual {v2}, Lcom/bumptech/glide/util/ExceptionPassthroughInputStream;->release()V
.line 71
.line 72
.line 73
if-eqz v1, :cond_2
.line 74
.line 75
invoke-virtual {p1}, Lcom/bumptech/glide/load/resource/bitmap/RecyclableBufferedInputStream;->release()V
.line 76
.line 77
.line 78
:cond_2
return-object p2
.line 79
:catchall_0
move-exception v0
.line 80
move-object p2, v0
.line 81
invoke-virtual {v2}, Lcom/bumptech/glide/util/ExceptionPassthroughInputStream;->release()V
.line 82
.line 83
.line 84
if-eqz v1, :cond_3
.line 85
.line 86
invoke-virtual {p1}, Lcom/bumptech/glide/load/resource/bitmap/RecyclableBufferedInputStream;->release()V
.line 87
.line 88
.line 89
:cond_3
throw p2
.line 90
:catchall_1
move-exception v0
.line 91
move-object p1, v0
.line 92
:try_start_2
monitor-exit v2
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_1
.line 93
throw p1
.end method