Android 5.x 权限问题解决方法
发布日期:2021-07-22 21:24:38 浏览次数:6 分类:技术文章

本文共 703 字,大约阅读时间需要 2 分钟。

1.从android5.x开始,引入严格的selinux权限管理机制,经常会遇到各种avc denied的Log。  
 # adb shell cat /proc/kmsg | grep avc
 # adb shell dmesg | grep avc 
 # adb logcat | grep avc
解决原则是:缺什么补什么,一步一步补到没有avc denied为止。   
2.Log解决:
 audit(0.0:67): avc: denied { write }for path="/dev/block/vold/93:96" dev="tmpfs" ino=1263 scontext=u:r:kernel:s0 tcontext=u:object_r:block_device:s0tclass=blk_file permissive=0  
分析过程: 
缺少什么权限:           { write }权限, 
谁缺少权限:             scontext=u:r:kernel:s0, 
对哪个文件缺少权限:tcontext=u:object_r:block_device 
什么类型的文件:        tclass=blk_file  
解决方法:kernel.te 
# allow kernel block_device:blk_file write; 
3.万能套用公式:  
                       scontext(进程名)  tcontext(安全上下文)      tclass(访问类型)    avc denied(访问权限)
             allow     kernel           block_device       :    blk_file          write
重新编译:make bootimage,重新烧写boot.img固件.  

转载地址:https://blog.csdn.net/menghaocheng/article/details/79235950 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:pandas.DataFrame对象的创建
下一篇:【Axiso跨域问题】

发表评论

最新留言

很好
[***.229.124.182]2024年04月22日 09时19分29秒