mirror of
https://github.com/huiyadanli/RevokeMsgPatcher.git
synced 2025-07-07 15:56:08 +08:00
[+] 修复1.4版本不兼容3.7以下微信防撤回的问题
This commit is contained in:
parent
527d53eddc
commit
1af0b53999
File diff suppressed because one or more lines are too long
|
@ -17,7 +17,7 @@ namespace RevokeMsgPatcher
|
|||
{
|
||||
Apps = AppConfig(),
|
||||
LatestVersion = "1.4",
|
||||
PatchVersion = 20220514,
|
||||
PatchVersion = 20220515,
|
||||
Notice = ""
|
||||
};
|
||||
}
|
||||
|
@ -57,7 +57,8 @@ namespace RevokeMsgPatcher
|
|||
new TargetInfo
|
||||
{
|
||||
Name = "WeChatWin.dll",
|
||||
RelativePath = "WeChatWin.dll"
|
||||
RelativePath = "WeChatWin.dll",
|
||||
StartVersion = "1.0.0.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -65,7 +66,8 @@ namespace RevokeMsgPatcher
|
|||
new TargetInfo
|
||||
{
|
||||
Name = "WeChat.exe",
|
||||
RelativePath = "../WeChat.exe"
|
||||
RelativePath = "../WeChat.exe",
|
||||
StartVersion = "3.7.0.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -14,6 +14,10 @@ namespace RevokeMsgPatcher.Model
|
|||
|
||||
public string Memo { get; set; }
|
||||
|
||||
public string StartVersion { get; set; }
|
||||
|
||||
public string EndVersion { get; set; }
|
||||
|
||||
public TargetInfo Clone()
|
||||
{
|
||||
TargetInfo o = new TargetInfo();
|
||||
|
|
|
@ -242,9 +242,16 @@ namespace RevokeMsgPatcher.Modifier
|
|||
foreach (TargetInfo info in config.FileTargetInfos.Values)
|
||||
{
|
||||
FileHexEditor editor = new FileHexEditor(installPath, info);
|
||||
editors.Add(editor);
|
||||
// editor.FileVersion 在 StartVersion 和 EndVersion 之间
|
||||
if (IsInVersionRange(editor.FileVersion, info.StartVersion, info.EndVersion))
|
||||
{
|
||||
editors.Add(editor);
|
||||
}
|
||||
}
|
||||
if(editors.Count == 0)
|
||||
{
|
||||
throw new BusinessException("no_support_editor", "当前版本没有对应的文件修改信息,请确认补丁信息是否正常!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -319,12 +326,12 @@ namespace RevokeMsgPatcher.Modifier
|
|||
// SHA1不匹配,连版本也不匹配,说明完全不支持
|
||||
if (matchingVersion == null)
|
||||
{
|
||||
throw new BusinessException("not_support", $"不支持此版本:{editor.FileVersion}!");
|
||||
throw new BusinessException("not_support", $"不支持的文件:名称 {editor.FileName} 版本 {editor.FileVersion}!");
|
||||
}
|
||||
// SHA1不匹配,但是版本匹配,可能dll已经被其他补丁程序修改过
|
||||
if (matchingVersion != null)
|
||||
{
|
||||
throw new BusinessException("maybe_modified", $"程序支持此版本:{editor.FileVersion}。但是文件校验不通过,请确认是否使用过其他补丁程序!");
|
||||
throw new BusinessException("maybe_modified", $"程序支持此文件版本: {editor.FileName} - {editor.FileVersion}。但是文件校验不通过,请确认是否使用过其他补丁程序!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -339,6 +346,10 @@ namespace RevokeMsgPatcher.Modifier
|
|||
public bool Patch()
|
||||
{
|
||||
// 首先验证文件修改器是否没问题
|
||||
if(editors.Count == 0)
|
||||
{
|
||||
throw new Exception("补丁安装失败,原因:无对应的文件修改器");
|
||||
}
|
||||
foreach (FileHexEditor editor in editors)
|
||||
{
|
||||
if (editor == null)
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace RevokeMsgPatcher.Properties {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 {"Apps":{"Wechat":{"Name":"WeChat","FileTargetInfos":{"WeChatWin.dll":{"Name":"WeChatWin.dll","RelativePath":"WeChatWin.dll","Memo":null},"WeChat.exe":{"Name":"WeChat.exe","RelativePath":"../WeChat.exe","Memo":null}},"FileModifyInfos":{"WeChat.exe":[],"WeChatWin.dll":[{"Name":"WeChatWin.dll","Version":"3.3.5.25","SHA1Before":"3e94753ccbc2799d98f3c741377e99bdae33b4cf","SHA1After":"ab98f83fc16674ac4911380882c79c3ca4c2fd71","Changes":[{"Position":3413977,"Content":[235]},{"Position":12159591,"Content":[235]}]} [字符串的其余部分被截断]"; 的本地化字符串。
|
||||
/// 查找类似 {"Apps":{"Wechat":{"Name":"WeChat","FileTargetInfos":{"WeChatWin.dll":{"Name":"WeChatWin.dll","RelativePath":"WeChatWin.dll","Memo":null,"StartVersion":"1.0.0.0","EndVersion":null},"WeChat.exe":{"Name":"WeChat.exe","RelativePath":"../WeChat.exe","Memo":null,"StartVersion":"3.7.0.0","EndVersion":null}},"FileModifyInfos":{"WeChat.exe":[],"WeChatWin.dll":[{"Name":"WeChatWin.dll","Version":"3.3.5.25","SHA1Before":"3e94753ccbc2799d98f3c741377e99bdae33b4cf","SHA1After":"ab98f83fc16674ac4911380882c79c3ca4c2fd71"," [字符串的其余部分被截断]"; 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string PatchJson {
|
||||
get {
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user