I have a phone database /data/user/0/com.miui.gallery/databases/gallery.db containing information such as exif data and file name. there is a column sha1
containing value
e89cfb34fbea51e225ab9e17fa3a15cb171cd2d4
I lost the phone and MicroSD Card so the original files are lost. However there is a cache directory /storage/emulated/0/Android/data/com.miui.gallery/files/gallery_disk_cache/full_size containing thumbnails in 750x1000 resolution.
I identified a picture which is the preview for the above entry. However the file name cannot be found in the database. also the mtime is slightly different, although I am sure that is the same picture.
the file name of the thumbnail picture is (I don't know what it is)
57818493be39acef0f61b5530ead56a244cc9f50672635f49f1c5e31b1f33ad0.0
the calculated sha1 and sha2 of the thumbnail picture is
277a7e182228906ca92dd969d4929a6171da3f8b
1366c580e9f8e6ed28347401942934bc8d3ac7257112033e2a40c49f5973b253
assuming the thumbnail file name is the sha2 of the original picture, is there any way to assign the sha2 to sha1 without having the file? maybe with bruteforce or something?
gallery.db
with or without path? Because assuming the contained SHA-1 value is from the original image file it doesn't make sense to lookup the thumbnail by the hash of the original file data hash. Calculating the hash is pretty CPU intensive, especially for JPEG images it may be faster to load the JPEG image directly in a lower resolution than calculating the hash for looking up the thumbnail.