Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update apk.py #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update apk.py #3

wants to merge 1 commit into from

Conversation

CrimsonGlory
Copy link

Since a malformed apk can return non-ascii data, better to use string formatting.

2018-05-23T13:17:38+00:00 172.21.0.1 worker_no_vt[1000]:   File "/myapp/PlugIns/APK/tdoly_apk_parse/apk.py", line 466, in get_activities
2018-05-23T13:17:38+00:00 172.21.0.1 worker_no_vt[1000]:     return self.get_elements("activity", "name")
2018-05-23T13:17:38+00:00 172.21.0.1 worker_no_vt[1000]:   File "/myapp/PlugIns/APK/tdoly_apk_parse/apk.py", line 400, in get_elements
2018-05-23T13:17:38+00:00 172.21.0.1 worker_no_vt[1000]:     l.append(str(value))
2018-05-23T13:17:38+00:00 172.21.0.1 worker_no_vt[1000]: UnicodeEncodeError: 'ascii' codec can't encode character u'\u1e37' in position 2: ordinal not in range(128)
2018-05-23T13:17:38+00:00 172.21.0.1 worker_no_vt[1000]: INFO:root:**** PlugIn    : apk_metadata ****
2018-05-23T13:17:38+00:00 172.21.0.1 worker_no_vt[1000]: INFO:root:Traceback (most recent call last):

Since a malformed apk can return non-ascii data, better to use string formatting.
```
2018-05-23T13:17:38+00:00 172.21.0.1 worker_no_vt[1000]:   File "/myapp/PlugIns/APK/tdoly_apk_parse/apk.py", line 466, in get_activities
2018-05-23T13:17:38+00:00 172.21.0.1 worker_no_vt[1000]:     return self.get_elements("activity", "name")
2018-05-23T13:17:38+00:00 172.21.0.1 worker_no_vt[1000]:   File "/myapp/PlugIns/APK/tdoly_apk_parse/apk.py", line 400, in get_elements
2018-05-23T13:17:38+00:00 172.21.0.1 worker_no_vt[1000]:     l.append(str(value))
2018-05-23T13:17:38+00:00 172.21.0.1 worker_no_vt[1000]: UnicodeEncodeError: 'ascii' codec can't encode character u'\u1e37' in position 2: ordinal not in range(128)
2018-05-23T13:17:38+00:00 172.21.0.1 worker_no_vt[1000]: INFO:root:**** PlugIn    : apk_metadata ****
2018-05-23T13:17:38+00:00 172.21.0.1 worker_no_vt[1000]: INFO:root:Traceback (most recent call last):
```
@AhnMo
Copy link

AhnMo commented Sep 19, 2018

Oh, I got same error.

@Goshrt
Copy link

Goshrt commented Oct 30, 2023

Dado que una apk con formato incorrecto puede devolver datos que no sean ASCII, es mejor utilizar el formato de cadena.

2018-05-23T13:17:38+00:00 172.21.0.1 worker_no_vt[1000]:   File "/myapp/PlugIns/APK/tdoly_apk_parse/apk.py", line 466, in get_activities
2018-05-23T13:17:38+00:00 172.21.0.1 worker_no_vt[1000]:     return self.get_elements("activity", "name")
2018-05-23T13:17:38+00:00 172.21.0.1 worker_no_vt[1000]:   File "/myapp/PlugIns/APK/tdoly_apk_parse/apk.py", line 400, in get_elements
2018-05-23T13:17:38+00:00 172.21.0.1 worker_no_vt[1000]:     l.append(str(value))
2018-05-23T13:17:38+00:00 172.21.0.1 worker_no_vt[1000]: UnicodeEncodeError: 'ascii' codec can't encode character u'\u1e37' in position 2: ordinal not in range(128)
2018-05-23T13:17:38+00:00 172.21.0.1 worker_no_vt[1000]: INFO:root:**** PlugIn    : apk_metadata ****
2018-05-23T13:17:38+00:00 172.21.0.1 worker_no_vt[1000]: INFO:root:Traceback (most recent call last):

Copy link

@Goshrt Goshrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants