Reputation: 175
I am trying to figure out how to compile the AOSP with superuser. I was pointed to this question: Build Android with Superuser. The instructions seem a little unclear and I also do not understand exactly what is going on. It also seems to talk about this allowing su privileges on android apps. I am not trying to get this on apps. I was trying to have root access when running some code in the main android source(specifically trying to open a socket in DisplayDevice.cpp).
I have asked a similar question here(Create a socket in android code(not in android application) getting Permission Denied). I figured that since I was put on the right track and now know that I need to compile the code as superuser, I should just ask another question.
I have added the su-binary code to my AOSP code as per instructions from the first SO question. I have also changed my init.rc, but am under the impression that I need to do something to make those changes go through as well. This is not talked about in the question. Right now when I run make su-binary I get "make: Nothing to be done for `su-binary'.". I think something was wrong here. I am using the makefile specified by m-ric. I also was not sure if I needed the Superuser.apk since I am not working with code that will be found in an Android app.
If anyone could point me in the right direction for this I would be really grateful. I am happy to provide more information if needed.
Upvotes: 2
Views: 1686
Reputation: 79
Right now when I run make su-binary I get "make: Nothing to be done for `su-binary'."
An example how to change su.c can be found here: https://code.google.com/p/aosp4nexus5/wiki/AOSPforNexus5#Debugging_a_C_file
Actually only logging is added, but it is the same as changing setgid() and setuid() calls. :-)
Upvotes: 0
Reputation: 20936
Actually, I can explain how to build Android with Superuser but I think you do not this for your task. The problem is that the process that runs the code of DisplayDevice.cpp
does not belong to inet group (usually gid = 3003).
I'm not familiar with display system of Android but if you want to just experiment I would recommend you the following steps.
Upvotes: 1