vincentcox / StaCoAn

StaCoAn is a crossplatform tool which aids developers, bugbounty hunters and ethical hackers performing static code analysis on mobile applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unicode issue on report generation

kumzugloom opened this issue · comments

Hi, thank you for your efforts!

I just came across your project and wanted to look into it. However, it seems to have some unicode issues.
When I try to analyze the test-apk.apk, that comes with this repository, it fails:

python3 main.py test-apk.apk 
Decompiling app...
/home/???/dev/StaCoAn/test-apk/jadx_source_code
"/home/???/dev/StaCoAn/jadx/bin/jadx" -d "/home/???/dev/StaCoAn/test-apk/jadx_source_code" test-apk.apk
/bin/sh: 1: /home/???/dev/StaCoAn/jadx/bin/jadx: Permission denied
Decompiling done.
Searching trough files
Searching done.
start generating report
[...]
progress: 97.52%
progress: 98.14%
progress: 98.76%
progress: 99.38%
Traceback (most recent call last):
  File "main.py", line 124, in <module>
    program()
  File "main.py", line 107, in program
    print(Report_html.Tree_builder.tree_js_file(Project.projects[project_path]), file=f)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 149599-149600: ordinal not in range(128)

Some other apk I fed to it also failed, but at a different stage:

[...]
progress: 8.59%
progress: 8.72%
Traceback (most recent call last):
  File "main.py", line 124, in <module>
    program()
  File "main.py", line 72, in program
    print(overview_html.gethtml(), file=f)
UnicodeEncodeError: 'ascii' codec can't encode character '\u0580' in position 5519: ordinal not in range(128)

I shortly peeked into the code, but was insecure, whether it is an issue with yattag or this repo here, maybe you know?

Thanks for creating this issue. I will look into this issue and let you know when a fix is available. Thanks for giving detailed information.

Can you try again with the current master branch? The releases are not updated yet, so try to follow the next steps:

git clone https://github.com/vincentcox/StaCoAn/

cd StaCoAn

Make sure that you have pip3 installed:

sudo apt-get install python3-pip

Install the required python packages:

pip3 install -r requirements.txt

python3 main.py yourApp.apk

That was quick! :)
It now works fine. Thanks a lot! 👍