Skip to content

Commit 9d3fad0

Browse files
author
Soul Dark
committed
update to 5.0.1
1 parent 4d49f82 commit 9d3fad0

File tree

5 files changed

+62
-15
lines changed

5 files changed

+62
-15
lines changed

shadowsocks-csharp/Controller/UpdateChecker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class UpdateChecker
2121

2222
public const string Name = "ShadowsocksR";
2323
public const string Copyright = "Copyright © BreakWa11 2017. Fork from Shadowsocks by clowwindy";
24-
public const string Version = "4.0.0";
24+
public const string Version = "5.0.2";
2525
#if !_DOTNET_4_0
2626
public const string NetVer = "2.0";
2727
#elif !_CONSOLE

shadowsocks-csharp/Program.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
using Shadowsocks.Controller;
2-
using Shadowsocks.Properties;
2+
using Shadowsocks.Util;
33
using System;
44
using System.Collections.Generic;
55
using System.Diagnostics;
66
using System.IO;
7-
using System.Net;
87
using System.Threading;
98
using System.Windows.Forms;
109
using Microsoft.Win32;
@@ -17,9 +16,9 @@ namespace Shadowsocks
1716
{
1817
static class Program
1918
{
20-
static ShadowsocksController _controller;
19+
private static ShadowsocksController _controller;
2120
#if !_CONSOLE
22-
static MenuViewController _viewController;
21+
public static MenuViewController _viewController { get; set; }
2322
#endif
2423

2524
/// <summary>
@@ -40,14 +39,18 @@ static void Main(string[] args)
4039
return;
4140
}
4241
}
42+
43+
if (Utils.is360Exist()){
44+
return;
45+
}
46+
4347
using (Mutex mutex = new Mutex(false, "Global\\ShadowsocksR_" + Application.StartupPath.GetHashCode()))
4448
{
4549
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
4650
Application.EnableVisualStyles();
4751
Application.ApplicationExit += Application_ApplicationExit;
4852
SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
4953
Application.SetCompatibleTextRenderingDefault(false);
50-
5154
if (!mutex.WaitOne(0, false))
5255
{
5356
MessageBox.Show(I18N.GetString("Find Shadowsocks icon in your notify tray.") + "\n" +

shadowsocks-csharp/Util/Util.cs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
using System.Security.Cryptography;
1212
using System.Text;
1313
using System.Windows.Forms;
14+
using Microsoft.Win32;
1415
using OpenDNS;
1516
using Shadowsocks.Controller;
16-
using Shadowsocks.Encryption;
17+
using Shadowsocks;
1718
using Shadowsocks.Model;
1819

1920
namespace Shadowsocks.Util
@@ -490,6 +491,27 @@ public static int GetDpiMul()
490491
return (dpi * 4 + 48) / 96;
491492
}
492493

494+
public static bool is360Exist()
495+
{
496+
List<Process> process = new List<Process>(Process.GetProcessesByName("ZhuDongFangYu"));
497+
process.AddRange(Process.GetProcessesByName("360Safe"));
498+
string registry_path_360Safe = (IntPtr.Size == 4 ? @"Software\Microsoft\Windows\CurrentVersion\App Paths\360safe.exe" : @"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\App Paths\360safe.exe");
499+
string registry_path_360Se6 = (IntPtr.Size == 4 ? @"Software\Microsoft\Windows\CurrentVersion\App Paths\360se6.exe" : @"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\App Paths\360se6.exe");
500+
RegistryKey registry_360Safe = Registry.LocalMachine.OpenSubKey(registry_path_360Safe);
501+
RegistryKey registry_360Se6 = Registry.LocalMachine.OpenSubKey(registry_path_360Se6);
502+
if (
503+
process.Count != 0 ||
504+
registry_360Safe != null||
505+
registry_360Se6 != null
506+
)
507+
{
508+
//因为只有国行小白才会看到本消息,所以用中文
509+
MessageBox.Show(I18N.GetString("SSRR无法运行于安装有360的电脑,告辞!"));
510+
return true;
511+
}
512+
return false;
513+
}
514+
493515
#if !_CONSOLE
494516
public enum DeviceCap
495517
{

shadowsocks-csharp/View/MenuViewController.cs

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
using Shadowsocks.Model;
33
using Shadowsocks.Properties;
44
using System;
5-
using System.IO;
65
using System.Collections.Generic;
76
using System.Diagnostics;
87
using System.Drawing;
9-
using System.Text;
108
using System.Windows.Forms;
119
using System.Runtime.InteropServices;
1210

@@ -15,6 +13,7 @@
1513
using ZXing.QrCode;
1614
using System.Threading;
1715
using System.Text.RegularExpressions;
16+
using Shadowsocks.Util;
1817

1918
namespace Shadowsocks.View
2019
{
@@ -68,6 +67,7 @@ public class MenuViewController
6867
private SubscribeForm subScribeForm;
6968
private LogForm logForm;
7069
private string _urlToOpen;
70+
private System.Timers.Timer timerDetect360;
7171
private System.Timers.Timer timerDelayCheckUpdate;
7272

7373
private bool configfrom_open = false;
@@ -105,13 +105,24 @@ public MenuViewController(ShadowsocksController controller)
105105
updateSubscribeManager = new UpdateSubscribeManager();
106106

107107
LoadCurrentConfiguration();
108+
timerDetect360 = new System.Timers.Timer(1000.0*30);
109+
timerDetect360.Elapsed += timerDetect360_Elapsed;
110+
timerDetect360.Start();
108111

109112
timerDelayCheckUpdate = new System.Timers.Timer(1000.0 * 10);
110-
timerDelayCheckUpdate.Elapsed += timer_Elapsed;
113+
timerDelayCheckUpdate.Elapsed += timerDelayCheckUpdate_Elapsed;
111114
timerDelayCheckUpdate.Start();
112115
}
113116

114-
private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
117+
private void timerDetect360_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
118+
{
119+
if (Utils.is360Exist())
120+
{
121+
Quit();
122+
}
123+
}
124+
125+
private void timerDelayCheckUpdate_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
115126
{
116127
if (timerDelayCheckUpdate != null)
117128
{
@@ -638,7 +649,7 @@ void updateChecker_NewVersionFound(object sender, EventArgs e)
638649
I18N.GetString("Click menu to download"), ToolTipIcon.Info, 10000);
639650
_notifyIcon.BalloonTipClicked += notifyIcon1_BalloonTipClicked;
640651

641-
timerDelayCheckUpdate.Elapsed -= timer_Elapsed;
652+
timerDelayCheckUpdate.Elapsed -= timerDelayCheckUpdate_Elapsed;
642653
timerDelayCheckUpdate.Stop();
643654
timerDelayCheckUpdate = null;
644655
}
@@ -970,7 +981,7 @@ private void Setting_Click(object sender, EventArgs e)
970981
ShowSettingForm();
971982
}
972983

973-
private void Quit_Click(object sender, EventArgs e)
984+
private void Quit()
974985
{
975986
controller.Stop();
976987
if (configForm != null)
@@ -983,16 +994,27 @@ private void Quit_Click(object sender, EventArgs e)
983994
serverLogForm.Close();
984995
serverLogForm = null;
985996
}
997+
if (timerDetect360 != null)
998+
{
999+
timerDetect360.Elapsed -= timerDetect360_Elapsed;
1000+
timerDetect360.Stop();
1001+
timerDetect360 = null;
1002+
}
9861003
if (timerDelayCheckUpdate != null)
9871004
{
988-
timerDelayCheckUpdate.Elapsed -= timer_Elapsed;
1005+
timerDelayCheckUpdate.Elapsed -= timerDelayCheckUpdate_Elapsed;
9891006
timerDelayCheckUpdate.Stop();
9901007
timerDelayCheckUpdate = null;
9911008
}
9921009
_notifyIcon.Visible = false;
9931010
Application.Exit();
9941011
}
9951012

1013+
private void Quit_Click(object sender, EventArgs e)
1014+
{
1015+
Quit();
1016+
}
1017+
9961018
private void OpenWiki_Click(object sender, EventArgs e)
9971019
{
9981020
Process.Start("https://github.com/shadowsocksrr/shadowsocks-rss/wiki");

shadowsocks-csharp/ssr-win-4.0.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:files="https://sourceforge.net/api/files.rdf#" xmlns:media="http://video.search.yahoo.com/mrss/" xmlns:doap="http://usefulinc.com/ns/doap#" xmlns:sf="https://sourceforge.net/api/sfelements.rdf#" version="2.0">
33
<channel xmlns:files="https://sourceforge.net/api/files.rdf#" xmlns:media="http://video.search.yahoo.com/mrss/" xmlns:doap="http://usefulinc.com/ns/doap#" xmlns:sf="https://sourceforge.net/api/sfelements.rdf#">
44
<item>
5-
<media:content xmlns:media="http://video.search.yahoo.com/mrss/" type="application/zip; charset=binary" url="https://github.com/SoDa-GitHub/shadowsocksrr-csharp/releases/download/5.0.0/ShadowsocksR-win-5.0.1.zip" filesize="397252"></media:content>
5+
<media:content xmlns:media="http://video.search.yahoo.com/mrss/" type="application/zip; charset=binary" url="https://github.com/SoDa-GitHub/shadowsocksrr-csharp/releases/download/5.0.2/ShadowsocksR-win-5.0.2.7z" filesize="828351"></media:content>
66
</item>
77
</channel>
88
</rss>

0 commit comments

Comments
 (0)