I'm trying to run some secure (internal) api calls, and I'm obviously getting security exceptions:
java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.provider.Telephony.SPN_STRINGS_UPDATED from pid=24864, uid=10107
I'm trying to run the same call from root, but I'm not sure if it's possible in the first place. I can of course get the root permissions like this:
Process p = Runtime.getRuntime().exec("su");
But it doesn't seem to do the trick. I'm getting the same security exception. One of the samples I've seen tries to wait for the su
call to finish first, as follows:
Process p = Runtime.getRuntime().exec("su");
p.waitFor();
but that didn't help me either. What am I doing wrong then? Is it possible to do at all?
If it's important, I'm trying to get an instance of the com.android.internal.telephony.Phone class, using the PhoneFactory (getting them with reflection). Getting reflection out of the way, it would look something like this:
// Initialize the telephony framework
PhoneFactory.makeDefaultPhones(this);
// Get the default phone
Phone phone = PhoneFactory.getDefaultPhone();