这个很简单,就是拿versionName和versionName进行异或操作就可以了,versionName和versionName在AM里面设置;
protected void onCreate(Bundle arg3) {
super.onCreate(arg3);
this.setContentView(0x7F04001B);
this.btn = this.findViewById(0x7F0B0058);
this.text = this.findViewById(0x7F0B0057);
this.btn.setOnClickListener(new View$OnClickListener() {
public void onClick(View arg10) {
try {
String v1 = MainActivity.this.text.getText().toString();
PackageInfo v2 = MainActivity.this.getPackageManager().getPackageInfo("com.example.yaphetshan.tencentgreat", 0x4000);
String v3 = v2.versionName; //v3=versionName
int v4 = v2.versionCode; //v4=versionName
int v0 = 0;
while(v0 < v1.length()) {
if(v0 >= v3.length()) {
break;
}
if(v1.charAt(v0) != (v3.charAt(v0) ^ v4)) { //v3和v4异或就ok了,简单
Toast.makeText(MainActivity.this, "再接再厉,加油~", 1).show();
return;
}
else {
++v0;
continue;
}
}
if(v1.length() != v3.length()) {
goto label_39;
}
Toast.makeText(MainActivity.this, "恭喜开启闯关之门!", 1).show();
return;
}
catch(PackageManager$NameNotFoundException v5) {
}
label_39:
Toast.makeText(MainActivity.this, "年轻人不要耍小聪明噢", 1).show();
}
});
}
AM里面找到versionName和versionName
<manifest android:versionCode="15" android:versionName="X<cP[?PHNB<P?aj"
解密得到flag:
public static void main(String[] args) {
String versionName="X<cP[?PHNB<P?aj";
char[] flag=new char[versionName.length()];
int versionCode =15;
int i=0;
while (i<versionName.length()){
flag[i]= (char) (versionName.charAt(i)^versionCode);
i++;
}
System.out.println(flag);
}