Skip to content

Commit 09ca8b8

Browse files
committed
Switch workflow lib
- Add APK file universal action - Add modifier for listed applications - Add modifier to show package options from dump task stacks - Check APK signature in background
1 parent 0b971a0 commit 09ca8b8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+2360
-2240
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

scripts/adb_wifi.py renamed to adb_wifi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from workflow.background import run_in_background, is_running
66
from item import Item
7-
from workflow import Workflow3
7+
from workflow import Workflow
88
from toolchain import run_script
99
from commands import CMD_GET_TCPIP
1010
from commands import CMD_TCPIP
@@ -19,7 +19,7 @@ def connect():
1919
wifiDevices = []
2020
wifiDevices.append(it)
2121
run_in_background("update_wifi_history",
22-
['/usr/bin/python', wf.workflowfile('scripts/update_wifi_history.py'), 'add', pickle.dumps(wifiDevices)])
22+
['/usr/bin/python3', wf.workflowfile('update_wifi_history.py'), 'add', pickle.dumps(wifiDevices)])
2323
print("Executed: " + result)
2424

2525
def init():
@@ -35,5 +35,5 @@ def init():
3535

3636
if __name__ == '__main__':
3737
if ip:
38-
wf = Workflow3()
38+
wf = Workflow()
3939
init()

apk_print_cert.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import os
2+
import sys
3+
import pipes
4+
from workflow import Workflow
5+
from toolchain import run_script
6+
import subprocess
7+
8+
adb_path = os.getenv('adb_path')
9+
apkFileOrFolder = os.getenv('apkFile')
10+
aapt_path = os.getenv('aapt_path')
11+
apksigner_path = os.getenv("apksigner_path")
12+
13+
def main(wf):
14+
15+
hash = sys.argv[1]
16+
apkPath = pipes.quote(apkFileOrFolder)
17+
cmd = "{0} verify -v --print-certs {1}".format(apksigner_path, apkPath)
18+
19+
result = ""
20+
verified = False
21+
try:
22+
result = run_script(cmd)
23+
verified = True
24+
except subprocess.CalledProcessError as exc:
25+
log.error("Not verified")
26+
result = exc.output.decode('utf8')
27+
28+
log.warning(result)
29+
log.warning("result--end")
30+
31+
wf.cache_data('apk_print_cert' + hash, result+ "\n{}".format(verified))
32+
33+
34+
if __name__ == '__main__':
35+
wf = Workflow()
36+
log = wf.logger
37+
sys.exit(wf.run(main))
File renamed without changes.

scripts/clear_command_history.py renamed to clear_command_history.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sys
22
import os
3-
from workflow import Workflow3
3+
from workflow import Workflow
44

55
def main(wf):
66

@@ -20,6 +20,6 @@ def main(wf):
2020
wf.send_feedback()
2121

2222
if __name__ == '__main__':
23-
wf = Workflow3()
23+
wf = Workflow()
2424
log = wf.logger
2525
sys.exit(wf.run(main))
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)