Skip to content

Stop the Samsung My Files artifacts crashing when a database won't open - #1112

Merged
abrignoni merged 1 commit into
mainfrom
fix/samsung-myfiles
Aug 14, 2026
Merged

Stop the Samsung My Files artifacts crashing when a database won't open#1112
abrignoni merged 1 commit into
mainfrom
fix/samsung-myfiles

Conversation

@abrignoni

Copy link
Copy Markdown
Owner

Summary

open_sqlite_db_readonly returns None (and logs the reason) when a database can't be opened. Five of the Samsung My Files artifacts called db.cursor() on that return without checking it, so a single database that failed to open raised 'NoneType' object has no attribute 'cursor' and the unhandled exception failed the artifact.

Mattia Epifani reported almost all the My Files plugins failing this way. On his Windows setup a very long output path made the open fail with unable to open database file (same root cause fixed for siminfo in #1111); because these artifacts all target the same app, they all fell over together.

Fix

Guard the None return in smyFiles, smyFiles2, smyfilesOpHistory, smyfilesRecents and smyfilescache so an unopenable database is skipped and the artifact continues. smyfilesStored already caught this (bare except) and is unchanged.

Validation

  • With open_sqlite_db_readonly forced to return None, the three undecorated query helpers (_query, _rows, get_db_data) now return []/0 instead of raising AttributeError; before the change db.cursor() on None raised exactly Mattia's error.
  • A full My Files profile run against a real com.sec.android.app.myfiles extraction is unchanged: smyfilesStored 2048, My Files Cache 2048, Recent Files 100 and 100; the genuinely-empty download_history/googledrive still report no data; no errors, exit 0.

Pylint 10.00, claim-language and validate_sample_data clean. Reporter's extraction is private and not committed.

Notes (not in this PR)

  • The underlying Windows extended-length-path (\\?\) open failure is a core issue affecting every SQLite artifact (already flagged separately). This PR makes the My Files artifacts degrade gracefully; recovering the data on very long Windows paths is the separate core fix.
  • My Files Operation History is intentionally gated to Android 10-12 and its path cipher differs on Android 13+ (it flags those entries *unsupported entry*). Decoding the newer cipher is separate research, not this crash fix.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com

🤖 Generated with Claude Code

open_sqlite_db_readonly returns None (and logs the reason) when a
database cannot be opened. Five of the My Files artifacts called
db.cursor() on that return without checking it, so a single database
that failed to open raised "'NoneType' object has no attribute
'cursor'" and the unhandled exception failed the artifact. Mattia
Epifani reported almost all the My Files plugins failing this way; on
his Windows setup a very long output path made the open fail with
"unable to open database file" (the same cause fixed for siminfo in
PR #1111), and because these artifacts all target the same app they
all fell over together.

Guard the None return in smyFiles, smyFiles2, smyfilesOpHistory,
smyfilesRecents and smyfilescache so an unopenable database is skipped
and the artifact continues. smyfilesStored already caught this and is
unchanged.

Verified two ways: with open_sqlite_db_readonly forced to return None
the three query helpers now return empty instead of raising
AttributeError; and a full My Files profile run against a real
com.sec.android.app.myfiles extraction is unchanged (smyfilesStored
2048, My Files Cache 2048, Recent Files 100 and 100, and the
genuinely-empty download_history/googledrive still reporting no data),
with no errors.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@abrignoni
abrignoni merged commit 40cb60c into main Aug 14, 2026
8 checks passed
@abrignoni
abrignoni deleted the fix/samsung-myfiles branch August 14, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant