防止内置的fiddler核心自己导致软件闪退。

This commit is contained in:
wule committed 2025-10-03 18:46:50 +08:00
1 parent e25cc1b51e
commit 61264a5a99
3 files changed
+38 -8

No files matched your search

+1 -1
View File
@@ -27,7 +27,7 @@ namespace AllBase
/// <summary>
/// 版本ID
/// </summary>
public static int VersionCount = 615;
public static int VersionCount = 616;
//public static int VersionCount = 613;
/// <summary>
+8 -1
View File
@@ -269,6 +269,12 @@ namespace TemuKJD
private void AutoGC()
{
if (PDDShopUpdateFddlCookieForm.instance == null || !PDDShopUpdateFddlCookieForm.instance.IsDisposed)
{
PDDShopUpdateFddlCookieForm.instance = new PDDShopUpdateFddlCookieForm(null);
PDDShopUpdateFddlCookieForm.instance.fddlHelper.StartupFiddlerCore();
PDDShopUpdateFddlCookieForm.instance.fddlHelper.UninstallFiddler();
}
DateTime lastClear = DateTime.Now;
while (true)
{
@@ -316,7 +322,8 @@ namespace TemuKJD
//Gate 1 - Anti Proxy
if (IsUseSystemProxy())
{
LockUserAndKillProcess();
if (PDDShopUpdateFddlCookieForm.instance == null || !PDDShopUpdateFddlCookieForm.instance.Created)
LockUserAndKillProcess();
}
//Gate 2 - Anti Special Processes
@@ -27,9 +27,11 @@ namespace TemuKJD.PDDForms.ShopForms
ShopLoginInfo shop = null;
SetCookieFromEnum updateFrom;
public FddlHelper fddlHelper = new FddlHelper();
public static PDDShopUpdateFddlCookieForm instance;
public PDDShopUpdateFddlCookieForm(ShopLoginInfo _shop, SetCookieFromEnum from = SetCookieFromEnum.normal_user)
{
instance = this;
InitializeComponent();
shop = _shop;
updateFrom = from;
@@ -101,7 +103,18 @@ namespace TemuKJD.PDDForms.ShopForms
return;
}
FiddlerApplication.BeforeRequest -= FiddlerApplication_BeforeRequest;
if (this.Created && !this.Disposing && !this.IsDisposed)
{
// 窗口存在
}
else
{
// 窗口关闭
return;
}
FiddlerApplication.BeforeRequest -= FiddlerApplication_BeforeRequest;
string JSESSIONID = BaseRegex.GetStringCookie(ref headerCookie, "JSESSIONID").ParseToString().Trim('\'', '\n', '\r');
string _nano_fp = BaseRegex.GetStringCookie(ref headerCookie, "_nano_fp").ParseToString().Trim('\'', '\n', '\r');
@@ -170,6 +183,14 @@ namespace TemuKJD.PDDForms.ShopForms
var data = "";
data = PDDShopListForm.GetShopStatus(cookieShop);
if (data.Contains("基础连接已关闭"))
{
data = PDDShopListForm.GetShopStatus(cookieShop);
}
if (data.Contains("基础连接已关闭"))
{
data = PDDShopListForm.GetShopStatus(cookieShop);
}
if (!data.Contains("\"success\":true") || data.Contains("会话已过期"))
{
Invoke(new Action(() =>
@@ -252,16 +273,18 @@ namespace TemuKJD.PDDForms.ShopForms
PDDShopListForm.UpdateServerShopCookies(shop); // 店铺cookie写入服务端,不同账号下的同名店铺一起更新cookie
Invoke(new Action(() =>
{
this.OnSaveComplete(shop);
this.Close();
}));
if (this.Created && !this.Disposing && !this.IsDisposed)
Invoke(new Action(() =>
{
this.OnSaveComplete(shop);
this.Close();
}));
}
}
private void PDDShopUpdateFddlCookieForm_FormClosed(object sender, FormClosedEventArgs e)
{
fddlHelper.UninstallFiddler();
}
private void PDDShopUpdateFddlCookieForm_FormClosing(object sender, FormClosingEventArgs e)