File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -71,4 +71,14 @@ find $InstallDir/etc/default-permissions -type f -exec chcon --reference=$Instal
7171find $InstallDir /etc/preferred-apps -type f -exec chcon --reference=$InstallDir /etc/fs_config_dirs {} \;
7272find $InstallDir /etc/sysconfig -type f -exec chcon --reference=$InstallDir /etc/fs_config_dirs {} \;
7373
74- echo " !! Apply completed !!"
74+ echo " Applying SELinux policy"
75+ # Sed will remove the SELinux policy for plat_sepolicy.cil, preserve policy using cp
76+ cp $InstallDir /etc/selinux/plat_sepolicy.cil $InstallDir /etc/selinux/plat_sepolicy_new.cil
77+ sed -i ' s/(allow gmscore_app self (process (ptrace)))/(allow gmscore_app self (process (ptrace)))\n(allow gmscore_app self (vsock_socket (read write create connect)))\n(allow gmscore_app device_config_runtime_native_boot_prop (file (read)))/g' $InstallDir /etc/selinux/plat_sepolicy_new.cil
78+ cp $InstallDir /etc/selinux/plat_sepolicy_new.cil $InstallDir /etc/selinux/plat_sepolicy.cil
79+ rm $InstallDir /etc/selinux/plat_sepolicy_new.cil
80+
81+ # Prevent android from using cached SELinux policy
82+ echo ' 0000000000000000000000000000000000000000000000000000000000000000' > $InstallDir /etc/selinux/plat_sepolicy_and_mapping.sha256
83+
84+ echo " !! Apply completed !!"
You can’t perform that action at this time.
0 commit comments