好友
阅读权限25
听众
最后登录1970-1-1
|
本帖最后由 weikun444 于 2019-5-7 17:19 编辑
public class MainActivity extends AppCompatActivity
{
Button btn;
String correct = "XclSH6nZEPVd41FsAsqeChz6Uy+HFzV8Cl9jqMyg6mMrcgSoM0vJtA1BpApYahCY";
Encrypt encrypt;
EditText flagText;
ImageView imageView;
protected void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
setContentView(2130968601);
this.imageView = ((ImageView)findViewById(2131492946));
this.flagText = ((EditText)findViewById(2131492947));
this.encrypt = new Encrypt();
this.btn = ((Button)findViewById(2131492948));
try
{
paramBundle = BitmapFactory.decodeStream(getAssets().open("kawai.jpg"));
this.imageView.setImageBitmap(paramBundle);
this.btn.setOnClickListener(new View.OnClickListener()
{
public void onClick(View paramView)
{
if (MainActivity.this.encrypt.doEncrypt(MainActivity.this.flagText.getText().toString()).equals(MainActivity.this.correct))
{
Toast.makeText(MainActivity.this.getApplicationContext(), "Correct!", 1).show();
return;
}
Toast.makeText(MainActivity.this.getApplicationContext(), "Wrong!", 1).show();
}
});
return;
}
catch (java.lang.Exception paramBundle)
{
}
}
}
还差一点内容:
private String key = "3b0de20546e9331c7c87aaabf9d0d4afd8c8a761";
AES的不怎么懂!
|
|