package com.psmreborn.nopsmdrm; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.net.wifi.WifiManager; import android.os.Bundle; import android.os.Environment; import android.os.Handler; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import com.psmreborn.nopsmdrm.pscertified.PlayStationCertified; import com.psmreborn.nopsmdrm.pscertified.PsCertificatesInstaller; import java.io.File; public class MainActivity extends Activity { /* @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.activity_menu, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle item selection. switch (item.getItemId()) { case R.id.accIdentifer: return true; case R.id.accEmail: return true; case R.id.accPassword: return true; default: return super.onOptionsItemSelected(item); } } */ @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(); System.exit(0); super.onBackPressed(); } private void psCertifiedAlert(){ 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", null).show(); } public void installStart(View view) { PlayStationCertified playStationCertified = new PlayStationCertified(this); if(!playStationCertified.isPlaystationCertified()){ psCertifiedAlert(); } else { (new NoPsmDrmInstaller(this)).execute(); } } public void dumpAllRifs(View view){ String rifOutput = new File(Environment.getExternalStorageDirectory(), "psm").getAbsolutePath(); new AlertDialog.Builder((Activity)this) .setTitle("Backup licenses") .setMessage("This will show a black screen for awhile\nthen a PlayStation Mobile game will start\nOnce the game starts, a backup of all your PSM licenses can be found at\n\""+rifOutput+"\"\nDo you want to do this?") .setCancelable(false) .setPositiveButton("Yes", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { DumpAllRifs.setDumpAllFlagAndStartPsm(MainActivity.this); } }) .setNegativeButton("No", null).show(); } }