1

I want to know how to read files placed in root folder. For instance let's take file /init.trace.rc. When I'm trying to read it I get exception:

java.io.FileNotFoundException: /init.trace.rc: EACCES (Permission denied)

I thought that I need to get superuser access. I did it but that made no difference ((( I still can't read it. Could anybody help me? ...and also I wonder how file explorers like "RootExplorer" read that stuff?

YS-L
  • 14,358
  • 3
  • 47
  • 58
iamarkadyt
  • 2,740
  • 2
  • 13
  • 13
  • You need to add root permissions to your app – John Apr 22 '14 at 16:46
  • possible duplicate of [How can I get root permissions through the Android SDK?](http://stackoverflow.com/questions/5293615/how-can-i-get-root-permissions-through-the-android-sdk) – John Apr 22 '14 at 16:47

1 Answers1

1

apparently this is all you need to run to get root access:

Process root = Runtime.getRuntime().exec("su");

taken from:

Community
  • 1
  • 1
John
  • 3,769
  • 6
  • 30
  • 49
  • 1
    That or use RootTools library from Stericson. Keep in mind the device will NEED to be rooted. – shkschneider Apr 22 '14 at 17:00
  • My device is rooted and as I said above I requested root permissions and got them. But when I tried again to read that file I got the same exception!!! (( – iamarkadyt Apr 23 '14 at 05:12