diff --git a/Android.mk b/Android.mk index b96a2af..4c26765 100644 --- a/Android.mk +++ b/Android.mk @@ -8,8 +8,8 @@ commands_recovery_local_path := $(LOCAL_PATH) # LOCAL_CPP_EXTENSION := .c LOCAL_SRC_FILES := \ - extendedcommands.c \ - nandroid.c \ + extendedcommands.c \ + nandroid.c \ legacy.c \ commands.c \ recovery.c \ @@ -26,7 +26,7 @@ LOCAL_MODULE := recovery LOCAL_FORCE_STATIC_EXECUTABLE := true -RECOVERY_VERSION := ClockworkMod Recovery v1.7.8.3 +RECOVERY_VERSION := ClockworkMod Recovery v1.7.8.4 LOCAL_CFLAGS := -DRECOVERY_VERSION="$(RECOVERY_VERSION)" RECOVERY_API_VERSION := 2 LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION) diff --git a/commands.c b/commands.c index 3114569..a544215 100644 --- a/commands.c +++ b/commands.c @@ -772,9 +772,19 @@ cmd_backup_rom(const char *name, void *cookie, int argc, const char *argv[], { case 0: { - struct timeval tp; - gettimeofday(&tp, NULL); - sprintf(backup_path, "/sdcard/clockworkmod/backup/%d", tp.tv_sec); + char backup_path[PATH_MAX]; + time_t t = time(NULL); + struct tm *tmp = localtime(&t); + if (tmp == NULL) + { + struct timeval tp; + gettimeofday(&tp, NULL); + sprintf(backup_path, "/sdcard/clockworkmod/backup/%d", tp.tv_sec); + } + else + { + strftime(backup_path, sizeof(backup_path), "/sdcard/clockworkmod/backup/%F.%H.%M.%S", tmp); + } backup_name = backup_path; } break; diff --git a/extendedcommands.c b/extendedcommands.c index f3ddd00..bc8391f 100644 --- a/extendedcommands.c +++ b/extendedcommands.c @@ -399,7 +399,7 @@ int confirm_format() } #define MOUNTABLE_COUNT 4 -#define MTD_COUNT 4 +#define MTD_COUNT 1 void show_partition_menu() { @@ -417,10 +417,10 @@ void show_partition_menu() }; string mtds[MTD_COUNT][2] = { + { "format boot", "boot" }, { "format system", "system" }, { "format data", "data" }, { "format cache", "cache" }, - { "format boot", "boot" } }; for (;;) @@ -636,10 +636,19 @@ void show_nandroid_menu() { case 0: { - struct timeval tp; - gettimeofday(&tp, NULL); char backup_path[PATH_MAX]; - sprintf(backup_path, "/sdcard/clockworkmod/backup/%d", tp.tv_sec); + time_t t = time(NULL); + struct tm *tmp = localtime(&t); + if (tmp == NULL) + { + struct timeval tp; + gettimeofday(&tp, NULL); + sprintf(backup_path, "/sdcard/clockworkmod/backup/%d", tp.tv_sec); + } + else + { + strftime(backup_path, sizeof(backup_path), "/sdcard/clockworkmod/backup/%F.%H.%M.%S", tmp); + } nandroid_backup(backup_path); } break;