diff --git a/patches/branding/835.patch b/patches/branding/835.patch index c1b2bb2ec3..c583883bec 100644 --- a/patches/branding/835.patch +++ b/patches/branding/835.patch @@ -45,7 +45,7 @@ diff -crB -x dist -x build com.discord-835-base/AndroidManifest.xml com.discord- --- 1,4 ---- -! +! diff --git a/patches/branding/addpatch.py b/patches/branding/addpatch.py index 46029e9a42..4b51bb9116 100644 --- a/patches/branding/addpatch.py +++ b/patches/branding/addpatch.py @@ -1,25 +1,44 @@ #!/bin/env python3 +import os import sys -import time fname = sys.argv[1] +persistdir = "/home/ave/distokrepos/versionlogs/" + + +def counterup(): + # HACKY + cfname = persistdir + fname.split("/")[-1].replace(".patch", "") + if os.path.isfile(fname): + with open(cfname, 'r') as file: + countdata = file.read() + else: + countdata = 0 + + countdata = int(countdata) + 1 + + with open(cfname, 'w') as file: + file.write(str(countdata)) + + return countdata + # Read in the file with open(fname, 'r') as file: filedata = file.read() -timestamp = str(time.time()).split(".")[0] +buildnum = counterup() name = "CutTheCord" branch = "base" if "customtheme" in sys.argv: branch = "themed" - name += " Themed" + # name += " Themed" # Replace the target string filedata = filedata.replace("CTCBRANCH", branch)\ - .replace("CTCTIMESTAMP", timestamp)\ + .replace("CTCBUILD", buildnum)\ .replace("CTCNAME", name) # Write the file out again