Compare commits

..
8 Commits
Author SHA1 Message Date
rmbgame 2ab26f7848 ready 1.0.3 2020-12-26 22:20:50 +08:00
rmbgame d646eacda1 ready 1.0.2 2020-12-21 21:54:23 +08:00
rmbgame fb029f729b ready 1.0.0 2020-12-21 21:47:08 +08:00
rmbgame 5ef6663269 delete ref lib 2020-12-21 21:36:17 +08:00
rmbgame 5c86b53000 ready 1.0.0 2020-12-17 12:10:47 +08:00
rmbgame efb6adbd9b delete ref lib 2020-12-16 10:38:03 +08:00
rmbgame 209202b5cf sync develop 2020-12-16 10:36:52 +08:00
rmbgame c0a081e226 delete ref lib 2020-12-16 10:34:52 +08:00
582 changed files with 3379 additions and 4928 deletions
+13
View File
@@ -0,0 +1,13 @@
### 该问题是怎么引起的?
### 重现步骤
### 报错信息
+15
View File
@@ -0,0 +1,15 @@
### 相关的Issue
### 原因(目的、解决的问题等)
### 描述(做了什么,变更了什么)
### 测试用例(新增、改动、可能影响的功能)
-6
View File
@@ -1,6 +0,0 @@
[submodule "references/Titanium-Web-Proxy"]
path = references/Titanium-Web-Proxy
url = https://github.com/rmbadmin/Titanium-Web-Proxy.git
[submodule "references/MetroRadiance"]
path = references/MetroRadiance
url = https://github.com/rmbadmin/MetroRadiance.git
View File

Before

Width:  |  Height:  |  Size: 145 KiB

After

Width:  |  Height:  |  Size: 145 KiB

View File

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 148 KiB

View File

Before

Width:  |  Height:  |  Size: 322 KiB

After

Width:  |  Height:  |  Size: 322 KiB

View File

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 130 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

Before

Width:  |  Height:  |  Size: 427 KiB

After

Width:  |  Height:  |  Size: 427 KiB

@@ -1,5 +1,6 @@
[
{
"Index": 1,
"Name": "*瑞",
"Amount": 5,
"OrderNumber": "",
@@ -8,6 +9,7 @@
"PayTime": "2020-12-17 19:41:57"
},
{
"Index": 2,
"Name": "**耀",
"Amount": 5,
"OrderNumber": "",
@@ -16,6 +18,7 @@
"PayTime": "2020-12-17 20:46:01"
},
{
"Index": 3,
"Name": "**皓",
"Amount": 1,
"OrderNumber": "",
@@ -24,6 +27,7 @@
"PayTime": "2020-12-17 22:41:27"
},
{
"Index": 4,
"Name": "**宇",
"Amount": 1,
"OrderNumber": "",
@@ -32,6 +36,7 @@
"PayTime": "2020-12-18 08:39:42"
},
{
"Index": 5,
"Name": "*钊",
"Amount": 20,
"OrderNumber": "",
@@ -40,6 +45,7 @@
"PayTime": "2020-12-19 17:10:44"
},
{
"Index": 6,
"Name": "R*n",
"Amount": 20,
"OrderNumber": "",
@@ -48,6 +54,7 @@
"PayTime": "2020-12-17 14:32:00"
},
{
"Index": 7,
"Name": "*炜",
"Amount": 100,
"OrderNumber": "",
@@ -56,6 +63,7 @@
"PayTime": "2020-12-20 12:02:17"
},
{
"Index": 8,
"Name": "**智",
"Amount": 20,
"OrderNumber": "",
@@ -64,6 +72,7 @@
"PayTime": "2020-12-20 12:21:04"
},
{
"Index": 9,
"Name": "*森",
"Amount": 66,
"OrderNumber": "",
@@ -72,6 +81,7 @@
"PayTime": "2020-12-21 23:03:26"
},
{
"Index": 10,
"Name": "*珂",
"Amount": 50,
"OrderNumber": "",
@@ -80,6 +90,7 @@
"PayTime": "2020-12-21 23:18:09"
},
{
"Index": 11,
"Name": "**丰",
"Amount": 1,
"OrderNumber": "",
@@ -88,6 +99,7 @@
"PayTime": "2020-12-22 12:33:46"
},
{
"Index": 12,
"Name": "Ruby",
"Amount": 77,
"OrderNumber": "",
@@ -96,6 +108,7 @@
"PayTime": "2020-12-24 19:40:25"
},
{
"Index": 13,
"Name": "**桐",
"Amount": 1,
"OrderNumber": "",
@@ -104,6 +117,7 @@
"PayTime": "2020-12-26 09:32:57"
},
{
"Index": 14,
"Name": "**珂",
"Amount": 5,
"OrderNumber": "",
@@ -112,6 +126,7 @@
"PayTime": "2020-12-26 13:28:07"
},
{
"Index": 15,
"Name": "z.w",
"Amount": 10,
"OrderNumber": "",
@@ -120,6 +135,7 @@
"PayTime": "2020-12-26 15:34:50"
},
{
"Index": 16,
"Name": "**林",
"Amount": 6,
"OrderNumber": "",
@@ -128,131 +144,12 @@
"PayTime": "2020-12-26 18:25:06"
},
{
"Index": 17,
"Name": "**立",
"Amount": 1,
"OrderNumber": "",
"PayType": 2,
"Remark": "",
"PayTime": "2020-12-26 18:56:57"
},
{
"Name": "*易",
"Amount": 6.66,
"OrderNumber": "",
"PayType": 1,
"Remark": "其乐Kenagi,给大佬递冰阔落",
"PayTime": "2020-12-27 13:55:11"
},
{
"Name": "*明",
"Amount": 10,
"OrderNumber": "",
"PayType": 1,
"Remark": "感谢大佬",
"PayTime": "2020-12-27 21:28:40"
},
{
"Name": "山山为川",
"Amount": 1,
"OrderNumber": "",
"PayType": 2,
"Remark": "",
"PayTime": "2020-12-27 22:17:22"
},
{
"Name": "*梁",
"Amount": 3,
"OrderNumber": "",
"PayType": 1,
"Remark": "其乐wuwang23333 给大佬递",
"PayTime": "2020-12-28 11:59:20"
},
{
"Name": "**男",
"Amount": 1,
"OrderNumber": "",
"PayType": 1,
"Remark": "越做越好",
"PayTime": "2020-12-28 14:54:48"
},
{
"Name": "匿名",
"Amount": 14.61,
"OrderNumber": "",
"PayType": 2,
"Remark": "",
"PayTime": "2020-12-28 14:07:44"
},
{
"Name": "jiwuwang",
"Amount": 10,
"OrderNumber": "",
"PayType": 2,
"Remark": "希望挂卡早点安排上",
"PayTime": "2020-12-29 03:14:35"
},
{
"Name": "缄默",
"Amount": 10,
"OrderNumber": "",
"PayType": 2,
"Remark": "给软软打call!steam++是目前接触的最好用的插件!",
"PayTime": "2020-12-29 12:35:07"
},
{
"Name": "**宇",
"Amount": 6,
"OrderNumber": "",
"PayType": 1,
"Remark": "",
"PayTime": "2020-12-31 20:14:05"
},
{
"Name": "**东",
"Amount": 1,
"OrderNumber": "",
"PayType": 1,
"Remark": "一点绵薄之力,希望继续完善!",
"PayTime": "2021-01-03 21:28:08"
},
{
"Name": "**羽",
"Amount": 5,
"OrderNumber": "",
"PayType": 2,
"Remark": "感谢大佬",
"PayTime": "2021-01-05 16:22:11"
},
{
"Name": "**彬",
"Amount": 5,
"OrderNumber": "",
"PayType": 1,
"Remark": "平其心论天下之事,定其心应天下之变",
"PayTime": "2021-01-06 17:08:36"
},
{
"Name": "K",
"Amount": 10,
"OrderNumber": "",
"PayType": 2,
"Remark": "支持一下",
"PayTime": "2021-01-07 14:46:04"
},
{
"Name": "*鹏",
"Amount": 10,
"OrderNumber": "",
"PayType": 1,
"Remark": "加油💪",
"PayTime": "2021-01-07 11:42:38"
},
{
"Name": "*成",
"Amount": 6.66,
"OrderNumber": "",
"PayType": 1,
"Remark": "",
"PayTime": "2021-01-07 12:25:59"
}
]
View File

Before

Width:  |  Height:  |  Size: 128 KiB

After

Width:  |  Height:  |  Size: 128 KiB

View File

Before

