Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Simple Python-based Signal APK downloader
#!/usr/bin/env python3
import requests
import urllib.request
import hashlib
import sys
from simplejson.errors import JSONDecodeError
url = ""
response = requests.get(url=url)
data = response.json()
except JSONDecodeError:
print("ERROR: Can't decode json file.")
except requests.exceptions.ConnectionError:
print("ERROR: Can't connect to")
print("Signal APK download from")
print("Available version: {}".format(data["versionName"]))
decision = input("Do you want to download this version? (y/N) ")
if decision in ("y, Y, yes, Yes"):
print(" Starting download …")
url_parts = data["url"].split("/")
file_name = url_parts[4]
original_sha256 = data["sha256sum"]
with urllib.request.urlopen(data["url"]) as response, \
open(file_name, 'wb') as out_file:
data =
print(" Download complete.")
decision = input("Do you want to check file integrity? (y/N) ")
if decision in ("y, Y, yes, Yes"):
sha256_hash = hashlib.sha256()
with open(file_name, "rb") as f:
for byte_block in iter(lambda:, b""):
if sha256_hash.hexdigest() == original_sha256:
print(" Integrity check okay.")
print(" ERROR: Hashes differ.")
print("Done. Good bye.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.