From eb1f1ff8ac810c564d927474cae07ac007c48ec6 Mon Sep 17 00:00:00 2001 From: Ave Ozkal Date: Fri, 25 Jan 2019 15:48:05 +0300 Subject: [PATCH] branding: change app name --- .gitignore | 2 +- patches/branding/835.patch | 17 ++++++++++++++++- patches/branding/README.md | 2 ++ patches/branding/addpatch.py | 27 +++++++++++++++++++++++++++ 4 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 patches/branding/addpatch.py diff --git a/.gitignore b/.gitignore index cf64670..629742a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -patches/customversion/*-custom.patch +patches/*/*-custom.patch diff --git a/patches/branding/835.patch b/patches/branding/835.patch index 8bf4d5b..c1b2bb2 100644 --- a/patches/branding/835.patch +++ b/patches/branding/835.patch @@ -14,7 +14,7 @@ diff -crB -x dist -x build com.discord-834-base/res/values/strings.xml com.disco Disconnecting your account might remove you from servers you joined via this account. Disconnect %1$s Disconnect from Voice -! CutTheCord +! CTCNAME Free and secure chat for gamers, works on both your desktop and your phone. Team voice & text chat discord.gg/ @@ -35,3 +35,18 @@ diff -crB -x dist -x build com.discord-834-base/res/values/strings.xml com.disco "Somebody Playin'" Notifications Continue +diff -crB -x dist -x build com.discord-835-base/AndroidManifest.xml com.discord-835/AndroidManifest.xml +*** com.discord-835-base/AndroidManifest.xml 2019-01-25 10:57:34.292581301 +0300 +--- com.discord-835/AndroidManifest.xml 2019-01-25 15:30:47.000000000 +0300 +*************** +*** 1,4 **** +! + + + +--- 1,4 ---- +! + + + + diff --git a/patches/branding/README.md b/patches/branding/README.md index 0aa9543..6571b30 100644 --- a/patches/branding/README.md +++ b/patches/branding/README.md @@ -2,6 +2,8 @@ This patch renames Discord app to Cutthecord. +You'll need to run "addpatch.py" with syntax of `python3 addpatch.py $in_patch_filename $space_splitted_patches` and use the `-custom.patch` version, or else it'll fail. + Running customicon.sh (while on root of the extracted folder) will also change the icon to the debug icon: ![](https://elixi.re/i/48nc2je7.png) diff --git a/patches/branding/addpatch.py b/patches/branding/addpatch.py new file mode 100644 index 0000000..46029e9 --- /dev/null +++ b/patches/branding/addpatch.py @@ -0,0 +1,27 @@ +#!/bin/env python3 +import sys +import time + +fname = sys.argv[1] + +# Read in the file +with open(fname, 'r') as file: + filedata = file.read() + +timestamp = str(time.time()).split(".")[0] + +name = "CutTheCord" +branch = "base" + +if "customtheme" in sys.argv: + branch = "themed" + name += " Themed" + +# Replace the target string +filedata = filedata.replace("CTCBRANCH", branch)\ + .replace("CTCTIMESTAMP", timestamp)\ + .replace("CTCNAME", name) + +# Write the file out again +with open(fname.replace(".patch", "-custom.patch"), 'w') as file: + file.write(filedata)