This repository has been archived on 2025-12-16. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
mbtombcp/action.sh
Cuynu aa470d6a75 feat: action.sh: customize.sh: add original app check
and then redirect to mbcpinstall if users on original app

Signed-off-by: Cuynu <cuynu@proton.me>
2025-08-22 15:15:36 +07:00

31 lines
2 KiB
Shell
Executable file

#!/system/bin/sh
for library in $(find /data/app -name libtoolChecker.so | grep com.mbmobile) ; do echo "Please install MBCP v6.4.60+ !" && am start -a android.intent.action.VIEW -d https://git.disroot.org/mbcp/info/wiki/mbcpinstall && exit 1 ; done
# Check if users trying to install this module under KernelSU/Next/RKSU/APatch
[[ -f /data/adb/apd ]] && echo "APatch detected!" && echo "Enabling provider..." && pm enable com.mbmobile/androidx.UnderlyingVcl && for library in $(find /data/app -name libweneedfreedom.so | grep com.mbmobile) ; do am start -n com.mbmobile/io.flutter.plugins.MainActivity ; done && exit 0
[[ -f /data/adb/ksud ]] && echo "KernelSU/Next/RKSU detected!" && echo "Enabling provider..." && pm enable com.mbmobile/androidx.UnderlyingVcl && for library in $(find /data/app -name libweneedfreedom.so | grep com.mbmobile) ; do am start -n com.mbmobile/io.flutter.plugins.MainActivity ; done && exit 0
# Magisk related code (should not be used for other root solution)
# Delete /data/magisk if it exists so MB doesnt failling when eKYC with error code EKYC3002-MS6998 for Magisk users
echo "Deleting /data/magisk if it exists..."
[[ -d /data/magisk ]] && rm -r /data/magisk
find /data -name 'magisk_backup*' -delete
# Enable bulit-in zygisk
echo "Enabling bulit-in zygisk..."
magisk --sqlite 'insert into settings (key,value) values("zygisk","1");'
magisk --sqlite 'replace into settings (key,value) values("zygisk","1");'
# Bulit-in zygisk is enough for MBCP...
echo "Deleting ZygiskNext/ReZygisk..."
rm -rf /data/adb/modules/zygisksu
rm -rf /data/adb/modules/rezygisk
echo "Enabling Denylist..."
magisk --denylist enable
magisk --denylist add com.mbmobile
echo "Use this only if you are replaced official app with MBCP"
echo "But also used MBZDefend-Fix module before!"
pm enable com.mbmobile/androidx.UnderlyingVcl
echo "Finding for MBCP app..."
for library in $(find /data/app -name libweneedfreedom.so | grep com.mbmobile) ; do am start -n com.mbmobile/io.flutter.plugins.MainActivity ; done
exit 0