Skip to content

Instantly share code, notes, and snippets.

@obfusk
Created June 18, 2021 23:03
Show Gist options
  • Select an option

  • Save obfusk/c1e8e0cd3867a237ea932f6792739c11 to your computer and use it in GitHub Desktop.

Select an option

Save obfusk/c1e8e0cd3867a237ea932f6792739c11 to your computer and use it in GitHub Desktop.
fix fdroid apkcache timestamps
#!/usr/bin/python3
import collections, glob, json, os
with open("tmp/apkcache.json") as f:
apkcache = json.load(f, object_pairs_hook=collections.OrderedDict)
for apk in glob.glob("repo/*.apk"):
mtime = os.stat(apk).st_mtime
apkcache[os.path.basename(apk)]["added"] = mtime
with open("tmp/apkcache.json", "w") as f:
json.dump(apkcache, f, indent=2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment