{"record":{"id":"e91166a5b9206773","repo":"MuntashirAkon/AppManager","slug":"invalid-compression-type-tartype","errorCode":null,"errorMessage":"Invalid compression type: ${tarType}","messagePattern":"Invalid compression type: (.+?)","errorType":"exception","errorClass":"BackupException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/TBConverter.java","lineNumber":266,"sourceCode":"        }\n        String tarType = mDestMetadata.info.tarType;\n        int i = 0;\n        String intBackupFilePrefix = null;\n        String extBackupFilePrefix = null;\n        if (mDestMetadata.info.flags.backupInternalData()) {\n            intBackupFilePrefix = BackupUtils.getDataFilePrefix(i++, getExt(tarType));\n        }\n        if (mDestMetadata.info.flags.backupExternalData()) {\n            extBackupFilePrefix = BackupUtils.getDataFilePrefix(i, getExt(tarType));\n        }\n        try (BufferedInputStream bis = new BufferedInputStream(dataFile.openInputStream())) {\n            CompressorInputStream cis;\n            if (TAR_GZIP.equals(mSourceMetadata.tarType)) {\n                cis = new GzipCompressorInputStream(bis);\n            } else if (TAR_BZIP2.equals(mSourceMetadata.tarType)) {\n                cis = new BZip2CompressorInputStream(bis);\n            } else {\n                throw new BackupException(\"Invalid compression type: \" + tarType);\n            }\n            TarArchiveInputStream tis = new TarArchiveInputStream(cis);\n            SplitOutputStream intSos = null, extSos = null;\n            TarArchiveOutputStream intTos = null, extTos = null;\n            if (intBackupFilePrefix != null) {\n                intSos = new SplitOutputStream(mBackupItem.getUnencryptedBackupPath(), intBackupFilePrefix, DEFAULT_SPLIT_SIZE);\n                BufferedOutputStream bos = new BufferedOutputStream(intSos);\n                OutputStream cos = TarUtils.createCompressedStream(bos, tarType);\n                intTos = new TarArchiveOutputStream(cos);\n                intTos.setLongFileMode(TarArchiveOutputStream.LONGFILE_POSIX);\n                intTos.setBigNumberMode(TarArchiveOutputStream.BIGNUMBER_POSIX);\n            }\n            if (extBackupFilePrefix != null) {\n                extSos = new SplitOutputStream(mBackupItem.getUnencryptedBackupPath(), extBackupFilePrefix, DEFAULT_SPLIT_SIZE);\n                BufferedOutputStream bos = new BufferedOutputStream(extSos);\n                OutputStream cos = TarUtils.createCompressedStream(bos, tarType);\n                extTos = new TarArchiveOutputStream(cos);\n                extTos.setLongFileMode(TarArchiveOutputStream.LONGFILE_POSIX);","sourceCodeStart":248,"sourceCodeEnd":284,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/TBConverter.java#L248-L284","documentation":"During backupData() decompression of the source archive, TBConverter only supports TAR_GZIP and TAR_BZIP2 tar types for the source metadata. If mSourceMetadata.tarType is anything else (note the message string interpolates the unrelated local variable tarType), it throws BackupException. This guards against silently feeding unsupported archive codecs into Gzip/BZip2 compressor streams.","triggerScenarios":"Converting a backup whose prop file declares a compression codec other than GZIP or BZIP2 (e.g. a plain/none or ZSTD/lz4-style codec), so neither TAR_GZIP.equals(...) nor TAR_BZIP2.equals(...) matches.","commonSituations":"Older or newer OAndBackup versions writing codecs App Manager's TB format does not support; prop files edited by hand; backups produced with different compression settings than the two supported ones.","solutions":["Recompress or re-create the source backup with GZIP or BZIP2 compression.","Inspect the prop file's app_apk_codec value and change it to GZIP or BZIP2 only if the data really is in that format.","Check that the source metadata was parsed correctly (readPropFile maps GZIP/BZIP2 only); a corrupted/misread prop can leave tarType wrong.","Convert via a third format supported by both tools if the codec cannot be changed."],"exampleFix":"// before\nString codec = \"ZSTD\"; // from prop\n// after\nif (!\"GZIP\".equals(codec) && !\"BZIP2\".equals(codec)) {\n    // repack archive with gzip first\n    codec = \"GZIP\";\n}","handlingStrategy":"validation","validationCode":"String codec = readPropCodec(propFile); // app_apk_codec\nif (!\"GZIP\".equals(codec) && !\"BZIP2\".equals(codec)) {\n    throw new IllegalStateException(\"Codec not convertible: \" + codec);\n}","typeGuard":null,"tryCatchPattern":"try {\n    converter.convert(backupDir);\n} catch (BackupException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"Invalid compression type\")) {\n        // repack archive with gzip and retry\n    } else throw e;\n}","preventionTips":["Configure OAndBackup to use GZIP or BZIP2 compression only.","Check app_apk_codec before scheduling bulk conversions.","Never hand-edit prop files without verifying the archive encoding matches."],"tags":["android","backup","compression","unsupported-codec"],"backgroundTag":"invalid-enum-value","analyzedSha":"0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5","analyzedAt":"2026-09-12T14:03:37.243Z","contentChangedAt":"2026-09-12T14:03:37.243Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}