3,申请权限。
系统app:/device/mediatek/common/sepolicy/system_app.te
第三方app:/device/mediatek/common/sepolicy/untrusted_app.te
或者根据log提示对应的地方增加申请权限,连接adb后,
用命令:dmesg | grep avc 获取日志。
如: avc: denied { read } for pid=2478 comm="jw.ComAssistant" >name="ttymxc1" dev="tmpfs" ino=5327 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:device:s0 tclass=chr_file permissive=0
scontext == 》 对应的就是需要添加权限的app类型。
这里就是第三方app,我们在对应文件增加:
allow untrusted_app tty_device_file:chr_file rw_file_perms;
make installclean -j12;make -j12 重新编译代码。
如果编译出错,就clean重编一次。