MuntashirAkon/AppManager · error · BackupException
Couldn't verify metadata file.\nFile: " + infoFile + "\nFoun
Error message
Couldn't verify metadata file.\nFile: " + infoFile + "\nFound: " + checksum + "\nRequired: " + mChecksum.get(infoFile.getName())
What it means
VerifyOp.verifyMetadata() fails while checking the backup-info.json file (only for v5+ backups): the SHA digest of the info file on disk does not equal the digest recorded in the backup's checksum file. This means the info file was modified or corrupted after the backup was created, or the checksum entry is missing/stale. It is thrown as a BackupException so restore/verify aborts before trusting the backup metadata.
Source
Thrown at app/src/main/java/io/github/muntashirakon/AppManager/backup/VerifyOp.java:118
} catch (BackupException e) {
throw e;
} catch (Throwable th) {
throw new BackupException("Unknown error occurred", th);
}
}
private void verifyMetadata() throws BackupException {
boolean isV5AndUp = mBackupItem.isV5AndUp();
if (isV5AndUp) {
Path infoFile;
try {
infoFile = mBackupItem.getInfoFile();
} catch (IOException e) {
throw new BackupException("Could not get metadata file.", e);
}
String checksum = DigestUtils.getHexDigest(mBackupInfo.checksumAlgo, infoFile);
if (!checksum.equals(mChecksum.get(infoFile.getName()))) {
throw new BackupException("Couldn't verify metadata file." +
"\nFile: " + infoFile +
"\nFound: " + checksum +
"\nRequired: " + mChecksum.get(infoFile.getName()));
}
}
Path metadataFile;
try {
metadataFile = isV5AndUp ? mBackupItem.getMetadataV5File(false) : mBackupItem.getMetadataV2File();
} catch (IOException e) {
throw new BackupException("Could not get metadata file.", e);
}
String checksum = DigestUtils.getHexDigest(mBackupInfo.checksumAlgo, metadataFile);
if (!checksum.equals(mChecksum.get(metadataFile.getName()))) {
throw new BackupException("Couldn't verify metadata file." +
"\nFile: " + metadataFile +
"\nFound: " + checksum +
"\nRequired: " + mChecksum.get(metadataFile.getName()));
}View on GitHub (pinned to 0152f468fc)
Solutions
- Recreate the backup so the info file and its recorded checksum are regenerated consistently.
- Recompute the checksum of the info file with the recorded algorithm (e.g. sha256sum) and replace the corresponding entry in the backup's checksum file if the modification was intentional.
- Re-transfer the backup directory from its source — the file may be corrupted in transit.
- If checksum entry is simply absent, add an entry for the info file name in the checksum file using mBackupInfo.checksumAlgo.
Example fix
// before (hand-edited backup-info.json, restore fails) // after: regenerate checksum entry for the info file // $ sha256sum backup-info.json -> update entry in backup.checksums
Defensive patterns
Strategy: validation
Validate before calling
// Before constructing VerifyOp: recompute and compare the info-file digest
String algo = backupInfo.checksumAlgo;
String found = DigestUtils.getHexDigest(algo, backupItem.getInfoFile());
if (!found.equals(checksums.get("backup-info.json"))) {
throw new IllegalStateException("backup-info.json modified; regenerate checksums");
} Try / catch
try {
new VerifyOp(backupItem);
} catch (BackupException e) {
if (e.getMessage().startsWith("Couldn't verify metadata file")) {
// prompt user to re-copy or re-create the backup
}
} Prevention
- Never hand-edit files inside a backup directory without regenerating the checksum file.
- Always copy the entire backup directory (info, metadata, data, checksums) together.
- Verify backups right after creating them, before deleting the source.
- Use binary-safe transfer methods (adb pull, tar) rather than text-mode copies.
When it happens
Trigger: DigestUtils.getHexDigest(mBackupInfo.checksumAlgo, infoFile) != mChecksum.get(infoFile.getName()) during VerifyOp construction (verifyMetadata), for backups with format v5 and above; also thrown when the checksum file has no entry for the info file (get returns null).
Common situations: User edited backup-info.json by hand (e.g. to change flags or metadata) before restoring; partial/corrupted copy of the backup directory (truncated file during transfer); backup made on an older App Manager version whose info-file layout differs; files restored from cloud storage with line-ending or encoding changes.
Understand the failure class
Background: Checksum mismatch errors: "checksum verification failed", "digest mismatch", "expected vs actual checksum" — what they mean and how to fix them — this error's family across 41 libraries.
Related errors
- Data file verification failed for index ${i}.\nFile: ${file}
- Couldn't verify misc file.\nFile: ${miscFile}\nFound: ${chec
- Failed to create checksum file.
- Failed to get checksums.
- Couldn't verify metadata file.
AI-assisted analysis of MuntashirAkon/AppManager@0152f468fc (2026-09-12).
Data as JSON: /api/errors/b08292ea95b15959.
Report an issue: GitHub.