From d68aeec26e28753ff8db86e43145b99a603c3b06 Mon Sep 17 00:00:00 2001 From: Cuynu Date: Sun, 24 Aug 2025 16:19:39 +0700 Subject: [PATCH] feat: logmb: initial commit Signed-off-by: Cuynu --- META-INF/com/google/android/update-binary | 33 +++++++++++ META-INF/com/google/android/updater-script | 1 + README.md | 38 ++++++++++++ createmodule.sh | 12 ++++ customize.sh | 67 ++++++++++++++++++++++ module.prop | 7 +++ 6 files changed, 158 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 createmodule.sh create mode 100755 customize.sh create mode 100755 module.prop 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..c1c4344 --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +# Dump MB Logs + +- Since v6.4.60+, MB hidden the `client.log` under `/data/data/com.mbmobile/cache` or `/data/data/com.mbmobile/app_flutter` even without internet connection. This make debugging even more harder for us. +- The only place where logs exists since v6.4.60+ is `/data/data/com.mbmobile/app_flutter/hive_databases` but it's encrypted and cannot be read. +- Only way for now is force v6.4.59 libraries to current app. + +# [Download from releases](https://git.disroot.org/mbcp/mbtombcp/releases) + +## Made module manually + +- Grab v6.4.59 apks from [Telegram : eMBee APKs](https://t.me/embeeapks) or [Lotus Chat: MB Bank APKs](https://lotuschat.vn/w/+anSH1BbDbAYn54JC9nIC9A) +- Unzip it : +- For arm64 : +``` +unzip embee_v6.4.59_679_arm64-v8a_armeabi-v7a.apks +unzip split_config.arm64_v8a.apk +``` +- Grab `libapp.so` from extracted [split_config.arm64_v8a.apk] to logmb folder, then run +``` +./createmodule.sh +``` + +For armeabi-v7a +- Run this command under `logmb` folder +``` +sed -i 's|arm64|arm|g' customize.sh +``` +- Grab v6.4.59 apks from [Telegram : eMBee APKs](https://t.me/embeeapks) or [Lotus Chat: MB Bank APKs](https://lotuschat.vn/w/+anSH1BbDbAYn54JC9nIC9A) +- Unzip it : +``` +unzip embee_v6.4.59_679_arm64-v8a_armeabi-v7a.apks +unzip split_config.armeabi_v7a.apk +``` +- Grab `libapp.so` from extracted [split_config.armeabi_v7a.apk] to logmb folder, then run +``` +./createmodule.sh +``` + diff --git a/createmodule.sh b/createmodule.sh new file mode 100755 index 0000000..30cdfb4 --- /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 *.so 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..5f7e929 --- /dev/null +++ b/customize.sh @@ -0,0 +1,67 @@ +#!/system/bin/sh + +# Find app path with lib +dumpsys package com.mbmobile | grep legacyNativeLibraryDir > /data/local/tmp/path.txt +sed -i 's|legacyNativeLibraryDir=||g' /data/local/tmp/path.txt +sed -i 's| ||g' /data/local/tmp/path.txt + +LIBPATH="$(cat /data/local/tmp/path.txt)" + +echo Current lib path : "$LIBPATH" + +# Backup old libapp.so to restore it after dumped client.log +cp -f "$LIBPATH/arm64/libapp.so" "/data/local/tmp" + +echo "Copying original libraries [libapp.so]..." +unzip -o "$ZIPFILE" 'libapp.so' -d "$LIBPATH/arm64" + +# Disable network access to dump logs (behaviour from app bundle) +su -c svc wifi disable +su -c svc data disable + +am force-stop com.mbmobile +am start -n com.mbmobile/io.flutter.plugins.MainActivity +sleep 10 + +echo "Dumping app log..." +cp -f '/data/data/com.mbmobile/cache/client.log' '/sdcard/' && echo "Success dump app logs! Location : [/sdcard/client.log]" + +echo "Restoring original libraries [libapp.so] to lib path..." +cp -f "/data/local/tmp/libapp.so" "$LIBPATH/arm64" + +echo "Forcing stop app..." +am force-stop com.mbmobile && echo "Done!" + +# Enable network access again +su -c svc wifi enable +su -c svc data enable + +echo "IGNORE installation failed error. It's excepted as this isn't real module." +exit 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/module.prop b/module.prop new file mode 100755 index 0000000..8f543d8 --- /dev/null +++ b/module.prop @@ -0,0 +1,7 @@ +id=mblog +name=Dump MB Logs +version=v1.0-mbcp +versionCode=10 +author=cuynu +description=Dump MB Logs for v6.4.60+ where log is hidden +updateJson=