mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 07:52:35 +03:00
Fix update crash in case of unset dates in APK
This commit is contained in:
parent
8135760554
commit
a8b1472a43
1 changed files with 10 additions and 6 deletions
|
@ -568,12 +568,16 @@ def scan_apks(apps, apkcache, repodir, knownapks):
|
||||||
# has to be more than 24 hours newer because ZIP/APK files do not
|
# has to be more than 24 hours newer because ZIP/APK files do not
|
||||||
# store timezone info
|
# store timezone info
|
||||||
manifest = apkzip.getinfo('AndroidManifest.xml')
|
manifest = apkzip.getinfo('AndroidManifest.xml')
|
||||||
dt_obj = datetime(*manifest.date_time)
|
if manifest.date_time[1] == 0: # month can't be zero
|
||||||
checkdt = dt_obj - timedelta(1)
|
logging.debug('AndroidManifest.xml has no date')
|
||||||
if datetime.today() < checkdt:
|
else:
|
||||||
logging.warn('System clock is older than manifest in: '
|
dt_obj = datetime(*manifest.date_time)
|
||||||
+ apkfilename + '\nSet clock to that time using:\n'
|
checkdt = dt_obj - timedelta(1)
|
||||||
+ 'sudo date -s "' + str(dt_obj) + '"')
|
if datetime.today() < checkdt:
|
||||||
|
logging.warn('System clock is older than manifest in: '
|
||||||
|
+ apkfilename
|
||||||
|
+ '\nSet clock to that time using:\n'
|
||||||
|
+ 'sudo date -s "' + str(dt_obj) + '"')
|
||||||
|
|
||||||
iconfilename = "%s.%s.png" % (
|
iconfilename = "%s.%s.png" % (
|
||||||
apk['id'],
|
apk['id'],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue