fix: try to fix module fail to hide

This commit is contained in:
KOWX712
2025-03-12 04:22:24 +08:00
parent 6419f5e3b9
commit 9f6faf4e17
2 changed files with 23 additions and 17 deletions

View File

@@ -47,17 +47,19 @@ migrate_config() {
fi
# Additional system app
SYSTEM_APP="
com.google.android.gms
com.google.android.gsf
com.android.vending
com.oplus.deepthinker
com.heytap.speechassist
com.coloros.sceneservice"
touch "/data/adb/tricky_store/system_app"
for app in $SYSTEM_APP; do
if pm list packages -s | grep -q "$app" && ! grep -q "$app" "/data/adb/tricky_store/system_app"; then
echo "$app" >> "/data/adb/tricky_store/system_app"
fi
done
if [ -f "/data/adb/tricky_store/system_app" ]; then
SYSTEM_APP="
com.google.android.gms
com.google.android.gsf
com.android.vending
com.oplus.deepthinker
com.heytap.speechassist
com.coloros.sceneservice"
touch "/data/adb/tricky_store/system_app"
for app in $SYSTEM_APP; do
if pm list packages -s | grep -q "$app"; then
echo "$app" >> "/data/adb/tricky_store/system_app"
fi
done
fi
}

View File

@@ -55,7 +55,9 @@ if [ -f "$MODPATH/action.sh" ]; then
# Hide module from Magisk manager
if [ "$MODPATH" != "$HIDE_DIR" ]; then
rm -rf "$HIDE_DIR"
mv "$MODPATH" "$HIDE_DIR"
mkdir -p "$HIDE_DIR"
busybox chcon --reference="$MODPATH" "$HIDE_DIR"
cp -af "$MODPATH/." "$HIDE_DIR/"
fi
MODPATH="$HIDE_DIR"
@@ -70,10 +72,10 @@ fi
rm -f "$MODPATH/module.prop"
# Symlink tricky store
if [ -f "$MODPATH/action.sh" ] && [ ! -f "$TS/action.sh" ] && [ ! -L "$TS/action.sh" ]; then
if [ -f "$MODPATH/action.sh" ] && [ ! -e "$TS/action.sh" ]; then
ln -s "$MODPATH/action.sh" "$TS/action.sh"
fi
if [ ! -d "$TS/webroot" ] && [ ! -L "$TS/webroot" ]; then
if [ ! -e "$TS/webroot" ]; then
ln -s "$MODPATH/webui" "$TS/webroot"
fi
@@ -125,3 +127,5 @@ done
sed -i '$ s/,$//' "$OUTPUT_APP"
echo "]" >> "$OUTPUT_APP"
[ -f "$MODPATH/action.sh" ] && rm -rf "/data/adb/modules/TA_utl"