Skip to content

Instantly share code, notes, and snippets.

@programminghoch10
Last active March 23, 2025 06:03
Show Gist options
  • Save programminghoch10/fa37e0da8b2efc5cb8077e59d000771d to your computer and use it in GitHub Desktop.
Save programminghoch10/fa37e0da8b2efc5cb8077e59d000771d to your computer and use it in GitHub Desktop.
Snapchat Data Extractor
#!/bin/bash
if [[ $(id -u) -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
if [ -z $(pm list packages | grep com.snapchat.android) ]; then
echo "Snapchat not found"
exit 1
fi
SDCARD=/storage/emulated/0
EXPORTDIR=$SDCARD/snapchat_exports
SNAPDATA=$(pm dump com.snapchat.android | grep dataDir= | head -n 1 | cut -d= -f2)
echo "Export folder: $EXPORTDIR"
echo "Snapchat data folder: $SNAPDATA"
rm -r $EXPORTDIR
mkdir -v $EXPORTDIR
cp -r $SNAPDATA/files/file_manager/chat_snap $EXPORTDIR
cp -r $SNAPDATA/files/file_manager/story_snap $EXPORTDIR
cp $SNAPDATA/files/file_manager/snap_first_frame/* $EXPORTDIR/story_snap
cp -r $SNAPDATA/files/file_manager/snap $EXPORTDIR
cp -r $SNAPDATA/files/file_manager/posted_story_snap $EXPORTDIR
cp -r $SNAPDATA/files/file_manager/memories_media $EXPORTDIR
cp -r $SNAPDATA/files/file_manager/memories_thumbnail $EXPORTDIR
#cp -r $SNAPDATA/files/file_manager/memories_overlay $EXPORTDIR
cp -r $SNAPDATA/files/file_manager/media_package_thumb $EXPORTDIR
cp -r $SNAPDATA/files/file_manager/external_sticker $EXPORTDIR
cp -r $SNAPDATA/files/file_manager/non_user_bitmoji $EXPORTDIR
for folder in $EXPORTDIR/*/;
do
for file in $folder*;
do
if (file "$file" | grep text);
then mv "$file" "$file.txt";
else
if (head -n 1 "$file" | grep mp4);
then mv "$file" "$file.mp4";
else
if (head -n 1 "$file" | grep JFIF);
then mv "$file" "$file.jfif"
else
if (head -n 1 "$file" | grep WEBP);
then mv "$file" "$file.webp"
else
if (head -n 1 "$file" | grep PNG);
then mv "$file" "$file.png"
fi
fi
fi
fi
fi
done
for file in "$folder*.txt"; do rm "$file"; done
done
exit 0
@aqib13114
Copy link

hi i am new here just want help i want to extract conversation details of that file i have downloded snapchat data but this conversation shows only stamp date name no details really important plz help me out

plz someone help me out

@aqib13114
Copy link

only hope from that site so plz its very important for my life

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