180 lines
3.6 KiB
Smali
180 lines
3.6 KiB
Smali
.class public Lcom/zk/drivermonitor/utils/Rijndael;
|
|
.super Ljava/lang/Object;
|
|
.source "Rijndael.java"
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 18
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static a(Ljava/lang/String;)[B
|
|
.locals 6
|
|
|
|
.line 21
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-ge v0, v1, :cond_0
|
|
|
|
const/4 p0, 0x0
|
|
|
|
return-object p0
|
|
|
|
.line 23
|
|
:cond_0
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v0
|
|
|
|
div-int/lit8 v0, v0, 0x2
|
|
|
|
new-array v0, v0, [B
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 24
|
|
:goto_0
|
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v2
|
|
|
|
div-int/lit8 v2, v2, 0x2
|
|
|
|
if-lt v1, v2, :cond_1
|
|
|
|
return-object v0
|
|
|
|
:cond_1
|
|
mul-int/lit8 v2, v1, 0x2
|
|
|
|
add-int/lit8 v3, v2, 0x1
|
|
|
|
.line 25
|
|
invoke-virtual {p0, v2, v3}, Ljava/lang/String;->substring(II)Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
const/16 v5, 0x10
|
|
|
|
invoke-static {v4, v5}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;I)I
|
|
|
|
move-result v4
|
|
|
|
add-int/lit8 v2, v2, 0x2
|
|
|
|
.line 26
|
|
invoke-virtual {p0, v3, v2}, Ljava/lang/String;->substring(II)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-static {v2, v5}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;I)I
|
|
|
|
move-result v2
|
|
|
|
mul-int/lit8 v4, v4, 0x10
|
|
|
|
add-int/2addr v4, v2
|
|
|
|
int-to-byte v2, v4
|
|
|
|
.line 28
|
|
aput-byte v2, v0, v1
|
|
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
.end method
|
|
|
|
.method public static a([BLjava/lang/String;)[B
|
|
.locals 2
|
|
|
|
.line 35
|
|
:try_start_0
|
|
new-instance v0, Ljavax/crypto/spec/SecretKeySpec;
|
|
|
|
invoke-virtual {p1}, Ljava/lang/String;->getBytes()[B
|
|
|
|
move-result-object p1
|
|
|
|
const-string v1, "AES"
|
|
|
|
invoke-direct {v0, p1, v1}, Ljavax/crypto/spec/SecretKeySpec;-><init>([BLjava/lang/String;)V
|
|
|
|
const-string p1, "AES"
|
|
|
|
.line 36
|
|
invoke-static {p1}, Ljavax/crypto/Cipher;->getInstance(Ljava/lang/String;)Ljavax/crypto/Cipher;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 v1, 0x2
|
|
|
|
.line 37
|
|
invoke-virtual {p1, v1, v0}, Ljavax/crypto/Cipher;->init(ILjava/security/Key;)V
|
|
|
|
.line 38
|
|
invoke-virtual {p1, p0}, Ljavax/crypto/Cipher;->doFinal([B)[B
|
|
|
|
move-result-object p0
|
|
:try_end_0
|
|
.catch Ljava/security/NoSuchAlgorithmException; {:try_start_0 .. :try_end_0} :catch_4
|
|
.catch Ljavax/crypto/NoSuchPaddingException; {:try_start_0 .. :try_end_0} :catch_3
|
|
.catch Ljava/security/InvalidKeyException; {:try_start_0 .. :try_end_0} :catch_2
|
|
.catch Ljavax/crypto/IllegalBlockSizeException; {:try_start_0 .. :try_end_0} :catch_1
|
|
.catch Ljavax/crypto/BadPaddingException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object p0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
.line 49
|
|
invoke-virtual {p0}, Ljavax/crypto/BadPaddingException;->printStackTrace()V
|
|
|
|
goto :goto_0
|
|
|
|
:catch_1
|
|
move-exception p0
|
|
|
|
.line 47
|
|
invoke-virtual {p0}, Ljavax/crypto/IllegalBlockSizeException;->printStackTrace()V
|
|
|
|
goto :goto_0
|
|
|
|
:catch_2
|
|
move-exception p0
|
|
|
|
.line 45
|
|
invoke-virtual {p0}, Ljava/security/InvalidKeyException;->printStackTrace()V
|
|
|
|
goto :goto_0
|
|
|
|
:catch_3
|
|
move-exception p0
|
|
|
|
.line 43
|
|
invoke-virtual {p0}, Ljavax/crypto/NoSuchPaddingException;->printStackTrace()V
|
|
|
|
goto :goto_0
|
|
|
|
:catch_4
|
|
move-exception p0
|
|
|
|
.line 41
|
|
invoke-virtual {p0}, Ljava/security/NoSuchAlgorithmException;->printStackTrace()V
|
|
|
|
:goto_0
|
|
const/4 p0, 0x0
|
|
|
|
return-object p0
|
|
.end method
|