chore: treewide: double quote all $DIRPATH usage

shouldve made this into the initial treewide sed me noob

Signed-off-by: fukiame <fukiame@proton.me>
This commit is contained in:
Hikarie Fukirei 2025-07-30 09:53:39 +07:00
commit 3e1e7318a1
2 changed files with 23 additions and 23 deletions

View file

@ -22,17 +22,17 @@ if [ "$opt" == 'Bypass 1200 error [v6.4.45]' ]; then
rm -rf bypass1200
## MB Forced update to 658, it must be spoofed!
echo "Patching [apktool.yml]..."
sed -i 's|658|700|g' $DIRPATH/mbapk/mbapk_unpacked/apktool.yml
sed -i 's|658|700|g' "$DIRPATH"/mbapk/mbapk_unpacked/apktool.yml
echo "This patch are applied by MBCPApp Patcher on $(uname -s -r) with commit :" $(git rev-parse --short HEAD) at $(git show -s --format=%cd HEAD). > 'mbapk/mbapk_unpacked/assets/mbcp_info/bypass_1200_error.inf'
# Placeholder patch, not yet implemented
elif [ "$opt" == 'Bypass signature check' ]; then
echo "Applying patch [Bypass signature check]..."
if [ -d $DIRPATH/mbapk/mbapk_unpacked ]
if [ -d "$DIRPATH"/mbapk/mbapk_unpacked ]
then
# Checks for MBShield, if exists then exit function
if [ -f $DIRPATH/mbapk/mbapk_unpacked/assets/mbshield.szip ]
if [ -f "$DIRPATH"/mbapk/mbapk_unpacked/assets/mbshield.szip ]
then
echo "INFO : MBShield found on unpacked APK ! Bypass signature checks won't be possible if MBShield is present on current unpacked APK !"
echo "INFO : Please use supported version !!!"
@ -51,16 +51,16 @@ if [ "$opt" == 'Bypass 1200 error [v6.4.45]' ]; then
fi
elif [ "$opt" == '[TEST] Remove v6.4.56 root detection' ]; then
if [ -f $DIRPATH/mbapk/mbapk_unpacked/smali/androidx/UnderlyingVcl.smali ]
if [ -f "$DIRPATH"/mbapk/mbapk_unpacked/smali/androidx/UnderlyingVcl.smali ]
then
echo "Applying patch..."
echo "Removing checksum from provider..."
sed -i 's|e1a14adc915d7ad159edf2668b0dfcb359cf86538642de0e425d027f66eb07b2||g' $DIRPATH/mbapk/mbapk_unpacked/smali/androidx/UnderlyingVcl.smali
sed -i 's|ca168a2ad00a92b8010d6801c3ca43e6df9f3701f084f6864399eaa4bbfaf56d||g' $DIRPATH/mbapk/mbapk_unpacked/smali/androidx/UnderlyingVcl.smali
sed -i 's|5c9a139e42e6e6032ddbc1092af9831b8142e4e5ae89700fc7828f5bd62e1671||g' $DIRPATH/mbapk/mbapk_unpacked/smali/androidx/UnderlyingVcl.smali
sed -i 's|c0a161a71738083df4298a0f03b0c54abf5bfda97c7d230875d97593733226ec||g' $DIRPATH/mbapk/mbapk_unpacked/smali/androidx/UnderlyingVcl.smali
sed -i 's|designersactivists |weneedfreedom|g' $DIRPATH/mbapk/mbapk_unpacked/smali/androidx/UnderlyingVcl.smali
sed -i 's|e1a14adc915d7ad159edf2668b0dfcb359cf86538642de0e425d027f66eb07b2||g' "$DIRPATH"/mbapk/mbapk_unpacked/smali/androidx/UnderlyingVcl.smali
sed -i 's|ca168a2ad00a92b8010d6801c3ca43e6df9f3701f084f6864399eaa4bbfaf56d||g' "$DIRPATH"/mbapk/mbapk_unpacked/smali/androidx/UnderlyingVcl.smali
sed -i 's|5c9a139e42e6e6032ddbc1092af9831b8142e4e5ae89700fc7828f5bd62e1671||g' "$DIRPATH"/mbapk/mbapk_unpacked/smali/androidx/UnderlyingVcl.smali
sed -i 's|c0a161a71738083df4298a0f03b0c54abf5bfda97c7d230875d97593733226ec||g' "$DIRPATH"/mbapk/mbapk_unpacked/smali/androidx/UnderlyingVcl.smali
sed -i 's|designersactivists |weneedfreedom|g' "$DIRPATH"/mbapk/mbapk_unpacked/smali/androidx/UnderlyingVcl.smali
echo "Patching [libdesignersactivists.so]..."
sed -i 's|com.zimperium|app.dontfixew|g' 'mbapk/mbapk_unpacked/lib/arm64-v8a/libdesignersactivists.so'
sed -i 's|detection|freedom..|g' 'mbapk/mbapk_unpacked/lib/armeabi-v7a/libdesignersactivists.so'

