One-Button / Automated Encrypted DNS (ODoH) Example On Windows 10 / 11

Iron Contributor

This stub resolver example utilizes ODoH (DNSCrypt-Proxy 2.x), can be used in conjunction with a VPN, and an optional Caching-Only DNS / Name Server behind it.


NOTE: Right-click on the following batch files after saving them, and click "Run as administrator".


(1.) Use Notepad to create this file on your desktop or another folder: DNSCrypt-Proxy_Auto_Installer.bat

 

@ECHO OFF
SETLOCAL EnableDelayedExpansion
IF %Processor_Architecture%==AMD64 (SET ARCH_WIDTH=win64) ELSE (SET ARCH_WIDTH=win32)
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser -Force}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope LocalMachine -Force}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Set-PSReadLineOption -HistorySaveStyle SaveNothing -MaximumHistoryCount 1}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Write-Output 'Remove-Module PSReadline' | New-Item -Path $PROFILE -Type File -Force}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetFirewallProfile | Set-NetFirewallProfile -EnableStealthModeForIPsec True}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetFirewallRule -DisplayName '*mDNS*Out)*' | Enable-NetFirewallRule}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetFirewallRule -DisplayName 'Core Networking*DNS*Out)' | Enable-NetFirewallRule}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Remove-NetFirewallRule -DisplayName 'cURL (Sys*)'}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Remove-NetFirewallRule -DisplayName 'App Updater Essential ( cURL - Sys* )'}"
IF EXIST "C:\Windows\System32\curl.exe" PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {New-NetFirewallRule -Action Allow -Direction Outbound -DisplayName 'App Updater Essential ( cURL - System32 )' -Profile Any -Program 'C:\Windows\System32\curl.exe' -Protocol Any}"
IF EXIST "C:\Windows\SysWOW64\curl.exe" PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {New-NetFirewallRule -Action Allow -Direction Outbound -DisplayName 'App Updater Essential ( cURL - SysWOW64 )' -Profile Any -Program 'C:\Windows\SysWOW64\curl.exe' -Protocol Any}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Remove-NetFirewallRule -DisplayName 'Windows Time Service'}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Remove-NetFirewallRule -DisplayName 'App Updater Essential ( Windows Time Service )'}"
REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers /T REG_SZ /D "0" /F
REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers /V 2 /T REG_SZ /D "time.windows.com" /F
REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers /V 1 /T REG_SZ /D "time.nist.gov" /F
REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers /V 0 /T REG_SZ /D "time.cloudflare.com" /F
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {New-NetFirewallRule -Action Allow -Direction Outbound -DisplayName 'App Updater Essential ( Windows Time Service )' -Profile Any -Protocol UDP -LocalPort 123 -RemotePort 123 -Service W32Time}"
IF NOT EXIST "%ProgramFiles%\dnscrypt-proxy\backup\%ARCH_WIDTH%" MKDIR "%ProgramFiles%\dnscrypt-proxy\backup\%ARCH_WIDTH%"
XCOPY "%~f0" "%ProgramFiles%\dnscrypt-proxy\backup\" /C /I /Q /G /H /R /Y /B /J
CD /D "%ProgramFiles%\dnscrypt-proxy"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {$tmp_date_chk_0_=[int](Get-Date -Format yyyy);$tmp_date_chk_1_=[int](((Get-Date -Year $tmp_date_chk_0_ -Month 12 -Day 31).DayOfYear)-((Get-Date).DayOfYear))+((Get-Date -Year 2084 -Month 5 -Day 16).DayOfYear);while($tmp_date_chk_0_ -lt 2083){$tmp_date_chk_0_++;$tmp_date_chk_1_+=[int](Get-Date -Year $tmp_date_chk_0_ -Month 12 -Day 31).DayOfYear;};Set-Content -Path 'C:\Program Files\dnscrypt-proxy\Revision_Num_0.txt' -value $tmp_date_chk_1_;}"
SET /P TMP_DATE_CHK=<"Revision_Num_0.txt"
curl --ssl-no-revoke --tlsv1.3 -A "" -w "%%{redirect_url}\n" "https://github.com/DNSCrypt/dnscrypt-proxy/releases/latest"> "%ProgramFiles%\dnscrypt-proxy\Revision_Num_1.txt"
TYPE "%ProgramFiles%\dnscrypt-proxy\Revision_Num_1.txt"| FIND "https://github.com/DNSCrypt/dnscrypt-proxy/releases/tag/" /C> "%ProgramFiles%\dnscrypt-proxy\Revision_Num_2.txt"
SET /P TMP_NL_CHK=<"Revision_Num_2.txt"
IF %TMP_NL_CHK% EQU 0 GOTO CNFGDNSCRYPT_SKP_LST_LBL
(REG ADD HKLM\SYSTEM\ControlSet001\Services\SstpSvc\Parameters /V NoCertRevocationCheck /T REG_DWORD /D 00000001 /F)
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Add-DnsClientDohServerAddress -ServerAddress 9.9.9.11 -DohTemplate 'https://dns11.quad9.net/dns-query' -AllowFallbackToUdp $False -AutoUpgrade $False;Add-DnsClientDohServerAddress -ServerAddress 149.112.112.11 -DohTemplate 'https://dns11.quad9.net/dns-query' -AllowFallbackToUdp $False -AutoUpgrade $False;}"
SET /P TMPRV_NM=<"Revision_Num_1.txt"
SET REV_NUM_=%TMPRV_NM:~56%

ECHO Windows Registry Editor Version 5.00> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\dnscrypt-proxy]>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO "Type"=dword:00000010>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO "Start"=dword:00000002>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO "ErrorControl"=dword:00000000>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO "ImagePath"=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,\>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO   6d,00,20,00,46,00,69,00,6c,00,65,00,73,00,5c,00,64,00,6e,00,73,00,63,00,72,\>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO   00,79,00,70,00,74,00,2d,00,70,00,72,00,6f,00,78,00,79,00,5c,00,64,00,6e,00,\>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO   73,00,63,00,72,00,79,00,70,00,74,00,2d,00,70,00,72,00,6f,00,78,00,79,00,2e,\>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO   00,65,00,78,00,65,00,22,00,20,00,2d,00,63,00,6f,00,6e,00,66,00,69,00,67,00,\>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO   20,00,64,00,6e,00,73,00,63,00,72,00,79,00,70,00,74,00,2d,00,70,00,72,00,6f,\>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO   00,78,00,79,00,2e,00,74,00,6f,00,6d,00,6c,00,00,00>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO "DisplayName"="DNSCrypt Client Proxy">> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO "ObjectName"="LocalSystem">> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO "Description"="Encrypted/Authenticated DNS Proxy">> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO "FailureActionsOnNonCrashFailures"=dword:00000001>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO "FailureActions"=hex:3c,00,00,00,00,00,00,00,00,00,00,00,03,00,00,00,14,00,00,\>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO   00,01,00,00,00,30,75,00,00,01,00,00,00,30,75,00,00,01,00,00,00,30,75,00,00>> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"
ECHO "Group"="NetworkProvider">> "%ProgramFiles%\dnscrypt-proxy\backup\dns-proxy.reg"

ECHO @ECHO OFF> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO SETLOCAL>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO sc config dnscrypt-proxy start= disabled>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO net stop dnscrypt-proxy>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO sc delete dnscrypt-proxy>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ECHO # Copyright (c) 1993-2009 Microsoft Corp.^> %%SystemRoot%%\System32\Drivers\etc\hosts>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ECHO #^>^> %%SystemRoot%%\System32\Drivers\etc\hosts>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ECHO # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.^>^> %%SystemRoot%%\System32\Drivers\etc\hosts>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ECHO #^>^> %%SystemRoot%%\System32\Drivers\etc\hosts>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ECHO # This file contains the mappings of IP addresses to host names. Each^>^> %%SystemRoot%%\System32\Drivers\etc\hosts>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ECHO # entry should be kept on an individual line. The IP address should^>^> %%SystemRoot%%\System32\Drivers\etc\hosts>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ECHO # be placed in the first column followed by the corresponding host name.^>^> %%SystemRoot%%\System32\Drivers\etc\hosts>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ECHO # The IP address and the host name should be separated by at least one^>^> %%SystemRoot%%\System32\Drivers\etc\hosts>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ECHO # space.^>^> %%SystemRoot%%\System32\Drivers\etc\hosts>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ECHO #^>^> %%SystemRoot%%\System32\Drivers\etc\hosts>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ECHO # Additionally, comments (such as these) may be inserted on individual^>^> %%SystemRoot%%\System32\Drivers\etc\hosts>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ECHO # lines or following the machine name denoted by a '#' symbol.^>^> %%SystemRoot%%\System32\Drivers\etc\hosts>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ECHO #^>^> %%SystemRoot%%\System32\Drivers\etc\hosts>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ECHO # For example:^>^> %%SystemRoot%%\System32\Drivers\etc\hosts>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ECHO #^>^> %%SystemRoot%%\System32\Drivers\etc\hosts>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ECHO #      102.54.94.97     rhino.acme.com          # source server^>^> %%SystemRoot%%\System32\Drivers\etc\hosts>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ECHO #       38.25.63.10     x.acme.com              # x client host^>^> %%SystemRoot%%\System32\Drivers\etc\hosts>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ECHO:^>^> %%SystemRoot%%\System32\Drivers\etc\hosts>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ECHO # localhost name resolution is handled within DNS itself.^>^> %%SystemRoot%%\System32\Drivers\etc\hosts>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ECHO #	127.0.0.1       localhost^>^> %%SystemRoot%%\System32\Drivers\etc\hosts>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ECHO #	::1             localhost^>^> %%SystemRoot%%\System32\Drivers\etc\hosts>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Remove-Item -Path 'HKLM:\SYSTEM\ControlSet001\Services\dnscrypt-proxy' -Recurse -Force}">> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Set-NetIPInterface}">> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-DnsClient | Set-DnsClientServerAddress -ResetServerAddresses}">> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetFirewallRule -DisplayName '*mDNS*Out)*' | Enable-NetFirewallRule}">> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetFirewallRule -DisplayName 'Core Networking*DNS*Out)' | Enable-NetFirewallRule}">> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Remove-NetFirewallRule -DisplayName 'DNSCrypt Client Proxy'}">> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ^(REG DELETE HKLM\SYSTEM\ControlSet001\Services\SstpSvc\Parameters /V NoCertRevocationCheck /F^)>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO RMDIR /S /Q "%%ProgramFiles%%\dnscrypt-proxy">> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO ENDLOCAL>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"
ECHO MOVE NUL 2^>^&^0>> "%ProgramFiles%\dnscrypt-proxy\backup\Remove_DNSCrypt-Proxy.bat"

