Android框架层添加自定义服务

1.添加自定义服务
可参考该文章:http://processors.wiki.ti.com/index.php/Android-Adding_SystemService
非常清晰

2.添加服务后出现的问题
1)出现”add_service(‘privacy’,1c) uid=1000 - PERMISSION DENIED”这种问题,该问题就是不让你添加自己的服务,为什么呢?因为自从android4.0以后引入了MAC机制,selinux不允许你添加不符合规范的服务.
如何解决呢?
在自定义服务的名称前面加上现有服务名称作为前缀就可以了(通过大量的google).
试试吧
喜欢看英文的可以该贴:http://forum.xda-developers.com/xposed/devs-how-to-selinux-restrictions-t2775101/page8

3.编译指令

Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:
   lunch:   lunch <product_name>-<build_variant>
   tapas:   tapas [<App1> <App2> ...] [arm|x86|mips|armv5] [eng|userdebug|user]
   croot:   Changes directory to the top of the tree.
   m:       Makes from the top of the tree.
   mm:      Builds all of the modules in the current directory, but not their dependencies.
   mmm:     Builds all of the modules in the supplied directories, but not their dependencies.
            To limit the modules being built use the syntax: mmm dir/:target1,target2.
   mma:     Builds all of the modules in the current directory, and their dependencies.
   mmma:    Builds all of the modules in the supplied directories, and their dependencies.
   cgrep:   Greps on all local C/C++ files.
   jgrep:   Greps on all local Java files.
   resgrep: Greps on all local res/*.xml files.
   godir:   Go to the directory containing a file.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值