|
|
@@ -6,6 +6,7 @@ using System.Reflection; |
|
|
|
using Shadowsocks.Controller; |
|
|
|
using Shadowsocks.Controller.Strategy; |
|
|
|
using SimpleJson; |
|
|
|
using Newtonsoft.Json; |
|
|
|
|
|
|
|
namespace Shadowsocks.Model |
|
|
|
{ |
|
|
@@ -28,10 +29,10 @@ namespace Shadowsocks.Model |
|
|
|
try |
|
|
|
{ |
|
|
|
var content = File.ReadAllText(ConfigFile); |
|
|
|
var configuration = SimpleJson.SimpleJson.DeserializeObject<StatisticsStrategyConfiguration>(content); |
|
|
|
var configuration = JsonConvert.DeserializeObject<StatisticsStrategyConfiguration>(content); |
|
|
|
return configuration; |
|
|
|
} |
|
|
|
catch (FileNotFoundException) |
|
|
|
catch (FileNotFoundException e) |
|
|
|
{ |
|
|
|
var configuration = new StatisticsStrategyConfiguration(); |
|
|
|
Save(configuration); |
|
|
@@ -48,7 +49,7 @@ namespace Shadowsocks.Model |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
var content = SimpleJson.SimpleJson.SerializeObject(configuration); |
|
|
|
var content = JsonConvert.SerializeObject(configuration, Formatting.Indented); |
|
|
|
File.WriteAllText(ConfigFile, content); |
|
|
|
} |
|
|
|
catch (Exception e) |
|
|
|