ECHO @ECHO OFF> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt_Create_RAR.bat"
ECHO SETLOCAL>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt_Create_RAR.bat"
ECHO CD /D "%%~dp0">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt_Create_RAR.bat"
ECHO REM Create Locked Archive With BLAKE2 HASH / Checksum>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt_Create_RAR.bat"
ECHO IF EXIST "%%UserProfile%%\Desktop\TEMP_DELETE" "%%ProgramFiles%%\WinRAR\Rar.exe" a -oi -oni -ow -k -htb -m5 -ma5 "%%UserProfile%%\Desktop\TEMP_DELETE\DNSCrypt-Proxy-%REV_NUM_%.rar" -r "..\dnscrypt-proxy\*.*">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt_Create_RAR.bat"
ECHO IF NOT EXIST "%%UserProfile%%\Desktop\TEMP_DELETE" "%%ProgramFiles%%\WinRAR\Rar.exe" a -oi -oni -ow -k -htb -m5 -ma5 "%%UserProfile%%\Desktop\DNSCrypt-Proxy-%REV_NUM_%.rar" -r "..\dnscrypt-proxy\*.*">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt_Create_RAR.bat"
ECHO ENDLOCAL>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt_Create_RAR.bat"
ECHO MOVE NUL 2^>^&^0>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt_Create_RAR.bat"

ECHO @ECHO OFF> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO SETLOCAL>> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO CD /D "%%ProgramFiles%%\dnscrypt-proxy">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO XCOPY "hosts" "%%SystemRoot%%\System32\Drivers\etc" /C /I /Q /G /H /R /Y /B /J>> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO ^(REG ADD HKLM\SYSTEM\ControlSet001\Services\SstpSvc\Parameters /V NoCertRevocationCheck /T REG_DWORD /D 00000001 /F^)>> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Add-DnsClientDohServerAddress -ServerAddress 9.9.9.11 -DohTemplate 'https://dns11.quad9.net/dns-query' -AllowFallbackToUdp $False -AutoUpgrade $False;Add-DnsClientDohServerAddress -ServerAddress 149.112.112.11 -DohTemplate 'https://dns11.quad9.net/dns-query' -AllowFallbackToUdp $False -AutoUpgrade $False;}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser -Force}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope LocalMachine -Force}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Set-PSReadLineOption -HistorySaveStyle SaveNothing -MaximumHistoryCount 1}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Write-Output 'Remove-Module PSReadline' | New-Item -Path $PROFILE -Type File -Force}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetAdapter | Enable-NetAdapter}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Set-NetIPInterface}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-DnsClient | Set-DnsClientServerAddress -ResetServerAddresses}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Enable-NetAdapterBinding -AllBindings -IncludeHidden -componentid 'ms_netbios'}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -AllBindings -IncludeHidden -componentid 'ms_netbios'}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -componentid 'ms_tcpip6'}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -componentid 'ms_msclient'}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -componentid 'ms_server'}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -componentid 'ms_pacer'}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -componentid 'ms_implat'}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -componentid 'ms_lldp'}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -componentid 'ms_rspndr'}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-DnsClient | Set-DnsClientServerAddress -ResetServerAddresses}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-DnsClient | Set-DnsClientServerAddress -ServerAddresses ('127.0.0.1','9.9.9.11')}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-DnsClient | Set-DNSClient -RegisterThisConnectionsAddress $False -UseSuffixWhenRegistering $False -ConnectionSpecificSuffix ' '}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetFirewallProfile | Set-NetFirewallProfile -EnableStealthModeForIPsec True}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetFirewallRule -DisplayName '*mDNS*Out)*' | Disable-NetFirewallRule}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetFirewallRule -DisplayName 'Core Networking*DNS*Out)' | Disable-NetFirewallRule}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {New-NetFirewallRule -Action Allow -Direction Outbound -DisplayName 'DNSCrypt Client Proxy' -Profile Any -Program '%%ProgramFiles%%\dnscrypt-proxy\dnscrypt-proxy.exe' -Protocol Any}">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO sc create dnscrypt-proxy binPath= "\"C:\Program Files\dnscrypt-proxy\dnscrypt-proxy.exe\" -config dnscrypt-proxy.toml" group= NetworkProvider displayname= "DNSCrypt Client Proxy">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO sc description dnscrypt-proxy "Encrypted/Authenticated DNS Proxy">> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO sc failureflag dnscrypt-proxy ^1>> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO sc failure dnscrypt-proxy reset= 60 actions= restart/30000/restart/30000/restart/30000/>> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO sc config dnscrypt-proxy start= auto>> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO ENDLOCAL>> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat
ECHO MOVE NUL 2^>^&^0>> "%ProgramFiles%\dnscrypt-proxy\backup\Offline_Setup_DNSCrypt-Proxy.bat

ECHO @ECHO OFF> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO SETLOCAL EnableDelayedExpansion>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO SET CNFG_DNSCRYPTSKP_RSTRT_FLG_=^0>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO SET CNFG_DNSCRYPTSKP_LSTVAR_=^0>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO SET CNFG_DNSCRYPTSKP_TMPVAR_=^0>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF ^[%%1^]==^[^] GOTO CNFG_DNSCRYPTSKP_RST_LBL_1_>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%1==RESET ^(SET CNFG_DNSCRYPTSKP_RSTRT_FLG_=1^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF ^[%%2^]==^[^] GOTO CNFG_DNSCRYPTSKP_RST_LBL_1_>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%1==RESET ^(IF %%2==DISABLE ^(SET CNFG_DNSCRYPTSKP_LSTVAR_=1^)^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%1==NORESET ^(IF %%2==DISABLE ^(SET CNFG_DNSCRYPTSKP_LSTVAR_=1^)^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO :CNFG_DNSCRYPTSKP_RST_LBL_1_>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO DEL /Q "%%~dp0Revision_Num_*.txt" 2^> nul>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO curl --ssl-no-revoke --tlsv1.3 -A "" -w "%%%%{redirect_url}\n" "https://github.com/DNSCrypt/dnscrypt-proxy/releases/latest"^> "%%~dp0Revision_Num_1.txt">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO TYPE "%%~dp0Revision_Num_1.txt"^| FIND "https://github.com/DNSCrypt/dnscrypt-proxy/releases/tag/" /C^> "%%~dp0Revision_Num_3.txt">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO SET /P TMP_NL_CHK=^<"%%~dp0Revision_Num_3.txt">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%TMP_NL_CHK%% EQU 0 GOTO DNSCRYPTSKP_RSTRT_LBL>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO SET /P TMPRV_NM=^<"%%~dp0Revision_Num_1.txt">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO SET REV_NUM_=%%TMPRV_NM:~56%%>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ^("%%ProgramFiles%%\dnscrypt-proxy\dnscrypt-proxy.exe" -version^)^>"%%~dp0Revision_Num_2.txt" 2^>^&^1>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO SET /P TMP_NW_RV=^<"%%~dp0Revision_Num_2.txt">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO curl --parallel-immediate --parallel-max 100 --progress-bar --ssl-no-revoke --tlsv1.3 -LZRA "" "https://big.oisd.nl/domainswild" -o "%%~dp0oisd_big_domainswild.txt" --next ^^>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO --parallel-immediate --progress-bar --ssl-no-revoke --tlsv1.3 -LZRA "" "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-relays.md" -o "%%~dp0odoh-relays.md" --next ^^>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO --parallel-immediate --progress-bar --ssl-no-revoke --tlsv1.3 -LZRA "" "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-servers.md" -o "%%~dp0odoh-servers.md" --next ^^>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO --parallel-immediate --progress-bar --ssl-no-revoke --tlsv1.3 -LZRA "" "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-relays.md.minisig" -o "%%~dp0odoh-relays.md.minisig" --next ^^>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO --parallel-immediate --progress-bar --ssl-no-revoke --tlsv1.3 -LZRA "" "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-servers.md.minisig" -o "%%~dp0odoh-servers.md.minisig" --next ^^>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO --parallel-immediate --progress-bar --ssl-no-revoke --tlsv1.3 -LZRA "" "https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext" -o "%%~dp0hosts">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 0 ^(XCOPY "%%~dp0hosts" "%%SystemRoot%%\System32\Drivers\etc" /C /I /Q /G /H /R /Y /B /J^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 1 ^(ECHO # Copyright ^^(c^^) 1993-2009 Microsoft Corp.^> %%SystemRoot%%\System32\Drivers\etc\hosts^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 1 ^(ECHO #^>^> %%SystemRoot%%\System32\Drivers\etc\hosts^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 1 ^(ECHO # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.^>^> %%SystemRoot%%\System32\Drivers\etc\hosts^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 1 ^(ECHO #^>^> %%SystemRoot%%\System32\Drivers\etc\hosts^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 1 ^(ECHO # This file contains the mappings of IP addresses to host names. Each^>^> %%SystemRoot%%\System32\Drivers\etc\hosts^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 1 ^(ECHO # entry should be kept on an individual line. The IP address should^>^> %%SystemRoot%%\System32\Drivers\etc\hosts^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 1 ^(ECHO # be placed in the first column followed by the corresponding host name.^>^> %%SystemRoot%%\System32\Drivers\etc\hosts^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 1 ^(ECHO # The IP address and the host name should be separated by at least one^>^> %%SystemRoot%%\System32\Drivers\etc\hosts^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 1 ^(ECHO # space.^>^> %%SystemRoot%%\System32\Drivers\etc\hosts^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 1 ^(ECHO #^>^> %%SystemRoot%%\System32\Drivers\etc\hosts^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 1 ^(ECHO # Additionally, comments ^^(such as these^^) may be inserted on individual^>^> %%SystemRoot%%\System32\Drivers\etc\hosts^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 1 ^(ECHO # lines or following the machine name denoted by a '#' symbol.^>^> %%SystemRoot%%\System32\Drivers\etc\hosts^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 1 ^(ECHO #^>^> %%SystemRoot%%\System32\Drivers\etc\hosts^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 1 ^(ECHO # For example:^>^> %%SystemRoot%%\System32\Drivers\etc\hosts^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 1 ^(ECHO #^>^> %%SystemRoot%%\System32\Drivers\etc\hosts^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 1 ^(ECHO #      102.54.94.97     rhino.acme.com          # source server^>^> %%SystemRoot%%\System32\Drivers\etc\hosts^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 1 ^(ECHO #       38.25.63.10     x.acme.com              # x client host^>^> %%SystemRoot%%\System32\Drivers\etc\hosts^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 1 ^(ECHO:^>^> %%SystemRoot%%\System32\Drivers\etc\hosts^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 1 ^(ECHO # localhost name resolution is handled within DNS itself.^>^> %%SystemRoot%%\System32\Drivers\etc\hosts^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 1 ^(ECHO #	127.0.0.1       localhost^>^> %%SystemRoot%%\System32\Drivers\etc\hosts^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 1 ^(ECHO #	::1             localhost^>^> %%SystemRoot%%\System32\Drivers\etc\hosts^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_RSTRT_FLG_%% EQU 1 ^(sc config dnscrypt-proxy start= disabled^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_RSTRT_FLG_%% EQU 1 ^(net stop dnscrypt-proxy^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF NOT %%TMP_NW_RV%%==%%REV_NUM_%% GOTO _PRSE1_CFG_LBL>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%TMP_NW_RV%%==%%REV_NUM_%% GOTO _PRSE2_CFG_LBL>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO :_PRSE1_CFG_LBL>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO ...Updating "DNSCrypt-Proxy" Service>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO MKDIR "%%~dp0backup\%ARCH_WIDTH%">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO curl --progress-bar --ssl-no-revoke --tlsv1.3 -LZRA "" https://github.com/DNSCrypt/dnscrypt-proxy/releases/download/%%REV_NUM_%%/dnscrypt-proxy-%ARCH_WIDTH%-%%REV_NUM_%%.zip -o "%%~dp0dnscrypt-proxy-%ARCH_WIDTH%-%%REV_NUM_%%.zip">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO tar -C "%%~dp0backup" -xf "%%~dp0dnscrypt-proxy-%ARCH_WIDTH%-%%REV_NUM_%%.zip" *exe *pem>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO @ECHO OFF^> "%%ProgramFiles%%\dnscrypt-proxy\backup\%ARCH_WIDTH%\DNSCrypt_Create_RAR.bat">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO SETLOCAL^>^> "%%ProgramFiles%%\dnscrypt-proxy\backup\%ARCH_WIDTH%\DNSCrypt_Create_RAR.bat">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO CD /D "%%%%~dp0"^>^> "%%ProgramFiles%%\dnscrypt-proxy\backup\%ARCH_WIDTH%\DNSCrypt_Create_RAR.bat">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO REM Create Locked Archive With BLAKE2 HASH / Checksum^>^> "%%ProgramFiles%%\dnscrypt-proxy\backup\%ARCH_WIDTH%\DNSCrypt_Create_RAR.bat">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO IF EXIST "%%%%UserProfile%%%%\Desktop\TEMP_DELETE" "%%%%ProgramFiles%%%%\WinRAR\Rar.exe" a -oi -oni -ow -k -htb -m5 -ma5 "%%%%UserProfile%%%%\Desktop\TEMP_DELETE\DNSCrypt-Proxy-%%REV_NUM_%%.rar" -r "..\dnscrypt-proxy\*.*"^>^> "%%ProgramFiles%%\dnscrypt-proxy\backup\%ARCH_WIDTH%\DNSCrypt_Create_RAR.bat">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO IF NOT EXIST "%%%%UserProfile%%%%\Desktop\TEMP_DELETE" "%%%%ProgramFiles%%%%\WinRAR\Rar.exe" a -oi -oni -ow -k -htb -m5 -ma5 "%%%%UserProfile%%%%\Desktop\DNSCrypt-Proxy-%%REV_NUM_%%.rar" -r "..\dnscrypt-proxy\*.*"^>^> "%%ProgramFiles%%\dnscrypt-proxy\backup\%ARCH_WIDTH%\DNSCrypt_Create_RAR.bat">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO ENDLOCAL^>^> "%%ProgramFiles%%\dnscrypt-proxy\backup\%ARCH_WIDTH%\DNSCrypt_Create_RAR.bat">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO MOVE NUL 2^^^>^^^&^^^0^>^> "%%ProgramFiles%%\dnscrypt-proxy\backup\%ARCH_WIDTH%\DNSCrypt_Create_RAR.bat">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO SET CNFG_DNSCRYPTSKP_RSTRT_FLG_=^1>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO sc config dnscrypt-proxy start= disabled>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO net stop dnscrypt-proxy>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO DEL /Q "%%~dp0dnscrypt-proxy-%ARCH_WIDTH%-%%REV_NUM_%%.zip" 2^> nul>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO CD /D "%%~dp0backup\%ARCH_WIDTH%">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO XCOPY "*.*" "%%~dp0" /E /C /I /Q /G /H /R /Y /B /J>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO CD /D "%%~dp0">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO RMDIR /S /Q "%%~dp0backup">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO :_PRSE2_CFG_LBL>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO listen_addresses = ['127.0.0.1:53']^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO max_clients = 2500^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO ipv4_servers = true^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO ipv6_servers = false^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO dnscrypt_servers = true^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO doh_servers = true^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO odoh_servers = true^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO require_dnssec = true^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO require_nolog = true^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO require_nofilter = true^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO disabled_server_names = []^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO force_tcp = false^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO http3 = true^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO timeout = 3000^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO keepalive = ^^5^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO edns_client_subnet = ["0.0.0.0/0", "2001:db8::/32"]^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO blocked_query_response = 'refused'^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO use_syslog = false^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO cert_refresh_delay = 240^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO dnscrypt_ephemeral_keys = true^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO tls_disable_session_tickets = true^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO tls_cipher_suite = [159, 171, 4866, 4867, 49196, 49200, 52392, 52393, 52394, 52396, 52397, 53250]^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO bootstrap_resolvers = ['9.9.9.11:53', '149.112.112.11:53']^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO ignore_system_dns = true^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO netprobe_timeout = -^^1^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO netprobe_address = '9.9.9.11:53'^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO log_files_max_size = ^^1^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO log_files_max_age = ^^1^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO log_files_max_backups = ^^1^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO block_ipv6 = true^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO block_unqualified = true^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO block_undelegated = true^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO reject_ttl = 10^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO cache = true^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO cache_size = 750000^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO cache_min_ttl = 2400^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO cache_max_ttl = 86400^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO cache_neg_min_ttl = 60^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO cache_neg_max_ttl = 600^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO [captive_portals]^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO [local_doh]^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO REM MYSYS2 / Cygwin:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO REM NOTE: Seed File Names - 1024 Bytes ( 2048 HEX CHARACTERS - 4-BIT HEX / BASE-16, NO WHITESPACES, NO DASH, ETC )>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO REM 1.) cd '/C/Program Files/dnscrypt-proxy/'>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO REM 2.) openssl genpkey -genparam -algorithm EC -out localhost_param.pem -pkeyopt ec_paramgen_curve:secp521r1 -pkeyopt ec_param_enc:named_curve>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO REM 3.) openssl ecparam -noout -in localhost_param.pem -rand Teapot_Kitten_Megasize.txt -genkey -out localhost_key.pem>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO REM 5A.) openssl req -nodes -x509 -SHA512 -days %TMP_DATE_CHK% -newkey EC:localhost_param.pem -key localhost_key.pem -out localhost_cert.pem -subj /C='CH'/ST='Duck Socks Bathtub Fizzing State'/O='Period Panda Bear Watermelon Llama Drama'/CN='Penguin Fiefdom Foil Socks Jamboree' -addext basicConstraints=critical,CA:FALSE,pathlen:1 -addext keyUsage=critical,digitalSignature,nonRepudiation,keyEncipherment,dataEncipherment,keyAgreement,keyCertSign,cRLSign,encipherOnly,decipherOnly -addext extendedKeyUsage=critical,serverAuth,clientAuth,codeSigning,emailProtection,timeStamping,OCSPSigning,msCTLSign,msEFS>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO REM 5B.) openssl req -nodes -x509 -SHA512 -days %TMP_DATE_CHK% -newkey EC:localhost_param.pem -key localhost_key.pem -out localhost_cert.pem -subj /subjectAltName=IP:'127.0.0.1'+C='CH'+ST='Duck Socks Bathtub Fizzing State'+O='Period Panda Bear Watermelon Llama Drama'+CN='Penguin Fiefdom Foil Socks Jamboree' -addext basicConstraints=critical,CA:FALSE,pathlen:1 -addext keyUsage=critical,digitalSignature,nonRepudiation,keyEncipherment,dataEncipherment,keyAgreement,keyCertSign,cRLSign,encipherOnly,decipherOnly -addext extendedKeyUsage=critical,serverAuth,clientAuth,codeSigning,emailProtection,timeStamping,OCSPSigning,msCTLSign,msEFS>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO REM 6.) openssl x509 -outform der -in localhost_cert.pem -out localhost_cert.crt>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO REM Windows 10 / 11:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO REM 7.) ^(IF %%Processor_Architecture%%==ARM64 ^(SDELETE64A -ACCEPTEULA -R -NOBANNER "%%ProgramFiles%%\dnscrypt-proxy\localhost_param.pem" "%%ProgramFiles%%\dnscrypt-proxy\Teapot_Kitten_Megasize.txt"^)^)^&^(IF %%Processor_Architecture%%==AMD64 ^(SDELETE64 -ACCEPTEULA -R -NOBANNER "%%ProgramFiles%%\dnscrypt-proxy\localhost_param.pem" "%%ProgramFiles%%\dnscrypt-proxy\Teapot_Kitten_Megasize.txt"^)^)^&^(IF %%Processor_Architecture%%==x86 ^(SDELETE -ACCEPTEULA -R -NOBANNER "%%ProgramFiles%%\dnscrypt-proxy\localhost_param.pem" "%%ProgramFiles%%\dnscrypt-proxy\Teapot_Kitten_Megasize.txt"^)^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO REM 8.) "Update GlobalSign Root Certificate - Windows XP & Windows 2000" -^> "https://support.globalsign.com/ca-certificates/root-certificates/update-globalsign-root-certificate-windows-xp-windows-2000">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO REM PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Remove-DnsClientDohServerAddress -ServerAddress 127.0.0.1}">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO REM ECHO listen_addresses = ['127.0.0.1:3000']^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO REM ECHO path = '/dns-query'^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO REM ECHO cert_file = 'localhost_cert.pem'^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO REM ECHO cert_key_file = 'localhost_key.pem'^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO REM PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Add-DnsClientDohServerAddress -ServerAddress 127.0.0.1 -DohTemplate 'https://127.0.0.1:3000/dns-query' -AllowFallbackToUdp $False -AutoUpgrade $False}">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO [query_log]^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO format = 'tsv'^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO [nx_log]^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO format = 'tsv'^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO [blocked_names]^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_LSTVAR_%% EQU 0 ^(ECHO blocked_names_file = 'oisd_big_domainswild.txt'^>^> "%%~dp0dnscrypt-proxy.toml"^)>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO [blocked_ips]^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO [allowed_names]^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO [allowed_ips]^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO [schedules]^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO [sources]^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO [sources.'odoh-servers']^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO urls = ['https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-servers.md', 'https://download.dnscrypt.info/resolvers-list/v3/odoh-servers.md', 'https://ipv6.download.dnscrypt.info/resolvers-list/v3/odoh-servers.md', 'https://download.dnscrypt.net/resolvers-list/v3/odoh-servers.md']^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO cache_file = 'odoh-servers.md'^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO minisign_key = 'RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3'^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO refresh_delay = 168^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO prefix = ''^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO [sources.'odoh-relays']^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO urls = ['https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-relays.md', 'https://download.dnscrypt.info/resolvers-list/v3/odoh-relays.md', 'https://ipv6.download.dnscrypt.info/resolvers-list/v3/odoh-relays.md', 'https://download.dnscrypt.net/resolvers-list/v3/odoh-relays.md']^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO cache_file = 'odoh-relays.md'^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO minisign_key = 'RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3'^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO refresh_delay = 168^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO prefix = ''^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO [broken_implementations]^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO fragments_blocked = ['cisco', 'cisco-ipv6', 'cisco-familyshield', 'cisco-familyshield-ipv6', 'cleanbrowsing-adult', 'cleanbrowsing-adult-ipv6', 'cleanbrowsing-family', 'cleanbrowsing-family-ipv6', 'cleanbrowsing-security', 'cleanbrowsing-security-ipv6']^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO [doh_client_x509_auth]^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO [anonymized_dns]^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO routes = [ { server_name='*', via=['*'] } ]^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO skip_incompatible = true^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO [dns64]^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO [static]^>^> "%%~dp0dnscrypt-proxy.toml">> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO:>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO IF %%CNFG_DNSCRYPTSKP_RSTRT_FLG_%% EQU 0 GOTO DNSCRYPTSKP_RSTRT_LBL>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ECHO ...Restarting "DNSCrypt-Proxy" Service>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO sc config dnscrypt-proxy start= auto>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO net start dnscrypt-proxy>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO :DNSCRYPTSKP_RSTRT_LBL>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO DEL /Q "%%~dp0Revision_Num_*.txt" 2^> nul>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO ENDLOCAL DisableDelayedExpansion>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"
ECHO MOVE NUL 2^>^&^0>> "%ProgramFiles%\dnscrypt-proxy\backup\DNSCrypt-Proxy-Update-Sources_C.bat"

curl --progress-bar --ssl-no-revoke --tlsv1.3 -LZRA "" "https://github.com/DNSCrypt/dnscrypt-proxy/releases/download/%REV_NUM_%/dnscrypt-proxy-%ARCH_WIDTH%-%REV_NUM_%.zip" -o "%ProgramFiles%\dnscrypt-proxy\dnscrypt-proxy-%ARCH_WIDTH%-%REV_NUM_%.zip"
tar -xf "dnscrypt-proxy-%ARCH_WIDTH%-%REV_NUM_%.zip" -C ".\backup"
CD /D "%ProgramFiles%\dnscrypt-proxy\backup\%ARCH_WIDTH%"
XCOPY "dnscrypt-proxy.exe" "%ProgramFiles%\dnscrypt-proxy\backup" /C /I /Q /G /H /R /Y /B /J
XCOPY "localhost.pem" "%ProgramFiles%\dnscrypt-proxy\backup" /C /I /Q /G /H /R /Y /B /J
CD /D "%ProgramFiles%\dnscrypt-proxy\backup"
RMDIR /S /Q "%ARCH_WIDTH%"
curl --parallel-immediate --parallel-max 100 --progress-bar --ssl-no-revoke --tlsv1.3 -LZRA "" "https://big.oisd.nl/domainswild" -o "%ProgramFiles%\dnscrypt-proxy\backup\oisd_big_domainswild.txt" --next ^
--parallel-immediate --progress-bar --ssl-no-revoke --tlsv1.3 -LZRA "" "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-relays.md" -o "%ProgramFiles%\dnscrypt-proxy\backup\odoh-relays.md" --next ^
--parallel-immediate --progress-bar --ssl-no-revoke --tlsv1.3 -LZRA "" "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-servers.md" -o "%ProgramFiles%\dnscrypt-proxy\backup\odoh-servers.md" --next ^
--parallel-immediate --progress-bar --ssl-no-revoke --tlsv1.3 -LZRA "" "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-relays.md.minisig" -o "%ProgramFiles%\dnscrypt-proxy\backup\odoh-relays.md.minisig" --next ^
--parallel-immediate --progress-bar --ssl-no-revoke --tlsv1.3 -LZRA "" "https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-servers.md.minisig" -o "%ProgramFiles%\dnscrypt-proxy\backup\odoh-servers.md.minisig" --next ^
--parallel-immediate --progress-bar --ssl-no-revoke --tlsv1.3 -LZRA "" "https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext" -o "%ProgramFiles%\dnscrypt-proxy\backup\hosts"
XCOPY "hosts" "%SystemRoot%\System32\Drivers\etc" /C /I /Q /G /H /R /Y /B /J

ECHO listen_addresses = ['127.0.0.1:53']> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO max_clients = 2500>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO ipv4_servers = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO ipv6_servers = false>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO dnscrypt_servers = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO doh_servers = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO odoh_servers = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO require_dnssec = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO require_nolog = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO require_nofilter = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO disabled_server_names = []>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO force_tcp = false>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO http3 = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO timeout = 3000>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO keepalive = ^5>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO edns_client_subnet = ["0.0.0.0/0", "2001:db8::/32"]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO blocked_query_response = 'refused'>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO use_syslog = false>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO cert_refresh_delay = 240>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO dnscrypt_ephemeral_keys = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO tls_disable_session_tickets = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO tls_cipher_suite = [159, 171, 4866, 4867, 49196, 49200, 52392, 52393, 52394, 52396, 52397, 53250]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO bootstrap_resolvers = ['9.9.9.11:53', '149.112.112.11:53']>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO ignore_system_dns = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO netprobe_timeout = -^1>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO netprobe_address = '9.9.9.11:53'>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO log_files_max_size = ^1>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO log_files_max_age = ^1>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO log_files_max_backups = ^1>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO block_ipv6 = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO block_unqualified = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO block_undelegated = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO reject_ttl = 10>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO cache = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO cache_size = 750000>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO cache_min_ttl = 2400>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO cache_max_ttl = 86400>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO cache_neg_min_ttl = 60>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO cache_neg_max_ttl = 600>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [captive_portals]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [local_doh]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [query_log]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO format = 'tsv'>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [nx_log]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO format = 'tsv'>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [blocked_names]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO blocked_names_file = 'oisd_big_domainswild.txt'>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [blocked_ips]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [allowed_names]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [allowed_ips]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [schedules]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [sources]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [sources.'odoh-servers']>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO urls = ['https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-servers.md', 'https://download.dnscrypt.info/resolvers-list/v3/odoh-servers.md', 'https://ipv6.download.dnscrypt.info/resolvers-list/v3/odoh-servers.md', 'https://download.dnscrypt.net/resolvers-list/v3/odoh-servers.md']>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO cache_file = 'odoh-servers.md'>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO minisign_key = 'RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3'>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO refresh_delay = 168>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO prefix = ''>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [sources.'odoh-relays']>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO urls = ['https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/odoh-relays.md', 'https://download.dnscrypt.info/resolvers-list/v3/odoh-relays.md', 'https://ipv6.download.dnscrypt.info/resolvers-list/v3/odoh-relays.md', 'https://download.dnscrypt.net/resolvers-list/v3/odoh-relays.md']>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO cache_file = 'odoh-relays.md'>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO minisign_key = 'RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3'>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO refresh_delay = 168>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO prefix = ''>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [broken_implementations]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO fragments_blocked = ['cisco', 'cisco-ipv6', 'cisco-familyshield', 'cisco-familyshield-ipv6', 'cleanbrowsing-adult', 'cleanbrowsing-adult-ipv6', 'cleanbrowsing-family', 'cleanbrowsing-family-ipv6', 'cleanbrowsing-security', 'cleanbrowsing-security-ipv6']>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [doh_client_x509_auth]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [anonymized_dns]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO routes = [ { server_name='*', via=['*'] } ]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO skip_incompatible = true>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [dns64]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"
ECHO [static]>> "%ProgramFiles%\dnscrypt-proxy\backup\dnscrypt-proxy.toml"

DEL /Q "%ProgramFiles%\dnscrypt-proxy\dnscrypt-proxy-%ARCH_WIDTH%-%REV_NUM_%.zip" 2> nul

XCOPY "*.*" "%ProgramFiles%\dnscrypt-proxy" /E /C /I /Q /G /H /R /Y /B /J
CD /D "%ProgramFiles%\dnscrypt-proxy"
RMDIR /S /Q "%ProgramFiles%\dnscrypt-proxy\backup"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser -Force}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope LocalMachine -Force}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Set-PSReadLineOption -HistorySaveStyle SaveNothing -MaximumHistoryCount 1}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Write-Output 'Remove-Module PSReadline' | New-Item -Path $PROFILE -Type File -Force}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetAdapter | Enable-NetAdapter}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Set-NetIPInterface}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-DnsClient | Set-DnsClientServerAddress -ResetServerAddresses}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Enable-NetAdapterBinding -AllBindings -IncludeHidden -componentid 'ms_netbios'}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -AllBindings -IncludeHidden -componentid 'ms_netbios'}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -componentid 'ms_tcpip6'}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -componentid 'ms_msclient'}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -componentid 'ms_server'}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -componentid 'ms_pacer'}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -componentid 'ms_implat'}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -componentid 'ms_lldp'}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetAdapterBinding | Disable-NetAdapterBinding -componentid 'ms_rspndr'}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-DnsClient | Set-DnsClientServerAddress -ResetServerAddresses}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-DnsClient | Set-DnsClientServerAddress -ServerAddresses ('127.0.0.1','9.9.9.11')}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-DnsClient | Set-DNSClient -RegisterThisConnectionsAddress $False -UseSuffixWhenRegistering $False -ConnectionSpecificSuffix ' '}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetFirewallProfile | Set-NetFirewallProfile -EnableStealthModeForIPsec True}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetFirewallRule -DisplayName '*mDNS*Out)*' | Disable-NetFirewallRule}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Get-NetFirewallRule -DisplayName 'Core Networking*DNS*Out)' | Disable-NetFirewallRule}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {New-NetFirewallRule -Action Allow -Direction Outbound -DisplayName 'DNSCrypt Client Proxy' -Profile Any -Program '%ProgramFiles%\dnscrypt-proxy\dnscrypt-proxy.exe' -Protocol Any}"
sc create dnscrypt-proxy binPath= "\"C:\Program Files\dnscrypt-proxy\dnscrypt-proxy.exe\" -config dnscrypt-proxy.toml" group= NetworkProvider displayname= "DNSCrypt Client Proxy"
sc description dnscrypt-proxy "Encrypted/Authenticated DNS Proxy"
sc failureflag dnscrypt-proxy 1
sc failure dnscrypt-proxy reset= 60 actions= restart/30000/restart/30000/restart/30000/
sc config dnscrypt-proxy start= auto
net start dnscrypt-proxy
:CNFGDNSCRYPT_SKP_LST_LBL
DEL /Q "Revision_Num_*.txt" 2> nul
ENDLOCAL DisableDelayedExpansion
MOVE NUL 2>&0

 

