MuntashirAkon/AppManager · error · BackupException

Failed to get checksums.

Error message

Failed to get checksums.

What it means

RestoreOp loads the checksum manifest with mBackupItem.getChecksum() and wraps any Throwable as BackupException 'Failed to get checksums.' Checksums are required before metadata verification, so the restore aborts and the backup item is cleaned up.

Source

Thrown at app/src/main/java/io/github/muntashirakon/AppManager/backup/RestoreOp.java:141

        }
        try {
            mBackupItem.setCrypto(mBackupInfo.getCrypto());
        } catch (CryptoException e) {
            mBackupItem.cleanup();
            throw new BackupException("Could not get crypto " + mBackupInfo.crypto, e);
        }
        try {
            mBackupMetadata = mBackupItem.getMetadata(mBackupInfo).metadata;
        } catch (IOException e) {
            mBackupItem.cleanup();
            throw new BackupException("Could not read backup metadata. Possibly due to a malformed json file.", e);
        }
        // Get checksums
        try {
            mChecksum = mBackupItem.getChecksum();
        } catch (Throwable e) {
            mBackupItem.cleanup();
            throw new BackupException("Failed to get checksums.", e);
        }
        // Verify metadata
        if (!requestedFlags.skipSignatureCheck()) {
            try {
                verifyMetadata();
            } catch (BackupException e) {
                mBackupItem.cleanup();
                throw e;
            }
        }
        // Check user handle
        if (mBackupInfo.userId != userId) {
            Log.w(TAG, "Using different user handle.");
        }
        // Get package info
        mPackageInfo = null;
        try {
            mPackageInfo = PackageManagerCompat.getPackageInfo(packageName, GET_SIGNING_CERTIFICATES

View on GitHub (pinned to 0152f468fc)

Solutions

  1. Ensure the checksum file from the original backup is present and complete in the backup directory
  2. Re-copy the entire backup folder in one operation and compare sizes/checksums of the manifest itself
  3. If the backup intentionally has no checksums, re-create the backup with checksum verification enabled
  4. Inspect the wrapped Throwable to identify parse vs I/O errors

Example fix

// before
try {
    mChecksum = mBackupItem.getChecksum();
} catch (Throwable e) {
    mBackupItem.cleanup();
    throw new BackupException("Failed to get checksums.", e);
}
// after
File checksumFile = new File(backupDir, "checksums.txt");
if (!checksumFile.exists()) {
    throw new BackupException("checksums.txt missing from backup directory " + backupDir);
}
try {
    mChecksum = mBackupItem.getChecksum();
} catch (Throwable e) {
    mBackupItem.cleanup();
    throw new BackupException("Failed to get checksums.", e);
}
Defensive patterns

Strategy: validation

Validate before calling

File cs = new File(backupDir, "checksums.txt");
if (!cs.isFile() || cs.length() == 0) throw new BackupException("Checksum manifest missing/empty in " + backupDir);

Try / catch

try { restoreOp.runRestore(progressHandler); } catch (BackupException e) { if ("Failed to get checksums.".equals(e.getMessage())) { recopyBackupOrSkipIntegrityCheck(); } throw e; }

Prevention

When it happens

Trigger: getChecksum() throws because checksums.txt (or the v5 equivalent) is missing, unreadable, or its lines are malformed; any Throwable is caught, including RuntimeExceptions from parsing.

Common situations: Backup folder copied without checksums file; checksum file truncated by interrupted transfer; empty checksum file for backups created without checksum checking but the restore path still demands it.

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


AI-assisted analysis of MuntashirAkon/AppManager@0152f468fc (2026-09-12). Data as JSON: /api/errors/68388f52affbfb29. Report an issue: GitHub.