-1

Hi so my application runs some commands using the su in android root.

It works fine in JellyBean on the Galaxy Nexus but when I try to run it on the LG Nexus 5 (kitkat), I get an error saying:

su: uid 10069 not allowed to su

I'm not really sure what I'm missing here. I have root access (it runs su fine on the Galaxy Nexus).

Basically the application reads in a command from a TextEdit, strips it, appends the necessary parameters etc. and then calls the script which is put on the phone. I use the ProcessBuilder to build the call for the script.

Any fixes or ideas as to where I should look would be appreciated. Thank you

asm
  • 837
  • 1
  • 16
  • 41
  • This looks very much like the error message which the *stock* `su` on old Android versions would invariably provide, as *it was never intended* to allow unprivileged users to run privileged tasks. However I think the stock Android `su` vanished well before kitkat. Another possibility is that you do have a "hacked" `su` which would be usable, except that your human user has declined to authorize your app to use it (or its authorization method is broken, for example, perhaps the app providing the authorization UI is missing). Is this device actually (and fully) rooted? – Chris Stratton Apr 01 '14 at 16:54
  • Yea I've been looking into the issue and this is what I have so far. I can run the "su" command when I access the phone(Nexus 5) using the adb shell command but when I try to use the "su" command on a terminal emulator application it gives me the uid error. The terminal emulator works fine for the Galaxy Nexus – asm Apr 01 '14 at 17:11
  • Your question is rather incomplete though. Is the device actually rooted? Can any other app on it use `su`? Can you use it from the adb shell? – Chris Stratton Apr 01 '14 at 17:12
  • Yes, like I said, the adb shell works but not other apps (like the terminal emulator). I'm assuming then that I have to replace the su? – asm Apr 01 '14 at 17:13
  • What exactly is installed on your device? If you have a user build of kitkat, you won't have a /system/xbin/su but if you have an engineering build you may have one, that is not usable by apps. Otherwise you have some 3rd party hack, of unknown origins and properties. – Chris Stratton Apr 01 '14 at 17:19
  • Rooted using SuperSu. I installed a custom app which tries to run the su commands. The /system/xbin/su definitely exists but unusable by apps which is the problem I'm trying to fix. I apologize for not being clear enough, I don't have much experience with su and rooting – asm Apr 01 '14 at 17:40
  • This sounds like it's probably a support question for whatever tool or guide you used to "root" your device. Generally, Android end-user configuration problems belong on Android.stackexchange rather than here, and as you are basically and "end user" from the perspective of the root hacking tool, it may be you really should ask there, or ask the tool's authors. It's not really making sense where your `su` came from - if you have an engineering build it shouldn't be usable by apps, but then it seems you got it from a hacking tool, in which case the point is probably for it to be. – Chris Stratton Apr 01 '14 at 18:14
  • That makes sense to me, I definitely want it to be usable by apps at this point, moving forward probably not. Thanks a lot! – asm Apr 01 '14 at 18:59

2 Answers2

0

The issue was SuperSu not being properly installed and granting permission to the application. Once I changed that there were no permissions issues.

asm
  • 837
  • 1
  • 16
  • 41
0

If you have problem with rooting to super user.

You can use "run-as" command to access files of your application.

ex: run-as com.your.package

It will drop you to the shell@android:/data/data/com.your.package $

now you can use commands ls Then it will display the list of file folders

  cache
  databases
  lib
  shared_prefs
Jyoti Prakash
  • 3,921
  • 3
  • 21
  • 24