NOTE: You may have to install WSL first through the command line to utilize BSDTar / cURL.


(2.) Use Notepad to create this file on your desktop or another folder: Auto_Update_WSL.bat

 

@ECHO OFF
SETLOCAL
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser -Force}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope LocalMachine -Force}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Set-PSReadLineOption -HistorySaveStyle SaveNothing -MaximumHistoryCount 1}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Write-Output 'Remove-Module PSReadline' | New-Item -Path $PROFILE -Type File -Force}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Install-PackageProvider -Name PowerShellGet -Scope AllUsers -Force}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Install-PackageProvider -Name NuGet -Scope AllUsers -Force}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Install-PackageProvider -Name WinGet -Scope AllUsers -Force}"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& {Register-PackageSource -Name 'Nuget Gallery' -Location https://api.nuget.org/v3/index.json -Trusted -Force -ProviderName NuGet}"
DISM /Online /Enable-Feature /All /Norestart /FeatureName:Microsoft-Windows-Subsystem-Linux
DISM /Online /Enable-Feature /All /Norestart /FeatureName:VirtualMachinePlatform
DISM /Online /Enable-Feature /All /Norestart /FeatureName:HypervisorPlatform
REM NOTE: If the "Microsoft App Installer" doesn't install, then you have to go into the Microsoft Store ( App ) and hit the "Retry" button.
winget install 9NBLGGH4NNS1 --silent --accept-package-agreements --accept-source-agreements
winget install Microsoft.VCRedist.2015+.x86 --silent --accept-package-agreements --accept-source-agreements
winget install Microsoft.VCRedist.2015+.x64 --silent --accept-package-agreements --accept-source-agreements
ENDLOCAL
MOVE NUL 2>&0

 

