{"record":{"id":"60cd3d6bcd0e4a54","repo":"MuntashirAkon/AppManager","slug":"could-not-verify-extras-nfile-miscfile-getname-nfound","errorCode":null,"errorMessage":"Could not verify extras.\\nFile: \" + miscFile.getName() + \"\\nFound: \" + checksum + \"\\nRequired: \" + mChecksum.get(miscFile.getName())","messagePattern":"Could not verify extras\\.\\\\nFile: \" \\+ miscFile\\.getName\\(\\) \\+ \"\\\\nFound: \" \\+ checksum \\+ \"\\\\nRequired: \" \\+ mChecksum\\.get\\(miscFile\\.getName\\(\\)\\)","errorType":"exception","errorClass":"BackupException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/io/github/muntashirakon/AppManager/backup/VerifyOp.java","lineNumber":205,"sourceCode":"                            \"\\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()))) {\n            throw new BackupException(\"Could not verify extras.\" +\n                    \"\\nFile: \" + miscFile.getName() +\n                    \"\\nFound: \" + checksum +\n                    \"\\nRequired: \" + mChecksum.get(miscFile.getName()));\n        }\n    }\n\n    private void verifyRules() throws BackupException {\n        Path rulesFile;\n        try {\n            rulesFile = mBackupItem.getRulesFile();\n        } catch (IOException e) {\n            if (mBackupMetadata.hasRules) {\n                throw new BackupException(\"Rules file is missing.\", e);\n            } else {\n                // There are no rules, just skip\n                return;\n            }\n        }","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/MuntashirAkon/AppManager/blob/0152f468fc9463ee02dc2ca83f6fe4989a2c4ca5/app/src/main/java/io/github/muntashirakon/AppManager/backup/VerifyOp.java#L187-L223","documentation":"verifyExtras() checks the 'misc' file that stores app permissions (and other extras) when mBackupFlags.backupExtras() is set. Its computed digest doesn't match the recorded checksum, meaning the permissions/extras file was modified or corrupted after the backup was made. Missing extras are tolerated (IOException -> return) but an existing file with a wrong checksum is not.","triggerScenarios":"verify() -> verifyExtras() when mBackupFlags.backupExtras() is true and mBackupItem.getMiscFile() succeeds; DigestUtils.getHexDigest(...) != mChecksum.get(miscFile.getName()) — including a missing checksum entry (null required).","commonSituations":"User hand-edited the misc/permissions file (e.g. to pre-grant or strip permissions) without updating checksums; file corrupted in transfer; checksum file paired with a different backup; checksumAlgo recorded differs from the one used.","solutions":["Restore the original misc file from the source backup.","If the edit was intentional, recompute its digest with the recorded algo and update the checksum file entry.","Recreate the backup with extras included.","Disable the extras flag on restore if permission data isn't needed, so verifyExtras() is skipped."],"exampleFix":"// before\n//   Could not verify extras. File: misc.xml Found: ... Required: ...\n// after: recompute and update the checksum entry after intentional edit\n// $ sha256sum misc.xml","handlingStrategy":"validation","validationCode":"// Check extras file digest before verify (when extras flag set)\nif (flags.backupExtras()) {\n    Path misc = backupItem.getMiscFile(); // handle IOException as 'no extras'\n    if (!DigestUtils.getHexDigest(backupInfo.checksumAlgo, misc).equals(checksums.get(misc.getName()))) {\n        throw new IllegalStateException(\"extras/permissions file modified: \" + misc.getName());\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    verifyOp.verify();\n} catch (BackupException e) {\n    if (e.getMessage().startsWith(\"Could not verify extras\")) {\n        // restore original misc file or update its checksum entry after intentional edit\n    }\n}","preventionTips":["If you must adjust permissions in the misc file, recompute its checksum entry immediately afterwards.","Copy the misc file together with the checksum file; never edit only one side.","Disable the extras flag when permission data isn't required for the restore.","Verify right after backup creation to catch corruption at the source."],"tags":["backup","extras","permissions","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-14T11:17:12.474Z"}