{"record":{"id":"6d3cc080f0dc1ed9","repo":"MuntashirAkon/AppManager","slug":"could-not-get-internal-data-backup","errorCode":null,"errorMessage":"Could not get internal data backup.","messagePattern":"Could not get internal data backup\\.","errorType":"exception","errorClass":"BackupException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/OABConverter.java","lineNumber":304,"sourceCode":"        // Overwrite with the new files\n        try {\n            sourceFiles = mBackupItem.encrypt(sourceFiles);\n        } catch (IOException e) {\n            throw new BackupException(\"Failed to encrypt \" + Arrays.toString(sourceFiles), e);\n        }\n        for (Path file : sourceFiles) {\n            mChecksum.add(file.getName(), DigestUtils.getHexDigest(mDestMetadata.info.checksumAlgo, file));\n        }\n    }\n\n    private void backupData() throws BackupException {\n        List<Path> dataFiles = new ArrayList<>(2);\n        if (mDestMetadata.info.flags.backupInternalData()) {\n            try {\n                dataFiles.add(mBackupLocation.findFile(CryptoUtils.getAppropriateFilename(mPackageName + \".zip\",\n                        mSourceCryptoMode)));\n            } catch (FileNotFoundException e) {\n                throw new BackupException(\"Could not get internal data backup.\", e);\n            }\n        }\n        if (mDestMetadata.info.flags.backupExternalData()) {\n            try {\n                dataFiles.add(mBackupLocation.findFile(EXTERNAL_FILES).findFile(CryptoUtils.getAppropriateFilename(\n                        mPackageName + \".zip\", mSourceCryptoMode)));\n            } catch (FileNotFoundException e) {\n                throw new BackupException(\"Could not get external data backup.\", e);\n            }\n        }\n        String tarType = mDestMetadata.info.tarType;\n        int i = 0;\n        Path[] files;\n        for (Path dataFile : dataFiles) {\n            files = new Path[]{dataFile};\n            // Decrypt APK file if needed\n            try {\n                files = ConvertUtils.decryptSourceFiles(files, mSourceCrypto, mSourceCryptoMode, mBackupItem);","sourceCodeStart":286,"sourceCodeEnd":322,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/backup/convert/OABConverter.java#L286-L322","documentation":"backupData() collects the internal data archive (<packageName>.zip, crypto-named) from the backup location when the destination metadata's flags request internal data backup. If findFile() cannot locate it, the FileNotFoundException is wrapped into this BackupException. It means internal-data backup was requested but the source zip is missing.","triggerScenarios":"backupData() (called from convert()) executes mBackupLocation.findFile(CryptoUtils.getAppropriateFilename(mPackageName + \".zip\", mSourceCryptoMode)) and throws FileNotFoundException at OABConverter.java:304, while mDestMetadata.info.flags.backupInternalData() is true.","commonSituations":"Source backup contained only external data (or only the APK), so no internal-data zip exists; the zip was deleted; wrong mSourceCryptoMode yields a wrong expected filename; the package name used for lookup differs from the zip's actual prefix.","solutions":["Copy the <packageName>.zip internal-data archive into the backup root (with the correct crypto-transformed name if encrypted).","Re-create the OAndBackup backup including internal data before converting.","If the source has no internal data, adjust the converted backup's flags so backupInternalData() is false (e.g. external-data-only conversion).","Verify mSourceCryptoMode and mPackageName match the on-disk zip name."],"exampleFix":"// before: flags request internal data but backup dir has only the external zip\n// after: place the internal zip in the backup root\n//   backup/com.example.app.zip   <- internal data\n//   backup/external_files/com.example.app.zip\n// or clear the internal-data flag before conversion","handlingStrategy":"validation","validationCode":"String internalZip = CryptoUtils.getAppropriateFilename(packageName + \".zip\", sourceCryptoMode);\nif (destFlags.backupInternalData() && !backupLocation.hasFile(internalZip)) {\n    throw new IllegalStateException(\"Internal data zip missing: \" + internalZip);\n}","typeGuard":null,"tryCatchPattern":"try {\n    converter.convert(...);\n} catch (BackupException e) {\n    if (e.getMessage().contains(\"internal data backup\")) {\n        Log.e(TAG, \"Internal <pkg>.zip not found; adjust flags or restore file\", e.getCause());\n    }\n}","preventionTips":["Only request internal-data backup when the source zip is present.","Keep package name and crypto mode consistent with the on-disk zip name.","Don't delete .zip archives from source backups before conversion."],"tags":["android","backup","file-not-found","data"],"backgroundTag":"file-not-found","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"}