Help with files in data/data location

giga

Well-Known Member
Licensed User
Longtime User
Does anyone have a code to reference a file in the /data/data/app-name/files location to run a command?

Tried this code but no luck :BangHead:

B4X:
Dim Command, Runner As String
Dim StdOut, StdErr As StringBuilder
Dim Result As Int
Dim Ph As Phone
Runner = File.Combine(File.DirInternalCache, "runner")
Command = File.Combine(File.DirInternalCache, "command")
File.WriteString(File.DirInternalCache, "runner", "su < " & Command)
File.WriteString(File.DirInternalCache, "command", "/data/data/app-name/files/commandfile" & 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, "")

Thanks for any Help or suggestions.
 
Last edited:
Top