Sub Log2USB(LogText As String)
Dim su As SuShell
Dim process As SuProcess = su.Execute("ls /mnt/media_rw/")
process.WaitForCompletion
If process.Success Then
For i = 0 To process.Response.Length - 1
Dim line As String = process.Response(i)
If line.Length > 0 Then
Dim Timestamp As String = DateTime.Date(DateTime.Now) & " " & DateTime.Time(DateTime.Now)
Dim command As String = $"echo "${Timestamp}: ${LogText}" >> /mnt/media_rw/${line}/SystemLog.txt"$
su.Execute(command)
Exit
End If
Next
End If
End Sub