summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornailyk-fr <nailyk_git@nailyk.fr>2016-12-18 14:32:25 +0100
committerDees Troy <dees_troy@teamw.in>2017-01-11 18:09:59 +0100
commit1021edf17ed57f193724a953dd159e7717e9553a (patch)
tree915c6cf1604fefd52239fda6865fb0d589879b85
parentSupport theme width and height offsets (diff)
downloadandroid_bootable_recovery-1021edf17ed57f193724a953dd159e7717e9553a.tar
android_bootable_recovery-1021edf17ed57f193724a953dd159e7717e9553a.tar.gz
android_bootable_recovery-1021edf17ed57f193724a953dd159e7717e9553a.tar.bz2
android_bootable_recovery-1021edf17ed57f193724a953dd159e7717e9553a.tar.lz
android_bootable_recovery-1021edf17ed57f193724a953dd159e7717e9553a.tar.xz
android_bootable_recovery-1021edf17ed57f193724a953dd159e7717e9553a.tar.zst
android_bootable_recovery-1021edf17ed57f193724a953dd159e7717e9553a.zip
-rw-r--r--bootloader_message/Android.mk4
-rw-r--r--bootloader_message/bootloader_message.cpp11
2 files changed, 15 insertions, 0 deletions
diff --git a/bootloader_message/Android.mk b/bootloader_message/Android.mk
index 8653fd525..1d5c85fe3 100644
--- a/bootloader_message/Android.mk
+++ b/bootloader_message/Android.mk
@@ -37,5 +37,9 @@ else
LOCAL_SHARED_LIBRARIES += libc++
endif
LOCAL_CFLAGS := -DEXCLUDE_FS_MGR
+# ignore bootloader's factory reset command even when written to /misc
+ifeq ($(TW_IGNORE_MISC_WIPE_DATA), true)
+ LOCAL_CFLAGS += -DIGNORE_MISC_WIPE_DATA
+endif
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
include $(BUILD_SHARED_LIBRARY)
diff --git a/bootloader_message/bootloader_message.cpp b/bootloader_message/bootloader_message.cpp
index eb99bdb42..362d9cbe2 100644
--- a/bootloader_message/bootloader_message.cpp
+++ b/bootloader_message/bootloader_message.cpp
@@ -284,6 +284,17 @@ get_args(int *argc, char ***argv) {
(*argv)[0] = strdup(arg);
for (*argc = 1; *argc < MAX_ARGS; ++*argc) {
if ((arg = strtok(NULL, "\n")) == NULL) break;
+
+// if the device does not have an own recovery key combo we just want to open TWRP after
+// walking through the factory reset screen - without actually doing a factory reset
+#ifdef IGNORE_MISC_WIPE_DATA
+ if (!strcmp(arg, "--wipe_data")) {
+ (*argv)[*argc] = "";
+ *argc = *argc -1;
+ printf("Bootloader arg \"%s\" ignored because TWRP was compiled with TW_IGNORE_MISC_WIPE_DATA\n", arg);
+ continue;
+ }
+#endif
(*argv)[*argc] = strdup(arg);
}
printf("Got arguments from boot message\n");