Problem deleting system files

great_mirko

Member
Licensed User
Longtime User
Hello to all.
So, I need a your hand.
I'm making an app to change the bootanimation, and I need to delete the old one and copy the one chosen by the user.

I used a script to get the correct permissions for root and use this function to delete:

File.Delete("/system/media/", "bootanimation.zip")

The problem is that it gets root permissions, but does not delete the file.
I tried the same function on a SD card files and working properly. How can I do? Thank you very much ..:sign0013::sign0013:
 

great_mirko

Member
Licensed User
Longtime User
You should create a script and run it with shell: Running shell commands as SuperUser

Erel Hello, thanks for the reply. Then the script I entered it correctly in the button. In fact, root permissions I get them. The problem is that I do not delete the file ...
This is the complete code of the button:

B4X:
Runner = File.Combine(File.DirInternalCache, "runner")
   Command = File.Combine(File.DirInternalCache, "command")
   File.WriteString(File.DirInternalCache, "runner", "su < " & Command)
   File.WriteString(File.DirInternalCache, "command", "modprobe cifs" & CRLF & "modprobe aufs" & CRLF & "exit") 'Any commands via crlf, and exit at end 
   Result = Ph.Shell("sh", Array As String(Runner), StdOut, StdErr)
   Msgbox(StdOut.tostring, "")
File.Delete("/system/media/", "bootanimation.zip")
 
Last edited:
Upvote 0
Top