From 5b9a28939b5ff165176b34c874a7f02775848cf1 Mon Sep 17 00:00:00 2001 From: Ave Ozkal Date: Fri, 18 Jan 2019 17:51:40 +0300 Subject: [PATCH] Push some of the code --- README.md | 20 +++++++++++++++++++- emojireplace.sh | 10 ++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 emojireplace.sh diff --git a/README.md b/README.md index 59f72793..ff87bc06 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,21 @@ # cutthecord -Discord Android app patches \ No newline at end of file +Discord Android app patches + +## Toolchain setup + +- Get apktool +- Get a keystore, see [here](https://stackoverflow.com/a/14994354/3286892), step 1. +- Get 72x72 copies of latest version of mutant standard emojis with codepoints. I have a zip [here](https://mutant.lavatech.top/72x72.zip). +- Extract the emojis you got somewhere, then prepend `emoji_` to their names (`for f in * ; do mv -- "$f" "emoji_$f" ; done`). +- Get rid of `-fe0f` on filenames to fix render of some emojis (`find . -name '*png' -exec bash -c ' mv $0 ${0/-fe0f/}' {} \;`). +- Clone this repo somewhere, edit `emojireplace.sh` and set the variables to the folders you want it to run on. + +## Building an patched discord app + +- Get a Discord apk (*cough* [aptoide](https://ws75.aptoide.com/api/7/app/getMeta?package_name=com.discord)), and get the patches you want for that version. If the patches aren't available, you'll have to port them yourself. +- Apply the patches you want +- Edit `emojireplace.sh` to point to right directories, and apply emoji patches (`bash emojireplace.sh`) +- Build the new APK (`apktool b com.discord-831`) +- Sign the new APK (`jarsigner -keystore /dist/.apk `) +- Get your new APK from `/dist/.apk`, install and enjoy! diff --git a/emojireplace.sh b/emojireplace.sh new file mode 100644 index 00000000..1f0a4dcd --- /dev/null +++ b/emojireplace.sh @@ -0,0 +1,10 @@ +#!/bin/bash +EXTRACTED_DISCORD="/home/ave/Downloads/dic/com.discord-830" +EXTRACTED_MUTSTD="/home/ave/Downloads/emojo/72x72" +for filename in $EXTRACTED_DISCORD/res/raw/*.png; do + basefilename=$(basename $filename) + if [ -f $EXTRACTED_MUTSTD/$basefilename ]; then + echo "$basefilename replaced" + \cp $EXTRACTED_MUTSTD/$basefilename $filename + fi +done