Skip to content

Instantly share code, notes, and snippets.

@programminghoch10
Created September 12, 2025 12:09
Show Gist options
  • Select an option

  • Save programminghoch10/7edbed8e0fee8b9e36c891d4e6a44ecd to your computer and use it in GitHub Desktop.

Select an option

Save programminghoch10/7edbed8e0fee8b9e36c891d4e6a44ecd to your computer and use it in GitHub Desktop.
WhatsApp ViewOnce Magisk Script
#!/bin/sh
# regurarily copy WhatsApp ViewOnce images into sdcard
while true; do
sleep 60
[ "$(ls /data/data/com.whatsapp/files/ViewOnce | wc -l)" -eq 0 ] && continue
mkdir -p /sdcard/Pictures/WhatsApp/ViewOnce
cp -d -u -p /data/data/com.whatsapp/files/ViewOnce/* -t /sdcard/Pictures/WhatsApp/ViewOnce
done

WhatsApp ViewOnce Magisk Script

This Magisk service script regurarily copies the WhatsApp ViewOnce Images to sdcard for easy access.

Installation

  1. Place file the script from this gist to /data/adb/service.d/whatsapp-viewonce.sh
  2. Make it executable
  3. Restart device

Usage

When receiving ViewOnce images in WhatsApp, do not open them and instead wait for the script to copy them to /sdcard/Pictures/WhatsApp/ViewOnce.

This will happen only every 60 seconds, to keep device load low.

After the file has been copied, you are free to open the Image in WhatsApp, as the copied file remains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment