54 lines
1.9 KiB
Java
54 lines
1.9 KiB
Java
package com.psmreborn.nopsmdrm;
|
|
|
|
import android.app.Activity;
|
|
import android.app.AlertDialog;
|
|
import android.content.DialogInterface;
|
|
import android.os.AsyncTask;
|
|
import android.os.Bundle;
|
|
import android.view.View;
|
|
|
|
import com.psmreborn.nopsmdrm.pscertified.PlayStationCertified;
|
|
import com.psmreborn.nopsmdrm.pscertified.PsCertificatesInstaller;
|
|
|
|
|
|
public class MainActivity extends Activity {
|
|
|
|
@Override
|
|
public void onCreate(Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
setContentView(R.layout.activity_main);
|
|
Helper.setContext(this);
|
|
|
|
(new Startup(this)).execute();
|
|
}
|
|
|
|
@Override
|
|
public void onBackPressed(){
|
|
finish();
|
|
}
|
|
public void installStart(View view) {
|
|
PlayStationCertified playStationCertified = new PlayStationCertified(this);
|
|
if(!playStationCertified.isPlaystationCertified()){
|
|
new AlertDialog.Builder((Activity)this)
|
|
.setTitle("PS Certification Missing")
|
|
.setMessage("Your device appears to not be\"PlayStation Certified\"\nDo you want to certify it?\n(Warning: modifies /system/)")
|
|
.setCancelable(false)
|
|
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
|
|
@Override
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
(new PsCertificatesInstaller(MainActivity.this)).execute();
|
|
}
|
|
})
|
|
.setNegativeButton("No", new DialogInterface.OnClickListener() {
|
|
@Override
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
(new NoPsmDrmInstaller(MainActivity.this)).execute();
|
|
}
|
|
}).show();
|
|
}
|
|
else {
|
|
(new NoPsmDrmInstaller(this)).execute();
|
|
}
|
|
}
|
|
}
|