Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 44 additions & 10 deletions post-fs-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,22 @@ MODPATH="${0%/*}"

boot="/data/adb/service.d"
placeholder="/data/adb/modules/playintegrityfix/webroot/common_scripts"
DISABLE_FILE="/data/adb/modules/playintegrityfix/disable"

# If module is disabled, clean up all external files and exit
if [ -f "$DISABLE_FILE" ]; then
# Remove all service.d scripts created by this module
rm -f "$boot/prop.sh" "$boot/hash.sh" "$boot/lineage.sh" \
"$boot/shamiko.sh" "$boot/package.sh" "$boot/.box_cleanup.sh"
# Remove system.prop to stop property spoofing
rm -f "/data/adb/modules/playintegrityfix/system.prop"
exit 0
fi

mkdir -p "/data/adb/Box-Brain/Integrity-Box-Logs"
mkdir -p "$boot"

# Grant perms
# Grant perms
if [ -f "$placeholder/autopilot.sh" ]; then
chmod 755 "$placeholder/autopilot.sh"
fi
Expand Down Expand Up @@ -423,6 +435,7 @@ cat <<'EOF' > "$boot/.box_cleanup.sh"
# It only runs if IntegrityBox is not installed

PROP_FILE="/data/adb/modules/playintegrityfix/module.prop"
DISABLE_FILE="/data/adb/modules/playintegrityfix/disable"
REQUIRED_LINE="support=https://t.me/MeowDump"
LOG_DIR="/data/adb/Box-Brain"

Expand All @@ -434,18 +447,19 @@ SERVICE_FILES="
/data/adb/service.d/package.sh
"

# Check if the prop file exists and contains the required line
if [ ! -f "$PROP_FILE" ] || ! grep -Fq "$REQUIRED_LINE" "$PROP_FILE"; then
# Clean up if module is uninstalled OR disabled
if [ ! -f "$PROP_FILE" ] || ! grep -Fq "$REQUIRED_LINE" "$PROP_FILE" || [ -f "$DISABLE_FILE" ]; then
# Delete leftover files if they exist
for file in $SERVICE_FILES; do
[ -e "$file" ] && rm -rf "$file"
done

# Delete Box-Brain folder if it exists
[ -d "$LOG_DIR" ] && rm -rf "$LOG_DIR"

# Delete this script itself
rm -f "$0"
if [ ! -f "$PROP_FILE" ] || ! grep -Fq "$REQUIRED_LINE" "$PROP_FILE"; then
# Full cleanup only on uninstall (not just disable)
[ -d "$LOG_DIR" ] && rm -rf "$LOG_DIR"
# Delete this script itself
rm -f "$0"
fi
fi
EOF

Expand Down Expand Up @@ -757,6 +771,11 @@ chmod 777 "$placeholder/hma.sh"
cat <<'EOF' > "$boot/package.sh"
#!/system/bin/sh

# Exit if module is disabled
if [ -f "/data/adb/modules/playintegrityfix/disable" ]; then
exit 0
fi

# Check if required module folders exist
# These modules add system app package names to target.txt which ruins keybox & increases battery drain
MODULE1="/data/adb/modules/.TA_utl"
Expand Down Expand Up @@ -961,6 +980,11 @@ chmod 777 "$boot/lineage.sh"
cat <<'EOF' > "$boot/hash.sh"
#!/system/bin/sh

# Exit if module is disabled
if [ -f "/data/adb/modules/playintegrityfix/disable" ]; then
exit 0
fi

HASH_FILE="/data/adb/Box-Brain/hash.txt"
LOG_DIR="/data/adb/Box-Brain/Integrity-Box-Logs"
LOG_FILE="$LOG_DIR/vbmeta.log"
Expand All @@ -971,7 +995,7 @@ log() {
echo "$(date '+%Y-%m-%d %H:%M:%S') | $1" >> "$LOG_FILE"
}

# Stop when safe mode is enabled
# Stop when safe mode is enabled
if [ -f "/data/adb/Box-Brain/safemode" ]; then
log " Permission denied by Safe Mode"
exit 1
Expand Down Expand Up @@ -1046,6 +1070,11 @@ chmod 777 "$boot/hash.sh"
cat <<'EOF' > "$boot/prop.sh"
#!/system/bin/sh

# Exit if module is disabled
if [ -f "/data/adb/modules/playintegrityfix/disable" ]; then
exit 0
fi

# CONFIG
PATCH_DATE="2026-04-01"
FILE_PATH="/data/adb/tricky_store/security_patch.txt"
Expand Down Expand Up @@ -1136,7 +1165,12 @@ if [ ! -f "/data/adb/modules/zygisk_shamiko/module.prop" ]; then
cat <<'EOF' > "$boot/shamiko.sh"
#!/system/bin/sh

# Stop when safe mode is enabled
# Exit if module is disabled
if [ -f "/data/adb/modules/playintegrityfix/disable" ]; then
exit 0
fi

# Stop when safe mode is enabled
if [ -f "/data/adb/Box-Brain/safemode" ]; then
echo " Permission denied by Safe Mode"
exit 1
Expand Down
6 changes: 6 additions & 0 deletions service.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/system/bin/sh
MODPATH="${0%/*}"

# If module is disabled, do nothing
if [ -f "$MODPATH/disable" ]; then
exit 0
fi

. $MODPATH/common_func.sh

# Module path and file references
Expand Down