facebookarchive/profilo

workflow_demo.py can't parse APK

Closed this issue · 1 comments

I'm having trouble getting the workflow_demo.py script to extract symbols from my test APK.

Here's the stack trace:

Traceback (most recent call last):
File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "profilo/python/profilo/workflow_demo.py", line 255, in
args.func(tracefile, args)
File "profilo/python/profilo/workflow_demo.py", line 174, in stacks
symbols = extract_apk_symbols(args.apk)
File "profilo/python/profilo/symbols/apk_symbols.py", line 235, in extract_apk_symbols
dex = Dex(dex_file)
File "profilo/python/profilo/symbols/apk_symbols.py", line 160, in init
self.strings = self._read_strings(f)
File "profilo/python/profilo/symbols/apk_symbols.py", line 174, in _read_strings
result.append(StringDataItem(f).data)
File "profilo/python/profilo/symbols/apk_symbols.py", line 145, in init
c = f.read(1).decode("ascii")
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 0: ordinal not in range(128)

Here's the trace off the device:

override-main-1954-2018-3-28T13-15-6-EsAb7fOK_wy-cs-c8480e9e.log

And the APK:

app-debug.apk.zip

This has been fixed by 7cb6487