{"record":{"id":"f6dc11d8027ea310","repo":"beemdevelopment/Aegis","slug":"unsupported-algorithm-s","errorCode":null,"errorMessage":"Unsupported Algorithm: %s","messagePattern":"Unsupported Algorithm: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/main/java/com/beemdevelopment/aegis/otp/GoogleAuthInfo.java","lineNumber":426,"sourceCode":"                        .setSecret(ByteString.copyFrom(info.getOtpInfo().getSecret()))\n                        .setName(info.getAccountName())\n                        .setIssuer(info.getIssuer());\n\n                switch (info.getOtpInfo().getAlgorithm(false)) {\n                    case \"SHA1\":\n                        parameters.setAlgorithm(GoogleAuthProtos.MigrationPayload.Algorithm.ALGORITHM_SHA1);\n                        break;\n                    case \"SHA256\":\n                        parameters.setAlgorithm(GoogleAuthProtos.MigrationPayload.Algorithm.ALGORITHM_SHA256);\n                        break;\n                    case \"SHA512\":\n                        parameters.setAlgorithm(GoogleAuthProtos.MigrationPayload.Algorithm.ALGORITHM_SHA512);\n                        break;\n                    case \"MD5\":\n                        parameters.setAlgorithm(GoogleAuthProtos.MigrationPayload.Algorithm.ALGORITHM_MD5);\n                        break;\n                    default:\n                        throw new GoogleAuthInfoException(info.getUri(), String.format(\"Unsupported Algorithm: %s\", info.getOtpInfo().getAlgorithm(false)));\n                }\n\n                switch (info.getOtpInfo().getDigits()) {\n                    case 6:\n                        parameters.setDigits(GoogleAuthProtos.MigrationPayload.DigitCount.DIGIT_COUNT_SIX);\n                        break;\n                    case 8:\n                        parameters.setDigits(GoogleAuthProtos.MigrationPayload.DigitCount.DIGIT_COUNT_EIGHT);\n                        break;\n                    default:\n                        throw new GoogleAuthInfoException(info.getUri(), String.format(\"Unsupported number of digits: %s\", info.getOtpInfo().getDigits()));\n                }\n\n                switch (info.getOtpInfo().getType().toLowerCase()) {\n                    case HotpInfo.ID:\n                        parameters.setType(GoogleAuthProtos.MigrationPayload.OtpType.OTP_TYPE_HOTP);\n                        parameters.setCounter(((HotpInfo) info.getOtpInfo()).getCounter());\n                        break;","sourceCodeStart":408,"sourceCodeEnd":444,"githubUrl":"https://github.com/beemdevelopment/Aegis/blob/d6f4e5925a97e4e91593f1542085eae03432a759/app/src/main/java/com/beemdevelopment/aegis/otp/GoogleAuthInfo.java#L408-L444","documentation":"When encoding to a migration payload, getUri maps the OtpInfo's algorithm string to the protobuf Algorithm enum. Only SHA1, SHA256, SHA512, and MD5 are supported by the Google Authenticator format; any other algorithm string hits the default branch and throws a GoogleAuthInfoException.","triggerScenarios":"Calling GoogleAuthInfo.getUri (via export/exportGoogleUris) on an entry whose info.getOtpInfo().getAlgorithm(false) is not one of SHA1/SHA256/SHA512/MD5 (case per the switch).","commonSituations":"Custom algorithm values from fork-specific token types (e.g. 'SHA3-512' or steam-style entries), or databases with algorithm strings outside the standard set.","solutions":["Re-key the token with a supported algorithm (SHA1/SHA256/SHA512/MD5) before exporting","Filter out entries with unsupported algorithms instead of failing the export","Extend the switch to map additional algorithms if the target format supports them"],"exampleFix":"// before\nTotpInfo info = new TotpInfo(secret, \"SHA3-256\", 6, 30); // then export\n// after\nTotpInfo info = new TotpInfo(secret, \"SHA256\", 6, 30); // then export","handlingStrategy":"validation","validationCode":"Set<String> supported = Set.of(\"SHA1\", \"SHA256\", \"SHA512\", \"MD5\");\nif (!supported.contains(entry.getInfo().getAlgorithm(false))) { /* skip entry */ }","typeGuard":null,"tryCatchPattern":"try {\n    uri = GoogleAuthInfo.getUri(entry);\n} catch (GoogleAuthInfoException e) {\n    skipped.add(entry); // unsupported algorithm for Google export\n}","preventionTips":["Only issue tokens with SHA1/SHA256/SHA512/MD5","Skip or convert unsupported entries before export","Catch per entry so exports are partial, not failed"],"tags":["otp","hash-algorithm","export"],"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"}