mirror of
https://github.com/huiyadanli/RevokeMsgPatcher.git
synced 2025-05-23 22:06:06 +08:00
67 lines
1.8 KiB
C#
67 lines
1.8 KiB
C#
using RevokeMsgPatcher.Model;
|
|
using RevokeMsgPatcher.Utils;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace RevokeMsgPatcher.Modifier
|
|
{
|
|
class QQLiteModifier : AppModifier
|
|
{
|
|
public QQLiteModifier(App config)
|
|
{
|
|
this.config = config;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 自动寻找获取微信安装路径
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public override string FindInstallPath()
|
|
{
|
|
try
|
|
{
|
|
string installPath = PathUtil.FindInstallPathFromRegistry("QQLite");
|
|
if (!IsAllFilesExist(installPath))
|
|
{
|
|
List<string> defaultPathList = PathUtil.GetDefaultInstallPaths(@"Tencent\QQLite");
|
|
foreach (string defaultPath in defaultPathList)
|
|
{
|
|
if (IsAllFilesExist(defaultPath))
|
|
{
|
|
return defaultPath;
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
return installPath;
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Console.WriteLine(e.Message);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取整个APP的当前版本
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public override string GetVersion()
|
|
{
|
|
if (editors != null && editors.Count > 0)
|
|
{
|
|
foreach (FileHexEditor editor in editors)
|
|
{
|
|
if (editor.FileName == "IM.dll")
|
|
{
|
|
return editor.FileVersion;
|
|
}
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
}
|
|
}
|