'Activity module
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 rc As RootCmd
Dim btninstall As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
btninstall.Initialize("btn")
btninstall.Text="Install Apk"
Activity.AddView(btninstall,0,0,-2,-2)
End Sub
Sub btn_Click
If rc.haveRoot Then
File.Copy(File.DirAssets,"testapk.apk",File.DirRootExternal,"testapk.apk") 'copy to sdcard because the assets dir is readable only this application
If rc.InstallApk(File.DirRootExternal&"/testapk.apk") Then
Msgbox("install ok","success")
Else
Msgbox("install error","error")
End If
Else
Msgbox("there is no root!","need Root")
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub