{"record":{"id":"13d2d4c675be3279","repo":"beemdevelopment/Aegis","slug":"unsupported-digits-d","errorCode":null,"errorMessage":"Unsupported digits: %d","messagePattern":"Unsupported digits: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/main/java/com/beemdevelopment/aegis/otp/GoogleAuthInfo.java","lineNumber":218,"sourceCode":"            throw new GoogleAuthInfoException(uri, e);\n        }\n\n        List<GoogleAuthInfo> infos = new ArrayList<>();\n        for (GoogleAuthProtos.MigrationPayload.OtpParameters params : payload.getOtpParametersList()) {\n            OtpInfo otp;\n            try {\n                int digits;\n                switch (params.getDigits()) {\n                    case DIGIT_COUNT_UNSPECIFIED:\n                        // intentional fallthrough\n                    case DIGIT_COUNT_SIX:\n                        digits = TotpInfo.DEFAULT_DIGITS;\n                        break;\n                    case DIGIT_COUNT_EIGHT:\n                        digits = 8;\n                        break;\n                    default:\n                        throw new GoogleAuthInfoException(uri, String.format(\"Unsupported digits: %d\", params.getDigits().ordinal()));\n                }\n\n                String algo;\n                switch (params.getAlgorithm()) {\n                    case ALGORITHM_UNSPECIFIED:\n                        // intentional fallthrough\n                    case ALGORITHM_SHA1:\n                        algo = \"SHA1\";\n                        break;\n                    case ALGORITHM_SHA256:\n                        algo = \"SHA256\";\n                        break;\n                    case ALGORITHM_SHA512:\n                        algo = \"SHA512\";\n                        break;\n                    default:\n                        throw new GoogleAuthInfoException(uri, String.format(\"Unsupported hash algorithm: %d\", params.getAlgorithm().ordinal()));\n                }","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/beemdevelopment/Aegis/blob/d6f4e5925a97e4e91593f1542085eae03432a759/app/src/main/java/com/beemdevelopment/aegis/otp/GoogleAuthInfo.java#L200-L236","documentation":"When decoding a Google Authenticator migration payload, each OtpParameters entry carries a DigitCount enum. Aegis only supports 6 and 8 digit codes (DIGIT_COUNT_SIX, DIGIT_COUNT_EIGHT; unspecified falls back to 6). Any other enum value causes this exception.","triggerScenarios":"Parsing a migration payload where params.getDigits() is an enum value other than UNSPECIFIED, SIX, or EIGHT (e.g. a future/unknown DIGIT_COUNT value from a newer exporter), hitting the default branch of the digits switch.","commonSituations":"Payloads exported by a newer Google Authenticator version introducing a new digit count, or hand-forged protobuf payloads with out-of-range enum ordinals.","solutions":["Re-export using only 6- or 8-digit tokens, or change the token's digit count in the source app","Regenerate the export payload with a compatible Google Authenticator version","If you control the payload producer, restrict digit counts to 6 or 8"],"exampleFix":"// before\nparameters.setDigits(DIGIT_COUNT_SEVEN); // unsupported\n// after\nparameters.setDigits(GoogleAuthProtos.MigrationPayload.DigitCount.DIGIT_COUNT_SIX);","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    GoogleAuthInfo.parseExportUri(uri);\n} catch (GoogleAuthInfoException e) {\n    // skip or surface this token; unsupported digits in payload\n    Log.w(TAG, \"Token skipped: \" + e.getMessage());\n}","preventionTips":["Export tokens configured with 6 or 8 digits only","Keep Google Authenticator and Aegis updated","Per-token try/catch so one bad entry doesn't abort the import"],"tags":["otp","enum","protobuf"],"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"}