libsignal-service-java/update-hashes.py

31 lines
920 B
Python
Raw Normal View History

#!/usr/bin/env python3
import requests
import hashlib
import json
2022-06-16 20:08:44 +00:00
VERSION = "0.17.0"
TARGETS = [
"aarch64-unknown-linux-gnu",
"arm-unknown-linux-gnueabi",
"arm-unknown-linux-gnueabihf",
"armv7-unknown-linux-gnueabihf",
"x86_64-unknown-linux-gnu",
2022-07-31 20:07:24 +00:00
"x86_64-apple-darwin",
"x86_64-unknown-linux-musl"
]
2022-04-06 18:45:49 +00:00
urlFormat = "https://gitlab.com/api/v4/groups/6853927/-/packages/maven/org/signald/libsignal-client-{target}/{version}/libsignal-client-{target}-{version}.{ext}"
output = {}
for target in TARGETS:
output[target] = {}
for ext in ["jar", "module"]:
url = urlFormat.format(target=target, version=VERSION, ext=ext)
print("fetching {}".format(url))
r = requests.get(url, allow_redirects=True)
r.raise_for_status()
output[target][ext] = hashlib.sha256(r.content).hexdigest()
with open('hashes.json', 'w') as f:
json.dump(output, f, indent=4)