{"record":{"id":"f76af2be8a47bfd3","repo":"MuntashirAkon/AppManager","slug":"failed-to-get-crypto-sbconverter","errorCode":null,"errorMessage":"Failed to get crypto ","messagePattern":"Failed to get crypto ","errorType":"exception","errorClass":"BackupException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/SBConverter.java","lineNumber":112,"sourceCode":"    }\n\n    @Override\n    public void convert() throws BackupException {\n        // Source metadata\n        BackupMetadataV2 sourceMetadata = generateMetadata();\n        // Simulate a backup creation\n        try {\n            mBackupItem = BackupItems.createBackupItemGracefully(mUserId, \"SB\", mPackageName);\n        } catch (IOException e) {\n            throw new BackupException(\"Could not get backup files.\", e);\n        }\n        boolean backupSuccess = false;\n        try {\n            try {\n                // Destination metadata\n                mDestMetadata = ConvertUtils.getV5Metadata(sourceMetadata, mBackupItem);\n            } catch (CryptoException e) {\n                throw new BackupException(\"Failed to get crypto \" + mDestMetadata.info.crypto, e);\n            }\n            try {\n                mChecksum = mBackupItem.getChecksum();\n            } catch (IOException e) {\n                throw new BackupException(\"Failed to create checksum file.\", e);\n            }\n            // Backup icon\n            backupIcon();\n            if (mDestMetadata.info.flags.backupApkFiles()) {\n                backupApkFile();\n            }\n            if (mDestMetadata.info.flags.backupData()) {\n                backupData();\n            }\n            // Write modified metadata\n            try {\n                Map<String, String> filenameChecksumMap = MetadataManager.writeMetadata(mDestMetadata, mBackupItem);\n                for (Map.Entry<String, String> filenameChecksumPair : filenameChecksumMap.entrySet()) {","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/SBConverter.java#L94-L130","documentation":"SBConverter.convert throws BackupException('Failed to get crypto <crypto>') when ConvertUtils.getV5Metadata throws CryptoException while building destination metadata, i.e. a Crypto instance for the configured destination crypto scheme (mDestMetadata.info.crypto) could not be instantiated.","triggerScenarios":"Destination metadata specifies a crypto scheme (e.g. GCM/none/custom) whose Crypto implementation cannot be created — missing key/parameters, unsupported mode, or CryptoException from the crypto factory.","commonSituations":"Converting a backup whose metadata references a crypto mode unavailable in this build; incorrect password/key material for the destination encryption; version drift where a crypto scheme was renamed or removed.","solutions":["Check that mDestMetadata.info.crypto names a supported crypto mode for this build","Supply the correct password/key parameters for the destination crypto","Set the destination crypto to none/CryptoUtils.CRYPTO_MODE_NO_ENCRYPT if encryption is not required","Update App Manager if the source used an older/newer crypto scheme"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"int mode = mDestMetadata.info.crypto;\nif (!CryptoUtils.isCryptoModeCrypto(mode) /* unsupported scheme */ && mode != CryptoUtils.CRYPTO_MODE_NO_ENCRYPT) {\n    throw new IllegalArgumentException(\"Unsupported destination crypto mode: \" + mode);\n}","typeGuard":null,"tryCatchPattern":"try {\n    converter.convert(...);\n} catch (BackupException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Failed to get crypto\")) {\n        // fall back to NO_ENCRYPT or prompt user for correct key/password\n    }\n}","preventionTips":["Confirm destination crypto mode is supported by the current build","Supply correct key/password material for encrypted destinations","Prefer CRYPTO_MODE_NO_ENCRYPT when encryption is unnecessary"],"tags":["android","backup","crypto","metadata"],"backgroundTag":"missing-credentials","analyzedSha":"0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5","analyzedAt":"2026-09-12T14:03:37.243Z","contentChangedAt":"2026-09-12T14:03:37.243Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}