Skip to content
freesiliconPublic

About

Air-gapped offline Android screenshot search (zero INTERNET permission) powered by FreeSilicon freesched GPU+NPU

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Recall

Offline screenshot search powered by FreeSched — 100% air-gapped, zero INTERNET permission, zero gallery permissions, 16 KiB page-aligned.

Recall (org.freesilicon.recall) indexes and searches your screenshots locally on Android using SQLite FTS5, quantized INT8 vector similarity, and FreeSched's AHardwareBuffer (0x1000000) + sync_file GPU↔NPU pipeline (arm64-v8a).

Security & Privacy Guarantees

  • Zero <uses-permission> declarations: No INTERNET, no ACCESS_NETWORK_STATE, no READ_MEDIA_IMAGES, no MANAGE_EXTERNAL_STORAGE, and no AccessibilityService.
  • Scoped user-driven import only: Android Photo Picker (PickMultipleVisualMedia), Android Share Sheet (ACTION_SEND / ACTION_SEND_MULTIPLE), and SAF Folder Picker (ACTION_OPEN_DOCUMENT_TREE).
  • Owner-only local store (0600): SQLite FTS5 + INT8 embedding index and cached thumbnails reside strictly in app-private noBackupFilesDir / databases with cloud backup disabled.
  • Cancel-safe & non-resurrecting deletes: Monotonic import_generation fencing ensures deleting a screenshot while indexing is in flight never resurrects it on late completion.
  • 16 KiB Page Alignment: Built for arm64-v8a with PT_LOAD >= 0x4000, uncompressed jniLibs, and zipalign -P 16.

Architecture

  1. Import & Dedupe (ImportManager, Sha256Hasher) — Streams incoming URIs through SHA-256 deduplication and reserves a monotonic import_generation in SQLite.
  2. Pretrained Visual+Text Search & Zero-Permission OCR (MobileClipOnnxEncoder, ClipBpeTokenizer, BitmapOcrExtractor, :models_pack) — Play Asset Delivery install-time pack bundles SHA-256-verified pretrained MobileCLIP-S0 INT8 ONNX vision+text encoders (11 MB vision + 41 MB text + CLIP BPE tokenizer, fetched at build time by scripts/fetch-mobileclip-onnx.sh on 16 KiB-aligned zero-permission onnxruntime-android:1.25.0) alongside ocr_glyphs_int8.rcl1 for both visual object/item search and light/dark-aware on-device OCR.
  3. FreeSched Hardware Telemetry & 8-Image Calibration (FreeSchedEngine) — Discovers NNAPI accelerators (google-edgetpu, qti-htp/qti-dsp, mtk-neuron/mtk-mdla) via freesilicon/freesched and runs an apples-to-apples 8-image 2-layer FFN calibration (64 -> 128 -> 64) on CPU vs FreeSched AHB+NNAPI without faking NPU speedup on fallback.
  4. Hybrid Store (RecallDatabase) — Combines SQLite fts5 (bm25) lexical search with quantized 512-d INT8 cosine similarity and normalized OCR bounding boxes.
  5. 3-Screen Jetpack Compose UI —
    • Search Home: Instant semantic + OCR search, matched snippet pills, masonry grid, and + Import sheet.
    • Indexing & Benchmark Card: Live batch telemetry, 8-image calibration comparison, and 1-tap PNG Hardware Card exporter (zero personal screenshots included).
    • Result Detail & Crop Jump: Pinch/pan zoom focused on matched OCR bounding boxes, Copy, Share, Redact (v1.1 hook), and atomic Delete.

Build & Verify

# 1. Sync pinned freesilicon/freesched (c795eed1) & build its 16 KiB arm64-v8a AAR
./scripts/build-freesched-aar.sh

# 2. Run JVM + Robolectric unit tests, assemble debug APK & Play Asset Delivery AAB
./gradlew testDebugUnitTest assembleDebug bundleDebug

# 3. Verify zero platform permissions, 16 KiB ELF alignment, and clean-room boundaries
./scripts/check-zero-permissions.sh
./scripts/check-16k-alignment.sh
./scripts/clean-room-audit.sh

License

Apache License 2.0 — see LICENSE.

About

Air-gapped offline Android screenshot search (zero INTERNET permission) powered by FreeSilicon freesched GPU+NPU

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages