├── requirements_unfrozen.txt ├── main.ico ├── requirements.txt ├── web └── dwt-screenshot.png ├── .vscode └── settings.json ├── .github └── ISSUE_TEMPLATE.md ├── .gitignore ├── README.md ├── COPYING.LESSER ├── dwt_about.py ├── dwt_util.py ├── dwt.py └── COPYING /requirements_unfrozen.txt: -------------------------------------------------------------------------------- 1 | pypiwin32 2 | six 3 | wxpython -------------------------------------------------------------------------------- /main.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitlog2/DisableWinTracking/HEAD/main.ico -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitlog2/DisableWinTracking/HEAD/requirements.txt -------------------------------------------------------------------------------- /web/dwt-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bitlog2/DisableWinTracking/HEAD/web/dwt-screenshot.png -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "python.formatting.provider": "black", 3 | "[markdown]": { 4 | "editor.formatOnSave": false 5 | } 6 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **INFORMATION:** 2 | 3 | * Windows Edition (Home/Pro/Enterprise): 4 | * Architecture (32bit/64bit): 5 | * Options used: 6 | 7 | **LOG:** 8 | 9 | ```python 10 | REPLACE THIS WITH DWT.LOG 11 | ``` 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Pycharm 2 | .idea/ 3 | 4 | # Python stuff 5 | *.py[cod] 6 | env 7 | 8 | # Pyinstaller 9 | build/ 10 | dist/ 11 | *.spec 12 | public/ 13 | 14 | #Sublime Stuff 15 | *.sublime-project 16 | *.sublime-workspace 17 | 18 | # Log 19 | dwt.log 20 | 21 | # Resource files 22 | dwticon.res 23 | 24 | # Other 25 | getapps.py 26 | getreleases.py 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # This repository is a living fork of the last stable release of [DisableWinTracking](https://github.com/10se1ucgo/DisableWinTracking) 2 | [DisableWinTracking](https://github.com/10se1ucgo/DisableWinTracking) was archived on 12/2020, and had it's last release on 01/2019 3 | We don't want the goodness to die, so we forked DWT! 4 | Please help us fix bugs and improve this software! We can't do it without you! 5 | See [Changes in this fork](#changes-in-this-fork) for an overview of what we've changed. 6 | 7 | # -------------------------- 8 | 9 | # DisableWinTracking 10 | 11 | A tool that I created to use some of the known methods of disabling tracking in Windows 10. 12 | 13 | 14 | 15 | ![screenshot](web/dwt-screenshot.png) 16 | 17 | ## CYRILLIC LANGUAGES WARNING 18 | 19 | ## ПРЕДУПРЕЖДЕНИЕ ДЛЯ КИРИЛЛИЧЕСКИХ ЯЗЫКОВ 20 | 21 | **Slavic languages: Belarusian, Bulgarian, Macedonian, Russian, Rusyn, Serbo-Croatian (for Standard Serbian, Bosnian, and Montenegrin), Ukrainian.** 22 | 23 | **Славянские языки: белорусский, болгарский, македонский, русский, русинский, сербохорватский (для стандартного сербского, боснийского и черногорского), украинский.** 24 | 25 | This program cannot run correctly from a file path that contains Cyrillic characters. Make sure to run it from your root folder (usually C:/ ) so that you don't get runtime errors. 26 | 27 | Эта программа не может работать корректно, если в пути к файлу есть кириллические символы. Обязательно запустите его из корневой папки ( обычно C:/ ), чтобы вы не получали ошибок во время выполнения. 28 | 29 | ## DOWNLOAD 30 | 31 | [DOWNLOAD EXE HERE](https://github.com/bitlog2/DisableWinTracking/releases/) 32 | 33 | **Note:** Windows Defender may report the EXE as a trojan (Win32/Pocyx.C!cl), and may therefore prevent you from extracting the EXE to anywhere on your computer. Set up an exclusion in **Settings > Update & Security > Windows Defender > Exclusions** by adding the folder you intend to extract the EXE to. 34 | 35 | ## How to Use 36 | 37 | You can either: 38 | 39 | A. [Run the binary uploaded to the Release tab as an Administrator and select which options you'd like](https://github.com/bitlog2/DisableWinTracking/releases/) 40 | 41 | B. Install Python and the dependencies listed below and run the script from an elevated command prompt and select which options you'd like 42 | 43 | #### Silent 44 | 45 | Either can be run with the -silent argument as of v3.1. This will perform all available options of the version you're using. 46 | 47 | **You still need to run it as administrator.** 48 | 49 | ## Dependencies 50 | This is only to run the script from source, [download the exe here](https://github.com/bitlog2/DisableWinTracking/releases/) 51 | * Tested on Python 3.7.2 since DisableWinTracking 3.2.4 (commit [9f1d2aa](https://github.com/bitlog2/DisableWinTracking/commit/9f1d2aa58cec76306c3dc6887e7c9c92769936fe)) 52 | * [wxPython](http://wxpython.org/download.php) 53 | * [PyWin32](http://sourceforge.net/projects/pywin32/files/pywin32/) 54 | * Windows 10 (Duh) 55 | 56 | ## Methods Used 57 | 58 | #### Telemetry 59 | 60 | Set the `AllowTelemetry` string in `HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection` to `0` 61 | 62 | #### DiagTrack Log 63 | 64 | Clears and disables writing to the log located in `C:\ProgramData\Microsoft\Diagnosis\ETLLogs\AutoLogger` 65 | 66 | #### Services 67 | 68 | You can delete or disable the 2 services below: 69 | * `DiagTrack` (aka. Connected User Experiences and Telemetry) Diagnostics Tracking Service 70 | * `dmwappushsvc` WAP Push Message Routing Service 71 | 72 | Action: 73 | * Delete: Remove both services 74 | * Disable: Set the `Start` registry key for both services to `4` (Disabled) Located at `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\` 75 | 76 | #### HOSTS 77 | 78 | Append known tracking domains to the `HOSTS` file located in `C:\Windows\System32\drivers\etc` 79 | 80 | #### IP Blocking 81 | 82 | Blocks known tracking IPs with the Windows Firewall. The rules are named TrackingIPX, replacing X with the IP numbers. 83 | 84 | #### Windows Defender 85 | 86 | Disables the following: 87 | - Automatic Sample Submission 88 | - Delivery Optimization Download Mode 89 | 90 | #### WifiSense 91 | Disables the following: 92 | - Credential Share 93 | - Open-ness 94 | 95 | #### OneDrive 96 | 97 | Runs `C:\Windows\SysWOW64\OneDriveSetup.exe /uninstall` (64 bit) or 98 | `C:\Windows\System32\OneDriveSetup.exe /uninstall` (32 bit) 99 | 100 | Also disables registry entries that keep the OneDrive Icon pinned to your Windows Explorer list: 101 | ![OneDrive Example Image](http://i.imgur.com/26yfnGD.png) 102 | 103 | #### Xbox DVR 104 | 105 | Action: 106 | * Disable: Set the `GameDVR_Enabled` registry key for both services to `0` (Disabled) Located at `HKEY_CURRENT_USER\System\GameConfigStore` 107 | * Disable: Set the `AllowGameDVR` registry key for both services to `0` (Disabled) Located at `HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR` 108 | 109 | This action requires reboot computer for completely applying. 110 | 111 | ## Delete Services vs Disable Services? 112 | 113 | Selecting "Disable" will simply stop the services from being able to run. 114 | Selecting the "Delete" choice will completely delete the tracking services. 115 | 116 | ## Changes in this fork 117 | This fork changes a few things from the original [DisableWinTracking](https://github.com/10se1ucgo/DisableWinTracking) 118 | 119 | - Fixes Windows 10 Network Connectivity Status Indicator (NCSI). No longer adds these hosts file entries:
120 | 0.0.0.0 msftncsi.com
121 | 0.0.0.0 www.msftncsi.com
122 | If your Windows 10 NCSI is broken, we recommend you edit C:\Windows\System32\drivers\etc\hosts and remove any lines containing the text "msftncsi", then save the file. That should fix the issue for you. 123 | - Upgraded from Python 2.7 to 3.9 124 | 125 | ## License 126 | 127 | ``` 128 | Copyright (C) 10se1ucgo 2016 129 | 130 | This program is free software: you can redistribute it and/or modify 131 | it under the terms of the GNU General Public License as published by 132 | the Free Software Foundation, either version 3 of the License, or 133 | (at your option) any later version. 134 | 135 | This program is distributed in the hope that it will be useful, 136 | but WITHOUT ANY WARRANTY; without even the implied warranty of 137 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 138 | GNU General Public License for more details. 139 | 140 | You should have received a copy of the GNU General Public License 141 | along with this program. If not, see . 142 | ``` 143 | -------------------------------------------------------------------------------- /COPYING.LESSER: -------------------------------------------------------------------------------- 1 | GNU LESSER 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 | 9 | This version of the GNU Lesser General Public License incorporates 10 | the terms and conditions of version 3 of the GNU General Public 11 | License, supplemented by the additional permissions listed below. 12 | 13 | 0. Additional Definitions. 14 | 15 | As used herein, "this License" refers to version 3 of the GNU Lesser 16 | General Public License, and the "GNU GPL" refers to version 3 of the GNU 17 | General Public License. 18 | 19 | "The Library" refers to a covered work governed by this License, 20 | other than an Application or a Combined Work as defined below. 21 | 22 | An "Application" is any work that makes use of an interface provided 23 | by the Library, but which is not otherwise based on the Library. 24 | Defining a subclass of a class defined by the Library is deemed a mode 25 | of using an interface provided by the Library. 26 | 27 | A "Combined Work" is a work produced by combining or linking an 28 | Application with the Library. The particular version of the Library 29 | with which the Combined Work was made is also called the "Linked 30 | Version". 31 | 32 | The "Minimal Corresponding Source" for a Combined Work means the 33 | Corresponding Source for the Combined Work, excluding any source code 34 | for portions of the Combined Work that, considered in isolation, are 35 | based on the Application, and not on the Linked Version. 36 | 37 | The "Corresponding Application Code" for a Combined Work means the 38 | object code and/or source code for the Application, including any data 39 | and utility programs needed for reproducing the Combined Work from the 40 | Application, but excluding the System Libraries of the Combined Work. 41 | 42 | 1. Exception to Section 3 of the GNU GPL. 43 | 44 | You may convey a covered work under sections 3 and 4 of this License 45 | without being bound by section 3 of the GNU GPL. 46 | 47 | 2. Conveying Modified Versions. 48 | 49 | If you modify a copy of the Library, and, in your modifications, a 50 | facility refers to a function or data to be supplied by an Application 51 | that uses the facility (other than as an argument passed when the 52 | facility is invoked), then you may convey a copy of the modified 53 | version: 54 | 55 | a) under this License, provided that you make a good faith effort to 56 | ensure that, in the event an Application does not supply the 57 | function or data, the facility still operates, and performs 58 | whatever part of its purpose remains meaningful, or 59 | 60 | b) under the GNU GPL, with none of the additional permissions of 61 | this License applicable to that copy. 62 | 63 | 3. Object Code Incorporating Material from Library Header Files. 64 | 65 | The object code form of an Application may incorporate material from 66 | a header file that is part of the Library. You may convey such object 67 | code under terms of your choice, provided that, if the incorporated 68 | material is not limited to numerical parameters, data structure 69 | layouts and accessors, or small macros, inline functions and templates 70 | (ten or fewer lines in length), you do both of the following: 71 | 72 | a) Give prominent notice with each copy of the object code that the 73 | Library is used in it and that the Library and its use are 74 | covered by this License. 75 | 76 | b) Accompany the object code with a copy of the GNU GPL and this license 77 | document. 78 | 79 | 4. Combined Works. 80 | 81 | You may convey a Combined Work under terms of your choice that, 82 | taken together, effectively do not restrict modification of the 83 | portions of the Library contained in the Combined Work and reverse 84 | engineering for debugging such modifications, if you also do each of 85 | the following: 86 | 87 | a) Give prominent notice with each copy of the Combined Work that 88 | the Library is used in it and that the Library and its use are 89 | covered by this License. 90 | 91 | b) Accompany the Combined Work with a copy of the GNU GPL and this license 92 | document. 93 | 94 | c) For a Combined Work that displays copyright notices during 95 | execution, include the copyright notice for the Library among 96 | these notices, as well as a reference directing the user to the 97 | copies of the GNU GPL and this license document. 98 | 99 | d) Do one of the following: 100 | 101 | 0) Convey the Minimal Corresponding Source under the terms of this 102 | License, and the Corresponding Application Code in a form 103 | suitable for, and under terms that permit, the user to 104 | recombine or relink the Application with a modified version of 105 | the Linked Version to produce a modified Combined Work, in the 106 | manner specified by section 6 of the GNU GPL for conveying 107 | Corresponding Source. 108 | 109 | 1) Use a suitable shared library mechanism for linking with the 110 | Library. A suitable mechanism is one that (a) uses at run time 111 | a copy of the Library already present on the user's computer 112 | system, and (b) will operate properly with a modified version 113 | of the Library that is interface-compatible with the Linked 114 | Version. 115 | 116 | e) Provide Installation Information, but only if you would otherwise 117 | be required to provide such information under section 6 of the 118 | GNU GPL, and only to the extent that such information is 119 | necessary to install and execute a modified version of the 120 | Combined Work produced by recombining or relinking the 121 | Application with a modified version of the Linked Version. (If 122 | you use option 4d0, the Installation Information must accompany 123 | the Minimal Corresponding Source and Corresponding Application 124 | Code. If you use option 4d1, you must provide the Installation 125 | Information in the manner specified by section 6 of the GNU GPL 126 | for conveying Corresponding Source.) 127 | 128 | 5. Combined Libraries. 129 | 130 | You may place library facilities that are a work based on the 131 | Library side by side in a single library together with other library 132 | facilities that are not Applications and are not covered by this 133 | License, and convey such a combined library under terms of your 134 | choice, if you do both of the following: 135 | 136 | a) Accompany the combined library with a copy of the same work based 137 | on the Library, uncombined with any other library facilities, 138 | conveyed under the terms of this License. 139 | 140 | b) Give prominent notice with the combined library that part of it 141 | is a work based on the Library, and explaining where to find the 142 | accompanying uncombined form of the same work. 143 | 144 | 6. Revised Versions of the GNU Lesser General Public License. 145 | 146 | The Free Software Foundation may publish revised and/or new versions 147 | of the GNU Lesser General Public License from time to time. Such new 148 | versions will be similar in spirit to the present version, but may 149 | differ in detail to address new problems or concerns. 150 | 151 | Each version is given a distinguishing version number. If the 152 | Library as you received it specifies that a certain numbered version 153 | of the GNU Lesser General Public License "or any later version" 154 | applies to it, you have the option of following the terms and 155 | conditions either of that published version or of any later version 156 | published by the Free Software Foundation. If the Library as you 157 | received it does not specify a version number of the GNU Lesser 158 | General Public License, you may choose any version of the GNU Lesser 159 | General Public License ever published by the Free Software Foundation. 160 | 161 | If the Library as you received it specifies that a proxy can decide 162 | whether future versions of the GNU Lesser General Public License shall 163 | apply, that proxy's public statement of acceptance of any version is 164 | permanent authorization for you to choose that version for the 165 | Library. -------------------------------------------------------------------------------- /dwt_about.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 10se1ucgo 2015-2016 2 | # 3 | # This file is part of DisableWinTracking. 4 | # 5 | # DisableWinTracking is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # DisableWinTracking is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with DisableWinTracking. If not, see . 17 | 18 | # dwt.py will become cluttered enough :^) 19 | import datetime 20 | import cgi 21 | import json 22 | from six.moves.urllib.request import urlopen 23 | from six.moves.urllib.error import URLError 24 | import webbrowser 25 | from distutils.version import StrictVersion 26 | 27 | import wx 28 | import wx.adv 29 | import wx.lib.scrolledpanel as sp 30 | 31 | __version__ = "3.2.6" 32 | year = datetime.date.today().year 33 | 34 | 35 | def about_dialog(parent): 36 | license_text = """ 37 | Copyright (C) 10se1ucgo 2015-{year} 38 | 39 | This program is free software: you can redistribute it and/or modify 40 | it under the terms of the GNU General Public License as published by 41 | the Free Software Foundation, either version 3 of the License, or 42 | (at your option) any later version. 43 | 44 | This program is distributed in the hope that it will be useful, 45 | but WITHOUT ANY WARRANTY; without even the implied warranty of 46 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 47 | GNU General Public License for more details. 48 | 49 | You should have received a copy of the GNU General Public License 50 | along with this program. If not, see .""".format( 51 | year=year 52 | ) 53 | 54 | about_info = wx.adv.AboutDialogInfo() 55 | about_info.SetName("Disable Windows 10 Tracking") 56 | about_info.SetVersion("v{v}".format(v=__version__)) 57 | about_info.SetCopyright("Copyright (C) 10se1ucgo 2015-{year}".format(year=year)) 58 | about_info.SetDescription("A tool to disable tracking in Windows 10") 59 | about_info.SetWebSite( 60 | "https://github.com/bitlog2/DisableWinTracking", "GitHub repository" 61 | ) 62 | about_info.AddDeveloper("10se1ucgo") 63 | about_info.AddDeveloper("Ruined1") 64 | about_info.SetLicense(license_text) 65 | wx.adv.AboutBox(about_info, parent) 66 | 67 | 68 | class Licenses(wx.Dialog): 69 | def __init__(self, parent): 70 | super(Licenses, self).__init__( 71 | parent, title="Licenses", style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER 72 | ) 73 | 74 | self.scrolled_panel = sp.ScrolledPanel(self) 75 | 76 | mono_font = wx.Font() 77 | mono_font.SetFamily(wx.FONTFAMILY_TELETYPE) 78 | 79 | info = wx.StaticText( 80 | self.scrolled_panel, 81 | label=( 82 | "DisableWinTracking uses a number of open source software." 83 | "The following are the licenses for these software." 84 | ), 85 | ) 86 | 87 | wxw = wx.StaticText( 88 | self.scrolled_panel, 89 | label=( 90 | "DisableWinTracking uses wxWidgets and wxPython. Their license " 91 | "is below\nMore info at https://www.wxwidgets.org/about/" 92 | ), 93 | ) 94 | wxw_license = """ 95 | wxWindows Library License, Version 3.1 96 | ====================================== 97 | Copyright (c) 1998-2005 Julian Smart, Robert Roebling et al 98 | Everyone is permitted to copy and distribute verbatim copies 99 | of this license document, but changing it is not allowed. 100 | WXWINDOWS LIBRARY LICENSE 101 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 102 | This library is free software; you can redistribute it and/or modify it 103 | under the terms of the GNU Library General Public License as published by 104 | the Free Software Foundation; either version 2 of the License, or (at your 105 | option) any later version. 106 | This library is distributed in the hope that it will be useful, but WITHOUT 107 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 108 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 109 | License for more details. 110 | You should have received a copy of the GNU Library General Public License 111 | along with this software, usually in a file named COPYING.LIB. If not, 112 | write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth 113 | Floor, Boston, MA 02110-1301 USA. 114 | EXCEPTION NOTICE 115 | 1. As a special exception, the copyright holders of this library give 116 | permission for additional uses of the text contained in this release of the 117 | library as licensed under the wxWindows Library License, applying either 118 | version 3.1 of the License, or (at your option) any later version of the 119 | License as published by the copyright holders of version 3.1 of the License 120 | document. 121 | 2. The exception is that you may use, copy, link, modify and distribute 122 | under your own terms, binary object code versions of works based on the 123 | Library. 124 | 3. If you copy code from files distributed under the terms of the GNU 125 | General Public License or the GNU Library General Public License into a 126 | copy of this library, as this license permits, the exception does not apply 127 | to the code that you add in this way. To avoid misleading anyone as to the 128 | status of such modified files, you must delete this exception notice from 129 | such code and/or adjust the licensing conditions notice accordingly. 130 | 4. If you write modifications of your own for this library, it is your 131 | choice whether to permit this exception to apply to your modifications. If 132 | you do not wish that, you must delete the exception notice from such code 133 | and/or adjust the licensing conditions notice accordingly.""" 134 | wxw_text = wx.StaticText(self.scrolled_panel, label=wxw_license) 135 | wxw_text.SetFont(mono_font) 136 | 137 | pywin = wx.StaticText( 138 | self.scrolled_panel, 139 | label="DisableWinTracking uses PyWin32. Its license is below.", 140 | ) 141 | pywin_license = """ 142 | Unless stated in the specific source file, this work is 143 | Copyright (c) 1996-2008, Greg Stein and Mark Hammond. 144 | All rights reserved. 145 | 146 | Redistribution and use in source and binary forms, with or without 147 | modification, are permitted provided that the following conditions 148 | are met: 149 | 150 | Redistributions of source code must retain the above copyright notice, 151 | this list of conditions and the following disclaimer. 152 | 153 | Redistributions in binary form must reproduce the above copyright 154 | notice, this list of conditions and the following disclaimer in 155 | the documentation and/or other materials provided with the distribution. 156 | 157 | Neither names of Greg Stein, Mark Hammond nor the name of contributors may be used 158 | to endorse or promote products derived from this software without 159 | specific prior written permission. 160 | 161 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS 162 | IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 163 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 164 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR 165 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 166 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 167 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 168 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 169 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 170 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 171 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.""" 172 | pywin_text = wx.StaticText(self.scrolled_panel, label=pywin_license) 173 | pywin_text.SetFont(mono_font) 174 | 175 | self.top_sizer = wx.BoxSizer(wx.VERTICAL) 176 | self.scroll_sizer = wx.BoxSizer(wx.VERTICAL) 177 | 178 | self.scroll_sizer.Add(info, 0, wx.ALL, 2) 179 | self.scroll_sizer.Add(wxw, 0, wx.ALL, 2) 180 | self.scroll_sizer.Add(wxw_text, 0, wx.EXPAND | wx.ALL, 3) 181 | self.scroll_sizer.Add(pywin, 0, wx.ALL, 2) 182 | self.scroll_sizer.Add(pywin_text, 0, wx.EXPAND | wx.ALL, 3) 183 | self.top_sizer.Add(self.scrolled_panel, 1, wx.EXPAND) 184 | 185 | self.SetSizerAndFit(self.top_sizer) 186 | self.scrolled_panel.SetSizerAndFit(self.scroll_sizer) 187 | self.scrolled_panel.SetupScrolling() 188 | self.Show() 189 | 190 | 191 | def update_check(parent): 192 | try: 193 | r = urlopen( 194 | "https://api.github.com/repos/bitlog2/DisableWinTracking/releases/latest" 195 | ) 196 | except URLError: 197 | return 198 | value, parameters = cgi.parse_header(r.headers.get("Content-Type", "")) 199 | release = json.loads(r.read().decode(parameters.get("charset", "utf-8"))) 200 | if release["prerelease"]: 201 | return 202 | new = release["tag_name"] 203 | 204 | try: 205 | if StrictVersion(__version__) < StrictVersion(new.lstrip("v")): 206 | info = wx.MessageDialog( 207 | parent, 208 | message="DWT {v} is now available!\nGo to download page?".format(v=new), 209 | caption="DWT Update", 210 | style=wx.OK | wx.CANCEL | wx.ICON_INFORMATION, 211 | ) 212 | if info.ShowModal() == wx.ID_OK: 213 | webbrowser.open_new_tab(release["html_url"]) 214 | info.Destroy() 215 | except ValueError: 216 | return 217 | -------------------------------------------------------------------------------- /dwt_util.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 10se1ucgo 2015-2016 2 | # 3 | # This file is part of DisableWinTracking. 4 | # 5 | # DisableWinTracking is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # DisableWinTracking is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with DisableWinTracking. If not, see . 17 | import logging 18 | import os 19 | import platform 20 | from collections import OrderedDict 21 | import pywintypes 22 | import shutil 23 | import subprocess 24 | import tempfile 25 | from six.moves import winreg 26 | import shlex 27 | 28 | import win32serviceutil 29 | import winerror 30 | 31 | logger = logging.getLogger("dwt.util") 32 | 33 | 34 | class CalledProcessError(Exception): 35 | """This exception is raised by subprocess_handler() returns a non-zero exit status. 36 | It is a direct copy + paste backport from Python 3, as the Python 2 version does not 37 | include the "stderr" property. 38 | 39 | Original docstring: 40 | This exception is raised when a process run by check_call() or 41 | check_output() returns a non-zero exit status. 42 | The exit status will be stored in the returncode attribute; 43 | check_output() will also store the output in the output attribute. 44 | """ 45 | 46 | def __init__(self, returncode, cmd, output=None, stderr=None): 47 | self.returncode = returncode 48 | self.cmd = cmd 49 | self.output = output 50 | self.stderr = stderr 51 | 52 | def __str__(self): 53 | return "Command '%s' returned non-zero exit status %d" % ( 54 | self.cmd, 55 | self.returncode, 56 | ) 57 | 58 | @property 59 | def stdout(self): 60 | """Alias for output attribute, to match stderr""" 61 | return self.output 62 | 63 | @stdout.setter 64 | def stdout(self, value): 65 | # There's no obvious reason to set this, but allow it anyway so 66 | # .stdout is a transparent alias for .output 67 | self.output = value 68 | 69 | 70 | def is_64bit(): 71 | if os.name != "nt": 72 | logger.critical( 73 | "This was only meant to be run on Windows-based system. Specifically, Windows 10." 74 | ) 75 | os._exit(0) 76 | 77 | if os.environ["PROCESSOR_ARCHITECTURE"] == "AMD64" or os.environ["PROCESSOR_ARCHITEW6432"] == "AMD64": 78 | return True 79 | 80 | return False 81 | 82 | 83 | def ip_block(ip_list, undo): 84 | for ip in ip_list: 85 | cmd = 'netsh advfirewall firewall {act} rule name="TrackingIP-{ip}"'.format( 86 | act="delete" if undo else "add", ip=ip 87 | ) 88 | if not undo: 89 | cmd += ( 90 | ' dir=out protocol=any remoteip="{ip}" profile=any action=block'.format( 91 | ip=ip 92 | ) 93 | ) 94 | 95 | try: 96 | subprocess_handler(shlex.split(cmd)) 97 | logger.info( 98 | "IP Blocker: The IP {ip} was successfully {act}.".format( 99 | ip=ip, act="unblocked" if undo else "blocked" 100 | ) 101 | ) 102 | except CalledProcessError as e: 103 | logger.exception( 104 | "IP Blocker: Failed to {act} IP {ip}".format( 105 | act="unblock" if undo else "block", ip=ip 106 | ) 107 | ) 108 | logger.critical( 109 | "IP Blocker: Error output:\n" + e.stdout.decode("ascii", "replace") 110 | ) 111 | 112 | 113 | def clear_diagtrack(): 114 | file = os.path.join( 115 | os.environ["SYSTEMDRIVE"], 116 | ( 117 | "\\ProgramData\\Microsoft\\Diagnosis\\ETLLogs\\AutoLogger\\AutoLogger-Diagtrack-Listener.etl" 118 | ), 119 | ) 120 | 121 | cmds = [ 122 | "sc delete DiagTrack", 123 | "sc delete dmwappushservice", 124 | 'echo "" > "{file}"'.format(file=file), 125 | ] 126 | 127 | i = 0 128 | failed = False 129 | for cmd in cmds: 130 | i += 1 131 | service = cmd.split("sc delete ") 132 | 133 | output = subprocess_handler(cmd) 134 | if output[0] in [0, 1060, 1072]: 135 | if output[0] == 0: 136 | if len(service) > 1: 137 | logger.info( 138 | "DiagTrack: Successfully deleted service '{0}'".format( 139 | service[1] 140 | ) 141 | ) 142 | else: 143 | logger.info("DiagTrack: Successfully erased tracking log.") 144 | if output[0] == 1060: 145 | logger.info( 146 | "DiagTrack: {0} service doesn't exist. This is OK, you likely removed it already.".format( 147 | service[1] 148 | ) 149 | ) 150 | if output[0] == 1072: 151 | logger.info( 152 | "DiagTrack: {0} service marked for deletion. This is OK, make sure you reboot your machine!".format( 153 | service[1] 154 | ) 155 | ) 156 | 157 | logger.info("DiagTrack: Completed Part {0}/{1}".format(i, len(cmds))) 158 | else: 159 | logger.info("{0}".format(output[0])) 160 | failed = True 161 | logger.exception("DiagTrack: Failed Part {0}/{1}".format(i, len(cmds))) 162 | logger.critical( 163 | "DiagTrack: Error code: {0} - {1}".format(output[0], output[1]) 164 | ) 165 | 166 | if failed: 167 | logger.info("DiagTrack: Complete. Errors were recorded.") 168 | else: 169 | logger.info("DiagTrack: Completed successfully, without errors.") 170 | 171 | """ 172 | This is an ORDERED dictionary. It will always run in order, not subject to the devastation 173 | of a standard dictionary, so no worries. 174 | """ 175 | 176 | # temporarily removing this code in favor of something that actually works 177 | """ 178 | cmds = OrderedDict() 179 | cmds["takeown /f {0}".format(file)]="Take Ownership" 180 | cmds["icacls {0} /grant administrators:F".format(file)]="Grant Admin Privilege" 181 | cmds["icacls {0} /inheritance:r /deny SYSTEM:F /grant Administrators:F".format(file)]="Deny System Privilege" 182 | 183 | i = 0 184 | 185 | for x, y in cmds.iteritems(): 186 | i += 1 187 | 188 | if i == 3: 189 | try: 190 | open(file, 'w').close() 191 | logger.info("DiagTrack: Cleared AutoLogger-Diagtrack-Listener.etl") 192 | except: 193 | logger.exception("DiagTrack: Couldn't open AutoLogger-Diagtrack-Listener.etl for writing") 194 | 195 | p = subprocess.Popen(x, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE) 196 | output = p.communicate() 197 | logger.info("DiagTrack: {0} of AutoLogger-Diagtrack-Listener.etl was successful".format(y)) 198 | 199 | if p.returncode: 200 | logger.exception(p.returncode.decode()) 201 | 202 | if i == 3: 203 | logger.info("DiagTrack: Successfully cleared and locked DiagTrack log.") 204 | """ 205 | 206 | 207 | def delete_service(service): 208 | try: 209 | win32serviceutil.RemoveService(service) 210 | logger.info( 211 | "Services: Succesfully removed service '{service}'".format(service=service) 212 | ) 213 | except pywintypes.error as e: 214 | errors = ( 215 | winerror.ERROR_SERVICE_DOES_NOT_EXIST, 216 | winerror.ERROR_SERVICE_NOT_ACTIVE, 217 | winerror.ERROR_SERVICE_MARKED_FOR_DELETE, 218 | ) 219 | if not any(error == e.winerror for error in errors): 220 | logger.exception( 221 | "Services: Failed to remove service '{service}'".format(service=service) 222 | ) 223 | 224 | 225 | def disable_service(service): 226 | try: 227 | win32serviceutil.StopService(service) 228 | logger.info( 229 | "Services: Succesfully stopped service '{service}'".format(service=service) 230 | ) 231 | except pywintypes.error as e: 232 | errors = ( 233 | winerror.ERROR_SERVICE_DOES_NOT_EXIST, 234 | winerror.ERROR_SERVICE_NOT_ACTIVE, 235 | ) 236 | if not any(error == e.winerror for error in errors): 237 | logger.exception( 238 | "Services: Failed to stop service '{service}'".format(service=service) 239 | ) 240 | 241 | 242 | def telemetry(undo): 243 | value = int(undo) 244 | telemetry_keys = { 245 | "AllowTelemetry": [ 246 | winreg.HKEY_LOCAL_MACHINE, 247 | r"SOFTWARE\Policies\Microsoft\Windows\DataCollection", 248 | "AllowTelemetry", 249 | winreg.REG_DWORD, 250 | value, 251 | ] 252 | } 253 | set_registry(telemetry_keys) 254 | 255 | 256 | def services(undo): 257 | value = 4 if undo else 3 258 | service_keys = { 259 | "dmwappushsvc": [ 260 | winreg.HKEY_LOCAL_MACHINE, 261 | r"SYSTEM\\CurrentControlSet\\Services\\dmwappushsvc", 262 | "Start", 263 | winreg.REG_DWORD, 264 | value, 265 | ], 266 | "DiagTrack": [ 267 | winreg.HKEY_LOCAL_MACHINE, 268 | r"SYSTEM\\CurrentControlSet\\Services\\DiagTrack", 269 | "Start", 270 | winreg.REG_DWORD, 271 | value, 272 | ], 273 | } 274 | set_registry(service_keys) 275 | 276 | 277 | def defender(undo): 278 | value = int(undo) 279 | defender_keys = { 280 | "Windows Defender Delivery Optimization Download": [ 281 | winreg.HKEY_LOCAL_MACHINE, 282 | r"SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config", 283 | "DODownloadMode", 284 | winreg.REG_DWORD, 285 | value, 286 | ], 287 | "Windows Defender Spynet": [ 288 | winreg.HKEY_LOCAL_MACHINE, 289 | r"SOFTWARE\Microsoft\Windows Defender\Spynet", 290 | "SpyNetReporting", 291 | winreg.REG_DWORD, 292 | value, 293 | ], 294 | "Windows Defender Sample Submission": [ 295 | winreg.HKEY_LOCAL_MACHINE, 296 | r"SOFTWARE\Microsoft\Windows Defender\Spynet", 297 | "SubmitSamplesConsent", 298 | winreg.REG_DWORD, 299 | value, 300 | ], 301 | } 302 | set_registry(defender_keys) 303 | 304 | 305 | def wifisense(undo): 306 | value = int(undo) 307 | wifisense_keys = { 308 | "WifiSense Credential Share": [ 309 | winreg.HKEY_LOCAL_MACHINE, 310 | r"SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features", 311 | "WiFiSenseCredShared", 312 | winreg.REG_DWORD, 313 | value, 314 | ], 315 | "WifiSense Open-ness": [ 316 | winreg.HKEY_LOCAL_MACHINE, 317 | r"SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\features", 318 | "WiFiSenseOpen", 319 | winreg.REG_DWORD, 320 | value, 321 | ], 322 | } 323 | set_registry(wifisense_keys) 324 | 325 | 326 | def onedrive(undo): 327 | file_sync_value = int(undo) 328 | list_pin_value = int(not undo) 329 | action = "install" if undo else "uninstall" 330 | 331 | if is_64bit(): 332 | onedrive_keys = { 333 | "FileSync": [ 334 | winreg.HKEY_LOCAL_MACHINE, 335 | r"SOFTWARE\Policies\Microsoft\Windows\OneDrive", 336 | "DisableFileSyncNGSC", 337 | winreg.REG_DWORD, 338 | file_sync_value, 339 | ], 340 | "ListPin": [ 341 | winreg.HKEY_CLASSES_ROOT, 342 | r"CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}", 343 | "System.IsPinnedToNameSpaceTree", 344 | winreg.REG_DWORD, 345 | list_pin_value, 346 | ], 347 | "ListPin64Bit": [ 348 | winreg.HKEY_CLASSES_ROOT, 349 | r"Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}", 350 | "System.IsPinnedToNameSpaceTree", 351 | winreg.REG_DWORD, 352 | list_pin_value, 353 | ], 354 | } 355 | else: 356 | onedrive_keys = { 357 | "FileSync": [ 358 | winreg.HKEY_LOCAL_MACHINE, 359 | r"SOFTWARE\Policies\Microsoft\Windows\OneDrive", 360 | "DisableFileSyncNGSC", 361 | winreg.REG_DWORD, 362 | file_sync_value, 363 | ], 364 | "ListPin": [ 365 | winreg.HKEY_CLASSES_ROOT, 366 | r"CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}", 367 | "System.IsPinnedToNameSpaceTree", 368 | winreg.REG_DWORD, 369 | list_pin_value, 370 | ], 371 | } 372 | 373 | set_registry(onedrive_keys) 374 | 375 | system = "SysWOW64" if is_64bit() else "System32" 376 | onedrive_setup = os.path.join( 377 | os.environ["SYSTEMROOT"], "{system}\\OneDriveSetup.exe".format(system=system) 378 | ) 379 | 380 | # Adding check if exe is there to help weed out issue submissions 381 | # from users who have somehow previously removed the binary 382 | if os.path.isfile(onedrive_setup): 383 | cmd = "{bin} /{action}".format(bin=onedrive_setup, action=action) 384 | 385 | output = subprocess_handler(cmd) 386 | if output[0] == -2147219813: 387 | logger.info("OneDrive: successfully {action}ed".format(action=action)) 388 | else: 389 | logger.info( 390 | "OneDrive: unable to {action}. Exited with code: {code} - {message}".format( 391 | action=action, code=output[0], message=output[1] 392 | ) 393 | ) 394 | else: 395 | logger.info( 396 | "OneDrive: Binary doesn't exist. Unable to {action}. Do not send a report for this.".format( 397 | action=action 398 | ) 399 | ) 400 | 401 | 402 | def set_registry(keys): 403 | mask = ( 404 | winreg.KEY_WOW64_64KEY | winreg.KEY_ALL_ACCESS 405 | if is_64bit() 406 | else winreg.KEY_ALL_ACCESS 407 | ) 408 | 409 | for key_name, values in keys.items(): 410 | try: 411 | key = winreg.CreateKeyEx(values[0], values[1], 0, mask) 412 | winreg.SetValueEx(key, values[2], 0, values[3], values[4]) 413 | winreg.CloseKey(key) 414 | logger.info( 415 | "Registry: Successfully modified {key} key.".format(key=key_name) 416 | ) 417 | except OSError: 418 | logger.exception( 419 | "Registry: Unable to modify {key} key.".format(key=key_name) 420 | ) 421 | 422 | 423 | def host_file(entries, undo): 424 | null_ip = "0.0.0.0 " 425 | nulled_entires = [null_ip + x for x in entries] 426 | hosts_path = os.path.join(os.environ["SYSTEMROOT"], "System32/drivers/etc/hosts") 427 | 428 | if undo: 429 | try: 430 | with open(hosts_path, "r") as hosts, tempfile.NamedTemporaryFile( 431 | mode="w+", 432 | delete=False 433 | ) as temp: 434 | for line in hosts: 435 | if not any(domain in line for domain in entries): 436 | temp.write(line) 437 | temp.close() 438 | shutil.move(temp.name, hosts_path) 439 | return True 440 | except OSError: 441 | logger.exception("Hosts: Failed to undo hosts file") 442 | else: 443 | try: 444 | with open(hosts_path, "a") as f: 445 | f.write("\n" + "\n".join(nulled_entires)) 446 | return True 447 | except (WindowsError, IOError): 448 | logger.exception("Hosts: Failed to modify hosts file") 449 | 450 | return False 451 | 452 | 453 | def app_manager(apps, undo): 454 | running = {} 455 | for app in apps: 456 | cmd = 'powershell "Get-AppxPackage *{app}*|Remove-AppxPackage"'.format(app=app) 457 | try: 458 | process = subprocess.Popen( 459 | shlex.split(cmd), 460 | stdout=subprocess.PIPE, 461 | stderr=subprocess.PIPE, 462 | stdin=subprocess.PIPE, 463 | ) 464 | running[app] = process 465 | except OSError: 466 | logger.exception( 467 | "App remover: Failed to remove app '{app}'".format(app=app) 468 | ) 469 | 470 | for app, process in running.items(): 471 | process.wait() 472 | if process.returncode: 473 | logger.exception( 474 | "App remover: Failed to remove app '{app}'".format(app=app) 475 | ) 476 | else: 477 | logger.info("Successfully removed app '{app}'".format(app=app)) 478 | 479 | 480 | def subprocess_handler(cmd): 481 | p = subprocess.Popen( 482 | cmd, 483 | stdout=subprocess.PIPE, 484 | stderr=subprocess.PIPE, 485 | stdin=subprocess.PIPE, 486 | shell=True, 487 | ) 488 | output = p.communicate() 489 | 490 | return [p.returncode, output] 491 | 492 | 493 | # Old reinstall code, does not work: 494 | # if reinstall: 495 | # # We encode in Base64 because the command is complex and I'm too lazy to escape everything. 496 | # # It's uncoded format command: "Get-AppxPackage -AllUsers| Foreach {Add-AppxPackage -DisableDevelopmentMode 497 | # # -Register "$($_.InstallLocation)\AppXManifest.xml"}" 498 | # encodedcommand = 'Get-AppxPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode # -Register \ 499 | # "$($_.InstallLocation)\AppXManifest.xml"}' 500 | # try: 501 | # subprocess.call("powershell -EncodedCommand {0}".format(encodedcommand), shell=True) 502 | # except (WindowsError, IOError): 503 | # print "App management: Could not re-install all apps" 504 | 505 | 506 | def dvr(undo): 507 | game_dvr_enabled = allow_game_dvr = 0 508 | action = "disabled" 509 | if undo: 510 | game_dvr_enabled = allow_game_dvr = 1 511 | action = "enabled" 512 | 513 | dvr_keys = { 514 | "GameDVR_Enabled": [ 515 | winreg.HKEY_CURRENT_USER, 516 | r"System\GameConfigStore", 517 | "GameDVR_Enabled", 518 | winreg.REG_DWORD, 519 | game_dvr_enabled, 520 | ], 521 | "AllowGameDVR": [ 522 | winreg.HKEY_LOCAL_MACHINE, 523 | r"SOFTWARE\Policies\Microsoft\Windows\GameDVR", 524 | "AllowGameDVR", 525 | winreg.REG_DWORD, 526 | allow_game_dvr, 527 | ], 528 | } 529 | 530 | set_registry(dvr_keys) 531 | logger.info("Xbox DVR: successfully {action}".format(action=action)) 532 | -------------------------------------------------------------------------------- /dwt.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 10se1ucgo 2015-2016 2 | # 3 | # This file is part of DisableWinTracking. 4 | # 5 | # DisableWinTracking is free software: you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation, either version 3 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # DisableWinTracking is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with DisableWinTracking. If not, see . 17 | import logging 18 | import sys 19 | import io 20 | import platform 21 | import traceback 22 | import webbrowser 23 | from ctypes import windll 24 | from six import u 25 | 26 | import wx 27 | from wx.lib.itemspicker import ( 28 | ItemsPicker, 29 | IP_SORT_SELECTED, 30 | IP_SORT_CHOICES, 31 | IP_REMOVE_FROM_CHOICES, 32 | ) 33 | 34 | import dwt_about 35 | import dwt_util 36 | 37 | 38 | class RedirectText(io.StringIO): 39 | def __init__(self, console, old_stdout): 40 | super(RedirectText, self).__init__() 41 | 42 | self.out = console 43 | self.old_out = old_stdout 44 | 45 | def write(self, string): 46 | # Oh my god this is the DUMBEST THING I've ever done. (Keeping a reference to the old stdout) 47 | self.old_out.write(string) 48 | self.out.WriteText(string) 49 | 50 | 51 | class ConsoleDialog(wx.Dialog): 52 | def __init__(self, old_stdout): 53 | wx.Dialog.__init__( 54 | self, 55 | parent=wx.GetApp().TopWindow, 56 | title="Console Output", 57 | size=(500, 200), 58 | style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER, 59 | ) 60 | 61 | console_box = wx.TextCtrl(self, style=wx.TE_MULTILINE | wx.TE_READONLY) 62 | sys.stdout = RedirectText(console_box, old_stdout) 63 | 64 | top_sizer = wx.BoxSizer(wx.VERTICAL) 65 | console_sizer = wx.BoxSizer(wx.VERTICAL) 66 | button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL) 67 | 68 | report_button = wx.FindWindowById(wx.ID_CANCEL, self) 69 | report_button.SetLabel("Report an issue") 70 | 71 | console_sizer.Add( 72 | console_box, 1, wx.LEFT | wx.RIGHT | wx.EXPAND | wx.ALIGN_TOP, 5 73 | ) 74 | 75 | top_sizer.Add(console_sizer, 1, wx.ALL | wx.EXPAND, 5) 76 | top_sizer.Add(button_sizer, 0, wx.ALL | wx.ALIGN_LEFT, 5) 77 | 78 | self.Bind(wx.EVT_CLOSE, handler=lambda x: sys.exit(0)) 79 | self.Bind(wx.EVT_BUTTON, handler=lambda x: sys.exit(0), id=wx.ID_OK) 80 | self.Bind(wx.EVT_BUTTON, source=report_button, handler=self.submit_issue) 81 | self.SetSizer(top_sizer) 82 | 83 | def submit_issue(self, event): 84 | webbrowser.open_new_tab( 85 | "https://github.com/bitlog2/DisableWinTracking/issues/new" 86 | ) 87 | 88 | 89 | class MainFrame(wx.Frame): 90 | def __init__(self): 91 | super(MainFrame, self).__init__( 92 | parent=wx.GetApp().GetTopWindow(), 93 | title="Disable Windows 10 Tracking", 94 | size=(415, 245), 95 | ) 96 | 97 | self.SetMinSize(self.GetSize()) 98 | panel = MainPanel(self) 99 | 100 | file_menu = wx.Menu() 101 | settings = file_menu.Append(wx.ID_SETUP, "&Settings", "DWT settings") 102 | 103 | help_menu = wx.Menu() 104 | about = help_menu.Append(wx.ID_ABOUT, "&About", "About DWT") 105 | licenses = help_menu.Append(wx.ID_ANY, "&Licenses", "Open-source licenses") 106 | 107 | menu_bar = wx.MenuBar() 108 | menu_bar.Append(file_menu, "&File") 109 | menu_bar.Append(help_menu, "&Help") 110 | self.SetMenuBar(menu_bar) 111 | 112 | check_elevated() 113 | 114 | self.SetIcon(wx.Icon(sys.executable, wx.BITMAP_TYPE_ICO)) 115 | self.Bind(wx.EVT_MENU, lambda x: dwt_about.about_dialog(self), about) 116 | self.Bind(wx.EVT_MENU, panel.settings, settings) 117 | self.Bind(wx.EVT_MENU, lambda x: dwt_about.Licenses(self), licenses) 118 | self.Layout() 119 | 120 | 121 | class MainPanel(wx.Panel): 122 | def __init__(self, parent): 123 | super(MainPanel, self).__init__(parent) 124 | 125 | self.parent = parent 126 | self.picked_normal = [] 127 | self.picked_extra = [] 128 | self.picked_ips = [] 129 | 130 | self.service_check = wx.CheckBox(self, label="Services") 131 | self.service_check.SetToolTip( 132 | "Disables or deletes tracking services. Choose option in 'Services Method'" 133 | ) 134 | 135 | self.diagtrack_check = wx.CheckBox(self, label="Clear DiagTrack log") 136 | self.diagtrack_check.SetToolTip( 137 | "Clears Dianostic Tracking log and prevents modification to it. " 138 | "Cannot be undone automatically." 139 | ) 140 | 141 | # Telemetry checkbox 142 | self.telemetry_check = wx.CheckBox(self, label="Telemetry") 143 | self.telemetry_check.SetToolTip( 144 | "Sets 'AllowTelemetry' to 0. " 145 | "On non-Enterprise OS editions, requires HOSTS file modification." 146 | ) 147 | 148 | # HOSTS file checkbox 149 | self.host_check = wx.CheckBox(self, label="Block tracking domains") 150 | self.host_check.SetToolTip( 151 | "Adds known tracking domains to HOSTS file. Required to disable Telemetry" 152 | ) 153 | 154 | # Extra HOSTS checkbox 155 | self.extra_host_check = wx.CheckBox( 156 | self, label="Block even more tracking domains" 157 | ) 158 | self.extra_host_check.SetToolTip( 159 | "For the paranoid. Adds extra domains to the HOSTS file.\n" 160 | "May cause issues with Skype, Dr. Watson, Hotmail and/or Error Reporting." 161 | ) 162 | 163 | # IP block checkbox 164 | self.ip_check = wx.CheckBox(self, label="Block tracking IP addresses") 165 | self.ip_check.SetToolTip( 166 | "Blocks known tracking IP addresses with Windows Firewall." 167 | ) 168 | 169 | # Windows Privacy Regs (Policy Manager) 170 | self.defender_check = wx.CheckBox(self, label="Windows Defender collection") 171 | # self.defender_check.SetToolTip("Modifies registry to prevent Defender collection") 172 | # Disable defender option until a solution is found. 173 | self.defender_check.SetToolTip( 174 | "Disable due to limitation set by windows kernel." 175 | ) 176 | self.defender_check.Enable(False) 177 | 178 | # WifiSense checkbox 179 | self.wifisense_check = wx.CheckBox(self, label="WifiSense") 180 | 181 | # OneDrive uninstall checkbox 182 | self.onedrive_check = wx.CheckBox(self, label="Uninstall OneDrive") 183 | self.onedrive_check.SetToolTip( 184 | "Uninstalls OneDrive from your computer and removes it from Explorer." 185 | ) 186 | 187 | # Xbox DVR checkbox 188 | self.dvr_check = wx.CheckBox(self, label="Disable Xbox DVR") 189 | self.dvr_check.SetToolTip("Disable Xbox DVR feature to increase FPS in games") 190 | 191 | self.service_rad = wx.RadioBox( 192 | self, label="Service Method", choices=("Disable", "Delete") 193 | ) 194 | self.service_rad.SetItemToolTip( 195 | item=0, text="Simply disables the services. This can be undone." 196 | ) 197 | self.service_rad.SetItemToolTip( 198 | item=1, text="Deletes the services completely. This can't be undone." 199 | ) 200 | 201 | self.mode_rad = wx.RadioBox(self, label="Mode", choices=("Privacy", "Revert")) 202 | self.mode_rad.SetItemToolTip(item=0, text="Applies the selected settings.") 203 | self.mode_rad.SetItemToolTip(item=1, text="Reverts the selected settings.") 204 | 205 | go_button = wx.Button(self, label="Go!") 206 | 207 | # Temporarily removed due to issues with not being able to restore apps properly 208 | # This was honestly beyond the scope of the project to begin with and shouldn't have been implemented 209 | 210 | """self.app_box = wx.StaticBoxSizer(wx.VERTICAL, self, "Built-in Apps") 211 | stat_box = self.app_box.GetStaticBox() 212 | top_app_sizer = wx.BoxSizer(wx.HORIZONTAL) 213 | button_app_sizer = wx.BoxSizer(wx.HORIZONTAL) 214 | left_app_sizer = wx.BoxSizer(wx.VERTICAL) 215 | middle_app_sizer = wx.BoxSizer(wx.VERTICAL) 216 | right_app_sizer = wx.BoxSizer(wx.VERTICAL) 217 | 218 | # wx.CheckBox(app_box.GetStaticBox(), label="Name", name="search_name") 219 | 220 | wx.CheckBox(stat_box, label="3D Builder", name="3dbuilder") 221 | wx.CheckBox(stat_box, label="Alarms && Clocks", name="windowsalarms") 222 | wx.CheckBox(stat_box, label="Calendar and Mail", name="windowscommunicationsapps") 223 | wx.CheckBox(stat_box, label="Camera", name="windowscamera") 224 | wx.CheckBox(stat_box, label="Drawboard PDF", name="drawboardpdf") 225 | wx.CheckBox(stat_box, label="Feedback Hub", name="windowsfeedbackhub") 226 | wx.CheckBox(stat_box, label="Food && Drink", name="bingfoodanddrink") 227 | wx.CheckBox(stat_box, label="Get Office App", name="officehub") 228 | wx.CheckBox(stat_box, label="Get Skype App", name="skypeapp") 229 | wx.CheckBox(stat_box, label="Get Started App", name="getstarted") 230 | wx.CheckBox(stat_box, label="Groove Music", name="zunemusic") 231 | wx.CheckBox(stat_box, label="Health && Fitness", name="binghealthandfitness") 232 | wx.CheckBox(stat_box, label="Maps", name="windowsmaps") 233 | wx.CheckBox(stat_box, label="Messaging", name="messaging") 234 | wx.CheckBox(stat_box, label="Money", name="bingfinance") 235 | wx.CheckBox(stat_box, label="Movies && TV", name="zunevideo") 236 | wx.CheckBox(stat_box, label="News", name="bingnews") 237 | wx.CheckBox(stat_box, label="OneNote App", name="onenote") 238 | wx.CheckBox(stat_box, label="People", name="people") 239 | wx.CheckBox(stat_box, label="Phone Companion", name="windowsphone") 240 | wx.CheckBox(stat_box, label="Photos", name="photos") 241 | wx.CheckBox(stat_box, label="Reader", name="reader") 242 | wx.CheckBox(stat_box, label="Reading List", name="windowsreadinglist") 243 | wx.CheckBox(stat_box, label="Solitaire Collection", name="solitairecollection") 244 | wx.CheckBox(stat_box, label="Sports", name="bingsports") 245 | wx.CheckBox(stat_box, label="Sticky Notes", name="microsoftstickynotes") 246 | wx.CheckBox(stat_box, label="Sway App", name="sway") 247 | wx.CheckBox(stat_box, label="Travel", name="bingtravel") 248 | wx.CheckBox(stat_box, label="Voice Recorder", name="soundrecorder") 249 | wx.CheckBox(stat_box, label="Weather", name="bingweather") 250 | wx.CheckBox(stat_box, label="Xbox", name="xboxapp") 251 | remove_app_button = wx.Button(stat_box, label="Remove selected apps") 252 | select_all_check = wx.CheckBox(stat_box, label="Select all") 253 | 254 | sorted_list = sorted(stat_box.GetChildren(), key=lambda x: x.GetLabel()) 255 | for index, item in enumerate([x for x in sorted_list if isinstance(x, wx.CheckBox) and x != select_all_check]): 256 | n = len(sorted_list) // 3 257 | if index <= n: 258 | left_app_sizer.Add(item, 1, wx.ALL, 1) 259 | elif index <= n * 2: 260 | middle_app_sizer.Add(item, 1, wx.ALL, 1) 261 | else: 262 | right_app_sizer.Add(item, 1, wx.ALL, 1) 263 | 264 | top_app_sizer.Add(left_app_sizer, 1, wx.ALL, 1) 265 | top_app_sizer.Add(middle_app_sizer, 1, wx.ALL, 1) 266 | top_app_sizer.Add(right_app_sizer, 1, wx.ALL, 1) 267 | button_app_sizer.Add(remove_app_button, 0, wx.ALL, 1) 268 | button_app_sizer.Add(select_all_check, 1, wx.ALL, 5) 269 | self.app_box.Add(top_app_sizer) 270 | self.app_box.Add(button_app_sizer)""" 271 | 272 | top_sizer = wx.BoxSizer(wx.VERTICAL) 273 | top_row_sizer = wx.BoxSizer(wx.HORIZONTAL) 274 | check_sizer = wx.BoxSizer(wx.VERTICAL) 275 | rad_sizer = wx.BoxSizer(wx.VERTICAL) 276 | 277 | top_sizer.Add(top_row_sizer, 0, wx.ALL, 5) 278 | # top_sizer.Add(self.app_box, 0, wx.ALL, 5) 279 | top_row_sizer.Add(check_sizer, 0, wx.ALL) 280 | top_row_sizer.Add(rad_sizer, 0, wx.ALL) 281 | rad_sizer.Add(self.service_rad, 0, wx.ALL, 10) 282 | rad_sizer.Add(go_button, 0, wx.ALL ^ wx.BOTTOM | wx.ALIGN_CENTER, 10) 283 | rad_sizer.Add(self.mode_rad, 0, wx.ALL, 10) 284 | check_sizer.Add(self.service_check, 0, wx.ALL, 1) 285 | check_sizer.Add(self.diagtrack_check, 0, wx.ALL, 1) 286 | check_sizer.Add(self.telemetry_check, 0, wx.ALL, 1) 287 | check_sizer.Add(self.host_check, 0, wx.ALL, 1) 288 | check_sizer.Add(self.extra_host_check, 0, wx.ALL, 1) 289 | check_sizer.Add(self.ip_check, 0, wx.ALL, 1) 290 | check_sizer.Add(self.defender_check, 0, wx.ALL, 1) 291 | check_sizer.Add(self.wifisense_check, 0, wx.ALL, 1) 292 | check_sizer.Add(self.onedrive_check, 0, wx.ALL, 1) 293 | check_sizer.Add(self.dvr_check, 0, wx.ALL, 1) 294 | 295 | # self.Bind(wx.EVT_CHECKBOX, handler=self.select_all_apps, source=select_all_check) 296 | self.Bind(wx.EVT_CHECKBOX, handler=self.ip_warn, source=self.ip_check) 297 | self.Bind( 298 | wx.EVT_CHECKBOX, handler=self.hosts_warn, source=self.extra_host_check 299 | ) 300 | # self.Bind(wx.EVT_BUTTON, handler=self.remove_apps, source=remove_app_button) 301 | self.Bind(wx.EVT_BUTTON, handler=self.go, source=go_button) 302 | 303 | self.SetSizer(top_sizer) 304 | 305 | def select_all_apps(self, event): 306 | # Iters through all children of the wxStaticBox of the wxStaticBoxSizer and checks/un checks all wxCheckBoxes. 307 | for child in self.app_box.GetStaticBox().GetChildren(): 308 | if isinstance(child, wx.CheckBox): 309 | child.SetValue(event.IsChecked()) 310 | 311 | def ip_warn(self, event): 312 | # Warn users about the potential side effects of the IP blocking firewall rules 313 | if event.IsChecked(): 314 | warn = wx.MessageDialog( 315 | parent=self, 316 | message="This option could potentially disable Microsoft Licensing traffic and thus " 317 | "certain games and apps may cease to work, such as, Forza, or Gears of War.", 318 | caption="Attention!", 319 | style=wx.YES_NO | wx.ICON_EXCLAMATION, 320 | ) 321 | 322 | if warn.ShowModal() == wx.ID_NO: 323 | event.GetEventObject().SetValue(False) 324 | 325 | warn.Destroy() 326 | 327 | def hosts_warn(self, event): 328 | # Warn users about the potential side effects of the extra hosts mod. 329 | if event.IsChecked(): 330 | warn = wx.MessageDialog( 331 | parent=self, 332 | message="This option could potentially disable one or more of the following " 333 | "services:\n\nSkype, Hotmail, Dr. Watson and/or Error Reporting. Continue?", 334 | caption="Attention!", 335 | style=wx.YES_NO | wx.ICON_EXCLAMATION, 336 | ) 337 | 338 | if warn.ShowModal() == wx.ID_NO: 339 | event.GetEventObject().SetValue(False) 340 | 341 | warn.Destroy() 342 | 343 | def go(self, event): 344 | if not all((self.picked_ips, self.picked_extra, self.picked_normal)): 345 | self.settings(event=None) 346 | 347 | undo = bool(self.mode_rad.GetSelection()) 348 | 349 | if self.ip_check.IsChecked(): 350 | dwt_util.ip_block(self.picked_ips, undo=undo) 351 | if self.diagtrack_check.IsChecked(): 352 | dwt_util.clear_diagtrack() 353 | if self.service_check.IsChecked(): 354 | if self.service_rad.GetSize(): 355 | dwt_util.delete_service("dmwappushsvc") 356 | dwt_util.delete_service("DiagTrack") 357 | else: 358 | dwt_util.disable_service("dmwappushsvc") 359 | dwt_util.disable_service("DiagTrack") 360 | dwt_util.services(undo=undo) 361 | if self.telemetry_check.IsChecked(): 362 | dwt_util.telemetry(undo=undo) 363 | if self.host_check.IsChecked(): 364 | dwt_util.host_file(self.picked_normal, undo=undo) 365 | if self.extra_host_check.IsChecked(): 366 | dwt_util.host_file(self.picked_extra, undo=undo) 367 | if self.defender_check.IsChecked(): 368 | dwt_util.defender(undo=undo) 369 | if self.wifisense_check.IsChecked(): 370 | dwt_util.wifisense(undo=undo) 371 | if self.onedrive_check.IsChecked(): 372 | dwt_util.onedrive(undo=undo) 373 | if self.dvr_check.IsChecked(): 374 | dwt_util.dvr(undo=undo) 375 | logger.info( 376 | "Done. It's recommended that you reboot as soon as possible for the full effect." 377 | ) 378 | logger.info( 379 | ( 380 | "If you feel something didn't work properly, please press the 'Report an issue'" 381 | " button and follow the directions" 382 | ) 383 | ) 384 | console.Center() 385 | console.Show() 386 | 387 | def remove_apps(self, event): 388 | children = [ 389 | child 390 | for child in self.app_box.GetStaticBox().GetChildren() 391 | if child.GetName() != "check" 392 | ] 393 | app_list = [ 394 | child.GetName() 395 | for child in children 396 | if isinstance(child, wx.CheckBox) and child.IsChecked() 397 | ] 398 | dwt_util.app_manager(app_list, undo=False) 399 | 400 | def settings(self, event, silent=False): 401 | if silent == False: 402 | dialog = wx.Dialog( 403 | parent=self, 404 | title="Settings", 405 | style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER, 406 | ) 407 | sizer = wx.BoxSizer(wx.VERTICAL) 408 | 409 | normal_domains = ( 410 | "a-0001.a-msedge.net", 411 | "a-0002.a-msedge.net", 412 | "a-0003.a-msedge.net", 413 | "a-0004.a-msedge.net", 414 | "a-0005.a-msedge.net", 415 | "a-0006.a-msedge.net", 416 | "a-0007.a-msedge.net", 417 | "a-0008.a-msedge.net", 418 | "a-0009.a-msedge.net", 419 | "a-msedge.net", 420 | "a.ads1.msn.com", 421 | "a.ads2.msads.net", 422 | "a.ads2.msn.com", 423 | "a.rad.msn.com", 424 | "ac3.msn.com", 425 | "ad.doubleclick.net", 426 | "adnexus.net", 427 | "adnxs.com", 428 | "ads.msn.com", 429 | "ads1.msads.net", 430 | "ads1.msn.com", 431 | "aidps.atdmt.com", 432 | "aka-cdn-ns.adtech.de", 433 | "az361816.vo.msecnd.net", 434 | "az512334.vo.msecnd.net", 435 | "b.ads1.msn.com", 436 | "b.ads2.msads.net", 437 | "b.rad.msn.com", 438 | "bs.serving-sys.com", 439 | "c.atdmt.com", 440 | "c.msn.com", 441 | "cdn.atdmt.com", 442 | "cds26.ams9.msecn.net", 443 | "choice.microsoft.com", 444 | "choice.microsoft.com.nsatc.net", 445 | "compatexchange.cloudapp.net", 446 | "corp.sts.microsoft.com", 447 | "corpext.msitadfs.glbdns2.microsoft.com", 448 | "cs1.wpc.v0cdn.net", 449 | "db3aqu.atdmt.com", 450 | "df.telemetry.microsoft.com", 451 | "diagnostics.support.microsoft.com", 452 | "ec.atdmt.com", 453 | "feedback.microsoft-hohm.com", 454 | "feedback.search.microsoft.com", 455 | "feedback.windows.com", 456 | "flex.msn.com", 457 | "g.msn.com", 458 | "h1.msn.com", 459 | "i1.services.social.microsoft.com", 460 | "i1.services.social.microsoft.com.nsatc.net", 461 | "lb1.www.ms.akadns.net", 462 | "live.rads.msn.com", 463 | "m.adnxs.com", 464 | "msedge.net", 465 | "msnbot-65-55-108-23.search.msn.com", 466 | "msntest.serving-sys.com", 467 | "oca.telemetry.microsoft.com", 468 | "oca.telemetry.microsoft.com.nsatc.net", 469 | "pre.footprintpredict.com", 470 | "preview.msn.com", 471 | "rad.live.com", 472 | "rad.msn.com", 473 | "redir.metaservices.microsoft.com", 474 | "reports.wes.df.telemetry.microsoft.com", 475 | "schemas.microsoft.akadns.net", 476 | "secure.adnxs.com", 477 | "secure.flashtalking.com", 478 | "services.wes.df.telemetry.microsoft.com", 479 | "settings-sandbox.data.microsoft.com", 480 | "settings-win.data.microsoft.com", 481 | "sls.update.microsoft.com.akadns.net", 482 | "sqm.df.telemetry.microsoft.com", 483 | "sqm.telemetry.microsoft.com", 484 | "sqm.telemetry.microsoft.com.nsatc.net", 485 | "ssw.live.com", 486 | "static.2mdn.net", 487 | "statsfe1.ws.microsoft.com", 488 | "statsfe2.ws.microsoft.com", 489 | "telecommand.telemetry.microsoft.com", 490 | "telecommand.telemetry.microsoft.com.nsatc.net", 491 | "telemetry.appex.bing.net", 492 | "telemetry.microsoft.com", 493 | "telemetry.urs.microsoft.com", 494 | "v10.vortex-win.data.microsoft.com", 495 | "vortex-bn2.metron.live.com.nsatc.net", 496 | "vortex-cy2.metron.live.com.nsatc.net", 497 | "vortex-sandbox.data.microsoft.com", 498 | "vortex-win.data.metron.live.com.nsatc.net", 499 | "vortex-win.data.microsoft.com", 500 | "vortex.data.glbdns2.microsoft.com", 501 | "vortex.data.microsoft.com", 502 | "watson.live.com", 503 | "web.vortex.data.microsoft.com", 504 | ) 505 | 506 | extra_domains = ( 507 | "fe2.update.microsoft.com.akadns.net", 508 | "s0.2mdn.net", 509 | "statsfe2.update.microsoft.com.akadns.net", 510 | "survey.watson.microsoft.com", 511 | "view.atdmt.com", 512 | "watson.microsoft.com", 513 | "watson.ppe.telemetry.microsoft.com", 514 | "watson.telemetry.microsoft.com", 515 | "watson.telemetry.microsoft.com.nsatc.net", 516 | "wes.df.telemetry.microsoft.com", 517 | "ui.skype.com", 518 | "pricelist.skype.com", 519 | "apps.skype.com", 520 | "m.hotmail.com", 521 | "s.gateway.messenger.live.com", 522 | ) 523 | 524 | ip_addresses = ( 525 | "2.22.61.43", 526 | "2.22.61.66", 527 | "65.39.117.230", 528 | "65.55.108.23", 529 | "23.218.212.69", 530 | "134.170.30.202", 531 | "137.116.81.24", 532 | "157.56.106.189", 533 | "204.79.197.200", 534 | "65.52.108.33", 535 | "64.4.54.254", 536 | ) 537 | 538 | normal_domain_picker = ItemsPicker( 539 | dialog, 540 | choices=[], 541 | selectedLabel="Domains to be blocked", 542 | ipStyle=IP_SORT_SELECTED | IP_SORT_CHOICES | IP_REMOVE_FROM_CHOICES, 543 | ) 544 | if self.picked_normal: 545 | normal_domain_picker.SetSelections(self.picked_normal) 546 | normal_domain_picker.SetItems( 547 | [ 548 | domain 549 | for domain in normal_domains 550 | if domain not in self.picked_normal 551 | ] 552 | ) 553 | else: 554 | normal_domain_picker.SetSelections(normal_domains) 555 | 556 | extra_domain_picker = ItemsPicker( 557 | dialog, 558 | choices=[], 559 | selectedLabel="Extra domains to be blocked", 560 | ipStyle=IP_SORT_SELECTED | IP_SORT_CHOICES | IP_REMOVE_FROM_CHOICES, 561 | ) 562 | if self.picked_extra: 563 | extra_domain_picker.SetSelections(self.picked_extra) 564 | extra_domain_picker.SetItems( 565 | [domain for domain in extra_domains if domain not in self.picked_extra] 566 | ) 567 | else: 568 | extra_domain_picker.SetSelections(extra_domains) 569 | 570 | ip_picker = ItemsPicker( 571 | dialog, 572 | choices=[], 573 | selectedLabel="IP addresses to be blocked", 574 | ipStyle=IP_SORT_SELECTED | IP_SORT_CHOICES | IP_REMOVE_FROM_CHOICES, 575 | ) 576 | if self.picked_ips: 577 | ip_picker.SetSelections(self.picked_ips) 578 | ip_picker.SetItems([ip for ip in ip_addresses if ip not in self.picked_ips]) 579 | else: 580 | ip_picker.SetSelections(ip_addresses) 581 | 582 | if silent == False: 583 | sizer.Add(normal_domain_picker, 0, wx.EXPAND) 584 | sizer.Add(extra_domain_picker, 0, wx.EXPAND) 585 | sizer.Add(ip_picker, 0, wx.EXPAND) 586 | if event is not None: 587 | dialog.SetSizerAndFit(sizer) 588 | dialog.Center() 589 | dialog.ShowModal() 590 | dialog.Destroy() 591 | 592 | self.picked_normal = normal_domain_picker.GetSelections() 593 | self.picked_extra = extra_domain_picker.GetSelections() 594 | self.picked_ips = ip_picker.GetSelections() 595 | 596 | 597 | def setup_logging(): 598 | global logger 599 | logger = logging.getLogger("dwt") 600 | logger.setLevel(logging.DEBUG) 601 | 602 | formatter = logging.Formatter( 603 | fmt="%(asctime)s %(levelname)s: %(message)s", datefmt="%H:%M:%S" 604 | ) 605 | 606 | stdout_log = logging.StreamHandler(sys.stdout) 607 | stdout_log.setLevel(logging.DEBUG) 608 | stdout_log.setFormatter(formatter) 609 | logger.addHandler(stdout_log) 610 | 611 | try: 612 | file_log = logging.FileHandler(filename="dwt.log") 613 | file_log.setLevel(logging.DEBUG) 614 | file_log.setFormatter(formatter) 615 | logger.addHandler(file_log) 616 | except (OSError, IOError): 617 | error_dialog = wx.MessageDialog( 618 | parent=wx.GetApp().GetTopWindow(), 619 | message="Could not create log file, errors will not be recorded!", 620 | caption="ERROR!", 621 | style=wx.OK | wx.ICON_ERROR, 622 | ) 623 | error_dialog.ShowModal() 624 | error_dialog.Destroy() 625 | logger.exception("Could not create log file.") 626 | 627 | logger.info( 628 | "Python {version} on {platform}".format( 629 | version=sys.version, platform=sys.platform 630 | ) 631 | ) 632 | logger.info(platform.uname()) 633 | logger.info("DisableWinTracking version {v}".format(v=dwt_about.__version__)) 634 | 635 | 636 | def exception_hook(error, value, trace): 637 | error_message = "".join(traceback.format_exception(error, value, trace)) 638 | logger.critical(error_message) 639 | error_dialog = wx.MessageDialog( 640 | parent=wx.GetApp().GetTopWindow(), 641 | message="An error has occured!\n\n" + error_message, 642 | caption="ERROR!", 643 | style=wx.OK | wx.CANCEL | wx.ICON_ERROR, 644 | ) 645 | error_dialog.SetOKCancelLabels("Ignore", "Quit") 646 | if error_dialog.ShowModal() == wx.ID_OK: 647 | error_dialog.Destroy() 648 | else: 649 | error_dialog.Destroy() 650 | sys.exit(1) 651 | 652 | 653 | def check_elevated(silent=False): 654 | if not bool(windll.advpack.IsNTAdmin(0, None)): 655 | if silent: 656 | windll.shell32.ShellExecuteW( 657 | None, 658 | u"runas", 659 | u(sys.executable), 660 | u"{0} -silent".format(u(__file__)), 661 | None, 662 | 1, 663 | ) 664 | sys.exit(1) 665 | else: 666 | windll.shell32.ShellExecuteW( 667 | None, u"runas", u(sys.executable), u(__file__), None, 1 668 | ) 669 | sys.exit(1) 670 | 671 | 672 | def silent(): 673 | 674 | setup_logging() 675 | check_elevated(True) 676 | 677 | dwt_util.clear_diagtrack() 678 | dwt_util.disable_service("dmwappushsvc") 679 | dwt_util.disable_service("DiagTrack") 680 | dwt_util.services(0) 681 | dwt_util.telemetry(0) 682 | # dwt_util.defender(0) 683 | dwt_util.wifisense(0) 684 | dwt_util.onedrive(0) 685 | 686 | logger.info("COMPLETE") 687 | 688 | 689 | if __name__ == "__main__": 690 | if "-silent" in sys.argv: 691 | silent() 692 | sys.exit(0) 693 | 694 | wx_app = wx.App() 695 | frame = MainFrame() 696 | console = ConsoleDialog(sys.stdout) 697 | setup_logging() 698 | sys.excepthook = exception_hook 699 | dwt_about.update_check(None) 700 | frame.Show() 701 | wx_app.MainLoop() 702 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 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 | --------------------------------------------------------------------------------