Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim OS As OperatingSystem
Dim BT As BluetoothAdmin
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Activity.LoadLayout("BT")
BT.Initialize ("BT")
End Sub
Sub BT_StateChanged (NewState As Int, OldState As Int)
Dim Command, Runner As String
Dim StdOut, StdErr As StringBuilder
Dim Result As Int
Dim Ph As Phone
StdOut.Initialize
StdErr.Initialize
If NewState = 10 AND OldState = 11 Then
Runner = File.Combine(File.DirInternalCache, "runner")
Command = File.Combine(File.DirInternalCache, "command")
File.WriteString(File.DirInternalCache, "runner", "su < " & Command)
File.WriteString(File.DirInternalCache, "command", "mount -o remount,rw /system")
Result = Ph.Shell("sh", Array As String(Runner), StdOut, StdErr)
Msgbox(StdOut.tostring, "") ' got nothing
Dim FilesToDelete As List
FilesToDelete.Initialize
FilesToDelete.AddAll(File.ListFiles("/data/data/com.android.bluetooth"))
For i = 0 To FilesToDelete.Size -1
File.Delete("/data/data/com.android.bluetooth", FilesToDelete.Get(i))
Next
OS.killBackgroundProcesses ("com.android.bluetooth")
Msgbox("Hi!", "")
End If
End Sub