Fix wizzard apkm/zip split packages.#1387
Fix wizzard apkm/zip split packages.#1387JabLuszko wants to merge 10 commits intoMap-A-Droid:asyncfrom
Conversation
|
Hey @JabLuszko , |
True, totally forgot I renamed my testing .apkm to .zip. |
| return await self._json_response(data=data[apk_type]) | ||
|
|
||
| def allowed_file(self, filename): | ||
| ALLOWED_EXTENSIONS = set(['apk', 'apkm', 'zip']) |
There was a problem hiding this comment.
This line is equivalent to ALLOWED_EXTENSIONS = {'apk', 'apkm', 'zip'} which is more efficient as it doesnt create a list then convert it to a set. I dont think it matters in this context though.
This should be a global variable thats initialized once and referenced instead of initialized on every call.
| @@ -537,12 +538,13 @@ def normalize_package(self) -> NoReturn: | |||
| apk = apkutils.APK().from_io(bytes_of_apk).parse_resource() | |||
| manifest = apk.get_manifest() | |||
There was a problem hiding this comment.
It looks like manifest is no longer used. Should be good to remove the line.
| elif not file.filename: | ||
| await self._add_notice_message('No file selected for uploading') | ||
| raise web.HTTPFound(self._url_for("upload")) | ||
| elif not allowed_file(file.filename): |
There was a problem hiding this comment.
Is allowed_file utilized anywhere else? If not, the code should be removed to have a cleaner code base.
No description provided.