Returns
APIResponse<boolean>:result === truemeans unlock succeeds, andresult === falsemeans unlock fails
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Unlock an encrypted file or directory with a password.
static unlockPathWithPassword(filePath: string, password: string): Promise<APIResponse<boolean>>;
| Parameter | Type | Description |
|---|---|---|
filePath | string | File or directory path |
password | string | Password used to unlock the path |
APIResponse<boolean>:
result === true means unlock succeeds, and result === false means unlock failsimport { PluginFileAPI } from 'sn-plugin-lib';
/**
* Example: unlock an encrypted path with a password.
*/
export async function exampleUnlockPathWithPassword() {
const filePath = '/storage/emulated/0/Note/demo.note';
const password = '123456';
const res = await PluginFileAPI.unlockPathWithPassword(filePath, password);
if (!res.success) {
throw new Error(res.error?.message ?? 'unlockPathWithPassword call failed');
}
return res.result;
}