0
0
mirror of https://github.com/ponces/treble_aosp.git synced 2025-05-08 18:57:35 +00:00
Files
treble_aosp/patches/personal/device_phh_treble/0002-Rework-securize-tweak.patch

116 lines
5.3 KiB
Diff

From c2957f4297b97e6d9e87b0491d4fff8c792f1529 Mon Sep 17 00:00:00 2001
From: Alberto Ponces <ponces26@gmail.com>
Date: Wed, 25 Dec 2019 12:34:05 +0200
Subject: [PATCH 2/2] Rework securize tweak
---
base.mk | 1 -
rw-system.sh | 49 ++++++++++++++++++++++++++++++-------------------
2 files changed, 30 insertions(+), 20 deletions(-)
diff --git a/base.mk b/base.mk
index a29e402..1928cdc 100644
--- a/base.mk
+++ b/base.mk
@@ -168,7 +168,6 @@ PRODUCT_PACKAGES += \
resetprop_phh
PRODUCT_COPY_FILES += \
- device/phh/treble/phh-securize.sh:system/bin/phh-securize.sh \
device/phh/treble/files/ota.sh:system/bin/ota.sh \
PRODUCT_COPY_FILES += \
diff --git a/rw-system.sh b/rw-system.sh
index 055c2cd..6903559 100644
--- a/rw-system.sh
+++ b/rw-system.sh
@@ -785,32 +785,59 @@ copyprop() {
resetprop_phh "$1" "$(getprop "$2")"
fi
}
-if [ -f /system/phh/secure ] || [ -f /metadata/phh/secure ];then
copyprop ro.build.device ro.vendor.build.device
copyprop ro.system.build.fingerprint ro.vendor.build.fingerprint
copyprop ro.bootimage.build.fingerprint ro.vendor.build.fingerprint
copyprop ro.build.fingerprint ro.vendor.build.fingerprint
+ copyprop ro.system_ext.build.fingerprint ro.vendor.build.fingerprint
+ copyprop ro.product.build.fingerprint ro.vendor.build.fingerprint
copyprop ro.build.device ro.vendor.product.device
copyprop ro.product.system.device ro.vendor.product.device
copyprop ro.product.device ro.vendor.product.device
copyprop ro.product.system.device ro.product.vendor.device
copyprop ro.product.device ro.product.vendor.device
+ copyprop ro.product.system_ext.device ro.vendor.product.device
+ copyprop ro.product.product.device ro.vendor.product.device
+ copyprop ro.product.system_ext.device ro.product.vendor.device
+ copyprop ro.product.product.device ro.product.vendor.device
copyprop ro.product.system.name ro.vendor.product.name
copyprop ro.product.name ro.vendor.product.name
- copyprop ro.product.system.name ro.product.vendor.device
- copyprop ro.product.name ro.product.vendor.device
+ copyprop ro.product.system.name ro.product.vendor.name
+ copyprop ro.product.name ro.product.vendor.name
+ copyprop ro.product.system_ext.name ro.vendor.product.name
+ copyprop ro.product.product.name ro.vendor.product.name
+ copyprop ro.product.system_ext.name ro.product.vendor.name
+ copyprop ro.product.product.name ro.product.vendor.name
copyprop ro.system.product.brand ro.vendor.product.brand
copyprop ro.product.brand ro.vendor.product.brand
+ copyprop ro.product.system.brand ro.vendor.product.brand
+ copyprop ro.product.system_ext.brand ro.vendor.product.brand
+ copyprop ro.product.product.brand ro.product.vendor.brand
+ copyprop ro.system.product.brand ro.product.vendor.brand
+ copyprop ro.product.brand ro.product.vendor.brand
+ copyprop ro.product.system.brand ro.product.vendor.brand
+ copyprop ro.product.system_ext.brand ro.product.vendor.brand
+ copyprop ro.product.product.brand ro.product.vendor.brand
copyprop ro.product.system.model ro.vendor.product.model
copyprop ro.product.model ro.vendor.product.model
+ copyprop ro.product.system_ext.model ro.vendor.product.model
+ copyprop ro.product.product.model ro.vendor.product.model
copyprop ro.product.system.model ro.product.vendor.model
copyprop ro.product.model ro.product.vendor.model
copyprop ro.build.product ro.vendor.product.model
copyprop ro.build.product ro.product.vendor.model
+ copyprop ro.product.system_ext.model ro.product.vendor.model
+ copyprop ro.product.product.model ro.product.vendor.model
copyprop ro.system.product.manufacturer ro.vendor.product.manufacturer
copyprop ro.product.manufacturer ro.vendor.product.manufacturer
+ copyprop ro.product.system.manufacturer ro.vendor.product.manufacturer
+ copyprop ro.product.product.manufacturer ro.vendor.product.manufacturer
+ copyprop ro.product.system_ext.manufacturer ro.vendor.product.manufacturer
copyprop ro.system.product.manufacturer ro.product.vendor.manufacturer
copyprop ro.product.manufacturer ro.product.vendor.manufacturer
+ copyprop ro.product.system.manufacturer ro.product.vendor.manufacturer
+ copyprop ro.product.product.manufacturer ro.product.vendor.manufacturer
+ copyprop ro.product.system_ext.manufacturer ro.product.vendor.manufacturer
(getprop ro.vendor.build.security_patch; getprop ro.keymaster.xxx.security_patch) |sort |tail -n 1 |while read v;do
[ -n "$v" ] && resetprop_phh ro.build.version.security_patch "$v"
done
@@ -839,22 +866,6 @@ if [ -f /system/phh/secure ] || [ -f /metadata/phh/secure ];then
resetprop_phh ro.adb.secure 1
- # Hide system/xbin/su
- mount /mnt/phh/empty_dir /system/xbin
- mount /mnt/phh/empty_dir /system/app/me.phh.superuser
- mount /mnt/phh/empty /system/xbin/phh-su
-else
- mkdir /mnt/phh/xbin
- chmod 0755 /mnt/phh/xbin
- chcon u:object_r:system_file:s0 /mnt/phh/xbin
-
- #phh-su will bind over this empty file to make a real su
- touch /mnt/phh/xbin/su
- chcon u:object_r:system_file:s0 /mnt/phh/xbin/su
-
- mount -o bind /mnt/phh/xbin /system/xbin
-fi
-
for abi in "" 64;do
f=/vendor/lib$abi/libstagefright_foundation.so
if [ -f "$f" ];then
--
2.34.1