diff --git a/.eslintignore b/.eslintignore index 9ede21387..0246b2d27 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1142,7 +1142,6 @@ packages/lib/services/keychain/KeychainService.test.js packages/lib/services/keychain/KeychainService.js packages/lib/services/keychain/KeychainServiceDriver.dummy.js packages/lib/services/keychain/KeychainServiceDriver.electron.js -packages/lib/services/keychain/KeychainServiceDriver.mobile.js packages/lib/services/keychain/KeychainServiceDriver.node.js packages/lib/services/keychain/KeychainServiceDriverBase.js packages/lib/services/noteList/defaultLeftToRightListRenderer.js diff --git a/.gitignore b/.gitignore index f5b7a8a6f..d727f8ce4 100644 --- a/.gitignore +++ b/.gitignore @@ -1119,7 +1119,6 @@ packages/lib/services/keychain/KeychainService.test.js packages/lib/services/keychain/KeychainService.js packages/lib/services/keychain/KeychainServiceDriver.dummy.js packages/lib/services/keychain/KeychainServiceDriver.electron.js -packages/lib/services/keychain/KeychainServiceDriver.mobile.js packages/lib/services/keychain/KeychainServiceDriver.node.js packages/lib/services/keychain/KeychainServiceDriverBase.js packages/lib/services/noteList/defaultLeftToRightListRenderer.js diff --git a/packages/app-mobile/root.tsx b/packages/app-mobile/root.tsx index 8b651f2ee..3acae8bbd 100644 --- a/packages/app-mobile/root.tsx +++ b/packages/app-mobile/root.tsx @@ -21,7 +21,6 @@ import ShareExtension from './utils/ShareExtension'; import handleShared from './utils/shareHandler'; import uuid from '@joplin/lib/uuid'; import { loadKeychainServiceAndSettings } from '@joplin/lib/services/SettingUtils'; -import KeychainServiceDriverMobile from '@joplin/lib/services/keychain/KeychainServiceDriver.mobile'; import { _, setLocale } from '@joplin/lib/locale'; import SyncTargetJoplinServer from '@joplin/lib/SyncTargetJoplinServer'; import SyncTargetJoplinCloud from '@joplin/lib/SyncTargetJoplinCloud'; @@ -596,7 +595,7 @@ async function initialize(dispatch: Dispatch) { reg.logger().info('Database is ready.'); reg.logger().info('Loading settings...'); - await loadKeychainServiceAndSettings([KeychainServiceDriverMobile]); + await loadKeychainServiceAndSettings([]); await migrateMasterPassword(); if (!Setting.value('clientId')) Setting.setValue('clientId', uuid.create()); diff --git a/packages/lib/services/keychain/KeychainServiceDriver.mobile.ts b/packages/lib/services/keychain/KeychainServiceDriver.mobile.ts deleted file mode 100644 index ac83ec308..000000000 --- a/packages/lib/services/keychain/KeychainServiceDriver.mobile.ts +++ /dev/null @@ -1,24 +0,0 @@ -import KeychainServiceDriverBase from './KeychainServiceDriverBase'; - -export default class KeychainServiceDriver extends KeychainServiceDriverBase { - public override readonly driverId: string = 'mobile-unknown'; - - public async supported(): Promise { - return false; - } - - public async setPassword(/* name:string, password:string*/): Promise { - return false; - } - - public async password(/* name:string*/): Promise { - return null; - } - - public async deletePassword(/* name:string*/): Promise { - - } - - public async upgradeStorageBackend(_secureKeys: string[], _newDatabaseVersion: number): Promise { - } -} diff --git a/packages/lib/testing/test-utils.ts b/packages/lib/testing/test-utils.ts index 3c7d630aa..9812a78e6 100644 --- a/packages/lib/testing/test-utils.ts +++ b/packages/lib/testing/test-utils.ts @@ -298,7 +298,7 @@ async function switchClient(id: number, options: any = null) { Setting.setConstant('pluginDir', pluginDir(id)); Setting.setConstant('isSubProfile', false); - await loadKeychainServiceAndSettings([options.keychainEnabled ? KeychainServiceDriverNode : KeychainServiceDriverDummy]); + await loadKeychainServiceAndSettings(options.keychainEnabled ? [KeychainServiceDriverNode] : []); Setting.setValue('sync.target', syncTargetId()); Setting.setValue('sync.wipeOutFailSafe', false); // To keep things simple, always disable fail-safe unless explicitly set in the test itself @@ -362,7 +362,7 @@ async function setupDatabase(id: number = null, options: any = null) { if (databases_[id]) { BaseModel.setDb(databases_[id]); await clearDatabase(id); - await loadKeychainServiceAndSettings([options.keychainEnabled ? KeychainServiceDriverNode : KeychainServiceDriverDummy]); + await loadKeychainServiceAndSettings(options.keychainEnabled ? [KeychainServiceDriverNode] : []); Setting.setValue('sync.target', syncTargetId()); return; }