commit 07891c977876d692032ad5a67c7151c6fa89625f Author: Dominika Date: Sat Jul 25 03:27:25 2020 +0200 Initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..1579c77 --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# mBank mobile app deadname remover + +On the main screen of the mighty mBank mobile app, there's a huge text welcoming the user to the app. It isn't problematic for most, but what if your name has changed, but it's legally still the old one? Well, this shell script to the rescue! + +## Instructions + +1. Get mBank's `base.apk` from your device - it usually sits somewhere in `/data/app/*/base.apk` +2. Run the script with the APK as a parameter, and your real name as the second one - `./mbankDeadnameRemover.sh base.apk Laura` +3. Transfer the patched APK back to your device +4. Uninstall the old application from your device - this is needed, as Android won't let you install a self-signed application over another application +5. Install the APK, pair the app with mBank +6. ??? +7. Profit! \ No newline at end of file diff --git a/mbankDeadnameRemover.sh b/mbankDeadnameRemover.sh new file mode 100755 index 0000000..9f9df60 --- /dev/null +++ b/mbankDeadnameRemover.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +if [[ $# -lt 2 ]]; then + echo "usage: $0 " + exit 0 +fi + +apk=$(realpath $1) + +mkdir mbank +cd mbank +[[ ! -f "apktool.jar" ]] && wget https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.4.1.jar -O apktool.jar +[[ ! -f "signapk.jar" ]] && wget https://github.com/techexpertize/SignApk/raw/master/signapk.jar -O signapk.jar +java -jar apktool.jar d $apk -o base +strings_file_en=$(grep -Rl "Hello, %s" base/res/*) +strings_file_pl=$(grep -Rl "Witaj, %s" base/res/*) +sed -i "s/Hello, \%s/Hello, $2/" $strings_file_en +sed -i "s/Witaj, \%s/Witaj, $2/" $strings_file_pl + +if [[ ! -f "crypto.crt" || ! -f "key.pk8" ]]; then + openssl genrsa -out crypto.key 1024 + openssl req -new -key crypto.key -out crypto.csr -subj "/C=PL/ST=Warsaw/L=Warsaw/O=Paweł Tanajno Rigcz Hawajska+ hacker collective" + openssl x509 -req -days 9999 -in crypto.csr -signkey crypto.key -out crypto.crt + cat crypto.key crypto.crt > certificate.pem + openssl pkcs8 -topk8 -outform DER -in certificate.pem -inform PEM -out key.pk8 -nocrypt + rm crypto.key crypto.csr certificate.pem +fi + +java -jar apktool.jar b base -o out.apk +java -jar signapk.jar crypto.crt key.pk8 out.apk out_signed.apk + +rm -R mbank/base + +echo "IMPORTANT NOTE: please store crypto.crt and key.pk8 in a safe place - you'll need them to sign the app after any updates." +echo "OUTPUT FILE: mbank/out_signed.apk" \ No newline at end of file