0

I'm trying to copy files from /system/lib/hw folder to another folder (in device storage).
I have root and I use the following code to do that:

Runtime.getRuntime().exec("su -c cat source > destination");

The files get copied but are empty. Is there another way to do it? copying other files using this code succeeds, this only happens for files in /system/lib/hw directory.

Oren
  • 937
  • 1
  • 10
  • 34
  • do you already give root permission to your application? – Randyka Yudhistira Apr 14 '15 at 08:08
  • possible duplicate of [How to make a copy of a file in android?](http://stackoverflow.com/questions/9292954/how-to-make-a-copy-of-a-file-in-android) It doesn't matter do you have root or not this code should work. If you don't have root access you will get an exception. – Viktor Yakunin Apr 14 '15 at 08:09
  • Yes, the issue is not with root as all other copy operations succeed, only files from /system/lib/hw are copied empty – Oren Apr 14 '15 at 08:10
  • This is not a duplicate, I can copy files from other directories. The issue is that files are copied empty – Oren Apr 14 '15 at 08:11
  • I'm not a linux expert , but that folder has references to mounted devices - camera, usb devices, etc... so they doesn't contain no bytes, just streams... so you can use them to get images from mounted camera and other hardware related stuff... – Viktor Yakunin Apr 14 '15 at 08:15
  • Thanks, I am not a Linux expert either, do you know of some example on how to do that? – Oren Apr 14 '15 at 08:25

0 Answers0