When compiling the user version, you often encounter problems with SELinux permissions that require a feature to be turned on, and here's an example of how to add an application's permissions.
The following example takes the Intel platform Cherrytrail android6.0.1 as an example;
One, add the writing sepolicy under the Te file:
1. The file path is:/device/intel/sepolicy/;
2. Add Folder Tinymix
3. CD Tinymix
4. Add edit a file under this folder file_contexts;
/system/bin/tinymix U:object_r:tinymix_exec:s0
5. Add edits to another file under this folder Tinymix.te; The file name must be the same as the real command;
# Tinymix
type tinymix, domain;
Type tinymix_exec, Exec_type, File_type;
Init_daemon_domain (tinymix)
allow Tinymix system_file:file {Execute_no_trans};
Allow Tinymix proc:file {Execute_no_trans};
Second, add compilation settings in another place, and if you do not add this setting, you cannot be compiled into the system.
The code path is:/DEVICE/INTEL/CHERRYTRAIL/R2_CHT_FFD/BOARDCONFIG.MK, the code is as follows:
Board_sepolicy_dirs + + Device/intel/sepolicy/tinymix