DISCLAIMER: One obvious limitation with this, is that ODoH support is still in the beta stages. It is possible to automate updating the block lists or the program itself, but it's actually NEVER been a feature of this particular stub resolver to begin with. An entry would have to be added utilizing the task scheduler, which would call a program or library that utilized the SENS API to wait for network access ( WAN response, ) which at that point it would be able to patch itself unattended:


Task Scheduler for developers | System Event Notification Service (SENS)


With this particular setup, often you can just choose a fixed date and time to update it, or even script it via the command line:

 

Update With Blocklists Enabled:

CMD /Q /C START /MIN /REALTIME /WAIT /B C:\PROGRA~1\DNSCRY~1\DNSCrypt-Proxy-Update-Sources_C.bat
CMD /Q /C START /MIN /REALTIME /WAIT /B C:\PROGRA~1\DNSCRY~1\DNSCrypt-Proxy-Update-Sources_C.bat NORESET ENABLE

Update With Blocklists Disabled:

CMD /Q /C START /MIN /REALTIME /WAIT /B C:\PROGRA~1\DNSCRY~1\DNSCrypt-Proxy-Update-Sources_C.bat NORESET DISABLE

Update, Restart The Proxy Service, With Blocklists Enabled:

CMD /Q /C START /MIN /REALTIME /WAIT /B C:\PROGRA~1\DNSCRY~1\DNSCrypt-Proxy-Update-Sources_C.bat RESET ENABLE

Update, Restart The Proxy Service, With Blocklists Disabled:

CMD /Q /C START /MIN /REALTIME /WAIT /B C:\PROGRA~1\DNSCRY~1\DNSCrypt-Proxy-Update-Sources_C.bat RESET DISABLE


Alternate:


Update With Blocklists Enabled:

CMD /Q /C START /MIN /REALTIME C:\PROGRA~1\DNSCRY~1\DNSCrypt-Proxy-Update-Sources_C.bat
CMD /Q /C START /MIN /REALTIME C:\PROGRA~1\DNSCRY~1\DNSCrypt-Proxy-Update-Sources_C.bat NORESET ENABLE

Update With Blocklists Disabled:

CMD /Q /C START /MIN /REALTIME C:\PROGRA~1\DNSCRY~1\DNSCrypt-Proxy-Update-Sources_C.bat NORESET DISABLE

Update, Restart The Proxy Service, With Blocklists Enabled:

