{"record":{"id":"e956769721ae380a","repo":"huiyadanli/RevokeMsgPatcher","slug":"error-e95676","errorCode":null,"errorMessage":"备份文件不存在，还原失败！","messagePattern":"备份文件不存在，还原失败！","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"RevokeMsgPatcher/Modifier/AppModifier.cs","lineNumber":491,"sourceCode":"                        {\n                            editor.Restore();\n                        }\n                        else\n                        {\n                            return false;\n                        }\n                    }\n                    else\n                    {\n                        editor.Restore();\n                    }\n                }\n\n                return true;\n            }\n            else\n            {\n                throw new Exception(\"备份文件不存在，还原失败！\");\n            }\n        }\n\n        public abstract void  AfterPatchSuccess();\n\n        public abstract void AfterPatchFail();\n    }\n}","sourceCodeStart":473,"sourceCodeEnd":499,"githubUrl":"https://github.com/huiyadanli/RevokeMsgPatcher/blob/89cbbb3f0cc896d5d092de0199a635c5c39944b6/RevokeMsgPatcher/Modifier/AppModifier.cs#L473-L499","documentation":"AppModifier.Restore() calls BackupExists(), which checks every editor's .h.bak file exists AND its BackupFileVersion equals the current FileVersion. If any fails, it throws a plain Exception because there is no valid backup to restore from.","triggerScenarios":"Restoring when no backup was ever made (patch never ran), the .h.bak was deleted, or the app updated so BackupFileVersion != current FileVersion (treated as a missing/mismatched backup).","commonSituations":"Restore clicked before any patch; WeChat/QQ auto-updated so the .bak is from a different version; backup files cleaned up manually.","solutions":["If a patch was applied earlier, locate or recreate the matching .h.bak before restoring.","Otherwise obtain a clean/original DLL and restore it manually.","Disable the target app's auto-update, or re-patch after updates (which re-creates fresh backups)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!modifier.BackupExists())\n{\n    MessageBox.Show(\"备份文件不存在或版本不匹配，无法还原。请提供原始文件或重新打补丁。\");\n    return;\n}\nmodifier.Restore();","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run Patch at least once (it creates .h.bak) before relying on Restore.","Disable target app auto-update, or re-patch after updates so backups stay version-matched.","Keep .h.bak files intact; do not manually clean the app directory."],"tags":["app-modifier","restore","backup-missing"],"backgroundTag":null,"analyzedSha":"89cbbb3f0cc896d5d092de0199a635c5c39944b6","analyzedAt":"2026-08-13T10:37:37.073Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}