From 31c180b3acca1ec74143acdcd7356a1cd877f97e Mon Sep 17 00:00:00 2001 From: Cuynu Date: Mon, 26 Jan 2026 20:10:47 +0700 Subject: [PATCH] feat: new VTAP fail ~check method & vtapfail/vtapstillfail as a function using logcat for finding VTAP activity, if it exists then open vtapfix site can handle some specific cases such as VTAP is provisioned, but the app not work and crashing or opens VTAP activity it might happens with KernelSU (original packageName) , the app is triggering but VTAP still got provisioned Signed-off-by: Cuynu --- module_new/zdefend-fix/action.sh | 35 ++++++++++++++++++++-- module_new/zdefend-fix/customize.sh | 40 ++++++++++++++++++++----- module_new/zdefend-fix/service.sh | 2 -- module_new/zdefend-fix/vtapnotinit.sh | 7 ----- module_new/zdefend-fix/vtapstillfail.sh | 16 ---------- 5 files changed, 65 insertions(+), 35 deletions(-) delete mode 100644 module_new/zdefend-fix/vtapnotinit.sh delete mode 100644 module_new/zdefend-fix/vtapstillfail.sh diff --git a/module_new/zdefend-fix/action.sh b/module_new/zdefend-fix/action.sh index c218398..b1a45e4 100644 --- a/module_new/zdefend-fix/action.sh +++ b/module_new/zdefend-fix/action.sh @@ -2,21 +2,48 @@ SYSLANGVI="$(getprop persist.sys.locale | grep vi-VN)" +INSTALLEN="https://git.disroot.org/mbcp/info_en/wiki/mbcpinstall" +INSTALLVI="https://git.disroot.org/mbcp/info_vi/wiki/mbcpinstall" + notmbcp() { echo "MB Bank [com.mbmobile] is installed, but it seems like that the app is NOT MBCP" echo "Please install MBCP v6.4.60+ in order to use this module !" - am start -a android.intent.action.VIEW -d https://git.disroot.org/mbcp/info/wiki/mbcpinstall + [[ $SYSLANGVI ]] && am start -a android.intent.action.VIEW -d $INSTALLVI || am start -a android.intent.action.VIEW -d $INSTALLEN exit 1 } +vtapfail() { + echo "VTAP is not provisioned!" + echo "App first normal launch required!" + iptables -t nat -F OUTPUT + am start -n com.mbmobile/io.flutter.plugins.MainActivity + logcat -c + sleep 20 + logcat -d | grep VGFullScreenDialog && vtapstillfail + am force-stop com.mbmobile +} + +vtapstillfail() { + echo "VTAP provision failed or triggering! Cannot continue!" + echo "If you have low-end device (eg : Vsmart Joy 2+)" + echo "Try to reinstall module again 3 more times." + if [ $SYSLANGVI ]; then + am start -a android.intent.action.VIEW -d https://git.disroot.org/mbcp/info_vi/wiki/vtapfix + exit 169 +else + am start -a android.intent.action.VIEW -d https://git.disroot.org/mbcp/info_en/wiki/vtapfix + exit 169 +fi +} + # Check for original MB Bank app for library in $(find /data/app -name libvvb2060.so | grep com.mbmobile) ; do notmbcp ; done # Check VTAP status to ensure that it must be provisioned echo "Checking VTAP status..." -echo "VTAP status : " && cat '/data/data/com.mbmobile/databases/vtap' | grep "true" && echo "VTAP is provisioned!" || sh 'vtapnotinit.sh' +echo "VTAP status : " && cat '/data/data/com.mbmobile/databases/vtap' | grep "true" && echo "VTAP is provisioned!" || vtapfail || exit 169 echo "Checking VTAP status again..." -cat '/data/data/com.mbmobile/databases/vtap' | grep "true" && echo "VTAP is provisioned!" || sh 'vtapstillfail.sh' || exit 169 +cat '/data/data/com.mbmobile/databases/vtap' | grep "true" && echo "VTAP is provisioned!" || vtapstillfail || exit 169 # 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..." @@ -24,6 +51,7 @@ echo "Deleting /data/magisk if it exists..." find /data -name 'magisk_backup*' -delete echo Forcing stop MB Bank... am force-stop com.mbmobile +logcat -c rm -rf /data/data/com.mbmobile/files/0* rm -rf /data/data/com.mbmobile/files/1* rm -rf /data/data/com.mbmobile/files/2* @@ -43,6 +71,7 @@ echo "Press [Try again] after got 1005/1007/VPN error on MB, so it's can bypass iptables -t nat -A OUTPUT -p tcp -j DNAT --to-destination 162.159.152.4 am start -n com.mbmobile/io.flutter.plugins.MainActivity sleep 20 +logcat -d | grep VGFullScreenDialog && vtapstillfail echo "Restoring network traffic" # Reference : https://gist.github.com/jstrosch/3190568 (Line 7) iptables -t nat -F diff --git a/module_new/zdefend-fix/customize.sh b/module_new/zdefend-fix/customize.sh index e4ba03a..4f36bf7 100644 --- a/module_new/zdefend-fix/customize.sh +++ b/module_new/zdefend-fix/customize.sh @@ -36,6 +36,30 @@ tsnghma() { pm hide com.tsng.hidemyapplist } +vtapfail() { + echo "VTAP is not provisioned!" + echo "App first normal launch required!" + iptables -t nat -F OUTPUT + am start -n com.mbmobile/io.flutter.plugins.MainActivity + logcat -c + sleep 20 + logcat -d | grep VGFullScreenDialog && vtapstillfail + am force-stop com.mbmobile +} + +vtapstillfail() { + echo "VTAP provision failed or triggering! Cannot continue!" + echo "If you have low-end device (eg : Vsmart Joy 2+)" + echo "Try to reinstall module again 3 more times." + if [ $SYSLANGVI ]; then + am start -a android.intent.action.VIEW -d https://git.disroot.org/mbcp/info_vi/wiki/vtapfix + exit 169 +else + am start -a android.intent.action.VIEW -d https://git.disroot.org/mbcp/info_en/wiki/vtapfix + exit 169 +fi +} + [[ -d /data/data/com.tsng.hidemyapplist ]] && tsnghma [[ -d /data/data/io.github.Nirtal0.magisk ]] && maliciousmagisk @@ -94,11 +118,6 @@ else pm grant com.mbmobile android.permission.READ_PHONE_STATE fi -unzip -o "$ZIPFILE" 'vtapnotinit.sh' -unzip -o "$ZIPFILE" 'vtapstillfail.sh' -chmod +x 'vtapstillfail.sh' -chmod +x 'vtapnotinit.sh' - # Delete /data/magisk if it exists so MB doesnt failling when eKYC with error code EKYC3002-MS6998 for Magisk users [ -d /data/magisk ] && echo "Magisk folder found! deleting..." && rm -r /data/magisk find /data -name 'magisk_backup*' -delete @@ -114,13 +133,16 @@ fi # Check VTAP status to ensure that it must be provisioned echo "Checking VTAP status..." -echo "VTAP status : " && cat '/data/data/com.mbmobile/databases/vtap' | grep "true" && echo "VTAP is provisioned!" || sh 'vtapnotinit.sh' +echo "VTAP status : " && cat '/data/data/com.mbmobile/databases/vtap' | grep "true" && echo "VTAP is provisioned!" || vtapfail || exit 169 echo "Checking VTAP status again..." -cat '/data/data/com.mbmobile/databases/vtap' | grep "true" && echo "VTAP is provisioned!" || sh 'vtapstillfail.sh' || exit 169 +cat '/data/data/com.mbmobile/databases/vtap' | grep "true" && echo "VTAP is provisioned!" || vtapstillfail || exit 169 echo Force closing MBBank app... am force-stop com.mbmobile +# Clear device logcat to ensure that no previous VTAP activity exists +logcat -c + # Support for Biz MB Bank v2.0 (Flutter version) for library in $(find /data/app -name libholdingshadow.so | grep com.mbbank.biz.prod) ; do rm $library ; done sleep 2 @@ -144,6 +166,10 @@ echo "Press [Try again] after got 1005/1007/VPN error on MB, so it's can bypass iptables -t nat -A OUTPUT -p tcp -j DNAT --to-destination 162.159.152.4 am start -n com.mbmobile/io.flutter.plugins.MainActivity sleep 20 + +# Look for VTAP activity from logcat +logcat -d | grep VGFullScreenDialog && vtapstillfail + echo "Restoring network traffic" # Reference : https://gist.github.com/jstrosch/3190568 (Line 7) iptables -t nat -F diff --git a/module_new/zdefend-fix/service.sh b/module_new/zdefend-fix/service.sh index 5ed6433..019eec3 100644 --- a/module_new/zdefend-fix/service.sh +++ b/module_new/zdefend-fix/service.sh @@ -6,8 +6,6 @@ done # Delete /data/magisk if it exists so MB doesnt failling when eKYC with error code EKYC3002-MS6998 for Magisk users [[ -d /data/magisk ]] && rm -r /data/magisk -[[ -d /data/data/io.github.x0eg0.magisk ]] && rm -r /data/adb/modules/zdefend-fix -[[ -d /data/data/io.github.Nirtal0.magisk ]] && rm -r /data/adb/modules/zdefend-fix rm -rf /data/data/com.mbmobile/files/0* rm -rf /data/data/com.mbmobile/files/1* rm -rf /data/data/com.mbmobile/files/2* diff --git a/module_new/zdefend-fix/vtapnotinit.sh b/module_new/zdefend-fix/vtapnotinit.sh deleted file mode 100644 index f62c1bf..0000000 --- a/module_new/zdefend-fix/vtapnotinit.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/system/bin/sh -echo "VTAP is not provisioned!" -echo "App first normal launch required!" -iptables -t nat -F OUTPUT -am start -n com.mbmobile/io.flutter.plugins.MainActivity -sleep 10 -am force-stop com.mbmobile diff --git a/module_new/zdefend-fix/vtapstillfail.sh b/module_new/zdefend-fix/vtapstillfail.sh deleted file mode 100644 index bdbe85d..0000000 --- a/module_new/zdefend-fix/vtapstillfail.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/system/bin/sh - -SYSLANGVI="$(getprop persist.sys.locale | grep vi-VN)" - -echo "VTAP provision failed! Cannot continue!" -echo "If you have low-end device (eg : Vsmart Joy 2+)" -echo "Try to reinstall module again 3 more times." - -if [ $SYSLANGVI ]; then - am start -a android.intent.action.VIEW -d https://git.disroot.org/mbcp/info_vi/wiki/vtapfix -else - am start -a android.intent.action.VIEW -d https://git.disroot.org/mbcp/info_en/wiki/vtapfix -fi - -exit 100 -