feat(doc-scan): Query for FairScan, if built-in scanning not available#16427
feat(doc-scan): Query for FairScan, if built-in scanning not available#16427
Conversation
To enable the document scanning feature for a specific build variant,
previously two places had to be adjusted:
- The build.gradle.kts, in the "region AppScan"
- A variant-specific implementation for VariantModule.kt
Now, only the first one is required and the VariantModule.kt handles it
automatically.
Benefits: Only a single place to change. And no code duplication
Drawback: Reflection is a bit more brittle - it all depends on the package
and class name to not change
Signed-off-by: Philipp Hasper <vcs@hasper.info>
Testing two main variants, one without appscan, and one with it. However, as of now the automated test for the gplay flavor does not run automatically in the CI, as we only test the generic flavor. So the test's purpose was just to verify the reflection approach locally. Signed-off-by: Philipp Hasper <vcs@hasper.info>
Built-in scanning is not available for all build variants - e.g. not for "generic", which is the flavor for the F-Droid release. It doesn't allow the non-reproducible TinyOpenCV build. If this is the case, we are checking whether the open source scanning app FairScan is available (https://github.com/pynicolas/FairScan) and open that one for scanning. The declaration in the AndroidManifest is required since Android 11 (API level 30), otherwise the Intent would always be null. See https://developer.android.com/training/package-visibility Signed-off-by: Philipp Hasper <vcs@hasper.info>
Before, the filename from FairScan just was <unixTimestamp>.pdf. Now, we are giving it our own timestamped name, just like we do for images and videos captured via the camera intent. This uses the same fileDisplayNameTransformer as PR #16298 Signed-off-by: Philipp Hasper <vcs@hasper.info>
|
blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed. |
|
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/16427.apk |
|
@tobiasKaminsky What do you think, could you share your opinion? |
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |

Built-in scanning is not available for all build variants - e.g. not for "generic", which is the flavor for the F-Droid release. It doesn't allow the non-reproducible TinyOpenCV build.
If this is the case, we are checking whether the open source scanning app FairScan is available (https://github.com/pynicolas/FairScan) and open that one for scanning.
This approach was selected based on the discussion here: #12624 (comment)
Result
Screen_recording_20260201_143916.webm
Behind the scenes
1769952395766.pdf.fileDisplayNameTransformeras in my other current PR When uploading a single file, offer input field to change file name #16298.