{"record":{"id":"9a1ac056c1e5053e","repo":"MuntashirAkon/AppManager","slug":"unsupported-encryption-method-encryptionname","errorCode":null,"errorMessage":"Unsupported encryption method: \" + encryptionName","messagePattern":"Unsupported encryption method: \" \\+ encryptionName","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/backup/adb/AndroidBackupHeader.java","lineNumber":237,"sourceCode":"        mkOut.writeByte(mk.length);\n        mkOut.write(mk);\n        mkOut.writeByte(checksum.length);\n        mkOut.write(checksum);\n        mkOut.flush();\n        byte[] encryptedMk = mkC.doFinal(blob.toByteArray());\n        headerbuf.append(byteArrayToHex(encryptedMk));\n        headerbuf.append('\\n');\n\n        return finalOutput;\n    }\n\n    @NonNull\n    private static InputStream decodeAesHeaderAndInitialize(char[] decryptPassword,\n                                                            @NonNull String encryptionName,\n                                                            boolean pbkdf2Fallback,\n                                                            @NonNull InputStream rawInStream) throws Exception {\n        if (!encryptionName.equals(ENCRYPTION_ALGORITHM_NAME)) {\n            throw new IOException(\"Unsupported encryption method: \" + encryptionName);\n        }\n\n        String userSaltHex = readHeaderLine(rawInStream); // 5\n        byte[] userSalt = hexToByteArray(userSaltHex);\n\n        String ckSaltHex = readHeaderLine(rawInStream); // 6\n        byte[] ckSalt = hexToByteArray(ckSaltHex);\n\n        int rounds = Integer.parseInt(readHeaderLine(rawInStream)); // 7\n        String userIvHex = readHeaderLine(rawInStream); // 8\n\n        String encryptionKeyBlobHex = readHeaderLine(rawInStream); // 9\n\n        // decrypt the encryption key blob\n        try {\n            return attemptEncryptionKeyDecryption(decryptPassword, PBKDF_CURRENT, userSalt,\n                    ckSalt, rounds, userIvHex, encryptionKeyBlobHex, rawInStream);\n        } catch (Exception e) {","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/backup/adb/AndroidBackupHeader.java#L219-L255","documentation":"IOException from AndroidBackupHeader.decodeAesHeaderAndInitialize: the encryption algorithm name in the backup header does not match the supported AES-256/CBC algorithm name (ENCRYPTION_ALGORITHM_NAME), so decryption cannot proceed.","triggerScenarios":"The header's encryption line (line 4) contains a value other than the supported constant — typically \"none\" mismarked, or a cipher name from a different backup tool; occurs when the header says encrypted but with an unrecognized algorithm.","commonSituations":"Backups produced by modified adb implementations or third-party tools with custom encryption; corrupted header line shifting values; spoofed/hand-edited headers.","solutions":["Re-create the backup using standard adb backup (AES-256 encryption) or no encryption","Compare the header's encryption line against the expected algorithm name to identify the producer","Use the original tool that encrypted the backup to decrypt it first, then feed plaintext to the extractor","Check for header line misalignment caused by earlier corruption"],"exampleFix":"// before\n// header line: AES-128-CBC-1.2 (from a non-standard tool) -> throws\nInputStream tar = header.toTar();\n// after (decrypt externally with the original tool first)\nInputStream plain = thirdPartyToolDecrypt(abFile, password);\nInputStream tar = new AndroidBackupHeader(plain, null).toTar();","handlingStrategy":"validation","validationCode":"String encLine = readHeaderLine(abFile, 3); // encryption algorithm line\nif (!\"AES-256-CBC-1.2\".equals(encLine) && !\"none\".equals(encLine)) {\n    throw new IOException(\"Unsupported backup encryption: \" + encLine);\n}","typeGuard":null,"tryCatchPattern":"try {\n    InputStream tar = header.toTar();\n} catch (IOException e) {\n    if (e.getMessage().startsWith(\"Unsupported encryption method\")) {\n        Log.e(TAG, \"Backup encrypted with a non-standard algorithm; decrypt with the original tool\", e);\n    } else throw e;\n}","preventionTips":["Create backups with standard adb (AES-256) or unencrypted","Log the header encryption line when debugging restores","Decrypt third-party-encrypted backups before using this extractor","Check the actual (exact) algorithm name, not just 'encrypted'"],"tags":["backup","encryption","unsupported-algorithm"],"backgroundTag":"unsupported-enum-value","analyzedSha":"0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5","analyzedAt":"2026-09-12T14:03:37.243Z","contentChangedAt":"2026-09-12T14:03:37.243Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}