beemdevelopment/Aegis · error

Unsupported algorithm

Error message

Unsupported algorithm: %d

What it means

The final field mapped per payload entry is the OTP type. Aegis supports OTP_TYPE_TOTP and OTP_TYPE_HOTP (unspecified falls through to TOTP); any other OtpType enum value reaches the default branch and throws this exception.

Solutions

  1. Only include TOTP/HOTP tokens in the export payload
  2. Regenerate the export with a compatible exporter version
  3. If producing payloads, set OtpType to OTP_TYPE_TOTP or OTP_TYPE_HOTP explicitly

Example fix

// before
parameters.setType(OTP_TYPE_STEAM); // unsupported in migration payload
// after
parameters.setType(GoogleAuthProtos.MigrationPayload.OtpType.OTP_TYPE_TOTP);
Defensive patterns

Strategy: try-catch

Try / catch

try {
    GoogleAuthInfo.parseExportUri(uri);
} catch (GoogleAuthInfoException e) {
    Log.w(TAG, "Token skipped: " + e.getMessage());
}

Prevention

When it happens

Trigger: Parsing a migration payload where params.getType() is an enum value other than UNSPECIFIED, TOTP, or HOTP (e.g. an unknown type added by a newer exporter).

Common situations: Payloads from newer Authenticator versions with new OTP types, or hand-built protobuf payloads with invalid type ordinals.

Related errors


AI-assisted analysis of beemdevelopment/Aegis@d6f4e5925a (2026-09-08). Data as JSON: /api/errors/c56412981be8426d. Report an issue: GitHub.

Appendix: source

Thrown at app/src/main/java/com/beemdevelopment/aegis/otp/GoogleAuthInfo.java:253

                        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()));
                }
            } catch (OtpInfoException e) {
                throw new GoogleAuthInfoException(uri, e);
            }

            String name = params.getName();
            String issuer = params.getIssuer();
            int colonI = name.indexOf(':');
            if (issuer.isEmpty() && colonI != -1) {
                issuer = name.substring(0, colonI);
                name = name.substring(colonI + 1);
            }

            GoogleAuthInfo info = new GoogleAuthInfo(otp, name, issuer);
            infos.add(info);
        }

        return new Export(infos, payload.getBatchId(), payload.getBatchIndex(), payload.getBatchSize());

View on GitHub (pinned to d6f4e5925a)