好友
阅读权限25
听众
最后登录1970-1-1
|
对不懂算法之辈,看看就行了。下面复杂的事就留给大神吧。
public class MainActivity extends AppCompatActivity
{
public MainActivity()
{
times = 0;
success = 32;
}
public static String NotMD5Encrypt(String s)
{
int i;
int j;
int k;
Object obj;
try
{
obj = MessageDigest.getInstance("MD5");
((MessageDigest) (obj)).update(s.getBytes());
s = ((MessageDigest) (obj)).digest();
obj = new StringBuilder();
k = s.length;
}
// Misplaced declaration of an exception variable
catch(String s)
{
return "";
}
i = 0;
goto _L1
_L5:
if(j >= 16)
break MISSING_BLOCK_LABEL_54;
((StringBuilder) (obj)).append("0");
((StringBuilder) (obj)).append(Integer.toHexString(j));
i++;
goto _L1
_L3:
s = ((StringBuilder) (obj)).toString().substring(8, 24);
return s;
_L1:
if(i >= k) goto _L3; else goto _L2
_L2:
byte byte0 = s[i];
j = byte0;
if(byte0 < 0)
j = byte0 + 256;
if(true) goto _L5; else goto _L4
_L4:
}
public boolean check()
{
int i = times;
boolean flag = false;
if(i == 0)
{
System.out.println(jniTest(0));
times = times + 1;
return false;
}
i++;
times = i;
if(i >= success)
flag = true;
return flag;
}
public void fail()
{
StringBuilder stringbuilder = new StringBuilder();
stringbuilder.append("不生气倒计时");
stringbuilder.append(success - times);
Toast.makeText(this, stringbuilder.toString(), 0).show();
}
public native int jniTest(int i);
protected void onCreate(Bundle bundle)
{
super.onCreate(bundle);
setContentView(0x7f0a001c);
try
{
bundle = String.format("%s/%s", new Object[] {
getCacheDir(), "pic.jpg"
});
InputStream inputstream = getAssets().open("pic.jpg");
FileOutputStream fileoutputstream = new FileOutputStream(bundle);
byte abyte0[] = new byte[inputstream.available()];
inputstream.read(abyte0);
fileoutputstream.write(abyte0);
inputstream.close();
fileoutputstream.close();
System.loadLibrary("c");
showPic((ImageView)findViewById(0x7f070062), Uri.fromFile(new File(bundle)));
(new File(bundle)).delete();
}
// Misplaced declaration of an exception variable
catch(Bundle bundle) { }
findViewById(0x7f070045).setOnClickListener(new android.view.View.OnClickListener() {
public void onClick(View view)
{
if(!check() && times != -1)
fail();
if(times < success)
break MISSING_BLOCK_LABEL_186;
view = Cipher.getInstance("AES/CBC/PKCS5Padding");
view.init(1, new SecretKeySpec(MainActivity.NotMD5Encrypt(String.valueOf(times)).getBytes(), "AES"), new IvParameterSpec(MainActivity.NotMD5Encrypt(String.valueOf(times)).getBytes()));
if(Base64.encodeToString(view.doFinal(String.valueOf(success).getBytes()), 0).equals(((EditText)findViewById(0x7f070079)).getText().toString()))
{
success();
break MISSING_BLOCK_LABEL_174;
}
times = 1;
fail();
return;
view;
return;
view;
return;
view;
return;
view;
return;
view;
return;
view;
}
final MainActivity this$0;
{
this$0 = MainActivity.this;
super();
}
}
);
}
public native void showPic(ImageView imageview, Uri uri);
public void success()
{
Button button = (Button)findViewById(0x7f070045);
EditText edittext = (EditText)findViewById(0x7f070079);
button.setEnabled(false);
edittext.setEnabled(false);
edittext.setText(0x7f0c001e);
edittext.setTextColor(0xffff0000);
}
public int success;
public int times;
} |
|