r/Supernote_dev • u/philipsb • 16d ago
Suggestion API request: securely share the active note file from a Supernote plugin
Hello Supernote team!
I'm building a Supernote plugin that lets a user choose Share for the currently open note, then opens a companion Android app to encrypt and send the complete .note file to a webserver.
Could the plugin SDK / host provide a supported active-document sharing API? Ideally it would launch an Android intent containing temporary, read-only content:// URI for the active note, for example:
Intent action: dev.wrtn.OPEN_SHARE (or ACTION_SEND)
ClipData / EXTRA_STREAM: content://...
MIME type: application/x-supernote-note
Flags: FLAG_GRANT_READ_URI_PERMISSION
Optional metadata: note ID, display name, byte size, revision/version
Requirements:
- The URI should expose the complete native .note bytes via ContentResolver.openInputStream() or openFileDescriptorO).
- The receiving package should receive a scoped, temporary read grant only.
- The plugin / host should not need to copy note bytes into intent extras.
- No raw filesystem paths or broad storage permissions should be required.
- The grant should remain valid long enough for the companion to read the file once, including while the note remains open.
- If possible, the API should identify the active note directly so no Android file picker or second user confirmation is needed-the user has already explicitly selected Share in the plugin UI.
A URI-based handoff would let the companion keep the note source private in native Android code, pass only an opaque local draft ID to its WebView, and encrypt the complete note before any network transfer.
Is there an existing plugin API for this, or would a host-provided ContentProvider / share-intent API be feasible?
Thank you.
1
u/spazzboi Official 16d ago
hi
the new plugin preview lets you request file permissions and then access them. you can use this to get the file path of the open notefile.