tools: Let adb secure check depend on "==0" rather than "!=1"
We are using PRODUCT_SYSTEM_DEFAULT_PROPERTIES to set
`ro.adb.secure` property. But unfortunately this flag only
affect system partition, which means in other partitions
e.g. vendor and system_ext `ro.adb.secure` stays empty.
Thus `persist.sys.usb.config=adb` is unconditionally set
in partitions other than system, which lead to adb enabled
by default even on user build.
Change-Id: I1f8b463b3ec645309369f36014bed556e75ed210
Signed-off-by: LibXZR <i@xzr.moe>
diff --git a/tools/post_process_props.py b/tools/post_process_props.py
index 00fc4eb..76a8fcd 100755
--- a/tools/post_process_props.py
+++ b/tools/post_process_props.py
@@ -28,9 +28,9 @@
# Put the modifications that you need to make into the */build.prop into this
# function.
def mangle_build_prop(prop_list):
- # If ro.adb.secure is not 1, then enable adb on USB by default
- # (this is for userdebug/eng builds)
- if prop_list.get_value("ro.adb.secure") != "1":
+ # If ro.adb.secure is 0, then enable adb on USB by default
+ # (this is for eng builds)
+ if prop_list.get_value("ro.adb.secure") == "0":
val = prop_list.get_value("persist.sys.usb.config")
if "adb" not in val:
if val == "":