Add nocamerabutton patch

Also, prompt before applying the patches.
This allows the user to manually edit them if needed.
This commit is contained in:
Observer of Time 2020-12-15 21:15:44 +02:00
parent b6d701e9e8
commit 423fc55dc5
Signed by: chronobserver
GPG Key ID: 8A2DEA1DBAEBCA9E
2 changed files with 21 additions and 9 deletions

View File

@ -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.<br>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.<br>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

View File

@ -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