Android 7.1.1中SystemProperties详解
https://blog.csdn.net/yin1031468524/article/details/67640786
另外,如果满足了上面的条件,如果设置 属性但是没有生效,可能是权限问题
通过 adb shell dmesg 分析如下log,可以看到是缺乏 Te权限,加上就可以。
[ 172.608096] init: avc: denied { set } for property=persist.nfc.broadcast.disable pid=5954 uid=1000 gid=1000 scontext=u:r:system_app:s0 tcontext=u:object_r:default_prop:s0 tclass=property_service permissive=0
[ 172.608130] init: sys_prop: permission denied uid:1000 name:persist.nfc.broadcast.disable
[ 172.609701] init: avc: denied { set } for property=persist.nfc.broadcast.disable pid=5954 uid=1000 gid=1000 scontext=u:r:system_app:s0 tcontext=u:object_r:default_prop:s0 tclass=property_service permissive=0
修改方法:
\system\sepolicy\system_app.te
allow system_app default_prop:property_service set;