Granting root access to Android system app

1,289 views
Skip to first unread message

Edd Barker

unread,
Apr 10, 2017, 9:59:40 AM4/10/17
to android-platform

I'm trying to restart a module from an Android system app, but I can't get it run because su doesn't allow for system apps.


I tried modifying su to set system apps as root but it still gives me permission error.

if(myuid == AID_SYSTEM) {
    myuid = AID_ROOT;
}

Does anyone know how I can run a root command from a system app? I have full access to the AOSP and root access from command line.


Thanks, Edd

biAji

unread,
Apr 12, 2017, 10:41:07 AM4/12/17
to android-platform
You can not simply give your self root uid in this way.   

check this out:  https://su.chainfire.eu/

Xu Koffu

unread,
Apr 13, 2017, 10:45:49 AM4/13/17
to android-platform
I'm not sure it can work, you can follow this attr in AndroidManifest.xml
android:sharedUserId="android.uid.system"
It will be modify PackageManagerService.java
ROOT_UID




在 2017年4月10日星期一 UTC+8下午9:59:40,Edd Barker写道:
Reply all
Reply to author
Forward
0 new messages