libsignal-service-java/update-verification-metadata.py
finn 4bc11f17a0 update to unofficial_38
some slightly different patching requirements
2022-01-24 18:52:38 -08:00

20 lines
No EOL
553 B
Python

#!/usr/bin/env python3
import os
import json
filename = "gradle/verification-metadata.xml"
with open('../hashes.json') as f:
hashes = json.load(f)
target = os.getenv("TARGET")
if target not in hashes:
raise Exception("Target {} not in known hashes, please update the python script".format(os.getenv("TARGET")))
with open(filename) as f:
template = f.read()
output = template.format(TARGET=target, TARGET_JAR_SHA256=hashes[target]["jar"], TARGET_MODULE_SHA256=hashes[target]["module"])
with open(filename, 'w') as f:
f.write(output)