QQModifier.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using RevokeMsgPatcher.Model;
  2. using RevokeMsgPatcher.Utils;
  3. namespace RevokeMsgPatcher.Modifier
  4. {
  5. class QQModifier : AppModifier
  6. {
  7. public QQModifier(App config)
  8. {
  9. this.config = config;
  10. }
  11. /// <summary>
  12. /// 自动寻找获取微信安装路径
  13. /// </summary>
  14. /// <returns></returns>
  15. public override string FindInstallPath()
  16. {
  17. string installPath = PathUtil.FindInstallPathFromRegistry("{052CFB79-9D62-42E3-8A15-DE66C2C97C3E}");
  18. if (!IsAllFilesExist(installPath))
  19. {
  20. foreach (string defaultPath in PathUtil.GetDefaultInstallPaths(@"Tencent\QQ"))
  21. {
  22. if (IsAllFilesExist(defaultPath))
  23. {
  24. return defaultPath;
  25. }
  26. }
  27. }
  28. else
  29. {
  30. return installPath;
  31. }
  32. return null;
  33. }
  34. /// <summary>
  35. /// 获取整个APP的当前版本
  36. /// </summary>
  37. /// <returns></returns>
  38. public override string GetVersion()
  39. {
  40. if (editors != null && editors.Count > 0)
  41. {
  42. foreach (FileHexEditor editor in editors)
  43. {
  44. if (editor.FileName == "IM.dll")
  45. {
  46. return editor.FileVersion;
  47. }
  48. }
  49. }
  50. return "";
  51. }
  52. }
  53. }