Width:  |  Height:  |  Size: 199 KiB

After

Width:  |  Height:  |  Size: 199 KiB

View File

Before

Width:  |  Height:  |  Size: 236 KiB

After

Width:  |  Height:  |  Size: 236 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Before

Width:  |  Height:  |  Size: 364 KiB

After

Width:  |  Height:  |  Size: 364 KiB

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Before

Width:  |  Height:  |  Size: 364 KiB

After

Width:  |  Height:  |  Size: 364 KiB

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

+48 -64
View File
@@ -1,92 +1,78 @@
<img src="https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/icon/LOGO1.png" alt="logo" width="130" height="130" align="left" />
# Steam++ SteamTools
<h1>Steam++ Tools</h1>
> 「Steam++」is a toolkit that contains a variety of Steam tools, most of which require you to download and install Steam in order to use them.
<br/>
「Steam++」是一个包含多种Steam工具功能的工具箱。
![Release Download](https://img.shields.io/github/downloads/rmbadmin/SteamTools/latest/total?style=flat-square)
[![Release Version](https://img.shields.io/github/v/release/rmbadmin/SteamTools?style=flat-square)](https://github.com/rmbadmin/SteamTools/releases/latest)
[![GitHub license](https://img.shields.io/github/license/rmbadmin/SteamTools?style=flat-square)](LICENSE)
[![GitHub Star](https://img.shields.io/github/stars/rmbadmin/SteamTools?style=flat-square)](https://github.com/rmbadmin/SteamTools/stargazers)
[![GitHub Fork](https://img.shields.io/github/forks/rmbadmin/SteamTools?style=flat-square)](https://github.com/rmbadmin/SteamTools/network/members)
![GitHub repo size](https://img.shields.io/github/repo-size/rmbadmin/SteamTools?style=flat-square&color=3cb371)
此工具的大部分功能都是需要您下载安装Steam才能使用。
## Samples
-------
![](https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/s.png)
![](https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/e.png)
![](https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/e2.png)
![](https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/t.png)
------
## Core Functions
## 核心功能
### 1. 反代Steam的社区网页使其能正常访问
功能类似羽翼城大佬的Steam302,使用[Titanium-Web-Proxy](https://github.com/justcoding121/Titanium-Web-Proxy)开源项目进行本地反代,相比302工具具有更快的启动速度,以及支持简单的脚本注入。
### 1. Local reverse proxy for Steam's community webpage to enable normal access in mainland China
![](https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/1.png)
---
### 2. Quickly switch the Steam account that the current PC has remembered to log into
### 2. 快速切换当前PC已经记住登陆的Steam账号
This feature is to read the local user login records stored under the Steam path to directly display the operation, you can switch between multiple accounts without re-entering passwords and tokens.
该功能是读取Steam路径下存储的本地用户登录记录直接展示操作,可以多账号切换无需重新输入密码和令牌。
![](https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/2.png)
---
### 3. Achievement stat modifications for Steam games
Function reference [SteamAchievementManager](https://github.com/gibbed/SteamAchievementManager) for secondary development, modified the game list loading and operation ease of use.
![](https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/3.png)
---
### 4. Steam Local Two-Step Authenticator
The function reference [WinAuth](https://github.com/winauth/winauth) is developed to enable you to view your token without launching the mobile version of Steam App, similar function software are [WinAuth](https://github.com/winauth/winauth), [SteamDesktopAuthenticator](https://github.com/Jessecar96/SteamDesktopAuthenticator).
! [](https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/4.png)
### 3. Steam游戏的成就统计管理功能
功能参考[SteamAchievementManager](https://github.com/gibbed/SteamAchievementManager)进行二次开发,修改了游戏列表的加载和操作易用性。
---
### 5. Some game tools
Currently there is a forced game borderless windowing, CSGO fix VAC shield.
This piece is randomly do some of my often used or idle tinkering with the function.
![](https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/5.png)
![](https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/6.png)
---
## Features expected to be added subsequently
### Steam Idle Card
The goal is to enable direct access to badge card information and start hanging cards without logging into your Steam account within the software.
### Plug-in form to load and run ASF
Support ASF as a plug-in to run within the tool and enhance the use of ASF in Windows Desktop environment.
### Steam Custom Cover Management
Enhanced management of Steam custom covers and quick matching of downloaded app covers from [SteamGridDB](https://www.steamgriddb.com/).
### More other game platform features
### More non-cheat game features
### 4. Steam本地两步身份验证器
功能参考[WinAuth](https://github.com/winauth/winauth)开发,可以使您不用启动移动版Steam App也能查看您的令牌,功能类似的软件有[WinAuth](https://github.com/winauth/winauth)、[SteamDesktopAuthenticator](https://github.com/Jessecar96/SteamDesktopAuthenticator)。
---
## Operating Environment
> The program was developed using C# WPF in .,If it does not work please download and install[.NET Framework 4.7.2](https://dotnet.microsoft.com/download/dotnet-framework/net472)。
> The missing assembly is my own modified project
* [Titanium-Web-Proxy](https://github.com/rmbadmin/Titanium-Web-Proxy)
* [MetroRadiance](https://github.com/rmbadmin/MetroRadiance)
### 5. 一些游戏工具
目前已有强制游戏无边框窗口化,CSGO修复VAC屏蔽。
这一块是随缘做一些我经常用或者闲着没事捣鼓的功能。
---
## 预计后续添加的功能
### Steam自动挂卡
尝试用社区反代功能结合成就解锁功能来重新实现,目的是实现在软件内登录Steam即可直接获取徽章卡片信息并开始挂卡。
### Steam皮肤设计器
挖坑画大饼,可视化编辑Steam皮肤,而且如果软件能上架Steam的话打算支持创意工坊分享设计的Steam皮肤,短期内肯定做不完。
### 插件形式加载运行ASF
以插件形式支持ASF在工具内运行并增强ASF在Windows Desktop环境下的使用。
### Steam自定义封面管理
增强Steam自定义封面的管理以及从[SteamGridDB](https://www.steamgriddb.com/)快速匹配下载应用封面。
### 更多其它游戏平台功能
### 更多非作弊游戏功能
---
## 运行环境
> 程序使用C# WPF在 .NET Framework4.7.2环境下开发,如果无法运行请下载安装[.NET Framework 4.7.2](https://dotnet.microsoft.com/download/dotnet-framework/net472)。
---
## License
> [GPL-3.0 License](https://github.com/rmbadmin/SteamTools/blob/develop/LICENSE)
> Open source/free software released under the GPLv3 license.
> [GPL-3.0 License](LICENSE.txt)
> 根据GPLv3许可发布的开源/免费软件。
---
## Thanks to the following open source projects
## 感谢以下开源项目
* [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json)
* [MetroRadiance](https://github.com/Grabacr07/MetroRadiance)
* [MetroTrilithon](https://github.com/Grabacr07/MetroTrilithon)
* [Livet](https://github.com/runceel/Livet)
* [StatefulModel](https://github.com/ugaya40/StatefulModel)
* [StatefulModel](https://github.com/Grabacr07/MetroTrilithonhttps://github.com/ugaya40/StatefulModel)
* [Hardcodet.NotifyIcon](https://github.com/HavenDV/Hardcodet.NotifyIcon.Wpf.NetCore)
* [System.Reactive](https://github.com/dotnet/reactive)
* [Titanium-Web-Proxy](https://github.com/justcoding121/Titanium-Web-Proxy)
@@ -96,6 +82,4 @@ Enhanced management of Steam custom covers and quick matching of downloaded app
* [SteamAchievementManager](https://github.com/gibbed/SteamAchievementManager)
* [ArchiSteamFarm](https://github.com/JustArchiNET/ArchiSteamFarm)
* [WinAuth](https://github.com/winauth/winauth)
* [SteamDesktopAuthenticator](https://github.com/Jessecar96/SteamDesktopAuthenticator)
* [Gameloop.Vdf](https://github.com/shravan2x/Gameloop.Vdf)
* [Costura.Fody](https://github.com/Fody/Costura)
* [SteamDesktopAuthenticator](https://github.com/Jessecar96/SteamDesktopAuthenticator)
+18 -34
View File
@@ -1,54 +1,37 @@
<img src="https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/icon/LOGO1.png" alt="logo" width="130" height="130" align="left" />
# Steam++工具箱
<h1>Steam++ 工具箱</h1>
「Steam++」是一个包含多种Steam工具功能的工具箱。
> 「Steam++」是一个包含多种Steam工具功能的工具箱,
> 此工具的大部分功能都是需要您下载安装Steam才能使用。
<br/>
此工具的大部分功能都是需要您下载安装Steam才能使用。
![Release Download](https://img.shields.io/github/downloads/rmbadmin/SteamTools/latest/total?style=flat-square)
[![Release Version](https://img.shields.io/github/v/release/rmbadmin/SteamTools?style=flat-square)](https://github.com/rmbadmin/SteamTools/releases/latest)
[![GitHub license](https://img.shields.io/github/license/rmbadmin/SteamTools?style=flat-square)](LICENSE)
[![GitHub Star](https://img.shields.io/github/stars/rmbadmin/SteamTools?style=flat-square)](https://github.com/rmbadmin/SteamTools/stargazers)
[![GitHub Fork](https://img.shields.io/github/forks/rmbadmin/SteamTools?style=flat-square)](https://github.com/rmbadmin/SteamTools/network/members)
![GitHub repo size](https://img.shields.io/github/repo-size/rmbadmin/SteamTools?style=flat-square&color=3cb371)
# Steam++
## 效果展示
-------
![](https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/s.png)
![](https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/e.png)
![](https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/e2.png)
![](https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/t.png)
------
## 核心功能
### 1. 反代Steam的社区网页使其能正常访问
功能类似羽翼城大佬的[steamcommunity_302](https://www.dogfight360.com/blog/686/),使用[Titanium-Web-Proxy](https://github.com/justcoding121/Titanium-Web-Proxy)开源项目进行本地反代,使国内用户可以正常访问steam社区页,相比302工具具有更快的启动速度,以及支持简单的脚本注入。(还顺便支持了Pixiv、Discord、Twitch等网站的反代支持)
![](https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/1.png)
功能类似羽翼城大佬的Steam302,使用[Titanium-Web-Proxy](https://github.com/justcoding121/Titanium-Web-Proxy)开源项目进行本地反代,相比302工具具有更快的启动速度,以及支持简单的脚本注入。
---
### 2. 快速切换当前PC已经记住登陆的Steam账号
该功能是读取Steam路径下存储的本地用户登录记录直接展示操作,可以多账号切换无需重新输入密码和令牌。
![](https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/2.png)
---
### 3. Steam游戏的成就统计管理功能
功能参考[SteamAchievementManager](https://github.com/gibbed/SteamAchievementManager)进行二次开发,修改了游戏列表的加载和操作易用性。
![](https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/3.png)
---
### 4. Steam本地两步身份验证器
功能参考[WinAuth](https://github.com/winauth/winauth)开发,可以使您不用启动移动版Steam App也能查看您的令牌,功能类似的软件有[WinAuth](https://github.com/winauth/winauth)、[SteamDesktopAuthenticator](https://github.com/Jessecar96/SteamDesktopAuthenticator)。
![](https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/4.png)
---
### 5. 一些游戏工具
目前已有强制游戏无边框窗口化,CSGO修复VAC屏蔽。
这一块是随缘做一些我经常用或者闲着没事捣鼓的功能。
![](https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/5.png)
![](https://raw.githubusercontent.com/rmbadmin/SteamTools/develop/resources/6.png)
---
## 预计后续添加的功能
@@ -72,15 +55,16 @@
---
## 开发环境
> 开发工具 [Visual Studio 2019](https://visualstudio.microsoft.com/)
> 开发语言 C# WPF
> .NET版本 .NET Framework4.7.2 和 .NET5
> 如果无法运行请下载安装[.NET Framework 4.7.2](https://dotnet.microsoft.com/download/dotnet-framework/net472)或[.NET 5](https://dotnet.microsoft.com/download/dotnet/5.0)。
## 运行环境
> 程序使用C# WPF在 .NET Framework4.7.2环境下开发,如果无法运行请下载安装[.NET Framework 4.7.2](https://dotnet.microsoft.com/download/dotnet-framework/net472)。
> 缺失的程序集为我自己修改后的项目
* [Titanium-Web-Proxy](https://github.com/rmbadmin/Titanium-Web-Proxy)
* [MetroRadiance](https://github.com/rmbadmin/MetroRadiance)
---
## License
> [GPL-3.0 License](https://github.com/rmbadmin/SteamTools/blob/develop/LICENSE)
> [GPL-3.0 License](LICENSE.txt)
> 根据GPLv3许可发布的开源/免费软件。
---
@@ -90,7 +74,7 @@
* [MetroRadiance](https://github.com/Grabacr07/MetroRadiance)
* [MetroTrilithon](https://github.com/Grabacr07/MetroTrilithon)
* [Livet](https://github.com/runceel/Livet)
* [StatefulModel](https://github.com/ugaya40/StatefulModel)
* [StatefulModel](https://github.com/Grabacr07/MetroTrilithonhttps://github.com/ugaya40/StatefulModel)
* [Hardcodet.NotifyIcon](https://github.com/HavenDV/Hardcodet.NotifyIcon.Wpf.NetCore)
* [System.Reactive](https://github.com/dotnet/reactive)
* [Titanium-Web-Proxy](https://github.com/justcoding121/Titanium-Web-Proxy)
File diff suppressed because it is too large Load Diff
@@ -7,7 +7,7 @@
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Portable.BouncyCastle" Version="1.8.9" />
<PackageReference Include="Portable.BouncyCastle" Version="1.8.8" />
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="5.0.0" />
</ItemGroup>
+33
View File
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using SteamTools.Model;
using Newtonsoft.Json;
namespace SteamTools.Helper
{
public static class ConfigHelper
{
private const string ConfigFileName = "SteamToolData.dat";
private static readonly string ConfigPath =
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), ConfigFileName);
public static SteamToolConfig SteamToolConfig { get; set; }
public static void SaveConfig()
{
var jsonData = JsonConvert.SerializeObject(SteamToolConfig);
File.WriteAllText(ConfigPath, jsonData, Encoding.UTF8);
}
public static SteamToolConfig ReadConfig()
{
SteamToolConfig = JsonConvert.DeserializeObject<SteamToolConfig>(File.ReadAllText(ConfigPath, Encoding.UTF8));
return SteamToolConfig;
}
}
}
@@ -0,0 +1,75 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Win32;
namespace SteamTools.Helper
{
public static class RegistryKeyHelper
{
/// <summary>
/// 创建注册表项
/// </summary>
/// <param name="registryKey"></param>
/// <param name="path"></param>
/// <returns></returns>
public static RegistryKey CreateRegistryKey(RegistryKey registryKey, string path)
{
return registryKey.CreateSubKey(path);
}
/// <summary>
/// 删除注册表项
/// </summary>
/// <param name="registryKey"></param>
/// <param name="path"></param>
/// <returns></returns>
public static void DeleteRegistryKey(RegistryKey registryKey, string path)
{
registryKey.DeleteSubKey(path, true); //该方法无返回值,直接调用即可
registryKey.Close();
}
/// <summary>
/// 读取注册表值
/// </summary>
/// <param name="registryKey"></param>
/// <param name="path"></param>
/// <param name="key"></param>
/// <returns></returns>
public static string ReadRegistryKey(RegistryKey registryKey, string path, string key)
{
var myreg = registryKey.OpenSubKey(path);
if (myreg != null)
{
var info = myreg.GetValue(key).ToString();
myreg.Close();
return info;
}
return string.Empty;
}
/// <summary>
/// 新增或修改注册表值
/// </summary>
/// <param name="registryKey"></param>
/// <param name="path"></param>
/// <param name="key"></param>
/// <param name="value"></param>
/// <param name="registryValueKind"></param>
/// <returns></returns>
public static void AddOrUpdateRegistryKey(RegistryKey registryKey, string path, string key, string value, RegistryValueKind registryValueKind)
{
RegistryKey myreg = registryKey.OpenSubKey(path, true); //该项必须已存在
if (myreg != null)
{
myreg.SetValue(key, value, registryValueKind);
myreg.Close();
}
}
}
}
+107
View File
@@ -0,0 +1,107 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Gameloop.Vdf.Linq;
using Microsoft.Win32;
using SteamTool.Common.Helper;
using SteamTools.Model;
namespace SteamTools.Helper
{
public class SteamHelper
{
public static readonly SteamHelper Instance = new SteamHelper();
public string SteamPath { get; set; }
public string SteamExePath { get; set; }
private const string SteamRegistryPath = @"SOFTWARE\Valve\Steam";
public SteamHelper()
{
var steamExePath = RegistryKeyHelper.ReadRegistryKey(Registry.CurrentUser, SteamRegistryPath, "SteamExe");
var steamPath = RegistryKeyHelper.ReadRegistryKey(Registry.CurrentUser, SteamRegistryPath, "SteamPath");
if (File.Exists(steamExePath))
{
SteamExePath = steamExePath;
}
if (Directory.Exists(steamPath))
{
SteamPath = steamPath;
}
}
public void KillSteamProcess()
{
Process[] processes = Process.GetProcesses();
foreach (Process process in processes)
{
if (process.ProcessName == "Steam" || process.ProcessName == "SteamService" || process.ProcessName == "steamwebhelper")
{
process.Kill();
}
}
}
public void StartSteam(string param = "")
{
if (!string.IsNullOrEmpty(SteamExePath))
{
Process.Start(SteamExePath, param);
}
}
/// <summary>
/// 获取最后一次自动登陆steam用户名称
/// </summary>
/// <returns></returns>
public string GetLastLoginUserName()
{
return RegistryKeyHelper.ReadRegistryKey(Registry.CurrentUser, SteamRegistryPath, "AutoLoginUser");
}
/// <summary>
/// 获取所有记住登陆steam用户信息
/// </summary>
/// <returns></returns>
public List<SteamUser> GetAllUser()
{
var users = new List<SteamUser>();
if (SteamPath != null)
{
var v = VdfHelper.GetVdfModelByPath(SteamPath + "/config/loginusers.vdf");
foreach (var item in v.Value)
{
var i = item.Value;
var user = new SteamUser
{
AccountName = i.AccountName.ToString(),
PersonaName = i.PersonaName.ToString(),
RememberPassword = Convert.ToBoolean(Convert.ToInt64(i.RememberPassword.ToString())),
MostRecent = Convert.ToBoolean(Convert.ToInt64(i.MostRecent.ToString())),
Timestamp = Convert.ToInt64(i.Timestamp.ToString())
};
user.LastLoginTime= new DateTime(1970, 1, 1, 8, 0, 0).AddSeconds(user.Timestamp);
users.Add(user);
}
}
return users;
}
/// <summary>
/// 设置下次登陆steam用户
/// </summary>
public void SetCurrentUser(string username)
{
RegistryKeyHelper.AddOrUpdateRegistryKey(Registry.CurrentUser, SteamRegistryPath, "AutoLoginUser", username, RegistryValueKind.String);
}
}
}
+35
View File
@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Gameloop.Vdf;
using Gameloop.Vdf.Linq;
namespace SteamTool.Common.Helper
{
public static class VdfHelper
{
/// <summary>
/// 获取VDF类型内容
/// </summary>
/// <param name="path">vdf文件内容</param>
/// <returns></returns>
public static dynamic GetVdfModel(string text)
{
return VdfConvert.Deserialize(text);
}
/// <summary>
/// 根据路径获取VDF类型内容
/// </summary>
/// <param name="path">vdf文件路径</param>
/// <returns></returns>
public static dynamic GetVdfModelByPath(string path)
{
string text = File.ReadAllText(path,Encoding.UTF8);
return GetVdfModel(text); ;
}
}
}
+21
View File
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SteamTools.Model
{
public class SteamToolConfig
{
/// <summary>
/// 启动参数
/// </summary>
public string SteamRunParam { get; set; }
/// <summary>
/// 保存用户
/// </summary>
public List<SteamUser> SteamUsers { get; set; }
}
}
+65
View File
@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SteamTools.Model
{
public class SteamUser
{
public string SteamId3 { get; set; }
public int SteamId3_Int { get; }
public string SteamId32 { get; set; }
public int SteamId32_Int { get; }
public long SteamId64 { get; set; }
/// <summary>
/// 个人资料链接
/// </summary>
public string ProfileUrl { get; set; }
/// <summary>
/// 昵称
/// </summary>
public string PersonaName { get; set; }
/// <summary>
/// 用户名
/// </summary>
public string AccountName { get; set; }
/// <summary>
/// 是否记住密码
/// </summary>
public bool RememberPassword { get; set; }
/// <summary>
/// 密码
/// </summary>
public string PassWord { get; set; }
/// <summary>
/// 最后登录时间戳
/// </summary>
public long Timestamp { get; set; }
/// <summary>
/// 最后登录时间
/// </summary>
public DateTime LastLoginTime { get; set; }
/// <summary>
/// 最近登录
/// </summary>
public bool MostRecent { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
}
}
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("SteamTool.Common")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SteamTool.Common")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("75e148c7-5f32-4f01-9444-cedefa28748a")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SteamTool.Common.Service
{
public class SteamToolsService
{
}
}
+74
View File
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{75E148C7-5F32-4F01-9444-CEDEFA28748A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SteamTool.Common</RootNamespace>
<AssemblyName>SteamTool.Common</AssemblyName>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '发布|AnyCPU'">
<OutputPath>bin\发布\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.3</LangVersion>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Gameloop.Vdf, Version=0.6.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Gameloop.Vdf.0.6.1\lib\net45\Gameloop.Vdf.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Helper\ConfigHelper.cs" />
<Compile Include="Helper\RegistryKeyHelper.cs" />
<Compile Include="Helper\SteamHelper.cs" />
<Compile Include="Helper\VdfHelper.cs" />
<Compile Include="Model\SteamToolConfig.cs" />
<Compile Include="Model\SteamUser.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Service\SteamToolsService.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Gameloop.Vdf" version="0.6.1" targetFramework="net46" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net46" />
</packages>
+26
View File
@@ -0,0 +1,26 @@
using SteamTool.Model;
using System;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
namespace SteamTool.Proxy
{
public static class CertificateEx
{
public static string GetPublicPemCertificateString(this X509Certificate2 @this)
{
StringBuilder builder = new StringBuilder();
builder.AppendLine(Const.HOST_TAG);
builder.AppendLine("-----BEGIN CERTIFICATE-----");
builder.AppendLine(
Convert.ToBase64String(@this.RawData, Base64FormattingOptions.InsertLineBreaks));
builder.AppendLine("-----END CERTIFICATE-----");
builder.AppendLine(Const.HOST_TAG);
return builder.ToString();
}
}
}
@@ -9,15 +9,6 @@ namespace SteamTool.Core.Common
{
public static class Common
{
/// <summary>
/// 时间戳转DateTime(系统时区)
/// </summary>
/// <returns></returns>
public static DateTime ToDateTime(this long timestamp)
{
return TimeZoneInfo.ConvertTimeFromUtc(new DateTime(1970, 1, 1, 0, 0, 0).AddSeconds(timestamp), TimeZoneInfo.Local);
}
/// <summary>
/// 返回当前时间戳
/// </summary>
@@ -46,16 +37,6 @@ namespace SteamTool.Core.Common
}
}
/// <summary>
/// 移除字符串内所有\r \n \t
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static string RemovePattern(this string inputString)
{
return inputString.Replace("\t", "").Replace("\r", "").Replace("\n", "");
}
/// <summary>
/// 获取两个字符串中间的字符串
/// </summary>
@@ -15,10 +15,6 @@ namespace SteamTool.Core.Common
/// <returns></returns>
public static string CompressString(this string text)
{
if (string.IsNullOrEmpty(text))
{
return null;
}
byte[] buffer = Encoding.UTF8.GetBytes(text);
var memoryStream = new MemoryStream();
using (var gZipStream = new GZipStream(memoryStream, CompressionMode.Compress, true))
@@ -44,10 +40,6 @@ namespace SteamTool.Core.Common
/// <returns></returns>
public static string DecompressString(this string compressedText)
{
if (string.IsNullOrEmpty(compressedText))
{
return null;
}
byte[] gZipBuffer = Convert.FromBase64String(compressedText);
using var memoryStream = new MemoryStream();
int dataLength = BitConverter.ToInt32(gZipBuffer, 0);
@@ -13,25 +13,12 @@ namespace SteamTool.Core
{
public class HostsService
{
public readonly static string HostsPath = @$"{Environment.SystemDirectory}\drivers\etc\hosts";
public readonly static string HostsPath = $"{Environment.GetFolderPath(Environment.SpecialFolder.System)}\\drivers\\etc\\hosts";
static HostsService()
{
if (!File.Exists(HostsPath))
{
using var fs = File.Create(HostsPath);
fs.Close();
}
}
public OperationResult<List<string>> ReadHostsAllLines()
{
var result = new OperationResult<List<string>>(OperationResultType.Error, Resources.Hosts_ReadError);
if (!File.Exists(HostsPath))
{
result.Message = "hosts file was not found";
return result;
}
try
{
var dataLines = File.ReadAllLines(HostsPath).ToList();
@@ -61,11 +48,7 @@ namespace SteamTool.Core
public OperationResult UpdateHosts(string ip, string domain)
{
var result = new OperationResult(OperationResultType.Error, Resources.Hosts_WirteError);
if (!File.Exists(HostsPath))
{
result.Message = "hosts file was not found";
return result;
}
//操作前取消只读属性
File.SetAttributes(HostsPath, FileAttributes.Normal);
@@ -92,7 +75,7 @@ namespace SteamTool.Core
try
{
dataLines.Add($"{ip} {domain} {Const.HOST_TAG}");
File.WriteAllLines(HostsPath, dataLines, Encoding.UTF8);
File.WriteAllLines(HostsPath, dataLines);
//File.SetAttributes(HostsPath, FileAttributes.ReadOnly);
result.ResultType = OperationResultType.Success;
@@ -111,11 +94,7 @@ namespace SteamTool.Core
public OperationResult UpdateHosts(List<(string ip, string domain)> hosts)
{
var result = new OperationResult(OperationResultType.Error, Resources.Hosts_WirteError);
if (!File.Exists(HostsPath))
{
result.Message = "hosts file was not found";
return result;
}
if (hosts.Count == 0)
{
return result;
@@ -153,7 +132,7 @@ namespace SteamTool.Core
}
try
{
File.WriteAllLines(HostsPath, dataLines, Encoding.UTF8);
File.WriteAllLines(HostsPath, dataLines);
//File.SetAttributes(HostsPath, FileAttributes.ReadOnly);
result.ResultType = OperationResultType.Success;
result.Message = Resources.Hosts_UpdateSuccess;
@@ -171,11 +150,7 @@ namespace SteamTool.Core
public OperationResult RemoveHosts(string ip, string domain)
{
var result = new OperationResult(OperationResultType.Error, Resources.Hosts_WirteError);
if (!File.Exists(HostsPath))
{
result.Message = "hosts file was not found";
return result;
}
//操作前取消只读属性
File.SetAttributes(HostsPath, FileAttributes.Normal);
@@ -197,7 +172,7 @@ namespace SteamTool.Core
try
{
File.WriteAllLines(HostsPath, dataLines, Encoding.UTF8);
File.WriteAllLines(HostsPath, dataLines);
//File.SetAttributes(HostsPath, FileAttributes.ReadOnly);
result.ResultType = OperationResultType.Success;
@@ -216,18 +191,16 @@ namespace SteamTool.Core
public OperationResult RemoveHostsByTag()
{
var result = new OperationResult(OperationResultType.Error, Resources.Hosts_WirteError);
if (!File.Exists(HostsPath))
{
result.Message = "hosts file was not found";
return result;
}
//操作前取消只读属性
File.SetAttributes(HostsPath, FileAttributes.Normal);
//避免重复写入
var dataLines = File.ReadAllLines(HostsPath, Encoding.Default).ToList().FindAll(s =>
{
var temp = s.Trim().Split(' ').ToList().FindAll(w => !string.IsNullOrEmpty(w));
//有效数据一行内至少要有两列数据
var temp = s.Trim().Split(' ').ToList();
temp = temp.FindAll(s => !string.IsNullOrEmpty(s));
//一行内至少要有两列数据
if (temp.Count >= 2)
{
if (!temp[0].StartsWith("#"))
@@ -240,7 +213,7 @@ namespace SteamTool.Core
try
{
File.WriteAllLines(HostsPath, dataLines, Encoding.UTF8);
File.WriteAllLines(HostsPath, dataLines);
//File.SetAttributes(HostsPath, FileAttributes.ReadOnly);
result.ResultType = OperationResultType.Success;
result.Message = Resources.Hosts_UpdateSuccess;
@@ -15,7 +15,7 @@ namespace SteamTool.Core
{
private readonly HttpClient _client = new HttpClient();
public string UserAgent { get; set; } = "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko";
public string UserAgent { get; set; } = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36";
public string Accept { get; set; } = "application/json";
@@ -19,11 +19,11 @@ namespace SteamTool.Core
public SteamToolCore()
{
Kernel.Bind<ConfigService>().ToConstant(new ConfigService());
Kernel.Bind<RegistryKeyService>().ToConstant(new RegistryKeyService());
Kernel.Bind<RegistryKeyService>().To<RegistryKeyService>();
Kernel.Bind<SteamToolService>().ToSelf();
Kernel.Bind<VdfService>().To<VdfService>();
Kernel.Bind<HttpServices>().ToConstant(new HttpServices());
Kernel.Bind<HostsService>().ToConstant(new HostsService());
Kernel.Bind<HostsService>().To<HostsService>();
}
public TInterface Get<TInterface>()
@@ -22,7 +22,7 @@ namespace SteamTool.Core.Properties {
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class Resources {
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
@@ -36,7 +36,7 @@ namespace SteamTool.Core.Properties {
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Resources.ResourceManager ResourceManager {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SteamTool.Core.Properties.Resources", typeof(Resources).Assembly);
@@ -51,7 +51,7 @@ namespace SteamTool.Core.Properties {
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Globalization.CultureInfo Culture {
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
@@ -74,7 +74,7 @@ namespace SteamTool.Core.Properties {
///# Additionally, comments (such as these) may be inserted on individual
///# lines or following th [字符串的其余部分被截断]&quot;; 的本地化字符串。
/// </summary>
public static string DefaultHosts {
internal static string DefaultHosts {
get {
return ResourceManager.GetString("DefaultHosts", resourceCulture);
}
@@ -83,7 +83,7 @@ namespace SteamTool.Core.Properties {
/// <summary>
/// 查找类似 写入的Hosts已经存在 的本地化字符串。
/// </summary>
public static string Hosts_Exists {
internal static string Hosts_Exists {
get {
return ResourceManager.GetString("Hosts_Exists", resourceCulture);
}
@@ -92,7 +92,7 @@ namespace SteamTool.Core.Properties {
/// <summary>
/// 查找类似 读取Hosts时发生错误 的本地化字符串。
/// </summary>
public static string Hosts_ReadError {
internal static string Hosts_ReadError {
get {
return ResourceManager.GetString("Hosts_ReadError", resourceCulture);
}
@@ -101,7 +101,7 @@ namespace SteamTool.Core.Properties {
/// <summary>
/// 查找类似 读取Hosts成功 的本地化字符串。
/// </summary>
public static string Hosts_ReadSuccess {
internal static string Hosts_ReadSuccess {
get {
return ResourceManager.GetString("Hosts_ReadSuccess", resourceCulture);
}
@@ -110,7 +110,7 @@ namespace SteamTool.Core.Properties {
/// <summary>
/// 查找类似 写入Hosts成功 的本地化字符串。
/// </summary>
public static string Hosts_UpdateSuccess {
internal static string Hosts_UpdateSuccess {
get {
return ResourceManager.GetString("Hosts_UpdateSuccess", resourceCulture);
}
@@ -119,7 +119,7 @@ namespace SteamTool.Core.Properties {
/// <summary>
/// 查找类似 写入Hosts时发生错误 的本地化字符串。
/// </summary>
public static string Hosts_WirteError {
internal static string Hosts_WirteError {
get {
return ResourceManager.GetString("Hosts_WirteError", resourceCulture);
}
@@ -141,24 +141,10 @@ namespace SteamTool.Core.Properties {
/// &lt;param name=&quot;File&quot; value=&quot;log\\&quot; /&gt;
/// &lt;param name=&quot;AppendToFile&quot; value=&quot;true&quot; [字符串的其余部分被截断]&quot;; 的本地化字符串。
/// </summary>
public static string Log4netXml {
internal static string Log4netXml {
get {
return ResourceManager.GetString("Log4netXml", resourceCulture);
}
}
/// <summary>
/// 查找类似 echo &quot;Steam++替换升级中...&quot;
///taskkill /f /im {0}
///xcopy /y /c /h /r /s &quot;{1}\*.*&quot; &quot;{2}&quot;
///rmdir /s /q {1}
///{3}
///del %0 的本地化字符串。
/// </summary>
public static string ProgramUpdateCmd {
get {
return ResourceManager.GetString("ProgramUpdateCmd", resourceCulture);
}
}
}
}
@@ -175,17 +175,12 @@
&lt;param name="RollingStyle" value="Date" /&gt;
&lt;layout type="log4net.Layout.PatternLayout,log4net"&gt;
&lt;param name="ConversionPattern" value="%d %-5p &gt;&gt; %m%n" /&gt;
&lt;!--输出头部并换行--&gt;
&lt;!--&lt;param name="Header" value="&amp;#13;&amp;#10;———————————————————&amp;#13;&amp;#10;" /&gt;
&lt;param name="Footer" value="&amp;#13;&amp;#10;———————————————————&amp;#13;&amp;#10;" /&gt;--&gt;
&lt;/layout&gt;
&lt;/appender&gt;
&lt;/log4net&gt;
&lt;/configuration&gt;</value>
</data>
<data name="ProgramUpdateCmd" xml:space="preserve">
<value>echo "Steam++替换升级中..."
taskkill /f /im {0}
xcopy /y /c /h /r /s "{1}\*.*" "{2}"
rmdir /s /q {1}
{3}
del %0</value>
</data>
</root>
@@ -12,8 +12,6 @@
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Ninject" Version="3.3.4" />
<PackageReference Include="Portable.BouncyCastle" Version="1.8.9" />
<PackageReference Include="SharpZipLib" Version="1.3.1" />
<PackageReference Include="System.Management" Version="5.0.0" />
<PackageReference Include="TaskScheduler" Version="2.9.0" />
</ItemGroup>
@@ -32,7 +30,7 @@
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
@@ -37,11 +37,6 @@ namespace SteamTool.Core
public const string UserDataDirectory = @"\userdata";
/*
Windows: ~\Steam\config\loginusers.vdf
Linux: ~/.steam/steam/config/loginusers.vdf
Mac: ~/Library/Application Support/Steam/config/loginusers.vdf
*/
public const string UserVdfPath = @"\config\loginusers.vdf";
private const string SteamRegistryPath = @"SOFTWARE\Valve\Steam";
@@ -67,7 +62,7 @@ namespace SteamTool.Core
Process[] processes = Process.GetProcesses();
foreach (Process process in processes)
{
if (process.ProcessName.Equals("steam", StringComparison.OrdinalIgnoreCase) || process.ProcessName.Equals("steamservice", StringComparison.OrdinalIgnoreCase) || process.ProcessName.Equals("steamwebhelper", StringComparison.OrdinalIgnoreCase))
if (process.ProcessName.Equals("steam", StringComparison.OrdinalIgnoreCase) || process.ProcessName.Equals("steamService", StringComparison.OrdinalIgnoreCase) || process.ProcessName.Equals("steamwebhelper", StringComparison.OrdinalIgnoreCase))
{
process.Kill();
}
@@ -95,17 +90,17 @@ namespace SteamTool.Core
/// 获取所有记住登陆steam用户信息
/// </summary>
/// <returns></returns>
public List<SteamUser> GetRememberUserList()
public List<SteamUser> GetAllUser()
{
var users = new List<SteamUser>();
if (File.Exists(SteamPath + UserVdfPath))
{
var v = vdfService.GetVdfModelByPath(SteamPath + UserVdfPath);
foreach (var item in v.Value)
{
var i = item.Value;
var user = new SteamUser(item.ToString())
var user = new SteamUser
{
SteamId64 = Convert.ToInt64(item.Key.ToString()),
AccountName = i.AccountName?.ToString(),
@@ -113,22 +108,20 @@ namespace SteamTool.Core
RememberPassword = Convert.ToBoolean(Convert.ToInt64(i.RememberPassword?.ToString())),
Timestamp = Convert.ToInt64(i.Timestamp?.ToString())
};
user.PersonaName = user.SteamID;
user.LastLoginTime = user.Timestamp.ToDateTime();
//老版本Steam数据 小写mostrecent 支持
user.MostRecent = i.mostrecent != null ?
Convert.ToBoolean(Convert.ToByte(i.mostrecent.ToString())) :
Convert.ToBoolean(Convert.ToByte(i.MostRecent.ToString()));
user.WantsOfflineMode = i.WantsOfflineMode != null ?
Convert.ToBoolean(Convert.ToByte(i.WantsOfflineMode.ToString())) : false;
// 因为警告这个东西应该都不需要所以直接默认跳过好了
user.SkipOfflineModeWarning = true;
//user.SkipOfflineModeWarning = i.SkipOfflineModeWarning != null ?
// Convert.ToBoolean(Convert.ToByte(i.SkipOfflineModeWarning.ToString())) : false;
user.LastLoginTime = TimeZoneInfo.ConvertTimeFromUtc(new DateTime(1970, 1, 1, 0, 0, 0).AddSeconds(user.Timestamp), TimeZoneInfo.Local);
if (i.mostrecent != null)//老版本Steam数据 小写mostrecent 支持
{
user.MostRecent = Convert.ToBoolean(Convert.ToInt64(i.mostrecent.ToString()));
}
else if (i.MostRecent != null)
{
user.MostRecent = Convert.ToBoolean(Convert.ToInt64(i.MostRecent.ToString()));
}
else
{
user.MostRecent = false;
}
users.Add(user);
}
}
@@ -221,10 +214,5 @@ namespace SteamTool.Core
Directory.Delete(temp, true);
}
}
public void UpdateSteamLocalUserData(SteamUser user)
{
vdfService.UpdateVdfValueByReplace(SteamPath + UserVdfPath, user.OriginVdfString, user.CurrentVdfString);
}
}
}
@@ -7,7 +7,6 @@ using System.Text;
using System.Threading.Tasks;
using Gameloop.Vdf;
using Gameloop.Vdf.Linq;
using SteamTool.Core.Common;
namespace SteamTool.Core
{
@@ -34,14 +33,6 @@ namespace SteamTool.Core
return GetVdfModel(text);
}
public void UpdateVdfValueByReplace(string path, string oldVaule, string newValue)
{
string text = File.ReadAllText(path, Encoding.UTF8);
text = text.RemovePattern().Replace(
oldVaule.RemovePattern().Replace(" ",string.Empty), newValue);
//Debug.WriteLine(text);
File.WriteAllText(path, text, Encoding.UTF8);
}
public void DeleteVdfValueByKey(string path, string key)
{
@@ -53,13 +44,5 @@ namespace SteamTool.Core
//Debug.WriteLine(text);
File.WriteAllText(path, text, Encoding.UTF8);
}
public void DeleteVdfValueByReplace(string path, string oldVaule)
{
string text = File.ReadAllText(path, Encoding.UTF8);
text = text.Replace(oldVaule, string.Empty);
//Debug.WriteLine(text);
File.WriteAllText(path, text, Encoding.UTF8);
}
}
}
@@ -5,7 +5,6 @@ namespace SteamTool.Model
public class Const
{
public const string APP_LIST_FILE = "apps.json";
public const string AUTHDATA_FILE = "authenticators.dat";
public const string SETTINGS_FILE = "settings.json";
public const string SCRIPT_DIR = "scripts";
public const string HOST_TAG = "#S302";
@@ -22,7 +21,6 @@ namespace SteamTool.Model
public const string MY_WISHLIST_URL = "https://store.steampowered.com/wishlist/profiles/76561198289531723/";
public const string MY_MINIPROFILE_URL = "https://steamcommunity.com/miniprofile/329265995";
public const string STEAM_LOGIN_URL = "https://steamcommunity.com/login/home/?goto=my/profile";
public const string STEAM_BADGES_URL = "https://steamcommunity.com/profiles/{0}/badges/";
public const string STEAMAPP_LIST_URL = "https://api.steampowered.com/ISteamApps/GetAppList/v2";
public const string STORE_APP_URL = "https://store.steampowered.com/app/{0}";
@@ -4,13 +4,6 @@ namespace SteamTool.Model
{
public class SteamUser
{
public SteamUser() { }
public SteamUser(string vdfstring)
{
OriginVdfString = vdfstring;
}
public string SteamId3 { get; set; }
public long SteamId3_Int => ((SteamId64 >> (ushort)0) & 0xFFFFFFFF);
@@ -39,35 +32,25 @@ namespace SteamTool.Model
public string PrivacyState { get; set; }
/// <summary>
/// 头像小图标
/// 头像链接
/// </summary>
public string AvatarIcon { get; set; }
/// <summary>
/// 头像中等图片链接
/// 头像链接
/// </summary>
public string AvatarMedium { get; set; } = "/Resources/Asstes/avater.jpg";
public string AvatarMedium { get; set; }
/// <summary>
/// 头像大图链接
/// 头像链接
/// </summary>
public string AvatarFull { get; set; }
public string AvatarFull { get; set; }
/// <summary>
/// 昵称
/// </summary>
public string SteamID { get; set; }
/// <summary>
/// 昵称
/// </summary>
public string SteamNickName => string.IsNullOrEmpty(SteamID) ? PersonaName : SteamID;
/// <summary>
/// 从VDF读取到的用户名
/// </summary>
public string PersonaName { get; set; } = "No Name";
/// <summary>
/// 用户名
/// </summary>
@@ -98,37 +81,9 @@ namespace SteamTool.Model
/// </summary>
public bool MostRecent { get; set; }
/// <summary>
/// 离线模式
/// </summary>
public bool WantsOfflineMode { get; set; }
/// <summary>
/// 忽略离线模式警告弹窗
/// </summary>
public bool SkipOfflineModeWarning { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 来源VDF字符串
/// </summary>
public string OriginVdfString { get; set; }
/// <summary>
/// 导出VDF配置字符串
/// </summary>
public string CurrentVdfString =>
"\"" + SteamId64 + "\"\n{\n" +
"\t\t\"AccountName\"\t\t\"" + AccountName + "\"\n" +
"\t\t\"PersonaName\"\t\t\"" + PersonaName + "\"\n" +
"\t\t\"RememberPassword\"\t\t\"" + Convert.ToByte(RememberPassword) + "\"\n" +
"\t\t\"MostRecent\"\t\t\"" + Convert.ToByte(MostRecent) + "\"\n" +
"\t\t\"WantsOfflineMode\"\t\t\"" + Convert.ToByte(WantsOfflineMode) + "\"\n" +
"\t\t\"SkipOfflineModeWarning\"\t\t\"" + Convert.ToByte(SkipOfflineModeWarning) + "\"\n" +
"\t\t\"Timestamp\"\t\t\"" + Timestamp + "\"\n}";
}
}
@@ -14,9 +14,6 @@ using Titanium.Web.Proxy.Http;
using Titanium.Web.Proxy.Models;
using SteamTool.Model;
using System.Security.Cryptography;
using Org.BouncyCastle.Asn1;
using Org.BouncyCastle.Asn1.X509;
using Org.BouncyCastle.X509;
namespace SteamTool.Proxy
{
@@ -30,19 +27,13 @@ namespace SteamTool.Proxy
public IReadOnlyCollection<ProxyDomainModel> ProxyDomains { get; set; }
public List<ProxyScript> Scripts { get; set; }
public bool IsEnableScript { get; set; }
public bool IsOnlyWorkSteamBrowser { get; set; }
public string CertificateName { get; }
public HttpProxy(IReadOnlyCollection<ProxyDomainModel> proxyDomains, string certificateName)
{
proxyServer.ThreadPoolWorkerThread = Environment.ProcessorCount * 8;
ProxyDomains = proxyDomains;
CertificateName = certificateName;
//proxyServer.CertificateManager.PfxPassword = $"{CertificateName}";
proxyServer.ThreadPoolWorkerThread = Environment.ProcessorCount * 8;
proxyServer.CertificateManager.PfxFilePath = Path.Combine(AppContext.BaseDirectory, $@"{CertificateName}.Certificate.pfx");
proxyServer.CertificateManager.RootCertificateIssuerName = $"{CertificateName} Certificate Authority";
proxyServer.CertificateManager.RootCertificateName = $"{CertificateName} Certificate";
proxyServer.CertificateManager.CertificateEngine = Titanium.Web.Proxy.Network.CertificateEngine.DefaultWindows;
}
public bool ProxyRunning => proxyServer.ProxyRunning;
@@ -74,19 +65,19 @@ namespace SteamTool.Proxy
*/
#endregion
Debug.WriteLine("OnRequest " + e.HttpClient.Request.RequestUri.AbsoluteUri);
Debug.WriteLine("OnRequest HTTP " + e.HttpClient.Request.HttpVersion);
Debug.WriteLine("OnRequest Authority " + e.HttpClient.Request.RequestUri.Authority);
Logger.Info("OnRequest" + e.HttpClient.Request.RequestUri.AbsoluteUri);
#endif
// Dns.GetHostAddressesAsync(e.HttpClient.Request.Host).ContinueWith(s =>
//{
// //部分运营商将奇怪的域名解析到127.0.0.1 再此排除这些不支持的代理域名
// if (IPAddress.IsLoopback(s.Result.FirstOrDefault())
// && ProxyDomains.Count(w => w.IsEnable && w.Hosts.Contains(e.HttpClient.Request.Host)) == 0)
// {
// e.Ok($"URL : {e.HttpClient.Request.RequestUri.AbsoluteUri} \r\n not support proxy");
// return;
// }
//});
#endif
await Dns.GetHostAddressesAsync(e.HttpClient.Request.Host).ContinueWith(s =>
{
//部分运营商将奇怪的域名解析到127.0.0.1 再此排除这些不支持的代理域名
if (IPAddress.IsLoopback(s.Result.FirstOrDefault())
&& ProxyDomains.Count(w => w.IsEnable && w.Hosts.Contains(e.HttpClient.Request.Host)) == 0)
{
e.Ok($"URL : {e.HttpClient.Request.RequestUri.AbsoluteUri} \r\n not support proxy");
return;
}
});
foreach (var item in ProxyDomains)
{
if (!item.IsEnable)
@@ -124,36 +115,21 @@ namespace SteamTool.Proxy
e.HttpClient.ConnectRequest.ClientHelloInfo.Extensions.Remove("server_name");
}
}
return;
}
}
}
//没有匹配到的结果直接返回不支持,避免出现Loopback死循环内存溢出
e.Ok($"URL : {e.HttpClient.Request.RequestUri.AbsoluteUri} {Environment.NewLine} not support proxy");
return;
}
public async Task OnResponse(object sender, SessionEventArgs e)
{
// read response headers
//var responseHeaders = e.HttpClient.Response.Headers;
//if (!e.ProxySession.Request.Host.Equals("medeczane.sgk.gov.tr")) return;
#if DEBUG
Debug.WriteLine("OnResponse" + e.HttpClient.Request.RequestUri.AbsoluteUri);
Logger.Info("OnResponse" + e.HttpClient.Request.RequestUri.AbsoluteUri);
#endif
if (IsEnableScript)
{
if (IsOnlyWorkSteamBrowser)
{
var ua = e.HttpClient.Request.Headers.GetHeaders("User-Agent");
if (ua.Any())
{
if (!ua.First().Value.Contains("Valve Steam"))
{
return;
}
}
else
return;
}
foreach (var script in Scripts)
{
if (script.Enable)
@@ -224,23 +200,26 @@ namespace SteamTool.Proxy
close:;
}
}
}
//// 允许重写默认的证书验证逻辑
//public Task OnCertificateValidation(object sender, CertificateValidationEventArgs e)
//{
// // 根据证书错误,设置IsValid为真/假
// //if (e.SslPolicyErrors == System.Net.Security.SslPolicyErrors.None)
// e.IsValid = true;
// return Task.CompletedTask;
//}
// 允许重写默认的证书验证逻辑
public Task OnCertificateValidation(object sender, CertificateValidationEventArgs e)
{
// 根据证书错误,设置IsValid为真/假
if (e.SslPolicyErrors == System.Net.Security.SslPolicyErrors.None)
e.IsValid = true;
return Task.CompletedTask;
}
//// 允许在相互身份验证期间重写默认客户端证书选择逻辑
//public Task OnCertificateSelection(object sender, CertificateSelectionEventArgs e)
//{
// // set e.clientCertificate to override
// return Task.CompletedTask;
//}
// 允许在相互身份验证期间重写默认客户端证书选择逻辑
public Task OnCertificateSelection(object sender, CertificateSelectionEventArgs e)
{
// set e.clientCertificate to override
return Task.CompletedTask;
}
public bool SetupCertificate()
{
@@ -249,18 +228,21 @@ namespace SteamTool.Proxy
//proxyServer.CertificateManager
// .CreateServerCertificate($"{Assembly.GetCallingAssembly().GetName().Name} Certificate")
// .ContinueWith(c => proxyServer.CertificateManager.RootCertificate = c.Result);
proxyServer.CertificateManager.PfxFilePath = Path.Combine(AppContext.BaseDirectory, $@"{CertificateName}.Certificate.pfx");
//proxyServer.CertificateManager.PfxPassword = $"{CertificateName}";
proxyServer.CertificateManager.RootCertificateIssuerName = CertificateName;
proxyServer.CertificateManager.RootCertificateName = $"{CertificateName} Certificate";
proxyServer.CertificateManager.CertificateEngine = Titanium.Web.Proxy.Network.CertificateEngine.DefaultWindows;
// 可选地设置证书引擎
// 在Mono之下,只有BouncyCastle将得到支持
//proxyServer.CertificateManager.CertificateEngine = Network.CertificateEngine.BouncyCastle;
//proxyServer.CertificateManager.SaveFakeCertificates = true;
var result = proxyServer.CertificateManager.CreateRootCertificate(true);
if (result)
{
proxyServer.CertificateManager.EnsureRootCertificate();
proxyServer.CertificateManager.RootCertificate.SaveCerCertificateFile(Path.Combine(AppContext.BaseDirectory, $@"{CertificateName}.Certificate.cer"));
}
return proxyServer.CertificateManager.IsRootCertificateUserTrusted();
proxyServer.CertificateManager.SaveFakeCertificates = false;
proxyServer.CertificateManager.CreateRootCertificate(true);
proxyServer.CertificateManager.EnsureRootCertificate();
//proxyServer.CertificateManager.TrustRootCertificate(true);
return IsCertificateInstalled(proxyServer.CertificateManager.RootCertificate);
}
public bool DeleteCertificate()
@@ -269,19 +251,22 @@ namespace SteamTool.Proxy
return false;
try
{
//using (var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser))
//{
// store.Open(OpenFlags.MaxAllowed);
// var test = store.Certificates.Find(X509FindType.FindByIssuerName, CertificateName, true);
// foreach (var item in test)
// {
// store.Remove(item);
// }
//}
//proxyServer.CertificateManager.ClearRootCertificate();
proxyServer.CertificateManager.RemoveTrustedRootCertificate();
//proxyServer.CertificateManager.RemoveTrustedRootCertificateAsAdmin();
//proxyServer.CertificateManager.CertificateStorage.Clear();
using (var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser))
{
store.Open(OpenFlags.MaxAllowed);
//var test = store.Certificates.Find(X509FindType.FindByIssuerName, "titan", true);
var test = store.Certificates.Find(X509FindType.FindByIssuerName, CertificateName, true);
foreach (var item in test)
{
store.Remove(item);
}
//if (store.Certificates.Contains(proxyServer.CertificateManager.RootCertificate))
// store.Remove(proxyServer.CertificateManager.RootCertificate);
}
proxyServer.CertificateManager.ClearRootCertificate();
proxyServer.CertificateManager.RemoveTrustedRootCertificate(true);
proxyServer.CertificateManager.RemoveTrustedRootCertificateAsAdmin(true);
proxyServer.CertificateManager.CertificateStorage.Clear();
}
catch (Exception ex)
{
@@ -326,11 +311,10 @@ namespace SteamTool.Proxy
return false;
}
}
//暂时移除443端口检测
//if (PortInUse(443))
//{
// return false;
//}
if (PortInUse(443))
{
return false;
}
if (IsProxyGOG) { WirtePemCertificateToGoGSteamPlugins(); }
#region 写入Hosts
@@ -366,12 +350,13 @@ namespace SteamTool.Proxy
//explicit endpoint 是客户端知道代理存在的地方
//因此,客户端以代理友好的方式发送请求
//proxyServer.AddEndPoint(explicitEndPoint);
// transparentEndPoint 对于反向代理很有用(客户端不知道代理的存在)
// transparentEndPoint 通常需要一个网络路由器端口来转发HTTP(S)包或DNS
// 透明endpoint 对于反向代理很有用(客户端不知道代理的存在)
// 透明endpoint 通常需要一个网络路由器端口来转发HTTP(S)包或DNS
// 发送数据到此endpoint
var transparentEndPoint = new TransparentProxyEndPoint(IPAddress.Any, 443, true)
{
//GenericCertificate = proxyServer.CertificateManager.RootCertificate
//GenericCertificateName= "steamcommunity-a.akamaihd.net"
};
proxyServer.AddEndPoint(transparentEndPoint);
try
@@ -402,8 +387,8 @@ namespace SteamTool.Proxy
{
proxyServer.BeforeRequest -= OnRequest;
proxyServer.BeforeResponse -= OnResponse;
//proxyServer.ServerCertificateValidationCallback -= OnCertificateValidation;
//proxyServer.ClientCertificateSelectionCallback -= OnCertificateSelection;
proxyServer.ServerCertificateValidationCallback -= OnCertificateValidation;
proxyServer.ClientCertificateSelectionCallback -= OnCertificateSelection;
proxyServer.Stop();
hostsService.RemoveHostsByTag();
}
@@ -427,7 +412,7 @@ namespace SteamTool.Proxy
var s = file.Substring(Const.HOST_TAG, Const.HOST_TAG, true);
if (string.IsNullOrEmpty(s))
{
File.AppendAllText(certifi, Environment.NewLine + pem);
File.AppendAllText(certifi, "\r\n" + pem);
}
else if (s.Trim() != pem.Trim())
{
@@ -9,6 +9,8 @@ namespace SteamTool.Proxy
{
public class ProxyDomainModel
{
public int Index { get; set; }
/// <summary>
/// 显示在UI上的名称
/// </summary>
@@ -70,19 +72,17 @@ namespace SteamTool.Proxy
Discord = 4,
[Description("Twitch直播")]
Twitch = 5,
[Description("Origin下载(Akamai)")]
[Description("Origin下载加速(Akamai)")]
OriginGameDownload = 6,
[Description("GOG.COM")]
GOG = 7,
[Description("Uplay更新防劫持")]
UplayUpdate = 7,
[Description("Google(Recaptcha)")]
GoogleCode = 8,
[Description("GOG.COM")]
GOG = 8,
[Description("Github图片修复")]
GithubContent = 9,
GithubContent = 9,
[Description("Pixiv")]
Pixiv = 10,
[Description("Discord更新下载")]
DiscordNet = 11,
[Description("Uplay更新防劫持")]
UplayUpdate = 12,
}
}
@@ -69,15 +69,6 @@ namespace SteamTool.Proxy.Properties {
}
}
/// <summary>
/// 查找类似 Discord更新下载 的本地化字符串。
/// </summary>
public static string DiscordNet {
get {
return ResourceManager.GetString("DiscordNet", resourceCulture);
}
}
/// <summary>
/// 查找类似 Github图片资源修复 的本地化字符串。
/// </summary>
@@ -120,9 +120,6 @@
<data name="Discord" xml:space="preserve">
<value>Discord语音</value>
</data>
<data name="DiscordNet" xml:space="preserve">
<value>Discord更新下载</value>
</data>
<data name="GithubContent" xml:space="preserve">
<value>Github图片资源修复</value>
</data>
@@ -11,7 +11,7 @@
<PackageReference Include="BrotliSharpLib" Version="0.3.3" />
<PackageReference Include="DnsClient" Version="1.3.2" />
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="Portable.BouncyCastle" Version="1.8.9" />
<PackageReference Include="Portable.BouncyCastle" Version="1.8.8" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="System.Memory" Version="4.5.4" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
@@ -21,7 +21,12 @@
<ItemGroup>
<ProjectReference Include="..\SteamTool.Core\SteamTool.Core.csproj" />
<ProjectReference Include="..\..\references\Titanium-Web-Proxy\src\Titanium.Web.Proxy\Titanium.Web.Proxy.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="Titanium.Web.Proxy">
<HintPath>..\Lib\Titanium.Web.Proxy.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
@@ -17,18 +17,14 @@ namespace SteamTool.Steam.Service.Web
public async Task<SteamUser> GetUserInfo(long steamId64)
{
var r = await httpServices.Get(string.Format(Const.STEAMDB_USERINFO_URL, steamId64));
if (!string.IsNullOrEmpty(r))
{
var userInfo = JsonConvert.DeserializeObject<SteamUser>(r);
return userInfo;
}
return new SteamUser() { SteamId64 = steamId64 };
var userInfo = JsonConvert.DeserializeObject<SteamUser>(r);
return userInfo;
}
public async Task<List<SteamUser>> GetUserInfo(long[] steamId64s)
{
var users = new List<SteamUser>();
foreach (var i in steamId64s)
foreach (var i in steamId64s)
{
users.Add(await GetUserInfo(i));
}
@@ -36,15 +32,11 @@ namespace SteamTool.Steam.Service.Web
}
public async Task<SteamApp> GetAppInfo(int appId)
public async Task<SteamApp> GetAppInfo(long appId)
{
var r = await httpServices.Get(string.Format(Const.STEAMDB_APPINFO_URL, appId));
if (!string.IsNullOrEmpty(r))
{
var steamApp = JsonConvert.DeserializeObject<SteamApp>(r);
return steamApp;
}
return new SteamApp() { AppId = (uint)appId };
var steamApp = JsonConvert.DeserializeObject<SteamApp>(r);
return steamApp;
}
}

Some files were not shown because too many files have changed in this diff Show More