Revert "Revert "Enable verity on userdebug, and add disable-verity to adb""
This reverts commit 99a31b8129b71aeeb08b3c33a39b0f7f97e74852.
Fixed build error, and also fixed memory leak spotted from warning.
(cherry-pick of 96e2e0ea682169fdaea1d5d163c39231a6f7041f.)
Bug: 17691572
Change-Id: I23b5ba537f7b557432041d4338b38b9be434e981
diff --git a/commandline.c b/commandline.c
index aa97eb4..21945d9 100644
--- a/commandline.c
+++ b/commandline.c
@@ -193,6 +193,7 @@
" adb keygen <file> - generate adb public/private key. The private key is stored in <file>,\n"
" and the public key is stored in <file>.pub. Any existing files\n"
" are overwritten.\n"
+ " adb disable-verity - disable dm-verity checking on USERDEBUG builds\n"
" adb help - show this help message\n"
" adb version - show version num\n"
"\n"
@@ -209,8 +210,7 @@
" adb reboot-bootloader - reboots the device into the bootloader\n"
" adb root - restarts the adbd daemon with root permissions\n"
" adb usb - restarts the adbd daemon listening on USB\n"
- " adb tcpip <port> - restarts the adbd daemon listening on TCP on the specified port"
- "\n"
+ " adb tcpip <port> - restarts the adbd daemon listening on TCP on the specified port\n"
"networking:\n"
" adb ppp <tty> [parameters] - Run PPP over USB.\n"
" Note: you should not automatically start a PPP connection.\n"
@@ -1446,7 +1446,7 @@
if(!strcmp(argv[0], "remount") || !strcmp(argv[0], "reboot")
|| !strcmp(argv[0], "reboot-bootloader")
|| !strcmp(argv[0], "tcpip") || !strcmp(argv[0], "usb")
- || !strcmp(argv[0], "root")) {
+ || !strcmp(argv[0], "root") || !strcmp(argv[0], "disable-verity")) {
char command[100];
if (!strcmp(argv[0], "reboot-bootloader"))
snprintf(command, sizeof(command), "reboot:bootloader");