ctcci: Pull version from patchport-state.json

This commit is contained in:
ave 2020-05-28 15:53:24 +03:00
parent cf6f10a0e1
commit 30c8b07077
Signed by untrusted user: a
GPG key ID: 398DD7BD03276F6D
2 changed files with 2 additions and 14 deletions

View file

@ -38,15 +38,8 @@ os.environ["DISTOK_EXTRACTED_DISCORD_PATH"] = WORK_APK_PATH
os.makedirs(WORK_FOLDER, exist_ok=True)
if LOCAL_STATE:
# Get the version of the APK from distok state file
with open(STATE_FILE) as f:
STATE = json.load(f)
else:
# Get the version of the APK from distok.top
STATE = requests.get("https://distok.top/state.json").json()
VERSION = STATE["android"][PACKAGE_ID]["version"]
with open(os.path.join(REPO_FOLDER, "patchport-state.json")) as f:
VERSION = f["versioncode"]
BASE_APK_PATH = os.path.join(WORK_FOLDER, f"discord-base-{VERSION}")