Skip to content

Commit

Permalink
Merge pull request #730 from huiyadanli/feat-qqnt
Browse files Browse the repository at this point in the history
安装 LiteLoaderQQNT 实现 QQNT 的防撤回
  • Loading branch information
huiyadanli authored Jun 15, 2024
2 parents 4de1791 + 344f2f7 commit 193dec8
Show file tree
Hide file tree
Showing 15 changed files with 378 additions and 36 deletions.
1 change: 1 addition & 0 deletions RevokeMsgPatcher.Assistant/Data/1.8/patch.json

Large diffs are not rendered by default.

51 changes: 48 additions & 3 deletions RevokeMsgPatcher.Assistant/JsonData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public Bag Bag()
return new Bag
{
Apps = AppConfig(),
LatestVersion = "1.7",
PatchVersion = 20240614,
LatestVersion = "1.8",
PatchVersion = 20240615,
Notice = "",
NoticeUrl = "",
};
Expand All @@ -36,7 +36,8 @@ public Dictionary<string, App> AppConfig()
{ "Wechat" , Wechat() },
{ "QQ" , QQ() },
{ "TIM" , TIM() },
{ "QQLite" , QQLite() }
{ "QQLite" , QQLite() },
{ "QQNT" , QQNT() }
};
}

Expand Down Expand Up @@ -1344,5 +1345,49 @@ public App QQLite()
}
};
}


public App QQNT()
{
return new App
{
Name = "QQNT",
FileTargetInfos = new Dictionary<string, TargetInfo>
{
{
"QQ.exe",
new TargetInfo
{
Name = "QQ.exe",
RelativePath = "QQ.exe"
}
}
},
FileCommonModifyInfos = new Dictionary<string, List<CommonModifyInfo>>
{
{
"QQ.exe",
new List<CommonModifyInfo>
{
new CommonModifyInfo
{
Name="QQ.exe",
StartVersion="9.9.10.00000",
EndVersion="",
ReplacePatterns = new List<ReplacePattern>
{
new ReplacePattern
{
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 = "LiteLoaderQQNT+插件列表+防撤回"
}
}
}
}
}
}
};
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
<None Include="Data\1.5\patch.json" />
<None Include="Data\1.6\patch.json" />
<None Include="Data\1.7\patch.json" />
<None Include="Data\1.8\patch.json" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down
20 changes: 17 additions & 3 deletions RevokeMsgPatcher/FormMain.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 24 additions & 3 deletions RevokeMsgPatcher/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public partial class FormMain : Form
private QQModifier qqModifier = null;
private TIMModifier timModifier = null;
private QQLiteModifier qqLiteModifier = null;
private QQNTModifier qqntModifier = null;

private string thisVersion;
private bool needUpdate = false;
Expand All @@ -42,11 +43,13 @@ public void InitModifier()
qqModifier = new QQModifier(bag.Apps["QQ"]);
timModifier = new TIMModifier(bag.Apps["TIM"]);
qqLiteModifier = new QQLiteModifier(bag.Apps["QQLite"]);
qqntModifier = new QQNTModifier(bag.Apps["QQNT"]);

rbtWechat.Tag = wechatModifier;
rbtQQ.Tag = qqModifier;
rbtTIM.Tag = timModifier;
rbtQQLite.Tag = qqLiteModifier;
rbtQQNT.Tag = qqntModifier;

// 默认微信
rbtWechat.Enabled = true;
Expand Down Expand Up @@ -168,7 +171,7 @@ private void btnPatch_Click(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show(@"防撤回(老) 和 防撤回带提示(新) 两个功能二选一即可!
1. 防撤回(老) 没有提示;
1. 防撤回(老) 没有提示,新版本会出现撤回自己消息不断转圈的情况(实际撤回成功)
2. 防撤回带提示(新) 有撤回提示 但是存在以下问题:
a. 如果正在和对方聊天时,对方撤回了消息,那撤回提示依然不会显示,只有在左侧预览窗有显示撤回,需要切换到和别人的聊天窗再切回来才能看到撤回提示,如果是把聊天拉出单独窗口,一直不会有撤回提示。
Expand Down Expand Up @@ -218,7 +221,7 @@ c. 部分历史消息无法防撤回;
{
modifier.Patch();
ga.RequestPageView($"{enName}/{version}/patch/succ", "补丁安装成功");
MessageBox.Show("补丁安装成功!");
MessageBox.Show("补丁安装成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (BusinessException ex)
{
Expand Down Expand Up @@ -277,7 +280,16 @@ private void btnRestore_Click(object sender, EventArgs e)
EnableAllButton(false);
try
{
bool succ = modifier.Restore();
bool succ;
if (rbtQQNT.Checked)
{
succ = qqntModifier.Restore();
}
else
{
succ = modifier.Restore();
}

if (succ)
{
MessageBox.Show("还原成功!");
Expand Down Expand Up @@ -368,6 +380,7 @@ private void lblUpdatePachJson_Click(object sender, EventArgs e)

tips += "支持以下版本" + Environment.NewLine;
tips += " ➯ 微信:" + wechatModifier.Config.GetSupportVersionStr() + Environment.NewLine;
tips += " ➯ QQNT:" + qqntModifier.Config.GetSupportVersionStr() + Environment.NewLine;
tips += " ➯ QQ:" + qqModifier.Config.GetSupportVersionStr() + Environment.NewLine;
tips += " ➯ QQ轻聊版:" + qqLiteModifier.Config.GetSupportVersionStr() + Environment.NewLine;
tips += " ➯ TIM:" + timModifier.Config.GetSupportVersionStr() + Environment.NewLine;
Expand Down Expand Up @@ -406,6 +419,10 @@ private void radioButtons_CheckedChanged(object sender, EventArgs e)
{
modifier = (QQLiteModifier)rbtQQLite.Tag;
}
else if (rbtQQNT.Checked)
{
modifier = (QQNTModifier)rbtQQNT.Tag;
}

EnableAllButton(true);
// 触发了 txtPath_TextChanged 方法 已经调用了 InitEditorsAndUI(txtPath.Text);
Expand Down Expand Up @@ -433,6 +450,10 @@ private string GetCheckedRadioButtonNameEn()
{
return "qqlite";
}
else if (rbtQQNT.Checked)
{
return "qqnt";
}

return "none";
}
Expand Down
Loading

0 comments on commit 193dec8

Please sign in to comment.