70 lines
2 KiB
Shell
Executable file
70 lines
2 KiB
Shell
Executable file
#!/usr/bin/env bash
|
|
|
|
APKTOOL_LINK="https://github.com/iBotPeaches/Apktool/releases/download/v3.0.2/apktool_3.0.2.jar"
|
|
APKEDITOR_LINK="https://github.com/REAndroid/APKEditor/releases/download/V1.4.8/APKEditor-1.4.8.jar"
|
|
|
|
# functions
|
|
javanotexist() {
|
|
echo "Java/OpenJDK is not installed!"
|
|
echo "Please install Java/OpenJDK for your system to continue!"
|
|
exit 1
|
|
}
|
|
|
|
mbapks() {
|
|
[ ! -f mbrn_apk/*.apks ] && echo "No APKs found! Please copy original app to [mbrn_apk] folder!"
|
|
}
|
|
|
|
alreadyunpacked() {
|
|
echo "APK is already unpacked."
|
|
exit 1
|
|
}
|
|
|
|
# create necessary folder (this will be ignored in gitignore)
|
|
[ ! -d tools ] && mkdir -p tools
|
|
[ ! -d mbrn_apk ] && mkdir -p mbrn_apk
|
|
[ ! -d mbrn_out ] && mkdir -p mbrn_out
|
|
|
|
# check if java/openjdk is installed or not
|
|
if command -v java ; then
|
|
echo "Java is installed!"
|
|
else
|
|
javanotexist
|
|
fi
|
|
|
|
# figlet banner check
|
|
if command -v figlet ; then
|
|
FIGLET="figlet"
|
|
else
|
|
FIGLET=:
|
|
fi
|
|
|
|
# Main banner
|
|
$FIGLET "MBRN Patcher"
|
|
echo "----------------------------------------------------"
|
|
echo "Open source tool for patching MB Bank React Native"
|
|
echo "Written by Cuynu from scratch with specific video."
|
|
echo "Supported app eta : v6.3.11 (React Native)"
|
|
echo "----------------------------------------------------"
|
|
PS3='Pls select smth : '
|
|
select opt in 'Unpack APK' 'Convert apks to apk' 'Repack APK' 'Download tools' 'Exit'
|
|
do
|
|
if [ "$opt" == 'Unpack APK' ]; then
|
|
[ -d mbrn_apk/mbrn_unpacked ] && alreadyunpacked
|
|
java -jar tools/apktool.jar d mbrn_apk/mbrn_app.apk -o mbrn_apk/mbrn_unpacked
|
|
|
|
elif [ "$opt" == 'Repack APK' ]; then
|
|
echo "smth"
|
|
|
|
elif [ "$opt" == 'Convert apks to apk' ]; then
|
|
mbapks
|
|
java -jar tools/apkeditor.jar merge -i mbrn_apk/*.apks -o mbrn_apk/mbrn_app.apk
|
|
|
|
elif [ "$opt" == 'Download tools' ]; then
|
|
[ ! -f tools/apktool.jar ] && wget $APKTOOL_LINK -O tools/apktool.jar || echo "apktool already downloaded!"
|
|
[ ! -f tools/apkeditor.jar ] && wget $APKEDITOR_LINK -O tools/apkeditor.jar || echo "apkeditor already downloaded!"
|
|
|
|
elif [ "$opt" == 'Exit' ]; then
|
|
exit
|
|
|
|
fi
|
|
done
|