soul-browser/app/smali/com/google/android/datatransport/cct/a.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

879 lines
19 KiB
Smali

.class public final synthetic Lcom/google/android/datatransport/cct/a;
.super Ljava/lang/Object;
.source "SourceFile"
# interfaces
.implements Lcom/google/android/datatransport/runtime/retries/Function;
# instance fields
.field public final synthetic a:Lcom/google/android/datatransport/cct/CctTransportBackend;
# direct methods
.method public synthetic constructor <init>(Lcom/google/android/datatransport/cct/CctTransportBackend;)V
.locals 0
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lcom/google/android/datatransport/cct/a;->a:Lcom/google/android/datatransport/cct/CctTransportBackend;
return-void
.end method
# virtual methods
.method public final a(Ljava/lang/Object;)Ljava/lang/Object;
.locals 16
.line 1
move-object/from16 v0, p1
.line 2
.line 3
check-cast v0, Lcom/google/android/datatransport/cct/CctTransportBackend$HttpRequest;
.line 4
.line 5
iget-object v1, v0, Lcom/google/android/datatransport/cct/CctTransportBackend$HttpRequest;->a:Ljava/net/URL;
.line 6
.line 7
const-string v2, "CctTransportBackend"
.line 8
.line 9
invoke-static {v2}, Lcom/google/android/datatransport/runtime/logging/Logging;->d(Ljava/lang/String;)Ljava/lang/String;
.line 10
.line 11
.line 12
move-result-object v3
.line 13
const/4 v4, 0x4
.line 14
invoke-static {v3, v4}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
.line 15
.line 16
.line 17
move-result v5
.line 18
const/4 v6, 0x0
.line 19
const/4 v7, 0x1
.line 20
if-eqz v5, :cond_0
.line 21
.line 22
new-array v5, v7, [Ljava/lang/Object;
.line 23
.line 24
aput-object v1, v5, v6
.line 25
.line 26
const-string v8, "Making request to: %s"
.line 27
.line 28
invoke-static {v8, v5}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
.line 29
.line 30
.line 31
move-result-object v5
.line 32
invoke-static {v3, v5}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 33
.line 34
.line 35
:cond_0
invoke-virtual {v1}, Ljava/net/URL;->openConnection()Ljava/net/URLConnection;
.line 36
.line 37
.line 38
move-result-object v1
.line 39
check-cast v1, Ljava/net/HttpURLConnection;
.line 40
.line 41
const/16 v3, 0x7530
.line 42
.line 43
invoke-virtual {v1, v3}, Ljava/net/URLConnection;->setConnectTimeout(I)V
.line 44
.line 45
.line 46
move-object/from16 v3, p0
.line 47
.line 48
iget-object v5, v3, Lcom/google/android/datatransport/cct/a;->a:Lcom/google/android/datatransport/cct/CctTransportBackend;
.line 49
.line 50
iget v8, v5, Lcom/google/android/datatransport/cct/CctTransportBackend;->g:I
.line 51
.line 52
invoke-virtual {v1, v8}, Ljava/net/URLConnection;->setReadTimeout(I)V
.line 53
.line 54
.line 55
invoke-virtual {v1, v7}, Ljava/net/URLConnection;->setDoOutput(Z)V
.line 56
.line 57
.line 58
invoke-virtual {v1, v6}, Ljava/net/HttpURLConnection;->setInstanceFollowRedirects(Z)V
.line 59
.line 60
.line 61
const-string v8, "POST"
.line 62
.line 63
invoke-virtual {v1, v8}, Ljava/net/HttpURLConnection;->setRequestMethod(Ljava/lang/String;)V
.line 64
.line 65
.line 66
const-string v8, "User-Agent"
.line 67
.line 68
const-string v9, "datatransport/3.1.8 android/"
.line 69
.line 70
invoke-virtual {v1, v8, v9}, Ljava/net/URLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
.line 71
.line 72
.line 73
const-string v8, "Content-Encoding"
.line 74
.line 75
const-string v9, "gzip"
.line 76
.line 77
invoke-virtual {v1, v8, v9}, Ljava/net/URLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
.line 78
.line 79
.line 80
const-string v10, "application/json"
.line 81
.line 82
const-string v11, "Content-Type"
.line 83
.line 84
invoke-virtual {v1, v11, v10}, Ljava/net/URLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
.line 85
.line 86
.line 87
const-string v10, "Accept-Encoding"
.line 88
.line 89
invoke-virtual {v1, v10, v9}, Ljava/net/URLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
.line 90
.line 91
.line 92
iget-object v10, v0, Lcom/google/android/datatransport/cct/CctTransportBackend$HttpRequest;->c:Ljava/lang/String;
.line 93
.line 94
if-eqz v10, :cond_1
.line 95
.line 96
const-string v12, "X-Goog-Api-Key"
.line 97
.line 98
invoke-virtual {v1, v12, v10}, Ljava/net/URLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
.line 99
.line 100
.line 101
:cond_1
const-wide/16 v12, 0x0
.line 102
.line 103
:try_start_0
invoke-virtual {v1}, Ljava/net/URLConnection;->getOutputStream()Ljava/io/OutputStream;
.line 104
.line 105
.line 106
move-result-object v14
:try_end_0
.catch Ljava/net/ConnectException; {:try_start_0 .. :try_end_0} :catch_3
.catch Ljava/net/UnknownHostException; {:try_start_0 .. :try_end_0} :catch_2
.catch Lcom/google/firebase/encoders/EncodingException; {:try_start_0 .. :try_end_0} :catch_1
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
.line 107
:try_start_1
new-instance v15, Ljava/util/zip/GZIPOutputStream;
.line 108
.line 109
invoke-direct {v15, v14}, Ljava/util/zip/GZIPOutputStream;-><init>(Ljava/io/OutputStream;)V
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_4
.line 110
.line 111
.line 112
:try_start_2
iget-object v5, v5, Lcom/google/android/datatransport/cct/CctTransportBackend;->a:Lcom/google/firebase/encoders/DataEncoder;
.line 113
.line 114
iget-object v0, v0, Lcom/google/android/datatransport/cct/CctTransportBackend$HttpRequest;->b:Lcom/google/android/datatransport/cct/internal/BatchedLogRequest;
.line 115
.line 116
move/from16 p1, v6
.line 117
.line 118
new-instance v6, Ljava/io/BufferedWriter;
.line 119
.line 120
new-instance v10, Ljava/io/OutputStreamWriter;
.line 121
.line 122
invoke-direct {v10, v15}, Ljava/io/OutputStreamWriter;-><init>(Ljava/io/OutputStream;)V
.line 123
.line 124
.line 125
invoke-direct {v6, v10}, Ljava/io/BufferedWriter;-><init>(Ljava/io/Writer;)V
.line 126
.line 127
.line 128
invoke-interface {v5, v0, v6}, Lcom/google/firebase/encoders/DataEncoder;->a(Ljava/lang/Object;Ljava/io/Writer;)V
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_5
.line 129
.line 130
.line 131
:try_start_3
invoke-virtual {v15}, Ljava/io/OutputStream;->close()V
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_4
.line 132
.line 133
.line 134
if-eqz v14, :cond_2
.line 135
.line 136
:try_start_4
invoke-virtual {v14}, Ljava/io/OutputStream;->close()V
:try_end_4
.catch Ljava/net/ConnectException; {:try_start_4 .. :try_end_4} :catch_3
.catch Ljava/net/UnknownHostException; {:try_start_4 .. :try_end_4} :catch_2
.catch Lcom/google/firebase/encoders/EncodingException; {:try_start_4 .. :try_end_4} :catch_1
.catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_0
.line 137
.line 138
.line 139
goto :goto_1
.line 140
:catch_0
move-exception v0
.line 141
goto/16 :goto_b
.line 142
.line 143
:catch_1
move-exception v0
.line 144
goto/16 :goto_b
.line 145
.line 146
:catch_2
move-exception v0
.line 147
:goto_0
const/4 v7, 0x0
.line 148
goto/16 :goto_c
.line 149
.line 150
:catch_3
move-exception v0
.line 151
goto :goto_0
.line 152
:cond_2
:goto_1
invoke-virtual {v1}, Ljava/net/HttpURLConnection;->getResponseCode()I
.line 153
.line 154
.line 155
move-result v0
.line 156
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
.line 157
.line 158
.line 159
move-result-object v5
.line 160
invoke-static {v2}, Lcom/google/android/datatransport/runtime/logging/Logging;->d(Ljava/lang/String;)Ljava/lang/String;
.line 161
.line 162
.line 163
move-result-object v6
.line 164
invoke-static {v6, v4}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z
.line 165
.line 166
.line 167
move-result v4
.line 168
if-eqz v4, :cond_3
.line 169
.line 170
new-array v4, v7, [Ljava/lang/Object;
.line 171
.line 172
aput-object v5, v4, p1
.line 173
.line 174
const-string v5, "Status Code: %d"
.line 175
.line 176
invoke-static {v5, v4}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
.line 177
.line 178
.line 179
move-result-object v4
.line 180
invoke-static {v6, v4}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 181
.line 182
.line 183
:cond_3
const-string v4, "Content-Type: %s"
.line 184
.line 185
invoke-virtual {v1, v11}, Ljava/net/URLConnection;->getHeaderField(Ljava/lang/String;)Ljava/lang/String;
.line 186
.line 187
.line 188
move-result-object v5
.line 189
invoke-static {v5, v2, v4}, Lcom/google/android/datatransport/runtime/logging/Logging;->a(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/String;)V
.line 190
.line 191
.line 192
const-string v4, "Content-Encoding: %s"
.line 193
.line 194
invoke-virtual {v1, v8}, Ljava/net/URLConnection;->getHeaderField(Ljava/lang/String;)Ljava/lang/String;
.line 195
.line 196
.line 197
move-result-object v5
.line 198
invoke-static {v5, v2, v4}, Lcom/google/android/datatransport/runtime/logging/Logging;->a(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/String;)V
.line 199
.line 200
.line 201
const/16 v2, 0x12e
.line 202
.line 203
if-eq v0, v2, :cond_b
.line 204
.line 205
const/16 v2, 0x12d
.line 206
.line 207
if-eq v0, v2, :cond_b
.line 208
.line 209
const/16 v2, 0x133
.line 210
.line 211
if-ne v0, v2, :cond_4
.line 212
.line 213
goto :goto_7
.line 214
:cond_4
const/16 v2, 0xc8
.line 215
.line 216
if-eq v0, v2, :cond_5
.line 217
.line 218
new-instance v1, Lcom/google/android/datatransport/cct/CctTransportBackend$HttpResponse;
.line 219
.line 220
const/4 v2, 0x0
.line 221
invoke-direct {v1, v0, v2, v12, v13}, Lcom/google/android/datatransport/cct/CctTransportBackend$HttpResponse;-><init>(ILjava/net/URL;J)V
.line 222
.line 223
.line 224
return-object v1
.line 225
:cond_5
invoke-virtual {v1}, Ljava/net/URLConnection;->getInputStream()Ljava/io/InputStream;
.line 226
.line 227
.line 228
move-result-object v2
.line 229
:try_start_5
invoke-virtual {v1, v8}, Ljava/net/URLConnection;->getHeaderField(Ljava/lang/String;)Ljava/lang/String;
.line 230
.line 231
.line 232
move-result-object v1
.line 233
invoke-virtual {v9, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
.line 234
.line 235
.line 236
move-result v1
.line 237
if-eqz v1, :cond_6
.line 238
.line 239
new-instance v1, Ljava/util/zip/GZIPInputStream;
.line 240
.line 241
invoke-direct {v1, v2}, Ljava/util/zip/GZIPInputStream;-><init>(Ljava/io/InputStream;)V
:try_end_5
.catchall {:try_start_5 .. :try_end_5} :catchall_0
.line 242
.line 243
.line 244
goto :goto_2
.line 245
:cond_6
move-object v1, v2
.line 246
:goto_2
:try_start_6
new-instance v4, Ljava/io/BufferedReader;
.line 247
.line 248
new-instance v5, Ljava/io/InputStreamReader;
.line 249
.line 250
invoke-direct {v5, v1}, Ljava/io/InputStreamReader;-><init>(Ljava/io/InputStream;)V
.line 251
.line 252
.line 253
invoke-direct {v4, v5}, Ljava/io/BufferedReader;-><init>(Ljava/io/Reader;)V
.line 254
.line 255
.line 256
invoke-static {v4}, Lcom/google/android/datatransport/cct/internal/LogResponse;->a(Ljava/io/BufferedReader;)Lcom/google/android/datatransport/cct/internal/LogResponse;
.line 257
.line 258
.line 259
move-result-object v4
.line 260
invoke-virtual {v4}, Lcom/google/android/datatransport/cct/internal/LogResponse;->b()J
.line 261
.line 262
.line 263
move-result-wide v4
.line 264
new-instance v6, Lcom/google/android/datatransport/cct/CctTransportBackend$HttpResponse;
.line 265
.line 266
const/4 v7, 0x0
.line 267
invoke-direct {v6, v0, v7, v4, v5}, Lcom/google/android/datatransport/cct/CctTransportBackend$HttpResponse;-><init>(ILjava/net/URL;J)V
:try_end_6
.catchall {:try_start_6 .. :try_end_6} :catchall_1
.line 268
.line 269
.line 270
if-eqz v1, :cond_7
.line 271
.line 272
:try_start_7
invoke-virtual {v1}, Ljava/io/InputStream;->close()V
:try_end_7
.catchall {:try_start_7 .. :try_end_7} :catchall_0
.line 273
.line 274
.line 275
goto :goto_3
.line 276
:catchall_0
move-exception v0
.line 277
move-object v1, v0
.line 278
goto :goto_5
.line 279
:cond_7
:goto_3
if-eqz v2, :cond_8
.line 280
.line 281
invoke-virtual {v2}, Ljava/io/InputStream;->close()V
.line 282
.line 283
.line 284
:cond_8
return-object v6
.line 285
:catchall_1
move-exception v0
.line 286
move-object v4, v0
.line 287
if-eqz v1, :cond_9
.line 288
.line 289
:try_start_8
invoke-virtual {v1}, Ljava/io/InputStream;->close()V
:try_end_8
.catchall {:try_start_8 .. :try_end_8} :catchall_2
.line 290
.line 291
.line 292
goto :goto_4
.line 293
:catchall_2
move-exception v0
.line 294
:try_start_9
invoke-virtual {v4, v0}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
.line 295
.line 296
.line 297
:cond_9
:goto_4
throw v4
:try_end_9
.catchall {:try_start_9 .. :try_end_9} :catchall_0
.line 298
:goto_5
if-eqz v2, :cond_a
.line 299
.line 300
:try_start_a
invoke-virtual {v2}, Ljava/io/InputStream;->close()V
:try_end_a
.catchall {:try_start_a .. :try_end_a} :catchall_3
.line 301
.line 302
.line 303
goto :goto_6
.line 304
:catchall_3
move-exception v0
.line 305
invoke-virtual {v1, v0}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
.line 306
.line 307
.line 308
:cond_a
:goto_6
throw v1
.line 309
:cond_b
:goto_7
const-string v2, "Location"
.line 310
.line 311
invoke-virtual {v1, v2}, Ljava/net/URLConnection;->getHeaderField(Ljava/lang/String;)Ljava/lang/String;
.line 312
.line 313
.line 314
move-result-object v1
.line 315
new-instance v2, Lcom/google/android/datatransport/cct/CctTransportBackend$HttpResponse;
.line 316
.line 317
new-instance v4, Ljava/net/URL;
.line 318
.line 319
invoke-direct {v4, v1}, Ljava/net/URL;-><init>(Ljava/lang/String;)V
.line 320
.line 321
.line 322
invoke-direct {v2, v0, v4, v12, v13}, Lcom/google/android/datatransport/cct/CctTransportBackend$HttpResponse;-><init>(ILjava/net/URL;J)V
.line 323
.line 324
.line 325
return-object v2
.line 326
:catchall_4
move-exception v0
.line 327
move-object v1, v0
.line 328
goto :goto_9
.line 329
:catchall_5
move-exception v0
.line 330
move-object v1, v0
.line 331
:try_start_b
invoke-virtual {v15}, Ljava/io/OutputStream;->close()V
:try_end_b
.catchall {:try_start_b .. :try_end_b} :catchall_6
.line 332
.line 333
.line 334
goto :goto_8
.line 335
:catchall_6
move-exception v0
.line 336
:try_start_c
invoke-virtual {v1, v0}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
.line 337
.line 338
.line 339
:goto_8
throw v1
:try_end_c
.catchall {:try_start_c .. :try_end_c} :catchall_4
.line 340
:goto_9
if-eqz v14, :cond_c
.line 341
.line 342
:try_start_d
invoke-virtual {v14}, Ljava/io/OutputStream;->close()V
:try_end_d
.catchall {:try_start_d .. :try_end_d} :catchall_7
.line 343
.line 344
.line 345
goto :goto_a
.line 346
:catchall_7
move-exception v0
.line 347
:try_start_e
invoke-virtual {v1, v0}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
.line 348
.line 349
.line 350
:cond_c
:goto_a
throw v1
:try_end_e
.catch Ljava/net/ConnectException; {:try_start_e .. :try_end_e} :catch_3
.catch Ljava/net/UnknownHostException; {:try_start_e .. :try_end_e} :catch_2
.catch Lcom/google/firebase/encoders/EncodingException; {:try_start_e .. :try_end_e} :catch_1
.catch Ljava/io/IOException; {:try_start_e .. :try_end_e} :catch_0
.line 351
:goto_b
const-string v1, "Couldn\'t encode request, returning with 400"
.line 352
.line 353
invoke-static {v2, v1, v0}, Lcom/google/android/datatransport/runtime/logging/Logging;->c(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Exception;)V
.line 354
.line 355
.line 356
new-instance v0, Lcom/google/android/datatransport/cct/CctTransportBackend$HttpResponse;
.line 357
.line 358
const/16 v1, 0x190
.line 359
.line 360
const/4 v7, 0x0
.line 361
invoke-direct {v0, v1, v7, v12, v13}, Lcom/google/android/datatransport/cct/CctTransportBackend$HttpResponse;-><init>(ILjava/net/URL;J)V
.line 362
.line 363
.line 364
goto :goto_d
.line 365
:goto_c
const-string v1, "Couldn\'t open connection, returning with 500"
.line 366
.line 367
invoke-static {v2, v1, v0}, Lcom/google/android/datatransport/runtime/logging/Logging;->c(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Exception;)V
.line 368
.line 369
.line 370
new-instance v0, Lcom/google/android/datatransport/cct/CctTransportBackend$HttpResponse;
.line 371
.line 372
const/16 v1, 0x1f4
.line 373
.line 374
invoke-direct {v0, v1, v7, v12, v13}, Lcom/google/android/datatransport/cct/CctTransportBackend$HttpResponse;-><init>(ILjava/net/URL;J)V
.line 375
.line 376
.line 377
:goto_d
return-object v0
.end method