Last active
March 23, 2025 06:03
-
-
Save programminghoch10/fa37e0da8b2efc5cb8077e59d000771d to your computer and use it in GitHub Desktop.
Snapchat Data Extractor
This file contains 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 | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
only hope from that site so plz its very important for my life