{"record":{"id":"5cc3a83e27905f9f","repo":"MuntashirAkon/AppManager","slug":"mode-mbackupinfo-crypto-is-currently-unavailable","errorCode":null,"errorMessage":"Mode ${mBackupInfo.crypto} is currently unavailable.","messagePattern":"Mode (.+?) is currently unavailable\\.","errorType":"exception","errorClass":"BackupException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/backup/VerifyOp.java","lineNumber":44,"sourceCode":"    private final BackupMetadataV5.Metadata mBackupMetadata;\n    @NonNull\n    private final BackupItems.BackupItem mBackupItem;\n    @NonNull\n    private final BackupItems.Checksum mChecksum;\n\n    VerifyOp(@NonNull BackupItems.BackupItem backupItem) throws BackupException {\n        mBackupItem = backupItem;\n        try {\n            mBackupInfo = mBackupItem.getInfo();\n            mBackupFlags = mBackupInfo.flags;\n        } catch (IOException e) {\n            mBackupItem.cleanup();\n            throw new BackupException(\"Could not read backup info. Possibly due to a malformed json file.\", e);\n        }\n        // Setup crypto\n        if (!CryptoUtils.isAvailable(mBackupInfo.crypto)) {\n            mBackupItem.cleanup();\n            throw new BackupException(\"Mode \" + mBackupInfo.crypto + \" is currently unavailable.\");\n        }\n        try {\n            mBackupItem.setCrypto(mBackupInfo.getCrypto());\n        } catch (CryptoException e) {\n            mBackupItem.cleanup();\n            throw new BackupException(\"Could not get crypto \" + mBackupInfo.crypto, e);\n        }\n        try {\n            mBackupMetadata = mBackupItem.getMetadata(mBackupInfo).metadata;\n        } catch (IOException e) {\n            mBackupItem.cleanup();\n            throw new BackupException(\"Could not read backup metadata. Possibly due to a malformed json file.\", e);\n        }\n        // Get checksums\n        try {\n            mChecksum = mBackupItem.getChecksum();\n        } catch (Throwable e) {\n            mBackupItem.cleanup();","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/backup/VerifyOp.java#L26-L62","documentation":"After loading backup info, VerifyOp checks CryptoUtils.isAvailable(mBackupInfo.crypto). If the crypto mode recorded in the backup (e.g. PGP, RSA, AES) is not currently usable on this device, cleanup() runs and this BackupException is thrown before any decryption is attempted.","triggerScenarios":"Verifying/restoring a backup created with a crypto mode unavailable in the current environment: OpenPGP not installed, RSA/AES keys missing from keystore, or the crypto constant from a newer backup not supported by the installed AppManager version.","commonSituations":"Moving a backup to a new device without OpenPGP or without the keystore keys, downgraded AppManager that lacks the crypto mode, or a backup.json edited to a crypto name that doesn't resolve.","solutions":["Install/enable the missing crypto provider (e.g. OpenPGP app) on the device.","Restore the keystore keys or provide the same key used at backup time.","Create a new unencrypted (MODE_NO_ENCRYPTION) backup and verify/restore that instead.","Update AppManager to a version that supports the crypto mode recorded in backup.json."],"exampleFix":"// before: backup created with PGP on device without OpenPGP\n// backup.json: \"crypto\": \"PGP\"\n// after: either install OpenPGP, or re-backup unencrypted\n// backup.json: \"crypto\": \"NONE\"","handlingStrategy":"validation","validationCode":"// Parse crypto from backup.json and check availability first\nJSONObject info = new JSONObject(readFile(new File(backupDir, \"backup.json\")));\nString crypto = info.optString(\"crypto\", \"NONE\");\nif (!CryptoUtils.isAvailable(crypto)) {\n    // install provider (OpenPGP) or choose an unencrypted backup\n}","typeGuard":null,"tryCatchPattern":"try {\n    new VerifyOp(backupItem).verify();\n} catch (BackupException e) {\n    if (e.getMessage().endsWith(\"is currently unavailable.\")) {\n        // surface a dialog telling the user to enable the crypto mode\n    }\n}","preventionTips":["Install OpenPGP (or the required provider) before transferring encrypted backups to a new device.","Prefer no-encryption mode when backups must be portable across devices.","Match AppManager versions between the backup and restore devices."],"tags":["crypto","unavailable-mode","backup-verify","dependency-missing"],"backgroundTag":"feature-not-enabled","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"}