beemdevelopment/Aegis · error
Unsupported hash algorithm
Error message
Unsupported hash algorithm: %d
What it means
Each migration payload entry declares an HMAC algorithm enum. Aegis maps only SHA1 (default), SHA256, and SHA512; unspecified falls back to SHA1. Any other Algorithm enum value in the payload throws this GoogleAuthInfoException.
Solutions
- Use a token configured with SHA1/SHA256/SHA512 before exporting
- Regenerate the payload with a compatible exporter version
- If producing payloads yourself, set Algorithm only to the supported enum values
Example fix
// before parameters.setAlgorithm(ALGORITHM_SHA3_512); // unsupported enum // after parameters.setAlgorithm(GoogleAuthProtos.MigrationPayload.Algorithm.ALGORITHM_SHA512);
Defensive patterns
Strategy: try-catch
Try / catch
try {
GoogleAuthInfo.parseExportUri(uri);
} catch (GoogleAuthInfoException e) {
Log.w(TAG, "Token skipped: " + e.getMessage());
} Prevention
- Use SHA1/SHA256/SHA512 for tokens intended for export
- Avoid exotic algorithms unsupported by the Google Authenticator format
- Catch per-entry so one unsupported token doesn't fail the batch
When it happens
Trigger: Parsing a migration payload where params.getAlgorithm() is an enum value other than ALGORITHM_UNSPECIFIED, ALGORITHM_SHA1, ALGORITHM_SHA256, or ALGORITHM_SHA512, reaching the default branch of the algorithm switch.
Common situations: Exports from newer Authenticator versions that added a new algorithm enum, or programmatically generated protobuf payloads with invalid algorithm fields.
Related errors
- Unsupported digits
- Unsupported algorithm
- Unsupported Algorithm
- unsupported otp type:
- unsupported otp type:
AI-assisted analysis of beemdevelopment/Aegis@d6f4e5925a (2026-09-08).
Data as JSON: /api/errors/57d4a63e6b7ccc3f.
Report an issue: GitHub.
Appendix: source
Thrown at app/src/main/java/com/beemdevelopment/aegis/otp/GoogleAuthInfo.java:235
default:
throw new GoogleAuthInfoException(uri, String.format("Unsupported digits: %d", params.getDigits().ordinal()));
}
String algo;
switch (params.getAlgorithm()) {
case ALGORITHM_UNSPECIFIED:
// intentional fallthrough
case ALGORITHM_SHA1:
algo = "SHA1";
break;
case ALGORITHM_SHA256:
algo = "SHA256";
break;
case ALGORITHM_SHA512:
algo = "SHA512";
break;
default:
throw new GoogleAuthInfoException(uri, String.format("Unsupported hash algorithm: %d", params.getAlgorithm().ordinal()));
}
byte[] secret = params.getSecret().toByteArray();
if (secret.length == 0) {
throw new GoogleAuthInfoException(uri, "Secret is empty");
}
switch (params.getType()) {
case OTP_TYPE_UNSPECIFIED:
// intentional fallthrough
case OTP_TYPE_TOTP:
otp = new TotpInfo(secret, algo, digits, TotpInfo.DEFAULT_PERIOD);
break;
case OTP_TYPE_HOTP:
otp = new HotpInfo(secret, algo, digits, params.getCounter());
break;
default:
throw new GoogleAuthInfoException(uri, String.format("Unsupported algorithm: %d", params.getType().ordinal()));View on GitHub (pinned to d6f4e5925a)