* 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>
807 lines
17 KiB
Smali
807 lines
17 KiB
Smali
.class public final Lcom/google/api/client/util/SecurityUtils;
|
|
.super Ljava/lang/Object;
|
|
.source "SourceFile"
|
|
|
|
|
|
# direct methods
|
|
.method private constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
.line 2
|
|
.line 3
|
|
.line 4
|
|
return-void
|
|
.end method
|
|
|
|
.method public static createMtlsKeyStore(Ljava/io/InputStream;)Ljava/security/KeyStore;
|
|
.locals 6
|
|
.annotation build Lcom/google/api/client/util/Beta;
|
|
.end annotation
|
|
|
|
.line 1
|
|
const-string v0, "JKS"
|
|
|
|
.line 2
|
|
.line 3
|
|
invoke-static {v0}, Ljava/security/KeyStore;->getInstance(Ljava/lang/String;)Ljava/security/KeyStore;
|
|
|
|
.line 4
|
|
.line 5
|
|
.line 6
|
|
move-result-object v0
|
|
|
|
.line 7
|
|
const/4 v1, 0x0
|
|
|
|
.line 8
|
|
invoke-virtual {v0, v1}, Ljava/security/KeyStore;->load(Ljava/security/KeyStore$LoadStoreParameter;)V
|
|
|
|
.line 9
|
|
.line 10
|
|
.line 11
|
|
new-instance v2, Lcom/google/api/client/util/PemReader;
|
|
|
|
.line 12
|
|
.line 13
|
|
new-instance v3, Ljava/io/InputStreamReader;
|
|
|
|
.line 14
|
|
.line 15
|
|
invoke-direct {v3, p0}, Ljava/io/InputStreamReader;-><init>(Ljava/io/InputStream;)V
|
|
|
|
.line 16
|
|
.line 17
|
|
.line 18
|
|
invoke-direct {v2, v3}, Lcom/google/api/client/util/PemReader;-><init>(Ljava/io/Reader;)V
|
|
|
|
.line 19
|
|
.line 20
|
|
.line 21
|
|
move-object p0, v1
|
|
|
|
.line 22
|
|
:cond_0
|
|
:goto_0
|
|
if-eqz v1, :cond_1
|
|
|
|
.line 23
|
|
.line 24
|
|
if-nez p0, :cond_2
|
|
|
|
.line 25
|
|
.line 26
|
|
:cond_1
|
|
invoke-virtual {v2}, Lcom/google/api/client/util/PemReader;->readNextSection()Lcom/google/api/client/util/PemReader$Section;
|
|
|
|
.line 27
|
|
.line 28
|
|
.line 29
|
|
move-result-object v3
|
|
|
|
.line 30
|
|
if-nez v3, :cond_5
|
|
|
|
.line 31
|
|
.line 32
|
|
:cond_2
|
|
if-eqz v1, :cond_4
|
|
|
|
.line 33
|
|
.line 34
|
|
if-eqz p0, :cond_3
|
|
|
|
.line 35
|
|
.line 36
|
|
const-string v2, "X.509"
|
|
|
|
.line 37
|
|
.line 38
|
|
invoke-static {v2}, Ljava/security/cert/CertificateFactory;->getInstance(Ljava/lang/String;)Ljava/security/cert/CertificateFactory;
|
|
|
|
.line 39
|
|
.line 40
|
|
.line 41
|
|
move-result-object v2
|
|
|
|
.line 42
|
|
new-instance v3, Ljava/io/ByteArrayInputStream;
|
|
|
|
.line 43
|
|
.line 44
|
|
invoke-virtual {v1}, Lcom/google/api/client/util/PemReader$Section;->getBase64DecodedBytes()[B
|
|
|
|
.line 45
|
|
.line 46
|
|
.line 47
|
|
move-result-object v1
|
|
|
|
.line 48
|
|
invoke-direct {v3, v1}, Ljava/io/ByteArrayInputStream;-><init>([B)V
|
|
|
|
.line 49
|
|
.line 50
|
|
.line 51
|
|
invoke-virtual {v2, v3}, Ljava/security/cert/CertificateFactory;->generateCertificate(Ljava/io/InputStream;)Ljava/security/cert/Certificate;
|
|
|
|
.line 52
|
|
.line 53
|
|
.line 54
|
|
move-result-object v1
|
|
|
|
.line 55
|
|
check-cast v1, Ljava/security/cert/X509Certificate;
|
|
|
|
.line 56
|
|
.line 57
|
|
new-instance v2, Ljava/security/spec/PKCS8EncodedKeySpec;
|
|
|
|
.line 58
|
|
.line 59
|
|
invoke-virtual {p0}, Lcom/google/api/client/util/PemReader$Section;->getBase64DecodedBytes()[B
|
|
|
|
.line 60
|
|
.line 61
|
|
.line 62
|
|
move-result-object p0
|
|
|
|
.line 63
|
|
invoke-direct {v2, p0}, Ljava/security/spec/PKCS8EncodedKeySpec;-><init>([B)V
|
|
|
|
.line 64
|
|
.line 65
|
|
.line 66
|
|
invoke-virtual {v1}, Ljava/security/cert/Certificate;->getPublicKey()Ljava/security/PublicKey;
|
|
|
|
.line 67
|
|
.line 68
|
|
.line 69
|
|
move-result-object p0
|
|
|
|
.line 70
|
|
invoke-interface {p0}, Ljava/security/Key;->getAlgorithm()Ljava/lang/String;
|
|
|
|
.line 71
|
|
.line 72
|
|
.line 73
|
|
move-result-object p0
|
|
|
|
.line 74
|
|
invoke-static {p0}, Ljava/security/KeyFactory;->getInstance(Ljava/lang/String;)Ljava/security/KeyFactory;
|
|
|
|
.line 75
|
|
.line 76
|
|
.line 77
|
|
move-result-object p0
|
|
|
|
.line 78
|
|
invoke-virtual {p0, v2}, Ljava/security/KeyFactory;->generatePrivate(Ljava/security/spec/KeySpec;)Ljava/security/PrivateKey;
|
|
|
|
.line 79
|
|
.line 80
|
|
.line 81
|
|
move-result-object p0
|
|
|
|
.line 82
|
|
const/4 v2, 0x0
|
|
|
|
.line 83
|
|
new-array v3, v2, [C
|
|
|
|
.line 84
|
|
.line 85
|
|
const/4 v4, 0x1
|
|
|
|
.line 86
|
|
new-array v4, v4, [Ljava/security/cert/X509Certificate;
|
|
|
|
.line 87
|
|
.line 88
|
|
aput-object v1, v4, v2
|
|
|
|
.line 89
|
|
.line 90
|
|
const-string v1, "alias"
|
|
|
|
.line 91
|
|
.line 92
|
|
invoke-virtual {v0, v1, p0, v3, v4}, Ljava/security/KeyStore;->setKeyEntry(Ljava/lang/String;Ljava/security/Key;[C[Ljava/security/cert/Certificate;)V
|
|
|
|
.line 93
|
|
.line 94
|
|
.line 95
|
|
return-object v0
|
|
|
|
.line 96
|
|
:cond_3
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
.line 97
|
|
.line 98
|
|
const-string v0, "private key is missing from certAndKey string"
|
|
|
|
.line 99
|
|
.line 100
|
|
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
.line 101
|
|
.line 102
|
|
.line 103
|
|
throw p0
|
|
|
|
.line 104
|
|
:cond_4
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
.line 105
|
|
.line 106
|
|
const-string v0, "certificate is missing from certAndKey string"
|
|
|
|
.line 107
|
|
.line 108
|
|
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
.line 109
|
|
.line 110
|
|
.line 111
|
|
throw p0
|
|
|
|
.line 112
|
|
:cond_5
|
|
if-nez v1, :cond_6
|
|
|
|
.line 113
|
|
.line 114
|
|
const-string v4, "CERTIFICATE"
|
|
|
|
.line 115
|
|
.line 116
|
|
invoke-virtual {v3}, Lcom/google/api/client/util/PemReader$Section;->getTitle()Ljava/lang/String;
|
|
|
|
.line 117
|
|
.line 118
|
|
.line 119
|
|
move-result-object v5
|
|
|
|
.line 120
|
|
invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
.line 121
|
|
.line 122
|
|
.line 123
|
|
move-result v4
|
|
|
|
.line 124
|
|
if-eqz v4, :cond_6
|
|
|
|
.line 125
|
|
.line 126
|
|
move-object v1, v3
|
|
|
|
.line 127
|
|
goto :goto_0
|
|
|
|
.line 128
|
|
:cond_6
|
|
const-string v4, "PRIVATE KEY"
|
|
|
|
.line 129
|
|
.line 130
|
|
invoke-virtual {v3}, Lcom/google/api/client/util/PemReader$Section;->getTitle()Ljava/lang/String;
|
|
|
|
.line 131
|
|
.line 132
|
|
.line 133
|
|
move-result-object v5
|
|
|
|
.line 134
|
|
invoke-virtual {v4, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
.line 135
|
|
.line 136
|
|
.line 137
|
|
move-result v4
|
|
|
|
.line 138
|
|
if-eqz v4, :cond_0
|
|
|
|
.line 139
|
|
.line 140
|
|
move-object p0, v3
|
|
|
|
.line 141
|
|
goto :goto_0
|
|
.end method
|
|
|
|
.method public static getDefaultKeyStore()Ljava/security/KeyStore;
|
|
.locals 1
|
|
|
|
.line 1
|
|
invoke-static {}, Ljava/security/KeyStore;->getDefaultType()Ljava/lang/String;
|
|
|
|
.line 2
|
|
.line 3
|
|
.line 4
|
|
move-result-object v0
|
|
|
|
.line 5
|
|
invoke-static {v0}, Ljava/security/KeyStore;->getInstance(Ljava/lang/String;)Ljava/security/KeyStore;
|
|
|
|
.line 6
|
|
.line 7
|
|
.line 8
|
|
move-result-object v0
|
|
|
|
.line 9
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static getEs256SignatureAlgorithm()Ljava/security/Signature;
|
|
.locals 1
|
|
|
|
.line 1
|
|
const-string v0, "SHA256withECDSA"
|
|
|
|
.line 2
|
|
.line 3
|
|
invoke-static {v0}, Ljava/security/Signature;->getInstance(Ljava/lang/String;)Ljava/security/Signature;
|
|
|
|
.line 4
|
|
.line 5
|
|
.line 6
|
|
move-result-object v0
|
|
|
|
.line 7
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static getJavaKeyStore()Ljava/security/KeyStore;
|
|
.locals 1
|
|
|
|
.line 1
|
|
const-string v0, "JKS"
|
|
|
|
.line 2
|
|
.line 3
|
|
invoke-static {v0}, Ljava/security/KeyStore;->getInstance(Ljava/lang/String;)Ljava/security/KeyStore;
|
|
|
|
.line 4
|
|
.line 5
|
|
.line 6
|
|
move-result-object v0
|
|
|
|
.line 7
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static getPkcs12KeyStore()Ljava/security/KeyStore;
|
|
.locals 1
|
|
|
|
.line 1
|
|
const-string v0, "PKCS12"
|
|
|
|
.line 2
|
|
.line 3
|
|
invoke-static {v0}, Ljava/security/KeyStore;->getInstance(Ljava/lang/String;)Ljava/security/KeyStore;
|
|
|
|
.line 4
|
|
.line 5
|
|
.line 6
|
|
move-result-object v0
|
|
|
|
.line 7
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static getPrivateKey(Ljava/security/KeyStore;Ljava/lang/String;Ljava/lang/String;)Ljava/security/PrivateKey;
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-virtual {p2}, Ljava/lang/String;->toCharArray()[C
|
|
|
|
.line 2
|
|
.line 3
|
|
.line 4
|
|
move-result-object p2
|
|
|
|
.line 5
|
|
invoke-virtual {p0, p1, p2}, Ljava/security/KeyStore;->getKey(Ljava/lang/String;[C)Ljava/security/Key;
|
|
|
|
.line 6
|
|
.line 7
|
|
.line 8
|
|
move-result-object p0
|
|
|
|
.line 9
|
|
check-cast p0, Ljava/security/PrivateKey;
|
|
|
|
.line 10
|
|
.line 11
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static getRsaKeyFactory()Ljava/security/KeyFactory;
|
|
.locals 1
|
|
|
|
.line 1
|
|
const-string v0, "RSA"
|
|
|
|
.line 2
|
|
.line 3
|
|
invoke-static {v0}, Ljava/security/KeyFactory;->getInstance(Ljava/lang/String;)Ljava/security/KeyFactory;
|
|
|
|
.line 4
|
|
.line 5
|
|
.line 6
|
|
move-result-object v0
|
|
|
|
.line 7
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static getSha1WithRsaSignatureAlgorithm()Ljava/security/Signature;
|
|
.locals 1
|
|
|
|
.line 1
|
|
const-string v0, "SHA1withRSA"
|
|
|
|
.line 2
|
|
.line 3
|
|
invoke-static {v0}, Ljava/security/Signature;->getInstance(Ljava/lang/String;)Ljava/security/Signature;
|
|
|
|
.line 4
|
|
.line 5
|
|
.line 6
|
|
move-result-object v0
|
|
|
|
.line 7
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static getSha256WithRsaSignatureAlgorithm()Ljava/security/Signature;
|
|
.locals 1
|
|
|
|
.line 1
|
|
const-string v0, "SHA256withRSA"
|
|
|
|
.line 2
|
|
.line 3
|
|
invoke-static {v0}, Ljava/security/Signature;->getInstance(Ljava/lang/String;)Ljava/security/Signature;
|
|
|
|
.line 4
|
|
.line 5
|
|
.line 6
|
|
move-result-object v0
|
|
|
|
.line 7
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static getX509CertificateFactory()Ljava/security/cert/CertificateFactory;
|
|
.locals 1
|
|
|
|
.line 1
|
|
const-string v0, "X.509"
|
|
|
|
.line 2
|
|
.line 3
|
|
invoke-static {v0}, Ljava/security/cert/CertificateFactory;->getInstance(Ljava/lang/String;)Ljava/security/cert/CertificateFactory;
|
|
|
|
.line 4
|
|
.line 5
|
|
.line 6
|
|
move-result-object v0
|
|
|
|
.line 7
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static loadKeyStore(Ljava/security/KeyStore;Ljava/io/InputStream;Ljava/lang/String;)V
|
|
.locals 0
|
|
|
|
.line 1
|
|
:try_start_0
|
|
invoke-virtual {p2}, Ljava/lang/String;->toCharArray()[C
|
|
|
|
.line 2
|
|
.line 3
|
|
.line 4
|
|
move-result-object p2
|
|
|
|
.line 5
|
|
invoke-virtual {p0, p1, p2}, Ljava/security/KeyStore;->load(Ljava/io/InputStream;[C)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 6
|
|
.line 7
|
|
.line 8
|
|
invoke-virtual {p1}, Ljava/io/InputStream;->close()V
|
|
|
|
.line 9
|
|
.line 10
|
|
.line 11
|
|
return-void
|
|
|
|
.line 12
|
|
:catchall_0
|
|
move-exception p0
|
|
|
|
.line 13
|
|
invoke-virtual {p1}, Ljava/io/InputStream;->close()V
|
|
|
|
.line 14
|
|
.line 15
|
|
.line 16
|
|
throw p0
|
|
.end method
|
|
|
|
.method public static loadKeyStoreFromCertificates(Ljava/security/KeyStore;Ljava/security/cert/CertificateFactory;Ljava/io/InputStream;)V
|
|
.locals 2
|
|
|
|
.line 1
|
|
invoke-virtual {p1, p2}, Ljava/security/cert/CertificateFactory;->generateCertificates(Ljava/io/InputStream;)Ljava/util/Collection;
|
|
|
|
.line 2
|
|
.line 3
|
|
.line 4
|
|
move-result-object p1
|
|
|
|
.line 5
|
|
invoke-interface {p1}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;
|
|
|
|
.line 6
|
|
.line 7
|
|
.line 8
|
|
move-result-object p1
|
|
|
|
.line 9
|
|
const/4 p2, 0x0
|
|
|
|
.line 10
|
|
:goto_0
|
|
invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
.line 11
|
|
.line 12
|
|
.line 13
|
|
move-result v0
|
|
|
|
.line 14
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 15
|
|
.line 16
|
|
invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
.line 17
|
|
.line 18
|
|
.line 19
|
|
move-result-object v0
|
|
|
|
.line 20
|
|
check-cast v0, Ljava/security/cert/Certificate;
|
|
|
|
.line 21
|
|
.line 22
|
|
invoke-static {p2}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
|
|
|
|
.line 23
|
|
.line 24
|
|
.line 25
|
|
move-result-object v1
|
|
|
|
.line 26
|
|
invoke-virtual {p0, v1, v0}, Ljava/security/KeyStore;->setCertificateEntry(Ljava/lang/String;Ljava/security/cert/Certificate;)V
|
|
|
|
.line 27
|
|
.line 28
|
|
.line 29
|
|
add-int/lit8 p2, p2, 0x1
|
|
|
|
.line 30
|
|
.line 31
|
|
goto :goto_0
|
|
|
|
.line 32
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static loadPrivateKeyFromKeyStore(Ljava/security/KeyStore;Ljava/io/InputStream;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/security/PrivateKey;
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-static {p0, p1, p2}, Lcom/google/api/client/util/SecurityUtils;->loadKeyStore(Ljava/security/KeyStore;Ljava/io/InputStream;Ljava/lang/String;)V
|
|
|
|
.line 2
|
|
.line 3
|
|
.line 4
|
|
invoke-static {p0, p3, p4}, Lcom/google/api/client/util/SecurityUtils;->getPrivateKey(Ljava/security/KeyStore;Ljava/lang/String;Ljava/lang/String;)Ljava/security/PrivateKey;
|
|
|
|
.line 5
|
|
.line 6
|
|
.line 7
|
|
move-result-object p0
|
|
|
|
.line 8
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static sign(Ljava/security/Signature;Ljava/security/PrivateKey;[B)[B
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-virtual {p0, p1}, Ljava/security/Signature;->initSign(Ljava/security/PrivateKey;)V
|
|
|
|
.line 2
|
|
.line 3
|
|
.line 4
|
|
invoke-virtual {p0, p2}, Ljava/security/Signature;->update([B)V
|
|
|
|
.line 5
|
|
.line 6
|
|
.line 7
|
|
invoke-virtual {p0}, Ljava/security/Signature;->sign()[B
|
|
|
|
.line 8
|
|
.line 9
|
|
.line 10
|
|
move-result-object p0
|
|
|
|
.line 11
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static verify(Ljava/security/Signature;Ljavax/net/ssl/X509TrustManager;Ljava/util/List;[B[B)Ljava/security/cert/X509Certificate;
|
|
.locals 7
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/security/Signature;",
|
|
"Ljavax/net/ssl/X509TrustManager;",
|
|
"Ljava/util/List<",
|
|
"Ljava/lang/String;",
|
|
">;[B[B)",
|
|
"Ljava/security/cert/X509Certificate;"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
.line 4
|
|
:try_start_0
|
|
invoke-static {}, Lcom/google/api/client/util/SecurityUtils;->getX509CertificateFactory()Ljava/security/cert/CertificateFactory;
|
|
|
|
move-result-object v1
|
|
:try_end_0
|
|
.catch Ljava/security/cert/CertificateException; {:try_start_0 .. :try_end_0} :catch_1
|
|
|
|
.line 5
|
|
invoke-interface {p2}, Ljava/util/List;->size()I
|
|
|
|
move-result v2
|
|
|
|
new-array v2, v2, [Ljava/security/cert/X509Certificate;
|
|
|
|
.line 6
|
|
invoke-interface {p2}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p2
|
|
|
|
const/4 v3, 0x0
|
|
|
|
move v4, v3
|
|
|
|
:goto_0
|
|
invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_1
|
|
|
|
invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v5
|
|
|
|
check-cast v5, Ljava/lang/String;
|
|
|
|
.line 7
|
|
invoke-static {v5}, Lcom/google/api/client/util/Base64;->decodeBase64(Ljava/lang/String;)[B
|
|
|
|
move-result-object v5
|
|
|
|
.line 8
|
|
new-instance v6, Ljava/io/ByteArrayInputStream;
|
|
|
|
invoke-direct {v6, v5}, Ljava/io/ByteArrayInputStream;-><init>([B)V
|
|
|
|
.line 9
|
|
:try_start_1
|
|
invoke-virtual {v1, v6}, Ljava/security/cert/CertificateFactory;->generateCertificate(Ljava/io/InputStream;)Ljava/security/cert/Certificate;
|
|
|
|
move-result-object v5
|
|
|
|
.line 10
|
|
instance-of v6, v5, Ljava/security/cert/X509Certificate;
|
|
|
|
if-nez v6, :cond_0
|
|
|
|
return-object v0
|
|
|
|
:cond_0
|
|
add-int/lit8 v6, v4, 0x1
|
|
|
|
.line 11
|
|
check-cast v5, Ljava/security/cert/X509Certificate;
|
|
|
|
aput-object v5, v2, v4
|
|
:try_end_1
|
|
.catch Ljava/security/cert/CertificateException; {:try_start_1 .. :try_end_1} :catch_0
|
|
|
|
move v4, v6
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
return-object v0
|
|
|
|
.line 12
|
|
:cond_1
|
|
:try_start_2
|
|
const-string p2, "RSA"
|
|
|
|
invoke-interface {p1, v2, p2}, Ljavax/net/ssl/X509TrustManager;->checkServerTrusted([Ljava/security/cert/X509Certificate;Ljava/lang/String;)V
|
|
:try_end_2
|
|
.catch Ljava/security/cert/CertificateException; {:try_start_2 .. :try_end_2} :catch_1
|
|
|
|
.line 13
|
|
aget-object p1, v2, v3
|
|
|
|
invoke-virtual {p1}, Ljava/security/cert/Certificate;->getPublicKey()Ljava/security/PublicKey;
|
|
|
|
move-result-object p1
|
|
|
|
.line 14
|
|
invoke-static {p0, p1, p3, p4}, Lcom/google/api/client/util/SecurityUtils;->verify(Ljava/security/Signature;Ljava/security/PublicKey;[B[B)Z
|
|
|
|
move-result p0
|
|
|
|
if-eqz p0, :cond_2
|
|
|
|
.line 15
|
|
aget-object p0, v2, v3
|
|
|
|
return-object p0
|
|
|
|
:catch_1
|
|
:cond_2
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static verify(Ljava/security/Signature;Ljava/security/PublicKey;[B[B)Z
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-virtual {p0, p1}, Ljava/security/Signature;->initVerify(Ljava/security/PublicKey;)V
|
|
|
|
.line 2
|
|
invoke-virtual {p0, p3}, Ljava/security/Signature;->update([B)V
|
|
|
|
.line 3
|
|
:try_start_0
|
|
invoke-virtual {p0, p2}, Ljava/security/Signature;->verify([B)Z
|
|
|
|
move-result p0
|
|
:try_end_0
|
|
.catch Ljava/security/SignatureException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return p0
|
|
|
|
:catch_0
|
|
const/4 p0, 0x0
|
|
|
|
return p0
|
|
.end method
|