Skip to content

Implement Password support for native platforms (iOS/Android/Win) - #600

Open
tpucci wants to merge 4 commits into
ScerIO:mainfrom
tpucci:main
Open

Implement Password support for native platforms (iOS/Android/Win)#600
tpucci wants to merge 4 commits into
ScerIO:mainfrom
tpucci:main

Conversation

@tpucci

@tpucci tpucci commented Nov 18, 2025

Copy link
Copy Markdown

iOS

CleanShot 2025-11-18 at 13 54 00

CleanShot 2025-11-18 at 13 53 42

Android

CleanShot 2025-11-18 at 13 52 02

Windows

Could not check as I own a macbook.

@vicajilau

Copy link
Copy Markdown
Member

Thanks for this, password support for native platforms is a real gap and this is a solid direction (Android's SdkExtensions version gating in particular is a nice touch).

This branch now conflicts with main: #623 recently restructured the Apple side from ios/Classes + separate macos/Classes into a shared darwin/pdfx/Sources layout for Swift Package Manager support, and the pigeon-generated bridge files have moved and changed shape since this was opened. Since this PR also changes the pigeon schema itself (adding password to the open-document message) across Android/iOS/Windows, it needs a proper rebase and pigeon regen rather than a mechanical conflict resolution, that's not something I want to do on your behalf without being able to verify the native builds compile.

Could you rebase onto current main and regenerate the pigeon bridge? Also noticed example/ios/Podfile.lock picked up unrelated local changes (integration_test pod, a Cocoapods downgrade to 1.14.2), might be worth dropping that from the diff. Happy to review again once it's rebased.

@vicajilau

Copy link
Copy Markdown
Member

One more thing worth flagging: as titled, this only covers iOS/Android/Windows, macOS is not touched. Today password is silently a no-op there too (document.dart even says "password supported only for web!", and the current Android Messages.kt never reads message.password at all, so it's quietly ignored, not just unimplemented on macOS).

Good news from the #623 restructuring: iOS and macOS now share the same darwin/pdfx/Sources/pdfx/Document.swift, which is built on CGPDFDocument (Core Graphics), not UIKit/AppKit. CGPDFDocumentUnlockWithPassword is identical on both platforms, so if you implement the unlock in that shared file rather than an iOS-only path, macOS should come along for free. Would appreciate if you can verify it actually works on macOS once rebased, rather than assuming the shared source covers it.

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.

Preview password PDF file

2 participants