From 423fc55dc5b157ff3cc84d44365548970e803965 Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Tue, 15 Dec 2020 21:15:44 +0200 Subject: [PATCH] Add nocamerabutton patch Also, prompt before applying the patches. This allows the user to manually edit them if needed. --- README.md | 21 +++++++++++++++------ patch.sh | 9 ++++++--- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index da77775..aa57803 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ - `customfont` ([text][Asap], [code][Hasklig]) - `customversion` - `necessary` +- `nocamerabutton` - `noblocked` - `squareavatars` @@ -43,21 +44,29 @@ You also need to set the following variables: ```sh # the version code of the Discord APK -export VERCODE="1196" +export VERCODE="1340" # the apkfuckery commit hash corresponding to VERCODE # https://gitdab.com/distok/apkfuckery/commits/branch/master -export COMMIT_HASH="2e0ee2fb8b4825de22cb43163be7072ea2f2b7b3" +export COMMIT_HASH="47c2a54ada268de6c892b130ffed118d76fc4f2a" ``` -Now, you can run the script.
You will -be prompted to enter the keystore password. +The variables below are optional: + +```sh +# if you don't want to be prompted before patching +export NO_PROMPT=1 +# if you want to manually install the patched app +# you will find the APK in com.discord/dist/ +export SKIP_INSTALL=1 +``` + +Now, you can run the script like so: ```sh bash < <(curl -LSs https://discord.coffee/5V4AnGq) ``` -You can install the patched app manually by setting `SKIP_INSTALL` -before running the script.
You will find it in `com.discord/dist/`. +You will be prompted to enter the keystore password. [CutTheCord]: https://gitdab.com/distok/cutthecord [Asap]: https://fonts.google.com/specimen/Asap diff --git a/patch.sh b/patch.sh index 750d693..9adaca9 100755 --- a/patch.sh +++ b/patch.sh @@ -29,13 +29,16 @@ _dab cutthecord master | tar xzf - printf 'Editing patches...\n' -sed -i cutthecord/patches/squareavatars/"$VERCODE".patch -e 's/3dp/5dp/' sed -i cutthecord/patches/branding/"$VERCODE".patch \ -e 's/CTCNAME/Discord (CTC)/g;s/CTCBRANCH/chronobserver/g' \ -e "s/-CTCBUILD/-$(date --iso-8601)/g;s/CTCBUILD//g" sed -i cutthecord/patches/branding/customicon.sh -e 's/#rm/rm/' -for p in necessary noblocked nocamerabutton squareavatars branding customversion; do +if [[ -z ${NO_PROMPT+x} ]]; then + read -rp 'Press enter when you are ready to continue ' +fi + +for p in necessary nocamerabutton noblocked squareavatars branding customversion; do printf 'Applying %s patch...\n' "$p" patch -d com.discord -p1 < "cutthecord/patches/$p/$VERCODE.patch" done @@ -55,7 +58,7 @@ curl -LSsfo com.discord/res/font/whitney_bold.ttf \ curl -LSsfo com.discord/res/font/whitney_medium.ttf \ https://github.com/google/fonts/raw/master/ofl/asap/Asap-Regular.ttf curl -LSsfo com.discord/res/font/sourcecodepro_semibold.ttf \ - https://github.com/thiagolucio/code-editor-fonts/raw/master/Hasklig.ttf/Hasklig-Medium.ttf + https://github.com/thiagolucio/HaskligFontFamily-Windows/raw/master/Hasklig-Medium.ttf apktool b com.discord