{"record":{"id":"e4e480e607adb939","repo":"beemdevelopment/Aegis","slug":"type-unsupported-by-googleauthprotos-s","errorCode":null,"errorMessage":"Type unsupported by GoogleAuthProtos: %s","messagePattern":"Type unsupported by GoogleAuthProtos: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/main/java/com/beemdevelopment/aegis/otp/GoogleAuthInfo.java","lineNumber":449,"sourceCode":"                        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;\n                    case TotpInfo.ID:\n                        parameters.setType(GoogleAuthProtos.MigrationPayload.OtpType.OTP_TYPE_TOTP);\n                        break;\n                    default:\n                        throw new GoogleAuthInfoException(info.getUri(), String.format(\"Type unsupported by GoogleAuthProtos: %s\", info.getOtpInfo().getType()));\n                }\n\n                builder.addOtpParameters(parameters.build());\n            }\n\n            Uri.Builder exportUriBuilder = new Uri.Builder()\n                    .scheme(SCHEME_EXPORT)\n                    .authority(\"offline\");\n\n            String data = Base64.encode(builder.build().toByteArray());\n            exportUriBuilder.appendQueryParameter(\"data\", data);\n\n            return exportUriBuilder.build();\n        }\n    }\n}\n","sourceCodeStart":431,"sourceCodeEnd":466,"githubUrl":"https://github.com/beemdevelopment/Aegis/blob/d6f4e5925a97e4e91593f1542085eae03432a759/app/src/main/java/com/beemdevelopment/aegis/otp/GoogleAuthInfo.java#L431-L466","documentation":"GoogleAuthInfo.getUri builds a Google Authenticator export (otpauth-migration://) URI and maps each entry's OTP type to a GoogleAuthProtos.MigrationPayload.OtpType enum. If an entry's type is neither HOTP nor TOTP (e.g. MOTP or Steam), the switch falls through to default and this GoogleAuthInfoException is thrown, since the protobuf schema has no representation for that type.","triggerScenarios":"Calling GoogleAuthInfo.export() / exportGoogleUris() (directly or via testDeepLinkIntent) while the selected entries include an OtpInfo whose typeId is not TotpInfo.ID or HotpInfo.ID — e.g. a MotpInfo or Steam-based entry — causing the switch's default branch at GoogleAuthInfo.java:449 to execute.","commonSituations":"Users add mOTP or Steam custom entries in Aegis, then attempt 'Export to Google Authenticator'; also common when new OTP types are added to the app before the migration exporter is updated.","solutions":["Exclude entries whose OTP type is not HOTP/TOTP from the Google Authenticator export selection before calling export().","Check info.getOtpInfo().getType() against supported types and filter: only pass entries where type is 'TOTP' or 'HOTP'.","If support is required, add a case to the switch mapping the new type to an OtpType (or extend the proto) in GoogleAuthInfo."],"exampleFix":"// before\nList<VaultEntry> selected = entries; // includes mOTP entries\nGoogleAuthInfo.export(selected);\n\n// after\nList<VaultEntry> selected = entries.stream()\n    .filter(e -> e.getOtpInfo().getType().equals(TotpInfo.ID)\n              || e.getOtpInfo().getType().equals(HotpInfo.ID))\n    .collect(Collectors.toList());\nGoogleAuthInfo.export(selected);","handlingStrategy":"validation","validationCode":"boolean exportable = info.getOtpInfo().getType().equals(TotpInfo.ID)\n    || info.getOtpInfo().getType().equals(HotpInfo.ID);","typeGuard":"boolean isGoogleExportable(OtpInfo otp) {\n    String t = otp.getType();\n    return TotpInfo.ID.equals(t) || HotpInfo.ID.equals(t);\n}","tryCatchPattern":"try {\n    Uri uri = GoogleAuthInfo.export(entries);\n} catch (GoogleAuthInfoException e) {\n    // e.getMessage() names the unsupported type; fall back to filtering entries\n    entries = entries.stream().filter(this::isGoogleExportableEntry).collect(Collectors.toList());\n}","preventionTips":["Filter the export selection to HOTP/TOTP entries before invoking the Google Authenticator export.","Hide or disable 'Export to Google Authenticator' when unsupported entries (mOTP/Steam) are selected.","Add a UI test covering export with mixed-type selections."],"tags":["otp","export","unsupported-type","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"}