Exodus-Privacy / exodus-standalone

εxodus CLI client for local analysis
GNU Affero General Public License v3.0
77 stars 13 forks source link

'str' object has no attribute 'decode' with --json option #8

Closed Rudloff closed 5 years ago

Rudloff commented 5 years ago

Hello,

I am getting the reverse error of https://github.com/Exodus-Privacy/exodus-standalone/pull/5:

Traceback (most recent call last):
  File "exodus_analyze.py", line 62, in <module>
    report = json.dumps(analysis.create_json_report(), indent = 2)
  File "exodus_analyze.py", line 18, in create_json_report
    'libraries': [l.decode('utf-8') for l in self.get_libraries()],
  File "exodus_analyze.py", line 18, in <listcomp>
    'libraries': [l.decode('utf-8') for l in self.get_libraries()],
AttributeError: 'str' object has no attribute 'decode'

get_libraries() already returns strings so there is no need to call decode().

pnu-s commented 5 years ago

Hello @Rudloff Could you please precise the steps to reproduce your issue?

Thanks!

Rudloff commented 5 years ago

I am simply running python3 exodus_analyze.py -j some_apk_with_libraries.apk (this one, for example). I am using exodus-core 2.0.2 and androguard 3.1.0.

pnu-s commented 5 years ago

Could you please try using exodus-core 1.0.15 (which is the version is requirements.txt)?

Rudloff commented 5 years ago

I tried with exodus-core 1.0.15 but I still get the same error.

It seems the error happens because this returns a string (so there is not need to decode it). But if I understand https://github.com/Exodus-Privacy/exodus-standalone/pull/5 correctly, this was not the case for @milouse. (Maybe a different lxml version? I tried with both 3.7.1 and 4.2.5.)

pnu-s commented 5 years ago

Ok, I could reproduce the issue, I'll take a look !

Rudloff commented 5 years ago

I confirm it now works correctly, thanks!