soul-browser/app/smali_classes4/okhttp3/internal/platform/android/AndroidSocketAdapter.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

613 lines
13 KiB
Smali

.class public Lokhttp3/internal/platform/android/AndroidSocketAdapter;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lokhttp3/internal/platform/android/SocketAdapter;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lokhttp3/internal/platform/android/AndroidSocketAdapter$Companion;
}
.end annotation
.annotation runtime Lkotlin/Metadata;
d1 = {
"\u0000\u000c\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0002\u0008\u0016\u0018\u00002\u00020\u0001:\u0001\u0002\u00a8\u0006\u0003"
}
d2 = {
"Lokhttp3/internal/platform/android/AndroidSocketAdapter;",
"Lokhttp3/internal/platform/android/SocketAdapter;",
"Companion",
"okhttp"
}
k = 0x1
mv = {
0x2,
0x2,
0x0
}
xi = 0x30
.end annotation
# static fields
.field public static final f:Lokhttp3/internal/platform/android/AndroidSocketAdapter$Companion$factory$1;
# instance fields
.field public final a:Ljava/lang/Class;
.field public final b:Ljava/lang/reflect/Method;
.field public final c:Ljava/lang/reflect/Method;
.field public final d:Ljava/lang/reflect/Method;
.field public final e:Ljava/lang/reflect/Method;
# direct methods
.method static constructor <clinit>()V
.locals 2
.line 1
const-string v0, "com.google.android.gms.org.conscrypt"
.line 2
.line 3
const-string v1, "packageName"
.line 4
.line 5
invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 6
.line 7
.line 8
new-instance v0, Lokhttp3/internal/platform/android/AndroidSocketAdapter$Companion$factory$1;
.line 9
.line 10
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
.line 11
.line 12
.line 13
sput-object v0, Lokhttp3/internal/platform/android/AndroidSocketAdapter;->f:Lokhttp3/internal/platform/android/AndroidSocketAdapter$Companion$factory$1;
.line 14
.line 15
return-void
.end method
.method public constructor <init>(Ljava/lang/Class;)V
.locals 4
.line 1
const-string v0, "sslSocketClass"
.line 2
.line 3
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 4
.line 5
.line 6
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 7
.line 8
.line 9
iput-object p1, p0, Lokhttp3/internal/platform/android/AndroidSocketAdapter;->a:Ljava/lang/Class;
.line 10
.line 11
const/4 v0, 0x1
.line 12
new-array v1, v0, [Ljava/lang/Class;
.line 13
.line 14
const/4 v2, 0x0
.line 15
sget-object v3, Ljava/lang/Boolean;->TYPE:Ljava/lang/Class;
.line 16
.line 17
aput-object v3, v1, v2
.line 18
.line 19
const-string v3, "setUseSessionTickets"
.line 20
.line 21
invoke-virtual {p1, v3, v1}, Ljava/lang/Class;->getDeclaredMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
.line 22
.line 23
.line 24
move-result-object v1
.line 25
const-string v3, "getDeclaredMethod(...)"
.line 26
.line 27
invoke-static {v1, v3}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
.line 28
.line 29
.line 30
iput-object v1, p0, Lokhttp3/internal/platform/android/AndroidSocketAdapter;->b:Ljava/lang/reflect/Method;
.line 31
.line 32
new-array v1, v0, [Ljava/lang/Class;
.line 33
.line 34
const-class v3, Ljava/lang/String;
.line 35
.line 36
aput-object v3, v1, v2
.line 37
.line 38
const-string v3, "setHostname"
.line 39
.line 40
invoke-virtual {p1, v3, v1}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
.line 41
.line 42
.line 43
move-result-object v1
.line 44
iput-object v1, p0, Lokhttp3/internal/platform/android/AndroidSocketAdapter;->c:Ljava/lang/reflect/Method;
.line 45
.line 46
const-string v1, "getAlpnSelectedProtocol"
.line 47
.line 48
const/4 v3, 0x0
.line 49
invoke-virtual {p1, v1, v3}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
.line 50
.line 51
.line 52
move-result-object v1
.line 53
iput-object v1, p0, Lokhttp3/internal/platform/android/AndroidSocketAdapter;->d:Ljava/lang/reflect/Method;
.line 54
.line 55
new-array v0, v0, [Ljava/lang/Class;
.line 56
.line 57
const-class v1, [B
.line 58
.line 59
aput-object v1, v0, v2
.line 60
.line 61
const-string v1, "setAlpnProtocols"
.line 62
.line 63
invoke-virtual {p1, v1, v0}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
.line 64
.line 65
.line 66
move-result-object p1
.line 67
iput-object p1, p0, Lokhttp3/internal/platform/android/AndroidSocketAdapter;->e:Ljava/lang/reflect/Method;
.line 68
.line 69
return-void
.end method
# virtual methods
.method public final a()Z
.locals 1
.line 1
sget-boolean v0, Lokhttp3/internal/platform/AndroidPlatform;->e:Z
.line 2
.line 3
sget-boolean v0, Lokhttp3/internal/platform/AndroidPlatform;->e:Z
.line 4
.line 5
return v0
.end method
.method public final b(Ljavax/net/ssl/SSLSocket;)Z
.locals 1
.line 1
const-string v0, "sslSocket"
.line 2
.line 3
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 4
.line 5
.line 6
iget-object v0, p0, Lokhttp3/internal/platform/android/AndroidSocketAdapter;->a:Ljava/lang/Class;
.line 7
.line 8
invoke-virtual {v0, p1}, Ljava/lang/Class;->isInstance(Ljava/lang/Object;)Z
.line 9
.line 10
.line 11
move-result p1
.line 12
return p1
.end method
.method public final c(Ljavax/net/ssl/SSLSocket;)Ljava/lang/String;
.locals 3
.line 1
const-string v0, "sslSocket"
.line 2
.line 3
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 4
.line 5
.line 6
invoke-virtual {p0, p1}, Lokhttp3/internal/platform/android/AndroidSocketAdapter;->b(Ljavax/net/ssl/SSLSocket;)Z
.line 7
.line 8
.line 9
move-result v0
.line 10
const/4 v1, 0x0
.line 11
if-nez v0, :cond_0
.line 12
.line 13
goto :goto_1
.line 14
:cond_0
:try_start_0
iget-object v0, p0, Lokhttp3/internal/platform/android/AndroidSocketAdapter;->d:Ljava/lang/reflect/Method;
.line 15
.line 16
invoke-virtual {v0, p1, v1}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
.line 17
.line 18
.line 19
move-result-object p1
.line 20
check-cast p1, [B
.line 21
.line 22
if-eqz p1, :cond_1
.line 23
.line 24
new-instance v0, Ljava/lang/String;
.line 25
.line 26
sget-object v2, Lkotlin/text/Charsets;->UTF_8:Ljava/nio/charset/Charset;
.line 27
.line 28
invoke-direct {v0, p1, v2}, Ljava/lang/String;-><init>([BLjava/nio/charset/Charset;)V
:try_end_0
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_1
.catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_0
.line 29
.line 30
.line 31
return-object v0
.line 32
:catch_0
move-exception p1
.line 33
goto :goto_0
.line 34
:catch_1
move-exception p1
.line 35
goto :goto_2
.line 36
:goto_0
invoke-virtual {p1}, Ljava/lang/reflect/InvocationTargetException;->getCause()Ljava/lang/Throwable;
.line 37
.line 38
.line 39
move-result-object v0
.line 40
instance-of v2, v0, Ljava/lang/NullPointerException;
.line 41
.line 42
if-eqz v2, :cond_2
.line 43
.line 44
check-cast v0, Ljava/lang/NullPointerException;
.line 45
.line 46
invoke-virtual {v0}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;
.line 47
.line 48
.line 49
move-result-object v0
.line 50
const-string v2, "ssl == null"
.line 51
.line 52
invoke-static {v0, v2}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
.line 53
.line 54
.line 55
move-result v0
.line 56
if-eqz v0, :cond_2
.line 57
.line 58
:cond_1
:goto_1
return-object v1
.line 59
:cond_2
new-instance v0, Ljava/lang/AssertionError;
.line 60
.line 61
invoke-direct {v0, p1}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
.line 62
.line 63
.line 64
throw v0
.line 65
:goto_2
new-instance v0, Ljava/lang/AssertionError;
.line 66
.line 67
invoke-direct {v0, p1}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
.line 68
.line 69
.line 70
throw v0
.end method
.method public final d(Ljavax/net/ssl/SSLSocket;Ljava/lang/String;Ljava/util/List;)V
.locals 5
.line 1
const-string v0, "sslSocket"
.line 2
.line 3
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 4
.line 5
.line 6
const-string v0, "protocols"
.line 7
.line 8
invoke-static {p3, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 9
.line 10
.line 11
invoke-virtual {p0, p1}, Lokhttp3/internal/platform/android/AndroidSocketAdapter;->b(Ljavax/net/ssl/SSLSocket;)Z
.line 12
.line 13
.line 14
move-result v0
.line 15
if-eqz v0, :cond_1
.line 16
.line 17
:try_start_0
iget-object v0, p0, Lokhttp3/internal/platform/android/AndroidSocketAdapter;->b:Ljava/lang/reflect/Method;
.line 18
.line 19
const/4 v1, 0x1
.line 20
new-array v2, v1, [Ljava/lang/Object;
.line 21
.line 22
sget-object v3, Ljava/lang/Boolean;->TRUE:Ljava/lang/Boolean;
.line 23
.line 24
const/4 v4, 0x0
.line 25
aput-object v3, v2, v4
.line 26
.line 27
invoke-virtual {v0, p1, v2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
.line 28
.line 29
.line 30
if-eqz p2, :cond_0
.line 31
.line 32
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
.line 33
.line 34
const/16 v2, 0x17
.line 35
.line 36
if-gt v0, v2, :cond_0
.line 37
.line 38
iget-object v0, p0, Lokhttp3/internal/platform/android/AndroidSocketAdapter;->c:Ljava/lang/reflect/Method;
.line 39
.line 40
new-array v2, v1, [Ljava/lang/Object;
.line 41
.line 42
aput-object p2, v2, v4
.line 43
.line 44
invoke-virtual {v0, p1, v2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
.line 45
.line 46
.line 47
goto :goto_0
.line 48
:catch_0
move-exception p1
.line 49
goto :goto_1
.line 50
:catch_1
move-exception p1
.line 51
goto :goto_2
.line 52
:cond_0
:goto_0
iget-object p2, p0, Lokhttp3/internal/platform/android/AndroidSocketAdapter;->e:Ljava/lang/reflect/Method;
.line 53
.line 54
sget-object v0, Lokhttp3/internal/platform/Platform;->a:Lokhttp3/internal/platform/Platform;
.line 55
.line 56
invoke-static {p3}, Lokhttp3/internal/platform/Platform$Companion;->b(Ljava/util/List;)[B
.line 57
.line 58
.line 59
move-result-object p3
.line 60
new-array v0, v1, [Ljava/lang/Object;
.line 61
.line 62
aput-object p3, v0, v4
.line 63
.line 64
invoke-virtual {p2, p1, v0}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
:try_end_0
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_1
.catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_0
.line 65
.line 66
.line 67
return-void
.line 68
:goto_1
new-instance p2, Ljava/lang/AssertionError;
.line 69
.line 70
invoke-direct {p2, p1}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
.line 71
.line 72
.line 73
throw p2
.line 74
:goto_2
new-instance p2, Ljava/lang/AssertionError;
.line 75
.line 76
invoke-direct {p2, p1}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
.line 77
.line 78
.line 79
throw p2
.line 80
:cond_1
return-void
.end method