CMD /Q /C START /MIN /REALTIME C:\PROGRA~1\DNSCRY~1\DNSCrypt-Proxy-Update-Sources_C.bat RESET ENABLE

Update, Restart The Proxy Service, With Blocklists Disabled:

CMD /Q /C START /MIN /REALTIME C:\PROGRA~1\DNSCRY~1\DNSCrypt-Proxy-Update-Sources_C.bat RESET DISABLE

 

1 Reply

@Mousefluff Example: Generic Configuration Guide For Using Firefox Portable And Vivaldi Portable ( Standalone ) In Conjunction With DNSCrypt-Proxy 2.x On Windows 10 / 11:

Misc Addons:

Adblock Plus: https://chrome.google.com/webstore/detail/adblock-plus-free-ad-bloc/cfhdojbkjhnklbpkdaibdccddilifddb
(Firefox: https://addons.mozilla.org/en-US/firefox/addon/adblock-plus/ )
Adblock: https://chrome.google.com/webstore/detail/adblock-%E2%80%94-best-ad-blocker/gighmmpiobklfepjocnamgkkbiglidom
(Firefox: https://addons.mozilla.org/en-US/firefox/addon/adblock-for-firefox )
Dark Mode: https://chrome.google.com/webstore/detail/dark-mode/dmghijelimhndkbmpgbldicpogfkceaj
(Firefox: https://addons.mozilla.org/en-US/firefox/addon/dark-mode-webextension/ )
Dark Reader: https://chrome.google.com/webstore/detail/dark-reader/eimadpbcbfnmbkopoojfekhnkhdbieeh
(Firefox: https://addons.mozilla.org/en-US/firefox/addon/darkreader/ )
Disable HTML5 Autoplay: https://chrome.google.com/webstore/detail/disable-html5-autoplay/efdhoaajjjgckpbkoglidkeendpkolai
Go Back With Backspace: https://chrome.google.com/webstore/detail/go-back-with-backspace/eekailopagacbcdloonjhbiecobagjci
High Contrast: https://chrome.google.com/webstore/detail/high-contrast/djcfdncoelnlbldjfhinnjlhdjlikmph
User-Agent Switcher and Manager: https://chrome.google.com/webstore/detail/user-agent-switcher-and-m/bhchdcejhohfmigjafbampogmaanbfkg
(Firefox: https://addons.mozilla.org/en-US/firefox/addon/user-agent-string-switcher/ )


Firefox Portable:


Disable Automatic Effiency Mode -> about:config -> dom.ipc.processPriorityManager.backgroundUsesEcoQoS = false

Firefox -> about:config -> fission.webContentIsolationStrategy -> 1

Firefox -> about:preferences#home -> New Windows and Tabs -> Homepage and new windows -> Firefox Home (Default)
Firefox -> about:preferences#home -> New Windows and Tabs -> New tabs -> Firefox Home (Default)
Firefox -> about:preferences#home -> Firefox Home Content -> Disable: Web Search
Firefox -> about:preferences#home -> Firefox Home Content -> Disable All: Shortcuts -> 1 row
Firefox -> about:preferences#home -> Firefox Home Content -> Disable All: Recommended by Pocket
Firefox -> about:preferences#home -> Firefox Home Content -> Disable All: Recent activity -> 1 row
Firefox -> about:preferences#home -> Firefox Home Content -> Disable: Snippets

Firefox -> about:preferences#search -> Search Bar -> Use the address bar for search and navigation
Firefox -> about:preferences#search -> Search Suggestions -> Disable All: Provide search suggestions

Firefox -> about:preferences#privacy -> Browser Privacy -> Strict
Firefox -> about:preferences#privacy -> Send websites a "Do Not Track" signal that you don't want to be tracked Learn more -> Only when Firefox is set to block known trackers
Firefox -> about:preferences#privacy -> Cookies and Site Data -> Enable: Delete cookies and site data when Firefox is closed
Firefox -> about:preferences#privacy -> Logins and Passwords -> Disable All: Ask to save logins and passwords for websites
Firefox -> about:preferences#privacy -> Logins and Passwords -> Disable: Show alerts about passwords for breached websites
Firefox -> about:preferences#privacy -> Logins and Passwords -> Disable: Allow Windows single sign-on for Microsoft, work, and school accounts
Firefox -> about:preferences#privacy -> Forms and Autofill -> Disable Autofill
Firefox -> about:preferences#privacy -> History -> Firefox will -> Use custom settings for history
Firefox -> about:preferences#privacy -> History -> Enable: Clear history when Firefox closes
Firefox -> about:preferences#privacy -> History -> Settings for Clearing History -> History -> Browsing & download history
Firefox -> about:preferences#privacy -> History -> Settings for Clearing History -> History -> Active logins
Firefox -> about:preferences#privacy -> History -> Settings for Clearing History -> History -> Form & search history
Firefox -> about:preferences#privacy -> History -> Settings for Clearing History -> History -> Cookies
Firefox -> about:preferences#privacy -> History -> Settings for Clearing History -> History -> Cache
Firefox -> about:preferences#privacy -> History -> Settings for Clearing History -> Data -> Site settings
Firefox -> about:preferences#privacy -> History -> Settings for Clearing History -> Data -> Offline website data
Firefox -> about:preferences#privacy -> Address Bar — Firefox Suggest -> Disable: Browsing history
Firefox -> about:preferences#privacy -> Address Bar — Firefox Suggest -> Disable: Bookmarks
Firefox -> about:preferences#privacy -> Address Bar — Firefox Suggest -> Disable: Open tabs
Firefox -> about:preferences#privacy -> Address Bar — Firefox Suggest -> Disable: Shortcuts
Firefox -> about:preferences#privacy -> Address Bar — Firefox Suggest -> Disable: Search engines
Firefox -> about:preferences#privacy -> Address Bar — Firefox Suggest -> Disable: Suggestions from the web
Firefox -> about:preferences#privacy -> Address Bar — Firefox Suggest -> Disable: Suggestions from sponsors
Firefox -> about:preferences#privacy -> Address Bar — Firefox Suggest -> Disable: Improve the Firefox Suggest experience
Firefox -> about:preferences#privacy -> Permissions -> Location -> Settings... -> Enable: Block new requests asking to access your location -> Save Changes
Firefox -> about:preferences#privacy -> Permissions -> Camera -> Settings... -> Enable: Block new requests asking to access your camera -> Save Changes
Firefox -> about:preferences#privacy -> Permissions -> Microphone -> Settings... -> Enable: Block new requests asking to access your microphone -> Save Changes
Firefox -> about:preferences#privacy -> Permissions -> Speaker Selection -> Settings... -> Remove All Websites ( If Any Exist ) -> Save Changes
Firefox -> about:preferences#privacy -> Permissions -> Notifications -> Settings... -> Enable: Block new requests asking to allow notifications
Firefox -> about:preferences#privacy -> Permissions -> Autoplay -> Settings... -> Remove All Websites ( If Any Exist ) -> Save Changes
Firefox -> about:preferences#privacy -> Permissions -> Virtual Reality -> Settings... -> Enable: Block new requests asking to access your virtual reality devices -> Save Changes
Firefox -> about:preferences#privacy -> Permissions -> Enable: Block pop-up windows -> Remove All Websites ( If Any Exist ) -> Save Changes
Firefox -> about:preferences#privacy -> Permissions -> Enable: Warn you when websites try to install add-ons
Firefox -> about:preferences#privacy -> Firefox Data Collection and Use -> Disable: Allow Firefox to send technical and interaction data to Mozilla
Firefox -> about:preferences#privacy -> Firefox Data Collection and Use -> Disable: Allow Firefox to make personalized extension recommendations
Firefox -> about:preferences#privacy -> Firefox Data Collection and Use -> Disable: Allow Firefox to install and run studies
Firefox -> about:preferences#privacy -> Firefox Data Collection and Use -> Disable: Allow Firefox to send backlogged crash reports on your behalf Learn more
Firefox -> about:preferences#privacy -> Security -> Deceptive Content and Dangerous Software Protection -> Disable: Block dangerous and deceptive content
Firefox -> about:preferences#privacy -> Security -> Certificates -> Enable: Query OCSP responder servers to confirm the current validity of certificates
Firefox -> about:preferences#privacy -> HTTPS-Only Mode -> Enable HTTPS-Only Mode in all windows
Firefox -> about:preferences#privacy -> DNS over HTTPS -> Off ( Use your default DNS resolver )

Firefox -> Adblock -> Options -> General -> General Options -> Enable: Add items to the right click menu
Firefox -> Adblock -> Options -> General -> General Options -> Enable: Show number of ads blocked on AdBlock button
Firefox -> Adblock -> Options -> General -> General Options -> Enable: I'm an advanced user, show me advanced options
Firefox -> Adblock -> Options -> Filter lists -> Ad Blocking Filter Lists -> Enable: AdBlock custom filters
Firefox -> Adblock -> Options -> Filter lists -> Ad Blocking Filter Lists -> Enable: Anti-Circumvention filters
Firefox -> Adblock -> Options -> Filter lists -> Other Filter Lists -> Enable: Adblock Warning Removal list
Firefox -> Adblock -> Options -> Filter lists -> Other Filter Lists -> Enable: Antisocial filter list
Firefox -> Adblock -> Options -> Filter lists -> Other Filter Lists -> Enable: Cryptocurrency (Bitcoin) Mining Protection List
Firefox -> Adblock -> Options -> Filter lists -> Other Filter Lists -> Enable: Fanboy's Annoyances
Firefox -> Adblock -> Options -> Filter lists -> Other Filter Lists -> Enable: I Don't Care About Cookies
Firefox -> Adblock -> Options -> Filter lists -> Custom Filter Lists -> Spam404 -> https://raw.githubusercontent.com/Spam404/lists/master/adblock-list.txt
Firefox -> Adblock -> Options -> Filter lists -> Custom Filter Lists -> EasyPrivacy+EasyList -> https://easylist-downloads.adblockplus.org/easyprivacy+easylist.txt
Firefox -> Adblock -> Options -> Filter lists -> Custom Filter Lists -> CPBL Filters for ABP & uBO -> https://raw.githubusercontent.com/bongochong/CombinedPrivacyBlockLists/master/cpbl-abp-list.txt
Firefox -> Adblock -> Options -> Filter lists -> Custom Filter Lists -> Peter Lowe's list -> https://pgl.yoyo.org/adservers/serverlist.php?hostformat=adblockplus&showintro=0&mimetype=plaintext
Firefox -> Adblock -> Options -> Filter lists -> Custom Filter Lists -> OISD Big -> https://big.oisd.nl


Vivaldi Portable (Standalone):


Vivaldi -> F4 to Open ( Toggle Panel ) -> Right-Click on Item ( Mastodon - https://www.social.vivaldi.net ) -> Edit -> Remove From Toolbar -> F4 to Close ( Toggle Panel )
Vivaldi -> F4 to Open ( Toggle Panel ) -> Right-Click on Item ( Vivaldi Help - https://help.vivaldi.com ) -> Edit -> Remove From Toolbar -> F4 to Close ( Toggle Panel )
Vivaldi -> F4 to Open ( Toggle Panel ) -> Right-Click on Item ( Wikipedia - https://wikipedia.org ) -> Edit -> Remove From Toolbar -> F4 to Close ( Toggle Panel )
Vivaldi -> F4 to Open ( Toggle Panel ) -> Right-Click on Item ( Add Web Panel / Plus Symbol / + ) -> Closed Web Panels -> Clear All -> F4 to Close ( Toggle Panel )

Vivaldi: vivaldi://flags -> Auto Dark Mode for Web Contents (Enable)
Vivaldi: vivaldi://flags -> Experimental QUIC protocol (Enable)
Vivaldi: vivaldi://flags -> Enable Isolated Web Apps (Enable)
Vivaldi: vivaldi://flags -> Strict-Origin-Isolation (Enable)
Vivaldi: vivaldi://flags -> Origin-keyed Processes by default (Enable)
Vivaldi: vivaldi://flags -> Isolated sandboxed iframes (Enable)
Vivaldi: vivaldi://flags -> TLS 1.3 hybridized Kyber support (Enable)
Vivaldi: vivaldi://flags -> Async DNS resolver (Disable)
Vivaldi: vivaldi://net-internals/#dns -> Host resolver cache -> Clear host cache
Vivaldi: vivaldi://flags -> Windows 11 Mica titlebar (Enable)
Vivaldi: vivaldi://flags -> Sanitizer API (Enable)
Vivaldi: vivaldi://flags -> Compression dictionary transport (Enable)
Vivaldi: vivaldi://flags -> Compression dictionary transport backend (Enable)
Vivaldi: vivaldi://flags -> Zstd Content-Encoding (Enable)
Vivaldi: vivaldi://flags -> Shared Zstd (Enable)
Vivaldi: vivaldi://flags -> Compress IndexedDB values (Enable)
Vivaldi: vivaldi://flags -> Block insecure private network requests (Enable)
Vivaldi: vivaldi://flags -> Parallel downloading (Enable)

NOTE: Most other Vivaldi settings not mentioned here could in theory be disabled (Examples: Disable Google Services / Extensions, Disable Broadcast IP for Best WebRTC Performance, etc.)

Vivaldi Settings: General
Startup -> Homepage -> Start Page
Startup with -> Start Page

Vivaldi Settings: Appearance
Window Appearance -> Use Animation
Window Appearance -> Use Buttons in Range Controls
Window Appearance -> Fade Colors in Background Windows
Status Bar -> Hide Status Bar
Menu -> Menu Position -> Vivaldi Button
Menu -> Menu Icon Style -> Vivaldi Icon
Menu -> Menu Customization -> Vivaldi Button Menu

Vivaldi Settings: Start Page
Start Page Navigation -> Hide Titles
Speed Dial -> Speed Dial Appearance -> Show Title
Speed Dial -> Maximum Columns -> 1
Speed Dial -> Speed Dial Thumbnail Size -> Small

Vivaldi Settings: Tabs
Tabs -> Show Tab Bar
New Tab Page -> Start Page
New Tab Position -> After Related Tabs
Closed Tab Position -> Next to Original Tab
Close Tab Activation -> Activate Above in Tab Order
Tab Handling -> Align Next Close Button
Tab Display -> Tab Bar -> Remove Tab Spacing in Maximized Windows
Tab Display -> Tab Bar -> Display Trash Can
Tab Display -> Tab Bar -> Display Synced Tabs Button
Tab Display -> Tab Options -> Display Close Button -> Permanently
Tab Display -> Tab Options -> Use Unread Indicators
Tab Display -> Page Load Progress -> Progress Bar
Tab Features -> Tab Cycling -> Cycle in Recently Used Order
Tab Features -> Tab Selection -> Enable Tab Selection
Tab Features -> Tab Selection -> Include Active Tab in Initial Selection
Tab Features -> Tab Stacking -> Disable
Tab Features -> Tab Stack Options -> Open Tabs in Current Tab Stack
Tab Features -> Tab Stack Options -> Allow Stacking by Drag and Drop
Tab Features -> Tab Stack Options -> Stacking Drop Delay -> 3/5 ( Middle Slider )
Tab Features -> Pinned Tabs -> Don't Close Pinned Tabs
Tab Features -> Pinned Tabs -> Show Separator Below Pinned Tabs
Tab Features -> Mute Tab Audio -> Play All Audio

Vivaldi Settings: Panel
Panels -> Panel Position -> Left Side

Vivaldi Settings: Address Bar
Address Bar -> Show Address Bar
Address Bar Position -> Top
Address Field Options -> Show Full Address
Address Field Options -> Select Address on Activation
Address Field Options -> Copy and Cut Encoded Address
Address Field Options -> Page Load Progress Bar
Address Field Options -> QR Code Generator
Open Address in New Tab -> Shift + Enter

Extension Visibility -> Toggle Only Hidden Extensions
Security Features -> Always Use Secure Connection (HTTPS)
Security Features -> Strip JavaScript from Pasted Text
Security Features -> Highlight Base Domain in Address

Vivaldi Settings: Bookmarks
Bookmarks -> Fetch Bookmark Data from Page Metadata
Bookmark Bar -> Show Bookmark Bar
Bookmark Bar -> Select Bookmark Bar Folder -> Bookmarks Bar
Bookmark Bar -> Bookmark Bar Position -> Top
Bookmark Bar -> Bookmark Bar Display -> Text and Icon

Vivaldi Settings: Keyboard
Focus Cycling -> Cycle All
Full Keyboard Access -> Focus All Controls
Keyboard Shortcuts -> Enable Keyboard Shortcuts
Keyboard Shortcuts -> Space Key to Fast Forward
Keyboard Shortcuts -> Alt Key for Main Menu

Vivaldi Settings: Search
Default Search Engine: Google
Search Field Display -> Show as a Text Field
Search Field Display -> Show Search Engine Nickname in Drop-Down Menu
Private Window Search Engine: Google
Search Options -> Show Search Field on Speed Dial
Search Options -> Page Selection Search in Background
Image Search Engine: Google

Vivaldi Settings: Privacy and Security
Save Browsing History -> Session Only
Tracking Prevention -> Block Hyperlink Audit Tracking
Default Permissions -> Autoplay (Block)
Default Permissions -> Notifications (Block)
Default Permissions -> Camera (Block)
Default Permissions -> Motion Sensors (Block)
Default Permissions -> MIDI Devices (Block)
Default Permissions -> Idle Detection (Block)
Default Permissions -> Sound (Allow)
Default Permissions -> Geolocation (Block)
Default Permissions -> Microphone (Block)
Default Permissions -> Bluetooth Devices (Block)
Default Permissions -> Popups (Block)

Tracker And Ad Blocking -> Block Trackers and Ads
Manage Sources -> Tracker Blocking Sources -> EasyPrivacy
Ad Blocking Sources -> ABP anti-circumvention list
Ad Blocking Sources -> EasyList
Ad Blocking Sources -> ABP filters -> + (add) -> https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt
Ad Blocking Sources -> CPBL Filters for ABP & uBO -> + (add) -> https://raw.githubusercontent.com/bongochong/CombinedPrivacyBlockLists/master/cpbl-abp-list.txt
Ad Blocking Sources -> English (Peter Lowe's List)
Ad Blocking Sources -> Fanboy's Annoyance List -> + (add) -> https://fanboy.co.nz/fanboy-annoyance.txt
Ad Blocking Sources -> I don't care about cookies -> + (add) -> https://easylist-downloads.adblockplus.org/i_dont_care_about_cookies.txt
Ad Blocking Sources -> NoCoin Filter List -> + (add) -> https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/nocoin.txt
Ad Blocking Sources -> Spam404 -> + (add) -> https://raw.githubusercontent.com/Spam404/lists/master/adblock-list.txt
Ad Blocking Sources -> OISD Big -> + (add) -> https://big.oisd.nl

Vivaldi Settings: Downloads
Download Location -> Select Folder... ( Avoid using folders within the Windows Namespace / User Profile )
Downloads -> Save Files to Default Location Without Asking
Downloads -> Display Downloads Automatically

Vivaldi Settings: Webpages
Webpages -> Use Hardware Acceleration When Available
Webpages -> Allow Text Selection in Links
Webpage Focus -> Focus All Controls and Links
Play Image Animation -> Loop
Load Images -> Always
Default Webpage Zoom -> 100 %
Default Webpage Zoom -> Use Ctrl+Scroll to Zoom Page
Default Webpage Zoom -> Use Tab Zoom
Plugins -> Enable Internal PDF Viewer
Plugins -> Enable Wildvine Plugin


NOTE: The following is optional and not necessary. For privacy reasons, it's often a much better idea to use Vivaldi without any addons installed:


Go Back With Backspace: Backspace should not go back in applets (enable)


Dark Mode: A. General dark styles (class a) - Pitch Dark


Disable HTML5 Autoplay: (Default Mode: Disable nothing)

www.insertblockedwebsitehere.com autoplay-only


Adblock Plus -> Options -> Settings -> Advanced -> +ADD FILTER LIST VIA URL (in this order)

1.) Spam404 -> https://raw.githubusercontent.com/Spam404/lists/master/adblock-list.txt
2.) NoCoin Filter List -> https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/nocoin.txt
3.) I don't care about cookies -> https://easylist-downloads.adblockplus.org/i_dont_care_about_cookies.txt

4.) Fanboy's Annoyances -> https://fanboy.co.nz/fanboy-annoyance.txt

Alternate lists already included in Fanboy's Annoyances: 

4A.) Fanboy's Notifications Blocking List -> https://easylist-downloads.adblockplus.org/fanboy-notifications.txt
4B.) Fanboy's Social Blocking List -> https://easylist-downloads.adblockplus.org/fanboy-social.txt

5.) EasyPrivacy+EasyList -> https://easylist-downloads.adblockplus.org/easyprivacy+easylist.txt
6.) Peter Lowe's list -> https://pgl.yoyo.org/adservers/serverlist.php?hostformat=adblockplus&showintro=0&mimetype=plaintext
7.) CPBL Filters for ABP & uBO -> https://raw.githubusercontent.com/bongochong/CombinedPrivacyBlockLists/master/cpbl-abp-list.txt
8.) ABP filters -> https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt
9.) OISD Big -> https://big.oisd.nl


