- Imported from https://github.com/supermegamestre/Project-Real-Resurrection-3 - APKTool decompilation (Smali bytecode) for modding and rebuilding APK - Supports both 32-bit (armeabi-v7a) and 64-bit (arm64-v8a) architectures - Includes full Smali source, resources, and native libraries - Ready to rebuild APK after modifications with apktool b command - Added comprehensive README-apktool.md with modding guide This branch complements the JADX branches: - Use JADX (main/discord-community) to UNDERSTAND code (readable Java) - Use APKTool (this branch) to MODIFY and REBUILD APK (editable Smali) Total: 44,417 files, 538.51 MB Smali source code
242 lines
5.9 KiB
Smali
242 lines
5.9 KiB
Smali
.class public Lcom/firemonkeys/cloudcellapi/util/Security;
|
|
.super Ljava/lang/Object;
|
|
.source "SourceFile"
|
|
|
|
|
|
# static fields
|
|
.field private static final KEY_FACTORY_ALGORITHM:Ljava/lang/String; = "RSA"
|
|
|
|
.field private static final SIGNATURE_ALGORITHM:Ljava/lang/String; = "SHA1withRSA"
|
|
|
|
.field private static final TAG:Ljava/lang/String; = "IABUtil/Security"
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 44
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static generatePublicKey(Ljava/lang/String;)Ljava/security/PublicKey;
|
|
.locals 3
|
|
|
|
const-string v0, "IABUtil/Security"
|
|
|
|
.line 86
|
|
:try_start_0
|
|
invoke-static {p0}, Lcom/firemonkeys/cloudcellapi/util/Base64;->decode(Ljava/lang/String;)[B
|
|
|
|
move-result-object p0
|
|
|
|
const-string v1, "RSA"
|
|
|
|
.line 87
|
|
invoke-static {v1}, Ljava/security/KeyFactory;->getInstance(Ljava/lang/String;)Ljava/security/KeyFactory;
|
|
|
|
move-result-object v1
|
|
|
|
.line 88
|
|
new-instance v2, Ljava/security/spec/X509EncodedKeySpec;
|
|
|
|
invoke-direct {v2, p0}, Ljava/security/spec/X509EncodedKeySpec;-><init>([B)V
|
|
|
|
invoke-virtual {v1, v2}, Ljava/security/KeyFactory;->generatePublic(Ljava/security/spec/KeySpec;)Ljava/security/PublicKey;
|
|
|
|
move-result-object p0
|
|
:try_end_0
|
|
.catch Ljava/security/NoSuchAlgorithmException; {:try_start_0 .. :try_end_0} :catch_2
|
|
.catch Ljava/security/spec/InvalidKeySpecException; {:try_start_0 .. :try_end_0} :catch_1
|
|
.catch Lcom/firemonkeys/cloudcellapi/util/Base64DecoderException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object p0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_1
|
|
move-exception p0
|
|
|
|
goto :goto_1
|
|
|
|
:catch_2
|
|
move-exception p0
|
|
|
|
goto :goto_2
|
|
|
|
:goto_0
|
|
const-string v1, "Base64 decoding failed."
|
|
|
|
.line 95
|
|
invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
.line 96
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-direct {v0, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/Throwable;)V
|
|
|
|
throw v0
|
|
|
|
:goto_1
|
|
const-string v1, "Invalid key specification."
|
|
|
|
.line 92
|
|
invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
.line 93
|
|
new-instance v0, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-direct {v0, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/Throwable;)V
|
|
|
|
throw v0
|
|
|
|
.line 90
|
|
:goto_2
|
|
new-instance v0, Ljava/lang/RuntimeException;
|
|
|
|
invoke-direct {v0, p0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/Throwable;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static verify(Ljava/security/PublicKey;Ljava/lang/String;Ljava/lang/String;)Z
|
|
.locals 3
|
|
|
|
const-string v0, "IABUtil/Security"
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:try_start_0
|
|
const-string v2, "SHA1withRSA"
|
|
|
|
.line 112
|
|
invoke-static {v2}, Ljava/security/Signature;->getInstance(Ljava/lang/String;)Ljava/security/Signature;
|
|
|
|
move-result-object v2
|
|
|
|
.line 113
|
|
invoke-virtual {v2, p0}, Ljava/security/Signature;->initVerify(Ljava/security/PublicKey;)V
|
|
|
|
.line 114
|
|
invoke-virtual {p1}, Ljava/lang/String;->getBytes()[B
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v2, p0}, Ljava/security/Signature;->update([B)V
|
|
|
|
.line 115
|
|
invoke-static {p2}, Lcom/firemonkeys/cloudcellapi/util/Base64;->decode(Ljava/lang/String;)[B
|
|
|
|
move-result-object p0
|
|
|
|
invoke-virtual {v2, p0}, Ljava/security/Signature;->verify([B)Z
|
|
|
|
move-result p0
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
const-string p0, "Signature verification failed."
|
|
|
|
.line 116
|
|
invoke-static {v0, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
:try_end_0
|
|
.catch Ljava/security/NoSuchAlgorithmException; {:try_start_0 .. :try_end_0} :catch_3
|
|
.catch Ljava/security/InvalidKeyException; {:try_start_0 .. :try_end_0} :catch_2
|
|
.catch Ljava/security/SignatureException; {:try_start_0 .. :try_end_0} :catch_1
|
|
.catch Lcom/firemonkeys/cloudcellapi/util/Base64DecoderException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return v1
|
|
|
|
:cond_0
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
|
|
:catch_0
|
|
const-string p0, "Base64 decoding failed."
|
|
|
|
.line 127
|
|
invoke-static {v0, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
goto :goto_0
|
|
|
|
:catch_1
|
|
const-string p0, "Signature exception."
|
|
|
|
.line 125
|
|
invoke-static {v0, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
goto :goto_0
|
|
|
|
:catch_2
|
|
const-string p0, "Invalid key specification."
|
|
|
|
.line 123
|
|
invoke-static {v0, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
goto :goto_0
|
|
|
|
:catch_3
|
|
const-string p0, "NoSuchAlgorithmException."
|
|
|
|
.line 121
|
|
invoke-static {v0, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
:goto_0
|
|
return v1
|
|
.end method
|
|
|
|
.method public static verifyPurchase(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z
|
|
.locals 3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const-string v1, "IABUtil/Security"
|
|
|
|
if-nez p1, :cond_0
|
|
|
|
const-string p0, "data is null"
|
|
|
|
.line 61
|
|
invoke-static {v1, p0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
return v0
|
|
|
|
.line 66
|
|
:cond_0
|
|
invoke-static {p2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_1
|
|
|
|
.line 67
|
|
invoke-static {p0}, Lcom/firemonkeys/cloudcellapi/util/Security;->generatePublicKey(Ljava/lang/String;)Ljava/security/PublicKey;
|
|
|
|
move-result-object p0
|
|
|
|
.line 68
|
|
invoke-static {p0, p1, p2}, Lcom/firemonkeys/cloudcellapi/util/Security;->verify(Ljava/security/PublicKey;Ljava/lang/String;Ljava/lang/String;)Z
|
|
|
|
move-result p0
|
|
|
|
if-nez p0, :cond_1
|
|
|
|
const-string p0, "signature does not match data."
|
|
|
|
.line 70
|
|
invoke-static {v1, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
return v0
|
|
|
|
:cond_1
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
.end method
|