This post shows my result of my research on the Samsung Trash Provider App on Samsung Android devices.
Android Version Tested:
Android 16
Test device:
Samsung Galaxy S23
Database location:
[...]/com.samsung.android.providers.trash/databases/trash.db
What is this app about?
What's in the databases?
- _data - Current file path
- original_path - The original File path
- _id - Some file id
- media_id - an additional id, empty for my data
- sec_media_id - id in the corresponding Samsung app, was filled for Gallery app and matched the idea there in my data
- is_cloud - for my data always 1 - but I did not have any cloud sync active - so meaning not known atm
- volume_name - The name of the volume the data is stored on
- title - In my data always the file name with file extensions
- _display_name - What is shown in the apps - identical to file name in my data
- _size - Size of file in bytes
- mime_type - Recognized MIME type of the file
- media_type - 1 = Image, 2 = Audio, 3 = Video, Pretty sure there are more types but I only have these in my data atm
- datetaken - if media was taken on the phone this value is set - didn't found another case were it was filled
- date_expires - the date/time this file will be deleted completely from trash
- date_deleted - the date/time the file was moved to trash
- user_id - which user account deleted it (0 = main user, 150 = secure folder context)
- extra - additional info from the source app, JSON based - can hold exif data (location, timestamp taken etc.)
SELECT
_id [File ID],
_data [Trash File Path],
original_path [Original File Path],
title [File Titel],
_display_name [File Name],
_size [File Size],
mime_type [MIME Type],
delete_package_name [App Context],
is_cloud [Cloud?],
user_id [User ID],
strftime('%Y-%m-%d %H:%M:%S.', "date_deleted"/1000, 'unixepoch') || ("date_deleted"%1000) [Deletion Timestamp],
strftime('%Y-%m-%d %H:%M:%S.', "date_expires"/1000, 'unixepoch') || ("date_expires"%1000) [Expiration Timestamp],
extra [Extra Info JSON]
FROM trashes
Location of the deleted files
- App Context - The files was deleted via the App Samsung My Files
- Old File Path - The original File path was /storage/emulated/0/Music/Telegram/
- Old File Name - The original File Name was deleted_file.ogg