Skip to content

Commit e179bc1

Browse files
committed
ui: add cancel button to notification, and lint
1 parent d8cd680 commit e179bc1

31 files changed

+249
-182
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
<service
2929
android:name="org.netdex.androidusbscript.service.LuaUsbService"
3030
android:enabled="true" />
31-
3231
</application>
3332

3433
</manifest>

app/src/main/assets/scripts/chromeacct.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
---
2-
--- expose saved Google account password from Chrome
2+
--- Expose saved Google account password from Chrome
33
---
44
require("common")
55

66
kb = luausb.create({ id = 0, type = "keyboard" })
77

88
-- This URL will be visited with the captured password appended to the end
9-
local endpoint = prompt("Endpoint querystring", "https://localhost/index.php?q=")
9+
local endpoint = prompt{
10+
message="Enter the URL of the end-point to query.",
11+
hint="End-point URL",
12+
default="https://localhost/index.php?q="
13+
}
1014

1115
while true do
1216
print("idle")
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
--- Common library functions
3+
---

app/src/main/assets/scripts/composite.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ while true do
1616
wait(1000)
1717

1818
-- send a string from keyboard 1
19-
kb1.send_string("kb1")
19+
kb1.string("kb1")
2020
wait(1000)
2121
-- send a string from keyboard 2
22-
kb2.send_string("kb2")
22+
kb2.string("kb2")
2323

2424
print("done")
2525

app/src/main/assets/scripts/downloadrun.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@
55

66
kb = luausb.create({ id = 0, type = "keyboard" })
77

8-
local file = prompt("File to download?", "https://github.com/Netdex/FlyingCursors/releases/download/1.0.0/FlyingCursors.exe")
9-
local runAs = confirm("Task UAC", "Launch exe as admin?");
8+
local file = prompt{
9+
message="Enter the URL for the file to download.",
10+
hint="File URL",
11+
default="https://github.com/Netdex/FlyingCursors/releases/download/1.0.0/FlyingCursors.exe"
12+
}
13+
local runAs = confirm{
14+
message="Launch executable with administrator privileges?"
15+
}
1016

1117
while true do
1218
print("idle")

app/src/main/assets/scripts/massstorage.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
--- a simple default mass storage device
2+
--- Simple mass storage device using default options
33
---
44

55
_ = luausb.create({ id = 0, type = "storage" })
Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
1+
---
2+
--- Draw some cool circles using the mouse
3+
---
4+
15
ms1 = luausb.create({ type = "mouse", id = 0 })
26

37
-- poll until usb plugged in
48
while luausb.state() == "not attached" do
59
wait(1000)
610
end
711

12+
t = 0
13+
s = 0.05
14+
r = 200
15+
x = r
16+
y = 0
817
while luausb.state() == "configured" do
9-
ms1.click(BTN_LEFT)
10-
ms1.move(30, 0)
11-
ms1.scroll(127)
12-
wait(1000)
18+
ax, ay = r * math.cos(t), r * math.sin(t)
19+
dx, dy = math.floor(ax - x), math.floor(ay - y)
20+
x, y = x + dx, y + dy
21+
t = t + s
22+
ms1.move(dx, dy)
1323
end
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
while true do
2+
wait(1000)
3+
end

app/src/main/assets/scripts/test.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ kb = luausb.create({ id = 0, type = "keyboard" })
22

33
while true do
44
wait(1000)
5-
end
5+
end

app/src/main/assets/scripts/wallpaper.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
---
2-
--- wallpaper.lua: Changes a Windows 10 desktop wallpaper
2+
--- Change Windows 10 desktop wallpaper
33
---
44

55
kb = luausb.create({ id = 0, type = "keyboard" })
66

7-
local file = prompt("Wallpaper to download?", "https://i.imgur.com/46wWHZ3.png")
7+
local file = prompt{
8+
message="Enter the URL of the wallpaper to download.",
9+
hint="Image URL",
10+
default="https://i.imgur.com/46wWHZ3.png"
11+
}
812

913
while true do
1014
print("idle")

0 commit comments

Comments
 (0)