v3.0.0 — full remediation (security, auto-crop & editor rewrites, off-thread, API cleanup)#33
Merged
Merged
Conversation
…f-thread, API cleanup BREAKING CHANGE: see MIGRATION.md. Single source of truth at 3.0.0. Versioning/install: - Align pubspec/README/CHANGELOG to v3.0.0; fix README install ref (was the non-existent v2.2.0 → every `pub get` failed); CI asserts tag == pubspec. Security: - downloadManualFromUrl: HTTPS-only (opt-in cleartext), streamed size cap, timeout, SSRF host blocklist, per-redirect re-validation, magic-byte checks. - storage_helper: sanitize filenames + path.isWithin (path-traversal fix); scoped app-specific storage; drop MANAGE_EXTERNAL_STORAGE. Algorithms: - Rewrite auto_cropper: Otsu white-blob detection + real homography+bilinear warp (pure Dart). Remove broken Canny path (List.filled row aliasing, recursion, fake affine "perspective", 100ms no-op timeout). - detectDocumentEdges now actually detects (off the UI thread). Editor (#30/#31/#32): - Rewrite ImageEditingWidget with a declarative state model rendered from the raw image: rotation keeps crop available + re-detects; reliable reset-crop; format change no longer auto-commits; no cumulative JPEG re-encode. API (breaking): - ColorFilter → DocumentColorFilter; trim barrel to public surface; DocumentScannerService instance + .instance (no hard singleton); QR methods take BuildContext; serialize documentFormat. Crash/leak: mounted guards; dispose PdfController; Image.memory errorBuilder; no force-unwrap in multi-page finalize; empty pdfPath handled; monotonic page ids. Perf: real off-thread processing via compute (ImageProcessingIsolateService). Build/deps: drop unused printing & file_picker; camera ^0.12.0+1; flutter >=3.32.0; align example lints; stop committing package pubspec.lock; add ci.yml (format/analyze/test/publish dry-run/pana + build_runner mock regen) and dependabot.yml. Tests: add real auto-crop accuracy, download security (SSRF/size/magic-byte), filename traversal, model round-trip, and %PDF output coverage; realign editor widget test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ional publish dry-run - Add missing `package:flutter/foundation.dart` import for compute in document_scanner_widget (was relying on material, which doesn't export it). - Apply `dart format` across the codebase. - Clear analyzer warning (unused import) and tidy infos (curly braces, redundant imports, await-on-non-future). - Regenerate mockito mocks for the new service signatures. - Make the CI publish dry-run informational (package is distributed via git, not pub.dev). Validated locally with Flutter 3.32.5: format clean, analyze clean (infos only), all tests pass (224 passed, 7 skipped). Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Comprehensive review + remediation. Breaking — see
MIGRATION.md. Single source of truth at 3.0.0.Highlights
downloadManualFromUrlhardened (HTTPS-only, size cap + streaming, timeout, SSRF blocklist, redirect re-validation, magic-byte validation); filename sanitization +path.isWithin(path-traversal fix); scoped storage (droppedMANAGE_EXTERNAL_STORAGE).List.filledaliasing, recursion, fake affine "perspective", 100 ms no-op timeout).ColorFilter→DocumentColorFilter; trimmed barrel;DocumentScannerServiceinstance +.instance; QR methods takeBuildContext;documentFormatserialized.mountedguards, disposePdfController,errorBuilder, no force-unwrap in multi-page finalize, monotonic page ids.compute.printing/file_picker,camera ^0.12.0+1,flutter >=3.32.0; newci.yml(format/analyze/test/publish-dry-run/pana +build_runnermock regen);dependabot.yml; tag==pubspec assert.%PDFoutput.Notes for reviewers
build_runner. Ifdart format --set-exit-if-changedfails, rundart format ..RobaMiais pinned tov1.0.0and unaffected until it bumps the ref (then followMIGRATION.md).🤖 Generated with Claude Code