50 lines
1.4 KiB
Diff
50 lines
1.4 KiB
Diff
From 81f34a4c35c904fdb34fae8f35229dc2f0580df9 Mon Sep 17 00:00:00 2001
|
|
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
|
|
Date: Thu, 29 Dec 2022 15:12:03 +0000
|
|
Subject: [PATCH 7/9] treble: Securize on-demand
|
|
|
|
Status is stored in /metadata and controlled by persist prop
|
|
|
|
Change-Id: I8069b6f471ad87ab34c18b743689ab3584cee35b
|
|
---
|
|
phh-prop-handler.sh | 14 ++++++++++++++
|
|
vndk.rc | 3 +++
|
|
2 files changed, 17 insertions(+)
|
|
|
|
diff --git a/phh-prop-handler.sh b/phh-prop-handler.sh
|
|
index 2d30ab7..92db128 100644
|
|
--- a/phh-prop-handler.sh
|
|
+++ b/phh-prop-handler.sh
|
|
@@ -257,3 +257,17 @@ if [ "$1" == "persist.bluetooth.system_audio_hal.enabled" ]; then
|
|
restartAudio
|
|
exit
|
|
fi
|
|
+
|
|
+if [ "$1" == "persist.sys.phh.securize" ];then
|
|
+ if [[ "$prop_value" != "true" && "$prop_value" != "false" ]]; then
|
|
+ exit 1
|
|
+ fi
|
|
+
|
|
+ if [[ "$prop_value" == "true" ]]; then
|
|
+ mkdir /metadata/phh
|
|
+ touch /metadata/phh/secure
|
|
+ else
|
|
+ rm /metadata/phh/secure
|
|
+ fi
|
|
+ exit
|
|
+fi
|
|
diff --git a/vndk.rc b/vndk.rc
|
|
index 823456a..1ec8ccb 100644
|
|
--- a/vndk.rc
|
|
+++ b/vndk.rc
|
|
@@ -90,3 +90,6 @@ service watchdogd-gsi /system/bin/watchdogd 10 20
|
|
class core
|
|
oneshot
|
|
seclabel u:r:watchdogd:s0
|
|
+
|
|
+on property:persist.sys.phh.securize=*
|
|
+ exec u:r:phhsu_daemon:s0 root -- /system/bin/phh-prop-handler.sh "persist.sys.phh.securize"
|
|
--
|
|
2.34.1
|
|
|