-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathoi.b4a
447 lines (328 loc) · 11.8 KB
/
oi.b4a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
Build1=Default,ch.waut
File1=20160813_151619_ii.jpg
File10=haveged
File11=haveged-COPYING
File12=Main.bal
File13=NOLICENSE
File14=sqlite3
File15=sqlite-LICENSE.md
File2=busybox
File3=busybox-LICENSE
File4=cb.sh
File5=cb_init.sh
File6=cb_io.sh
File7=cb_networking.sh
File8=cb_runhaveged
File9=cb_weekly.sh
FileGroup1=Default Group
FileGroup10=Default Group
FileGroup11=Default Group
FileGroup12=Default Group
FileGroup13=Default Group
FileGroup14=Default Group
FileGroup15=Default Group
FileGroup2=Default Group
FileGroup3=Default Group
FileGroup4=Default Group
FileGroup5=Default Group
FileGroup6=Default Group
FileGroup7=Default Group
FileGroup8=Default Group
FileGroup9=Default Group
Group=Default Group
IconFile=
Library1=core
Library2=clocks
Library3=b4arootcmd
Library4=mlfiles
Library5=accessibility
ManifestCode='This code will be applied to the manifest file during compilation.~\n~'You do not need to modify it in most cases.~\n~'See this link for for more information: http://www.basic4ppc.com/forum/showthread.php?p=78136~\n~AddManifestText(~\n~<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="29"/>~\n~<supports-screens android:largeScreens="true" ~\n~ android:normalScreens="true" ~\n~ android:smallScreens="true" ~\n~ android:anyDensity="true"/>)~\n~SetApplicationAttribute(android:icon, "@drawable/icon")~\n~SetApplicationAttribute(android:label, "$LABEL$")~\n~'End of default text.~\n~AddPermission("android.permission.ACCESS_SUPERUSER")~\n~AddPermission("android.permission.WRITE_SECURE_SETTINGS")~\n~RemovePermission("android.permission.WAKE_LOCK")~\n~'RemovePermission("android.permission.WRITE_EXTERNAL_STORAGE")~\n~'RemovePermission("android.permission.READ_EXTERNAL_STORAGE")~\n~
Module1=wautch_service
Module2=Schedule
NumberOfFiles=15
NumberOfLibraries=5
NumberOfModules=2
Version=8.3
@EndOfDesignText@
#Region Project Attributes
#ApplicationLabel: waut.ch!
#VersionCode: 169
#VersionName: 336b594c-141c-4036-ad3d-7e024d1706ae
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: True
#IncludeTitle: False
#End Region
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 Aclock As AnalogClock
Dim rc_main As RootCmd
' Dim fs_main As MLfiles
Private Panel1 As Panel
Private Label1 As Label
Private Button2 As Button
Private CheckBox1 As CheckBox
Private Button1 As Button
Dim time_I, time_II, time_III, time_IV As Long
End Sub
Sub random12() As Int
If(Rnd(1,64) <= 32 ) Then
Return 2
Else
Return 1
End If
End Sub
Sub random13() As Int
If(Rnd(1,64) > 0 ) And (Rnd(1,64) <= 18 ) Then
Return 2
End If
If(Rnd(1,64) > 18 ) And (Rnd(1,64) <= 36 ) Then
Return 3
End If
If(Rnd(1,64) > 36 ) And (Rnd(1,64) <= 64 ) Then
Return 1
End If
End Sub
Sub SetRandom_Local()
'Put throw
'Put choose
Dim i,j As Int
Dim random As Long
For j = 1 To 64
For i = 1 To 64
If(Rnd(1,64) > 30 ) Then
random = Rnd(1,1+Rnd(1,922337203685477))
random = Rnd(1+random12,9-random12)
random = Rnd(1+random12,9-random12)
random = random13
End If
Next
' random = random - Rnd(1+random12,9-random12) * Power(Rnd(1+random12,9-random12),i+1-random12)
For i = 1 To 64
If(Rnd(1,64) < 30 ) Then
random = Rnd(1,1+Rnd(1,922337203685477))
random = Rnd(1+random12,9-random12)
random = Rnd(1+random12,9-random12)
random = random13
Label1.TextSize = 18 - random13
Label1.Text = Rnd(1,64)
End If
Next
Label1.TextSize = 18 - random13
Label1.Text = Rnd(1,64)
i = random13
Label1.Top = Activity.Height / 2
i = random13
Label1.Left = Activity.Width / 2 - 40
Next
Label1.TextSize = 18 - random13
Label1.Text = Rnd(1,64)
End Sub
Sub Activity_Create(isFirst As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Main")
Activity.Title = "waut.ch! running... ? for help, space to clear page"
Aclock.Initialize("Aclock")
' Activity.AddView(Aclock, 200dip, 110dip, 100dip, 100dip)
Activity.AddView(Aclock, 0dip, 0dip, 100dip, 100dip)
' Activity.AddView(Aclock, DipToCurrent(Activity.Height / 2), DipToCurrent(Activity.Width / 2 - 40), 100dip, 100dip)
Aclock.Color = Colors.Transparent
Aclock.Visible = True
Panel1.SendToBack
Label1.Top = Activity.Height / 2
Label1.Left = Activity.Width / 2 - 40
Label1.BringToFront
rc_main.haveRoot
' fs_main.GetRoot
Label1.TextSize = 18 - random13
Button2.TextSize = 14
If rc_main.haveRoot = False Then
' fs_main.GetRoot
ToastMessageShow("root not found...",True)
Else
' fs_main.Copy(File.DirAssets,"busybox",File.DirInternal,"/busybox")
' fs_main.chmod(File.DirInternal & "busybox",755)
' fs_main.Touch(File.DirInternal & "/TOUCH")
' fs_main.chmod(File.DirInternal & "/TOUCH", 755)
' fs_main.RootCmd("/system/xbin/su", " - shell -c /system/xbin/su -c id > " & File.DirInternal & "/TOUCHFS",Null,Null,True)
' fs_main.RootCmd("echo", " -c id > " & File.DirInternal & "/TOUCHF1",Null,Null,True)
' fs_main.RootCmd("/system/xbin/su", " - shell -c chmod 755 " & File.DirInternal & "/TOUCHFS",Null,Null,True)
' fs_main.RootCmd("/system/xbin/su", " -c chmod 755 " & File.DirInternal & "/TOUCHF1",Null,Null,True)
' fs_main.RootCmd("/system/xbin/su", " - shell -c toolbox chmod 755 " & File.DirInternal & "/TOUCHFS",Null,Null,True)
' fs_main.RootCmd("/system/xbin/su", " -c toolbox chmod 755 " & File.DirInternal & "/TOUCHF1",Null,Null,True)
' fs_main.RootCmd("/system/xbin/su", " - shell -c toybox chmod 755 " & File.DirInternal & "/TOUCHFS",Null,Null,True)
' fs_main.RootCmd("/system/xbin/su", " -c toybox chmod 755 " & File.DirInternal & "/TOUCHF1",Null,Null,True)
' rc_main.execRootCmdSilent("su - shell -c su -c id > " & File.DirInternal & "/TOUCH")
' rc_main.execRootCmdSilent("su -c id >> " & File.DirInternal & "/TOUCH")
' rc_main.execRootCmdSilent("su - shell -c su -c toolbox chmod 755 " & File.DirInternal & "/TOUCH")
' rc_main.execRootCmdSilent("su - shell -c su -c chmod 755 " & File.DirInternal & "/TOUCH")
' rc_main.execRootCmdSilent("su - shell -c su -c chown 0:0 " & File.DirInternal & "/TOUCH")
ToastMessageShow("running in background...",True)
End If
SetRandom_Local
SetRandom_Local
StartServiceAt(wautch_service,DateTime.Now, True)
StartServiceAt(Schedule,DateTime.Now + 1 * 1000, True)
time_I = DateTime.Now
time_II = 0
time_III = DateTime.Now
time_IV = 0
' If ( isFirst = True ) Then
'#IF NOT(MAINTENANCE)
' ToastMessageShow("please reboot whenever possible...",True)
'#ELSE
' ToastMessageShow("may reboot automatically! please connect charger...",True)
'#END IF
' End If
End Sub
Sub StartService_Local()
' StartServiceAt(wautch_service,(DateTime.GetDayOfYear+1)*DateTime.TicksPerDay)
End Sub
Sub Activity_Pause(UserClosed As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
SetRandom_Local
ToastMessageShow( Rnd(1,64) , True )
Activity.Finish
' If ( UserClosed = True ) Then
' Activity.Finish
'' Else
'' ToastMessageShow("close",False)
' End If
' SetRandom_Local
' Label1.TextSize = 18 - random13
End Sub
Sub Activity_Resume()
'Do not forget to load the layout file created with the visual designer. For example:
SetRandom_Local
Label1.TextSize = 18 - random13
SetRandom_Local
' ToastMessageShow("turn",False)
End Sub
Sub Aclock_Click
SetRandom_Local
ToastMessageShow( DateTime.Time(DateTime.Now), False )
SetRandom_Local
End Sub
Sub Button2_Click
Button2.Enabled = False
time_I = DateTime.Now
SetRandom_Local
If ( time_I > ( time_II + 1500 ) ) Then
ToastMessageShow( "utility for background calibration, curation and tuning of the device towards an intuitive interface. subsystems being battery, entropy, encryption, disk, cpu, memory, filesystem, ui, scheduler, and network, all safe and open source technology. presented in this gaming metric format with infinite feedback and an interestingly assymetric chance. click the number, find the difference!", True )
time_II = DateTime.Now
End If
SetRandom_Local
Button2.Enabled = True
End Sub
Sub Label1_Click
Dim dummy As Boolean
SetRandom_Local
ToastMessageShow( Rnd(1,64), True )
SetRandom_Local
End Sub
Sub Panel1_Click
SetRandom_Local
End Sub
Sub CheckBox1_CheckedChange(Checked As Boolean)
' ToastMessageShow(Rnd(0,9) & Rnd(0,9) & Rnd(0,9) & Rnd(0,9) & Rnd(0,9) & Rnd(0,9), True )
SetRandom_Local
' ToastMessageShow("check",False)
' CheckBox1.Enabled = False
' CheckBox1.Visible = False
' CheckBox1.Checked = False
' Aclock.Visible = False
' Button2.Visible = False
''''' CheckBox1.Visible = True
' CheckBox1.Enabled = True
' Button1.Visible = True
' Button1.BringToFront
' CheckBox1.SendToBack
Activity.Title = "waut.ch! running... ! to redraw elements"
SetRandom_Local
Activity.Finish
End Sub
Sub S2()
Sleep(30)
End Sub
Sub Panel1_Touch (Action As Int, X As Float, Y As Float)
Dim random_long As Long
Dim i,j,k As Int
' time_III = DateTime.Now
If Aclock.Visible = False Then
time_IV = DateTime.Now
' If ( time_III > ( time_IV + 1500 ) ) Then
' ToastMessageShow( DateTime.Date(DateTime.Now) , False )
' time_IV = DateTime.Now
' Return 0
' End If
If ( time_IV > ( time_III + 5000 ) ) Then
ToastMessageShow( Rnd(1,64) , True )
' ToastMessageShow( DateTime.Date(DateTime.Now) , False )
' time_III = DateTime.Now
Activity.Finish
' Return 0
End If
For j = 1 To 64
For i = 1 To 64
random_long = Rnd(1,2+Abs(Action)+(Abs(X)*Abs(Y)))
If(Rnd(1,64) > 30 ) Then
random_long = Rnd(1,1+Rnd(1,922337203685477))
random_long = Rnd(1+random12,9-random12)
random_long = Rnd(1+random12,9-random12)
random_long = random13
End If
Next
For i = 1 To 64
random_long = Rnd(1,2+Abs(Action)+(Abs(X)*Abs(Y)))
If(Rnd(1,64) < 30 ) Then
random_long = Rnd(1,1+Rnd(1,922337203685477))
random_long = Rnd(1+random12,9-random12)
random_long = Rnd(1+random12,9-random12)
random_long = random13
End If
Next
' random_long = Rnd(1,Abs(X)+Abs(Y)) + random_long - Rnd(1+random12,9-random12) * Power(Rnd(1+random12,9-random12),i+1-random12)
Label1.TextSize = 18 - random13
S2
Sleep(30)
Label1.Text = Rnd(1,64)
Next
k = 50
If Activity.Height > 1000 Then k = 85
If Activity.Width > 1000 Then k = 85
i = random13
j = random13
' Label1.Top = Activity.Height / 2 + (i-3)*(j-3)*k
' Label1.Top = Activity.Height / 2 + 2*k - (i+j)*k
Label1.Top = Activity.Height / 2 + 3*k - (i+j)*k
i = random13
j = random13
Label1.Left = Activity.Width / 2 + 3*k - (i+j)*k
Label1.TextSize = 22 - 2*random13
S2
Sleep(30)
Label1.Text = Rnd(1,64)
End If
End Sub
Sub Button1_Click
SetRandom_Local
' ToastMessageShow(Rnd(0,9) & Rnd(0,9) & Rnd(0,9) & Rnd(0,9) & Rnd(0,9) & Rnd(0,9), True )
CheckBox1.Enabled = True
CheckBox1.Visible = True
CheckBox1.Checked = False
Aclock.Visible = True
Button2.Visible = True
Button1.Visible = False
Button1.SendToBack
CheckBox1.BringToFront
Activity.Title = "waut.ch! running... ? for help, space to clear page"
SetRandom_Local
End Sub