Android 5.x 权限问题解决方法
2018-02-02 10:24
447 查看
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固件.
# 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固件.
相关文章推荐
- Android 5.x 权限问题解决方法
- Android 5.x 权限问题解决方法
- Android 5.x 权限问题解决方法
- Android 5.x 权限问题解决方法
- Android 5.x 权限问题解决方法
- Android 5.x 权限问题解决方法
- Android 5.x 权限问题解决方法
- Android 5.x 权限问题解决方法
- Android 5.x 权限问题解决方法
- Android 5.x SELiunx 权限问题解决方法
- Android 6.0 权限问题解决方法
- Android 5.x 权限问题解决方法
- Android SeLinux权限问题和解决方法
- Android SELinux avc dennied权限问题解决方法
- Android SeLinux权限问题和解决方法
- Android SELinux avc dennied权限问题解决方法
- 没有权限使用网络资源问题的解决方法
- 编译 Android-2.1出现的问题,和解决方法。
- [原]用Eclipse开发Android应用,用svn管理源码时遇到的问题及解决方法
- Android平台上面输入法遮挡问题的解决方法