Skip to content

Commit 0aed113

Browse files
committed
Replace pipes with shlex
1 parent 24857c0 commit 0aed113

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8692,7 +8692,7 @@ You may be able to check it in terminal with "which emulator".</string>
86928692
<string>Screen Info|self_scripts/screen_info.py</string>
86938693
</dict>
86948694
<key>version</key>
8695-
<string>1.13.5</string>
8695+
<string>1.13.6</string>
86968696
<key>webaddress</key>
86978697
<string>https://github.com/zjn0505/adb-alfred</string>
86988698
</dict>

show_install_options.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
import sys
44
import re
5-
import pipes
5+
import shlex
66
from workflow import Workflow, ICON_INFO, ICON_NOTE, ICON_ERROR, ICON_WARNING
77
from toolchain import run_script
88
from workflow.background import is_running, run_in_background
@@ -62,7 +62,7 @@ def showApkInstallItems():
6262

6363
arg = wf.args[0].strip()
6464

65-
apkPath = pipes.quote(apkFileOrFolder)
65+
apkPath = shlex.quote(apkFileOrFolder)
6666
log.debug("Path {0}".format(apkPath))
6767
apk = None
6868
if not aapt_path:
@@ -72,7 +72,7 @@ def showApkInstallItems():
7272
if not apksigner_path:
7373
wf.add_item(title="apksigner not found", subtitle="Please config 'apksigner_path' in workflow settings for richer APK info", valid=False, icon=ICON_WARNING)
7474
else:
75-
cmd_dump_badging = "{0} dump badging {1} | grep 'package:\|application-label:\|dkVersion:\|uses-permission:\|application-debuggable\|testOnly='".format(aapt_path, apkPath)
75+
cmd_dump_badging = r"{0} dump badging {1} | grep 'package:\|application-label:\|dkVersion:\|uses-permission:\|application-debuggable\|testOnly='".format(aapt_path, apkPath)
7676
cmd_list_all = "{0} list -a {1} | grep 'sharedUserId'".format(aapt_path, apkPath)
7777
result_dump = run_script(cmd_dump_badging)
7878
is_system_app = False
@@ -138,7 +138,7 @@ def showApkInstallItems():
138138
currentVersionCode = ""
139139

140140
if serial:
141-
shell_cmd = "{0} -s {1} shell dumpsys package {2} | grep 'versionCode\|versionName' | awk '{{print $1}}'".format(adb_path, serial, apk["packName"])
141+
shell_cmd = r"{0} -s {1} shell dumpsys package {2} | grep 'versionCode\|versionName' | awk '{{print $1}}'".format(adb_path, serial, apk["packName"])
142142

143143
try:
144144
currentApkResult = run_script(shell_cmd)
@@ -197,7 +197,7 @@ def showApkInstallItems():
197197

198198
if deviceApi and "min" in apk and int(deviceApi) < apk["min"]:
199199
wf.add_item(title="Incompatiable device", subtitle="current device api level is {1}, lower than apk minSdkVersion {0}, ".format(deviceApi, apk["min"]), icon=ICON_ERROR, valid=False)
200-
if deviceApi and "max" in apk and int(deviceApi) > apk["maxs"]:
200+
if deviceApi and "max" in apk and int(deviceApi) > apk["max"]:
201201
wf.add_item(title="Incompatiable device", subtitle="current device api level is {1}, higher than apk maxSdkVersion {0}, ".format(deviceApi, apk["max"]), icon=ICON_ERROR, valid=False)
202202

203203

0 commit comments

Comments
 (0)