发新帖

该处签名校验如何跳转?

[复制链接]
3651 1
5NB
该处签名校验如何跳转?

.class public Lcom/qq/e/v2/util/GDTST;
.super Ljava/lang/Object;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/qq/e/v2/util/GDTST$1;,
        Lcom/qq/e/v2/util/GDTST$Holder;
    }
.end annotation


# instance fields
.field private a:Ljava/security/PublicKey;

.field private final b:Z


# direct methods
.method private constructor <init>()V
    .locals 1

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    :try_start_0
    #p0=(Reference,Lcom/qq/e/v2/util/GDTST;);
    const-string v0, "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDKta2b5Vw5YkWHCAj4rJCwS227\r/35FZ29e4I6pS2B8zSq2RgBpXUuMg7oZF1Qt3x0iyg8PeyblyNeCRB6gIMehFThe\r1Y7m1FaQyaZp+CJYOTLM4/THKp9UndrEgJ/5a83vP1375YCV2lMvWARrNlBep4RN\rnESUJhQz58Gr/F39TwIDAQAB"

    #v0=(Reference,Ljava/lang/String;);
    invoke-static {v0}, Lcom/qq/e/v2/util/GDTST;->b(Ljava/lang/String;)Ljava/security/PublicKey;

    move-result-object v0

    iput-object v0, p0, Lcom/qq/e/v2/util/GDTST;->a:Ljava/security/PublicKey;
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    const/4 v0, 0x1

    :goto_0
    #v0=(Boolean);
    iput-boolean v0, p0, Lcom/qq/e/v2/util/GDTST;->b:Z

    return-void

    :catch_0
    #v0=(Conflicted);
    move-exception v0

    #v0=(Reference,Ljava/lang/Throwable;);
    const/4 v0, 0x0

    #v0=(Null);
    goto :goto_0
.end method

.method synthetic constructor <init>(B)V
    .locals 0

    invoke-direct {p0}, Lcom/qq/e/v2/util/GDTST;-><init>()V

    #p0=(Reference,Lcom/qq/e/v2/util/GDTST;);
    return-void
.end method

