Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

1.7.0

  • Loading branch information...
commit 3d166faaee202c479b3b4a9871e8155bbffd1ffa 1 parent 5643517
@packetlss authored
Showing with 58 additions and 41 deletions.
  1. +54 −39 recovery.c
  2. 0  res/images/icon_error.png
  3. +4 −2 ui.c
View
93 recovery.c
@@ -452,7 +452,7 @@ choose_nandroid_file(const char *nandroid_folder)
if (confirm_apply == BTN_MOUSE) {
ui_print("\nRestoring : ");
- char nandroid_command[200]="/sbin/nandroid-mobile.sh -r -e --norecovery --nocache --nomisc --nosplash1 --nosplash2 --defaultinput -s ";
+ char nandroid_command[200]="/sbin/nandroid-mobile.sh -r -e --norecovery --nomisc --nocache --nosplash1 --nosplash2 --defaultinput -s ";
strlcat(nandroid_command, list[chosen_item], sizeof(nandroid_command));
@@ -635,6 +635,7 @@ choose_update_file()
DIR *dir;
struct dirent *de;
char **files;
+ char **list;
int total = 0;
int i;
@@ -678,6 +679,9 @@ choose_update_file()
files = (char **) malloc((total + 1) * sizeof(*files));
files[total] = NULL;
+ list = (char **) malloc((total + 1) * sizeof(*files));
+ list[total] = NULL;
+
/* set it up for the second pass */
rewinddir(dir);
@@ -691,6 +695,10 @@ choose_update_file()
files[i] = (char *) malloc(SDCARD_PATH_LENGTH + strlen(de->d_name) + 1);
strcpy(files[i], SDCARD_PATH);
strcat(files[i], de->d_name);
+
+ list[i] = (char *) malloc(strlen(de->d_name) + 1);
+ strcpy(list[i], de->d_name);
+
i++;
}
}
@@ -701,7 +709,7 @@ choose_update_file()
goto out;
}
- ui_start_menu(headers, files);
+ ui_start_menu(headers, list);
int selected = 0;
int chosen_item = -1;
@@ -729,7 +737,7 @@ choose_update_file()
ui_end_menu();
ui_print("\nInstall : ");
- ui_print(files[chosen_item]);
+ ui_print(list[chosen_item]);
ui_clear_key_queue();
ui_print(" ? \nPress Trackball to confirm,");
ui_print("\nany other key to abort.\n");
@@ -762,8 +770,10 @@ choose_update_file()
for (i = 0; i < total; i++) {
free(files[i]);
+ free(list[i]);
}
free(files);
+ free(list);
}
@@ -779,12 +789,14 @@ show_menu_wipe()
// these constants correspond to elements of the items[] list.
#define ITEM_WIPE_DATA 0
-#define ITEM_WIPE_DALVIK 1
-#define ITEM_WIPE_EXT 2
-#define ITEM_WIPE_BAT 3
-#define ITEM_WIPE_ROT 4
+#define ITEM_WIPE_CACHE 1
+#define ITEM_WIPE_DALVIK 2
+#define ITEM_WIPE_EXT 3
+#define ITEM_WIPE_BAT 4
+#define ITEM_WIPE_ROT 5
static char* items[] = { "- Wipe data/factory reset",
+ "- Wipe cache",
"- Wipe Dalvik-cache",
"- Wipe SD:ext partition",
"- Wipe battery stats",
@@ -838,6 +850,23 @@ show_menu_wipe()
if (!ui_text_visible()) return;
break;
+ case ITEM_WIPE_CACHE:
+ ui_clear_key_queue();
+ ui_print("\nWipe cache");
+ ui_print("\nPress Trackball to confirm,");
+ ui_print("\nany other key to abort.\n");
+ int confirm_wipe_cache = ui_wait_key();
+ if (confirm_wipe_cache == BTN_MOUSE) {
+ ui_print("\nWiping cache...\n");
+ erase_root("CACHE:");
+ ui_print("\nCache wipe complete.\n\n");
+ } else {
+ ui_print("\nCache wipe aborted.\n\n");
+ }
+ if (!ui_text_visible()) return;
+ break;
+
+
case ITEM_WIPE_DALVIK:
run_script("\nWipe Dalvik-cache",
"\nWiping Dalvik-cache : ",
@@ -910,15 +939,16 @@ show_menu_br()
#define ITEM_NANDROID_BCK 0
#define ITEM_NANDROID_BCKEXT 1
#define ITEM_NANDROID_RES 2
-#define ITEM_BART_BCK 3
-#define ITEM_BART_RES 4
+#define ITEM_GOOG_BCK 3
+#define ITEM_GOOG_RES 4
+
static char* items[] = { "- Nand backup",
"- Nand + ext backup",
"- Nand restore",
- "- BART backup",
- "- BART restore",
+ "- Backup Google proprietary system files",
+ "- Restore Google proprietary system files",
NULL };
ui_start_menu(headers, items);
@@ -954,7 +984,7 @@ show_menu_br()
case ITEM_NANDROID_BCK:
run_script("\nCreate Nandroid backup?",
"\nPerforming backup : ",
- "/sbin/nandroid-mobile.sh -b --norecovery --nocache --nomisc --nosplash1 --nosplash2 --defaultinput",
+ "/sbin/nandroid-mobile.sh -b --norecovery --nomisc --nocache --nosplash1 --nosplash2 --defaultinput",
"\nuNnable to execute nandroid-mobile.sh!\n(%s)\n",
"\nError : Run 'nandroid-mobile.sh' via adb!\n",
"\nBackup complete!\n\n",
@@ -964,7 +994,7 @@ show_menu_br()
case ITEM_NANDROID_BCKEXT:
run_script("\nCreate Nandroid + ext backup?",
"\nPerforming backup : ",
- "/sbin/nandroid-mobile.sh -b -e --norecovery --nocache --nomisc --nosplash1 --nosplash2 --defaultinput",
+ "/sbin/nandroid-mobile.sh -b -e --norecovery --nomisc --nocache --nosplash1 --nosplash2 --defaultinput",
"\nuNnable to execute nandroid-mobile.sh!\n(%s)\n",
"\nError : Run 'nandroid-mobile.sh' via adb!\n",
"\nBackup complete!\n\n",
@@ -975,28 +1005,25 @@ show_menu_br()
choose_nandroid_folder();
break;
-
- case ITEM_BART_BCK:
- run_script("\nCreate BART backup?",
+ case ITEM_GOOG_BCK:
+ run_script("\nBackup Google proprietary system files?",
"\nPerforming backup : ",
- "/sbin/bart --noninteractive --norecovery -s",
- "\nuNnable to execute bart!\n(%s)\n",
- "\nError : Run 'bart' via adb!\n",
+ "/sbin/backuptool.sh backup",
+ "\nuNnable to execute backuptool.sh!\n(%s)\n",
+ "\nError : Run 'backuptools.sh' via adb!\n",
"\nBackup complete!\n\n",
"\nBackup aborted!\n\n");
break;
- case ITEM_BART_RES:
- run_script("\nRestore BART backup?",
+ case ITEM_GOOG_RES:
+ run_script("\nRestore Google proprietary system files?",
"\nPerforming restore : ",
- "/sbin/bart --noninteractive --norecovery -r",
- "\nuNnable to execute bart!\n(%s)\n",
- "\nError : Run 'bart' via adb!\n",
+ "/sbin/backuptool.sh restore",
+ "\nuNnable to execute backuptool.sh!\n(%s)\n",
+ "\nError : Run 'backuptools.sh' via adb!\n",
"\nRestore complete!\n\n",
"\nRestore aborted!\n\n");
break;
-
-
}
@@ -1200,11 +1227,9 @@ show_menu_other()
// these constants correspond to elements of the items[] list.
#define ITEM_OTHER_FIXUID 0
-#define ITEM_OTHER_AP2SD 1
-#define ITEM_OTHER_RE2SD 2
+#define ITEM_OTHER_RE2SD 1
static char* items[] = { "- Fix apk uid mismatches",
- "- Move apps+dalv to SD",
"- Move recovery.log to SD",
NULL };
@@ -1247,16 +1272,6 @@ show_menu_other()
"\nUid mismatches fixed!\n\n",
"\nFixing aborted!\n\n");
break;
-
- case ITEM_OTHER_AP2SD:
- run_script("\nMove apps and dalvik-cache to SD",
- "\nMoving : ",
- "/sbin/apps2sd",
- "\nUnable to execute apps2sd!\n(%s)\n",
- "\nError : Run 'apps2sd' via adb!\n\n",
- "\nMoving complete!\n\n",
- "\nMoving aborted!\n\n");
- break;
case ITEM_OTHER_RE2SD:
run_script("\nMove recovery.log to SD",
View
0  res/images/icon_error.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
6 ui.c
@@ -29,7 +29,7 @@
#include "minui/minui.h"
#define MAX_COLS 64
-#define MAX_ROWS 32
+#define MAX_ROWS 64
#define CHAR_WIDTH 10
#define CHAR_HEIGHT 18
@@ -178,6 +178,7 @@ static void draw_screen_locked(void)
int i = 0;
if (show_menu) {
gr_color(120, 166, 0, 255);
+// gr_color(61, 233, 255, 255);
gr_fill(0, (menu_top+menu_sel) * CHAR_HEIGHT,
gr_fb_width(), (menu_top+menu_sel+1)*CHAR_HEIGHT+1);
@@ -185,7 +186,8 @@ static void draw_screen_locked(void)
if (i == menu_top + menu_sel) {
gr_color(255, 255, 255, 255);
draw_text_line(i, menu[i]);
- gr_color(120, 166, 0, 255);
+ gr_color(120, 166, 0, 255);
+// gr_color(61, 233, 255, 255);
} else {
draw_text_line(i, menu[i]);
}
Please sign in to comment.
Something went wrong with that request. Please try again.