实例演示

关闭和启动init.rc中的console 服务

service console /system/bin/sh
    class core
    console
    disabled
    user shell
    group log

启动和停止init.rc中的服务

 

代码实现

shell :

setprop ctl.start service_name

setprop ctl.stop service_name

JNI:

property_set("ctl.start", service_name);

property_set("ctl.stop", service_name);

 

权限

uid == AID_SYSTEM || uid == AID_ROOT

参见 system/core/init/property_service.c中check_control_perms函数
--------------------- 
作者:aeolia的围脖 
来源:CSDN 
原文:https://blog.csdn.net/aeolia_zhang/article/details/20126031 
版权声明:本文为博主原创文章,转载请附上博文链接!

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
  • 2021-07-15
  • 2021-12-27
猜你喜欢
  • 2022-12-23
  • 2021-12-28
  • 2021-05-28
相关资源
相似解决方案