linux java串口读写权限,在MTK Android 7.0 SELinux中给ublox串口加上读写权限

平台:MT6735 Android版本:7.0

u-blox.conf中定义串口为:

SERIAL_DEVICE                  /dev/ttyMT3

没有给串口加上权限前,出现以下log:

[212:logd.auditd]type=1400 audit(1420070619.170:645332): avc: denied { read write } for pid=1822 comm=67707320746872656164 name="ttyMT3" dev="tmpfs" ino=6437 scontext=u:r:system_server:s0 tcontext=u:object_r:ttyMT_device:s0 tclass=chr_file permissive=0

解决方法:

./system/sepolicy/file_contexts:146:/dev/ttyMT3 u:object_r:ublox_serial_device:s0

./system/sepolicy/device.te:105:type ublox_serial_device, dev_type;

./system/sepolicy/domain.te:147:allow domain ublox_serial_device:chr_file rw_file_perms;

./system/sepolicy/system_server.te:541:allow system_app ublox_serial_device:chr_file rw_file_perms;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值