├── .editorconfig
├── .gitignore
├── .idea
├── .gitignore
└── .idea.NaiveSharp
│ ├── .idea
│ ├── contentModel.xml
│ ├── encodings.xml
│ ├── indexLayout.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── projectSettingsUpdater.xml
│ └── vcs.xml
│ └── riderModule.iml
├── LICENSE
├── NaiveSharp.Test
├── NaiveCmdBuilder.cs
├── NaiveSharp.Test.csproj
└── Sharelink.cs
├── NaiveSharp.sln
├── NaiveSharp
├── 3rd
│ ├── Clash
│ │ ├── Country.mmdb
│ │ ├── clash.exe
│ │ └── config.yaml
│ ├── Naive
│ │ └── naive.exe
│ ├── Privoxy
│ │ ├── config.txt
│ │ ├── config_gfw.txt
│ │ ├── gfwlist.action
│ │ └── privoxy.exe
│ └── readme.txt
├── App.config
├── ConstText
│ ├── Msg.cs
│ ├── Path
│ │ ├── Clash.cs
│ │ ├── Config.cs
│ │ ├── Naive.cs
│ │ ├── Privoxy.cs
│ │ └── tmp.cs
│ └── Replace.cs
├── Controller
│ ├── Command.cs
│ ├── Encoder.cs
│ ├── Extension
│ │ ├── Dictionary.cs
│ │ ├── String.cs
│ │ ├── String[].cs
│ │ └── TreeNodeCollection.cs
│ ├── KvpHelper.cs
│ ├── NaiveCmdBuilder.cs
│ ├── Net.cs
│ ├── NodeList.cs
│ ├── NsInfo.cs
│ ├── Nshelper.cs
│ ├── Operation.cs
│ ├── Proxy.cs
│ ├── Sharelink.cs
│ └── Update.cs
├── DesignMap
│ ├── Config.md
│ ├── File.md
│ ├── Node.md
│ └── README.md
├── Model
│ ├── Config.cs
│ └── FormSize.cs
├── NaiveSharp.csproj
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ ├── Settings.settings
│ └── app.manifest
├── View
│ ├── About.Designer.cs
│ ├── About.cs
│ ├── About.resx
│ ├── AdvanceWindow.Designer.cs
│ ├── AdvanceWindow.cs
│ ├── AdvanceWindow.resx
│ ├── MainWindow.Designer.cs
│ ├── MainWindow.cs
│ ├── MainWindow.resx
│ ├── MainWindowsEx.cs
│ ├── Qr.Designer.cs
│ ├── Qr.cs
│ └── Qr.resx
├── app.manifest
├── ns.ico
└── packages.config
├── README.md
└── Screenshots
├── NaiveSharp.png
├── ns01prev.jpg
├── ns05prev-1.png
├── ns05prev-2.png
├── ns05prev.png
├── ns065prev-0.png
├── ns065prev-1.png
└── ns06prev.png
/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.cs]
2 |
3 | dotnet_diagnostic.IDE1006.severity = silent
4 | dotnet_diagnostic.CA1031.severity = silent
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Aa][Rr][Mm]/
27 | [Aa][Rr][Mm]64/
28 | bld/
29 | [Bb]in/
30 | [Oo]bj/
31 | [Ll]og/
32 | [Ll]ogs/
33 |
34 | # Visual Studio 2015/2017 cache/options directory
35 | .vs/
36 | # Uncomment if you have tasks that create the project's static files in wwwroot
37 | #wwwroot/
38 |
39 | # Visual Studio 2017 auto generated files
40 | Generated\ Files/
41 |
42 | # MSTest test Results
43 | [Tt]est[Rr]esult*/
44 | [Bb]uild[Ll]og.*
45 |
46 | # NUnit
47 | *.VisualState.xml
48 | TestResult.xml
49 | nunit-*.xml
50 |
51 | # Build Results of an ATL Project
52 | [Dd]ebugPS/
53 | [Rr]eleasePS/
54 | dlldata.c
55 |
56 | # Benchmark Results
57 | BenchmarkDotNet.Artifacts/
58 |
59 | # .NET Core
60 | project.lock.json
61 | project.fragment.lock.json
62 | artifacts/
63 |
64 | # StyleCop
65 | StyleCopReport.xml
66 |
67 | # Files built by Visual Studio
68 | *_i.c
69 | *_p.c
70 | *_h.h
71 | *.ilk
72 | *.meta
73 | *.obj
74 | *.iobj
75 | *.pch
76 | *.pdb
77 | *.ipdb
78 | *.pgc
79 | *.pgd
80 | *.rsp
81 | *.sbr
82 | *.tlb
83 | *.tli
84 | *.tlh
85 | *.tmp
86 | *.tmp_proj
87 | *_wpftmp.csproj
88 | *.log
89 | *.vspscc
90 | *.vssscc
91 | .builds
92 | *.pidb
93 | *.svclog
94 | *.scc
95 |
96 | # Chutzpah Test files
97 | _Chutzpah*
98 |
99 | # Visual C++ cache files
100 | ipch/
101 | *.aps
102 | *.ncb
103 | *.opendb
104 | *.opensdf
105 | *.sdf
106 | *.cachefile
107 | *.VC.db
108 | *.VC.VC.opendb
109 |
110 | # Visual Studio profiler
111 | *.psess
112 | *.vsp
113 | *.vspx
114 | *.sap
115 |
116 | # Visual Studio Trace Files
117 | *.e2e
118 |
119 | # TFS 2012 Local Workspace
120 | $tf/
121 |
122 | # Guidance Automation Toolkit
123 | *.gpState
124 |
125 | # ReSharper is a .NET coding add-in
126 | _ReSharper*/
127 | *.[Rr]e[Ss]harper
128 | *.DotSettings.user
129 |
130 | # TeamCity is a build add-in
131 | _TeamCity*
132 |
133 | # DotCover is a Code Coverage Tool
134 | *.dotCover
135 |
136 | # AxoCover is a Code Coverage Tool
137 | .axoCover/*
138 | !.axoCover/settings.json
139 |
140 | # Visual Studio code coverage results
141 | *.coverage
142 | *.coveragexml
143 |
144 | # NCrunch
145 | _NCrunch_*
146 | .*crunch*.local.xml
147 | nCrunchTemp_*
148 |
149 | # MightyMoose
150 | *.mm.*
151 | AutoTest.Net/
152 |
153 | # Web workbench (sass)
154 | .sass-cache/
155 |
156 | # Installshield output folder
157 | [Ee]xpress/
158 |
159 | # DocProject is a documentation generator add-in
160 | DocProject/buildhelp/
161 | DocProject/Help/*.HxT
162 | DocProject/Help/*.HxC
163 | DocProject/Help/*.hhc
164 | DocProject/Help/*.hhk
165 | DocProject/Help/*.hhp
166 | DocProject/Help/Html2
167 | DocProject/Help/html
168 |
169 | # Click-Once directory
170 | publish/
171 |
172 | # Publish Web Output
173 | *.[Pp]ublish.xml
174 | *.azurePubxml
175 | # Note: Comment the next line if you want to checkin your web deploy settings,
176 | # but database connection strings (with potential passwords) will be unencrypted
177 | *.pubxml
178 | *.publishproj
179 |
180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
181 | # checkin your Azure Web App publish settings, but sensitive information contained
182 | # in these scripts will be unencrypted
183 | PublishScripts/
184 |
185 | # NuGet Packages
186 | *.nupkg
187 | # NuGet Symbol Packages
188 | *.snupkg
189 | # The packages folder can be ignored because of Package Restore
190 | **/[Pp]ackages/*
191 | # except build/, which is used as an MSBuild target.
192 | !**/[Pp]ackages/build/
193 | # Uncomment if necessary however generally it will be regenerated when needed
194 | #!**/[Pp]ackages/repositories.config
195 | # NuGet v3's project.json files produces more ignorable files
196 | *.nuget.props
197 | *.nuget.targets
198 |
199 | # Microsoft Azure Build Output
200 | csx/
201 | *.build.csdef
202 |
203 | # Microsoft Azure Emulator
204 | ecf/
205 | rcf/
206 |
207 | # Windows Store app package directories and files
208 | AppPackages/
209 | BundleArtifacts/
210 | Package.StoreAssociation.xml
211 | _pkginfo.txt
212 | *.appx
213 | *.appxbundle
214 | *.appxupload
215 |
216 | # Visual Studio cache files
217 | # files ending in .cache can be ignored
218 | *.[Cc]ache
219 | # but keep track of directories ending in .cache
220 | !?*.[Cc]ache/
221 |
222 | # Others
223 | ClientBin/
224 | ~$*
225 | *~
226 | *.dbmdl
227 | *.dbproj.schemaview
228 | *.jfm
229 | *.pfx
230 | *.publishsettings
231 | orleans.codegen.cs
232 |
233 | # Including strong name files can present a security risk
234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
235 | #*.snk
236 |
237 | # Since there are multiple workflows, uncomment next line to ignore bower_components
238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
239 | #bower_components/
240 |
241 | # RIA/Silverlight projects
242 | Generated_Code/
243 |
244 | # Backup & report files from converting an old project file
245 | # to a newer Visual Studio version. Backup files are not needed,
246 | # because we have git ;-)
247 | _UpgradeReport_Files/
248 | Backup*/
249 | UpgradeLog*.XML
250 | UpgradeLog*.htm
251 | ServiceFabricBackup/
252 | *.rptproj.bak
253 |
254 | # SQL Server files
255 | *.mdf
256 | *.ldf
257 | *.ndf
258 |
259 | # Business Intelligence projects
260 | *.rdl.data
261 | *.bim.layout
262 | *.bim_*.settings
263 | *.rptproj.rsuser
264 | *- [Bb]ackup.rdl
265 | *- [Bb]ackup ([0-9]).rdl
266 | *- [Bb]ackup ([0-9][0-9]).rdl
267 |
268 | # Microsoft Fakes
269 | FakesAssemblies/
270 |
271 | # GhostDoc plugin setting file
272 | *.GhostDoc.xml
273 |
274 | # Node.js Tools for Visual Studio
275 | .ntvs_analysis.dat
276 | node_modules/
277 |
278 | # Visual Studio 6 build log
279 | *.plg
280 |
281 | # Visual Studio 6 workspace options file
282 | *.opt
283 |
284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
285 | *.vbw
286 |
287 | # Visual Studio LightSwitch build output
288 | **/*.HTMLClient/GeneratedArtifacts
289 | **/*.DesktopClient/GeneratedArtifacts
290 | **/*.DesktopClient/ModelManifest.xml
291 | **/*.Server/GeneratedArtifacts
292 | **/*.Server/ModelManifest.xml
293 | _Pvt_Extensions
294 |
295 | # Paket dependency manager
296 | .paket/paket.exe
297 | paket-files/
298 |
299 | # FAKE - F# Make
300 | .fake/
301 |
302 | # CodeRush personal settings
303 | .cr/personal
304 |
305 | # Python Tools for Visual Studio (PTVS)
306 | __pycache__/
307 | *.pyc
308 |
309 | # Cake - Uncomment if you are using it
310 | # tools/**
311 | # !tools/packages.config
312 |
313 | # Tabs Studio
314 | *.tss
315 |
316 | # Telerik's JustMock configuration file
317 | *.jmconfig
318 |
319 | # BizTalk build output
320 | *.btp.cs
321 | *.btm.cs
322 | *.odx.cs
323 | *.xsd.cs
324 |
325 | # OpenCover UI analysis results
326 | OpenCover/
327 |
328 | # Azure Stream Analytics local run output
329 | ASALocalRun/
330 |
331 | # MSBuild Binary and Structured Log
332 | *.binlog
333 |
334 | # NVidia Nsight GPU debugger configuration file
335 | *.nvuser
336 |
337 | # MFractors (Xamarin productivity tool) working folder
338 | .mfractor/
339 |
340 | # Local History for Visual Studio
341 | .localhistory/
342 |
343 | # BeatPulse healthcheck temp database
344 | healthchecksdb
345 |
346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
347 | MigrationBackup/
348 |
349 | # Ionide (cross platform F# VS Code tools) working folder
350 | .ionide/
351 |
352 | # Rider
353 | .idea
354 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | # Default ignored files
3 | /.idea.NaiveSharp/.idea/workspace.xml
--------------------------------------------------------------------------------
/.idea/.idea.NaiveSharp/.idea/contentModel.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
--------------------------------------------------------------------------------
/.idea/.idea.NaiveSharp/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/.idea.NaiveSharp/.idea/indexLayout.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/.idea.NaiveSharp/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/.idea.NaiveSharp/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/.idea.NaiveSharp/.idea/projectSettingsUpdater.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/.idea.NaiveSharp/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/.idea.NaiveSharp/riderModule.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/NaiveSharp.Test/NaiveCmdBuilder.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 |
3 | namespace NaiveSharp.Test
4 | {
5 | [TestClass]
6 | public class NaiveCmdBuilder
7 | {
8 | [TestMethod]
9 | public void Proxy()
10 | {
11 | string scheme = "https",
12 | username = "username",
13 | password = "password",
14 | host = "host.com";
15 |
16 | string tartget = "https://username:password@host.com";
17 |
18 | Assert.IsTrue(tartget == Controller.NaiveCmdBuilder.Proxy(scheme, username, password, host));
19 |
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/NaiveSharp.Test/NaiveSharp.Test.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netcoreapp3.1
5 |
6 | false
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | all
16 | runtime; build; native; contentfiles; analyzers; buildtransitive
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/NaiveSharp.Test/Sharelink.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 |
3 | using System;
4 |
5 | namespace NaiveSharp.Test
6 | {
7 | [TestClass]
8 | public class Sharelink
9 | {
10 | [TestMethod]
11 | public void LoadFromShareLink1()
12 | {
13 | var d = "naive+https://what:happened@test.someone.cf?padding=false#Naive!";
14 | var r = Controller.Sharelink.LoadFromShareLink(d);
15 |
16 | Console.WriteLine(@"Name => " + r.Value.Name);
17 | Console.WriteLine(@"Scheme => " + r.Value.Scheme);
18 | Console.WriteLine(@"Host => " + r.Value.Host);
19 | Console.WriteLine(@"Username => " + r.Value.Username);
20 | Console.WriteLine(@"Password => " + r.Value.Password);
21 | Console.WriteLine(@"ExtraHeaders => " + r.Value.ExtraHeaders);
22 |
23 | Assert.AreEqual(r.Value.Name, "Naive!");
24 | Assert.AreEqual(r.Value.Scheme, "https");
25 | Assert.AreEqual(r.Value.Host, "test.someone.cf");
26 | Assert.AreEqual(r.Value.Username, "what");
27 | Assert.AreEqual(r.Value.Password, "happened");
28 | Assert.AreEqual(r.Value.ExtraHeaders, null);
29 | }
30 |
31 | [TestMethod]
32 | public void LoadFromShareLink2()
33 | {
34 | var d = "naive+https://some.public.rs?padding=true#Public-01";
35 | var r = Controller.Sharelink.LoadFromShareLink(d);
36 | Console.WriteLine(@"Name => " + r.Value.Name);
37 | Console.WriteLine(@"Scheme => " + r.Value.Scheme);
38 | Console.WriteLine(@"Host => " + r.Value.Host);
39 | Console.WriteLine(@"Username => " + r.Value.Username);
40 | Console.WriteLine(@"Password => " + r.Value.Password);
41 | Console.WriteLine(@"ExtraHeaders => " + r.Value.ExtraHeaders);
42 |
43 | Assert.AreEqual(r.Value.Name, "Public-01");
44 | Assert.AreEqual(r.Value.Scheme, "https");
45 | Assert.AreEqual(r.Value.Host, "some.public.rs");
46 | Assert.AreEqual(r.Value.Username, "");
47 | Assert.AreEqual(r.Value.Password, "");
48 | Assert.AreEqual(r.Value.ExtraHeaders, null);
49 | }
50 |
51 | [TestMethod]
52 | public void LoadFromShareLink3()
53 | {
54 | var d = "naive+quic://manhole:114514@quic.test.me";
55 | var r = Controller.Sharelink.LoadFromShareLink(d);
56 | Console.WriteLine(@"Name => " + r.Value.Name);
57 | Console.WriteLine(@"Scheme => " + r.Value.Scheme);
58 | Console.WriteLine(@"Host => " + r.Value.Host);
59 | Console.WriteLine(@"Username => " + r.Value.Username);
60 | Console.WriteLine(@"Password => " + r.Value.Password);
61 | Console.WriteLine(@"ExtraHeaders => " + r.Value.ExtraHeaders);
62 |
63 | Assert.AreEqual(r.Value.Name, "");
64 | Assert.AreEqual(r.Value.Scheme, "quic");
65 | Assert.AreEqual(r.Value.Host, "quic.test.me");
66 | Assert.AreEqual(r.Value.Username, "manhole");
67 | Assert.AreEqual(r.Value.Password, "114514");
68 | Assert.AreEqual(r.Value.ExtraHeaders, null);
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/NaiveSharp.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.30114.105
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NaiveSharp", "NaiveSharp\NaiveSharp.csproj", "{EB5FD7C4-6735-4DE5-A292-358651270EED}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NaiveSharp.Test", "NaiveSharp.Test\NaiveSharp.Test.csproj", "{A29E7BE2-6E04-4B2A-AC03-30441D50D395}"
9 | EndProject
10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C91066CE-DC02-4740-AA7A-F243B3172F86}"
11 | ProjectSection(SolutionItems) = preProject
12 | .editorconfig = .editorconfig
13 | EndProjectSection
14 | EndProject
15 | Global
16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
17 | Debug|Any CPU = Debug|Any CPU
18 | Release|Any CPU = Release|Any CPU
19 | EndGlobalSection
20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
21 | {EB5FD7C4-6735-4DE5-A292-358651270EED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
22 | {EB5FD7C4-6735-4DE5-A292-358651270EED}.Debug|Any CPU.Build.0 = Debug|Any CPU
23 | {EB5FD7C4-6735-4DE5-A292-358651270EED}.Release|Any CPU.ActiveCfg = Release|Any CPU
24 | {EB5FD7C4-6735-4DE5-A292-358651270EED}.Release|Any CPU.Build.0 = Release|Any CPU
25 | {A29E7BE2-6E04-4B2A-AC03-30441D50D395}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
26 | {A29E7BE2-6E04-4B2A-AC03-30441D50D395}.Debug|Any CPU.Build.0 = Debug|Any CPU
27 | {A29E7BE2-6E04-4B2A-AC03-30441D50D395}.Release|Any CPU.ActiveCfg = Release|Any CPU
28 | {A29E7BE2-6E04-4B2A-AC03-30441D50D395}.Release|Any CPU.Build.0 = Release|Any CPU
29 | EndGlobalSection
30 | GlobalSection(SolutionProperties) = preSolution
31 | HideSolutionNode = FALSE
32 | EndGlobalSection
33 | GlobalSection(ExtensibilityGlobals) = postSolution
34 | SolutionGuid = {103CCAAF-CF3C-445B-A523-751B5131DE91}
35 | EndGlobalSection
36 | EndGlobal
37 |
--------------------------------------------------------------------------------
/NaiveSharp/3rd/Clash/Country.mmdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/NaiveSharp/9c7742b6d54811cde965e5ae2f207cfc0178fb83/NaiveSharp/3rd/Clash/Country.mmdb
--------------------------------------------------------------------------------
/NaiveSharp/3rd/Clash/clash.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/NaiveSharp/9c7742b6d54811cde965e5ae2f207cfc0178fb83/NaiveSharp/3rd/Clash/clash.exe
--------------------------------------------------------------------------------
/NaiveSharp/3rd/Clash/config.yaml:
--------------------------------------------------------------------------------
1 | port: 1081
2 | socks-port: 0 # Not use
3 | udp: true
4 | allow-lan: false
5 | mode: Rule
6 | log-level: silent
7 | #experimental:
8 | # ignore-resolve-fail: true
9 |
10 |
11 | dns:
12 | enable: false
13 | listen: 0.0.0.0:0 # the DNS server in clash is actually not used, turn it off
14 | enhanced-mode: fake-ip
15 | fake-ip-range: 255.0.128.1/20 # 255.0.128.1 - 255.0.143.254
16 | nameserver:
17 | - 114.114.114.114 # not used, just a placeholder
18 |
19 |
20 |
21 | Proxy:
22 | - { name: "naive", type: socks5, server: "127.0.0.1", port: 1080, udp: true}
23 |
24 | Proxy Group:
25 | - { name: "Proxy", type: select, proxies: ["naive"] }
26 |
27 |
28 | Rule:
29 | # Apple
30 | - DOMAIN-SUFFIX,apps.apple.com,Proxy
31 | - DOMAIN-SUFFIX,music.apple.com,DIRECT
32 | - DOMAIN-SUFFIX,icloud.com,DIRECT
33 | - DOMAIN-SUFFIX,icloud-content.com,DIRECT
34 | - DOMAIN-SUFFIX,me.com,DIRECT
35 | - DOMAIN-SUFFIX,mzstatic.com,DIRECT
36 | - DOMAIN-SUFFIX,akadns.net,DIRECT
37 | - DOMAIN-SUFFIX,aaplimg.com,DIRECT
38 | - DOMAIN-SUFFIX,cdn-apple.com,DIRECT
39 | - DOMAIN-SUFFIX,apple.com,DIRECT
40 | - DOMAIN-SUFFIX,apple-cloudkit.com,DIRECT
41 | - DOMAIN,hls.itunes.apple.com,Proxy
42 | #- DOMAIN,e.crashlytics.com,REJECT //注释此选项有助于大多数App开发者分析崩溃信息;如果您拒绝一切崩溃数据统计、搜集,请取消 # 注释。
43 |
44 |
45 | # 自定义规则
46 | ## 您可以在此处插入您补充的自定义规则
47 |
48 | # 国内网站
49 | - DOMAIN-SUFFIX,cn,DIRECT
50 | - DOMAIN-KEYWORD,-cn,DIRECT
51 |
52 | - DOMAIN-SUFFIX,126.com,DIRECT
53 | - DOMAIN-SUFFIX,126.net,DIRECT
54 | - DOMAIN-SUFFIX,127.net,DIRECT
55 | - DOMAIN-SUFFIX,163.com,DIRECT
56 | - DOMAIN-SUFFIX,360buyimg.com,DIRECT
57 | - DOMAIN-SUFFIX,36kr.com,DIRECT
58 | - DOMAIN-SUFFIX,acfun.tv,DIRECT
59 | - DOMAIN-SUFFIX,air-matters.com,DIRECT
60 | - DOMAIN-SUFFIX,aixifan.com,DIRECT
61 | - DOMAIN-SUFFIX,akamaized.net,DIRECT
62 | - DOMAIN-KEYWORD,alicdn,DIRECT
63 | - DOMAIN-KEYWORD,alipay,DIRECT
64 | - DOMAIN-KEYWORD,taobao,DIRECT
65 | - DOMAIN-SUFFIX,amap.com,DIRECT
66 | - DOMAIN-SUFFIX,autonavi.com,DIRECT
67 | - DOMAIN-KEYWORD,baidu,DIRECT
68 | - DOMAIN-SUFFIX,baidu.com,DIRECT
69 | - DOMAIN-SUFFIX,bdimg.com,DIRECT
70 | - DOMAIN-SUFFIX,bdstatic.com,DIRECT
71 | - DOMAIN-SUFFIX,bilibili.com,DIRECT
72 | - DOMAIN-SUFFIX,caiyunapp.com,DIRECT
73 | - DOMAIN-SUFFIX,clouddn.com,DIRECT
74 | - DOMAIN-SUFFIX,cnbeta.com,DIRECT
75 | - DOMAIN-SUFFIX,cnbetacdn.com,DIRECT
76 | - DOMAIN-SUFFIX,cootekservice.com,DIRECT
77 | - DOMAIN-SUFFIX,csdn.net,DIRECT
78 | - DOMAIN-SUFFIX,ctrip.com,DIRECT
79 | - DOMAIN-SUFFIX,dgtle.com,DIRECT
80 | - DOMAIN-SUFFIX,dianping.com,DIRECT
81 | - DOMAIN-SUFFIX,douban.com,DIRECT
82 | - DOMAIN-SUFFIX,doubanio.com,DIRECT
83 | - DOMAIN-SUFFIX,duokan.com,DIRECT
84 | - DOMAIN-SUFFIX,easou.com,DIRECT
85 | - DOMAIN-SUFFIX,ele.me,DIRECT
86 | - DOMAIN-SUFFIX,feng.com,DIRECT
87 | - DOMAIN-SUFFIX,fir.im,DIRECT
88 | - DOMAIN-SUFFIX,frdic.com,DIRECT
89 | - DOMAIN-SUFFIX,g-cores.com,DIRECT
90 | - DOMAIN-SUFFIX,godic.net,DIRECT
91 | - DOMAIN-SUFFIX,gtimg.com,DIRECT
92 | - DOMAIN,cdn.hockeyapp.net,DIRECT
93 | - DOMAIN-SUFFIX,hongxiu.com,DIRECT
94 | - DOMAIN-SUFFIX,hxcdn.net,DIRECT
95 | - DOMAIN-SUFFIX,iciba.com,DIRECT
96 | - DOMAIN-SUFFIX,ifeng.com,DIRECT
97 | - DOMAIN-SUFFIX,ifengimg.com,DIRECT
98 | - DOMAIN-SUFFIX,ipip.net,DIRECT
99 | - DOMAIN-SUFFIX,iqiyi.com,DIRECT
100 | - DOMAIN-SUFFIX,jd.com,DIRECT
101 | - DOMAIN-SUFFIX,jianshu.com,DIRECT
102 | - DOMAIN-SUFFIX,knewone.com,DIRECT
103 | - DOMAIN-SUFFIX,le.com,DIRECT
104 | - DOMAIN-SUFFIX,lecloud.com,DIRECT
105 | - DOMAIN-SUFFIX,lemicp.com,DIRECT
106 | - DOMAIN-SUFFIX,licdn.com,DIRECT
107 | - DOMAIN-SUFFIX,linkedin.com,DIRECT
108 | - DOMAIN-SUFFIX,luoo.net,DIRECT
109 | - DOMAIN-SUFFIX,meituan.com,DIRECT
110 | - DOMAIN-SUFFIX,meituan.net,DIRECT
111 | - DOMAIN-SUFFIX,mi.com,DIRECT
112 | - DOMAIN-SUFFIX,miaopai.com,DIRECT
113 | - DOMAIN-SUFFIX,microsoft.com,DIRECT
114 | - DOMAIN-SUFFIX,microsoftonline.com,DIRECT
115 | - DOMAIN-SUFFIX,miui.com,DIRECT
116 | - DOMAIN-SUFFIX,miwifi.com,DIRECT
117 | - DOMAIN-SUFFIX,mob.com,DIRECT
118 | - DOMAIN-SUFFIX,netease.com,DIRECT
119 | - DOMAIN-SUFFIX,office.com,DIRECT
120 | - DOMAIN-SUFFIX,office365.com,DIRECT
121 | - DOMAIN-KEYWORD,officecdn,DIRECT
122 | - DOMAIN-SUFFIX,oschina.net,DIRECT
123 | - DOMAIN-SUFFIX,ppsimg.com,DIRECT
124 | - DOMAIN-SUFFIX,pstatp.com,DIRECT
125 | - DOMAIN-SUFFIX,qcloud.com,DIRECT
126 | - DOMAIN-SUFFIX,qdaily.com,DIRECT
127 | - DOMAIN-SUFFIX,qdmm.com,DIRECT
128 | - DOMAIN-SUFFIX,qhimg.com,DIRECT
129 | - DOMAIN-SUFFIX,qhres.com,DIRECT
130 | - DOMAIN-SUFFIX,qidian.com,DIRECT
131 | - DOMAIN-SUFFIX,qihucdn.com,DIRECT
132 | - DOMAIN-SUFFIX,qiniu.com,DIRECT
133 | - DOMAIN-SUFFIX,qiniucdn.com,DIRECT
134 | - DOMAIN-SUFFIX,qiyipic.com,DIRECT
135 | - DOMAIN-SUFFIX,qq.com,DIRECT
136 | - DOMAIN-SUFFIX,qqurl.com,DIRECT
137 | - DOMAIN-SUFFIX,rarbg.to,DIRECT
138 | - DOMAIN-SUFFIX,ruguoapp.com,DIRECT
139 | - DOMAIN-SUFFIX,segmentfault.com,DIRECT
140 | - DOMAIN-SUFFIX,sinaapp.com,DIRECT
141 | - DOMAIN-SUFFIX,smzdm.com,DIRECT
142 | - DOMAIN-SUFFIX,snapdrop.net,DIRECT
143 | - DOMAIN-SUFFIX,sogou.com,DIRECT
144 | - DOMAIN-SUFFIX,sogoucdn.com,DIRECT
145 | - DOMAIN-SUFFIX,sohu.com,DIRECT
146 | - DOMAIN-SUFFIX,soku.com,DIRECT
147 | - DOMAIN-SUFFIX,speedtest.net,DIRECT
148 | - DOMAIN-SUFFIX,sspai.com,DIRECT
149 | - DOMAIN-SUFFIX,suning.com,DIRECT
150 | - DOMAIN-SUFFIX,taobao.com,DIRECT
151 | - DOMAIN-SUFFIX,tencent.com,DIRECT
152 | - DOMAIN-SUFFIX,tenpay.com,DIRECT
153 | - DOMAIN-SUFFIX,tianyancha.com,DIRECT
154 | - DOMAIN-SUFFIX,tmall.com,DIRECT
155 | - DOMAIN-SUFFIX,tudou.com,DIRECT
156 | - DOMAIN-SUFFIX,umetrip.com,DIRECT
157 | - DOMAIN-SUFFIX,upaiyun.com,DIRECT
158 | - DOMAIN-SUFFIX,upyun.com,DIRECT
159 | - DOMAIN-SUFFIX,veryzhun.com,DIRECT
160 | - DOMAIN-SUFFIX,weather.com,DIRECT
161 | - DOMAIN-SUFFIX,weibo.com,DIRECT
162 | - DOMAIN-SUFFIX,xiami.com,DIRECT
163 | - DOMAIN-SUFFIX,xiami.net,DIRECT
164 | - DOMAIN-SUFFIX,xiaomicp.com,DIRECT
165 | - DOMAIN-SUFFIX,ximalaya.com,DIRECT
166 | - DOMAIN-SUFFIX,xmcdn.com,DIRECT
167 | - DOMAIN-SUFFIX,xunlei.com,DIRECT
168 | - DOMAIN-SUFFIX,yhd.com,DIRECT
169 | - DOMAIN-SUFFIX,yihaodianimg.com,DIRECT
170 | - DOMAIN-SUFFIX,yinxiang.com,DIRECT
171 | - DOMAIN-SUFFIX,ykimg.com,DIRECT
172 | - DOMAIN-SUFFIX,youdao.com,DIRECT
173 | - DOMAIN-SUFFIX,youku.com,DIRECT
174 | - DOMAIN-SUFFIX,zealer.com,DIRECT
175 | - DOMAIN-SUFFIX,zhihu.com,DIRECT
176 | - DOMAIN-SUFFIX,zhimg.com,DIRECT
177 | - DOMAIN-SUFFIX,zimuzu.tv,DIRECT
178 |
179 | # 抗 DNS 污染
180 | - DOMAIN-KEYWORD,amazon,Proxy
181 | - DOMAIN-KEYWORD,google,Proxy
182 | - DOMAIN-KEYWORD,gmail,Proxy
183 | - DOMAIN-KEYWORD,youtube,Proxy
184 | - DOMAIN-KEYWORD,facebook,Proxy
185 | - DOMAIN-SUFFIX,fb.me,Proxy
186 | - DOMAIN-SUFFIX,fbcdn.net,Proxy
187 | - DOMAIN-KEYWORD,twitter,Proxy
188 | - DOMAIN-KEYWORD,instagram,Proxy
189 | - DOMAIN-KEYWORD,dropbox,Proxy
190 | - DOMAIN-SUFFIX,twimg.com,Proxy
191 | - DOMAIN-KEYWORD,blogspot,Proxy
192 | - DOMAIN-SUFFIX,youtu.be,Proxy
193 | - DOMAIN-KEYWORD,whatsapp,Proxy
194 |
195 | # 常见广告域名屏蔽
196 | #- DOMAIN-KEYWORD,admarvel,REJECT
197 | #- DOMAIN-KEYWORD,admaster,REJECT
198 | #- DOMAIN-KEYWORD,adsage,REJECT
199 | #- DOMAIN-KEYWORD,adsmogo,REJECT
200 | #- DOMAIN-KEYWORD,adsrvmedia,REJECT
201 | #- DOMAIN-KEYWORD,adwords,REJECT
202 | #- DOMAIN-KEYWORD,adservice,REJECT
203 | #- DOMAIN-KEYWORD,domob,REJECT
204 | #- DOMAIN-KEYWORD,duomeng,REJECT
205 | #- DOMAIN-KEYWORD,dwtrack,REJECT
206 | #- DOMAIN-KEYWORD,guanggao,REJECT
207 | #- DOMAIN-KEYWORD,lianmeng,REJECT
208 | #- DOMAIN-SUFFIX,mmstat.com,REJECT
209 | #- DOMAIN-KEYWORD,omgmta,REJECT
210 | #- DOMAIN-KEYWORD,openx,REJECT
211 | #- DOMAIN-KEYWORD,partnerad,REJECT
212 | #- DOMAIN-KEYWORD,pingfore,REJECT
213 | #- DOMAIN-KEYWORD,supersonicads,REJECT
214 | #- DOMAIN-KEYWORD,tracking,REJECT
215 | #- DOMAIN-KEYWORD,uedas,REJECT
216 | #- DOMAIN-KEYWORD,umeng,REJECT
217 | #- DOMAIN-KEYWORD,usage,REJECT
218 | #- DOMAIN-KEYWORD,wlmonitor,REJECT
219 | #- DOMAIN-KEYWORD,zjtoolbar,REJECT
220 |
221 | # 国外网站
222 | - DOMAIN-SUFFIX,9to5mac.com,Proxy
223 | - DOMAIN-SUFFIX,abpchina.org,Proxy
224 | - DOMAIN-SUFFIX,adblockplus.org,Proxy
225 | - DOMAIN-SUFFIX,adobe.com,Proxy
226 | - DOMAIN-SUFFIX,alfredapp.com,Proxy
227 | - DOMAIN-SUFFIX,amplitude.com,Proxy
228 | - DOMAIN-SUFFIX,ampproject.org,Proxy
229 | - DOMAIN-SUFFIX,android.com,Proxy
230 | - DOMAIN-SUFFIX,angularjs.org,Proxy
231 | - DOMAIN-SUFFIX,aolcdn.com,Proxy
232 | - DOMAIN-SUFFIX,apkpure.com,Proxy
233 | - DOMAIN-SUFFIX,appledaily.com,Proxy
234 | - DOMAIN-SUFFIX,appshopper.com,Proxy
235 | - DOMAIN-SUFFIX,appspot.com,Proxy
236 | - DOMAIN-SUFFIX,arcgis.com,Proxy
237 | - DOMAIN-SUFFIX,archive.org,Proxy
238 | - DOMAIN-SUFFIX,armorgames.com,Proxy
239 | - DOMAIN-SUFFIX,aspnetcdn.com,Proxy
240 | - DOMAIN-SUFFIX,att.com,Proxy
241 | - DOMAIN-SUFFIX,awsstatic.com,Proxy
242 | - DOMAIN-SUFFIX,azureedge.net,Proxy
243 | - DOMAIN-SUFFIX,azurewebsites.net,Proxy
244 | - DOMAIN-SUFFIX,bing.com,Proxy
245 | - DOMAIN-SUFFIX,bintray.com,Proxy
246 | - DOMAIN-SUFFIX,bit.com,Proxy
247 | - DOMAIN-SUFFIX,bit.ly,Proxy
248 | - DOMAIN-SUFFIX,bitbucket.org,Proxy
249 | - DOMAIN-SUFFIX,bjango.com,Proxy
250 | - DOMAIN-SUFFIX,bkrtx.com,Proxy
251 | - DOMAIN-SUFFIX,blog.com,Proxy
252 | - DOMAIN-SUFFIX,blogcdn.com,Proxy
253 | - DOMAIN-SUFFIX,blogger.com,Proxy
254 | - DOMAIN-SUFFIX,blogsmithmedia.com,Proxy
255 | - DOMAIN-SUFFIX,blogspot.com,Proxy
256 | - DOMAIN-SUFFIX,blogspot.hk,Proxy
257 | - DOMAIN-SUFFIX,bloomberg.com,Proxy
258 | - DOMAIN-SUFFIX,box.com,Proxy
259 | - DOMAIN-SUFFIX,box.net,Proxy
260 | - DOMAIN-SUFFIX,cachefly.net,Proxy
261 | - DOMAIN-SUFFIX,chromium.org,Proxy
262 | - DOMAIN-SUFFIX,cl.ly,Proxy
263 | - DOMAIN-SUFFIX,cloudflare.com,Proxy
264 | - DOMAIN-SUFFIX,cloudfront.net,Proxy
265 | - DOMAIN-SUFFIX,cloudmagic.com,Proxy
266 | - DOMAIN-SUFFIX,cmail19.com,Proxy
267 | - DOMAIN-SUFFIX,cnet.com,Proxy
268 | - DOMAIN-SUFFIX,cocoapods.org,Proxy
269 | - DOMAIN-SUFFIX,comodoca.com,Proxy
270 | - DOMAIN-SUFFIX,crashlytics.com,Proxy
271 | - DOMAIN-SUFFIX,culturedcode.com,Proxy
272 | - DOMAIN-SUFFIX,d.pr,Proxy
273 | - DOMAIN-SUFFIX,danilo.to,Proxy
274 | - DOMAIN-SUFFIX,dayone.me,Proxy
275 | - DOMAIN-SUFFIX,db.tt,Proxy
276 | - DOMAIN-SUFFIX,deskconnect.com,Proxy
277 | - DOMAIN-SUFFIX,disq.us,Proxy
278 | - DOMAIN-SUFFIX,disqus.com,Proxy
279 | - DOMAIN-SUFFIX,disquscdn.com,Proxy
280 | - DOMAIN-SUFFIX,dnsimple.com,Proxy
281 | - DOMAIN-SUFFIX,docker.com,Proxy
282 | - DOMAIN-SUFFIX,dribbble.com,Proxy
283 | - DOMAIN-SUFFIX,droplr.com,Proxy
284 | - DOMAIN-SUFFIX,duckduckgo.com,Proxy
285 | - DOMAIN-SUFFIX,dueapp.com,Proxy
286 | - DOMAIN-SUFFIX,dytt8.net,Proxy
287 | - DOMAIN-SUFFIX,edgecastcdn.net,Proxy
288 | - DOMAIN-SUFFIX,edgekey.net,Proxy
289 | - DOMAIN-SUFFIX,edgesuite.net,Proxy
290 | - DOMAIN-SUFFIX,engadget.com,Proxy
291 | - DOMAIN-SUFFIX,entrust.net,Proxy
292 | - DOMAIN-SUFFIX,eurekavpt.com,Proxy
293 | - DOMAIN-SUFFIX,evernote.com,Proxy
294 | - DOMAIN-SUFFIX,fabric.io,Proxy
295 | - DOMAIN-SUFFIX,fast.com,Proxy
296 | - DOMAIN-SUFFIX,fastly.net,Proxy
297 | - DOMAIN-SUFFIX,fc2.com,Proxy
298 | - DOMAIN-SUFFIX,feedburner.com,Proxy
299 | - DOMAIN-SUFFIX,feedly.com,Proxy
300 | - DOMAIN-SUFFIX,feedsportal.com,Proxy
301 | - DOMAIN-SUFFIX,fiftythree.com,Proxy
302 | - DOMAIN-SUFFIX,firebaseio.com,Proxy
303 | - DOMAIN-SUFFIX,flexibits.com,Proxy
304 | - DOMAIN-SUFFIX,flickr.com,Proxy
305 | - DOMAIN-SUFFIX,flipboard.com,Proxy
306 | - DOMAIN-SUFFIX,g.co,Proxy
307 | - DOMAIN-SUFFIX,gabia.net,Proxy
308 | - DOMAIN-SUFFIX,geni.us,Proxy
309 | - DOMAIN-SUFFIX,gfx.ms,Proxy
310 | - DOMAIN-SUFFIX,ggpht.com,Proxy
311 | - DOMAIN-SUFFIX,ghostnoteapp.com,Proxy
312 | - DOMAIN-SUFFIX,git.io,Proxy
313 | - DOMAIN-KEYWORD,github,Proxy
314 | - DOMAIN-SUFFIX,globalsign.com,Proxy
315 | - DOMAIN-SUFFIX,gmodules.com,Proxy
316 | - DOMAIN-SUFFIX,godaddy.com,Proxy
317 | - DOMAIN-SUFFIX,golang.org,Proxy
318 | - DOMAIN-SUFFIX,gongm.in,Proxy
319 | - DOMAIN-SUFFIX,goo.gl,Proxy
320 | - DOMAIN-SUFFIX,goodreaders.com,Proxy
321 | - DOMAIN-SUFFIX,goodreads.com,Proxy
322 | - DOMAIN-SUFFIX,gravatar.com,Proxy
323 | - DOMAIN-SUFFIX,gstatic.com,Proxy
324 | - DOMAIN-SUFFIX,gvt0.com,Proxy
325 | - DOMAIN-SUFFIX,hockeyapp.net,Proxy
326 | - DOMAIN-SUFFIX,hotmail.com,Proxy
327 | - DOMAIN-SUFFIX,icons8.com,Proxy
328 | - DOMAIN-SUFFIX,ifixit.com,Proxy
329 | - DOMAIN-SUFFIX,ift.tt,Proxy
330 | - DOMAIN-SUFFIX,ifttt.com,Proxy
331 | - DOMAIN-SUFFIX,iherb.com,Proxy
332 | - DOMAIN-SUFFIX,imageshack.us,Proxy
333 | - DOMAIN-SUFFIX,img.ly,Proxy
334 | - DOMAIN-SUFFIX,imgur.com,Proxy
335 | - DOMAIN-SUFFIX,imore.com,Proxy
336 | - DOMAIN-SUFFIX,instapaper.com,Proxy
337 | - DOMAIN-SUFFIX,ipn.li,Proxy
338 | - DOMAIN-SUFFIX,is.gd,Proxy
339 | - DOMAIN-SUFFIX,issuu.com,Proxy
340 | - DOMAIN-SUFFIX,itgonglun.com,Proxy
341 | - DOMAIN-SUFFIX,itun.es,Proxy
342 | - DOMAIN-SUFFIX,ixquick.com,Proxy
343 | - DOMAIN-SUFFIX,j.mp,Proxy
344 | - DOMAIN-SUFFIX,js.revsci.net,Proxy
345 | - DOMAIN-SUFFIX,jshint.com,Proxy
346 | - DOMAIN-SUFFIX,jtvnw.net,Proxy
347 | - DOMAIN-SUFFIX,justgetflux.com,Proxy
348 | - DOMAIN-SUFFIX,kat.cr,Proxy
349 | - DOMAIN-SUFFIX,klip.me,Proxy
350 | - DOMAIN-SUFFIX,libsyn.com,Proxy
351 | - DOMAIN-SUFFIX,linode.com,Proxy
352 | - DOMAIN-SUFFIX,lithium.com,Proxy
353 | - DOMAIN-SUFFIX,littlehj.com,Proxy
354 | - DOMAIN-SUFFIX,live.com,Proxy
355 | - DOMAIN-SUFFIX,live.net,Proxy
356 | - DOMAIN-SUFFIX,livefilestore.com,Proxy
357 | - DOMAIN-SUFFIX,llnwd.net,Proxy
358 | - DOMAIN-SUFFIX,macid.co,Proxy
359 | - DOMAIN-SUFFIX,macromedia.com,Proxy
360 | - DOMAIN-SUFFIX,macrumors.com,Proxy
361 | - DOMAIN-SUFFIX,mashable.com,Proxy
362 | - DOMAIN-SUFFIX,mathjax.org,Proxy
363 | - DOMAIN-SUFFIX,medium.com,Proxy
364 | - DOMAIN-SUFFIX,mega.co.nz,Proxy
365 | - DOMAIN-SUFFIX,mega.nz,Proxy
366 | - DOMAIN-SUFFIX,megaupload.com,Proxy
367 | - DOMAIN-SUFFIX,microsofttranslator.com,Proxy
368 | - DOMAIN-SUFFIX,mindnode.com,Proxy
369 | - DOMAIN-SUFFIX,mobile01.com,Proxy
370 | - DOMAIN-SUFFIX,modmyi.com,Proxy
371 | - DOMAIN-SUFFIX,msedge.net,Proxy
372 | - DOMAIN-SUFFIX,myfontastic.com,Proxy
373 | - DOMAIN-SUFFIX,name.com,Proxy
374 | - DOMAIN-SUFFIX,nextmedia.com,Proxy
375 | - DOMAIN-SUFFIX,nsstatic.net,Proxy
376 | - DOMAIN-SUFFIX,nssurge.com,Proxy
377 | - DOMAIN-SUFFIX,nyt.com,Proxy
378 | - DOMAIN-SUFFIX,nytimes.com,Proxy
379 | - DOMAIN-SUFFIX,omnigroup.com,Proxy
380 | - DOMAIN-SUFFIX,onedrive.com,Proxy
381 | - DOMAIN-SUFFIX,onenote.com,Proxy
382 | - DOMAIN-SUFFIX,ooyala.com,Proxy
383 | - DOMAIN-SUFFIX,openvpn.net,Proxy
384 | - DOMAIN-SUFFIX,openwrt.org,Proxy
385 | - DOMAIN-SUFFIX,orkut.com,Proxy
386 | - DOMAIN-SUFFIX,osxdaily.com,Proxy
387 | - DOMAIN-SUFFIX,outlook.com,Proxy
388 | - DOMAIN-SUFFIX,ow.ly,Proxy
389 | - DOMAIN-SUFFIX,paddleapi.com,Proxy
390 | - DOMAIN-SUFFIX,parallels.com,Proxy
391 | - DOMAIN-SUFFIX,parse.com,Proxy
392 | - DOMAIN-SUFFIX,pdfexpert.com,Proxy
393 | - DOMAIN-SUFFIX,periscope.tv,Proxy
394 | - DOMAIN-SUFFIX,pinboard.in,Proxy
395 | - DOMAIN-SUFFIX,pinterest.com,Proxy
396 | - DOMAIN-SUFFIX,pixelmator.com,Proxy
397 | - DOMAIN-SUFFIX,pixiv.net,Proxy
398 | - DOMAIN-SUFFIX,playpcesor.com,Proxy
399 | - DOMAIN-SUFFIX,playstation.com,Proxy
400 | - DOMAIN-SUFFIX,playstation.com.hk,Proxy
401 | - DOMAIN-SUFFIX,playstation.net,Proxy
402 | - DOMAIN-SUFFIX,playstationnetwork.com,Proxy
403 | - DOMAIN-SUFFIX,pushwoosh.com,Proxy
404 | - DOMAIN-SUFFIX,rime.im,Proxy
405 | - DOMAIN-SUFFIX,servebom.com,Proxy
406 | - DOMAIN-SUFFIX,sfx.ms,Proxy
407 | - DOMAIN-SUFFIX,shadowsocks.org,Proxy
408 | - DOMAIN-SUFFIX,sharethis.com,Proxy
409 | - DOMAIN-SUFFIX,shazam.com,Proxy
410 | - DOMAIN-SUFFIX,skype.com,Proxy
411 | - DOMAIN-SUFFIX,smartdnsProxy.com,Proxy
412 | - DOMAIN-SUFFIX,smartmailcloud.com,Proxy
413 | - DOMAIN-SUFFIX,sndcdn.com,Proxy
414 | - DOMAIN-SUFFIX,sony.com,Proxy
415 | - DOMAIN-SUFFIX,soundcloud.com,Proxy
416 | - DOMAIN-SUFFIX,sourceforge.net,Proxy
417 | - DOMAIN-SUFFIX,spotify.com,Proxy
418 | - DOMAIN-SUFFIX,squarespace.com,Proxy
419 | - DOMAIN-SUFFIX,sstatic.net,Proxy
420 | - DOMAIN-SUFFIX,st.luluku.pw,Proxy
421 | - DOMAIN-SUFFIX,stackoverflow.com,Proxy
422 | - DOMAIN-SUFFIX,startpage.com,Proxy
423 | - DOMAIN-SUFFIX,staticflickr.com,Proxy
424 | - DOMAIN-SUFFIX,steamcommunity.com,Proxy
425 | - DOMAIN-SUFFIX,symauth.com,Proxy
426 | - DOMAIN-SUFFIX,symcb.com,Proxy
427 | - DOMAIN-SUFFIX,symcd.com,Proxy
428 | - DOMAIN-SUFFIX,tapbots.com,Proxy
429 | - DOMAIN-SUFFIX,tapbots.net,Proxy
430 | - DOMAIN-SUFFIX,tdesktop.com,Proxy
431 | - DOMAIN-SUFFIX,techcrunch.com,Proxy
432 | - DOMAIN-SUFFIX,techsmith.com,Proxy
433 | - DOMAIN-SUFFIX,thepiratebay.org,Proxy
434 | - DOMAIN-SUFFIX,theverge.com,Proxy
435 | - DOMAIN-SUFFIX,time.com,Proxy
436 | - DOMAIN-SUFFIX,timeinc.net,Proxy
437 | - DOMAIN-SUFFIX,tiny.cc,Proxy
438 | - DOMAIN-SUFFIX,tinypic.com,Proxy
439 | - DOMAIN-SUFFIX,tmblr.co,Proxy
440 | - DOMAIN-SUFFIX,todoist.com,Proxy
441 | - DOMAIN-SUFFIX,trello.com,Proxy
442 | - DOMAIN-SUFFIX,trustasiassl.com,Proxy
443 | - DOMAIN-SUFFIX,tumblr.co,Proxy
444 | - DOMAIN-SUFFIX,tumblr.com,Proxy
445 | - DOMAIN-SUFFIX,tweetdeck.com,Proxy
446 | - DOMAIN-SUFFIX,tweetmarker.net,Proxy
447 | - DOMAIN-SUFFIX,twitch.tv,Proxy
448 | - DOMAIN-SUFFIX,txmblr.com,Proxy
449 | - DOMAIN-SUFFIX,typekit.net,Proxy
450 | - DOMAIN-SUFFIX,ubertags.com,Proxy
451 | - DOMAIN-SUFFIX,ublock.org,Proxy
452 | - DOMAIN-SUFFIX,ubnt.com,Proxy
453 | - DOMAIN-SUFFIX,ulyssesapp.com,Proxy
454 | - DOMAIN-SUFFIX,urchin.com,Proxy
455 | - DOMAIN-SUFFIX,usertrust.com,Proxy
456 | - DOMAIN-SUFFIX,v.gd,Proxy
457 | - DOMAIN-SUFFIX,v2ex.com,Proxy
458 | - DOMAIN-SUFFIX,vimeo.com,Proxy
459 | - DOMAIN-SUFFIX,vimeocdn.com,Proxy
460 | - DOMAIN-SUFFIX,vine.co,Proxy
461 | - DOMAIN-SUFFIX,vivaldi.com,Proxy
462 | - DOMAIN-SUFFIX,vox-cdn.com,Proxy
463 | - DOMAIN-SUFFIX,vsco.co,Proxy
464 | - DOMAIN-SUFFIX,vultr.com,Proxy
465 | - DOMAIN-SUFFIX,w.org,Proxy
466 | - DOMAIN-SUFFIX,w3schools.com,Proxy
467 | - DOMAIN-SUFFIX,webtype.com,Proxy
468 | - DOMAIN-SUFFIX,wikiwand.com,Proxy
469 | - DOMAIN-SUFFIX,wikileaks.org,Proxy
470 | - DOMAIN-SUFFIX,wikimedia.org,Proxy
471 | - DOMAIN-SUFFIX,wikipedia.com,Proxy
472 | - DOMAIN-SUFFIX,wikipedia.org,Proxy
473 | - DOMAIN-SUFFIX,windows.com,Proxy
474 | - DOMAIN-SUFFIX,windows.net,Proxy
475 | - DOMAIN-SUFFIX,wire.com,Proxy
476 | - DOMAIN-SUFFIX,wordpress.com,Proxy
477 | - DOMAIN-SUFFIX,workflowy.com,Proxy
478 | - DOMAIN-SUFFIX,wp.com,Proxy
479 | - DOMAIN-SUFFIX,wsj.com,Proxy
480 | - DOMAIN-SUFFIX,wsj.net,Proxy
481 | - DOMAIN-SUFFIX,xda-developers.com,Proxy
482 | - DOMAIN-SUFFIX,xeeno.com,Proxy
483 | - DOMAIN-SUFFIX,xiti.com,Proxy
484 | - DOMAIN-SUFFIX,yahoo.com,Proxy
485 | - DOMAIN-SUFFIX,yimg.com,Proxy
486 | - DOMAIN-SUFFIX,ying.com,Proxy
487 | - DOMAIN-SUFFIX,yoyo.org,Proxy
488 | - DOMAIN-SUFFIX,ytimg.com,Proxy
489 |
490 | # Telegram
491 | - DOMAIN-SUFFIX,telegra.ph,Proxy
492 | - DOMAIN-SUFFIX,telegram.org,Proxy
493 |
494 | - IP-CIDR,91.108.56.0/22,Proxy
495 | - IP-CIDR,91.108.4.0/22,Proxy
496 | - IP-CIDR,91.108.8.0/22,Proxy
497 | - IP-CIDR,109.239.140.0/24,Proxy
498 | - IP-CIDR,149.154.160.0/20,Proxy
499 | - IP-CIDR,149.154.164.0/22,Proxy
500 |
501 | # Locals are already bypassed by Android VPN service
502 | - IP-CIDR,127.0.0.0/8,DIRECT
503 | - IP-CIDR,172.16.0.0/12,DIRECT
504 | - IP-CIDR,172.19.0.0/12,DIRECT
505 | - IP-CIDR,192.168.0.0/16,DIRECT
506 | - IP-CIDR,10.0.0.0/8,DIRECT
507 | - IP-CIDR,17.0.0.0/8,DIRECT
508 | - IP-CIDR,100.64.0.0/10,DIRECT
509 |
510 | - GEOIP,CN,DIRECT
511 | - MATCH,Proxy
512 |
--------------------------------------------------------------------------------
/NaiveSharp/3rd/Naive/naive.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/NaiveSharp/9c7742b6d54811cde965e5ae2f207cfc0178fb83/NaiveSharp/3rd/Naive/naive.exe
--------------------------------------------------------------------------------
/NaiveSharp/3rd/Privoxy/config.txt:
--------------------------------------------------------------------------------
1 | listen-address 127.0.0.1:1081
2 | show-on-task-bar 0
3 | activity-animation 0
4 | hide-console
5 | forward-socks5 / 127.0.0.1:1080 .
--------------------------------------------------------------------------------
/NaiveSharp/3rd/Privoxy/config_gfw.txt:
--------------------------------------------------------------------------------
1 | listen-address 127.0.0.1:1081
2 | show-on-task-bar 0
3 | activity-animation 0
4 | hide-console
5 | actionsfile 3rd\Privoxy\gfwlist.action
--------------------------------------------------------------------------------
/NaiveSharp/3rd/Privoxy/privoxy.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/NaiveSharp/9c7742b6d54811cde965e5ae2f207cfc0178fb83/NaiveSharp/3rd/Privoxy/privoxy.exe
--------------------------------------------------------------------------------
/NaiveSharp/3rd/readme.txt:
--------------------------------------------------------------------------------
1 | This folder is to storage 3rd applications and configs.
2 | DO NOT MODIFY UNLESS YOU KNOW WHAT YOU ARE DOING.
--------------------------------------------------------------------------------
/NaiveSharp/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/NaiveSharp/ConstText/Msg.cs:
--------------------------------------------------------------------------------
1 | using NaiveSharp.Model;
2 |
3 | namespace NaiveSharp.ConstText
4 | {
5 | public static class Msg
6 | {
7 | public const string RUNNING_UNDER_BGD = "Hi there! Naive# is still running under background!";
8 |
9 | public const string ASK_CHANGES_NEED_APP_RESTART =
10 | "Reopening Naive# is required to apply changes.\n" +
11 | "Do you want to reopen Naive# immediately?";
12 |
13 | public const string CHOOSE_NULL_ITEM = "Please choose a valid item through left list control!";
14 |
15 | public const string RUN_SUCCESS = "NaiveProxy runs successfully!";
16 |
17 | public const string STOP_SUCCESS = "NaiveProxy stopped successfully!";
18 |
19 | public const string NODE_SAVE_SUCCESS = "Node information saved.";
20 |
21 | public const string ASK_GROUP_DELETE_CONFIRM =
22 | "The nodes which belongs to the group you selected will all be deleted. Continue?";
23 |
24 | public const string NODE_SELECTED_NOT_VALID = "Please select a valid node!";
25 |
26 | public const string NAIVEPROXY_IS_RUNNING = "NaiveProxy is running.";
27 |
28 | public static class Title
29 | {
30 | public const string INFO = "Info";
31 | public const string WARNING = "Warning";
32 | public const string ERROR = "Error";
33 | public const string TIP = "Naive# Tip";
34 | }
35 |
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/NaiveSharp/ConstText/Path/Clash.cs:
--------------------------------------------------------------------------------
1 | namespace NaiveSharp.ConstText
2 | {
3 | public static partial class PATH
4 | {
5 | public const string CLASH = @"3rd\Clash";
6 | public const string CLASH_EXE = @"3rd\Clash\clash.exe";
7 | }
8 | }
--------------------------------------------------------------------------------
/NaiveSharp/ConstText/Path/Config.cs:
--------------------------------------------------------------------------------
1 | namespace NaiveSharp.ConstText
2 | {
3 | public static partial class PATH
4 | {
5 | public const string CONFIG = @"config";
6 | public const string CONFIG_DEBUG = @"config\debug";
7 | public const string CONFIG_INI = @"config\config.ini";
8 | public const string CONFIG_FORM = @"config\form.ns";
9 | public const string CONFIG_NODE_NS = @"config\node.ns";
10 | public const string CONFIG_NODELIST = @"config\list.ns";
11 | public const string CONFIG_SELECT_NODE = @"config\selectnode.ns";
12 | }
13 | }
--------------------------------------------------------------------------------
/NaiveSharp/ConstText/Path/Naive.cs:
--------------------------------------------------------------------------------
1 | namespace NaiveSharp.ConstText
2 | {
3 | public static partial class PATH
4 | {
5 | public const string NAIVE = @"3rd\Naive\";
6 | public const string NAIVE_EXE = @"3rd\Naive\naive.exe";
7 | }
8 | }
--------------------------------------------------------------------------------
/NaiveSharp/ConstText/Path/Privoxy.cs:
--------------------------------------------------------------------------------
1 | namespace NaiveSharp.ConstText
2 | {
3 | public static partial class PATH
4 | {
5 | public const string PRIVOXY = @"3rd\Privoxy\";
6 | public const string PRIVOXY_EXE = @"3rd\Privoxy\privoxy.exe";
7 | public const string PRIVOXY_CONF_GFW_TXT = @"3rd\Privoxy\config_gfw.txt";
8 | public const string PRIVOXY_GFW_ACTION = @"3rd\Privoxy\gfwlist.action";
9 | public const string PRIVOXY_CONF_DEF_INI = @"3rd\Privoxy\config.txt";
10 | }
11 | }
--------------------------------------------------------------------------------
/NaiveSharp/ConstText/Path/tmp.cs:
--------------------------------------------------------------------------------
1 | namespace NaiveSharp.ConstText
2 | {
3 | public static partial class PATH
4 | {
5 | public const string TMP = "tmp";
6 |
7 | }
8 | }
--------------------------------------------------------------------------------
/NaiveSharp/ConstText/Replace.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace NaiveSharp.ConstText
4 | {
5 | [Obsolete("DO NOT USE AT PRESENT!!!!")]
6 | public static class REPLACE
7 | {
8 | // In "config.yaml", "config.txt"
9 | public const string SOCKS_IN = "{SOCKS_IN_LISTEN}";
10 |
11 | // In "config.yaml", "config.txt", ""config_gfw.txt""
12 | public const string HTTP_OUT = "{HTTP_OUT_LISTEN}";
13 |
14 | // NOT USE NOW
15 | // In "config.yaml"
16 | public const string SOCKS_OUT = "{SOCKS_OUT_LISTEN}";
17 | }
18 | }
--------------------------------------------------------------------------------
/NaiveSharp/Controller/Command.cs:
--------------------------------------------------------------------------------
1 | using NaiveSharp.ConstText;
2 | using NaiveSharp.Model;
3 |
4 | using System.Diagnostics;
5 | using System.IO;
6 | using System.Windows.Forms;
7 |
8 | namespace NaiveSharp.Controller
9 | {
10 | public static class Command
11 | {
12 | // proto only accept http & socks
13 | public static void RunNaive(string proto)
14 | {
15 | var p = new Process
16 | {
17 | StartInfo =
18 | {
19 | FileName = PATH.NAIVE_EXE,
20 | Arguments = "--proxy=" +
21 | NaiveCmdBuilder.Proxy(Config.Scheme, Config.Username, Config.Password,
22 | Config.Host) +
23 | " --listen=" + proto.ToLower() + "://127.0.0.1:1080"
24 | }
25 | };
26 |
27 |
28 | // TODO: ADD EXTRA-HEADERS SUPPORT
29 |
30 | if (Config.Debug)
31 | {
32 | p.StartInfo.Arguments += " --log";
33 | MessageBox.Show(p.StartInfo.Arguments);
34 | p.StartInfo.UseShellExecute = true;
35 | }
36 | else
37 | {
38 | p.StartInfo.UseShellExecute = false;
39 | p.StartInfo.CreateNoWindow = true;
40 | }
41 |
42 | p.Start();
43 | }
44 |
45 | public static void RunClash()
46 | {
47 | new Process
48 | {
49 | StartInfo =
50 | {
51 | FileName = PATH.CLASH_EXE,
52 | Arguments = $"-d {PATH.CLASH}",
53 | UseShellExecute = false,
54 | CreateNoWindow = true
55 | }
56 | }.Start();
57 | }
58 |
59 | public static void RunPrivoxyWithGFWList()
60 | {
61 | new Process
62 | {
63 | StartInfo =
64 | {
65 | FileName = "cmd.exe",
66 | Arguments = $"/c START /MIN {PATH.PRIVOXY_EXE} {PATH.PRIVOXY_CONF_GFW_TXT}",
67 | UseShellExecute = false,
68 | CreateNoWindow = true
69 | }
70 | }.Start();
71 | }
72 |
73 | public static void RunPrivoxy()
74 | {
75 | new Process
76 | {
77 | StartInfo =
78 | {
79 | FileName = "cmd.exe",
80 | Arguments = $"/c START /MIN {PATH.PRIVOXY_EXE} {PATH.PRIVOXY_CONF_DEF_INI}",
81 | UseShellExecute = false,
82 | CreateNoWindow = true
83 | }
84 | }.Start();
85 | }
86 |
87 | public static void InitializeTmp()
88 | {
89 | try
90 | {
91 | Directory.Delete(PATH.TMP, true);
92 | }
93 | finally
94 | {
95 | Directory.CreateDirectory(PATH.TMP);
96 | }
97 | }
98 | }
99 | }
--------------------------------------------------------------------------------
/NaiveSharp/Controller/Encoder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 |
4 | namespace NaiveSharp.Controller
5 | {
6 | public static class Encoder
7 | {
8 | #region Base64
9 |
10 | public static string ConvertToBase64(string str, bool exceptionReturnSourceData = false)
11 | {
12 | try
13 | {
14 | return Convert.ToBase64String(Encoding.UTF8.GetBytes(str));
15 | }
16 | catch
17 | {
18 | if (exceptionReturnSourceData)
19 | {
20 | return str;
21 | }
22 | else
23 | {
24 | throw new EncoderFallbackException($"{str} is not a valid string.");
25 | }
26 | }
27 | }
28 |
29 | public static string ConvertFromBase64(string str, bool exceptionReturnSourceData = false)
30 | {
31 | try
32 | {
33 | return Encoding.UTF8.GetString(Convert.FromBase64String(str));
34 | }
35 | catch
36 | {
37 | if (exceptionReturnSourceData)
38 | {
39 | return str;
40 | }
41 | else
42 | {
43 | throw new EncoderFallbackException($"{str} is not a valid base64 string.");
44 | }
45 | }
46 | }
47 |
48 | #endregion
49 | }
50 | }
--------------------------------------------------------------------------------
/NaiveSharp/Controller/Extension/Dictionary.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace NaiveSharp.Controller.Extension
4 | {
5 | public static class DictionaryEx
6 | {
7 | public static bool HasKey(this Dictionary dic, K value)
8 | => dic.ContainsKey(value);
9 | }
10 | }
--------------------------------------------------------------------------------
/NaiveSharp/Controller/Extension/String.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 |
4 | using static NaiveSharp.Controller.Encoder;
5 |
6 | namespace NaiveSharp.Controller.Extension
7 | {
8 | public static class StringEx
9 | {
10 | public static string ToBase64(this string str)
11 | => ConvertToBase64(str, false);
12 |
13 | public static string FromBase64(this string str)
14 | => ConvertFromBase64(str, false);
15 |
16 | public static string FromUrlEncode(this string str)
17 | => System.Web.HttpUtility.UrlDecode(str);
18 |
19 | public static bool StartsEndsWith(this string str, string prefix, string suffix)
20 | => str.StartsWith(prefix) && str.EndsWith(suffix);
21 |
22 | public static bool StartsEndsWith(this string str, string value)
23 | => str.StartsEndsWith(value, value);
24 |
25 | public static NaiveConfig? FromSharelink(this string str)
26 | => Sharelink.LoadFromShareLink(str);
27 |
28 | public static int ToInt(this string str, int ExcepReturn)
29 | {
30 | try
31 | {
32 | return int.Parse(str);
33 | }
34 | catch
35 | {
36 | return ExcepReturn;
37 | }
38 | }
39 |
40 | public static int ToInt(this string str)
41 | {
42 | try
43 | {
44 | return int.Parse(str);
45 | }
46 | catch (Exception ex)
47 | {
48 | throw ex;
49 | }
50 | }
51 | }
52 | }
--------------------------------------------------------------------------------
/NaiveSharp/Controller/Extension/String[].cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Text;
3 |
4 | namespace NaiveSharp.Controller.Extension
5 | {
6 | public static class StringArrayEx
7 | {
8 | public static string[] Trim(this string[] ss)
9 | {
10 | for (int i = 0; i < ss.Length; ++i)
11 | {
12 | ss[i] = ss[i].Trim();
13 | }
14 | return ss;
15 | }
16 |
17 | public static string[] Trim(this string[] ss, bool removeNullOrWhiteSpace)
18 | {
19 | if (!removeNullOrWhiteSpace)
20 | {
21 | return Trim(ss);
22 | }
23 | else
24 | {
25 | var x = new List();
26 | for (int i = 0; i < ss.Length; ++i)
27 | {
28 | if (string.IsNullOrWhiteSpace(ss[i]))
29 | {
30 | continue;
31 | }
32 | x.Add(ss[i].Trim());
33 | }
34 | return x.ToArray();
35 | }
36 |
37 | }
38 |
39 | public static string ToNewString(this string[] ss)
40 | {
41 | var sb = new StringBuilder();
42 | for (int i = 0; i < ss.Length; ++i)
43 | {
44 | sb.Append(ss[i]);
45 |
46 | if (i != ss.Length - 1)
47 | {
48 | sb.Append("\r\n");
49 | }
50 | }
51 | return sb.ToString();
52 | }
53 |
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/NaiveSharp/Controller/Extension/TreeNodeCollection.cs:
--------------------------------------------------------------------------------
1 | using System.Linq;
2 | using System.Windows.Forms;
3 |
4 | namespace NaiveSharp.Controller.Extension
5 | {
6 | public static class TreeNodeCollectionEx
7 | {
8 | public static bool ContainsText(this TreeNodeCollection tnc, string text)
9 | {
10 | /*
11 | => tnc.Cast()
12 | .Where(tn => tn.Text == text)
13 | .Count() > 0;
14 | */
15 | foreach (TreeNode tn in tnc)
16 | {
17 | if (tn.Text == text)
18 | {
19 | return true;
20 | }
21 | }
22 | return false;
23 | }
24 |
25 | public static int CountKeys(this TreeNodeCollection tnc, string text)
26 | => tnc.Cast()
27 | .Where(tn => tn.Text == text)
28 | .Count();
29 |
30 | public static void Add(this TreeNodeCollection tnc, string name, string text)
31 | => tnc.Add(new TreeNode() { Name = name, Text = text });
32 |
33 | public static void Add(this TreeNodeCollection tnc, string name, string text, string tag)
34 | => tnc.Add(new TreeNode() { Name = name, Text = text, Tag = tag });
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/NaiveSharp/Controller/KvpHelper.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Diagnostics;
3 | using System.IO;
4 |
5 | namespace NaiveSharp.Controller
6 | {
7 | public static class KvpHelper
8 | {
9 | public static Dictionary FromStringArray(string[] input)
10 | {
11 | var dic = new Dictionary();
12 | string tmp = string.Empty;
13 | for (int i = 0; i < input.Length; i++)
14 | {
15 | tmp = input[i].Trim();
16 |
17 | var kv = tmp.Split('=');
18 |
19 | if (kv.Length != 2)
20 | {
21 | Debug.WriteLine($"[IniHelper] {tmp} is invalid");
22 | continue;
23 | }
24 | else
25 | {
26 | // MessageBox.Show($"{kv[0]}\r\n{kv[1]}");
27 | dic.Add(kv[0].Trim(), kv[1].Trim()) ;
28 | }
29 | }
30 |
31 | return dic;
32 | }
33 |
34 | public static Dictionary FromFile(string path)
35 | {
36 | if (File.Exists(path)) return FromStringArray(File.ReadAllLines(path));
37 | File.Create(path).Close();
38 | File.WriteAllText(path, $"mode = global");
39 | return FromStringArray(File.ReadAllLines(path));
40 | }
41 | }
42 | }
--------------------------------------------------------------------------------
/NaiveSharp/Controller/NaiveCmdBuilder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace NaiveSharp.Controller
4 | {
5 | public static class NaiveCmdBuilder
6 | {
7 | public static string Proxy(string scheme, string user, string pass, string host)
8 | {
9 | var ub = new UriBuilder()
10 | {
11 | Scheme = scheme,
12 | UserName = user,
13 | Password = pass
14 | };
15 |
16 | var vv = host.Split(':');
17 | if (vv.Length == 2)
18 | {
19 | host = vv[0];
20 | ub.Port = int.Parse(vv[1]);
21 | }
22 | ub.Host = host;
23 |
24 | string v = ub.ToString();
25 | if (v.EndsWith("/"))
26 | {
27 | v = v.Substring(0, v.Length - 1);
28 | }
29 | return v;
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/NaiveSharp/Controller/Net.cs:
--------------------------------------------------------------------------------
1 | using System.Net;
2 | using System.Net.NetworkInformation;
3 |
4 | namespace NaiveSharp.Controller
5 | {
6 | class Net
7 | {
8 | public static bool IsPortUsed(int port)
9 | {
10 | IPGlobalProperties ipProperties = IPGlobalProperties.GetIPGlobalProperties();
11 | IPEndPoint[] ipEndPoints = ipProperties.GetActiveTcpListeners();
12 | foreach (IPEndPoint endPoint in ipEndPoints)
13 | {
14 | if (endPoint.Port == port)
15 | {
16 | return true;
17 | }
18 | }
19 | return false;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/NaiveSharp/Controller/NodeList.cs:
--------------------------------------------------------------------------------
1 | using NaiveSharp.Controller.Extension;
2 |
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Windows.Forms;
7 |
8 | namespace NaiveSharp.Controller
9 | {
10 | public class NodeList
11 | {
12 | public static void LoadFromStringArray(ref TreeView tv, string[] s)
13 | {
14 | tv.Nodes.Clear();
15 | s = s.Trim(true);
16 |
17 | string group = "default";
18 |
19 | for (int i = 0; i < s.Length; ++i)
20 | {
21 | if (s[i].StartsEndsWith("[", "]"))
22 | {
23 | group = s[i].Substring(1, s[i].Length - 2);
24 | if (!tv.Nodes.ContainsText(group))
25 | {
26 | tv.Nodes.Add(new TreeNode() { Name = group, Text = group });
27 | }
28 | }
29 | else
30 | {
31 | // Judge whether is a naiveproxy link
32 | if (s[i].StartsWith("naive"))
33 | {
34 | if (i == 0)
35 | {
36 | tv.Nodes.Add(new TreeNode() { Name = group, Text = group });
37 | }
38 | try
39 | {
40 | tv.Nodes[group].Nodes.Add(new TreeNode()
41 | {
42 | Tag = s[i],
43 | Text = new Uri(s[i]).Fragment.Substring(1)
44 | });
45 | }
46 | catch (UriFormatException ufe) { }
47 | catch (NullReferenceException)
48 | {
49 | // TODO: NRE
50 | }
51 | }
52 | // TODO: Maybe Trojan? I'm not sure.
53 | }
54 | }
55 | }
56 |
57 | public static string[] ToStringArray(TreeView tv)
58 | {
59 | var l = new List();
60 | foreach (TreeNode group in tv.Nodes)
61 | {
62 | l.Add($"[{group.Text}]");
63 | l.AddRange(from TreeNode node in @group.Nodes select (string) node.Tag);
64 | }
65 | return l.ToArray();
66 | }
67 |
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/NaiveSharp/Controller/NsInfo.cs:
--------------------------------------------------------------------------------
1 | namespace NaiveSharp.Controller
2 | {
3 | public struct NsInfo
4 | {
5 | public string GroupName;
6 | public string Name;
7 | public string Uri;
8 | public bool Padding;
9 | }
10 | }
--------------------------------------------------------------------------------
/NaiveSharp/Controller/Nshelper.cs:
--------------------------------------------------------------------------------
1 | using NaiveSharp.Controller.Extension;
2 |
3 | namespace NaiveSharp.Controller
4 | {
5 | public class Nshelper
6 | {
7 | public static NsInfo? LoadFromNs(string ns)
8 | {
9 | // NS -> Base64([GroupName]) Base64([NodeName]) Base64([NodeUri]) [Padding]
10 | var vv = ns.Split(' ');
11 | var nsInfo = new NsInfo();
12 | switch (vv.Length)
13 | {
14 | case 2:
15 | nsInfo.Uri = vv[0].FromBase64();
16 | nsInfo.Padding = bool.Parse(vv[1]);
17 | break;
18 | case 3:
19 | nsInfo.Name = vv[0].FromBase64();
20 | nsInfo.Uri = vv[1].FromBase64();
21 | nsInfo.Padding = bool.Parse(vv[2]);
22 | break;
23 | case 4:
24 | nsInfo.GroupName = vv[0].FromBase64();
25 | nsInfo.Name = vv[1].FromBase64();
26 | nsInfo.Uri = vv[2].FromBase64();
27 | nsInfo.Padding = bool.Parse(vv[3]);
28 | break;
29 | default:
30 | return null;
31 | }
32 |
33 | return nsInfo;
34 | }
35 |
36 |
37 | }
38 | }
--------------------------------------------------------------------------------
/NaiveSharp/Controller/Operation.cs:
--------------------------------------------------------------------------------
1 | using NaiveSharp.Model;
2 |
3 | using System.Diagnostics;
4 | using System.IO;
5 | using System.Windows.Forms;
6 | using PATH = NaiveSharp.ConstText.PATH;
7 |
8 | namespace NaiveSharp.Controller
9 | {
10 | public static class Operation
11 | {
12 | public static void Save(ref TreeView tv)
13 | {
14 | if (!Directory.Exists(PATH.CONFIG))
15 | {
16 | Directory.CreateDirectory(PATH.CONFIG);
17 | }
18 | // File.WriteAllText(PATH.CONFIG_NODE_NS, Config.ConvertToNs());
19 |
20 | File.WriteAllLines(PATH.CONFIG_NODELIST, NodeList.ToStringArray(tv));
21 | }
22 |
23 | public static void Run(ref TreeView tv)
24 | {
25 | Stop();
26 | Save(ref tv);
27 | // Command.InitializeTmp();
28 | switch (Config.RunMode.ToLower())
29 | {
30 | case "global":
31 | Command.RunNaive("socks");
32 | Command.RunPrivoxy();
33 | break;
34 | case "geoip":
35 | Command.RunNaive("socks");
36 | Command.RunClash();
37 | break;
38 | case "gfwlist":
39 | Command.RunNaive("socks");
40 | Command.RunPrivoxyWithGFWList();
41 | break;
42 | case "none":
43 | Command.RunNaive("socks");
44 | return;
45 | }
46 | Proxy.Set(1081);
47 | }
48 |
49 | public static void Stop()
50 | {
51 | Proxy.Reset();
52 | Process[] procs = Process.GetProcesses();
53 | foreach (Process item in procs)
54 | {
55 | if (item.ProcessName.ToLower() == "naive" ||
56 | item.ProcessName.ToLower() == "privoxy" ||
57 | item.ProcessName.ToLower() == "clash")
58 | {
59 | item.Kill();
60 | }
61 | }
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/NaiveSharp/Controller/Proxy.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace NaiveSharp.Controller
5 | {
6 | class Proxy
7 | {
8 | public static bool Set(int port)
9 | => Set("127.0.0.1:" + port.ToString());
10 |
11 | public static bool Set(string ip, int port)
12 | => Set(ip + ":" + port.ToString());
13 |
14 | public static bool Reset()
15 | => SetProxy(null, null);
16 |
17 | private static bool Set(string strProxy)
18 | => SetProxy(strProxy, null);
19 |
20 |
21 | private static bool SetProxy(string strProxy, string exceptions)
22 | {
23 | InternetPerConnOptionList list = new InternetPerConnOptionList();
24 |
25 | int optionCount = string.IsNullOrEmpty(strProxy) ? 1 : (string.IsNullOrEmpty(exceptions) ? 2 : 3);
26 | InternetConnectionOption[] options = new InternetConnectionOption[optionCount];
27 |
28 | options[0].m_Option = PerConnOption.INTERNET_PER_CONN_FLAGS;
29 | options[0].m_Value.m_Int = (int)((optionCount < 2)
30 | ? PerConnFlags.PROXY_TYPE_DIRECT
31 | : (PerConnFlags.PROXY_TYPE_DIRECT | PerConnFlags.PROXY_TYPE_PROXY));
32 |
33 | if (optionCount > 1)
34 | {
35 | options[1].m_Option = PerConnOption.INTERNET_PER_CONN_PROXY_SERVER;
36 | options[1].m_Value.m_StringPtr = Marshal.StringToHGlobalAuto(strProxy);
37 | if (optionCount > 2)
38 | {
39 | options[2].m_Option = PerConnOption.INTERNET_PER_CONN_PROXY_BYPASS;
40 | options[2].m_Value.m_StringPtr = Marshal.StringToHGlobalAuto(exceptions);
41 | }
42 | }
43 |
44 | list.dwSize = Marshal.SizeOf(list);
45 | list.szConnection = IntPtr.Zero;
46 | list.dwOptionCount = options.Length;
47 | list.dwOptionError = 0;
48 |
49 | int optSize = Marshal.SizeOf(typeof(InternetConnectionOption));
50 | IntPtr optionsPtr = Marshal.AllocCoTaskMem(optSize * options.Length);
51 | for (int i = 0; i < options.Length; ++i)
52 | {
53 | IntPtr opt = new IntPtr(optionsPtr.ToInt64() + (i * optSize));
54 | Marshal.StructureToPtr(options[i], opt, false);
55 | }
56 |
57 | list.options = optionsPtr;
58 |
59 | IntPtr ipcoListPtr = Marshal.AllocCoTaskMem((Int32)list.dwSize);
60 | Marshal.StructureToPtr(list, ipcoListPtr, false);
61 |
62 | int returnvalue = NativeMethods.InternetSetOption(IntPtr.Zero,
63 | InternetOption.INTERNET_OPTION_PER_CONNECTION_OPTION,
64 | ipcoListPtr, list.dwSize)
65 | ? -1
66 | : 0;
67 | if (returnvalue == 0)
68 | {
69 | returnvalue = Marshal.GetLastWin32Error();
70 | }
71 |
72 | Marshal.FreeCoTaskMem(optionsPtr);
73 | Marshal.FreeCoTaskMem(ipcoListPtr);
74 | if (returnvalue > 0)
75 | {
76 | // No need to catch
77 | }
78 |
79 | return (returnvalue < 0);
80 | }
81 |
82 |
83 | #region WinInet structures
84 |
85 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
86 | public struct InternetPerConnOptionList
87 | {
88 | public int dwSize; // size of the INTERNET_PER_CONN_OPTION_LIST struct
89 | public IntPtr szConnection; // connection name to set/query options
90 | public int dwOptionCount; // number of options to set/query
91 |
92 | public int dwOptionError; // on error, which option failed
93 |
94 | //[MarshalAs(UnmanagedType.)]
95 | public IntPtr options;
96 | };
97 |
98 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
99 | public struct InternetConnectionOption
100 | {
101 | static readonly int Size = Marshal.SizeOf(typeof(InternetConnectionOption));
102 | public PerConnOption m_Option;
103 | public InternetConnectionOptionValue m_Value;
104 |
105 | [StructLayout(LayoutKind.Explicit)]
106 | public struct InternetConnectionOptionValue
107 | {
108 | // Fields
109 | [FieldOffset(0)] public System.Runtime.InteropServices.ComTypes.FILETIME m_FileTime;
110 | [FieldOffset(0)] public int m_Int;
111 | [FieldOffset(0)] public IntPtr m_StringPtr;
112 | }
113 | }
114 |
115 | #endregion
116 |
117 | #region WinInet enums
118 |
119 | //
120 | // options manifests for Internet{Query|Set}Option
121 | //
122 | public enum InternetOption : uint
123 | {
124 | INTERNET_OPTION_PER_CONNECTION_OPTION = 75
125 | }
126 |
127 | //
128 | // Options used in INTERNET_PER_CONN_OPTON struct
129 | //
130 | public enum PerConnOption
131 | {
132 | INTERNET_PER_CONN_FLAGS =
133 | 1, // Sets or retrieves the connection type. The Value member will contain one or more of the values from PerConnFlags
134 | INTERNET_PER_CONN_PROXY_SERVER = 2, // Sets or retrieves a string containing the proxy servers.
135 |
136 | INTERNET_PER_CONN_PROXY_BYPASS =
137 | 3, // Sets or retrieves a string containing the URLs that do not use the proxy server.
138 |
139 | INTERNET_PER_CONN_AUTOCONFIG_URL =
140 | 4 //, // Sets or retrieves a string containing the URL to the automatic configuration script.
141 | }
142 |
143 | //
144 | // PER_CONN_FLAGS
145 | //
146 | [Flags]
147 | public enum PerConnFlags
148 | {
149 | PROXY_TYPE_DIRECT = 0x00000001, // direct to net
150 | PROXY_TYPE_PROXY = 0x00000002, // via named proxy
151 | PROXY_TYPE_AUTO_PROXY_URL = 0x00000004, // autoproxy URL
152 | PROXY_TYPE_AUTO_DETECT = 0x00000008 // use autoproxy detection
153 | }
154 |
155 | #endregion
156 |
157 | internal static class NativeMethods
158 | {
159 | [DllImport("WinInet.dll", SetLastError = true, CharSet = CharSet.Auto)]
160 | [return: MarshalAs(UnmanagedType.Bool)]
161 | public static extern bool InternetSetOption(IntPtr hInternet, InternetOption dwOption, IntPtr lpBuffer,
162 | int dwBufferLength);
163 | }
164 | }
165 | }
--------------------------------------------------------------------------------
/NaiveSharp/Controller/Sharelink.cs:
--------------------------------------------------------------------------------
1 | using NaiveSharp.Controller.Extension;
2 | using NaiveSharp.Model;
3 |
4 | using System;
5 | using System.Data;
6 | using System.Web;
7 |
8 | namespace NaiveSharp.Controller
9 | {
10 | public class Sharelink
11 | {
12 | public static NaiveConfig? LoadFromShareLink(string sharelink)
13 | {
14 | Uri uri;
15 | try
16 | {
17 | uri = new Uri(sharelink);
18 | }
19 | catch
20 | {
21 | return null;
22 | }
23 | var config = new NaiveConfig();
24 | switch (uri.Scheme)
25 | {
26 | case "naive+https":
27 | config.Scheme = "https";
28 | break;
29 | case "naive+quic":
30 | config.Scheme = "quic";
31 | break;
32 | default:
33 | return null;
34 | }
35 | config.Host = uri.Host;
36 | if (uri.Port > 0)
37 | {
38 | config.Host += ":" + uri.Port;
39 | }
40 | config.Name = uri.Fragment;
41 | if (config.Name.Length > 1)
42 | {
43 | config.Name = config.Name.Substring(1);
44 | }
45 | string userinfo = uri.UserInfo.Trim();
46 | if (string.IsNullOrWhiteSpace(userinfo))
47 | {
48 | config.Username = config.Password = "";
49 | }
50 | else
51 | {
52 | var vv = userinfo.Split(':');
53 | switch (vv.Length)
54 | {
55 | case 1:
56 | config.Username = vv[0];
57 | break;
58 | case 2:
59 | config.Username = vv[0].FromUrlEncode();
60 | config.Password = vv[1].FromUrlEncode();
61 | break;
62 | default:
63 | throw new DataException();
64 | }
65 | }
66 |
67 | var query = HttpUtility.ParseQueryString(uri.Query);
68 |
69 | if (!string.IsNullOrWhiteSpace(query["extra-headers"]))
70 | {
71 | config.ExtraHeaders = query["extra-headers"];
72 | }
73 | return config;
74 | }
75 |
76 | public static string Generate()
77 | {
78 | var queryC = HttpUtility.ParseQueryString(string.Empty);
79 |
80 | if (!string.IsNullOrWhiteSpace(Config.ExtraHeaders))
81 | {
82 | queryC.Add("extra-headers", Config.ExtraHeaders);
83 | }
84 | try
85 | {
86 | var v = Config.Host.Split(':');
87 |
88 | return v.Length switch
89 | {
90 | 1 => new UriBuilder()
91 | {
92 | Scheme = "naive+" + Config.Scheme,
93 | Host = Config.Host,
94 | UserName = Config.Username,
95 | Password = Config.Password,
96 | Query = queryC.ToString(),
97 | Fragment = Config.Name
98 |
99 | }.ToString(),
100 | 2 => new UriBuilder()
101 | {
102 | Scheme = "naive+" + Config.Scheme,
103 | Host = v[0],
104 | Port = v[1].ToInt(),
105 | UserName = Config.Username,
106 | Password = Config.Password,
107 | Query = queryC.ToString(),
108 | Fragment = Config.Name
109 | }.ToString(),
110 | _ => null
111 | };
112 | }
113 | catch
114 | {
115 | return "";
116 | }
117 | }
118 | }
119 |
120 | public struct NaiveConfig
121 | {
122 | public string Name;
123 |
124 | public string Username;
125 |
126 | public string Password;
127 |
128 | public string Host;
129 |
130 | public string Scheme;
131 |
132 | public string ExtraHeaders;
133 | }
134 | }
135 |
--------------------------------------------------------------------------------
/NaiveSharp/Controller/Update.cs:
--------------------------------------------------------------------------------
1 | namespace NaiveSharp.Controller
2 | {
3 | public class Update
4 | {
5 | // TODO: Updater
6 | }
7 | }
--------------------------------------------------------------------------------
/NaiveSharp/DesignMap/Config.md:
--------------------------------------------------------------------------------
1 | # Config Design
2 |
3 | config.ini
4 |
5 | ```ini
6 | [NaiveSharp]
7 | Proxy= [GeoIP/GfwList/Global]
8 | ```
--------------------------------------------------------------------------------
/NaiveSharp/DesignMap/File.md:
--------------------------------------------------------------------------------
1 | # File Design
2 |
3 | ```
4 | - NaiveSharp.exe
5 | - 3rd
6 | - Clash
7 | - Country.mmdb
8 | - clash.exe
9 | - config.yaml
10 | - Privoxy
11 | - config.txt
12 | - config_gfw.txt
13 | - gfwlist.action
14 | - privoxy.exe
15 | - NaiveProxy
16 | - naive.exe
17 | - config
18 | - config.ini
19 | - node.ns
20 | - tmp*
21 | ```
22 |
23 | > Tip: "tmp" folder is design for run config.
--------------------------------------------------------------------------------
/NaiveSharp/DesignMap/Node.md:
--------------------------------------------------------------------------------
1 | # Node Save Design
2 |
3 | node.ns
4 | ```
5 | base64(node_info) padding
6 | ```
7 |
8 |
9 | list.ns
10 | ```
11 | [Group_1]
12 | base64(node_info) padding
13 | [Group_2]
14 | base64(node_info) padding
15 | base64(node_info) padding
16 | ```
--------------------------------------------------------------------------------
/NaiveSharp/DesignMap/README.md:
--------------------------------------------------------------------------------
1 | # DesignMap
2 |
3 | This is NaiveSharp design thoughts.
4 |
5 | ## Map
6 |
7 | | Name | Function |
8 | | ---- | -------- |
9 | | [File](File.md) | File tree |
10 | | [Config](Config.md) | config.ini design |
11 | | [Node](Node.md) | node.ns things |
12 |
--------------------------------------------------------------------------------
/NaiveSharp/Model/Config.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using NaiveSharp.ConstText;
3 | using NaiveSharp.Controller.Extension;
4 |
5 | namespace NaiveSharp.Model
6 | {
7 | public class Config
8 | {
9 | public static string RunMode { set; get; } = "global";
10 |
11 | public static string Name { set; get; } = string.Empty;
12 |
13 | public static string Username { set; get; } = string.Empty;
14 |
15 | public static string Password { set; get; } = string.Empty;
16 |
17 | public static string Host { set; get; } = string.Empty;
18 |
19 | public static string Scheme { set; get; } = "https";
20 |
21 | public static string ExtraHeaders { set; get; } = null;
22 |
23 | public static bool Debug { get; set; } = false;
24 |
25 | public static bool IsFirstTimeHide { get; set; } = true;
26 |
27 | public static string ConvertToNs()
28 | {
29 | return Controller.NaiveCmdBuilder.Proxy(Scheme, Username, Password, Host).ToBase64();
30 | }
31 |
32 | public static void Save()
33 | {
34 | if (!File.Exists(PATH.CONFIG_INI))
35 | {
36 | File.Create(PATH.CONFIG_INI).Close();
37 | }
38 |
39 | File.WriteAllText(PATH.CONFIG_INI, $"mode = {Config.RunMode}");
40 | }
41 |
42 | }
43 | }
--------------------------------------------------------------------------------
/NaiveSharp/Model/FormSize.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using NaiveSharp.ConstText;
3 |
4 | namespace NaiveSharp.Model
5 | {
6 | public class FormSize
7 | {
8 | public static int X;
9 | public static int Y;
10 |
11 | public static void Save()
12 | {
13 | if (!File.Exists(PATH.CONFIG_FORM))
14 | {
15 | File.Create(PATH.CONFIG_FORM).Close();
16 | }
17 |
18 | File.WriteAllText(PATH.CONFIG_FORM, $"{X},{Y}");
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/NaiveSharp/NaiveSharp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {EB5FD7C4-6735-4DE5-A292-358651270EED}
8 | WinExe
9 | NaiveSharp
10 | NaiveSharp
11 | v4.7.2
12 | 512
13 | true
14 | true
15 | 8
16 | false
17 |
18 |
19 |
20 | publish\
21 | true
22 | Disk
23 | false
24 | Foreground
25 | 7
26 | Days
27 | false
28 | false
29 | true
30 | https://github.com/KevinZonda/NaiveSharp
31 | https://github.com/KevinZonda/NaiveSharp
32 | NaiveSharp
33 | Kevin Sanchez
34 | NaiveSharp
35 | 3
36 | 0.6.3.%2a
37 | false
38 | true
39 | true
40 |
41 |
42 | AnyCPU
43 | true
44 | full
45 | false
46 | bin\Debug\
47 | DEBUG;TRACE
48 | prompt
49 | 4
50 | false
51 |
52 |
53 | AnyCPU
54 | none
55 | true
56 | bin\Release\
57 |
58 |
59 | prompt
60 | 4
61 | false
62 | Auto
63 |
64 |
65 | ns.ico
66 |
67 |
68 |
69 | A5973F0F71D738B588F1A0E26663AF46DFA29F45
70 |
71 |
72 | NaiveSharp_TemporaryKey.pfx
73 |
74 |
75 | false
76 |
77 |
78 | false
79 |
80 |
81 |
82 | LocalIntranet
83 |
84 |
85 | app.manifest
86 |
87 |
88 |
89 | ..\packages\QrCode.Net.0.4.0.0\lib\net45\Gma.QrCodeNet.Encoding.dll
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 | Form
137 |
138 |
139 | About.cs
140 |
141 |
142 | Form
143 |
144 |
145 | AdvanceWindow.cs
146 |
147 |
148 | Form
149 |
150 |
151 | MainWindow.cs
152 |
153 |
154 | Form
155 |
156 |
157 | Form
158 |
159 |
160 | Qr.cs
161 |
162 |
163 | ResXFileCodeGenerator
164 | Resources.Designer.cs
165 | Designer
166 |
167 |
168 | True
169 | Resources.resx
170 | True
171 |
172 |
173 | About.cs
174 |
175 |
176 | AdvanceWindow.cs
177 |
178 |
179 | MainWindow.cs
180 |
181 |
182 | Qr.cs
183 |
184 |
185 |
186 |
187 |
188 | SettingsSingleFileGenerator
189 | Settings.Designer.cs
190 |
191 |
192 | True
193 | Settings.settings
194 | True
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 | False
209 | Microsoft .NET Framework 4.7.2 %28x86 and x64%29
210 | true
211 |
212 |
213 | False
214 | .NET Framework 3.5 SP1
215 | false
216 |
217 |
218 |
219 |
220 | False
221 | Exclude
222 | True
223 |
224 |
225 |
226 |
227 | File
228 |
229 |
230 | False
231 | Exclude
232 | True
233 |
234 |
235 |
236 |
237 | File
238 |
239 |
240 | False
241 | Exclude
242 | True
243 |
244 |
245 |
246 |
247 | File
248 |
249 |
250 |
251 |
--------------------------------------------------------------------------------
/NaiveSharp/Program.cs:
--------------------------------------------------------------------------------
1 | using NaiveSharp.View;
2 |
3 | using System;
4 | using System.Diagnostics;
5 | using System.Linq;
6 | using System.Reflection;
7 | using System.Runtime.InteropServices;
8 | using System.Windows.Forms;
9 |
10 | namespace NaiveSharp
11 | {
12 | static class Program
13 | {
14 | [STAThread]
15 | static void Main(string[] args)
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Process instance = RunningInstance();
20 | if (instance == null || args.Contains("--no-check-running"))
21 | {
22 | Application.Run(new MainWindow());
23 | }
24 | else
25 | {
26 | MessageBox.Show("Naive# has been running.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
27 | HandleRunningInstance(instance);
28 | }
29 | }
30 |
31 | public static Process RunningInstance()
32 | {
33 | Process current = Process.GetCurrentProcess();
34 | Process[] processes = Process.GetProcessesByName(current.ProcessName);
35 | foreach (Process process in processes)
36 | {
37 | if (process.Id != current.Id)
38 | {
39 | if (Assembly.GetExecutingAssembly().Location.Replace("/", "\\") == current.MainModule.FileName)
40 | {
41 | return process;
42 | }
43 | }
44 | }
45 | return null;
46 | }
47 |
48 | public static void HandleRunningInstance(Process instance)
49 | {
50 | ShowWindow(instance.MainWindowHandle, WS_SHOWNORMAL);
51 | SetForegroundWindow(instance.MainWindowHandle);
52 | }
53 |
54 | [DllImport("User32.dll")]
55 | private static extern bool ShowWindow(IntPtr hWnd, int cmdShow);
56 |
57 | [DllImport("User32.dll")]
58 | private static extern bool SetForegroundWindow(IntPtr hWnd);
59 | private const int WS_SHOWNORMAL = 1;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/NaiveSharp/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // 有关程序集的一般信息由以下
6 | // 控制。更改这些特性值可修改
7 | // 与程序集关联的信息。
8 | [assembly: AssemblyTitle("NaiveSharp")]
9 | [assembly: AssemblyDescription("A NaiveProxy Windows Client")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("KevinZonda")]
12 | [assembly: AssemblyProduct("NaiveSharp")]
13 | [assembly: AssemblyCopyright("Copyright © KevinZonda 2020")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // 将 ComVisible 设置为 false 会使此程序集中的类型
18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
19 | //请将此类型的 ComVisible 特性设置为 true。
20 | [assembly: ComVisible(false)]
21 |
22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
23 | [assembly: Guid("eb5fd7c4-6735-4de5-a292-358651270eed")]
24 |
25 | // 程序集的版本信息由下列四个值组成:
26 | //
27 | // 主版本
28 | // 次版本
29 | // 生成号
30 | // 修订号
31 | //
32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
33 | //通过使用 "*",如下所示:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("0.6.6.0")]
36 | [assembly: AssemblyFileVersion("0.6.6.0")]
37 |
--------------------------------------------------------------------------------
/NaiveSharp/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace NaiveSharp.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NaiveSharp.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/NaiveSharp/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/NaiveSharp/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace NaiveSharp.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.6.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/NaiveSharp/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/NaiveSharp/Properties/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
48 |
55 |
56 |
70 |
--------------------------------------------------------------------------------
/NaiveSharp/View/About.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace NaiveSharp.View
2 | {
3 | partial class About
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(About));
32 | this.picNavBackground = new System.Windows.Forms.PictureBox();
33 | this.lblName = new System.Windows.Forms.Label();
34 | this.lblContext = new System.Windows.Forms.Label();
35 | this.lstCredit = new System.Windows.Forms.ListBox();
36 | this.lblCredit = new System.Windows.Forms.Label();
37 | this.btnOk = new System.Windows.Forms.Button();
38 | this.llbLicense = new System.Windows.Forms.LinkLabel();
39 | ((System.ComponentModel.ISupportInitialize)(this.picNavBackground)).BeginInit();
40 | this.SuspendLayout();
41 | //
42 | // picNavBackground
43 | //
44 | this.picNavBackground.BackColor = System.Drawing.SystemColors.Window;
45 | this.picNavBackground.Dock = System.Windows.Forms.DockStyle.Top;
46 | this.picNavBackground.Location = new System.Drawing.Point(0, 0);
47 | this.picNavBackground.Margin = new System.Windows.Forms.Padding(4);
48 | this.picNavBackground.Name = "picNavBackground";
49 | this.picNavBackground.Size = new System.Drawing.Size(463, 72);
50 | this.picNavBackground.TabIndex = 0;
51 | this.picNavBackground.TabStop = false;
52 | //
53 | // lblName
54 | //
55 | this.lblName.AutoSize = true;
56 | this.lblName.BackColor = System.Drawing.SystemColors.Window;
57 | this.lblName.Font = new System.Drawing.Font("Segoe UI", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
58 | this.lblName.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(44)))), ((int)(((byte)(62)))), ((int)(((byte)(79)))));
59 | this.lblName.Location = new System.Drawing.Point(16, 12);
60 | this.lblName.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
61 | this.lblName.Name = "lblName";
62 | this.lblName.Size = new System.Drawing.Size(101, 37);
63 | this.lblName.TabIndex = 1;
64 | this.lblName.Text = "Naive#";
65 | //
66 | // lblContext
67 | //
68 | this.lblContext.AutoSize = true;
69 | this.lblContext.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
70 | this.lblContext.Location = new System.Drawing.Point(19, 88);
71 | this.lblContext.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
72 | this.lblContext.Name = "lblContext";
73 | this.lblContext.Size = new System.Drawing.Size(141, 80);
74 | this.lblContext.TabIndex = 2;
75 | this.lblContext.Text = "NaiveSharp\r\nVersion 0.6.6-prev\r\n© 2020 KevinZonda\r\nGNU GPL v3.0";
76 | //
77 | // lstCredit
78 | //
79 | this.lstCredit.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
80 | this.lstCredit.FormattingEnabled = true;
81 | this.lstCredit.ItemHeight = 20;
82 | this.lstCredit.Items.AddRange(new object[] {
83 | "klzgrad/naiveproxy - BSD 3-Clause",
84 | "trojan-gfw/igniter - GPLv3",
85 | "Dreamacro/clash - GPLv3",
86 | "privoxy.org/privoxy - GPLv2",
87 | "QrCode.NET - MIT"});
88 | this.lstCredit.Location = new System.Drawing.Point(23, 204);
89 | this.lstCredit.Margin = new System.Windows.Forms.Padding(4);
90 | this.lstCredit.Name = "lstCredit";
91 | this.lstCredit.Size = new System.Drawing.Size(416, 124);
92 | this.lstCredit.TabIndex = 3;
93 | //
94 | // lblCredit
95 | //
96 | this.lblCredit.AutoSize = true;
97 | this.lblCredit.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
98 | this.lblCredit.Location = new System.Drawing.Point(19, 180);
99 | this.lblCredit.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
100 | this.lblCredit.Name = "lblCredit";
101 | this.lblCredit.Size = new System.Drawing.Size(49, 20);
102 | this.lblCredit.TabIndex = 4;
103 | this.lblCredit.Text = "Credit";
104 | //
105 | // btnOk
106 | //
107 | this.btnOk.Location = new System.Drawing.Point(340, 337);
108 | this.btnOk.Margin = new System.Windows.Forms.Padding(4);
109 | this.btnOk.Name = "btnOk";
110 | this.btnOk.Size = new System.Drawing.Size(100, 31);
111 | this.btnOk.TabIndex = 5;
112 | this.btnOk.Text = "OK";
113 | this.btnOk.UseVisualStyleBackColor = true;
114 | this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
115 | //
116 | // llbLicense
117 | //
118 | this.llbLicense.AccessibleDescription = "License of NaiveSharp";
119 | this.llbLicense.ActiveLinkColor = System.Drawing.Color.DodgerBlue;
120 | this.llbLicense.AutoSize = true;
121 | this.llbLicense.BackColor = System.Drawing.SystemColors.Window;
122 | this.llbLicense.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
123 | this.llbLicense.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline;
124 | this.llbLicense.LinkColor = System.Drawing.Color.DodgerBlue;
125 | this.llbLicense.Location = new System.Drawing.Point(353, 24);
126 | this.llbLicense.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
127 | this.llbLicense.Name = "llbLicense";
128 | this.llbLicense.Size = new System.Drawing.Size(64, 20);
129 | this.llbLicense.TabIndex = 6;
130 | this.llbLicense.TabStop = true;
131 | this.llbLicense.Text = "LICENSE";
132 | this.llbLicense.VisitedLinkColor = System.Drawing.Color.DodgerBlue;
133 | this.llbLicense.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.llbLicense_LinkClicked);
134 | //
135 | // About
136 | //
137 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
138 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
139 | this.ClientSize = new System.Drawing.Size(463, 377);
140 | this.Controls.Add(this.llbLicense);
141 | this.Controls.Add(this.btnOk);
142 | this.Controls.Add(this.lblCredit);
143 | this.Controls.Add(this.lstCredit);
144 | this.Controls.Add(this.lblContext);
145 | this.Controls.Add(this.lblName);
146 | this.Controls.Add(this.picNavBackground);
147 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
148 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
149 | this.Margin = new System.Windows.Forms.Padding(4);
150 | this.MaximizeBox = false;
151 | this.MinimizeBox = false;
152 | this.Name = "About";
153 | this.Text = "About Naive#";
154 | ((System.ComponentModel.ISupportInitialize)(this.picNavBackground)).EndInit();
155 | this.ResumeLayout(false);
156 | this.PerformLayout();
157 |
158 | }
159 |
160 | #endregion
161 |
162 | private System.Windows.Forms.PictureBox picNavBackground;
163 | private System.Windows.Forms.Label lblName;
164 | private System.Windows.Forms.Label lblContext;
165 | private System.Windows.Forms.ListBox lstCredit;
166 | private System.Windows.Forms.Label lblCredit;
167 | private System.Windows.Forms.Button btnOk;
168 | private System.Windows.Forms.LinkLabel llbLicense;
169 | }
170 | }
--------------------------------------------------------------------------------
/NaiveSharp/View/About.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.Windows.Forms;
4 |
5 | namespace NaiveSharp.View
6 | {
7 | public partial class About : Form
8 | {
9 | public About()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | private void btnOk_Click(object sender, EventArgs e)
15 | {
16 | this.Close();
17 | }
18 |
19 | private void llbLicense_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
20 | {
21 | Process.Start("https://github.com/KevinZonda/NaiveSharp/blob/master/LICENSE");
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/NaiveSharp/View/AdvanceWindow.Designer.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel;
2 |
3 | namespace NaiveSharp.View
4 | {
5 | partial class AdvanceWindow
6 | {
7 | ///
8 | /// Required designer variable.
9 | ///
10 | private IContainer components = null;
11 |
12 | ///
13 | /// Clean up any resources being used.
14 | ///
15 | /// true if managed resources should be disposed; otherwise, false.
16 | protected override void Dispose(bool disposing)
17 | {
18 | if (disposing && (components != null))
19 | {
20 | components.Dispose();
21 | }
22 |
23 | base.Dispose(disposing);
24 | }
25 |
26 | #region Windows Form Designer generated code
27 |
28 | ///
29 | /// Required method for Designer support - do not modify
30 | /// the contents of this method with the code editor.
31 | ///
32 | private void InitializeComponent()
33 | {
34 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AdvanceWindow));
35 | this.btnDebug = new System.Windows.Forms.Button();
36 | this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
37 | this.lblDebug = new System.Windows.Forms.Label();
38 | this.btnResetFormSize = new System.Windows.Forms.Button();
39 | this.label1 = new System.Windows.Forms.Label();
40 | this.tableLayoutPanel1.SuspendLayout();
41 | this.SuspendLayout();
42 | //
43 | // btnDebug
44 | //
45 | this.btnDebug.AutoSize = true;
46 | this.btnDebug.Dock = System.Windows.Forms.DockStyle.Fill;
47 | this.btnDebug.Location = new System.Drawing.Point(119, 3);
48 | this.btnDebug.Name = "btnDebug";
49 | this.btnDebug.Size = new System.Drawing.Size(110, 53);
50 | this.btnDebug.TabIndex = 0;
51 | this.btnDebug.Text = "DEBUG";
52 | this.btnDebug.UseVisualStyleBackColor = true;
53 | this.btnDebug.Click += new System.EventHandler(this.btnDebug_Click);
54 | //
55 | // tableLayoutPanel1
56 | //
57 | this.tableLayoutPanel1.ColumnCount = 2;
58 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
59 | this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
60 | this.tableLayoutPanel1.Controls.Add(this.btnResetFormSize, 1, 1);
61 | this.tableLayoutPanel1.Controls.Add(this.label1, 0, 1);
62 | this.tableLayoutPanel1.Controls.Add(this.lblDebug, 0, 0);
63 | this.tableLayoutPanel1.Controls.Add(this.btnDebug, 1, 0);
64 | this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
65 | this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
66 | this.tableLayoutPanel1.Name = "tableLayoutPanel1";
67 | this.tableLayoutPanel1.RowCount = 2;
68 | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
69 | this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
70 | this.tableLayoutPanel1.Size = new System.Drawing.Size(232, 118);
71 | this.tableLayoutPanel1.TabIndex = 1;
72 | //
73 | // lblDebug
74 | //
75 | this.lblDebug.Anchor = System.Windows.Forms.AnchorStyles.None;
76 | this.lblDebug.AutoSize = true;
77 | this.lblDebug.Location = new System.Drawing.Point(13, 21);
78 | this.lblDebug.Name = "lblDebug";
79 | this.lblDebug.Size = new System.Drawing.Size(89, 17);
80 | this.lblDebug.TabIndex = 2;
81 | this.lblDebug.Text = "Debug Mode";
82 | //
83 | // btnResetFormSize
84 | //
85 | this.btnResetFormSize.AutoSize = true;
86 | this.btnResetFormSize.Dock = System.Windows.Forms.DockStyle.Fill;
87 | this.btnResetFormSize.Location = new System.Drawing.Point(119, 62);
88 | this.btnResetFormSize.Name = "btnResetFormSize";
89 | this.btnResetFormSize.Size = new System.Drawing.Size(110, 53);
90 | this.btnResetFormSize.TabIndex = 3;
91 | this.btnResetFormSize.Text = "OK";
92 | this.btnResetFormSize.UseVisualStyleBackColor = true;
93 | this.btnResetFormSize.Click += new System.EventHandler(this.btnResetFormSize_Click);
94 | //
95 | // label1
96 | //
97 | this.label1.Anchor = System.Windows.Forms.AnchorStyles.None;
98 | this.label1.AutoSize = true;
99 | this.label1.Location = new System.Drawing.Point(4, 80);
100 | this.label1.Name = "label1";
101 | this.label1.Size = new System.Drawing.Size(108, 17);
102 | this.label1.TabIndex = 4;
103 | this.label1.Text = "Reset FormSize";
104 | //
105 | // AdvanceWindow
106 | //
107 | this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
108 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
109 | this.BackColor = System.Drawing.SystemColors.Window;
110 | this.ClientSize = new System.Drawing.Size(232, 118);
111 | this.Controls.Add(this.tableLayoutPanel1);
112 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
113 | this.MaximizeBox = false;
114 | this.MinimizeBox = false;
115 | this.Name = "AdvanceWindow";
116 | this.Text = "Advance";
117 | this.Load += new System.EventHandler(this.AdvanceWindow_Load);
118 | this.tableLayoutPanel1.ResumeLayout(false);
119 | this.tableLayoutPanel1.PerformLayout();
120 | this.ResumeLayout(false);
121 |
122 | }
123 |
124 | #endregion
125 |
126 | private System.Windows.Forms.Button btnDebug;
127 | private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
128 | private System.Windows.Forms.Button btnResetFormSize;
129 | private System.Windows.Forms.Label label1;
130 | private System.Windows.Forms.Label lblDebug;
131 | }
132 | }
--------------------------------------------------------------------------------
/NaiveSharp/View/AdvanceWindow.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.IO;
4 | using System.Windows.Forms;
5 |
6 | using NaiveSharp.ConstText;
7 | using NaiveSharp.Controller;
8 |
9 | namespace NaiveSharp.View
10 | {
11 | public partial class AdvanceWindow : Form
12 | {
13 | public AdvanceWindow()
14 | {
15 | InitializeComponent();
16 | }
17 |
18 | private static bool IsDebug()
19 | => File.Exists(PATH.CONFIG_DEBUG);
20 |
21 | private static void SetDebugStatus(bool status)
22 | {
23 | if (status)
24 | {
25 | Create(PATH.CONFIG_DEBUG);
26 | }
27 | else
28 | {
29 | Delete(PATH.CONFIG_DEBUG);
30 | }
31 | }
32 |
33 | private static void ResetFormSize()
34 | => Delete(PATH.CONFIG_FORM);
35 |
36 | private static void Delete(string path)
37 | {
38 | if (File.Exists(path))
39 | {
40 | File.Delete(path);
41 | }
42 | }
43 |
44 | private static void Create(string path)
45 | {
46 | if (!File.Exists(path))
47 | {
48 | File.Create(path).Close();
49 | }
50 |
51 | }
52 |
53 | private void AdvanceWindow_Load(object sender, System.EventArgs e)
54 | => btnDebug.Text = IsDebug() ? "Turn Off" : "Turn On";
55 |
56 | private void btnResetFormSize_Click(object sender, System.EventArgs e)
57 | {
58 | ResetFormSize();
59 | RequestRestart();
60 | }
61 |
62 | private void btnDebug_Click(object sender, System.EventArgs e)
63 | {
64 | if (btnDebug.Text.EndsWith("On"))
65 | {
66 | SetDebugStatus(true);
67 | btnDebug.Text = @"Turn Off";
68 | }
69 | else
70 | {
71 | SetDebugStatus(false);
72 | btnDebug.Text = @"Turn On";
73 | }
74 | RequestRestart();
75 | }
76 |
77 | private static void RequestRestart()
78 | {
79 | if (MessageBox.Show(Msg.ASK_CHANGES_NEED_APP_RESTART, Msg.Title.INFO, MessageBoxButtons.YesNo,
80 | MessageBoxIcon.Asterisk) != DialogResult.Yes) return;
81 | Operation.Stop();
82 |
83 | Process.Start(new ProcessStartInfo
84 | {
85 | FileName = Application.ExecutablePath,
86 | Arguments = "--no-check-running",
87 | WindowStyle = ProcessWindowStyle.Normal
88 | });
89 | Environment.Exit(0);
90 | }
91 | }
92 | }
--------------------------------------------------------------------------------
/NaiveSharp/View/MainWindow.cs:
--------------------------------------------------------------------------------
1 | using NaiveSharp.Controller;
2 | using NaiveSharp.Model;
3 | using NaiveSharp.Controller.Extension;
4 | using System;
5 | using System.IO;
6 | using System.Windows.Forms;
7 | using NaiveSharp.ConstText;
8 |
9 | namespace NaiveSharp.View
10 | {
11 | public partial class MainWindow : Form
12 | {
13 | public MainWindow()
14 | {
15 | CheckPath();
16 |
17 | if (File.Exists(ConstText.PATH.CONFIG_FORM))
18 | {
19 | var c = File.ReadAllText(PATH.CONFIG_FORM).Replace(" ", "").Split(',');
20 | if (c.Length == 2)
21 | {
22 | if (int.TryParse(c[0].Trim(), out int iTx))
23 | FormSize.X = iTx;
24 | if (int.TryParse(c[1].Trim(), out int iTy))
25 | FormSize.Y = iTy;
26 | }
27 | }
28 |
29 | // MessageBox.Show(File.ReadAllText(PATH.CONFIG_INI));
30 | string runMode = LoadModeConfig();
31 |
32 | InitializeComponent();
33 | Config.RunMode = runMode;
34 | SyncRunModeToView();
35 |
36 | // THIS IS FOR TEST
37 | // TODO: LOGIC
38 | // NodeList.LoadFromStringArray(ref this.tvwNodeList, new string[] { "naive+https://what:happened@test.someone.cf?padding=false#Naive!", "[222]", "naive+https://some.public.rs?padding=true#Public-01" });
39 |
40 | LoadFromNodeListFile();
41 | int?[] selectedNode = new int?[] {0, null};
42 |
43 | if (File.Exists(PATH.CONFIG_SELECT_NODE))
44 | {
45 | string x = File.ReadAllText(PATH.CONFIG_SELECT_NODE);
46 | string[] y = x.Split(',').Trim();
47 | try
48 | {
49 | switch (y.Length)
50 | {
51 | case 1:
52 | selectedNode[0] = y[0].ToInt(0);
53 | break;
54 | case 2:
55 | selectedNode[0] = y[0].ToInt(0);
56 | selectedNode[1] = y[0].ToInt(0);
57 | break;
58 | }
59 | }
60 | finally
61 | {
62 | // MessageBox.Show($"READ -> {selectedNode[0]}, {selectedNode[1]}");
63 | SetSelecteNode(selectedNode[0].Value, selectedNode[1]);
64 | }
65 | }
66 | else
67 | {
68 | File.Create(PATH.CONFIG_SELECT_NODE).Close();
69 | File.WriteAllText(PATH.CONFIG_SELECT_NODE, @"0");
70 | }
71 |
72 | // tvwNodeList.ExpandAll();
73 |
74 | //NodeList.LoadFromStringArray(ref this.tvwNodeList, File.ReadAllLines(PATH.CONFIG_NODELIST));
75 |
76 | /*
77 | if (File.Exists(PATH.CONFIG_NODE_NS))
78 | {
79 | try
80 | {
81 | LoadFromNs(File.ReadAllText(PATH.CONFIG_NODE_NS));
82 | }
83 | catch
84 | {
85 | File.Delete(PATH.CONFIG_NODE_NS);
86 | }
87 | }
88 | */
89 | if (FormSize.X > 0)
90 | this.Width = FormSize.X;
91 | if (FormSize.Y > 0)
92 | this.Height = FormSize.Y;
93 | }
94 |
95 | private void MainWindows_Load(object sender, EventArgs e)
96 | {
97 | if (File.Exists(PATH.CONFIG_DEBUG))
98 | {
99 | Config.Debug = true;
100 | this.Text = @"[DEBUG]" + this.Text;
101 | }
102 |
103 | icnNotify.Visible = true;
104 | }
105 |
106 | private void MainWindow_ResizeEnd(object sender, EventArgs e)
107 | {
108 | FormSize.X = Width;
109 | FormSize.Y = Height;
110 | FormSize.Save();
111 | }
112 |
113 | #region ProxyMode
114 |
115 | private void rdoGlobal_CheckedChanged(object sender, EventArgs e)
116 | {
117 | if (rdoGlobal.Checked)
118 | {
119 | Config.RunMode = "global";
120 | }
121 |
122 | SyncRunModeToView(SyncMode.RadioToTsm);
123 | Config.Save();
124 | }
125 |
126 | private void rdoGfwlist_CheckedChanged(object sender, EventArgs e)
127 | {
128 | if (rdoGfwlist.Checked)
129 | {
130 | Config.RunMode = "gfwlist";
131 | }
132 |
133 | SyncRunModeToView(SyncMode.RadioToTsm);
134 | Config.Save();
135 | }
136 |
137 | private void rdoGeoIP_CheckedChanged(object sender, EventArgs e)
138 | {
139 | if (rdoGeoIP.Checked)
140 | {
141 | Config.RunMode = "geoip";
142 | }
143 |
144 | SyncRunModeToView(SyncMode.RadioToTsm);
145 | Config.Save();
146 | }
147 |
148 | private void rdoNone_CheckedChanged(object sender, EventArgs e)
149 | {
150 | if (rdoNone.Checked)
151 | {
152 | Config.RunMode = "none";
153 | }
154 |
155 | SyncRunModeToView(SyncMode.RadioToTsm);
156 | Config.Save();
157 | }
158 |
159 | #endregion
160 |
161 | #region Operation Controller
162 |
163 | private void lblSave_Click(object sender, EventArgs e)
164 | {
165 | Operation.Save(ref tvwNodeList);
166 | // MessageBox.Show(NodeList.ToStringArray(tvwNodeList).ToNewString());
167 | // File.WriteAllLines(PATH.CONFIG_NODELIST, NodeList.ToStringArray(tvwNodeList));
168 | MessageBox.Show(Msg.NODE_SAVE_SUCCESS, Msg.Title.INFO, MessageBoxButtons.OK, MessageBoxIcon.Information);
169 | }
170 |
171 | private void btnRun_Click(object sender, EventArgs e)
172 | {
173 | if (CheckPortStatus() == DialogResult.No)
174 | {
175 | return;
176 | }
177 |
178 | if (tvwNodeList.SelectedNode.Level == 0)
179 | {
180 | MessageBox.Show(Msg.NODE_SELECTED_NOT_VALID, Msg.Title.ERROR, MessageBoxButtons.OK,
181 | MessageBoxIcon.Error);
182 | return;
183 | }
184 |
185 | Operation.Run(ref tvwNodeList);
186 | MessageBox.Show(Msg.RUN_SUCCESS, Msg.Title.INFO, MessageBoxButtons.OK, MessageBoxIcon.Information);
187 | }
188 |
189 | private void btnStop_Click(object sender, EventArgs e)
190 | {
191 | Operation.Stop();
192 | MessageBox.Show(Msg.STOP_SUCCESS, Msg.Title.INFO, MessageBoxButtons.OK, MessageBoxIcon.Information);
193 | }
194 |
195 | private void btnExit_Click(object sender, EventArgs e)
196 | {
197 | Operation.Stop();
198 | Environment.Exit(0);
199 | }
200 |
201 | #endregion
202 |
203 | #region Control -> Config
204 |
205 | private void txtName_TextChanged(object sender, EventArgs e)
206 | {
207 | /* FIXME
208 | if (tvwNodeList.SelectedNode != null && tvwNodeList.SelectedNode.Level == 1)
209 | {
210 | if (tvwNodeList.SelectedNode.Level == 0)
211 | {
212 | if (tvwNodeList.Nodes.ContainsKey(txtName.Text))
213 | {
214 | tvwNodeList.Enabled = false;
215 | return;
216 | }
217 | else
218 | {
219 | tvwNodeList.Enabled = true;
220 | }
221 | }
222 | }
223 | */
224 | if (CheckIsSelectNodeNull())
225 | return;
226 |
227 | tvwNodeList.SelectedNode.Name = tvwNodeList.SelectedNode.Text = txtName.Text;
228 | Config.Name = txtName.Text;
229 | SyncToTag();
230 | }
231 |
232 | private bool CheckIsSelectNodeNull()
233 | {
234 | if (tvwNodeList.SelectedNode is { }) return false;
235 |
236 | MessageBox.Show(Msg.CHOOSE_NULL_ITEM, Msg.Title.WARNING, MessageBoxButtons.OK, MessageBoxIcon.Warning);
237 | return true;
238 | }
239 |
240 | private void txtUsername_TextChanged(object sender, EventArgs e)
241 | {
242 | if (CheckIsSelectNodeNull())
243 | return;
244 |
245 | Config.Username = txtUsername.Text;
246 | SyncToTag();
247 | }
248 |
249 | private void txtPassword_TextChanged(object sender, EventArgs e)
250 | {
251 | if (CheckIsSelectNodeNull())
252 | return;
253 |
254 | Config.Password = txtPassword.Text;
255 | SyncToTag();
256 | }
257 |
258 | private void txtHost_TextChanged(object sender, EventArgs e)
259 | {
260 | if (CheckIsSelectNodeNull())
261 | return;
262 |
263 | Config.Host = txtHost.Text;
264 | SyncToTag();
265 | }
266 |
267 | private void rdoHttps_CheckedChanged(object sender, EventArgs e)
268 | {
269 | Config.Scheme = rdoHttps.Checked ? "https" : "quic";
270 |
271 | SyncToTag();
272 | }
273 |
274 | private void rdoQuic_CheckedChanged(object sender, EventArgs e)
275 | {
276 | Config.Scheme = rdoHttps.Checked ? "https" : "quic";
277 |
278 | SyncToTag();
279 | }
280 |
281 | #endregion
282 |
283 | #region SMI
284 |
285 | private void smiExit_Click(object sender, EventArgs e)
286 | {
287 | Operation.Stop();
288 | Environment.Exit(0);
289 | }
290 |
291 | private void smiStop_Click(object sender, EventArgs e)
292 | {
293 | Operation.Stop();
294 | icnNotify.ShowBalloonTip(500, "Naive#", Msg.STOP_SUCCESS, ToolTipIcon.Info);
295 | }
296 |
297 | private void smiRun_Click(object sender, EventArgs e)
298 | {
299 | if (tvwNodeList.SelectedNode.Level == 0)
300 | {
301 | MessageBox.Show(Msg.NODE_SELECTED_NOT_VALID, Msg.Title.ERROR, MessageBoxButtons.OK,
302 | MessageBoxIcon.Error);
303 | return;
304 | }
305 |
306 | Operation.Run(ref tvwNodeList);
307 | icnNotify.ShowBalloonTip(500, "Naive#", Msg.NAIVEPROXY_IS_RUNNING, ToolTipIcon.Info);
308 | }
309 |
310 | private void smiAbout_Click(object sender, EventArgs e)
311 | {
312 | new About().ShowDialog();
313 | }
314 |
315 | #endregion
316 |
317 | private void smiCopyShareLink_Click(object sender, EventArgs e)
318 | {
319 | Clipboard.SetText(Sharelink.Generate());
320 | }
321 |
322 | private void smiLoadShareLink_Click(object sender, EventArgs e)
323 | {
324 | TreeNodeCollection tnc = null;
325 | if (tvwNodeList.SelectedNode != null)
326 | {
327 | tnc = tvwNodeList.SelectedNode.Level == 0
328 | ? tvwNodeList.SelectedNode.Nodes
329 | : tvwNodeList.SelectedNode.Parent.Nodes;
330 | }
331 |
332 | if (tnc == null) return;
333 | string[] x = Clipboard.GetText().Split('\n');
334 | if (x.Length == 0) return;
335 | for (int ii = 0; ii < x.Length; ++ii)
336 | {
337 | var y = Sharelink.LoadFromShareLink(x[ii]);
338 | if (!y.HasValue)
339 | {
340 | return;
341 | }
342 |
343 | tnc.Add(new TreeNode()
344 | {
345 | Tag = x,
346 | Text = y.Value.Name
347 | });
348 | }
349 |
350 |
351 | /*
352 | switch (y.Value.Scheme)
353 | {
354 | case "https":
355 | rdoHttps.Checked = true;
356 | rdoQuic.Checked = false;
357 | break;
358 | default:
359 | rdoHttps.Checked = false;
360 | rdoQuic.Checked = true;
361 | break;
362 | }
363 |
364 | txtHost.Text = y.Value.Host;
365 | txtUsername.Text = y.Value.Username;
366 | txtPassword.Text = y.Value.Password;
367 | chkPadding.Checked = y.Value.Padding ?? false;
368 | */
369 | }
370 |
371 | private void MainWindow_FormClosing(object sender, FormClosingEventArgs e)
372 | {
373 | if (e.CloseReason == CloseReason.UserClosing)
374 | {
375 | Hide();
376 | if (Config.IsFirstTimeHide)
377 | {
378 | icnNotify.ShowBalloonTip(1000, Msg.Title.TIP, Msg.RUNNING_UNDER_BGD,
379 | ToolTipIcon.Info);
380 | Config.IsFirstTimeHide = false;
381 | }
382 |
383 | e.Cancel = true;
384 | }
385 | }
386 |
387 | private void cmsNotify_Opening(object sender, System.ComponentModel.CancelEventArgs e)
388 | {
389 | }
390 |
391 | private void icnNotify_MouseDoubleClick(object sender, MouseEventArgs e)
392 | {
393 | Show();
394 | //Focus();
395 | }
396 |
397 | private void tsmGlobal_Click(object sender, EventArgs e)
398 | {
399 | Config.RunMode = "global";
400 | SyncRunModeToView();
401 | }
402 |
403 | private void tsmGFWList_Click(object sender, EventArgs e)
404 | {
405 | Config.RunMode = "gfwlist";
406 | SyncRunModeToView();
407 | }
408 |
409 | private void tsmGeoIP_Click(object sender, EventArgs e)
410 | {
411 | Config.RunMode = "geoip";
412 | SyncRunModeToView();
413 | }
414 |
415 | private void tsmNone_Click(object sender, EventArgs e)
416 | {
417 | Config.RunMode = "none";
418 | SyncRunModeToView();
419 | }
420 |
421 | private void tvwNodeList_AfterSelect(object sender, TreeViewEventArgs e)
422 | {
423 | // MessageBox.Show((string)tvwNodeList.SelectedNode.Tag);
424 | if (tvwNodeList.SelectedNode.Level == 0)
425 | {
426 | // MessageBox.Show($"{tvwNodeList.SelectedNode.Index}");
427 | // TODO: SAVE
428 | File.WriteAllText(PATH.CONFIG_SELECT_NODE, $@"{tvwNodeList.SelectedNode.Index}");
429 |
430 | txtName.Text = tvwNodeList.SelectedNode.Text;
431 | txtHost.Enabled = txtPassword.Enabled = txtUsername.Enabled = false;
432 | txtHost.Text = txtPassword.Text = txtUsername.Text = "";
433 | // this is group
434 | // tvwNodeList.SelectedNode.Expand();
435 | }
436 | else
437 | {
438 | txtHost.Enabled = txtPassword.Enabled = txtUsername.Enabled = true;
439 |
440 | // MessageBox.Show($"{tvwNodeList.SelectedNode.Parent.Index},{tvwNodeList.SelectedNode.Index}");
441 |
442 | File.WriteAllText(PATH.CONFIG_SELECT_NODE,
443 | $@"{tvwNodeList.SelectedNode.Parent.Index},{tvwNodeList.SelectedNode.Index}");
444 | var x = ((string) tvwNodeList.SelectedNode.Tag).FromSharelink();
445 | if (!x.HasValue) return;
446 |
447 | txtName.Text = x.Value.Name;
448 | txtHost.Text = x.Value.Host;
449 | txtUsername.Text = x.Value.Username;
450 | txtPassword.Text = x.Value.Password;
451 | rdoHttps.Checked = x.Value.Scheme.Contains("https");
452 | rdoQuic.Checked = x.Value.Scheme.Contains("quic");
453 | }
454 | }
455 |
456 | private void btnAddNode_Click(object sender, EventArgs e)
457 | {
458 | if (tvwNodeList.SelectedNode == null) return;
459 | TreeNodeCollection tnc = tvwNodeList.SelectedNode.Level == 0
460 | ? tvwNodeList.SelectedNode.Nodes
461 | : tvwNodeList.SelectedNode.Parent.Nodes;
462 |
463 | tnc.Add(new TreeNode() {Text = @"default", Tag = "naive+https://default:default@default#default"});
464 | }
465 |
466 | private void lblAddGroup_Click(object sender, EventArgs e)
467 | {
468 | string group = "Default";
469 | if (tvwNodeList.Nodes.ContainsKey(group))
470 | {
471 | for (int loop = 0;; ++loop)
472 | {
473 | if (!tvwNodeList.Nodes.ContainsKey("Default" + loop.ToString()))
474 | {
475 | group = "Default" + loop.ToString();
476 | break;
477 | }
478 | }
479 | }
480 |
481 | tvwNodeList.Nodes.Add(group, group);
482 | }
483 |
484 | private void btnDel_Click(object sender, EventArgs e)
485 | {
486 | if (tvwNodeList.SelectedNode != null)
487 | {
488 | if (tvwNodeList.SelectedNode.Level == 0)
489 | {
490 | // this is group
491 | if (MessageBox.Show(
492 | Msg.ASK_GROUP_DELETE_CONFIRM,
493 | Msg.Title.WARNING,
494 | MessageBoxButtons.YesNo,
495 | MessageBoxIcon.Warning) == DialogResult.Yes)
496 | {
497 | tvwNodeList.SelectedNode.Remove();
498 | }
499 | }
500 | else
501 | {
502 | tvwNodeList.SelectedNode.Remove();
503 | }
504 | }
505 |
506 | tvwNodeList.Enabled = true;
507 | }
508 |
509 | private void btnQR_Click(object sender, EventArgs e)
510 | {
511 | new Qr(Sharelink.Generate()).ShowDialog();
512 | }
513 |
514 | private void smiAdvance_Click(object sender, EventArgs e)
515 | {
516 | new AdvanceWindow().ShowDialog();
517 | }
518 | }
519 | }
--------------------------------------------------------------------------------
/NaiveSharp/View/MainWindowsEx.cs:
--------------------------------------------------------------------------------
1 | using NaiveSharp.ConstText;
2 | using NaiveSharp.Controller;
3 | using NaiveSharp.Model;
4 | using System;
5 | using System.Diagnostics;
6 | using System.IO;
7 | using System.Windows.Forms;
8 |
9 | namespace NaiveSharp.View
10 | {
11 | public partial class MainWindow
12 | {
13 | #region sync
14 |
15 | enum SyncMode
16 | {
17 | RadioToTsm,
18 | TsmToRadio
19 | }
20 |
21 | private void SyncRunModeToView(SyncMode mode = SyncMode.TsmToRadio)
22 | {
23 | bool global = false, geoip = false, gfwlist = false, none = false;
24 | switch (Config.RunMode.ToLower())
25 | {
26 | case "gfwlist":
27 | gfwlist = true;
28 | break;
29 | case "global":
30 | global = true;
31 | break;
32 | case "geoip":
33 | geoip = true;
34 | break;
35 | case "none":
36 | none = true;
37 | break;
38 | }
39 |
40 | switch (mode)
41 | {
42 | case SyncMode.TsmToRadio:
43 | tsmGlobal.Checked = rdoGlobal.Checked = global;
44 | tsmGeoIP.Checked = rdoGeoIP.Checked = geoip;
45 | tsmGFWList.Checked = rdoGfwlist.Checked = gfwlist;
46 | tsmNone.Checked = rdoNone.Checked = none;
47 | break;
48 | case SyncMode.RadioToTsm:
49 | tsmGlobal.Checked = global;
50 | tsmGeoIP.Checked = geoip;
51 | tsmGFWList.Checked = gfwlist;
52 | tsmNone.Checked = none;
53 | break;
54 | }
55 | }
56 |
57 | #endregion
58 |
59 | private DialogResult CheckPortStatus()
60 | {
61 | /*
62 | * 0 -> Ok
63 | * 1 -> 1080
64 | * 2 -> 1081
65 | * 3 -> 1080 & 1081
66 | */
67 | int status = 0;
68 |
69 | if (Net.IsPortUsed(1080))
70 | {
71 | status = 1;
72 | }
73 |
74 | if (Net.IsPortUsed(1081))
75 | {
76 | if (status == 1)
77 | {
78 | status = 3;
79 | }
80 | else
81 | {
82 | status = 2;
83 | }
84 | }
85 |
86 | var result = status switch
87 | {
88 | 1 => MessageBox.Show(
89 | "Port 1080 is in used! NaiveProxy may not work normally!\n" + "Do you still want to continue?",
90 | Msg.Title.WARNING, MessageBoxButtons.YesNo, MessageBoxIcon.Warning),
91 | 2 => MessageBox.Show(
92 | "Port 1081 is in used! HTTP proxy and padding may not work normally!\n" +
93 | "Do you still want to continue?", Msg.Title.WARNING, MessageBoxButtons.YesNo,
94 | MessageBoxIcon.Warning),
95 | 3 => MessageBox.Show(
96 | "Port 1080 is in used! NaiveProxy may not work normally!\n" +
97 | "Port 1081 is in used! HTTP proxy and padding may not work normally!\n" +
98 | "Do you still want to continue?", Msg.Title.WARNING, MessageBoxButtons.YesNo,
99 | MessageBoxIcon.Warning),
100 | _ => DialogResult.OK
101 | };
102 |
103 | return result;
104 | }
105 |
106 | private void SetSelecteNode(int groupIndex, int? nodeIndex)
107 | {
108 | try
109 | {
110 | if (nodeIndex.HasValue)
111 | {
112 | tvwNodeList.SelectedNode = tvwNodeList.Nodes[groupIndex].Nodes[nodeIndex.Value];
113 | }
114 | else
115 | {
116 | tvwNodeList.SelectedNode = tvwNodeList.Nodes[groupIndex];
117 | }
118 | }
119 | catch (NullReferenceException)
120 | {
121 | Debug.WriteLine($"Set select node failed -> [{groupIndex}][{nodeIndex}]");
122 | }
123 | catch
124 | {
125 | // ignored
126 | }
127 | }
128 |
129 | private void SetSelecteNode(int groupIndex)
130 | {
131 | try
132 | {
133 | tvwNodeList.SelectedNode = tvwNodeList.Nodes[groupIndex];
134 | }
135 | catch (NullReferenceException)
136 | {
137 | Debug.WriteLine($"Set select node failed -> [{groupIndex}]");
138 | }
139 | }
140 |
141 | private void LoadFromNodeListFile()
142 | {
143 | if (!File.Exists(PATH.CONFIG_NODELIST))
144 | {
145 | File.Create(PATH.CONFIG_NODELIST).Close();
146 | File.WriteAllText(PATH.CONFIG_NODELIST, @"[Default]");
147 | LoadFromNodeListFile();
148 | }
149 | else
150 | {
151 | NodeList.LoadFromStringArray(ref tvwNodeList, File.ReadAllLines(PATH.CONFIG_NODELIST));
152 | }
153 | }
154 |
155 | private void SyncToTag()
156 | {
157 | if (tvwNodeList.SelectedNode != null)
158 | {
159 | tvwNodeList.SelectedNode.Tag = Sharelink.Generate();
160 | }
161 | }
162 |
163 | private static string LoadModeConfig()
164 | {
165 | var d = KvpHelper.FromFile(PATH.CONFIG_INI);
166 | if (d.ContainsKey("mode"))
167 | {
168 | // MessageBox.Show(d["mode"].ToLower().Trim());
169 | switch (d["mode"].ToLower().Trim())
170 | {
171 | case "none":
172 | case "gfwlist":
173 | case "global":
174 | case "geoip":
175 | return d["mode"].ToLower();
176 | }
177 | }
178 |
179 | return "global";
180 | }
181 |
182 | private void CheckPath()
183 | {
184 | CheckDirectory(PATH.CONFIG);
185 | }
186 |
187 | private void CheckDirectory(string path)
188 | {
189 | if (!Directory.Exists(path))
190 | {
191 | Directory.CreateDirectory(path);
192 | }
193 | }
194 | }
195 | }
--------------------------------------------------------------------------------
/NaiveSharp/View/Qr.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace NaiveSharp.View
2 | {
3 | partial class Qr
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Qr));
32 | this.qrcQrImg = new Gma.QrCodeNet.Encoding.Windows.Forms.QrCodeGraphicControl();
33 | this.btnOK = new System.Windows.Forms.Button();
34 | this.txtSharelink = new System.Windows.Forms.TextBox();
35 | this.SuspendLayout();
36 | //
37 | // qrcQrImg
38 | //
39 | this.qrcQrImg.ErrorCorrectLevel = Gma.QrCodeNet.Encoding.ErrorCorrectionLevel.M;
40 | this.qrcQrImg.Location = new System.Drawing.Point(11, 14);
41 | this.qrcQrImg.Name = "qrcQrImg";
42 | this.qrcQrImg.QuietZoneModule = Gma.QrCodeNet.Encoding.Windows.Render.QuietZoneModules.Two;
43 | this.qrcQrImg.Size = new System.Drawing.Size(280, 280);
44 | this.qrcQrImg.TabIndex = 0;
45 | this.qrcQrImg.Text = "qrCodeGraphicControl1";
46 | //
47 | // btnOK
48 | //
49 | this.btnOK.Location = new System.Drawing.Point(186, 331);
50 | this.btnOK.Name = "btnOK";
51 | this.btnOK.Size = new System.Drawing.Size(79, 42);
52 | this.btnOK.TabIndex = 1;
53 | this.btnOK.Text = "OK";
54 | this.btnOK.UseVisualStyleBackColor = true;
55 | this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
56 | //
57 | // txtSharelink
58 | //
59 | this.txtSharelink.Location = new System.Drawing.Point(38, 300);
60 | this.txtSharelink.Name = "txtSharelink";
61 | this.txtSharelink.ReadOnly = true;
62 | this.txtSharelink.Size = new System.Drawing.Size(227, 25);
63 | this.txtSharelink.TabIndex = 2;
64 | this.txtSharelink.MouseUp += new System.Windows.Forms.MouseEventHandler(this.txtSharelink_MouseUp);
65 | //
66 | // Qr
67 | //
68 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
69 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
70 | this.BackColor = System.Drawing.SystemColors.Window;
71 | this.ClientSize = new System.Drawing.Size(304, 395);
72 | this.Controls.Add(this.txtSharelink);
73 | this.Controls.Add(this.btnOK);
74 | this.Controls.Add(this.qrcQrImg);
75 | this.Font = new System.Drawing.Font("Segoe UI", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
76 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
77 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
78 | this.MaximizeBox = false;
79 | this.MinimizeBox = false;
80 | this.Name = "Qr";
81 | this.Text = "QR Code";
82 | this.Load += new System.EventHandler(this.Qr_Load);
83 | this.ResumeLayout(false);
84 | this.PerformLayout();
85 |
86 | }
87 |
88 | #endregion
89 |
90 | private Gma.QrCodeNet.Encoding.Windows.Forms.QrCodeGraphicControl qrcQrImg;
91 | private System.Windows.Forms.Button btnOK;
92 | private System.Windows.Forms.TextBox txtSharelink;
93 | }
94 | }
--------------------------------------------------------------------------------
/NaiveSharp/View/Qr.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 |
5 | namespace NaiveSharp.View
6 | {
7 | public partial class Qr : Form
8 | {
9 | public Qr(string sharelink)
10 | {
11 | InitializeComponent();
12 |
13 | txtSharelink.Text = qrcQrImg.Text = sharelink;
14 | }
15 |
16 | private void Qr_Load(object sender, EventArgs e)
17 | {
18 |
19 | }
20 |
21 | private void btnOK_Click(object sender, EventArgs e)
22 | {
23 | this.Close();
24 | }
25 |
26 | private void txtSharelink_MouseUp(object sender, MouseEventArgs e)
27 | {
28 | if (e.Button == MouseButtons.Left)
29 | {
30 | ((TextBox)sender).SelectAll();
31 | }
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/NaiveSharp/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | true/PM
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/NaiveSharp/ns.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/NaiveSharp/9c7742b6d54811cde965e5ae2f207cfc0178fb83/NaiveSharp/ns.ico
--------------------------------------------------------------------------------
/NaiveSharp/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Naive \#
4 |
5 | [](https://ci.appveyor.com/project/KevinZonda/naivesharp/branch/master)
6 | [](https://www.gnu.org/licenses/gpl-3.0)
7 | 
8 | [](https://t.me/ohtcs)
9 | 
10 | 
11 | [](https://git.io/JfJiO)
12 |
13 | **THIS PROJECT IS UNDER DEVELOPING**
14 |
15 | A NaiveProxy Windows Client
16 |
17 | ## Screenshots
18 |
19 | ### 0.6.5 Preview
20 |
21 | 
22 | 
23 |
24 | ### 0.6 Preview
25 |
26 | 
27 |
28 | ### 0.5 Preview
29 |
30 | 
31 | 
32 | 
33 |
34 | ### 0.1 Preview
35 |
36 | 
37 |
38 | ## TODO
39 |
40 | - [x] base framework
41 | - [x] bypass
42 | - [x] node tree
43 |
44 | ## About Sharelink
45 |
46 | At present, [@klzgrad](https://github.com/klzgrad) haven't given an official URI specification. But we need this future, for compatibility, NaiveSharp uses the same specification with [QvPlugin-NaiveProxy](https://github.com/Qv2ray/QvPlugin-NaiveProxy).
47 |
48 | It looks like
49 |
50 | ```
51 | naive+https://what:happened@test.someone.cf?padding=false#Naive!
52 | naive+https://some.public.rs?padding=true#Public-01
53 | naive+quic://manhole:114514@quic.test.me
54 | ```
55 |
56 | You can get more information from [here](https://gist.github.com/DuckSoft/ca03913b0a26fc77a1da4d01cc6ab2f1).
57 |
58 | Thanks [@DuckSoft](https://github.com/DuckSoft) provides this specification. If [@klzgrad](https://github.com/klzgrad) provides specification, I will support it too.
59 |
60 | ## Credit
61 |
62 | - [Igniter](https://github.com/trojan-gfw/igniter)
63 |
64 | ```credit
65 | Version: 0.9.3-beta
66 | License: GPLv3
67 | ```
68 |
69 | - [Privoxy](https://www.privoxy.org/)
70 |
71 | ```credit
72 | Version: 3.0.28.0
73 | License: GPLv2
74 | ```
75 |
76 | - [Clash](https://github.com/Dreamacro/clash)
77 |
78 | ```credit
79 | Version: 0.18.0
80 | License: GPLv3
81 | ```
82 |
83 | ## Open-Sourced License - [GNU General Public License v3.0](LICENSE)
84 |
85 | ```license
86 | GNU GENERAL PUBLIC LICENSE
87 | Version 3, 29 June 2007
88 |
89 | Copyright (C) 2007 Free Software Foundation, Inc.
90 | Everyone is permitted to copy and distribute verbatim copies
91 | of this license document, but changing it is not allowed.
92 | ```
93 |
94 | -----
95 | Proudly build with ❤️ & .NET Framework 4.7.2
96 |
--------------------------------------------------------------------------------
/Screenshots/NaiveSharp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/NaiveSharp/9c7742b6d54811cde965e5ae2f207cfc0178fb83/Screenshots/NaiveSharp.png
--------------------------------------------------------------------------------
/Screenshots/ns01prev.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/NaiveSharp/9c7742b6d54811cde965e5ae2f207cfc0178fb83/Screenshots/ns01prev.jpg
--------------------------------------------------------------------------------
/Screenshots/ns05prev-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/NaiveSharp/9c7742b6d54811cde965e5ae2f207cfc0178fb83/Screenshots/ns05prev-1.png
--------------------------------------------------------------------------------
/Screenshots/ns05prev-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/NaiveSharp/9c7742b6d54811cde965e5ae2f207cfc0178fb83/Screenshots/ns05prev-2.png
--------------------------------------------------------------------------------
/Screenshots/ns05prev.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/NaiveSharp/9c7742b6d54811cde965e5ae2f207cfc0178fb83/Screenshots/ns05prev.png
--------------------------------------------------------------------------------
/Screenshots/ns065prev-0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/NaiveSharp/9c7742b6d54811cde965e5ae2f207cfc0178fb83/Screenshots/ns065prev-0.png
--------------------------------------------------------------------------------
/Screenshots/ns065prev-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/NaiveSharp/9c7742b6d54811cde965e5ae2f207cfc0178fb83/Screenshots/ns065prev-1.png
--------------------------------------------------------------------------------
/Screenshots/ns06prev.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KevinSHIT/NaiveSharp/9c7742b6d54811cde965e5ae2f207cfc0178fb83/Screenshots/ns06prev.png
--------------------------------------------------------------------------------