I'm writing an app that will use su
to execute some commands in the linux kernel. I was wondering how SuperUser figures out that the application is asking for root privileges ? Also, are there any known ways (through obfuscation) in which this check can be bypassed ?
In other words: How does Android/(SuperUser) know that an app requires root privileges despite the fact that there are no permissions explicitly requested in the android manifest file.
I'm asking this question from a security standpoint. I want to know the details of how this works in order to be sure that a malicious app cannot bypass SuperUser.
su
broadcasts a message asking for Superuser.apk to tell wether it should allow root access or not. So I'm wondering, what prevents another app to respond to that request instead of Superuser.apk? (which would be a huge vulnerability if that was possible, so I guess it's not ; just curious) Also, what protection exists to prevent an app from requesting root under a false name? (i.e. malicious.apk requesting root under the name of awesome-root-only-app.apk to trick the user into giving access) – Musicology