diff --git a/ctcci/ctcci.py b/ctcci/ctcci.py index 980d69e7fa..448d3f984a 100644 --- a/ctcci/ctcci.py +++ b/ctcci/ctcci.py @@ -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}") diff --git a/ctcci/ctcconfig.example.py b/ctcci/ctcconfig.example.py index ad03c0fcda..bc2e998247 100644 --- a/ctcci/ctcconfig.example.py +++ b/ctcci/ctcconfig.example.py @@ -2,11 +2,6 @@ import os APKTOOL_BIN = "java -jar /home/ave/apktool-cli-all.jar" # use latest -# Set to false if you're going to use a local state.json file -# state.json has information about the latest discord version -LOCAL_STATE = False -STATE_FILE = "/home/ave/distok/state.json" - # APKs must be placed under $DISTOK_FOLDER/android/$PACKAGE_ID-$VERSION_NUMBER.apk # Example: /home/ave/distok/android/com.discord-909.apk DISTOK_FOLDER = "/home/ave/distok"