package com.example.checkroot;
import
android.content.DialogInterface;
import
android.content.DialogInterface.OnClickListener;
import
android.os.Bundle;
import
android.util.Base64;
import
android.view.View;
import
android.view.View.OnClickListener;
import
android.widget.Button;
import
android.widget.EditText;
import
android.widget.Toast;
import
androidx.appcompat.app.AlertDialog.Builder;
import
androidx.appcompat.app.AppCompatActivity;
import
java.io.UnsupportedEncodingException;
public
class
MainActivity
extends AppCompatActivity
{
protected void onCreate(final Bundle paramBundle)
{
super
.onCreate(paramBundle);
setContentView(
2131427356
);
if
(rootcheck.isDeviceRooted())
{
paramBundle
=
new AlertDialog.Builder(this);
paramBundle.setTitle(
"安全警告"
);
paramBundle.setMessage(
"设备已root,点击确定退出"
);
paramBundle.setCancelable(false);
paramBundle.setPositiveButton(
"确定"
, new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface paramAnonymousDialogInterface,
int
paramAnonymousInt)
{
System.exit(
0
);
}
});
paramBundle.show();
}
else
{
paramBundle
=
new AlertDialog.Builder(this);
paramBundle.setTitle(
"安全提示"
);
paramBundle.setMessage(
"设备安全"
);
paramBundle.setCancelable(false);
paramBundle.setPositiveButton(
"确定"
, new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface paramAnonymousDialogInterface,
int
paramAnonymousInt) {}
});
paramBundle.show();
}
paramBundle
=
(EditText)findViewById(
2131231044
);
((Button)findViewById(
2131230940
)).setOnClickListener(new View.OnClickListener()
{
public void onClick(View paramAnonymousView)
{
paramAnonymousView
=
null;
try
{
String
str
=
new String(Base64.decode(
"5Y2K5p2v5YeJ6Iy2"
,
2
),
"utf-8"
);
paramAnonymousView
=
str
;
}
catch (UnsupportedEncodingException localUnsupportedEncodingException)
{
localUnsupportedEncodingException.printStackTrace();
}
if
(paramBundle.getText().toString().equals(paramAnonymousView)) {
Toast.makeText(MainActivity.this.getApplicationContext(),
"恭喜你,闯关成功"
,
0
).show();
}
else
{
Toast.makeText(MainActivity.this.getApplicationContext(),
"很遗憾,闯关失败"
,
0
).show();
}
paramBundle.setVisibility(
0
);
}
});
}
}