public void onClick(View v) {
String password
=
edit.getText().toString();
String table
=
MainActivity.this.getTableFromPic();
String pw
=
MainActivity.this.getPwdFromPic();
Log.i(
"lil"
,
"table:"
+
table);
Log.i(
"lil"
,
"pw:"
+
pw);
String enPassword
=
"";
try
{
enPassword
=
MainActivity.bytesToAliSmsCode(table, password.getBytes(
"utf-8"
));
Log.i(
"lil"
,
"enPassword:"
+
enPassword);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
if
(pw
=
=
null || pw.equals("") || !pw.equals(enPassword)) {
AlertDialog.Builder builder
=
new AlertDialog.Builder(MainActivity.this);
builder.setMessage(R.string.dialog_error_tips);
builder.setTitle(R.string.dialog_title);
builder.setPositiveButton(R.string.dialog_ok, new DialogInterface.OnClickListener() {
/
/
from
class
: com.example.simpleencryption.MainActivity.
1.1
@Override
/
/
android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialog,
int
which) {
dialog.dismiss();
}
});
builder.show();
return
;
}
MainActivity.this.showDialog();
}