mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-14 06:52:39 +03:00
allow common.get_apk_id() to be used in the API
If a project uses fdroidserver as a library, then just calls common.get_apk_id(), it will now work. Before, that project would have had to include something like `common.config = {}` to avoid a stacktrace.
This commit is contained in:
parent
9605d4ecad
commit
c6dcc82ca4
2 changed files with 20 additions and 3 deletions
|
@ -2689,9 +2689,11 @@ def get_apk_id(apkfile):
|
|||
try:
|
||||
return get_apk_id_androguard(apkfile)
|
||||
except zipfile.BadZipFile as e:
|
||||
logging.error(apkfile + ': ' + str(e))
|
||||
if 'aapt' in config:
|
||||
if config and 'aapt' in config:
|
||||
logging.error(apkfile + ': ' + str(e))
|
||||
return get_apk_id_aapt(apkfile)
|
||||
else:
|
||||
raise e
|
||||
|
||||
|
||||
def get_apk_id_androguard(apkfile):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue