Skip to content

Commit

Permalink
updater: change update path to subfolder
Browse files Browse the repository at this point in the history
The new backup path is now /sdcard/com.aero.control/backup
since profiles are now stored in a seperate folder.

Signed-off-by: Blechd0se <alex.christ@hotmail.de>
  • Loading branch information
Blechd0se committed Oct 7, 2014
1 parent 45e2c84 commit da89a93
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions AeroControl/src/com/aero/control/fragments/UpdaterFragment.java
Expand Up @@ -33,9 +33,9 @@ public class UpdaterFragment extends PreferenceFragment {
private static final String SDPATH = Environment.getExternalStorageDirectory().getPath();

private static final String timeStamp = new SimpleDateFormat("ddMMyyyy", Locale.getDefault()).format(Calendar.getInstance().getTime());
private static final File BACKUP_PATH = new File(SDPATH + "/com.aero.control/" + timeStamp + "/zImage");
private static final File BACKUP_PATH = new File(SDPATH + "/com.aero.control/backup/" + timeStamp + "/zImage");
private static final File IMAGE = new File (AeroActivity.files.zImage);
private static final String AERO_PATH = SDPATH + "/com.aero.control";
private static final String AERO_PATH = "/sdcard/com.aero.control/backup";

private static final updateHelper update = new updateHelper();
private Preference mBackupKernel;
Expand Down Expand Up @@ -72,7 +72,7 @@ public void onCreate(Bundle savedInstanceState) {

// Fresh Start, no backup found;
try {
mBackupKernel.setSummary(getText(R.string.last_backup_from)+ " " + AeroActivity.shell.getDirInfo(SDPATH + "/com.aero.control/", false)[0]);
mBackupKernel.setSummary(getText(R.string.last_backup_from)+ " " + AeroActivity.shell.getDirInfo(SDPATH + "/com.aero.control/backup", false)[0]);
mRestoreKernel.setEnabled(true);
} catch (NullPointerException e) {
mBackupKernel.setSummary(getText(R.string.last_backup_from)+ " " + getText(R.string.unavailable));
Expand All @@ -83,8 +83,8 @@ public void onCreate(Bundle savedInstanceState) {
mRestoreKernel.setIcon(R.drawable.ic_action_time);


mRestoreKernel.setEntries(AeroActivity.shell.getDirInfo(SDPATH + File.separator + "/com.aero.control/", false));
mRestoreKernel.setEntryValues(AeroActivity.shell.getDirInfo(SDPATH + "/com.aero.control/", false));
mRestoreKernel.setEntries(AeroActivity.shell.getDirInfo(SDPATH + File.separator + "/com.aero.control/backup/", false));
mRestoreKernel.setEntryValues(AeroActivity.shell.getDirInfo(SDPATH + "/com.aero.control/backup/", false));
mRestoreKernel.setDialogIcon(R.drawable.restore);

mRestoreKernel.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
Expand Down Expand Up @@ -158,8 +158,8 @@ public void onClick(DialogInterface dialog, int id) {
mBackupKernel.setSummary(getText(R.string.last_backup_from) + " " + timeStamp);

// Prepare the UI, otherwise it would throw a Exception;
mRestoreKernel.setEntries(AeroActivity.shell.getDirInfo(SDPATH + "/com.aero.control/", false));
mRestoreKernel.setEntryValues(AeroActivity.shell.getDirInfo(SDPATH + "/com.aero.control/", false));
mRestoreKernel.setEntries(AeroActivity.shell.getDirInfo(SDPATH + "/com.aero.control/backup/", false));
mRestoreKernel.setEntryValues(AeroActivity.shell.getDirInfo(SDPATH + "/com.aero.control/backup/", false));

mRestoreKernel.setEnabled(true);

Expand Down Expand Up @@ -220,7 +220,7 @@ private void restorezImage(String s) {
// Delete old zImage first, then copy backup;
String[] commands = new String[] {
"rm -f " + AeroActivity.files.zImage,
"cp " + "/sdcard/com.aero.control/" + s + "/zImage" + " " + AeroActivity.files.zImage,
"cp " + "/sdcard/com.aero.control/backup/" + s + "/zImage" + " " + AeroActivity.files.zImage,
};

AeroActivity.shell.setRootInfo(commands);
Expand All @@ -230,7 +230,7 @@ private void restorezImage(String s) {

private void restoreBoot(String s) {

String filepath = new File("/sdcard/com.aero.control/" + s + "/boot.img").getPath();
String filepath = new File("/sdcard/com.aero.control/backup/" + s + "/boot.img").getPath();

String[] commands = new String[] {
"chmod 0777 " + filepath,
Expand Down

0 comments on commit da89a93

Please sign in to comment.