与AOSP工作 [英] Working with AOSP

查看:188
本文介绍了与AOSP工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 AOSP 。我已经成功地将我的APK建设。现在,我想给root访问我的应用程序。我不想提供root访问其他应用程序,或者在我的体型安装超级用户的应用程序。我只想补充我的应用程序,以获得root权限。我怎样才能做到这一点?

I'm working on AOSP. I've successfully added my apk to build. Now I want to give root access to my app. I don't want to provide root access to other apps or to install the Superuser app in my build. I just want to add my app to get root access. How can I achieve that?

我通过去在 su.c 路径文件中的系统/演员/苏,但我无法了解整个code。

I went through the su.c file in path system/extras/su but I'm unable to understand the whole code.

当我通过code去了,我想我的目标就可以实现,如果我能修改 su.c 以提供根访问我的应用程序,编译它,并添加二进制的构建。我说得对?

When I went through the code, I think my objective can be achieved if I could modify su.c to provide root access to my app,compile it and add the binary to the build. Am I right?

推荐答案

您正在朝着正确的方向前进。您需要检查源 su.c ,你可以面对的唯一问题是如何运行你的程序作为根。要做到这一点,你需要设置SUID粘着位的应用程序的可执行文件。要做到这一点,你需要修改系统/核心/有/私营/ android_filesystem_config.h 文件(结构 android_files [] ),例如用于苏程序,你可以看到该位设置:

You're moving in the right direction. You need to check the sources for su.c The only problem that you can face is how to run your program as root. To do this you need to set SUID sticky bit for the executable of your application. To do this you need to modify system/core/include/private/android_filesystem_config.h file (structure android_files[]), for instance for su program you can see how this bit is set:

{ 06755, AID_ROOT,      AID_ROOT,      "system/xbin/su" },

这篇关于与AOSP工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