ADBLOCK:

Adblock -> General Options -> Enable local content caching for popular website libraries
Adblock -> Options -> Filter lists -> AdBlock custom filters ( https://cdn.adblockcdn.com/filters/adblock_custom.txt )


Erase Browser Metadata from Bookmarks HTML files using LibreOffice -> Rename file extension from .html to .txt and then back to html when finished -> Menu -> Edit -> Find and Replace... ( Replace All )

NOTE: If these variables are present, the browser's initial load speed is much slower, bookmarking a link is a slower process, and it also may crash when trying to bookmark a link. The process it uses for managing bookmarks only uses a single thread and is probably based on JavaScript ( on my device at least, it rarely utilizes more than 20% of a single CPU core. The only way you can keep track of it is by monitoring the disk transfer rate in the task manager. )

1A.) FIND: "http://
1B.) REPLACE: "https://

2A.) FIND: <DT><A HREF="chrome://newtab/">New Tab</A>
2B.) FIND: <DT><A HREF="vivaldi://newtab/">New Tab</A>
2C.) REPLACE: <DT><A HREF="chrome://vivaldi-webui/startpage">Start Page</A>

Regular Expressions:

NOTE: It may ask you to disable the "Undo" function temporarily ( You have to click Accept / Yes. ) There are a lot of faster ways to parse using ripgrep or something else ( or even a standalone multi-threaded C# / C++ program that focuses on efficient use of arrays, strings, character, reference values in general, etc. )

3A.) FIND: \b\sADD_DATE="[0-9]*"\sLAST_MODIFIED="[0-9]*"\b
3B.) REPLACE: Leave this field empty

