Skip to content

test(sqlite): reproduce plaintext SQLite behavior on official 7.3.0 builds - #4

Open
flsobral wants to merge 34 commits into
mainfrom
test/sqlite-plaintext-7.3.0
Open

flsobral wants to merge 34 commits into
mainfrom
test/sqlite-plaintext-7.3.0

Conversation

@flsobral

@flsobral flsobral commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Plaintext SQLite + Android shared storage regression reproducer

Uses the exact TotalCross 7.3.0 SDK and native TCVM package built in TotalCross workflow 40878222908 (artifact 12899147776, source SHA 5464c21e3107e3f1ce9c287b724829e2bb870c1d), also used by release workflow 40879229660. No changes to the TCVM.

Client example

The supplied Main.zip includes Main.java, TestPermission.java and Main.apk. TestPermission.java does not use SQLite: it sets Settings.dataPath="/sdcard/", then creates/deletes /sdcard/asd using TotalCross File. The supplied APK targets SDK 36 (min 24) and declares MANAGE_EXTERNAL_STORAGE.

The updated Android probe includes this exact filesystem operation, plus creation and re-opening of an unencrypted SQLite database in /sdcard, and opening/updating a pre-existing standard SQLite file pushed to /sdcard by the test runner.

Verified results

Android 15 emulator job — run 41888918200 — Android APK, separate logcats, SQLite fixtures, permission screenshots and diagnostics.

  • Permission declared but denied (appops MANAGE_EXTERNAL_STORAGE ignore): File.createDir("/sdcard/asd") triggers the special-permission Settings screen. The CI runner detects it and returns via BACK. The filesystem call fails with Error Code: 13 - Permission denied. SQLite NativeDB._open for new and pre-existing databases on /sdcard fails with [-1] unknown error (out of memory). SQLite within the application's private data directory still passes.
  • Permission granted (appops MANAGE_EXTERNAL_STORAGE allow): all in-app, /sdcard/asd, external new-DB, reopen/UPDATE/integrity, plaintext header and pre-existing external DB checks PASS. After TotalCross modifies the pre-existing database, host Python SQLite independently reads back updated-by-totalcross and verifies integrity ok.
  • This reproduces permission-dependent failure; it does not reproduce the customer's exact file is not a database message at NativeDB._exec / Stmt.executeUpdate. The denied reproduction fails earlier at NativeDB._open.
  • The same official 7.3.0 package previously passed native SQLite checks on Windows x64 and macOS arm64; iOS and Linux ARM packaging pass. Linux x64 is separately blocked by an existing TCVM startup __realpath_chk/glibc abort, unrelated to SQLite; the full workflow may still be red for Linux.

Test evidence and safety

The runner validates APK manifest permission, ABI/installation mode, and runtime appops; uses the exact same APK twice; captures separate denied/granted logcat and event JSON, all-files-access Settings screenshot, appops states, crash logs, file-path metadata, original and read-back SQLite fixtures, APK, build/deploy logs and source hashes. All data is generated by the test; the customer APK is not committed. Toggling appops models permission state, not a real user's tap to authorize the permission.

See tests/sqlite-plaintext/README.md for test contract and reproduction notes.

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