Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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