10

Question :

How to execute one complete app with root previleges (not just few commands)?


Scenario :

I am working on a rooted android device.

In an android app, I need to play the H.264 stream received through eth0. I need root privileges to open (raw open) eth0.

The corresponding code is in JNI. Since there are a lot of buffers that need to be exchanged between JNI code and Java code, the executable way(Process.exec(su)) is very inconvenient.


Ideal solution:

The JNI code is executed in the same process context as of the Java code. Therefore, granting root privileges to my android process should solve my problem. But I am not sure how to do that.


I tried :

  1. Making the application as system app/priv-app. I thought this will give the app root access. But that did not happen.
Sandeep
  • 18,356
  • 16
  • 68
  • 108

1 Answers1

0

Try moving your application from /system/app to /system/priv-app.

Applications in /system/priv-app will have system level access.

/system is read-only without root so it prevents uninstalling applications from /system/app and /system/priv-app. Applications that are critical are put there so that they can't be uninstalled.

/system/priv-app allows apps installed there to use signatureOrSystem and other privileged permissions.

arungiri_10
  • 988
  • 1
  • 11
  • 23