branding: Move from timestamp to build counter

This commit is contained in:
ave 2019-01-25 16:19:05 +03:00
parent eb1f1ff8ac
commit e57d1ff8ae
No known key found for this signature in database
GPG key ID: 09356ABAA42C842B
2 changed files with 24 additions and 5 deletions

View file

@ -45,7 +45,7 @@ diff -crB -x dist -x build com.discord-835-base/AndroidManifest.xml com.discord-
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/> <uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
<uses-feature android:name="android.hardware.faketouch" android:required="false"/> <uses-feature android:name="android.hardware.faketouch" android:required="false"/>
--- 1,4 ---- --- 1,4 ----
! <?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="28" android:compileSdkVersionCodename="9" android:installLocation="auto" package="com.cutthecord.CTCBRANCH" platformBuildVersionCode="835CTCTIMESTAMP" platformBuildVersionName="8.3.5g-cutthecord"> ! <?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="28" android:compileSdkVersionCodename="9" android:installLocation="auto" package="com.cutthecord.CTCBRANCH" platformBuildVersionCode="835CTCBUILD" platformBuildVersionName="8.3.5g-cutthecord">
<uses-feature android:name="android.hardware.camera" android:required="false"/> <uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/> <uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
<uses-feature android:name="android.hardware.faketouch" android:required="false"/> <uses-feature android:name="android.hardware.faketouch" android:required="false"/>

View file

@ -1,25 +1,44 @@
#!/bin/env python3 #!/bin/env python3
import os
import sys import sys
import time
fname = sys.argv[1] 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 # Read in the file
with open(fname, 'r') as file: with open(fname, 'r') as file:
filedata = file.read() filedata = file.read()
timestamp = str(time.time()).split(".")[0] buildnum = counterup()
name = "CutTheCord" name = "CutTheCord"
branch = "base" branch = "base"
if "customtheme" in sys.argv: if "customtheme" in sys.argv:
branch = "themed" branch = "themed"
name += " Themed" # name += " Themed"
# Replace the target string # Replace the target string
filedata = filedata.replace("CTCBRANCH", branch)\ filedata = filedata.replace("CTCBRANCH", branch)\
.replace("CTCTIMESTAMP", timestamp)\ .replace("CTCBUILD", buildnum)\
.replace("CTCNAME", name) .replace("CTCNAME", name)
# Write the file out again # Write the file out again