beemdevelopment/Aegis · error · DatabaseImporterException
unsupported otp type:
Error message
unsupported otp type:
What it means
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.
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
Example fix
// before
default:
throw new DatabaseImporterException("unsupported otp type: " + type);
// after
default:
if (type.equals("motp")) {
// map or skip with a warning instead of aborting
continue;
}
throw new DatabaseImporterException("unsupported otp type: " + type); Defensive patterns
Strategy: try-catch
Validate before calling
JSONObject obj = new JSONObject(json);
String type = obj.getString("type");
if (!Set.of("totp","hotp","steam").contains(type)) {
// skip or warn
} Try / catch
try {
entry = importer.convertEntry(obj);
} catch (DatabaseImporterEntryException e) {
log.warn("Skipped entry: " + e.getMessage());
} Prevention
- Update Aegis before importing backups from newer andOTP versions
- Pre-scan exported JSON for unknown "type" values
- Keep hand edits minimal and schema-conformant
When it happens
Trigger: 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.
Common situations: Version drift between andOTP export schema and the Aegis importer; manually edited backup JSON; a fork of andOTP introducing new entry types.
Related errors
- unsupported otp type:
- unsupported otp type:
- Unrecognized tokenType
- Unsupported OTP type
- Unsupported OtpInfo type
AI-assisted analysis of beemdevelopment/Aegis@d6f4e5925a (2026-09-08).
Data as JSON: /api/errors/b4077a61519a0136.
Report an issue: GitHub.
Appendix: source
Thrown at app/src/main/java/com/beemdevelopment/aegis/importers/AndOtpImporter.java:249
try {
String type = obj.getString("type").toLowerCase(Locale.ROOT);
String algo = obj.getString("algorithm");
int digits = obj.getInt("digits");
byte[] secret = Base32.decode(obj.getString("secret"));
OtpInfo info;
switch (type) {
case "hotp":
info = new HotpInfo(secret, algo, digits, obj.getLong("counter"));
break;
case "totp":
info = new TotpInfo(secret, algo, digits, obj.getInt("period"));
break;
case "steam":
info = new SteamInfo(secret, algo, digits, obj.optInt("period", TotpInfo.DEFAULT_PERIOD));
break;
default:
throw new DatabaseImporterException("unsupported otp type: " + type);
}
String name;
String issuer = "";
if (obj.has("issuer")) {
name = obj.getString("label");
issuer = obj.getString("issuer");
} else {
String[] parts = obj.getString("label").split(" - ");
if (parts.length > 1) {
issuer = parts[0];
name = parts[1];
} else {
name = parts[0];
}
}
View on GitHub (pinned to d6f4e5925a)