mirror of
https://github.com/huiyadanli/RevokeMsgPatcher.git
synced 2025-05-23 05:46:07 +08:00
集成 LiteLoaderQQNT
This commit is contained in:
parent
f734a67586
commit
8b63257bb4
File diff suppressed because one or more lines are too long
|
@ -1380,7 +1380,7 @@ namespace RevokeMsgPatcher
|
|||
{
|
||||
Search = ByteUtil.HexStringToByteArray("48 89 CE 48 8B 11 4C 8B 41 08 49 29 D0 48 8B 49 18 E8 3F 3F 3F 3F"),
|
||||
Replace = ByteUtil.HexStringToByteArray("48 89 CE 48 8B 11 4C 8B 41 08 49 29 D0 48 8B 49 18 B8 01 00 00 00"),
|
||||
Category = "去校验"
|
||||
Category = "LiteLoaderQQNT+插件列表+防撤回"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -171,7 +171,7 @@ namespace RevokeMsgPatcher
|
|||
{
|
||||
DialogResult result = MessageBox.Show(@"防撤回(老) 和 防撤回带提示(新) 两个功能二选一即可!
|
||||
|
||||
1. 防撤回(老) 没有提示;
|
||||
1. 防撤回(老) 没有提示,新版本会出现撤回自己消息不断转圈的情况(实际撤回成功);
|
||||
|
||||
2. 防撤回带提示(新) 有撤回提示 但是存在以下问题:
|
||||
a. 如果正在和对方聊天时,对方撤回了消息,那撤回提示依然不会显示,只有在左侧预览窗有显示撤回,需要切换到和别人的聊天窗再切回来才能看到撤回提示,如果是把聊天拉出单独窗口,一直不会有撤回提示。
|
||||
|
@ -221,7 +221,7 @@ namespace RevokeMsgPatcher
|
|||
{
|
||||
modifier.Patch();
|
||||
ga.RequestPageView($"{enName}/{version}/patch/succ", "补丁安装成功");
|
||||
MessageBox.Show("补丁安装成功!");
|
||||
MessageBox.Show("补丁安装成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
catch (BusinessException ex)
|
||||
{
|
||||
|
@ -280,7 +280,16 @@ namespace RevokeMsgPatcher
|
|||
EnableAllButton(false);
|
||||
try
|
||||
{
|
||||
bool succ = modifier.Restore();
|
||||
bool succ;
|
||||
if (rbtQQNT.Checked)
|
||||
{
|
||||
succ = qqntModifier.Restore();
|
||||
}
|
||||
else
|
||||
{
|
||||
succ = modifier.Restore();
|
||||
}
|
||||
|
||||
if (succ)
|
||||
{
|
||||
MessageBox.Show("还原成功!");
|
||||
|
|
|
@ -134,6 +134,12 @@ namespace RevokeMsgPatcher.Modifier
|
|||
if (j == editors.Count)
|
||||
{
|
||||
label.Text = version + "(支持特征防撤回)";
|
||||
// QQNT 特殊处理
|
||||
if (config.Name == "QQNT")
|
||||
{
|
||||
label.Text = version + "(支持LiteLoader)";
|
||||
}
|
||||
|
||||
label.ForeColor = Color.LimeGreen;
|
||||
UIController.AddCategoryCheckBoxToPanel(panel, categories.ToArray(), installed.ToArray());
|
||||
}
|
||||
|
@ -256,6 +262,8 @@ namespace RevokeMsgPatcher.Modifier
|
|||
/// <param name="installPath">APP安装路径</param>
|
||||
public bool InitEditors(string installPath)
|
||||
{
|
||||
InstallPath = null;
|
||||
|
||||
// 初始化文件修改器
|
||||
editors = new List<FileHexEditor>();
|
||||
foreach (TargetInfo info in config.FileTargetInfos.Values)
|
||||
|
@ -275,6 +283,8 @@ namespace RevokeMsgPatcher.Modifier
|
|||
return false;
|
||||
}
|
||||
|
||||
InstallPath = installPath;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -413,6 +423,8 @@ namespace RevokeMsgPatcher.Modifier
|
|||
done.Add(editor);
|
||||
}
|
||||
}
|
||||
|
||||
AfterPatchSuccess();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -422,6 +434,7 @@ namespace RevokeMsgPatcher.Modifier
|
|||
editor.Restore();
|
||||
}
|
||||
|
||||
AfterPatchFail();
|
||||
throw ex;
|
||||
}
|
||||
|
||||
|
@ -478,5 +491,9 @@ namespace RevokeMsgPatcher.Modifier
|
|||
throw new Exception("备份文件不存在,还原失败!");
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void AfterPatchSuccess();
|
||||
|
||||
public abstract void AfterPatchFail();
|
||||
}
|
||||
}
|
|
@ -12,6 +12,14 @@ namespace RevokeMsgPatcher.Modifier
|
|||
this.config = config;
|
||||
}
|
||||
|
||||
public override void AfterPatchSuccess()
|
||||
{
|
||||
}
|
||||
|
||||
public override void AfterPatchFail()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自动寻找获取微信安装路径
|
||||
/// </summary>
|
||||
|
|
|
@ -12,6 +12,14 @@ namespace RevokeMsgPatcher.Modifier
|
|||
this.config = config;
|
||||
}
|
||||
|
||||
public override void AfterPatchSuccess()
|
||||
{
|
||||
}
|
||||
|
||||
public override void AfterPatchFail()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自动寻找获取微信安装路径
|
||||
/// </summary>
|
||||
|
|
|
@ -2,7 +2,10 @@
|
|||
using RevokeMsgPatcher.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace RevokeMsgPatcher.Modifier
|
||||
{
|
||||
|
@ -75,5 +78,70 @@ namespace RevokeMsgPatcher.Modifier
|
|||
|
||||
return "";
|
||||
}
|
||||
|
||||
public string GetIndexJsPath()
|
||||
{
|
||||
if (string.IsNullOrEmpty(InstallPath))
|
||||
{
|
||||
throw new Exception("未获取到QQNT安装路径或者QQNT安装路径不合法");
|
||||
}
|
||||
|
||||
string indexPath = Path.Combine(InstallPath, @"resources\app\app_launcher\index.js");
|
||||
if (!File.Exists(indexPath))
|
||||
{
|
||||
throw new Exception("未找到index.js文件");
|
||||
}
|
||||
|
||||
return indexPath;
|
||||
}
|
||||
|
||||
public string GetLiteLoaderPath()
|
||||
{
|
||||
return Path.Combine(Application.StartupPath, @"LiteLoaderQQNT");
|
||||
}
|
||||
|
||||
public override void AfterPatchSuccess()
|
||||
{
|
||||
string indexPath = GetIndexJsPath();
|
||||
string content = File.ReadAllText(indexPath);
|
||||
// 正则 require\(String.raw`.*`\);
|
||||
string pattern = @"require\(String.raw`.*`\);";
|
||||
string replacement = $"require(String.raw`{GetLiteLoaderPath()}`);";
|
||||
if (Regex.IsMatch(content, pattern))
|
||||
{
|
||||
content = Regex.Replace(content, pattern, replacement);
|
||||
}
|
||||
else
|
||||
{
|
||||
content = replacement + "\n" + content;
|
||||
}
|
||||
|
||||
File.WriteAllText(indexPath, content);
|
||||
}
|
||||
|
||||
public override void AfterPatchFail()
|
||||
{
|
||||
try
|
||||
{
|
||||
string indexPath = GetIndexJsPath();
|
||||
string content = File.ReadAllText(indexPath);
|
||||
string pattern = @"require\(String.raw`.*`\);\n";
|
||||
if (Regex.IsMatch(content, pattern))
|
||||
{
|
||||
content = Regex.Replace(content, pattern, "");
|
||||
File.WriteAllText(indexPath, content);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.WriteLine(e);
|
||||
}
|
||||
}
|
||||
|
||||
public new bool Restore()
|
||||
{
|
||||
AfterPatchFail();
|
||||
return base.Restore();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -10,6 +10,15 @@ namespace RevokeMsgPatcher.Modifier
|
|||
{
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
public override void AfterPatchSuccess()
|
||||
{
|
||||
}
|
||||
|
||||
public override void AfterPatchFail()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自动寻找获取微信安装路径
|
||||
/// </summary>
|
||||
|
|
|
@ -14,6 +14,14 @@ namespace RevokeMsgPatcher.Modifier
|
|||
this.config = config;
|
||||
}
|
||||
|
||||
public override void AfterPatchSuccess()
|
||||
{
|
||||
}
|
||||
|
||||
public override void AfterPatchFail()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自动寻找获取微信安装路径
|
||||
/// </summary>
|
||||
|
|
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
|
||||
// 方法是按如下所示使用“*”: :
|
||||
//[assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.7")]
|
||||
[assembly: AssemblyFileVersion("1.7")]
|
||||
[assembly: AssemblyVersion("1.8")]
|
||||
[assembly: AssemblyFileVersion("1.8")]
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user