diff --git a/src/importers/passwordAgentCsvImporter.ts b/src/importers/passwordAgentCsvImporter.ts index 6095fcbb52..e1d1018368 100644 --- a/src/importers/passwordAgentCsvImporter.ts +++ b/src/importers/passwordAgentCsvImporter.ts @@ -17,19 +17,24 @@ export class PasswordAgentCsvImporter extends BaseImporter implements Importer { if (value.length !== 5 && value.length < 9) { return; } + const altFormat = value.length === 10 && value[0] === '0'; const cipher = this.initLoginCipher(); - cipher.name = this.getValueOrDefault(value[0], '--'); - cipher.login.username = this.getValueOrDefault(value[1]); - cipher.login.password = this.getValueOrDefault(value[2]); + cipher.name = this.getValueOrDefault(value[altFormat ? 1 : 0], '--'); + cipher.login.username = this.getValueOrDefault(value[altFormat ? 2 : 1]); + cipher.login.password = this.getValueOrDefault(value[altFormat ? 3 : 2]); if (value.length === 5) { newVersion = false; cipher.notes = this.getValueOrDefault(value[4]); cipher.login.uris = this.makeUriArray(value[3]); } else { - const folder = this.getValueOrDefault(value[8], '(None)'); - const folderName = folder !== '(None)' ? folder.split('\\').join('/') : null; + const folder = this.getValueOrDefault(value[altFormat ? 9 : 8], '(None)'); + let folderName = folder !== '(None)' ? folder.split('\\').join('/') : null; + if (folderName != null) { + folderName = folder.split(' > ').join('/'); + folderName = folder.split('>').join('/'); + } this.processFolder(result, folderName); - cipher.notes = this.getValueOrDefault(value[3]); + cipher.notes = this.getValueOrDefault(value[altFormat ? 5 : 3]); cipher.login.uris = this.makeUriArray(value[4]); } this.convertToNoteIfNeeded(cipher);