美文网首页
android系统selinux中添加新属性property

android系统selinux中添加新属性property

作者: 辉色投像 | 来源:发表于2019-10-31 20:19 被阅读0次

    1.定位/android/system/sepolicy/private/property_contexts

    声明属性开头:persist.charge     声明属性类型: u:object_r:system_prop:s0

    图1

    2.定位到android/system/sepolicy/public/domain.te

    删除neverallow { domain -init } default_prop:property_service set;

    3.定位到android/system/sepolicy/public/system_app.te添加set 权限(我的是system app)

    allow system_app default_prop:property_service set;

    4.新property使用

    设置属性:SystemProperties.set("persist.charge.demo", "3.6");

    获取属性:SystemProperties.get("persist.charge.demo");

    相关文章

      网友评论

          本文标题:android系统selinux中添加新属性property

          本文链接:https://www.haomeiwen.com/subject/rytxbctx.html