Skip to content

Commit

Permalink
Fix MD5 hash regression with python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
zjn0505 committed Apr 28, 2022
1 parent 45d15a5 commit 0b971a0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8030,7 +8030,7 @@ Use keyword "geny" to list and start Genymotion emulator</string>
<string>aapt_path</string>
</array>
<key>version</key>
<string>1.13.1</string>
<string>1.13.2</string>
<key>webaddress</key>
<string>https://github.com/zjn0505/adb-alfred</string>
</dict>
Expand Down
6 changes: 4 additions & 2 deletions scripts/list_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ def list_devices(args):
it.setvar('ro.product.manufacturer', item.get('ro.product.manufacturer'))
it.setvar("serial", name)
it.setvar('name', item.get('name'))
if item.subtitle and not re.match(regexIp + ":5555", name):
if item.subtitle and not re.match(regexIp + ":5555", name) and not name.startswith("emulator-"):
# if item.subtitle and not re.match(regexIp + ":5555", name):
cmd_ip = adb_path + ' -s ' + name + " shell ip -f inet addr show wlan0 | grep inet | tr -s ' ' | awk '{print $2}'"
ip = run_script(cmd_ip)
if '/' in ip and re.match(regexIp, ip.split('/')[0]):
Expand All @@ -118,7 +119,8 @@ def list_devices(args):

# last func
if name.startswith("emulator-"):
name = hashlib.md5(item.subtitle).hexdigest()
log.debug(item.subtitle)
name = hashlib.md5(item.subtitle.encode("utf-8")).hexdigest()
it.setvar("his_tag", name)
lastFuncs = wf.cached_data('last_func:' + name, max_age=0)
if lastFuncs and len(lastFuncs) > 0:
Expand Down
2 changes: 0 additions & 2 deletions scripts/save_last_func.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import os
import sys
import pickle
import hashlib
from workflow import Workflow3

function = os.getenv("function")
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.13.1
1.13.2

0 comments on commit 0b971a0

Please sign in to comment.