[Asm] 纯文本查看 复制代码
# virtual methods
.method public onClick(Landroid/view/View;)V
.locals 10
.param p1, "v" # Landroid/view/View;
.prologue
const/4 v9, 0x0
const-string v8, ""
.line 53
check-cast p1, Landroid/widget/Button;
.end local p1 # "v":Landroid/view/View;
iget-object v6, p0, Lcom/mstar/test/LisenceCheck$1;->this$0:Lcom/mstar/test/LisenceCheck;
iget-object v6, v6, Lcom/mstar/test/LisenceCheck;->mbutton:Landroid/widget/Button;
if-ne p1, v6, :cond_5
.line 55
new-instance v4, Ljava/lang/String;
const-string v6, ""
invoke-direct {v4, v8}, Ljava/lang/String;-><init>(Ljava/lang/String;)V
.line 56
.local v4, "s1":Ljava/lang/String;
iget-object v6, p0, Lcom/mstar/test/LisenceCheck$1;->this$0:Lcom/mstar/test/LisenceCheck;
iget-object v6, v6, Lcom/mstar/test/LisenceCheck;->meditun:Landroid/widget/EditText;
invoke-virtual {v6}, Landroid/widget/EditText;->getText()Landroid/text/Editable;
move-result-object v6
invoke-interface {v6}, Landroid/text/Editable;->toString()Ljava/lang/String;
move-result-object v4
#上面的代码是接收输入的用户名的值
.line 57
new-instance v5, Ljava/lang/String;
const-string v6, ""
invoke-direct {v5, v8}, Ljava/lang/String;-><init>(Ljava/lang/String;)V
.line 58
.local v5, "s2":Ljava/lang/String;
iget-object v6, p0, Lcom/mstar/test/LisenceCheck$1;->this$0:Lcom/mstar/test/LisenceCheck;
iget-object v6, v6, Lcom/mstar/test/LisenceCheck;->meditsn:Landroid/widget/EditText;
invoke-virtual {v6}, Landroid/widget/EditText;->getText()Landroid/text/Editable;
move-result-object v6
invoke-interface {v6}, Landroid/text/Editable;->toString()Ljava/lang/String;
move-result-object v5
#上面的代码是接收输入的序列号的值
.line 60
const/4 v1, 0x0
.local v1, "i":I
const/4 v2, 0x0
.line 62
.local v2, "k1":I
const/4 v1, 0x0 #这里定义v1为0
:goto_0
invoke-virtual {v4}, Ljava/lang/String;->length()I
move-result v6 #读取输入用户名的值(即v4的值)的长度,给到v6
if-lt v1, v6, :cond_1 #如果v1小于v6,则跳转cond_1
.line 69
:cond_0
xor-int/lit16 v2, v2, 0x5678 #v2与0x5678进行异或运算,然后将结果给到v2
.line 72
const/4 v3, 0x0
.line 73
.local v3, "k2":I
const/4 v1, 0x0 #又重新给v1赋值为0
:goto_1
invoke-virtual {v5}, Ljava/lang/String;->length()I
move-result v6 #去输入序列号的长度,给到v6
if-lt v1, v6, :cond_3 #若v1小于v6,则跳转
.line 78
xor-int/lit16 v3, v3, 0x1234
.line 80
if-ne v2, v3, :cond_4
.line 81
iget-object v6, p0, Lcom/mstar/test/LisenceCheck$1;->this$0:Lcom/mstar/test/LisenceCheck;
invoke-virtual {v6}, Lcom/mstar/test/LisenceCheck;->getApplicationContext()Landroid/content/Context;
move-result-object v6
const-string v7, "Lisence Correct\uff01" #显示序列号正确咯
invoke-static {v6, v7, v9}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;
move-result-object v6
invoke-virtual {v6}, Landroid/widget/Toast;->show()V
.line 92
.end local v1 # "i":I
.end local v2 # "k1":I
.end local v3 # "k2":I
.end local v4 # "s1":Ljava/lang/String;
.end local v5 # "s2":Ljava/lang/String;
:goto_2
return-void
.line 64
.restart local v1 # "i":I
.restart local v2 # "k1":I
.restart local v4 # "s1":Ljava/lang/String;
.restart local v5 # "s2":Ljava/lang/String;
:cond_1
invoke-virtual {v4, v1}, Ljava/lang/String;->charAt(I)C
move-result v0 #读取v4的值的第v1位,给到v0(注意,这里给的是ASCII码)
#比如v4的第v1位为1,则v0的值为49
.line 65
.local v0, "ch":C
const/16 v6, 0x41 #即十进制65
if-lt v0, v6, :cond_0 #若v0小于v6,则跳转,若输入的用户名都为数字,很明显这样肯定要跳转
#若是输入的为字母或者是一些符号什么的,就不跳转,因为ASCII码65是A嘛
.line 66
const/16 v6, 0x5a #即十进制90
if-le v0, v6, :cond_2 #若v0小于v6,则跳转,这里v6为90,即是说,如果输入为大写字母,则跳转
const/16 v6, 0x20
sub-int v6, v0, v6
int-to-char v0, v6 #这里又是将输入的小写字母转换成大写字母
.line 67
:cond_2
add-int/2addr v2, v0 #将大写字母的ASCII码给到v2
.line 62
add-int/lit8 v1, v1, 0x1 #相当于 v1++
goto :goto_0
.line 74
.end local v0 # "ch":C
.restart local v3 # "k2":I
:cond_3
invoke-virtual {v5, v1}, Ljava/lang/String;->charAt(I)C
move-result v0 #去输入序列号(即v5的值)的第v1位,给到v0,这里同样是ASCII码
.line 75
.restart local v0 # "ch":C
const/16 v6, 0x30
sub-int v6, v0, v6
int-to-char v0, v6 #v0减去48,然后将结果给到v0
.line 76
mul-int/lit8 v6, v3, 0xa #v3乘以10,结果给到v6
add-int v3, v6, v0 #将v6和v0的值相加,结果给到v3
.line 73
add-int/lit8 v1, v1, 0x1 #相对于v1++
goto :goto_1
.line 83
.end local v0 # "ch":C
:cond_4
iget-object v6, p0, Lcom/mstar/test/LisenceCheck$1;->this$0:Lcom/mstar/test/LisenceCheck;
invoke-virtual {v6}, Lcom/mstar/test/LisenceCheck;->getApplicationContext()Landroid/content/Context;
move-result-object v6
const-string v7, "Lisence Uncorrect\uff01" #显示序列号错误咯
invoke-static {v6, v7, v9}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;
move-result-object v6
invoke-virtual {v6}, Landroid/widget/Toast;->show()V
goto :goto_2
.line 88
.end local v1 # "i":I
.end local v2 # "k1":I
.end local v3 # "k2":I
.end local v4 # "s1":Ljava/lang/String;
.end local v5 # "s2":Ljava/lang/String;
:cond_5
iget-object v6, p0, Lcom/mstar/test/LisenceCheck$1;->this$0:Lcom/mstar/test/LisenceCheck;
iget-object v6, v6, Lcom/mstar/test/LisenceCheck;->meditun:Landroid/widget/EditText;
const-string v7, ""
invoke-virtual {v6, v8}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V
.line 89
iget-object v6, p0, Lcom/mstar/test/LisenceCheck$1;->this$0:Lcom/mstar/test/LisenceCheck;
iget-object v6, v6, Lcom/mstar/test/LisenceCheck;->meditsn:Landroid/widget/EditText;
const-string v7, ""
invoke-virtual {v6, v8}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V
goto :goto_2
.end method