feat: logmb: initial commit

Signed-off-by: Cuynu <cuynu@proton.me>
This commit is contained in:
Cuynu 2025-08-24 16:19:39 +07:00
commit d68aeec26e
6 changed files with 158 additions and 0 deletions

View file

@ -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

View file

@ -0,0 +1 @@
#MAGISK

38
README.md Normal file
View file

@ -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
```

12
createmodule.sh Executable file
View file

@ -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

67
customize.sh Executable file
View file

@ -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

7
module.prop Executable file
View file

@ -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=