From 8c898480387e3555313a9e33742d5ccf2f78bc19 Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Thu, 24 Feb 2022 11:00:25 +0100 Subject: [PATCH] Allow disabling debugging for production devices Some 3rd party apps are using the RootBeer lib to detect a ro.debuggable equal to 1 and consider that the device might be rooted, so won't run. Allow the possibility to disable target debugging with the DISABLE_TARGET_DEBUGGING variable that will be used for stable builds. --- build/core/main_version.mk | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build/core/main_version.mk b/build/core/main_version.mk index e41313513..0ce881b77 100644 --- a/build/core/main_version.mk +++ b/build/core/main_version.mk @@ -34,3 +34,13 @@ ADDITIONAL_BUILD_PROPERTIES += \ # LineageOS Platform Internal Version ADDITIONAL_BUILD_PROPERTIES += \ ro.lineage.build.version.plat.rev=$(LINEAGE_PLATFORM_REV) + +# Allow disabling debugging flags set by the build system +# for 3rd party apps support. +ifeq ($(TARGET_BUILD_VARIANT),userdebug) + ifeq ($(DISABLE_TARGET_DEBUGGING),true) + ADDITIONAL_BUILD_PROPERTIES += ro.debuggable=0 + ADDITIONAL_BUILD_PROPERTIES += dalvik.vm.lockprof.threshold=0 + endif +endif + -- GitLab