mirror of
https://github.com/Grasscutters/GrassClipper.git
synced 2024-08-14 13:11:48 +08:00
proper cleanup, comments, etc
This commit is contained in:
parent
9f7aa48664
commit
d3bca30adc
@ -11,24 +11,28 @@ set PROXY=true
|
|||||||
for /f "tokens=2*" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable 2^>nul') do set "ORIG_PROXY_ENABLE=%%b"
|
for /f "tokens=2*" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable 2^>nul') do set "ORIG_PROXY_ENABLE=%%b"
|
||||||
for /f "tokens=2*" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer 2^>nul') do set "ORIG_PROXY_SERVER=%%b"
|
for /f "tokens=2*" %%a in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer 2^>nul') do set "ORIG_PROXY_SERVER=%%b"
|
||||||
|
|
||||||
start "Proxy Server" ./ext/mitmdump.exe -s "./proxy/proxy.py" --ssl-insecure --set ip=%ip%
|
|
||||||
|
|
||||||
:: Set proxy settings in Windows
|
:: Set proxy settings in Windows
|
||||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f >nul 2>nul
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f >nul 2>nul
|
||||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "127.0.0.1:8080" /f >nul 2>nul
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "127.0.0.1:8080" /f >nul 2>nul
|
||||||
|
|
||||||
:: Allow the proxy to start
|
:: Start proxy server
|
||||||
ping 192.0.2.2 -n 1 -w 5000 > nul
|
start "Proxy Server" ./ext/mitmdump.exe -s "./proxy/proxy.py" --ssl-insecure --set ip=%ip%
|
||||||
|
|
||||||
echo Opening %gamePath%/Genshin Impact Game/GenshinImpact.exe
|
echo Opening %gamePath%/Genshin Impact Game/GenshinImpact.exe
|
||||||
|
|
||||||
start "" /b "%gamePath%/Genshin Impact Game/GenshinImpact.exe"
|
:: Launch game
|
||||||
|
"%gamePath%/Genshin Impact Game/GenshinImpact.exe"
|
||||||
|
|
||||||
|
:: On exit clean proxy stuff
|
||||||
:EXIT
|
:EXIT
|
||||||
if "%PROXY%" == "" (
|
if "%PROXY%" == "" (
|
||||||
echo Proxy not started, no need to clean up.
|
echo Proxy not started, no need to clean up.
|
||||||
) else (
|
) else (
|
||||||
|
:: Clean proxy settings
|
||||||
echo Cleaning up proxy settings
|
echo Cleaning up proxy settings
|
||||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d "%ORIG_PROXY_ENABLE%" /f >nul 2>nul
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d "%ORIG_PROXY_ENABLE%" /f >nul 2>nul
|
||||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "%ORIG_PROXY_SERVER%" /f >nul 2>nul
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "%ORIG_PROXY_SERVER%" /f >nul 2>nul
|
||||||
|
|
||||||
|
:: Kill proxy server
|
||||||
|
taskkill /f /im mitmdump.exe
|
||||||
)
|
)
|
Loading…
x
Reference in New Issue
Block a user