.method private a(Ljava/lang/String;)Ljava/lang/String;
    .locals 4

    iget-object v0, p0, Lcom/qq/e/v2/util/GDTST;->a:Ljava/security/PublicKey;

    #v0=(Reference,Ljava/security/PublicKey;);
    if-eqz v0, :cond_0

    const/4 v0, 0x0

    #v0=(Null);
    invoke-static {p1, v0}, Landroid/util/Base64;->decode(Ljava/lang/String;I)[B

    move-result-object v0

    :try_start_0
    #v0=(Reference,[B);
    const-string v1, "RSA/ECB/PKCS1Padding"

    #v1=(Reference,Ljava/lang/String;);
    invoke-static {v1}, Ljavax/crypto/Cipher;->getInstance(Ljava/lang/String;)Ljavax/crypto/Cipher;

    move-result-object v1

    const/4 v2, 0x2

    #v2=(PosByte);
    iget-object v3, p0, Lcom/qq/e/v2/util/GDTST;->a:Ljava/security/PublicKey;

    #v3=(Reference,Ljava/security/PublicKey;);
    invoke-virtual {v1, v2, v3}, Ljavax/crypto/Cipher;->init(ILjava/security/Key;)V

    invoke-virtual {v1, v0}, Ljavax/crypto/Cipher;->doFinal([B)[B

    move-result-object v0

    new-instance v1, Ljava/lang/String;

    #v1=(UninitRef,Ljava/lang/String;);
    const-string v2, "UTF-8"

    #v2=(Reference,Ljava/lang/String;);
    invoke-direct {v1, v0, v2}, Ljava/lang/String;-><init>([BLjava/lang/String;)V

    #v1=(Reference,Ljava/lang/String;);
    invoke-virtual {v1}, Ljava/lang/String;->trim()Ljava/lang/String;
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    :goto_0
    #v1=(Conflicted);v2=(Conflicted);v3=(Conflicted);
    return-object v0

    :catch_0
    move-exception v0

    const-string v1, "ErrorWhileVerifySigNature"

    #v1=(Reference,Ljava/lang/String;);
    invoke-static {v1, v0}, Lcom/qq/e/v2/util/GDTLogger;->e(Ljava/lang/String;Ljava/lang/Throwable;)V

    :cond_0
    #v1=(Conflicted);
    const/4 v0, 0x0

    #v0=(Null);
    goto :goto_0
.end method

.method private static b(Ljava/lang/String;)Ljava/security/PublicKey;
    .locals 3
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

    const/4 v0, 0x0

    :try_start_0
    #v0=(Null);
    invoke-static {p0, v0}, Landroid/util/Base64;->decode(Ljava/lang/String;I)[B

    move-result-object v0

    #v0=(Reference,[B);
    const-string v1, "RSA"

    #v1=(Reference,Ljava/lang/String;);
    invoke-static {v1}, Ljava/security/KeyFactory;->getInstance(Ljava/lang/String;)Ljava/security/KeyFactory;

    move-result-object v1

    new-instance v2, Ljava/security/spec/X509EncodedKeySpec;

    #v2=(UninitRef,Ljava/security/spec/X509EncodedKeySpec;);
    invoke-direct {v2, v0}, Ljava/security/spec/X509EncodedKeySpec;-><init>([B)V

    #v2=(Reference,Ljava/security/spec/X509EncodedKeySpec;);
    invoke-virtual {v1, v2}, Ljava/security/KeyFactory;->generatePublic(Ljava/security/spec/KeySpec;)Ljava/security/PublicKey;
    :try_end_0
    .catch Ljava/security/NoSuchAlgorithmException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/security/spec/InvalidKeySpecException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/lang/NullPointerException; {:try_start_0 .. :try_end_0} :catch_2

    move-result-object v0

    return-object v0

    :catch_0
    #v1=(Conflicted);v2=(Conflicted);
    move-exception v0

    new-instance v0, Ljava/lang/Exception;

    #v0=(UninitRef,Ljava/lang/Exception;);
    const-string v1, "\u65e0\u6b64\u7b97\u6cd5"

    #v1=(Reference,Ljava/lang/String;);
    invoke-direct {v0, v1}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V

    #v0=(Reference,Ljava/lang/Exception;);
    throw v0

    :catch_1
    #v1=(Conflicted);
    move-exception v0

    new-instance v0, Ljava/lang/Exception;

    #v0=(UninitRef,Ljava/lang/Exception;);
    const-string v1, "\u516c\u94a5\u975e\u6cd5"

    #v1=(Reference,Ljava/lang/String;);
    invoke-direct {v0, v1}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V

    #v0=(Reference,Ljava/lang/Exception;);
    throw v0

    :catch_2
    #v1=(Conflicted);
    move-exception v0

    new-instance v0, Ljava/lang/Exception;

    #v0=(UninitRef,Ljava/lang/Exception;);
    const-string v1, "\u516c\u94a5\u6570\u636e\u4e3a\u7a7a"

    #v1=(Reference,Ljava/lang/String;);
    invoke-direct {v0, v1}, Ljava/lang/Exception;-><init>(Ljava/lang/String;)V

    #v0=(Reference,Ljava/lang/Exception;);
    throw v0
.end method

.method public static getToolInstance()Lcom/qq/e/v2/util/GDTST;
    .locals 1

    sget-object v0, Lcom/qq/e/v2/util/GDTST$Holder;->instance:Lcom/qq/e/v2/util/GDTST;

    #v0=(Reference,Lcom/qq/e/v2/util/GDTST;);
    return-object v0
.end method


# virtual methods
.method public verify(Ljava/lang/String;Ljava/lang/String;)Z
    .locals 4

    invoke-static {p2}, Lcom/qq/e/v2/util/StringUtil;->isEmpty(Ljava/lang/String;)Z

    move-result v0

    #v0=(Boolean);
    if-eqz v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    #v1=(Conflicted);v2=(Conflicted);v3=(Conflicted);
    return v0

    :cond_0
    #v1=(Uninit);v2=(Uninit);v3=(Uninit);
    iget-boolean v0, p0, Lcom/qq/e/v2/util/GDTST;->b:Z

    if-nez v0, :cond_1

    const/4 v0, 0x1

    #v0=(One);
    goto :goto_0

    :cond_1
    #v0=(Boolean);
    invoke-direct {p0, p1}, Lcom/qq/e/v2/util/GDTST;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    #v1=(Reference,Ljava/lang/String;);
    invoke-virtual {p2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    new-instance v2, Ljava/lang/StringBuilder;

    #v2=(UninitRef,Ljava/lang/StringBuilder;);
    const-string v3, "Verify Result"

    #v3=(Reference,Ljava/lang/String;);
    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    #v2=(Reference,Ljava/lang/StringBuilder;);
    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "src="

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, " & target="

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/qq/e/v2/util/GDTLogger;->d(Ljava/lang/String;)V

    goto :goto_0
.end method

.method public verifyFile(Ljava/lang/String;Ljava/io/File;)Z
    .locals 1

    if-eqz p2, :cond_0

    invoke-virtual {p2}, Ljava/io/File;->exists()Z

    move-result v0

    #v0=(Boolean);
    if-nez v0, :cond_1

    :cond_0
    #v0=(Conflicted);
    const/4 v0, 0x0

    :goto_0
    #v0=(Boolean);
    return v0

    :cond_1
    invoke-static {p2}, Lcom/qq/e/v2/util/Md5Util;->encode(Ljava/io/File;)Ljava/lang/String;

    move-result-object v0

    #v0=(Reference,Ljava/lang/String;);
    invoke-virtual {p0, p1, v0}, Lcom/qq/e/v2/util/GDTST;->verify(Ljava/lang/String;Ljava/lang/String;)Z

    move-result v0

    #v0=(Boolean);
    goto :goto_0
.end method

.method public verifyString(Ljava/lang/String;Ljava/lang/String;)Z
    .locals 1

    invoke-static {p2}, Lcom/qq/e/v2/util/Md5Util;->encode(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    #v0=(Reference,Ljava/lang/String;);
    invoke-virtual {p0, p1, v0}, Lcom/qq/e/v2/util/GDTST;->verify(Ljava/lang/String;Ljava/lang/String;)Z

    move-result v0

    #v0=(Boolean);
    return v0
.end method


举报 使用道具

回复

精彩评论1

zzage    发表于 2015-1-30 10:52:14 | 显示全部楼层
# virtual methods
.method public verify(Ljava/lang/String;Ljava/lang/String;)Z

目测,这个verify函数开头直接!
const/4 v0, 0x1
return v0

举报 使用道具

回复
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表