{"record":{"id":"50a98a31d425af55","repo":"MuntashirAkon/AppManager","slug":"could-not-verify-data-files-at-index-i-nfile-file-getname","errorCode":null,"errorMessage":"Could not verify data files at index \" + i + \".\\nFile: \" + file.getName() + \"\\nFound: \" + checksum + \"\\nRequired: \" + mChecksum.get(file.getName())","messagePattern":"Could not verify data files at index \" \\+ i \\+ \"\\.\\\\nFile: \" \\+ file\\.getName\\(\\) \\+ \"\\\\nFound: \" \\+ checksum \\+ \"\\\\nRequired: \" \\+ mChecksum\\.get\\(file\\.getName\\(\\)\\)","errorType":"exception","errorClass":"BackupException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/backup/VerifyOp.java","lineNumber":186,"sourceCode":"                        \"\\nFile: \" + file.getName() +\n                        \"\\nFound: \" + checksum +\n                        \"\\nRequired: \" + mChecksum.get(file.getName()));\n            }\n        }\n    }\n\n    private void verifyData() throws BackupException {\n        Path[] dataFiles;\n        String checksum;\n        for (int i = 0; i < mBackupMetadata.dataDirs.length; ++i) {\n            dataFiles = mBackupItem.getDataFiles(i);\n            if (dataFiles.length == 0) {\n                throw new BackupException(\"No data files at index \" + i + \".\");\n            }\n            for (Path file : dataFiles) {\n                checksum = DigestUtils.getHexDigest(mBackupInfo.checksumAlgo, file);\n                if (!checksum.equals(mChecksum.get(file.getName()))) {\n                    throw new BackupException(\"Could not verify data files at index \" + i + \".\" +\n                            \"\\nFile: \" + file.getName() +\n                            \"\\nFound: \" + checksum +\n                            \"\\nRequired: \" + mChecksum.get(file.getName()));\n                }\n            }\n        }\n    }\n\n    private void verifyExtras() throws BackupException {\n        Path miscFile;\n        try {\n            miscFile = mBackupItem.getMiscFile();\n        } catch (IOException ignore) {\n            // There are no permissions, just skip\n            return;\n        }\n        String checksum = DigestUtils.getHexDigest(mBackupInfo.checksumAlgo, miscFile);\n        if (!checksum.equals(mChecksum.get(miscFile.getName()))) {","sourceCodeStart":168,"sourceCodeEnd":204,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/backup/VerifyOp.java#L168-L204","documentation":"A data file belonging to data directory index i fails checksum verification: the computed digest differs from the one recorded in the backup's checksum file. The backed-up app data archives are corrupt or altered, and App Manager refuses to verify/restore them.","triggerScenarios":"verify() -> verifyData() loop; for any Path file in mBackupItem.getDataFiles(i), DigestUtils.getHexDigest(mBackupInfo.checksumAlgo, file) != mChecksum.get(file.getName()); also fires when the checksum file lacks an entry for that data file.","commonSituations":"Large split data archives truncated during copy to/from SD card or cloud; user edited/repacked the data archive; checksum file from a different backup run; SD card corruption affecting one archive part.","solutions":["Identify the corrupt file from 'File:' in the message and re-copy just that part from the original backup.","Recreate the backup to regenerate data files plus checksums.","Confirm the checksum file corresponds to the same backup (mismatched pairing yields false failures).","Recompute the digest of an intentionally modified archive and update the checksum entry if you accept the change."],"exampleFix":"// before\n//   Could not verify data files at index 0. File: data0.tar.gz Found: ... Required: ...\n// after: re-copy data0.tar.gz from the intact backup or update its checksum entry\n// $ sha256sum data0.tar.gz","handlingStrategy":"validation","validationCode":"// Digest-check data archives before library verify\nfor (int i = 0; i < metadata.dataDirs.length; i++) {\n    for (Path f : backupItem.getDataFiles(i)) {\n        if (!DigestUtils.getHexDigest(backupInfo.checksumAlgo, f).equals(checksums.get(f.getName()))) {\n            throw new IllegalStateException(\"data file corrupt: \" + f.getName());\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    verifyOp.verify();\n} catch (BackupException e) {\n    if (e.getMessage().startsWith(\"Could not verify data files at index\")) {\n        // re-copy the named archive part or recreate the backup\n    }\n}","preventionTips":["Use checksum-friendly, binary-safe transfer paths; SD card FAT corruption is a common culprit — prefer internal storage.","Re-verify data archives after each move between devices or cloud round-trips.","Keep data parts and the checksum file from the same backup run together.","For very large app data, split verification so a single corrupt part is easy to localize."],"tags":["backup","data","integrity","checksum"],"backgroundTag":"checksum-mismatch","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"}