Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 129de8ad authored by LibXZR's avatar LibXZR Committed by Michael Bestas
Browse files

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: default avatarLibXZR <i@xzr.moe>
parent 3f168464
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -28,9 +28,9 @@ PROP_VALUE_MAX = 91
# 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
  # 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") != "1":
  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 == "":