summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPat Erley <perley@cyngn.com>2016-02-05 10:47:21 -0800
committerPat Erley <perley@cyngn.com>2016-02-05 11:18:33 -0800
commit86d2b3f87ac8377bb57cba6e93334559d41bed99 (patch)
treeb993973109bf15de4c90c8ca3d5abbfabed7ed23
parentcea50b7a2c400918f59d3cfaf9c380741383e07c (diff)
downloadbootable_recovery-86d2b3f87ac8377bb57cba6e93334559d41bed99.zip
bootable_recovery-86d2b3f87ac8377bb57cba6e93334559d41bed99.tar.gz
bootable_recovery-86d2b3f87ac8377bb57cba6e93334559d41bed99.tar.bz2
recovery: Remove insecure wipe from menu on user builds
This would allow people who gain access to a pin-locked device to remove the pin and gain access to media. This will still allow wipes from Android to preserve media. Change-Id: I73bc9d176297081a41c8d29fc77638d665442fe8
-rw-r--r--Android.mk4
-rw-r--r--device.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
index ee06a3d..2aeefde 100644
--- a/Android.mk
+++ b/Android.mk
@@ -140,6 +140,10 @@ ifneq ($(BOARD_RECOVERY_BLDRMSG_OFFSET),)
LOCAL_CFLAGS += -DBOARD_RECOVERY_BLDRMSG_OFFSET=$(BOARD_RECOVERY_BLDRMSG_OFFSET)
endif
+ifeq ($(TARGET_BUILD_VARIANT),user)
+ LOCAL_CFLAGS += -DRELEASE_BUILD
+endif
+
LOCAL_CFLAGS += -DUSE_EXT4 -DMINIVOLD
LOCAL_C_INCLUDES += system/extras/ext4_utils system/core/fs_mgr/include external/fsck_msdos
LOCAL_C_INCLUDES += system/vold
diff --git a/device.cpp b/device.cpp
index 4f19f0e..011aef0 100644
--- a/device.cpp
+++ b/device.cpp
@@ -39,13 +39,17 @@ struct menu_entry {
};
static const char* WIPE_MENU_NAMES[] = {
+#ifndef RELEASE_BUILD
"System reset (keep media)",
+#endif
"Full factory reset",
"Wipe cache partition",
nullptr
};
static const menu_entry WIPE_MENU_ENTRIES[] = {
+#ifndef RELEASE_BUILD
{ ACTION_INVOKE, { .action = Device::WIPE_DATA } },
+#endif
{ ACTION_INVOKE, { .action = Device::WIPE_FULL } },
{ ACTION_INVOKE, { .action = Device::WIPE_CACHE } },
{ ACTION_NONE, { .action = Device::NO_ACTION } }