4A.) FIND: \b\sADD_DATE="[0-9]*"\b
4B.) REPLACE: Leave this field empty

5A.) FIND: \b\sLAST_MODIFIED="[0-9]*"\b
5B.) REPLACE: Leave this field empty

"Download LibreOffice" -> "https://www.libreoffice.org/download/download/"
"Gpg4win (GNU Privacy Guard for Windows) - Documentation" -> "https://www.gpg4win.org/documentation.html"
"Gpg4win (GNU Privacy Guard for Windows) - Files / Downloads" -> "https://files.gpg4win.org/"
"History Master Extension 1.1.1 ( OpenOffice / LibreOffice )" -> "https://extensions.openoffice.org/en/project/history-master"

Misc: To Enable the History Master Extension:
1.) Right-Click on the Start Menu -> Run -> C:\Program Files\LibreOffice\program\soffice.exe -> Click OK.
2.) LibreOffice Main Menu ( Drop Down ) -> Tools -> Add-Ons -> History Master - List Handling -> Current List -> PickList -> Click Remove All items.
3.) LibreOffice Main Menu ( Drop Down ) -> Tools -> Add-Ons -> History Master - List Handling -> Current List -> PickList -> List size -> 0 -> Click Apply changes.
4.) LibreOffice Main Menu ( Drop Down ) -> Tools -> Add-Ons -> History Master - List Handling -> Current List -> URLHistory ->  Click Remove All items.
5.) LibreOffice Main Menu ( Drop Down ) -> Tools -> Add-Ons -> History Master - List Handling -> Current List -> URLHistory -> List size -> 0 -> Click Apply changes.
6.) LibreOffice Main Menu ( Drop Down ) -> Tools -> Add-Ons -> History Master - List Handling -> Click Close.
7.) LibreOffice Main Menu ( Drop Down ) -> File -> Exit LibreOffice

"LibreOffice Help - List of Regular Expressions" -> "https://help.libreoffice.org/latest/en-US/text/shared/01/02100001.html"
"ICU Documentation - Regular Expression Metacharacters" -> "https://unicode-org.github.io/icu/userguide/strings/regexp.html#regular-expression-metacharacters"
"Github - Unicode ICU - Latest Release" -> "https://github.com/unicode-org/icu/releases"
"ICU - International Components for Unicode - Downloading ICU" -> "https://icu.unicode.org/download"
"ICU Documentation" -> "https://unicode-org.github.io/icu/"

NOTE: Metadata or tracking information might also be contained within the link itself, although it is unique to the website itself. You have to use a regular expression which is unique to that website, that either truncates / trims any text beyond the HTM / HTML file extension, or edits any of the JavaScript or JSON tags to not include any unique tags, other than what is necessary to identify the website itself. When you load the pages using the links, some will try to re-add browser and operating system specific information back into the link itself. If you use special characters using another Unicode character set, you may have to switch the interface language to have conformity with regular expressions ( Unicode Cyrillic characters, or any Unicode characters from the ideogram system, such as ones found in any East Asian language. ) If you are careful, often you can re-import the bookmarks HTML file without losing any description, thumbnail, or icon information.


How To Maximize Battery Life On An Android Phone:

Settings -> General -> Battery -> Batter Saver -> On
Settings -> General -> Battery -> Batter Saver -> Edit Mode -> Max Brightness (80%)
Settings -> General -> Battery -> Batter Saver -> Edit Mode -> Disable Always-On Display -> Enable
Settings -> General -> Battery -> Batter Saver -> Edit Mode -> Disable Vibration -> Enable
Settings -> General -> Battery -> Batter Saver -> Edit Mode -> Restrict Background Data -> Enable

Settings -> General -> Battery -> Power Saving Exclusions -> Disable All

Settings -> General -> Apps & Notifications -> Special Access -> Unrestricted Data Access -> Google Play Services
Settings -> General -> Apps & Notifications -> Special Access -> Unrestricted Data Access -> VPN ( If Installed )
Settings -> General -> Apps & Notifications -> Special Access -> Unrestricted Data Access -> 3rd-Party DNS Resolver ( If Installed - Such As Quad9 Connect )

Settings -> General -> Apps & Notifications -> App Info -> Google Play Services -> Background Data -> Enable
Settings -> General -> Apps & Notifications -> App Info -> Google Play Services -> Unrestricted Data Usage -> Enable

Settings -> General -> Apps & Notifications -> App Info -> VPN ( If Installed ) -> Background Data -> Enable
Settings -> General -> Apps & Notifications -> App Info -> VPN ( If Installed ) -> Unrestricted Data Usage -> Enable

Settings -> General -> Apps & Notifications -> App Info -> 3rd-Party DNS Resolver ( If Installed - Such As Quad9 Connect ) -> Background Data -> Enable
Settings -> General -> Apps & Notifications -> App Info -> 3rd-Party DNS Resolver ( If Installed - Such As Quad9 Connect ) -> Unrestricted Data Usage -> Enable

Settings -> General -> Apps & Notifications -> App Info -> 3rd-Party App Store ( If Installed - Huawei App Gallery / Hms Core ) -> Background Data -> Enable
Settings -> General -> Apps & Notifications -> App Info -> 3rd-Party App Store ( If Installed - Huawei App Gallery / Hms Core ) -> Unrestricted Data Usage -> Disable

Settings -> General -> Apps & Notifications -> App Info -> Insert App Name Here ( Most Other Apps If Not All ) -> Background Data -> Disable
Settings -> General -> Apps & Notifications -> App Info -> Insert App Name Here ( Most Other Apps If Not All ) -> Unrestricted Data Usage -> Disable