ctcci: commit some stuff I forgot to commit

This commit is contained in:
ave 2019-06-21 12:12:54 +03:00
parent 8f698e4899
commit 56f451009d
No known key found for this signature in database
GPG key ID: 09356ABAA42C842B
2 changed files with 13 additions and 6 deletions

View file

@ -33,10 +33,15 @@ if os.path.exists(WORK_APK_PATH):
os.makedirs(WORK_FOLDER, exist_ok=True)
# Get the version of the APK from distok state file
with open(STATE_FILE) as f:
if LOCAL_STATE:
# Get the version of the APK from distok state file
with open(STATE_FILE) as f:
STATE = json.load(f)
VERSION = STATE["android"][PACKAGE_ID]["version"]
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"]
BASE_APK_PATH = os.path.join(WORK_FOLDER, f"discord-base-{VERSION}")
@ -60,8 +65,9 @@ if not FORCE and os.path.exists(OUTPUT_FILE):
print("This version is already patched, bye!")
sys.exit(1)
# Update cutthecord
subprocess.run("git pull", shell=True, cwd=REPO_FOLDER)
if DO_GITPULL:
# Update cutthecord
subprocess.run("git pull", shell=True, cwd=REPO_FOLDER)
# Extract the APK if it's not already extracted to base cache
if not os.path.exists(BASE_APK_PATH):

View file

@ -20,6 +20,7 @@ FDROID_FOLDER = "/var/www/fdroid/seabear"
RESULT_FOLDER = FDROID_FOLDER + "/repo"
# Repo for CutTheCord (https://gitdab.com/distok/cutthecord)
DO_GITPULL = True
REPO_FOLDER = "/home/ave/distokrepos/cutthecord"
# Keystore file, alias and pass. Required.