{"record":{"id":"b4077a61519a0136","repo":"beemdevelopment/Aegis","slug":"unsupported-otp-type","errorCode":null,"errorMessage":"unsupported otp type: ","messagePattern":"unsupported otp type: ","errorType":"exception","errorClass":"DatabaseImporterException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/com/beemdevelopment/aegis/importers/AndOtpImporter.java","lineNumber":249,"sourceCode":"            try {\n                String type = obj.getString(\"type\").toLowerCase(Locale.ROOT);\n                String algo = obj.getString(\"algorithm\");\n                int digits = obj.getInt(\"digits\");\n                byte[] secret = Base32.decode(obj.getString(\"secret\"));\n\n                OtpInfo info;\n                switch (type) {\n                    case \"hotp\":\n                        info = new HotpInfo(secret, algo, digits, obj.getLong(\"counter\"));\n                        break;\n                    case \"totp\":\n                        info = new TotpInfo(secret, algo, digits, obj.getInt(\"period\"));\n                        break;\n                    case \"steam\":\n                        info = new SteamInfo(secret, algo, digits, obj.optInt(\"period\", TotpInfo.DEFAULT_PERIOD));\n                        break;\n                    default:\n                        throw new DatabaseImporterException(\"unsupported otp type: \" + type);\n                }\n\n                String name;\n                String issuer = \"\";\n\n                if (obj.has(\"issuer\")) {\n                    name = obj.getString(\"label\");\n                    issuer = obj.getString(\"issuer\");\n                } else {\n                    String[] parts = obj.getString(\"label\").split(\" - \");\n                    if (parts.length > 1) {\n                        issuer = parts[0];\n                        name = parts[1];\n                    } else {\n                        name = parts[0];\n                    }\n                }\n","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/beemdevelopment/Aegis/blob/d6f4e5925a97e4e91593f1542085eae03432a759/app/src/main/java/com/beemdevelopment/aegis/importers/AndOtpImporter.java#L231-L267","documentation":"During andOTP (JSON, unencrypted) import, each entry's \"type\" field is mapped to an OTP info class (totp, hotp, steam). If the type string is anything else, the importer throws DatabaseImporterException because Aegis has no representation for that OTP scheme.","triggerScenarios":"An andOTP JSON export contains an entry with \"type\" not equal to \"totp\", \"hotp\", or \"steam\" — e.g. exported by a newer andOTP version with a new algorithm type, or a hand-edited file.","commonSituations":"Version drift between andOTP export schema and the Aegis importer; manually edited backup JSON; a fork of andOTP introducing new entry types.","solutions":["Update Aegis to the latest version, which may support the new type","Inspect the JSON entry's \"type\" field and manually re-add that entry in Aegis","If a type was renamed (e.g. totp->timer), edit the backup JSON to a supported value","File an issue/PR with Aegis to add support for the new otp type"],"exampleFix":"// before\ndefault:\n    throw new DatabaseImporterException(\"unsupported otp type: \" + type);\n// after\ndefault:\n    if (type.equals(\"motp\")) {\n        // map or skip with a warning instead of aborting\n        continue;\n    }\n    throw new DatabaseImporterException(\"unsupported otp type: \" + type);","handlingStrategy":"try-catch","validationCode":"JSONObject obj = new JSONObject(json);\nString type = obj.getString(\"type\");\nif (!Set.of(\"totp\",\"hotp\",\"steam\").contains(type)) {\n    // skip or warn\n}","typeGuard":null,"tryCatchPattern":"try {\n    entry = importer.convertEntry(obj);\n} catch (DatabaseImporterEntryException e) {\n    log.warn(\"Skipped entry: \" + e.getMessage());\n}","preventionTips":["Update Aegis before importing backups from newer andOTP versions","Pre-scan exported JSON for unknown \"type\" values","Keep hand edits minimal and schema-conformant"],"tags":["import","otp","json","unsupported-type"],"backgroundTag":"unsupported-enum-value","analyzedSha":"d6f4e5925a97e4e91593f1542085eae03432a759","analyzedAt":"2026-09-08T00:46:31.111Z","contentChangedAt":"2026-09-08T00:46:31.111Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}