dpnishant / appmon

Documentation:
http://dpnishant.github.io/appmon
Apache License 2.0
1.55k stars 275 forks source link

[ERROR]: a bytes-like object is required, not 'str' #126

Closed salman0ansari closed 1 year ago

salman0ansari commented 2 years ago

command used: python3 apk_builder.py --apk /home/apex/Desktop/Frida/app.apk

error:

[I] Preparing work directory...
[I] Expanding APK...
Traceback (most recent call last):
  File "/home/apex/Desktop/Frida/appmon/apk_builder/apk_builder.py", line 96, in <module>
    package_name = apk_dump.split("package: name=")[1].split(" ")[0].strip("'\"\n\t ")
TypeError: a bytes-like object is required, not 'str'

specs: image

gam04 commented 1 year ago

Same here.

It seems its due by aapt bytes output

gam04 commented 1 year ago

Hi @salman0ansari , for now you can bypass this issue by converting subprocess byte output into str:

example:

# use bytes.decode('utf-8')
apk_dump = subprocess.check_output(["aapt", "dump", "badging", apk_path]).decode('utf-8')