From d9436eb6cc19be66d95b05a9d84a6fa116f972e7 Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Fri, 19 Nov 2021 19:32:22 +0200 Subject: [PATCH] Archive repo --- README.md | 5 +---- patch.sh | 19 +++++++------------ 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index aa57803..7e23535 100644 --- a/README.md +++ b/README.md @@ -40,14 +40,11 @@ If the file doesn't exist, generate it with `keytool`. keytool -genkeypair -keystore "$KEYSTORE_PATH" -alias "$KEYSTORE_ALIAS" ``` -You also need to set the following variables: +You also need to set the following variable: ```sh # the version code of the Discord APK export VERCODE="1340" -# the apkfuckery commit hash corresponding to VERCODE -# https://gitdab.com/distok/apkfuckery/commits/branch/master -export COMMIT_HASH="47c2a54ada268de6c892b130ffed118d76fc4f2a" ``` The variables below are optional: diff --git a/patch.sh b/patch.sh index 9adaca9..db7e157 100755 --- a/patch.sh +++ b/patch.sh @@ -15,17 +15,12 @@ set -euo pipefail trap 'exit 130' INT -: "$KEYSTORE_PATH" "$KEYSTORE_ALIAS" "$VERCODE" "$COMMIT_HASH" - -_dab() (curl --progress-bar -Lf "https://gitdab.com/distok/$1/archive/$2.tar.gz") - -printf 'Downloading Discord...\n' - -_dab apkfuckery "$COMMIT_HASH" | tar xzf - --strip-components=1 +: "$KEYSTORE_PATH" "$KEYSTORE_ALIAS" "$VERCODE" printf 'Downloading CutTheCord...\n' -_dab cutthecord master | tar xzf - +curl --progress-bar -Lf \ + "https://gitdab.com/distok/cutthecord/archive/2021-05-31.tar.gz" | tar xzf - printf 'Editing patches...\n' @@ -38,9 +33,9 @@ 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 +for p in necessary nocamerabutton noblocked notrack squareavatars branding customversion; do printf 'Applying %s patch...\n' "$p" - patch -d com.discord -p1 < "cutthecord/patches/$p/$VERCODE.patch" + patch --no-backup-if-mismatch -d com.discord -p1 < "cutthecord/patches/$p/$VERCODE.patch" done printf 'Replacing files...\n' @@ -63,10 +58,10 @@ curl -LSsfo com.discord/res/font/sourcecodepro_semibold.ttf \ apktool b com.discord while ! jarsigner -keystore "$KEYSTORE_PATH" \ - "com.discord/dist/com.discord-$VERCODE.apk" "$KEYSTORE_ALIAS" + "com.discord/dist/com.discord.apk" "$KEYSTORE_ALIAS" do :; done if [[ -z ${SKIP_INSTALL+x} ]]; then - adb install -r "com.discord/dist/com.discord-$VERCODE.apk" + adb install -r "com.discord/dist/com.discord.apk" rm -rf com.discord/ cutthecord/ fi