Created
December 8, 2024 19:17
-
-
Save stackcoder/c4b0afdf47bd72a3213a86b77297edce to your computer and use it in GitHub Desktop.
Wipe free space on Android devices
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euxo pipefail | |
{ | |
for path in "/system" "/data" "/cache" "/sdcard"; do | |
dst="$path/xxx-wipe" | |
echo "Fill $dst" | |
dd if=/dev/urandom of="$dst" bs=1048576 conv=sync || true | |
cat /dev/urandom > "$dst.1" || true | |
sync | |
ls -la "$dst" "$dst.1" | |
rm "$dst" "$dst.1" | |
done | |
} 2>&1 | tee -a wipe-free.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment