Stop siminfo crashing when a telephony.db cannot be opened - #1111
Merged
Conversation
get_siminfo called db.cursor() on the return of open_sqlite_db_readonly without checking it. That helper returns None (and logs the reason) when the database cannot be opened, so a single unreadable telephony.db raised "'NoneType' object has no attribute 'cursor'" and the unhandled exception failed the whole artifact, losing every SIM record including those from databases that opened fine. Mattia Epifani hit this on Windows, where a very long output path made the open fail with "unable to open database file". Guard the None return and skip that file so the artifact logs the open failure and continues. Verified with an aleapp.py profile run over two staged copies of a real telephony.db: one readable (parsed, 1 record) and one made unreadable to force the same "unable to open database file" path Mattia saw. The run now logs the failure, parses the readable database, and completes with no error; before the change the None database crashed the whole artifact. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 14, 2026
kalink0
pushed a commit
to kalink0/ALEAPP
that referenced
this pull request
Aug 15, 2026
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 abrignoni#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>
kalink0
pushed a commit
to kalink0/ALEAPP
that referenced
this pull request
Aug 15, 2026
open_sqlite_db_readonly returns None when the database cannot be opened, and get_usageapps called db.cursor() on it without checking, so an unreadable reflection_gel_events.db raised AttributeError and the main loop lost the artifact's rows. Guard the None the same way siminfo does (abrignoni#1111): skip the file and move on. usageapps is the twin of siminfo, the only other artifact that normalises the path to forward slashes before opening it. This is the leaf half of the Windows long-path work; the URI double-prefix that made the open return None on a path over 260 characters was fixed in abrignoni#1113. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
get_siminfocalleddb.cursor()on the return ofopen_sqlite_db_readonlywithout checking it. That helper returnsNone(and logs the reason) when a database can't be opened, so a single unreadabletelephony.dbraised'NoneType' object has no attribute 'cursor'and the unhandled exception failed the whole artifact, losing every SIM record including those from databases that opened fine.Mattia Epifani reported this. On his Windows setup the open failed with
unable to open database filebecause a very long output path produced a mangled extended-length (\\?\) URI.Fix
Guard the
Nonereturn andcontinue, so the artifact logs the open failure (the helper already does) and moves on to the next file.Validation
aleapp.pyprofile run over two staged copies of a realtelephony.db: one readable (parsed, 1 record, all 8 columns), and one made unreadable to force the exactunable to open database file→Nonepath Mattia saw. The run now logs the failure, parses the readable database, and completes with no error and exit 0; before the change thatNonecrashed the whole artifact.Pylint 10.00, claim-language and validate_sample_data clean. Reporter's database is private and not committed.
Note (separate, not in this PR)
The underlying open failure is a Windows extended-length-path (
\\?\) issue in the core path/URI handling that affects every SQLite artifact, not just siminfo, and needs testing on Windows. This PR stops the crash so the tool degrades gracefully; recovering the data on very long Windows paths is a separate core change.Co-Authored-By: Claude Opus 5 noreply@anthropic.com
🤖 Generated with Claude Code