View file

@ -5,9 +5,9 @@ FILEPATH=$(readlink -f "$0")
export DIRPATH=$(dirname "$FILEPATH")
# Initial startup
mkdir -p $DIRPATH/mbapk
mkdir -p $DIRPATH/mbcpapp_apk
mkdir -p $DIRPATH/tools
mkdir -p "$DIRPATH"/mbapk
mkdir -p "$DIRPATH"/mbcpapp_apk
mkdir -p "$DIRPATH"/tools
clear
# Check if user runs on actual Linux environment
@ -64,20 +64,20 @@ copy_assets() {
adb shell su -c cp -rf "/data/user/0/com.mbmobile/files/$1" /sdcard/assets
}
is_unpacked() { [ -d $DIRPATH/mbapk/mbapk_unpacked ] ; }
is_unpacked() { [ -d "$DIRPATH"/mbapk/mbapk_unpacked ] ; }
is_unpacked_lib() {
[ -d $DIRPATH/mbapk/mbapk_unpacked/lib ] || {
[ -d "$DIRPATH"/mbapk/mbapk_unpacked/lib ] || {
echo "ERROR : [mbapk_unpacked/lib] folder not found ! Please unpack APK first !" ; return 127
}
}
apktool_exist() {
[ -f $DIRPATH/tools/apktool.jar ] || { echo "ERROR : apktool not found" ; return 127 ; }
[ -f "$DIRPATH"/tools/apktool.jar ] || { echo "ERROR : apktool not found" ; return 127 ; }
}
apkeditor_exist() {
[ -f $DIRPATH/tools/apkeditor.jar ] || { echo "ERROR : apkeditor not found" ; return 127 ; }
[ -f "$DIRPATH"/tools/apkeditor.jar ] || { echo "ERROR : apkeditor not found" ; return 127 ; }
}
mb_apk_exist() {
ls $DIRPATH/mbapk/*.apk >/dev/null 2>&1 || {
ls "$DIRPATH"/mbapk/*.apk >/dev/null 2>&1 || {
echo "No *.apk found in [mbapk] folder, please copy apk to [mbapk] folder !"
echo "If you got apks from eMBee APKs, use [Convert apks to apk] option !"
}
@ -148,7 +148,7 @@ check_mbshield() {
echo "[mbapk_unpacked] not found ! Please unpack APK first !"
return 1
}
if [ -f $DIRPATH/mbapk/mbapk_unpacked/assets/mbshield.szip ]
if [ -f "$DIRPATH"/mbapk/mbapk_unpacked/assets/mbshield.szip ]
then
echo "$mbshield_found"
else
@ -158,7 +158,7 @@ check_mbshield() {
convert_apks() {
local - ; set -e
ls $DIRPATH/mbapk/*.apks >/dev/null 2>&1 || {
ls "$DIRPATH"/mbapk/*.apks >/dev/null 2>&1 || {
echo "APKs missing, cannot continue !"
return 1
}
@ -215,9 +215,9 @@ do
echo 'By trigger eKYC authetication with reset account password option or register DigitalOTP'
echo 'After you got into eKYC screen, close the app, then use Extract assets option to extract assets.'
elif [ "$opt" == 'Extract assets' ]; then
if [ -d $DIRPATH/mbapk/mbapk_unpacked/ ]
if [ -d "$DIRPATH"/mbapk/mbapk_unpacked/ ]
then
if [ -f $DIRPATH/mbapk/mbapk_unpacked/assets/mbshield.szip ]
if [ -f "$DIRPATH"/mbapk/mbapk_unpacked/assets/mbshield.szip ]
then
echo "INFO : MBShield found ! Continuing !!!"
echo 'You MUST grant root access to [com.android.shell] in order to extract assets !'
@ -308,7 +308,7 @@ done
select opt in 'App patched with newer version [v6.4.56 or higher]' 'App patched with older version [v6.4.55 or lower]' 'Exit'
do
if [ "$opt" == 'App patched with newer version [v6.4.56 or higher]' ]; then
if [ -f $DIRPATH/mbcpapp_apk/MBCP_Flutter_SelfPatched.apk ]
if [ -f "$DIRPATH"/mbcpapp_apk/MBCP_Flutter_SelfPatched.apk ]
then
echo "MBCP Helper / CorePatch must be installed with disable digest verify on !!!"
echo "You must have connected Android device with USB debugging turned on in order to install !!!"
@ -327,7 +327,7 @@ do
fi
elif [ "$opt" == 'App patched with older version [v6.4.55 or lower]' ]; then
if [ -f $DIRPATH/mbcpapp_apk/MBCP_Flutter_SelfPatched.apk ]
if [ -f "$DIRPATH"/mbcpapp_apk/MBCP_Flutter_SelfPatched.apk ]
then
echo "MBCP Helper / CorePatch must be installed with disable digest verify on !!!"
echo "You must have connected Android device with USB debugging turned on in order to install !!!"