From 719dec222bba63ed03a9c64db58a25b202bec144 Mon Sep 17 00:00:00 2001 From: Cuynu Date: Fri, 22 Aug 2025 04:38:58 +0700 Subject: [PATCH] feat: mbtombcp: init Signed-off-by: Cuynu --- META-INF/com/google/android/update-binary | 33 ++++++++++++++++++++++ META-INF/com/google/android/updater-script | 1 + README.md | 6 ++++ action.sh | 28 ++++++++++++++++++ createmodule.sh | 12 ++++++++ customize.sh | 28 ++++++++++++++++++ module.prop | 7 +++++ service.sh | 3 ++ 8 files changed, 118 insertions(+) create mode 100644 META-INF/com/google/android/update-binary create mode 100644 META-INF/com/google/android/updater-script create mode 100644 README.md create mode 100755 action.sh create mode 100755 createmodule.sh create mode 100755 customize.sh create mode 100755 module.prop create mode 100755 service.sh diff --git a/META-INF/com/google/android/update-binary b/META-INF/com/google/android/update-binary new file mode 100644 index 0000000..c624bcf --- /dev/null +++ b/META-INF/com/google/android/update-binary @@ -0,0 +1,33 @@ +#!/sbin/sh + +################# +# Initialization +################# + +umask 022 + +# echo before loading util_functions +ui_print() { echo "$1"; } + +require_new_magisk() { + ui_print "*******************************" + ui_print " Please install Magisk v20.4+! " + ui_print "*******************************" + exit 1 +} + +######################### +# Load util_functions.sh +######################### + +OUTFD=$2 +ZIPFILE=$3 + +mount /data 2>/dev/null + +[ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk +. /data/adb/magisk/util_functions.sh +[ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk + +install_module +exit 0x diff --git a/META-INF/com/google/android/updater-script b/META-INF/com/google/android/updater-script new file mode 100644 index 0000000..11d5c96 --- /dev/null +++ b/META-INF/com/google/android/updater-script @@ -0,0 +1 @@ +#MAGISK diff --git a/README.md b/README.md new file mode 100644 index 0000000..5066991 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# MB to MBCP Fix + +- This module are only used for who used MBZDefend-Fix module before with original app. +- It will re-enable UnderlyingVcl provider which allow app to working properly. + +# [Download from releases](https://git.disroot.org/mbcp/mbtombcp/releases) diff --git a/action.sh b/action.sh new file mode 100755 index 0000000..be70c1f --- /dev/null +++ b/action.sh @@ -0,0 +1,28 @@ +#!/system/bin/sh + +# 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");' +# 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 diff --git a/createmodule.sh b/createmodule.sh new file mode 100755 index 0000000..dae7cf3 --- /dev/null +++ b/createmodule.sh @@ -0,0 +1,12 @@ +#!/bin/bash +echo "Creating module (*.zip)..." +rm MBtoMBCP_fix.zip +zip -r MBtoMBCP_fix.zip *.sh *.prop META-INF +if [ -f MBtoMBCP_fix.zip ]; then + echo "Module saved to [MBtoMBCP_fix.zip], try to flash it :>" +else + echo "Where is [MBtoMBCP_fix.zip] ?" + echo "Did module actually created yet... Try fetch repo and use command again!" + echo "If your system doesn't have [zip], pls install it" +fi + diff --git a/customize.sh b/customize.sh new file mode 100755 index 0000000..8ccc63d --- /dev/null +++ b/customize.sh @@ -0,0 +1,28 @@ +#!/system/bin/sh +# Delete old MBZDefend-Fix module +rm -rf /data/adb/modules/zdefend-fix +# 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 +# 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");' +# 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 diff --git a/module.prop b/module.prop new file mode 100755 index 0000000..358b690 --- /dev/null +++ b/module.prop @@ -0,0 +1,7 @@ +id=mbcp-fix +name=MB-to-MBCP Fix +version=v1.1-mbcp +versionCode=11 +author=cuynu +description=Fixes device not secure issue after install MBCP from original MB with MBZDefend-Fix +updateJson= diff --git a/service.sh b/service.sh new file mode 100755 index 0000000..d683b89 --- /dev/null +++ b/service.sh @@ -0,0 +1,3 @@ +#!/system/bin/sh + +pm enable com.mbmobile/androidx.UnderlyingVcl \ No newline at end of file