Repository navigation
feat: open SQLite databases within the file rules when the engine app has all files access - #25
Merged
Merged
Conversation
… has all files access
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.
What changed
GuardSQLiteDatabasereplaces the static members ofandroid.database.sqlite.SQLiteDatabase(final; the databases it returns stay real). SQLite opens its file and journal by path, which no host descriptor can stand in for:SQLiteCantOpenDatabaseExceptionsaying to use the hostdbmodule, and warns once in the project log;stat, thenaccesswith read/write, or the folder for a new database) before the real SQLite opens it; refusals are reported like other paths.:memory:andcreate/createInMemoryalways work.GuardSessiongetsstorageAccess(defaultStorageAccess.granted():Environment.isExternalStorageManager()on Android 11+, a write check on shared storage before) andhasStorageAccess, read on every use since the user can switch it while the engine runs;warnOncefor free-form log warnings.sqliteOnStorageNeedsAllFilesAccess. Parity test: final classes whose objects stay real are checked for static members only;CONFLICT_VALUES(@hide) is skipped.Testing
:guard:connectedDebugAndroidTeston an API 36 x86_64 emulator: 28/28, including SQLite with and without access.JavaGuardConformance13/13 in NodeJSPlugin and the GraalJS fixture with this revision.data/bot.dbwith the db module message and open:memory:; after granting All files access to NodeJSPlugin,data/bot.dbin the project works and another bot's folder is still refused by the file rules.🤖 Generated with Claude Code