From 77bcca884b00ad86fe28521f5976e4c967e9284d Mon Sep 17 00:00:00 2001 From: BlackMesa123 Date: Fri, 29 Sep 2023 18:55:19 +0200 Subject: [PATCH] enhancer: fix file permission/context in boot mode Signed-off-by: BlackMesa123 --- enhancer/customize.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/enhancer/customize.sh b/enhancer/customize.sh index ab9e919..79a2971 100755 --- a/enhancer/customize.sh +++ b/enhancer/customize.sh @@ -115,7 +115,21 @@ if $BOOTMODE; then fi fi + ui_print "I: Fixing file permissions..." set_perm_recursive "$MODPATH" 0 0 0755 0644 + set_perm_recursive "$MODPATH/system/lib" 0 0 0755 0644 "u:object_r:system_lib_file:s0" + $IS64BIT && set_perm_recursive "$MODPATH/system/lib64" 0 0 0755 0644 "u:object_r:system_lib_file:s0" + if [ -e "$MODPATH/system/vendor" ]; then + set_perm_recursive "$MODPATH/system/vendor" 0 2000 0755 0644 "u:object_r:vendor_file:s0" + set_perm "$MODPATH/system/vendor/lib/hw" 0 2000 0755 "u:object_r:vendor_hal_file:s0" + set_perm "$MODPATH/system/vendor/lib/hw/camera.qcom.so" 0 0 0644 "u:object_r:vendor_file:s0" + [ -f "$MODPATH/system/vendor/lib/hw/com.qti.chi.override.so" ] && set_perm "$MODPATH/system/vendor/lib/hw/com.qti.chi.override.so" 0 0 0644 "u:object_r:vendor_file:s0" + if $IS64BIT; then + set_perm "$MODPATH/system/vendor/lib64/hw" 0 2000 0755 "u:object_r:vendor_hal_file:s0" + set_perm "$MODPATH/system/vendor/lib64/hw/camera.qcom.so" 0 0 0644 "u:object_r:vendor_file:s0" + [ -f "$MODPATH/system/vendor/lib64/hw/com.qti.chi.override.so" ] && set_perm "$MODPATH/system/vendor/lib64/hw/com.qti.chi.override.so" 0 0 0644 "u:object_r:vendor_file:s0" + fi + fi else ui_print "- Installing from recovery"