soul-browser/app/smali_classes3/com/google/api/client/util/PemReader.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

310 lines
7 KiB
Smali

.class public final Lcom/google/api/client/util/PemReader;
.super Ljava/lang/Object;
.source "SourceFile"
# annotations
.annotation build Lcom/google/api/client/util/Beta;
.end annotation
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/google/api/client/util/PemReader$Section;
}
.end annotation
# static fields
.field private static final BEGIN_PATTERN:Ljava/util/regex/Pattern;
.field private static final END_PATTERN:Ljava/util/regex/Pattern;
# instance fields
.field private reader:Ljava/io/BufferedReader;
# direct methods
.method static constructor <clinit>()V
.locals 1
.line 1
const-string v0, "-----BEGIN ([A-Z ]+)-----"
.line 2
.line 3
invoke-static {v0}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;
.line 4
.line 5
.line 6
move-result-object v0
.line 7
sput-object v0, Lcom/google/api/client/util/PemReader;->BEGIN_PATTERN:Ljava/util/regex/Pattern;
.line 8
.line 9
const-string v0, "-----END ([A-Z ]+)-----"
.line 10
.line 11
invoke-static {v0}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;
.line 12
.line 13
.line 14
move-result-object v0
.line 15
sput-object v0, Lcom/google/api/client/util/PemReader;->END_PATTERN:Ljava/util/regex/Pattern;
.line 16
.line 17
return-void
.end method
.method public constructor <init>(Ljava/io/Reader;)V
.locals 1
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 2
.line 3
.line 4
new-instance v0, Ljava/io/BufferedReader;
.line 5
.line 6
invoke-direct {v0, p1}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;)V
.line 7
.line 8
.line 9
iput-object v0, p0, Lcom/google/api/client/util/PemReader;->reader:Ljava/io/BufferedReader;
.line 10
.line 11
return-void
.end method
.method public static readFirstSectionAndClose(Ljava/io/Reader;)Lcom/google/api/client/util/PemReader$Section;
.locals 1
const/4 v0, 0x0
.line 1
invoke-static {p0, v0}, Lcom/google/api/client/util/PemReader;->readFirstSectionAndClose(Ljava/io/Reader;Ljava/lang/String;)Lcom/google/api/client/util/PemReader$Section;
move-result-object p0
return-object p0
.end method
.method public static readFirstSectionAndClose(Ljava/io/Reader;Ljava/lang/String;)Lcom/google/api/client/util/PemReader$Section;
.locals 1
.line 2
new-instance v0, Lcom/google/api/client/util/PemReader;
invoke-direct {v0, p0}, Lcom/google/api/client/util/PemReader;-><init>(Ljava/io/Reader;)V
.line 3
:try_start_0
invoke-virtual {v0, p1}, Lcom/google/api/client/util/PemReader;->readNextSection(Ljava/lang/String;)Lcom/google/api/client/util/PemReader$Section;
move-result-object p0
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 4
invoke-virtual {v0}, Lcom/google/api/client/util/PemReader;->close()V
return-object p0
:catchall_0
move-exception p0
invoke-virtual {v0}, Lcom/google/api/client/util/PemReader;->close()V
.line 5
throw p0
.end method
# virtual methods
.method public close()V
.locals 1
.line 1
iget-object v0, p0, Lcom/google/api/client/util/PemReader;->reader:Ljava/io/BufferedReader;
.line 2
.line 3
invoke-virtual {v0}, Ljava/io/BufferedReader;->close()V
.line 4
.line 5
.line 6
return-void
.end method
.method public readNextSection()Lcom/google/api/client/util/PemReader$Section;
.locals 1
const/4 v0, 0x0
.line 1
invoke-virtual {p0, v0}, Lcom/google/api/client/util/PemReader;->readNextSection(Ljava/lang/String;)Lcom/google/api/client/util/PemReader$Section;
move-result-object v0
return-object v0
.end method
.method public readNextSection(Ljava/lang/String;)Lcom/google/api/client/util/PemReader$Section;
.locals 8
const/4 v0, 0x0
move-object v1, v0
move-object v2, v1
.line 2
:cond_0
:goto_0
iget-object v3, p0, Lcom/google/api/client/util/PemReader;->reader:Ljava/io/BufferedReader;
invoke-virtual {v3}, Ljava/io/BufferedReader;->readLine()Ljava/lang/String;
move-result-object v3
const/4 v4, 0x0
const/4 v5, 0x1
if-nez v3, :cond_2
if-nez v2, :cond_1
move p1, v5
goto :goto_1
:cond_1
move p1, v4
.line 3
:goto_1
new-array v1, v5, [Ljava/lang/Object;
aput-object v2, v1, v4
const-string v2, "missing end tag (%s)"
invoke-static {p1, v2, v1}, Lcom/google/api/client/util/Preconditions;->checkArgument(ZLjava/lang/String;[Ljava/lang/Object;)V
return-object v0
:cond_2
if-nez v1, :cond_4
.line 4
sget-object v4, Lcom/google/api/client/util/PemReader;->BEGIN_PATTERN:Ljava/util/regex/Pattern;
invoke-virtual {v4, v3}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
move-result-object v3
.line 5
invoke-virtual {v3}, Ljava/util/regex/Matcher;->matches()Z
move-result v4
if-eqz v4, :cond_0
.line 6
invoke-virtual {v3, v5}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
move-result-object v3
if-eqz p1, :cond_3
.line 7
invoke-virtual {v3, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_0
.line 8
:cond_3
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
move-object v2, v3
goto :goto_0
.line 9
:cond_4
sget-object v6, Lcom/google/api/client/util/PemReader;->END_PATTERN:Ljava/util/regex/Pattern;
invoke-virtual {v6, v3}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
move-result-object v6
.line 10
invoke-virtual {v6}, Ljava/util/regex/Matcher;->matches()Z
move-result v7
if-eqz v7, :cond_5
.line 11
invoke-virtual {v6, v5}, Ljava/util/regex/Matcher;->group(I)Ljava/lang/String;
move-result-object p1
.line 12
invoke-virtual {p1, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
const/4 v3, 0x2
new-array v3, v3, [Ljava/lang/Object;
aput-object p1, v3, v4
aput-object v2, v3, v5
.line 13
const-string p1, "end tag (%s) doesn\'t match begin tag (%s)"
invoke-static {v0, p1, v3}, Lcom/google/api/client/util/Preconditions;->checkArgument(ZLjava/lang/String;[Ljava/lang/Object;)V
.line 14
new-instance p1, Lcom/google/api/client/util/PemReader$Section;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-static {v0}, Lcom/google/api/client/util/Base64;->decodeBase64(Ljava/lang/String;)[B
move-result-object v0
invoke-direct {p1, v2, v0}, Lcom/google/api/client/util/PemReader$Section;-><init>(Ljava/lang/String;[B)V
return-object p1
.line 15
:cond_5
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
goto :goto_0
.end method