Skip to content

Migrate encryption to isolate pool, switch image/PDF cache from bytes to file#51

Merged
ultraelectronica merged 9 commits into
mainfrom
versionF
Jun 28, 2026
Merged

Migrate encryption to isolate pool, switch image/PDF cache from bytes to file#51
ultraelectronica merged 9 commits into
mainfrom
versionF

Conversation

@ultraelectronica

Copy link
Copy Markdown
Member

Summary

Migrates all encryption to the isolate pool (removing file-size threshold), makes key derivation async to prevent UI stalls, and switches decrypted image cache and PDF viewer from in-memory bytes to file references to avoid ANRs on large files.

Changes

Crypto Performance

  • Migrate encryption to isolate pool and make key derivation async
  • Remove file-size threshold — always use encryptFileInIsolate
  • Change deriveFileKey to async variant to prevent main-isolate stalls
  • Write in-memory byte encryption to temp file for isolate processing

Image/PDF Performance

  • Switch decrypted image cache from bytes to File (avoids main-isolate decode stalls)
  • Switch PDF viewer from bytes to file path (avoids ANR on large PDFs)

UI

  • Remove app bar surface tint and scrolled under elevation
  • Remove overlay transparency from container decoration

Build

  • Add Flutter migrator flags to Gradle properties

Docs

  • Update repository URLs and contributor name
  • Update documentation to reference unlock autofill design

Replace in-memory Uint8List cache with File references to avoid
main-isolate decode stalls. Reading entire files into memory caused
performance issues on large images; streaming from disk lets Flutter
decode on the background rasterizer.
Remove the file-size threshold that previously decided between main-
isolate and isolate-based encryption. Always use the
encryptFileInIsolate
path to prevent UI freezes during batch operations.

Change deriveFileKey to its async variant deriveFileKeyAsync to avoid
multi-second main-isolate stalls from PBKDF2 when opening encrypted
files.

For in-memory byte encryption, write to a temporary file so the
isolate pool can process it, cleaning up afterward.
@ultraelectronica ultraelectronica self-assigned this Jun 28, 2026
@ultraelectronica ultraelectronica merged commit 8181052 into main Jun 28, 2026
1 check failed
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