File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed
Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ namespace SimpleDnsCrypt . Helper
2+ {
3+ /// <summary>
4+ /// Class to update the configuration file.
5+ /// </summary>
6+ public static class PatchHelper
7+ {
8+ public static bool Patch ( )
9+ {
10+ var version = VersionHelper . PublishVersion ;
11+ if ( ! DnscryptProxyConfigurationManager . LoadConfiguration ( ) ) return false ;
12+ if ( version . Equals ( "0.6.5" ) )
13+ {
14+ //added: netprobe_address = '255.255.255.0:53'
15+ //changed: netprobe_timeout = 0
16+ DnscryptProxyConfigurationManager . DnscryptProxyConfiguration . netprobe_address = "255.255.255.0:53" ;
17+ DnscryptProxyConfigurationManager . DnscryptProxyConfiguration . netprobe_timeout = 0 ;
18+ return DnscryptProxyConfigurationManager . SaveConfiguration ( ) ;
19+ }
20+ return false ;
21+ }
22+ }
23+ }
Original file line number Diff line number Diff line change 182182 <Compile Include =" Helper\LocalNetworkInterfaceManager.cs" />
183183 <Compile Include =" Helper\LogManagerHelper.cs" />
184184 <Compile Include =" Helper\NavigationService.cs" />
185+ <Compile Include =" Helper\PatchHelper.cs" />
185186 <Compile Include =" Helper\PrerequisiteHelper.cs" />
186187 <Compile Include =" Helper\ValidationHelper.cs" />
187188 <Compile Include =" Helper\VersionHelper.cs" />
Original file line number Diff line number Diff line change @@ -168,6 +168,11 @@ private async void InitializeApplication()
168168 File . Move ( configFile , configFile + ".bak" ) ;
169169 }
170170 File . Move ( tmpConfigPath , configFile ) ;
171+ // update the configuration file
172+ if ( PatchHelper . Patch ( ) )
173+ {
174+ await Task . Delay ( 500 ) . ConfigureAwait ( false ) ;
175+ }
171176 }
172177 }
173178
You can’t perform that action at this time.
0 commit comments