{"record":{"id":"a9cbecc20c72ad3c","repo":"MuntashirAkon/AppManager","slug":"failed-to-get-crypto-mdestmetadata-info-crypto","errorCode":null,"errorMessage":"Failed to get crypto \" + mDestMetadata.info.crypto","messagePattern":"Failed to get crypto \" \\+ mDestMetadata\\.info\\.crypto","errorType":"exception","errorClass":"BackupException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/OABConverter.java","lineNumber":125,"sourceCode":"    public void convert() throws BackupException {\n        if (SPECIAL_BACKUPS.contains(mPackageName)) {\n            throw new BackupException(\"Cannot convert special backup \" + mPackageName);\n        }\n        // Source metadata\n        mSourceMetadata = readLogFile();\n        // Simulate a backup creation\n        try {\n            mBackupItem = BackupItems.createBackupItemGracefully(mUserId, \"OAndBackup\", 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(mSourceMetadata, 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            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()) {\n                    mChecksum.add(filenameChecksumPair.getKey(), filenameChecksumPair.getValue());\n                }","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/OABConverter.java#L107-L143","documentation":"ConvertUtils.getV5Metadata builds the App Manager v5 metadata from OAndBackup metadata and may need a Crypto instance matching metadata.info.crypto. If instantiating it throws CryptoException, convert() wraps it as BackupException(\"Failed to get crypto \" + mDestMetadata.info.crypto).","triggerScenarios":"The converted metadata specifies a crypto scheme (e.g. GCM, RSA) whose setup fails — bad/missing key store entry, unsupported crypto name in metadata, or corrupted crypto parameters in the source log.","commonSituations":"OAndBackup backup used encryption that App Manager cannot reconstruct; encryption keys absent on the new device; metadata crypto field set to a scheme not configured in App Manager.","solutions":["Check App Manager's crypto/encryption settings and keys are available for the named scheme","Convert unencrypted backups, or disable encryption in the destination metadata if encryption is not required","Verify the crypto name in the source .log metadata is supported by this App Manager version","Update App Manager — older versions may lack newer crypto schemes"],"exampleFix":"// before\nmetadata.crypto = \"GCM\"; // key not present on device\n// after\nmetadata.crypto = null; // or configure keys before converting","handlingStrategy":"try-catch","validationCode":"// Pre-check: only convert unencrypted OAB backups or ones whose crypto is configured\nString crypto = sourceMetadata.crypto; // from .log if available\nif (crypto != null && !isCryptoConfigured(crypto)) {\n    throw new IllegalStateException(\"Crypto not configured: \" + crypto);\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        // configure keys or convert with encryption disabled\n    }\n}","preventionTips":["Configure encryption keys in App Manager before converting encrypted backups","Prefer converting unencrypted backups","Keep App Manager updated for crypto scheme support"],"tags":["backup","crypto","encryption","migration"],"backgroundTag":"invalid-config-value","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"}