小白留爪
smali跳转去做就没意义了
dex -> jar后的源代码
直接看按钮onClick部分
public void onClick(View paramView)
{
switch (paramView.getId())
{
default:
return;
case 2131230724:
if (!checkSN(this.edit_userName.getText().toString().trim(), this.edit_sn.getText().toString().trim()))
{
Toast.makeText(this, 2131034123, 0).show();
return;
}
Toast.makeText(this, 2131034124, 0).show();
this.btn_register.setEnabled(false);
setTitle(2131034122);
return;
case 2131230723:
}
checkSNfalse(this.edit_userName.getText().toString().trim(), this.edit_sn.getText().toString().trim());
this.btn_answer.setVisibility(8);
}
校验在checkSN
private boolean checkSN(String paramString1, String paramString2)
{
if (paramString1 != null)
try
{
if (paramString1.length() == 0)
return false;
if ((paramString2 != null) && (paramString2.length() == 16))
{
Object localObject = MessageDigest.getInstance("MD5");
((MessageDigest)localObject).reset();
((MessageDigest)localObject).update(paramString1.getBytes());
paramString1 = toHexString(((MessageDigest)localObject).digest(), "");
localObject = new StringBuilder();
int i = 0;
while (true)
{
if (i >= paramString1.length())
{
paramString1 = ((StringBuilder)localObject).toString();
Log.e("TAG", paramString1);
if (!paramString1.equalsIgnoreCase(paramString2))
break;
return true;
}
((StringBuilder)localObject).append(paramString1.charAt(i));
i += 2;
}
}
}
catch (NoSuchAlgorithmException paramString1)
{
paramString1.printStackTrace();
}
return false;
}
可以看到这个算法就是将你的输入的字符串做MD5后取偶数位
解决脚本
import hashlib
str1 = '123'
str2 = ''
a = hashlib.md5()
a.update(str1)
str1 = a.hexdigest()
m = 0
while True:
if m >= len(str1):
print str2
break
str2 += str1[m]
m += 2
|