Archive repo
This commit is contained in:
parent
423fc55dc5
commit
d9436eb6cc
|
@ -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:
|
||||
|
|
19
patch.sh
19
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
|
||||
|
|
Reference in New Issue