soul-browser/app/smali_classes3/com/google/auth/http/HttpCredentialsAdapter.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

453 lines
8.9 KiB
Smali

.class public Lcom/google/auth/http/HttpCredentialsAdapter;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lcom/google/api/client/http/HttpRequestInitializer;
.implements Lcom/google/api/client/http/HttpUnsuccessfulResponseHandler;
# static fields
.field public static final b:Ljava/util/logging/Logger;
.field public static final c:Ljava/util/regex/Pattern;
# instance fields
.field public final a:Lcom/google/auth/Credentials;
# direct methods
.method static constructor <clinit>()V
.locals 1
.line 1
const-class v0, Lcom/google/auth/http/HttpCredentialsAdapter;
.line 2
.line 3
invoke-virtual {v0}, Ljava/lang/Class;->getName()Ljava/lang/String;
.line 4
.line 5
.line 6
move-result-object v0
.line 7
invoke-static {v0}, Ljava/util/logging/Logger;->getLogger(Ljava/lang/String;)Ljava/util/logging/Logger;
.line 8
.line 9
.line 10
move-result-object v0
.line 11
sput-object v0, Lcom/google/auth/http/HttpCredentialsAdapter;->b:Ljava/util/logging/Logger;
.line 12
.line 13
const-string v0, "\\s*error\\s*=\\s*\"?invalid_token\"?"
.line 14
.line 15
invoke-static {v0}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;
.line 16
.line 17
.line 18
move-result-object v0
.line 19
sput-object v0, Lcom/google/auth/http/HttpCredentialsAdapter;->c:Ljava/util/regex/Pattern;
.line 20
.line 21
return-void
.end method
.method public constructor <init>(Lcom/google/auth/Credentials;)V
.locals 0
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 2
.line 3
.line 4
invoke-static {p1}, Lcom/google/api/client/util/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object;
.line 5
.line 6
.line 7
iput-object p1, p0, Lcom/google/auth/http/HttpCredentialsAdapter;->a:Lcom/google/auth/Credentials;
.line 8
.line 9
return-void
.end method
# virtual methods
.method public final handleResponse(Lcom/google/api/client/http/HttpRequest;Lcom/google/api/client/http/HttpResponse;Z)Z
.locals 4
.line 1
invoke-virtual {p2}, Lcom/google/api/client/http/HttpResponse;->getHeaders()Lcom/google/api/client/http/HttpHeaders;
.line 2
.line 3
.line 4
move-result-object p3
.line 5
invoke-virtual {p3}, Lcom/google/api/client/http/HttpHeaders;->getAuthenticateAsList()Ljava/util/List;
.line 6
.line 7
.line 8
move-result-object p3
.line 9
const/4 v0, 0x1
.line 10
const/4 v1, 0x0
.line 11
if-eqz p3, :cond_1
.line 12
.line 13
invoke-interface {p3}, Ljava/util/List;->iterator()Ljava/util/Iterator;
.line 14
.line 15
.line 16
move-result-object p3
.line 17
:cond_0
invoke-interface {p3}, Ljava/util/Iterator;->hasNext()Z
.line 18
.line 19
.line 20
move-result v2
.line 21
if-eqz v2, :cond_1
.line 22
.line 23
invoke-interface {p3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
.line 24
.line 25
.line 26
move-result-object v2
.line 27
check-cast v2, Ljava/lang/String;
.line 28
.line 29
const-string v3, "Bearer "
.line 30
.line 31
invoke-virtual {v2, v3}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
.line 32
.line 33
.line 34
move-result v3
.line 35
if-eqz v3, :cond_0
.line 36
.line 37
sget-object p3, Lcom/google/auth/http/HttpCredentialsAdapter;->c:Ljava/util/regex/Pattern;
.line 38
.line 39
invoke-virtual {p3, v2}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;
.line 40
.line 41
.line 42
move-result-object p3
.line 43
invoke-virtual {p3}, Ljava/util/regex/Matcher;->find()Z
.line 44
.line 45
.line 46
move-result p3
.line 47
move v2, v0
.line 48
goto :goto_0
.line 49
:cond_1
move p3, v1
.line 50
move v2, p3
.line 51
:goto_0
if-nez v2, :cond_3
.line 52
.line 53
invoke-virtual {p2}, Lcom/google/api/client/http/HttpResponse;->getStatusCode()I
.line 54
.line 55
.line 56
move-result p2
.line 57
const/16 p3, 0x191
.line 58
.line 59
if-ne p2, p3, :cond_2
.line 60
.line 61
move p3, v0
.line 62
goto :goto_1
.line 63
:cond_2
move p3, v1
.line 64
:cond_3
:goto_1
if-eqz p3, :cond_4
.line 65
.line 66
:try_start_0
iget-object p2, p0, Lcom/google/auth/http/HttpCredentialsAdapter;->a:Lcom/google/auth/Credentials;
.line 67
.line 68
invoke-virtual {p2}, Lcom/google/auth/Credentials;->b()V
.line 69
.line 70
.line 71
invoke-virtual {p0, p1}, Lcom/google/auth/http/HttpCredentialsAdapter;->initialize(Lcom/google/api/client/http/HttpRequest;)V
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
.line 72
.line 73
.line 74
return v0
.line 75
:catch_0
move-exception p1
.line 76
sget-object p2, Ljava/util/logging/Level;->SEVERE:Ljava/util/logging/Level;
.line 77
.line 78
const-string p3, "unable to refresh token"
.line 79
.line 80
sget-object v0, Lcom/google/auth/http/HttpCredentialsAdapter;->b:Ljava/util/logging/Logger;
.line 81
.line 82
invoke-virtual {v0, p2, p3, p1}, Ljava/util/logging/Logger;->log(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V
.line 83
.line 84
.line 85
:cond_4
return v1
.end method
.method public final initialize(Lcom/google/api/client/http/HttpRequest;)V
.locals 4
.line 1
invoke-virtual {p1, p0}, Lcom/google/api/client/http/HttpRequest;->setUnsuccessfulResponseHandler(Lcom/google/api/client/http/HttpUnsuccessfulResponseHandler;)Lcom/google/api/client/http/HttpRequest;
.line 2
.line 3
.line 4
iget-object v0, p0, Lcom/google/auth/http/HttpCredentialsAdapter;->a:Lcom/google/auth/Credentials;
.line 5
.line 6
invoke-virtual {v0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
.line 7
.line 8
.line 9
invoke-virtual {p1}, Lcom/google/api/client/http/HttpRequest;->getHeaders()Lcom/google/api/client/http/HttpHeaders;
.line 10
.line 11
.line 12
move-result-object v1
.line 13
invoke-virtual {p1}, Lcom/google/api/client/http/HttpRequest;->getUrl()Lcom/google/api/client/http/GenericUrl;
.line 14
.line 15
.line 16
move-result-object v2
.line 17
if-eqz v2, :cond_0
.line 18
.line 19
invoke-virtual {p1}, Lcom/google/api/client/http/HttpRequest;->getUrl()Lcom/google/api/client/http/GenericUrl;
.line 20
.line 21
.line 22
move-result-object p1
.line 23
invoke-virtual {p1}, Lcom/google/api/client/http/GenericUrl;->toURI()Ljava/net/URI;
.line 24
.line 25
.line 26
move-result-object p1
.line 27
goto :goto_0
.line 28
:cond_0
const/4 p1, 0x0
.line 29
:goto_0
invoke-virtual {v0, p1}, Lcom/google/auth/Credentials;->a(Ljava/net/URI;)Ljava/util/Map;
.line 30
.line 31
.line 32
move-result-object p1
.line 33
if-nez p1, :cond_1
.line 34
.line 35
goto :goto_2
.line 36
:cond_1
invoke-interface {p1}, Ljava/util/Map;->entrySet()Ljava/util/Set;
.line 37
.line 38
.line 39
move-result-object p1
.line 40
invoke-interface {p1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
.line 41
.line 42
.line 43
move-result-object p1
.line 44
:goto_1
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
.line 45
.line 46
.line 47
move-result v0
.line 48
if-eqz v0, :cond_2
.line 49
.line 50
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
.line 51
.line 52
.line 53
move-result-object v0
.line 54
check-cast v0, Ljava/util/Map$Entry;
.line 55
.line 56
invoke-interface {v0}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
.line 57
.line 58
.line 59
move-result-object v2
.line 60
check-cast v2, Ljava/lang/String;
.line 61
.line 62
new-instance v3, Ljava/util/ArrayList;
.line 63
.line 64
invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V
.line 65
.line 66
.line 67
invoke-interface {v0}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
.line 68
.line 69
.line 70
move-result-object v0
.line 71
check-cast v0, Ljava/util/Collection;
.line 72
.line 73
invoke-virtual {v3, v0}, Ljava/util/ArrayList;->addAll(Ljava/util/Collection;)Z
.line 74
.line 75
.line 76
invoke-virtual {v1, v2, v3}, Lcom/google/api/client/util/GenericData;->put(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
.line 77
.line 78
.line 79
goto :goto_1
.line 80
:cond_2
:goto_2
return-void
.end method