0

I'm currently using RootTools to try and move and file that's downloading into the Downloads Folder into the System Directory

Command command = new Command(0, "cp -f " + Environment.DIRECTORY_DOWNLOADS +"/old.html" + " /system/new.html");
RootTools.getShell(true).add(command);

But for whatever reason, this doesn't actually work .

Any ideas?

  • its a security measure . I would have questioned android if you could have done that. – nafas Feb 08 '16 at 09:54
  • @nafas I don't understand? It's enabling Root and executing a command through that? – IdkHowToCodeAtAll Feb 08 '16 at 09:55
  • 1
    try this mate, grab a terminal emulator and create a file in `/system` e.g. `touch hello.html`, if your device is rooted I believe it won't give error but the file won't be created either – nafas Feb 08 '16 at 10:00
  • Damn. You're right. Then how could I make an APP that moves a file into /system? https://stackoverflow.com/questions/35197618/android-download-manager-save-to-system?noredirect=1#comment58114174_35197618 – IdkHowToCodeAtAll Feb 08 '16 at 10:08
  • I don't know the logic of how the /system is been protected, but one thing I know, the only way to do what you want, is to basically completely hack ur system (e.g by installing a custom kernel) – nafas Feb 08 '16 at 10:15
  • its because the core security of mobile system is to be able to protect such folders – nafas Feb 08 '16 at 10:16
  • @nafas Is /system/fonts as protected as just /system? – IdkHowToCodeAtAll Feb 08 '16 at 10:18
  • not sure but I think everything under `/system` is protected, you can test it by trying to create a file in it and see if it work. e.g `touch /system/fonts/test` then `ls /system/fonts/test` to see if its there. – nafas Feb 08 '16 at 10:28
  • If it says read only file system, does that mean no go? But I know for a fact there are some apps that do stuff to /system/fonts =/ – IdkHowToCodeAtAll Feb 08 '16 at 10:30
  • oh, if its read only, it means that's how its been mounted, i'll be surprize if those app can directly manupluate the files in /system – nafas Feb 08 '16 at 11:28

1 Answers1

1

The reason it wasn't working was because /system is mounted as read-only. I had to remount it with this

mount -o remount,rw /system