mirror of
https://github.com/BeyondDimension/SteamTools.git
synced 2026-10-26 20:20:14 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8da01ac3dd | ||
|
|
39fcc4d9a8 | ||
|
|
b4a755a647 | ||
|
|
083189c264 | ||
|
|
676c628b6f | ||
|
|
43ca455e70 | ||
|
|
95e834a188 | ||
|
|
e9d822bb0c | ||
|
|
f395383db8 | ||
|
|
f805911f4e | ||
|
|
b3d203fbda | ||
|
|
bb022f45fd | ||
|
|
e4a97463f4 |
@@ -151,5 +151,59 @@
|
||||
"PayType": 2,
|
||||
"Remark": "",
|
||||
"PayTime": "2020-12-26 18:56:57"
|
||||
},
|
||||
{
|
||||
"Index": 18,
|
||||
"Name": "*易",
|
||||
"Amount": 6.66,
|
||||
"OrderNumber": "",
|
||||
"PayType": 1,
|
||||
"Remark": "其乐Kenagi,给大佬递冰阔落",
|
||||
"PayTime": "2020-12-27 13:55:11"
|
||||
},
|
||||
{
|
||||
"Index": 19,
|
||||
"Name": "*明",
|
||||
"Amount": 10,
|
||||
"OrderNumber": "",
|
||||
"PayType": 1,
|
||||
"Remark": "感谢大佬",
|
||||
"PayTime": "2020-12-27 21:28:40"
|
||||
},
|
||||
{
|
||||
"Index": 20,
|
||||
"Name": "山山为川",
|
||||
"Amount": 1,
|
||||
"OrderNumber": "",
|
||||
"PayType": 2,
|
||||
"Remark": "",
|
||||
"PayTime": "2020-12-27 22:17:22"
|
||||
},
|
||||
{
|
||||
"Index": 21,
|
||||
"Name": "*梁",
|
||||
"Amount": 3,
|
||||
"OrderNumber": "",
|
||||
"PayType": 1,
|
||||
"Remark": "其乐wuwang23333 给大佬递",
|
||||
"PayTime": "2020-12-28 11:59:20"
|
||||
},
|
||||
{
|
||||
"Index": 22,
|
||||
"Name": "**男",
|
||||
"Amount": 1,
|
||||
"OrderNumber": "",
|
||||
"PayType": 1,
|
||||
"Remark": "越做越好",
|
||||
"PayTime": "2020-12-28 14:54:48"
|
||||
},
|
||||
{
|
||||
"Index": 23,
|
||||
"Name": "匿名",
|
||||
"Amount": 14.61,
|
||||
"OrderNumber": "",
|
||||
"PayType": 2,
|
||||
"Remark": "",
|
||||
"PayTime": "2020-12-28 14:07:44"
|
||||
}
|
||||
]
|
||||
|
||||
+1330
-1330
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.8" />
|
||||
<PackageReference Include="Portable.BouncyCastle" Version="1.8.9" />
|
||||
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -15,6 +15,10 @@ 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))
|
||||
@@ -40,6 +44,10 @@ 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);
|
||||
|
||||
@@ -0,0 +1,322 @@
|
||||
using ICSharpCode.SharpZipLib.Checksum;
|
||||
using ICSharpCode.SharpZipLib.Zip;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace SteamTool.Core.Common
|
||||
{
|
||||
public static class ZipHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// 压缩
|
||||
/// </summary>
|
||||
/// <param name="filename"> 压缩后的文件名(包含物理路径)</param>
|
||||
/// <param name="directory">待压缩的文件夹(包含物理路径)</param>
|
||||
public static void PackFiles(string filename, string directory)
|
||||
{
|
||||
try
|
||||
{
|
||||
FastZip fz = new FastZip();
|
||||
fz.CreateEmptyDirectories = true;
|
||||
fz.CreateZip(filename, directory, true, "");
|
||||
fz = null;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 解压缩
|
||||
/// </summary>
|
||||
/// <param name="file">待解压文件名(包含物理路径)</param>
|
||||
/// <param name="dir"> 解压到哪个目录中(包含物理路径)</param>
|
||||
public static bool UnpackFiles(string file, string dir)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(dir))
|
||||
{
|
||||
Directory.CreateDirectory(dir);
|
||||
}
|
||||
ZipInputStream s = new ZipInputStream(File.OpenRead(file));
|
||||
ZipEntry theEntry;
|
||||
while ((theEntry = s.GetNextEntry()) != null)
|
||||
{
|
||||
string directoryName = Path.GetDirectoryName(theEntry.Name);
|
||||
string fileName = Path.GetFileName(theEntry.Name);
|
||||
if (directoryName != String.Empty)
|
||||
{
|
||||
Directory.CreateDirectory(Path.Combine(dir, directoryName));
|
||||
}
|
||||
if (fileName != String.Empty)
|
||||
{
|
||||
FileStream streamWriter = File.Create(Path.Combine(dir, theEntry.Name));
|
||||
int size = 2048;
|
||||
byte[] data = new byte[2048];
|
||||
while (true)
|
||||
{
|
||||
size = s.Read(data, 0, data.Length);
|
||||
if (size > 0)
|
||||
{
|
||||
streamWriter.Write(data, 0, size);
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
streamWriter.Close();
|
||||
}
|
||||
}
|
||||
s.Close();
|
||||
return true;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class ClassZip
|
||||
{
|
||||
#region 私有方法
|
||||
/// <summary>
|
||||
/// 递归压缩文件夹方法
|
||||
/// </summary>
|
||||
private static bool ZipFileDictory(string FolderToZip, ZipOutputStream s, string ParentFolderName)
|
||||
{
|
||||
bool res = true;
|
||||
string[] folders, filenames;
|
||||
ZipEntry entry = null;
|
||||
FileStream fs = null;
|
||||
Crc32 crc = new Crc32();
|
||||
try
|
||||
{
|
||||
entry = new ZipEntry(Path.Combine(ParentFolderName, Path.GetFileName(FolderToZip) + "/"));
|
||||
s.PutNextEntry(entry);
|
||||
s.Flush();
|
||||
filenames = Directory.GetFiles(FolderToZip);
|
||||
foreach (string file in filenames)
|
||||
{
|
||||
fs = File.OpenRead(file);
|
||||
byte[] buffer = new byte[fs.Length];
|
||||
fs.Read(buffer, 0, buffer.Length);
|
||||
entry = new ZipEntry(Path.Combine(ParentFolderName, Path.GetFileName(FolderToZip) + "/" + Path.GetFileName(file)));
|
||||
entry.DateTime = DateTime.Now;
|
||||
entry.Size = fs.Length;
|
||||
fs.Close();
|
||||
crc.Reset();
|
||||
crc.Update(buffer);
|
||||
entry.Crc = crc.Value;
|
||||
s.PutNextEntry(entry);
|
||||
s.Write(buffer, 0, buffer.Length);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
res = false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (fs != null)
|
||||
{
|
||||
fs.Close();
|
||||
fs = null;
|
||||
}
|
||||
if (entry != null)
|
||||
{
|
||||
entry = null;
|
||||
}
|
||||
GC.Collect();
|
||||
GC.Collect(1);
|
||||
}
|
||||
folders = Directory.GetDirectories(FolderToZip);
|
||||
foreach (string folder in folders)
|
||||
{
|
||||
if (!ZipFileDictory(folder, s, Path.Combine(ParentFolderName, Path.GetFileName(FolderToZip))))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 压缩目录
|
||||
/// </summary>
|
||||
/// <param name="FolderToZip">待压缩的文件夹,全路径格式</param>
|
||||
/// <param name="ZipedFile">压缩后的文件名,全路径格式</param>
|
||||
private static bool ZipFileDictory(string FolderToZip, string ZipedFile, int level)
|
||||
{
|
||||
bool res;
|
||||
if (!Directory.Exists(FolderToZip))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
ZipOutputStream s = new ZipOutputStream(File.Create(ZipedFile));
|
||||
s.SetLevel(level);
|
||||
res = ZipFileDictory(FolderToZip, s, "");
|
||||
s.Finish();
|
||||
s.Close();
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 压缩文件
|
||||
/// </summary>
|
||||
/// <param name="FileToZip">要进行压缩的文件名</param>
|
||||
/// <param name="ZipedFile">压缩后生成的压缩文件名</param>
|
||||
private static bool ZipFile(string FileToZip, string ZipedFile, int level)
|
||||
{
|
||||
if (!File.Exists(FileToZip))
|
||||
{
|
||||
throw new System.IO.FileNotFoundException("指定要压缩的文件: " + FileToZip + " 不存在!");
|
||||
}
|
||||
FileStream ZipFile = null;
|
||||
ZipOutputStream ZipStream = null;
|
||||
ZipEntry ZipEntry = null;
|
||||
bool res = true;
|
||||
try
|
||||
{
|
||||
ZipFile = File.OpenRead(FileToZip);
|
||||
byte[] buffer = new byte[ZipFile.Length];
|
||||
ZipFile.Read(buffer, 0, buffer.Length);
|
||||
ZipFile.Close();
|
||||
|
||||
ZipFile = File.Create(ZipedFile);
|
||||
ZipStream = new ZipOutputStream(ZipFile);
|
||||
ZipEntry = new ZipEntry(Path.GetFileName(FileToZip));
|
||||
ZipStream.PutNextEntry(ZipEntry);
|
||||
ZipStream.SetLevel(level);
|
||||
|
||||
ZipStream.Write(buffer, 0, buffer.Length);
|
||||
}
|
||||
catch
|
||||
{
|
||||
res = false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (ZipEntry != null)
|
||||
{
|
||||
ZipEntry = null;
|
||||
}
|
||||
if (ZipStream != null)
|
||||
{
|
||||
ZipStream.Finish();
|
||||
ZipStream.Close();
|
||||
}
|
||||
if (ZipFile != null)
|
||||
{
|
||||
ZipFile.Close();
|
||||
ZipFile = null;
|
||||
}
|
||||
GC.Collect();
|
||||
GC.Collect(1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 压缩
|
||||
/// </summary>
|
||||
/// <param name="FileToZip">待压缩的文件目录</param>
|
||||
/// <param name="ZipedFile">生成的目标文件</param>
|
||||
/// <param name="level">6</param>
|
||||
public static bool Zip(String FileToZip, String ZipedFile, int level)
|
||||
{
|
||||
if (Directory.Exists(FileToZip))
|
||||
{
|
||||
return ZipFileDictory(FileToZip, ZipedFile, level);
|
||||
}
|
||||
else if (File.Exists(FileToZip))
|
||||
{
|
||||
return ZipFile(FileToZip, ZipedFile, level);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 解压
|
||||
/// </summary>
|
||||
/// <param name="FileToUpZip">待解压的文件</param>
|
||||
/// <param name="ZipedFolder">解压目标存放目录</param>
|
||||
public static void UnZip(string FileToUpZip, string ZipedFolder)
|
||||
{
|
||||
if (!File.Exists(FileToUpZip))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!Directory.Exists(ZipedFolder))
|
||||
{
|
||||
Directory.CreateDirectory(ZipedFolder);
|
||||
}
|
||||
ZipInputStream s = null;
|
||||
ZipEntry theEntry = null;
|
||||
string fileName;
|
||||
FileStream streamWriter = null;
|
||||
try
|
||||
{
|
||||
s = new ZipInputStream(File.OpenRead(FileToUpZip));
|
||||
while ((theEntry = s.GetNextEntry()) != null)
|
||||
{
|
||||
if (theEntry.Name != String.Empty)
|
||||
{
|
||||
fileName = Path.Combine(ZipedFolder, theEntry.Name);
|
||||
if (fileName.EndsWith("/") || fileName.EndsWith("\\"))
|
||||
{
|
||||
Directory.CreateDirectory(fileName);
|
||||
continue;
|
||||
}
|
||||
streamWriter = File.Create(fileName);
|
||||
int size = 2048;
|
||||
byte[] data = new byte[2048];
|
||||
while (true)
|
||||
{
|
||||
size = s.Read(data, 0, data.Length);
|
||||
if (size > 0)
|
||||
{
|
||||
streamWriter.Write(data, 0, size);
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (streamWriter != null)
|
||||
{
|
||||
streamWriter.Close();
|
||||
streamWriter = null;
|
||||
}
|
||||
if (theEntry != null)
|
||||
{
|
||||
theEntry = null;
|
||||
}
|
||||
if (s != null)
|
||||
{
|
||||
s.Close();
|
||||
s = null;
|
||||
}
|
||||
GC.Collect();
|
||||
GC.Collect(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,12 +13,25 @@ namespace SteamTool.Core
|
||||
{
|
||||
public class HostsService
|
||||
{
|
||||
public readonly static string HostsPath = $"{Environment.GetFolderPath(Environment.SpecialFolder.System)}\\drivers\\etc\\hosts";
|
||||
public readonly static string HostsPath = @$"{Environment.SystemDirectory}\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();
|
||||
@@ -48,7 +61,11 @@ 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);
|
||||
|
||||
@@ -94,7 +111,11 @@ 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;
|
||||
@@ -150,7 +171,11 @@ 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);
|
||||
|
||||
@@ -191,16 +216,18 @@ 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();
|
||||
temp = temp.FindAll(s => !string.IsNullOrEmpty(s));
|
||||
//一行内至少要有两列数据
|
||||
var temp = s.Trim().Split(' ').ToList().FindAll(w => !string.IsNullOrEmpty(w));
|
||||
//有效数据一行内至少要有两列数据
|
||||
if (temp.Count >= 2)
|
||||
{
|
||||
if (!temp[0].StartsWith("#"))
|
||||
@@ -228,6 +255,7 @@ namespace SteamTool.Core
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public void StartNotepadEditHosts()
|
||||
{
|
||||
System.Diagnostics.Process.Start("notepad.exe", HostsPath);
|
||||
|
||||
@@ -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; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36";
|
||||
public string UserAgent { get; set; } = "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko";
|
||||
|
||||
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>().To<RegistryKeyService>();
|
||||
Kernel.Bind<RegistryKeyService>().ToConstant(new RegistryKeyService());
|
||||
Kernel.Bind<SteamToolService>().ToSelf();
|
||||
Kernel.Bind<VdfService>().To<VdfService>();
|
||||
Kernel.Bind<HttpServices>().ToConstant(new HttpServices());
|
||||
Kernel.Bind<HostsService>().To<HostsService>();
|
||||
Kernel.Bind<HostsService>().ToConstant(new HostsService());
|
||||
}
|
||||
|
||||
public TInterface Get<TInterface>()
|
||||
|
||||
+24
-10
@@ -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()]
|
||||
internal class Resources {
|
||||
public 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)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
public 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)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
public 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 [字符串的其余部分被截断]"; 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string DefaultHosts {
|
||||
public static string DefaultHosts {
|
||||
get {
|
||||
return ResourceManager.GetString("DefaultHosts", resourceCulture);
|
||||
}
|
||||
@@ -83,7 +83,7 @@ namespace SteamTool.Core.Properties {
|
||||
/// <summary>
|
||||
/// 查找类似 写入的Hosts已经存在 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string Hosts_Exists {
|
||||
public static string Hosts_Exists {
|
||||
get {
|
||||
return ResourceManager.GetString("Hosts_Exists", resourceCulture);
|
||||
}
|
||||
@@ -92,7 +92,7 @@ namespace SteamTool.Core.Properties {
|
||||
/// <summary>
|
||||
/// 查找类似 读取Hosts时发生错误 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string Hosts_ReadError {
|
||||
public static string Hosts_ReadError {
|
||||
get {
|
||||
return ResourceManager.GetString("Hosts_ReadError", resourceCulture);
|
||||
}
|
||||
@@ -101,7 +101,7 @@ namespace SteamTool.Core.Properties {
|
||||
/// <summary>
|
||||
/// 查找类似 读取Hosts成功 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string Hosts_ReadSuccess {
|
||||
public static string Hosts_ReadSuccess {
|
||||
get {
|
||||
return ResourceManager.GetString("Hosts_ReadSuccess", resourceCulture);
|
||||
}
|
||||
@@ -110,7 +110,7 @@ namespace SteamTool.Core.Properties {
|
||||
/// <summary>
|
||||
/// 查找类似 写入Hosts成功 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string Hosts_UpdateSuccess {
|
||||
public static string Hosts_UpdateSuccess {
|
||||
get {
|
||||
return ResourceManager.GetString("Hosts_UpdateSuccess", resourceCulture);
|
||||
}
|
||||
@@ -119,7 +119,7 @@ namespace SteamTool.Core.Properties {
|
||||
/// <summary>
|
||||
/// 查找类似 写入Hosts时发生错误 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string Hosts_WirteError {
|
||||
public static string Hosts_WirteError {
|
||||
get {
|
||||
return ResourceManager.GetString("Hosts_WirteError", resourceCulture);
|
||||
}
|
||||
@@ -141,10 +141,24 @@ namespace SteamTool.Core.Properties {
|
||||
/// <param name="File" value="log\\" />
|
||||
/// <param name="AppendToFile" value="true" [字符串的其余部分被截断]"; 的本地化字符串。
|
||||
/// </summary>
|
||||
internal static string Log4netXml {
|
||||
public static string Log4netXml {
|
||||
get {
|
||||
return ResourceManager.GetString("Log4netXml", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 echo "Steam++替换升级中..."
|
||||
///taskkill /f /im {0}
|
||||
///xcopy /y /c /h /r /s "{1}\*.*" "{2}"
|
||||
///rmdir /s /q {1}
|
||||
///{3}
|
||||
///del %0 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string ProgramUpdateCmd {
|
||||
get {
|
||||
return ResourceManager.GetString("ProgramUpdateCmd", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,12 +175,17 @@
|
||||
<param name="RollingStyle" value="Date" />
|
||||
<layout type="log4net.Layout.PatternLayout,log4net">
|
||||
<param name="ConversionPattern" value="%d %-5p >> %m%n" />
|
||||
<!--输出头部并换行-->
|
||||
<!--<param name="Header" value="&#13;&#10;———————————————————&#13;&#10;" />
|
||||
<param name="Footer" value="&#13;&#10;———————————————————&#13;&#10;" />-->
|
||||
</layout>
|
||||
</appender>
|
||||
</log4net>
|
||||
</configuration></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,6 +12,7 @@
|
||||
<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="SharpZipLib" Version="1.3.1" />
|
||||
<PackageReference Include="System.Management" Version="5.0.0" />
|
||||
<PackageReference Include="TaskScheduler" Version="2.9.0" />
|
||||
</ItemGroup>
|
||||
@@ -30,7 +31,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
@@ -5,6 +5,7 @@ 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";
|
||||
@@ -21,6 +22,7 @@ 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}";
|
||||
|
||||
@@ -51,6 +51,11 @@ namespace SteamTool.Model
|
||||
/// </summary>
|
||||
public string SteamID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 昵称
|
||||
/// </summary>
|
||||
public string SteamNickName => string.IsNullOrEmpty(SteamID) ? "无法获取此账户昵称" : SteamID;
|
||||
|
||||
/// <summary>
|
||||
/// 用户名
|
||||
/// </summary>
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace SteamTool.Proxy
|
||||
*/
|
||||
#endregion
|
||||
Debug.WriteLine("OnRequest " + e.HttpClient.Request.RequestUri.AbsoluteUri);
|
||||
Debug.WriteLine("OnRequest Authority " + e.HttpClient.Request.RequestUri.Authority);
|
||||
Debug.WriteLine("OnRequest HTTP " + e.HttpClient.Request.HttpVersion);
|
||||
Logger.Info("OnRequest" + e.HttpClient.Request.RequestUri.AbsoluteUri);
|
||||
#endif
|
||||
await Dns.GetHostAddressesAsync(e.HttpClient.Request.Host).ContinueWith(s =>
|
||||
|
||||
@@ -70,6 +70,8 @@ namespace SteamTool.Proxy
|
||||
SteamChat = 3,
|
||||
[Description("Discord语音")]
|
||||
Discord = 4,
|
||||
[Description("Discord更新下载")]
|
||||
DiscordNet = 11,
|
||||
[Description("Twitch直播")]
|
||||
Twitch = 5,
|
||||
[Description("Origin下载加速(Akamai)")]
|
||||
|
||||
@@ -69,6 +69,15 @@ namespace SteamTool.Proxy.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Discord更新下载 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string DiscordNet {
|
||||
get {
|
||||
return ResourceManager.GetString("DiscordNet", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Github图片资源修复 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -120,6 +120,9 @@
|
||||
<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>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:s="clr-namespace:System;assembly=mscorlib"
|
||||
ShutdownMode="OnExplicitShutdown"
|
||||
xmlns:converters="http://schemes.grabacr.net/winfx/2015/personal/converters">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
|
||||
+32
-11
@@ -21,6 +21,8 @@ using Hardcodet.Wpf.TaskbarNotification;
|
||||
using SteamTools.Models;
|
||||
using SteamTools.Models.Settings;
|
||||
using SteamTools.ViewModels;
|
||||
using SteamTool.Core;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace SteamTools
|
||||
{
|
||||
@@ -31,22 +33,37 @@ namespace SteamTools
|
||||
{
|
||||
public static App Instance => Current as App;
|
||||
|
||||
public string ProgramName => Path.GetFileName(Environment.GetCommandLineArgs()[0]);
|
||||
|
||||
public DirectoryInfo LocalAppData = new DirectoryInfo(
|
||||
Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
|
||||
ProductInfo.Company,
|
||||
ProductInfo.Product));
|
||||
ProductInfo.Title));
|
||||
|
||||
private void IsRenameProgram()
|
||||
{
|
||||
string strFullPath = Path.GetFileName(Environment.GetCommandLineArgs()[0]);
|
||||
if ($"{ProductInfo.Title}.exe" != strFullPath)
|
||||
if ($"{ProductInfo.Title}.exe" != ProgramName)
|
||||
{
|
||||
//MessageBox.Show(SteamTools.Properties.Resources.ReNameErrorInfo, "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
this.Shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置WebBrowser IE版本
|
||||
/// </summary>
|
||||
private void SetWebBrowserIeVersion()
|
||||
{
|
||||
try
|
||||
{
|
||||
SteamToolCore.Instance.Get<RegistryKeyService>().AddOrUpdateRegistryKey(Registry.CurrentUser, @"Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", ProgramName, "11001", RegistryValueKind.DWord);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error("Program -> Main -> Registry and environment modifications resulted in an exception.", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 启动时
|
||||
@@ -68,15 +85,12 @@ namespace SteamTools
|
||||
}
|
||||
Logger.EnableTextLog = true;
|
||||
#endif
|
||||
App.Current.ShutdownMode = ShutdownMode.OnExplicitShutdown;
|
||||
this.DispatcherUnhandledException += App_DispatcherUnhandledException;
|
||||
DispatcherHelper.UIDispatcher = this.Dispatcher;
|
||||
if (e.Args.ContainsArg("-log"))
|
||||
{
|
||||
Logger.EnableTextLog = true;
|
||||
}
|
||||
if (e.Args.ContainsArg("-safe"))
|
||||
{
|
||||
|
||||
}
|
||||
SettingsHost.Load();
|
||||
this.compositeDisposable.Add(SettingsHost.Save);
|
||||
@@ -87,11 +101,18 @@ namespace SteamTools
|
||||
WindowService.Current.AddTo(this).Initialize();
|
||||
ProxyService.Current.Initialize();
|
||||
SteamConnectService.Current.Initialize();
|
||||
AuthService.Current.Initialize();
|
||||
if (GeneralSettings.IsAutoCheckUpdate)
|
||||
{
|
||||
AutoUpdateService.Current.CheckUpdate();
|
||||
}
|
||||
|
||||
//托盘加载
|
||||
TaskbarService.Current.Taskbar = (TaskbarIcon)FindResource("Taskbar");
|
||||
ThemeService.Current.Register(this, Theme.Windows, Accent.Windows);
|
||||
|
||||
SetWebBrowserIeVersion();
|
||||
|
||||
this.MainWindow = WindowService.Current.GetMainWindow();
|
||||
if (e.Args.ContainsArg("-minimized") || GeneralSettings.IsStartupAppMinimized.Value)
|
||||
{
|
||||
@@ -129,13 +150,12 @@ namespace SteamTools
|
||||
try
|
||||
{
|
||||
Logger.Error($"{Assembly.GetExecutingAssembly().GetName().Name} Run Error : {Environment.NewLine}", e.Exception);
|
||||
MessageBox.Show(e.Exception.ToString(), "Error");
|
||||
//WindowService.Current.ShowDialogWindow(e.Exception.Message, "Error");
|
||||
MessageBox.Show(e.Exception.ToString(), $"{ProductInfo.Title} {ProductInfo.VersionString} Error");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.WriteLine(ex);
|
||||
MessageBox.Show(ex.Message, "Error");
|
||||
MessageBox.Show(ex.Message, $"{ProductInfo.Title} {ProductInfo.VersionString} Error");
|
||||
}
|
||||
|
||||
Current.Shutdown();
|
||||
@@ -152,8 +172,8 @@ namespace SteamTools
|
||||
//TaskbarService.Current.Taskbar.Icon = null; //避免托盘图标没有自动消失
|
||||
TaskbarService.Current.Taskbar.Icon.Dispose();
|
||||
}
|
||||
base.OnExit(e);
|
||||
this.compositeDisposable.Dispose();
|
||||
base.OnExit(e);
|
||||
}
|
||||
|
||||
private void ProcessCommandLineParameter(string[] args)
|
||||
@@ -172,6 +192,7 @@ namespace SteamTools
|
||||
}
|
||||
if (args.ContainsArg("-app", out int appid))
|
||||
{
|
||||
App.Current.ShutdownMode = ShutdownMode.OnMainWindowClose;
|
||||
ThemeService.Current.Register(this, Theme.Windows, Accent.Windows);
|
||||
new SettingsPageViewModel();
|
||||
WindowService.Current.AddTo(this).Initialize(appid);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using MetroTrilithon.Serialization;
|
||||
using SteamTool.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
@@ -9,16 +11,37 @@ namespace SteamTools.Models.Settings
|
||||
{
|
||||
public static class AuthSettings
|
||||
{
|
||||
static AuthSettings()
|
||||
{
|
||||
Authenticators.ValueChanged += Authenticators_ValueChanged;
|
||||
}
|
||||
|
||||
private static void Authenticators_ValueChanged(object sender, ValueChangedEventArgs<string> e)
|
||||
{
|
||||
if (e.NewValue != e.OldValue)
|
||||
{
|
||||
if (AuthSettings.IsCurrentDirectorySaveAuthData.Value)
|
||||
{
|
||||
File.WriteAllText(Path.Combine(AppContext.BaseDirectory, Const.AUTHDATA_FILE), e.NewValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 令牌数据(压缩存储)
|
||||
/// </summary>
|
||||
public static SerializableProperty<string> Authenticators { get; }
|
||||
= new SerializableProperty<string>(GetKey(), Providers.Local) { AutoSave = true };
|
||||
|
||||
/// <summary>
|
||||
/// 是否将令牌数据存储在程序路径下
|
||||
/// </summary>
|
||||
public static SerializableProperty<bool> IsCurrentDirectorySaveAuthData { get; }
|
||||
= new SerializableProperty<bool>(GetKey(), Providers.Roaming, false) { AutoSave = true };
|
||||
|
||||
private static string GetKey([CallerMemberName] string propertyName = "")
|
||||
{
|
||||
return nameof(GeneralSettings) + "." + propertyName;
|
||||
return nameof(AuthSettings) + "." + propertyName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace SteamTools.Models.Settings
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
|
||||
ProductInfo.Company, ProductInfo.Title, Const.SETTINGS_FILE);
|
||||
|
||||
public static string LocalFilePath { get; } = Path.Combine(App.Instance.LocalAppData.FullName, Const.SETTINGS_FILE);
|
||||
public static string LocalFilePath => Path.Combine(App.Instance.LocalAppData.FullName, Const.SETTINGS_FILE);
|
||||
|
||||
public static ISerializationProvider Roaming { get; } = new FileSettingsProvider(RoamingFilePath);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace SteamTools.Models.Settings
|
||||
|
||||
private static string GetKey([CallerMemberName] string propertyName = "")
|
||||
{
|
||||
return nameof(GeneralSettings) + "." + propertyName;
|
||||
return nameof(ProxySettings) + "." + propertyName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace SteamTools.Models.Settings
|
||||
|
||||
private static string GetKey([CallerMemberName] string propertyName = "")
|
||||
{
|
||||
return nameof(GeneralSettings) + "." + propertyName;
|
||||
return nameof(UISettings) + "." + propertyName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,7 +340,8 @@ namespace SteamTools.Models
|
||||
break;
|
||||
|
||||
case "autorefresh":
|
||||
_autoRefresh = reader.ReadElementContentAsBoolean();
|
||||
//_autoRefresh = reader.ReadElementContentAsBoolean();
|
||||
_autoRefresh = false;
|
||||
break;
|
||||
|
||||
case "allowcopy":
|
||||
@@ -446,9 +447,9 @@ namespace SteamTools.Models
|
||||
writer.WriteValue(Convert.ToInt64((this.Created.ToUniversalTime() - new DateTime(1970, 1, 1)).TotalMilliseconds));
|
||||
writer.WriteEndElement();
|
||||
|
||||
writer.WriteStartElement("autorefresh");
|
||||
writer.WriteValue(this.AutoRefresh);
|
||||
writer.WriteEndElement();
|
||||
//writer.WriteStartElement("autorefresh");
|
||||
//writer.WriteValue(this.AutoRefresh);
|
||||
//writer.WriteEndElement();
|
||||
//
|
||||
writer.WriteStartElement("allowcopy");
|
||||
writer.WriteValue(this.AllowCopy);
|
||||
|
||||
+29
-2
@@ -195,6 +195,15 @@ namespace SteamTools.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 导出令牌 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string Auth_Export {
|
||||
get {
|
||||
return ResourceManager.GetString("Auth_Export", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 导入令牌 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -231,6 +240,15 @@ namespace SteamTools.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 交易确认 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string Auth_Trade {
|
||||
get {
|
||||
return ResourceManager.GetString("Auth_Trade", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 交易确认 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -448,7 +466,7 @@ namespace SteamTools.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 游戏列表 的本地化字符串。
|
||||
/// 查找类似 库存游戏 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string GameList {
|
||||
get {
|
||||
@@ -1086,6 +1104,15 @@ namespace SteamTools.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 检测到新版本 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string UpdateTips {
|
||||
get {
|
||||
return ResourceManager.GetString("UpdateTips", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 Uplay 的本地化字符串。
|
||||
/// </summary>
|
||||
@@ -1105,7 +1132,7 @@ namespace SteamTools.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 帐户切换 的本地化字符串。
|
||||
/// 查找类似 账号切换 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string UserFastChange {
|
||||
get {
|
||||
|
||||
@@ -162,6 +162,9 @@
|
||||
<data name="Auth_Edit" xml:space="preserve">
|
||||
<value>令牌编辑</value>
|
||||
</data>
|
||||
<data name="Auth_Export" xml:space="preserve">
|
||||
<value>导出令牌</value>
|
||||
</data>
|
||||
<data name="Auth_Import" xml:space="preserve">
|
||||
<value>导入令牌</value>
|
||||
</data>
|
||||
@@ -174,6 +177,9 @@
|
||||
<data name="Auth_See" xml:space="preserve">
|
||||
<value>查看令牌</value>
|
||||
</data>
|
||||
<data name="Auth_Trade" xml:space="preserve">
|
||||
<value>交易确认</value>
|
||||
</data>
|
||||
<data name="Auth_TradeTitle" xml:space="preserve">
|
||||
<value>交易确认</value>
|
||||
</data>
|
||||
@@ -238,7 +244,7 @@
|
||||
<value>游戏</value>
|
||||
</data>
|
||||
<data name="GameList" xml:space="preserve">
|
||||
<value>游戏列表</value>
|
||||
<value>库存游戏</value>
|
||||
</data>
|
||||
<data name="GameName" xml:space="preserve">
|
||||
<value>游戏名称</value>
|
||||
@@ -459,6 +465,9 @@
|
||||
<data name="Unsupported_Operation" xml:space="preserve">
|
||||
<value>不支持的操作</value>
|
||||
</data>
|
||||
<data name="UpdateTips" xml:space="preserve">
|
||||
<value>检测到新版本</value>
|
||||
</data>
|
||||
<data name="Uplay" xml:space="preserve">
|
||||
<value>Uplay</value>
|
||||
</data>
|
||||
@@ -466,7 +475,7 @@
|
||||
<value>重启Steam并以该账号登录</value>
|
||||
</data>
|
||||
<data name="UserFastChange" xml:space="preserve">
|
||||
<value>帐户切换</value>
|
||||
<value>账号切换</value>
|
||||
</data>
|
||||
<data name="VACFIX_BAT" xml:space="preserve">
|
||||
<value>@echo off
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 735 B |
Binary file not shown.
|
After Width: | Height: | Size: 630 B |
Binary file not shown.
|
Before Width: | Height: | Size: 510 B After Width: | Height: | Size: 584 B |
@@ -15,6 +15,8 @@ using SteamTools.Models.Settings;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Linq;
|
||||
using MetroTrilithon.Mvvm;
|
||||
using SteamTool.Model;
|
||||
|
||||
namespace SteamTools.Services
|
||||
{
|
||||
@@ -45,7 +47,13 @@ namespace SteamTools.Services
|
||||
|
||||
#endregion
|
||||
|
||||
private BindingList<WinAuthAuthenticator> _Authenticators;
|
||||
//public AuthService()
|
||||
//{
|
||||
// AuthService.Current.Subscribe(nameof(AuthService.Current.Authenticators),
|
||||
// () => { AuthSettings.Authenticators.Value = ConvertJsonAuthenticator(AuthService.Current.Authenticators); });
|
||||
//}
|
||||
|
||||
private BindingList<WinAuthAuthenticator> _Authenticators = new BindingList<WinAuthAuthenticator>();
|
||||
|
||||
public BindingList<WinAuthAuthenticator> Authenticators
|
||||
{
|
||||
@@ -62,21 +70,58 @@ namespace SteamTools.Services
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(AuthSettings.Authenticators.Value))
|
||||
try
|
||||
{
|
||||
try
|
||||
var path = Path.Combine(AppContext.BaseDirectory, Const.AUTHDATA_FILE);
|
||||
if (AuthSettings.IsCurrentDirectorySaveAuthData.Value && File.Exists(path))
|
||||
{
|
||||
var text = File.ReadAllText(path);
|
||||
var auths = AuthService.LoadJsonAuthenticator(text.DecompressString());
|
||||
Authenticators = new BindingList<WinAuthAuthenticator>(auths);
|
||||
if (string.IsNullOrEmpty(AuthSettings.Authenticators.Value))
|
||||
{
|
||||
AuthSettings.Authenticators.Value = text;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var auths = AuthService.LoadJsonAuthenticator(AuthSettings.Authenticators.Value.DecompressString());
|
||||
Authenticators = new BindingList<WinAuthAuthenticator>(auths);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
WindowService.Current.MainWindow.Dialog($"令牌同步服务器失败,错误信息:{ex.Message}");
|
||||
if (AuthSettings.IsCurrentDirectorySaveAuthData.Value)
|
||||
{
|
||||
File.WriteAllText(path, AuthSettings.Authenticators.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
catch (Exception ex)
|
||||
{
|
||||
Authenticators = new BindingList<WinAuthAuthenticator>();
|
||||
Logger.Error(ex);
|
||||
WindowService.Current.ShowDialogWindow($"令牌同步服务器失败,错误信息:{ex}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导入Steam++导出的令牌数据文件
|
||||
/// </summary>
|
||||
public void ImportAuthenticatorsString(string str)
|
||||
{
|
||||
var auths = AuthService.LoadJsonAuthenticator(str);
|
||||
foreach (var auth in auths)
|
||||
{
|
||||
Authenticators.Add(auth);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导入Steam++导出的令牌数据文件
|
||||
/// </summary>
|
||||
public void ImportAuthenticators(string file)
|
||||
{
|
||||
var text = File.ReadAllText(file, Encoding.UTF8);
|
||||
var auths = AuthService.LoadJsonAuthenticator(text.DecompressString());
|
||||
foreach (var auth in auths)
|
||||
{
|
||||
Authenticators.Add(auth);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +131,7 @@ namespace SteamTools.Services
|
||||
/// <param name="parent">parent Form</param>
|
||||
/// <param name="file">file name to import</param>
|
||||
/// <returns>list of imported authenticators</returns>
|
||||
public void ImportAuthenticators(string file)
|
||||
public void ImportWinAuthenticators(string file)
|
||||
{
|
||||
StringBuilder lines = new StringBuilder();
|
||||
bool retry;
|
||||
@@ -516,35 +561,43 @@ namespace SteamTools.Services
|
||||
public static IList<WinAuthAuthenticator> LoadJsonAuthenticator(string authString)
|
||||
{
|
||||
var list = new List<WinAuthAuthenticator>();
|
||||
XmlReader reader = XmlReader.Create(new StringReader(authString));
|
||||
reader.Read();
|
||||
while (reader.EOF == false && reader.IsEmptyElement == true)
|
||||
if (!string.IsNullOrEmpty(authString))
|
||||
{
|
||||
XmlReader reader = XmlReader.Create(new StringReader(authString));
|
||||
reader.Read();
|
||||
}
|
||||
reader.MoveToContent();
|
||||
while (reader.EOF == false)
|
||||
{
|
||||
if (reader.IsStartElement())
|
||||
{
|
||||
if (reader.Name == "Auth")
|
||||
{
|
||||
reader.Read();
|
||||
}
|
||||
if (reader.Name == "WinAuthAuthenticator")
|
||||
{
|
||||
var wa = new WinAuthAuthenticator();
|
||||
wa.ReadXml(reader, null);
|
||||
list.Add(wa);
|
||||
}
|
||||
}
|
||||
else
|
||||
while (reader.EOF == false && reader.IsEmptyElement == true)
|
||||
{
|
||||
reader.Read();
|
||||
break;
|
||||
}
|
||||
reader.MoveToContent();
|
||||
while (reader.EOF == false)
|
||||
{
|
||||
if (reader.IsStartElement())
|
||||
{
|
||||
if (reader.Name == "Auth")
|
||||
{
|
||||
reader.Read();
|
||||
}
|
||||
if (reader.Name == "WinAuthAuthenticator")
|
||||
{
|
||||
var wa = new WinAuthAuthenticator() { AutoRefresh = false };
|
||||
wa.ReadXml(reader, null);
|
||||
list.Add(wa);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
reader.Read();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public void SaveCurrentAuth()
|
||||
{
|
||||
AuthSettings.Authenticators.Value = ConvertJsonAuthenticator(Authenticators).CompressString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ using System.Net;
|
||||
using System.IO;
|
||||
using Livet;
|
||||
using SteamTools.Properties;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace SteamTools.Services
|
||||
{
|
||||
@@ -62,44 +63,62 @@ namespace SteamTools.Services
|
||||
{
|
||||
StatusService.Current.Notify("正在从Github检查更新...");
|
||||
var result = await httpServices.Get(Const.GITHUB_LATEST_RELEASEAPI_URL);
|
||||
var model = JsonConvert.DeserializeObject<GithubReleaseModel>(result);
|
||||
if (!(ProductInfo.Version < model.version))
|
||||
UpdateInfo = JsonConvert.DeserializeObject<GithubReleaseModel>(result);
|
||||
|
||||
// if (!(ProductInfo.Version > UpdateInfo.version)) Debug时反向检查更新来测试
|
||||
if (!(ProductInfo.Version < UpdateInfo.version))
|
||||
{
|
||||
IsExistUpdate = false;
|
||||
StatusService.Current.Notify("当前已是最新版本");
|
||||
return;
|
||||
}
|
||||
IsExistUpdate = true;
|
||||
DownloadUpdate(model);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error("更新出错:", ex);
|
||||
WindowService.Current.ShowDialogWindow($"更新出错:{ex.Message}");
|
||||
StatusService.Current.Notify($"更新出错:{ex.Message}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public async void DownloadUpdate(GithubReleaseModel model)
|
||||
private GithubReleaseModel _UpdateInfo;
|
||||
public GithubReleaseModel UpdateInfo
|
||||
{
|
||||
if (WindowService.Current.MainWindow.Dialog($"检测到新版本更新内容:{model.body}\r\n是否立即更新?", $"{ProductInfo.Title} | 更新提示") == true)
|
||||
get => this._UpdateInfo;
|
||||
set
|
||||
{
|
||||
//var name = model.assets.FirstOrDefault()?.name;
|
||||
var name = Path.Combine(AppContext.BaseDirectory, @$"{ProductInfo.Title} {model.version}.zip");
|
||||
if (this._UpdateInfo != value)
|
||||
{
|
||||
this._UpdateInfo = value;
|
||||
this.RaisePropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async void DownloadUpdate()
|
||||
{
|
||||
if (WindowService.Current.MainWindow.Dialog($"检测到新版本更新内容:{UpdateInfo.body}\r\n是否立即更新?", $"{ProductInfo.Title} | 更新提示") == true)
|
||||
{
|
||||
var name = Path.Combine(AppContext.BaseDirectory, UpdateInfo.assets.FirstOrDefault()?.name);
|
||||
//var name = Path.Combine(AppContext.BaseDirectory, @$"{ProductInfo.Title} {UpdateInfo.version}.zip");
|
||||
if (File.Exists(name))
|
||||
{
|
||||
StatusService.Current.Notify("更新文件已经存在,不需要下载");
|
||||
if (Path.GetExtension(name) == ".zip")
|
||||
{
|
||||
OverwriteUpgrade(name);
|
||||
}
|
||||
return;
|
||||
}
|
||||
var fileReq = WebRequest.Create(model.assets.FirstOrDefault()?.browser_download_url);
|
||||
var fileReq = WebRequest.Create(UpdateInfo.assets.FirstOrDefault()?.browser_download_url);
|
||||
await fileReq?.GetResponseAsync().ContinueWith(s =>
|
||||
{
|
||||
long totalBytes = s.Result.ContentLength;
|
||||
using Stream responseStream = s.Result.GetResponseStream();
|
||||
using FileStream fileStream = new FileStream(name, FileMode.Create, FileAccess.Write);
|
||||
long totalDownloadBytes = 0;
|
||||
byte[] bs = new byte[4096];
|
||||
byte[] bs = new byte[1024];
|
||||
int size = responseStream.Read(bs, 0, bs.Length);
|
||||
while (size > 0)
|
||||
{
|
||||
@@ -112,9 +131,40 @@ namespace SteamTools.Services
|
||||
fileStream.Flush();
|
||||
fileStream.Close();
|
||||
StatusService.Current.Set(Resources.Ready);
|
||||
StatusService.Current.Notify($"{ProductInfo.Title} {model.version}版本已经下载到程序根目录下,暂时请手动替换更新");
|
||||
if (Path.GetExtension(name) == ".zip")
|
||||
{
|
||||
OverwriteUpgrade(name);
|
||||
}
|
||||
StatusService.Current.Notify($"{ProductInfo.Title} {UpdateInfo.version}版本已经下载到程序根目录下,请手动替换更新");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void OverwriteUpgrade(string zipFile)
|
||||
{
|
||||
App.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
if (WindowService.Current.MainWindow.Dialog($"新版本下载完成,是否自动重启替换到新版本?", $"{ProductInfo.Title} | 更新提示") == true)
|
||||
{
|
||||
var out_dir = Path.Combine(AppContext.BaseDirectory, Path.GetFileNameWithoutExtension(zipFile));
|
||||
if (ZipHelper.UnpackFiles(zipFile, out_dir))
|
||||
{
|
||||
File.Delete(zipFile);
|
||||
var batpath = Path.Combine(App.Instance.LocalAppData.FullName, "update.cmd");
|
||||
File.WriteAllText(batpath,
|
||||
string.Format(SteamTool.Core.Properties.Resources.ProgramUpdateCmd,
|
||||
ProductInfo.Title + ".exe", out_dir, AppContext.BaseDirectory, App.Instance.ProgramName), Encoding.Default);
|
||||
Process p = new Process();
|
||||
p.StartInfo.FileName = batpath;//要执行的程序名称
|
||||
p.StartInfo.UseShellExecute = false;
|
||||
p.StartInfo.CreateNoWindow = true;//不显示程序窗口
|
||||
//管理员权限运行
|
||||
p.StartInfo.Verb = "runas";
|
||||
App.Current.Shutdown();
|
||||
p.Start();//启动程序
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ Index=0,
|
||||
Name=Resources.SteamCommunity,
|
||||
Domains = new List<string>{"steamcommunity.com" },
|
||||
ToDomain = "steamcommunity-a.akamaihd.net",
|
||||
//ToDomain = "steampowered.com",
|
||||
Hosts = new List<string>{ "steamcommunity.com", "www.steamcommunity.com"},
|
||||
DomainTag = DomainTag.SteamCommunity,
|
||||
IsEnable= true,
|
||||
@@ -58,7 +59,8 @@ new ProxyDomainModel{
|
||||
Index=1,
|
||||
Name=Resources.SteamStore,
|
||||
Domains = new List<string>{"steampowered.com" },
|
||||
ToDomain = "steamstore-a.akamaihd.net",
|
||||
//ToDomain = "steamstore-a.akamaihd.net",
|
||||
ToDomain = "media.steampowered.com",
|
||||
Hosts = new List<string>{ "store.steampowered.com", "api.steampowered.com"},
|
||||
DomainTag = DomainTag.SteamStore,
|
||||
IsEnable= false,
|
||||
@@ -68,7 +70,7 @@ Index=2,
|
||||
Name=Resources.SteamImage,
|
||||
Domains = new List<string>{"steamcdn-a.akamaihd.net" },
|
||||
ToDomain = "cdn.akamai.steamstatic.com",
|
||||
//ProxyIPAddres = "184.50.87.34",
|
||||
//ToDomain = "media.steampowered.com",
|
||||
Hosts = new List<string>{ "steamcdn-a.akamaihd.net"},
|
||||
DomainTag = DomainTag.SteamImage,
|
||||
IsEnable= false,
|
||||
@@ -77,7 +79,8 @@ new ProxyDomainModel{
|
||||
Index=3,
|
||||
Name=Resources.SteamChat,
|
||||
Domains = new List<string>{"steam-chat.com" },
|
||||
ToDomain = "steamstore-a.akamaihd.net",
|
||||
//ToDomain = "steamstore-a.akamaihd.net",
|
||||
ToDomain = "media.steampowered.com",
|
||||
Hosts = new List<string>{ "steam-chat.com"},
|
||||
DomainTag = DomainTag.SteamChat,
|
||||
IsEnable= false,
|
||||
@@ -85,15 +88,11 @@ IsEnable= false,
|
||||
new ProxyDomainModel{
|
||||
Index=4,
|
||||
Name=Resources.Discord,
|
||||
Domains = new List<string>{ "discordapp.com","discordapp.net" },
|
||||
Domains = new List<string>{ "discordapp.com"},
|
||||
//ToDomain = "discord.com",
|
||||
ProxyIPAddres="162.159.133.232",
|
||||
ProxyIPAddres="162.159.129.233",
|
||||
Hosts = new List<string>{
|
||||
"discordapp.com",
|
||||
"dl.discordapp.net",
|
||||
"media.discordapp.net",
|
||||
"images-ext-2.discordapp.net",
|
||||
"images-ext-1.discordapp.net",
|
||||
"support.discordapp.com",
|
||||
"url9177.discordapp.com",
|
||||
"canary-api.discordapp.com",
|
||||
@@ -117,6 +116,20 @@ DomainTag = DomainTag.Discord,
|
||||
IsEnable= false,
|
||||
},
|
||||
new ProxyDomainModel{
|
||||
Index=11,
|
||||
Name=Resources.DiscordNet,
|
||||
Domains = new List<string>{ "discordapp.net" },
|
||||
ProxyIPAddres="162.159.130.232",
|
||||
Hosts = new List<string>{
|
||||
"dl.discordapp.net",
|
||||
"media.discordapp.net",
|
||||
"images-ext-2.discordapp.net",
|
||||
"images-ext-1.discordapp.net",
|
||||
},
|
||||
DomainTag = DomainTag.DiscordNet,
|
||||
IsEnable= false,
|
||||
},
|
||||
new ProxyDomainModel{
|
||||
Index=5,
|
||||
Name=Resources.Twitch,
|
||||
Domains = new List<string>{ "twitch.tv" ,"usher.ttvnw.net"},
|
||||
@@ -337,7 +350,8 @@ IsEnable= false,
|
||||
}
|
||||
else
|
||||
{
|
||||
WindowService.Current.ShowDialogWindow("启动加速服务失败,请检查443端口是否被占用或者证书安装失败。");
|
||||
//WindowService.Current.ShowDialogWindow("启动加速服务失败,请检查443端口是否被占用或者证书安装失败。");
|
||||
StatusService.Current.Notify("启动加速服务失败,请检查443端口是否被占用或者证书安装失败。");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace SteamTools.Services
|
||||
{
|
||||
//该64位id的steamID3等于0,是steam未获取到当前登录用户的默认返回值,所以直接重新获取,
|
||||
//希望这位用户不会用steam++,嗯...
|
||||
ApiService.SteamClient.Dispose();
|
||||
SteamConnectService.Current.DisposeSteamClient();
|
||||
continue;
|
||||
}
|
||||
IsConnectToSteam = true;
|
||||
|
||||
@@ -40,7 +40,9 @@
|
||||
|
||||
<PackageId />
|
||||
|
||||
<Version>1.0.3</Version>
|
||||
<Version>1.0.4</Version>
|
||||
|
||||
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net472|AnyCPU'">
|
||||
@@ -98,6 +100,7 @@
|
||||
<None Remove="Resources\Asstes\delete.png" />
|
||||
<None Remove="Resources\Asstes\detail.png" />
|
||||
<None Remove="Resources\Asstes\edit.png" />
|
||||
<None Remove="Resources\Asstes\export.png" />
|
||||
<None Remove="Resources\Asstes\install-line.png" />
|
||||
<None Remove="Resources\Asstes\movecross.png" />
|
||||
<None Remove="Resources\Asstes\ok.png" />
|
||||
@@ -106,6 +109,7 @@
|
||||
<None Remove="Resources\Asstes\restore.png" />
|
||||
<None Remove="Resources\Asstes\save.png" />
|
||||
<None Remove="Resources\Asstes\seek.png" />
|
||||
<None Remove="Resources\Asstes\trade.png" />
|
||||
<None Remove="Resources\Asstes\unlock.png" />
|
||||
<None Remove="Resources\Asstes\wechatdonate.png" />
|
||||
</ItemGroup>
|
||||
@@ -130,6 +134,7 @@
|
||||
<Resource Include="Resources\Asstes\delete.png" />
|
||||
<Resource Include="Resources\Asstes\detail.png" />
|
||||
<Resource Include="Resources\Asstes\edit.png" />
|
||||
<Resource Include="Resources\Asstes\export.png" />
|
||||
<Resource Include="Resources\Asstes\install-line.png" />
|
||||
<Resource Include="Resources\Asstes\movecross.png" />
|
||||
<Resource Include="Resources\Asstes\ok.png" />
|
||||
@@ -138,6 +143,7 @@
|
||||
<Resource Include="Resources\Asstes\restore.png" />
|
||||
<Resource Include="Resources\Asstes\save.png" />
|
||||
<Resource Include="Resources\Asstes\seek.png" />
|
||||
<Resource Include="Resources\Asstes\trade.png" />
|
||||
<Resource Include="Resources\Asstes\unlock.png" />
|
||||
<Resource Include="Resources\Asstes\wechatdonate.png" />
|
||||
</ItemGroup>
|
||||
@@ -257,6 +263,10 @@
|
||||
<Page Update="Views\Content\CommonGame\GameCSGO.xaml">
|
||||
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
|
||||
</Page>
|
||||
<Page Update="Views\Content\Settings\SettingsAuth.xaml">
|
||||
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Views\Content\Settings\SettingsGeneral.xaml">
|
||||
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -283,6 +293,9 @@
|
||||
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Views\Pages\SteamIdleCardPage.xaml">
|
||||
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
|
||||
</Page>
|
||||
<Page Update="Views\Pages\SteamAppPage.xaml">
|
||||
<XamlRuntime>$(DefaultXamlRuntime)</XamlRuntime>
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
@@ -55,6 +55,7 @@ namespace SteamTools.ViewModels
|
||||
p.StartInfo.CreateNoWindow = true;//不显示程序窗口
|
||||
p.Start();//启动程序
|
||||
p.StandardInput.AutoFlush = true;
|
||||
//管理员权限运行
|
||||
p.StartInfo.Verb = "runas";
|
||||
//向CMD窗口发送输入信息:
|
||||
//p.StandardInput.WriteLine(@Resources.VACFIX_BAT);
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using System.Windows;
|
||||
using SteamTools.Win32;
|
||||
using MetroRadiance.Interop.Win32;
|
||||
using System.Diagnostics;
|
||||
using SteamTool.Core.Common;
|
||||
using System.Runtime.InteropServices;
|
||||
using SteamTools.Services;
|
||||
using SteamTool.Steam.Service.Web;
|
||||
using SteamTool.Core;
|
||||
using SteamTool.Steam.Service;
|
||||
using SteamTool.Model;
|
||||
using Newtonsoft.Json;
|
||||
using SteamTools.Models.Settings;
|
||||
using System.IO;
|
||||
using SteamTools.Models;
|
||||
|
||||
namespace SteamTools.ViewModels
|
||||
{
|
||||
public class SettingsAuthViewModel : Livet.ViewModel
|
||||
{
|
||||
public void ImportOldVersionAuthData()
|
||||
{
|
||||
var settingPath = Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
|
||||
ProductInfo.Company,
|
||||
ProductInfo.Product, Const.SETTINGS_FILE);
|
||||
|
||||
if (File.Exists(settingPath))
|
||||
{
|
||||
var text = File.ReadAllText(settingPath);
|
||||
var data = text.Substring("<x:String x:Key=\"GeneralSettings.Authenticators\">", "</x:String>", false);
|
||||
try
|
||||
{
|
||||
AuthService.Current.ImportAuthenticatorsString(data.DecompressString());
|
||||
AuthService.Current.SaveCurrentAuth();
|
||||
if (WindowService.Current.MainWindow.Dialog("导入旧版本令牌数据完成,\r\n是否删除Steam++旧版本数据文件?") == true)
|
||||
{
|
||||
File.Delete(settingPath);
|
||||
StatusService.Current.Notify("旧版本数据文件删除完成");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
WindowService.Current.MainWindow.Dialog("导入旧版本令牌数据出错:" + ex.Message);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
StatusService.Current.Notify("旧版本令牌数据不存在");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,6 +45,5 @@ namespace SteamTools.ViewModels
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,9 +46,6 @@ namespace SteamTools.ViewModels
|
||||
CanExecuteFunc = () => true,
|
||||
CommandAction = () =>
|
||||
{
|
||||
App.Current.MainWindow = WindowService.Current.GetMainWindow();
|
||||
//if (!App.Current.MainWindow.IsVisible)
|
||||
// App.Current.MainWindow.Show();
|
||||
var mainWindow = (WindowService.Current.MainWindow as MainWindowViewModel);
|
||||
mainWindow.IsVisible = true;
|
||||
}
|
||||
|
||||
@@ -125,22 +125,19 @@ namespace SteamTools.ViewModels
|
||||
if (!this.IsInitialized)
|
||||
{
|
||||
base.Initialize();
|
||||
foreach (var item in this.TabItems)
|
||||
await Task.Run(async () =>
|
||||
{
|
||||
if (item == SteamAppPage)
|
||||
continue;
|
||||
await item.Initialize().ContinueWith(s =>
|
||||
foreach (var item in this.TabItems)
|
||||
{
|
||||
Logger.Error(s.Exception);
|
||||
WindowService.Current.ShowDialogWindow(s.Exception.Message);
|
||||
}, TaskContinuationOptions.OnlyOnFaulted).ContinueWith(s => s.Dispose());
|
||||
}
|
||||
|
||||
AuthService.Current.Initialize();
|
||||
if (GeneralSettings.IsAutoCheckUpdate)
|
||||
{
|
||||
AutoUpdateService.Current.CheckUpdate();
|
||||
}
|
||||
if (item == SteamAppPage)
|
||||
continue;
|
||||
await item.Initialize().ContinueWith(s =>
|
||||
{
|
||||
Logger.Error(s.Exception);
|
||||
WindowService.Current.ShowDialogWindow(s.Exception.Message);
|
||||
}, TaskContinuationOptions.OnlyOnFaulted).ContinueWith(s => s.Dispose());
|
||||
}
|
||||
});
|
||||
|
||||
this.IsInitialized = true;
|
||||
StatusService.Current.Set(Resources.Ready);
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace SteamTools.ViewModels
|
||||
{
|
||||
var fileDialog = new OpenFileDialog
|
||||
{
|
||||
Filter = "脚本文件|*.js",
|
||||
Filter = "JavaScript Files (*.js)|*.js",
|
||||
Title = Resources.ImportScript,
|
||||
//AddExtension = true,
|
||||
Multiselect = true
|
||||
|
||||
@@ -26,21 +26,6 @@ namespace SteamTools.ViewModels
|
||||
protected set { throw new NotImplementedException(); }
|
||||
}
|
||||
|
||||
private BindingList<WinAuthAuthenticator> _Authenticators;
|
||||
|
||||
public BindingList<WinAuthAuthenticator> Authenticators
|
||||
{
|
||||
get => this._Authenticators;
|
||||
set
|
||||
{
|
||||
if (this._Authenticators != value)
|
||||
{
|
||||
this._Authenticators = value;
|
||||
this.RaisePropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool _IsEdit;
|
||||
public bool IsEdit
|
||||
{
|
||||
@@ -57,8 +42,8 @@ namespace SteamTools.ViewModels
|
||||
|
||||
public void ImageDelete_Click(WinAuthAuthenticator auth)
|
||||
{
|
||||
Authenticators.Remove(auth);
|
||||
if (Authenticators.Count == 0)
|
||||
AuthService.Current.Authenticators.Remove(auth);
|
||||
if (AuthService.Current.Authenticators.Count == 0)
|
||||
{
|
||||
AuthSettings.Authenticators.Value = null;
|
||||
IsEdit = false;
|
||||
@@ -94,12 +79,6 @@ namespace SteamTools.ViewModels
|
||||
TaskbarService.Current.Notify("已复制令牌");
|
||||
}
|
||||
|
||||
internal async override Task Initialize()
|
||||
{
|
||||
AuthService.Current.Subscribe(nameof(AuthService.Current.Authenticators),
|
||||
() => { Authenticators = AuthService.Current.Authenticators; }).AddTo(this);
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
public void AddAuth_Click()
|
||||
{
|
||||
@@ -108,7 +87,7 @@ namespace SteamTools.ViewModels
|
||||
|
||||
public void EditAuth_Click()
|
||||
{
|
||||
if (Authenticators == null || !Authenticators.Any())
|
||||
if (AuthService.Current.Authenticators == null || !AuthService.Current.Authenticators.Any())
|
||||
{
|
||||
StatusService.Current.Notify("没有可编辑的令牌");
|
||||
return;
|
||||
@@ -116,7 +95,7 @@ namespace SteamTools.ViewModels
|
||||
this.IsEdit = !IsEdit;
|
||||
if (!IsEdit)
|
||||
{
|
||||
AuthSettings.Authenticators.Value = AuthService.ConvertJsonAuthenticator(Authenticators.ToList()).CompressString();
|
||||
AuthSettings.Authenticators.Value = AuthService.ConvertJsonAuthenticator(AuthService.Current.Authenticators.ToList()).CompressString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,5 +109,28 @@ namespace SteamTools.ViewModels
|
||||
{
|
||||
new AuthTradeWindow() { DataContext = new AuthTradeWindowViewModel(auth) }.Show();
|
||||
}
|
||||
|
||||
|
||||
public void ImageAuthExport_Click()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(AuthSettings.Authenticators.Value))
|
||||
{
|
||||
SaveFileDialog saveFileDialog = new SaveFileDialog
|
||||
{
|
||||
AddExtension = true,
|
||||
CheckPathExists = true,
|
||||
Filter = "AuthData Files (*.dat)|*.dat",
|
||||
RestoreDirectory = true,
|
||||
FileName = $"{ProductInfo.Title} Authenticator {DateTime.Now.ToString("yyyy-MM-dd")}",
|
||||
Title = ProductInfo.Title + " | " + Resources.Auth_Export,
|
||||
};
|
||||
if (saveFileDialog.ShowDialog(App.Current.MainWindow) == true)
|
||||
{
|
||||
File.WriteAllText(saveFileDialog.FileName, AuthSettings.Authenticators.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ namespace SteamTools.ViewModels
|
||||
//WindowService.Current.MainWindow.Transition(achievement, typeof(AchievementWindow));
|
||||
var nApp = app.Clone();
|
||||
//nApp.Process = Process.Start($"{ProductInfo.Title}.exe", app.AppId.ToString(CultureInfo.InvariantCulture));
|
||||
nApp.Process = Process.Start(Environment.GetCommandLineArgs()[0], "-app " + app.AppId.ToString(CultureInfo.InvariantCulture));
|
||||
nApp.Process = Process.Start(App.Instance.ProgramName, "-app " + app.AppId.ToString(CultureInfo.InvariantCulture));
|
||||
SteamConnectService.Current.RuningSteamApps.Add(nApp);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace SteamTools.ViewModels
|
||||
SteamConnectService.Current.Initialize(appid);
|
||||
if (SteamConnectService.Current.IsConnectToSteam == false)
|
||||
{
|
||||
MessageBox.Show("与Steam建立连接失败,可能是该游戏没有成就,或者你不拥有该游戏。");
|
||||
MessageBox.Show("与Steam建立连接失败,可能是该游戏没有成就,或者你没有该游戏。");
|
||||
EnforceClose();
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace SteamTools.ViewModels
|
||||
{
|
||||
if (param.Result != 1)
|
||||
{
|
||||
this.Dialog($"错误代码: {param.Result}\r\n检索成就统计信息时出错,可能是该游戏没有成就,或者你不拥有该游戏。");
|
||||
this.Dialog($"错误代码: {param.Result}\r\n检索成就统计信息时出错,可能是该游戏没有成就,或者你没有该游戏。");
|
||||
EnforceClose();
|
||||
}
|
||||
if (this.LoadUserGameStatsSchema() == false)
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace SteamTools.ViewModels
|
||||
public bool IsWinAuth { get; set; }
|
||||
public bool IsSteamApp { get; set; } = true;
|
||||
public bool IsSDA { get; set; }
|
||||
public bool IsSpp { get; set; }
|
||||
|
||||
private string _WinAuthFileName;
|
||||
public string WinAuthFileName
|
||||
@@ -40,6 +41,20 @@ namespace SteamTools.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
private string _AuthFileName;
|
||||
public string AuthFileName
|
||||
{
|
||||
get => this._AuthFileName;
|
||||
set
|
||||
{
|
||||
if (this._AuthFileName != value)
|
||||
{
|
||||
this._AuthFileName = value;
|
||||
this.RaisePropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string _SDAFile;
|
||||
public string SDAFile
|
||||
{
|
||||
@@ -53,6 +68,7 @@ namespace SteamTools.ViewModels
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string _SDAPassword;
|
||||
public string SDAPassword
|
||||
{
|
||||
@@ -123,6 +139,7 @@ namespace SteamTools.ViewModels
|
||||
{
|
||||
WinAuthFileName = ofd.FileName;
|
||||
this.Topmost = true;
|
||||
this.Topmost = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,6 +158,40 @@ namespace SteamTools.ViewModels
|
||||
{
|
||||
SDAFile = ofd.FileName;
|
||||
this.Topmost = true;
|
||||
this.Topmost = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenSppAuthFile()
|
||||
{
|
||||
OpenFileDialog ofd = new OpenFileDialog
|
||||
{
|
||||
AddExtension = true,
|
||||
CheckFileExists = true,
|
||||
CheckPathExists = true,
|
||||
Filter = "AuthData Files (*.dat)|*.dat|All Files (*.*)|*.*",
|
||||
RestoreDirectory = true,
|
||||
Title = ProductInfo.Title
|
||||
};
|
||||
if (ofd.ShowDialog(App.Current.MainWindow) == true)
|
||||
{
|
||||
AuthFileName = ofd.FileName;
|
||||
this.Topmost = true;
|
||||
this.Topmost = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导入Steam++导出的令牌数据文件
|
||||
/// </summary>
|
||||
public void ImportAuthenticatorFile()
|
||||
{
|
||||
if (File.Exists(AuthFileName))
|
||||
{
|
||||
StatusService.Current.Set("导入Steam++令牌中...");
|
||||
AuthService.Current.ImportAuthenticators(AuthFileName);
|
||||
AuthService.Current.SaveCurrentAuth();
|
||||
StatusService.Current.Set(Resources.Ready);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,9 +200,8 @@ namespace SteamTools.ViewModels
|
||||
if (File.Exists(WinAuthFileName))
|
||||
{
|
||||
StatusService.Current.Set("导入WinAuth令牌中...");
|
||||
AuthService.Current.ImportAuthenticators(WinAuthFileName);
|
||||
AuthSettings.Authenticators.Value = AuthService.ConvertJsonAuthenticator(AuthService.Current.Authenticators).CompressString();
|
||||
//(WindowService.Current.MainWindow as MainWindowViewModel).LocalAuthPage
|
||||
AuthService.Current.ImportWinAuthenticators(WinAuthFileName);
|
||||
AuthService.Current.SaveCurrentAuth();
|
||||
StatusService.Current.Set(Resources.Ready);
|
||||
}
|
||||
}
|
||||
@@ -161,7 +211,7 @@ namespace SteamTools.ViewModels
|
||||
StatusService.Current.Notify("导入Steam App令牌中...");
|
||||
if (AuthService.Current.ImportSteamGuard(AuthName, UUID, SteamGuard))
|
||||
{
|
||||
AuthSettings.Authenticators.Value = AuthService.ConvertJsonAuthenticator(AuthService.Current.Authenticators).CompressString();
|
||||
AuthService.Current.SaveCurrentAuth();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -174,7 +224,7 @@ namespace SteamTools.ViewModels
|
||||
StatusService.Current.Set("导入Steam Desktop Auth令牌中...");
|
||||
if (AuthService.Current.ImportSDAFile(SDAFile, SDAPassword))
|
||||
{
|
||||
AuthSettings.Authenticators.Value = AuthService.ConvertJsonAuthenticator(AuthService.Current.Authenticators).CompressString();
|
||||
AuthService.Current.SaveCurrentAuth();
|
||||
StatusService.Current.Set(Resources.Ready);
|
||||
}
|
||||
else
|
||||
@@ -184,14 +234,16 @@ namespace SteamTools.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public void Apply()
|
||||
public void Apply()
|
||||
{
|
||||
if (IsWinAuth)
|
||||
ImportWinAuthFile();
|
||||
else if (IsSteamApp)
|
||||
ImportSteamGuard();
|
||||
else if(IsSDA)
|
||||
else if (IsSDA)
|
||||
ImportSDA();
|
||||
else if (IsSpp)
|
||||
ImportAuthenticatorFile();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,9 @@ using SteamTool.Core.Common;
|
||||
using System.Threading.Tasks;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using WinAuth;
|
||||
using System.Net;
|
||||
using SteamTools.Win32;
|
||||
using SteamTool.Model;
|
||||
|
||||
namespace SteamTools.ViewModels
|
||||
{
|
||||
@@ -20,17 +23,55 @@ namespace SteamTools.ViewModels
|
||||
{
|
||||
private SteamAuthenticator _Authenticator;
|
||||
|
||||
public AuthTradeWindowViewModel()
|
||||
{
|
||||
this.Title = ProductInfo.Title + " | " + Resources.Auth_TradeTitle;
|
||||
}
|
||||
|
||||
public AuthTradeWindowViewModel(WinAuthAuthenticator auth)
|
||||
{
|
||||
_Authenticator = auth.AuthenticatorData as SteamAuthenticator;
|
||||
this.Title = ProductInfo.Title + " | " + Resources.Auth_TradeTitle;
|
||||
|
||||
//var steam = _Authenticator.GetClient();
|
||||
|
||||
//if (steam.IsLoggedIn() == false)
|
||||
//{
|
||||
// ExtractSteamCookies(steam);
|
||||
//}
|
||||
}
|
||||
|
||||
public void ExtractSteamCookies()
|
||||
{
|
||||
var login_url = new Uri(Const.STEAM_LOGIN_URL);
|
||||
var container = WinInet.GetUriCookieContainer(login_url);
|
||||
var cookies = container.GetCookies(login_url);
|
||||
var steam = _Authenticator.GetClient();
|
||||
|
||||
foreach (Cookie cookie in cookies)
|
||||
{
|
||||
steam.Session.Cookies.Add(login_url, cookie);
|
||||
//if (cookie.Name == "sessionid")
|
||||
//{
|
||||
// steam.Session.Cookies.Add(login_url, cookie);
|
||||
//}
|
||||
//else if (cookie.Name == "steamLogin")
|
||||
//{
|
||||
// steam.Session.Cookies.Add(login_url, cookie);
|
||||
// //Settings.Default.steamLogin = cookie.Value;
|
||||
// //Settings.Default.myProfileURL = SteamProfile.GetSteamUrl();
|
||||
//}
|
||||
//else if (cookie.Name == "steamLoginSecure")
|
||||
//{
|
||||
// steam.Session.Cookies.Add(login_url, cookie);
|
||||
// //Settings.Default.myProfileURL = SteamProfile.GetSteamUrl();
|
||||
//}
|
||||
//else if (cookie.Name == "steamparental")
|
||||
//{
|
||||
// //Settings.Default.steamparental = cookie.Value;
|
||||
//}
|
||||
//else if (cookie.Name == "steamRememberLogin")
|
||||
//{
|
||||
// //Settings.Default.steamRememberLogin = cookie.Value;
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,12 +19,6 @@ namespace SteamTools.ViewModels
|
||||
public class ShowAuthWindowViewModel : MainWindowViewModelBase
|
||||
{
|
||||
private SteamAuthenticator _Authenticator;
|
||||
|
||||
public ShowAuthWindowViewModel()
|
||||
{
|
||||
this.Title = ProductInfo.Title + " | " + Resources.Auth_DetailTitle;
|
||||
}
|
||||
|
||||
public ShowAuthWindowViewModel(WinAuthAuthenticator auth)
|
||||
{
|
||||
_Authenticator = auth.AuthenticatorData as SteamAuthenticator;
|
||||
|
||||
@@ -37,9 +37,9 @@
|
||||
<DataTemplate>
|
||||
<DockPanel Margin="8">
|
||||
<WrapPanel VerticalAlignment="Center">
|
||||
<TextBlock Text="{Binding Name}" Foreground="{StaticResource ActiveForegroundBrushKey}" Margin="10,0,0,0" Width="50"></TextBlock>
|
||||
<TextBlock Text="{Binding Amount,StringFormat={}{0:F2}元}" Foreground="{StaticResource ActiveForegroundBrushKey}" Margin="30,0,0,0" Width="70"></TextBlock>
|
||||
<TextBlock Text="{Binding Remark}" Foreground="{StaticResource ActiveForegroundBrushKey}" Margin="30,0,0,0"></TextBlock>
|
||||
<TextBlock Text="{Binding Name}" Foreground="{StaticResource ActiveForegroundBrushKey}" Margin="10,0,0,0" Width="60"></TextBlock>
|
||||
<TextBlock Text="{Binding Amount,StringFormat={}{0:F2}元}" Foreground="{StaticResource ActiveForegroundBrushKey}" Margin="20,0,0,0" Width="70"></TextBlock>
|
||||
<TextBlock Text="{Binding Remark}" Foreground="{StaticResource ActiveForegroundBrushKey}" Margin="30,0,0,0" TextTrimming="CharacterEllipsis"></TextBlock>
|
||||
</WrapPanel>
|
||||
<TextBlock Text="{Binding PayTime,StringFormat='{}{0:yyyy年MM月dd日}',ConverterCulture=zh-CN}" Foreground="{StaticResource ActiveForegroundBrushKey}" Margin="10" HorizontalAlignment="Right"></TextBlock>
|
||||
</DockPanel>
|
||||
|
||||
@@ -22,83 +22,156 @@
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<ScrollViewer Padding="8" VerticalScrollBarVisibility="Auto">
|
||||
<DockPanel>
|
||||
<TextBlock DockPanel.Dock="Top" Text="{Binding Resources.AboutUpdateHistory, Source={x:Static services:ResourceService.Current}, Mode=OneWay}"
|
||||
<DockPanel Margin="8">
|
||||
<TextBlock DockPanel.Dock="Top" Text="{Binding Resources.AboutUpdateHistory, Source={x:Static services:ResourceService.Current}, Mode=OneWay}"
|
||||
Style="{DynamicResource SettingsHeaderTextStyleKey}" />
|
||||
<Border Grid.Column="1">
|
||||
<FlowDocumentScrollViewer Padding="0,-18,0,0"
|
||||
<Border Grid.Column="1">
|
||||
<FlowDocumentScrollViewer Padding="0,-18,0,0"
|
||||
HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Auto">
|
||||
<FlowDocument FontSize="12"
|
||||
<FlowDocument FontSize="12"
|
||||
Foreground="{DynamicResource ForegroundBrushKey}"
|
||||
FontFamily="Meiryo UI"
|
||||
TextAlignment="Left"
|
||||
MaxPageWidth="900">
|
||||
<Paragraph Language="zh-cn">
|
||||
<Run Text="Steam++ v1.0.2" FontSize="16"/>
|
||||
<Run Text=" "/>
|
||||
<Run Text="2020-12-21" FontSize="10" />
|
||||
<LineBreak />
|
||||
<Run Text="更新内容"></Run>
|
||||
<LineBreak />
|
||||
<Run Text="    "/>
|
||||
<Run Text="更新了由Benares制作的图标" />
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="新增帐户切换删除功能" />
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="添加github图片资源文件代理服务与discord代理服务支持" />
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="因为有问题暂时去掉了GOG Galaxy代理选项"></Run>
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="修复一个会导致程序启动没有反应的bug"></Run>
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="修复托盘菜单steam昵称过长ui错位bug"></Run>
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="新增steam启动参数设置"></Run>
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="新增启动时程序最小化到托盘菜单设置"></Run>
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="新增捐助列表的展示"></Run>
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="新增工具自动更新功能"></Run>
|
||||
<LineBreak />
|
||||
<LineBreak />
|
||||
<Run Text="已知的未修复问题"></Run>
|
||||
<LineBreak />
|
||||
<Run Text="    "/>
|
||||
<Run Text="(严重)经反馈,程序运行时可能会影响部分steam游戏掉帧,GPU占用率变低,这个BUG目前在作者的机器上无法复现所以暂时没有修复,如果你遇到这个问题可以手动关闭steam++解决。" />
|
||||
<LineBreak />
|
||||
<Run Text="    "/>
|
||||
<Run Text="程序在高DPI缩放分辨率下可能会UI布局错位,目前暂时拖动程序可恢复。" />
|
||||
<LineBreak />
|
||||
<Run Text="    "/>
|
||||
<Run Text="部分用户无法加载游戏列表,无法复现,原因暂时不明。" />
|
||||
</Paragraph>
|
||||
<Paragraph Language="zh-cn">
|
||||
<Run Text="Steam++ v1.0.0" FontSize="16"/>
|
||||
<Run Text=" "/>
|
||||
<Run Text="2020-12-14" FontSize="10" />
|
||||
<LineBreak />
|
||||
<Run Text="发布第一个版本" />
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="主要功能:社区反代,帐户切换,成就解锁,本地令牌。"></Run>
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="次要功能:强制无边框窗口化以及CSGO VAC屏蔽修复。"></Run>
|
||||
</Paragraph>
|
||||
</FlowDocument>
|
||||
</FlowDocumentScrollViewer>
|
||||
</Border>
|
||||
</DockPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<Paragraph Language="zh-cn">
|
||||
<Run Text="Steam++ v1.0.4" FontSize="16"/>
|
||||
<Run Text=" "/>
|
||||
<Run Text="2020-12-28" FontSize="10" />
|
||||
<LineBreak />
|
||||
<Run Text="更新内容"></Run>
|
||||
<LineBreak />
|
||||
<Run Text="    "/>
|
||||
<Run Foreground="IndianRed" Text="*此版本修改了配置文件的保存读取功能,会无法读取1.0.4版本以前的配置文件包括令牌数据。(可以通过设置-令牌设置-导入旧版本Steam++令牌数据按钮来恢复旧版本令牌数据)" />
|
||||
<LineBreak />
|
||||
<Run Text="    "/>
|
||||
<Run Text="还原steam社区反代上游地址修复部分请求会提示需要登录的问题" />
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="新增令牌导入导出备份功能" />
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="新增令牌可以选择保存在程序根目录下的设置选项(方便备份)" />
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="修改了自动更新的提示方式"></Run>
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="自动更新可以自动覆盖升级,不再需要手动替换"></Run>
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="修复令牌无法保存的问题"></Run>
|
||||
<LineBreak/>
|
||||
<LineBreak />
|
||||
<Run Text="已知的未修复问题"></Run>
|
||||
<LineBreak />
|
||||
<Run Text="    "/>
|
||||
<Run Text="部分用户无法加载游戏列表,原因是因为缓存文件可能没有下载完成只下了一半,解决方法暂时可以手动刷新游戏列表缓存或者删除apps.json文件重启程序" />
|
||||
</Paragraph>
|
||||
<Paragraph Language="zh-cn">
|
||||
<Run Text="Steam++ v1.0.3" FontSize="16"/>
|
||||
<Run Text=" "/>
|
||||
<Run Text="2020-12-26" FontSize="10" />
|
||||
<LineBreak />
|
||||
<Run Text="更新内容"></Run>
|
||||
<LineBreak />
|
||||
<Run Text="    "/>
|
||||
<Run Text="新增pixiv本地反代服务支持" />
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="新增在欢迎页steam昵称后显示steam的登陆区域" />
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="添加steam图片修复的本地反代支持" />
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="修复最小化恢复时UI边框错位的BUG"></Run>
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="修复令牌编辑和导入时出现的非空报错"></Run>
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="帐户切换功能的最近登陆时间从北京时间改为当前系统时区时间"></Run>
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="修复一个因为DNS解析错误会导致程序内存溢出闪退的BUG"></Run>
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="SDA令牌导入不再支持导入加密文件,如果要导入加密的maFile请先在SDA移除加密"></Run>
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="修改初始化的方式和steam api的连接逻辑来避免steam游戏掉帧的BUG"></Run>
|
||||
<LineBreak/>
|
||||
<LineBreak />
|
||||
<Run Text="已知的未修复问题"></Run>
|
||||
<LineBreak />
|
||||
<Run Text="    "/>
|
||||
<Run Text="部分用户无法加载游戏列表,无法复现,原因暂时不明。(也可能是加载太慢,过半小时才能加载出来)" />
|
||||
</Paragraph>
|
||||
<Paragraph Language="zh-cn">
|
||||
<Run Text="Steam++ v1.0.2" FontSize="16"/>
|
||||
<Run Text=" "/>
|
||||
<Run Text="2020-12-21" FontSize="10" />
|
||||
<LineBreak />
|
||||
<Run Text="更新内容"></Run>
|
||||
<LineBreak />
|
||||
<Run Text="    "/>
|
||||
<Run Text="更新了由Benares制作的图标" />
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="新增帐户切换删除功能" />
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="添加github图片资源文件代理服务与discord代理服务支持" />
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="因为有问题暂时去掉了GOG Galaxy代理选项"></Run>
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="修复一个会导致程序启动没有反应的bug"></Run>
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="修复托盘菜单steam昵称过长ui错位bug"></Run>
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="新增steam启动参数设置"></Run>
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="新增启动时程序最小化到托盘菜单设置"></Run>
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="新增捐助列表的展示"></Run>
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="新增工具自动更新功能"></Run>
|
||||
<LineBreak />
|
||||
<LineBreak />
|
||||
<Run Text="已知的未修复问题"></Run>
|
||||
<LineBreak />
|
||||
<Run Text="    "/>
|
||||
<Run Text="(严重)经反馈,程序运行时可能会影响部分steam游戏掉帧,GPU占用率变低,这个BUG目前在作者的机器上无法复现所以暂时没有修复,如果你遇到这个问题可以手动关闭steam++解决。" />
|
||||
<LineBreak />
|
||||
<Run Text="    "/>
|
||||
<Run Text="程序在高DPI缩放分辨率下可能会UI布局错位,目前暂时拖动程序可恢复。" />
|
||||
<LineBreak />
|
||||
<Run Text="    "/>
|
||||
<Run Text="部分用户无法加载游戏列表,无法复现,原因暂时不明。" />
|
||||
</Paragraph>
|
||||
<Paragraph Language="zh-cn">
|
||||
<Run Text="Steam++ v1.0.0" FontSize="16"/>
|
||||
<Run Text=" "/>
|
||||
<Run Text="2020-12-14" FontSize="10" />
|
||||
<LineBreak />
|
||||
<Run Text="发布第一个版本" />
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="主要功能:社区反代,帐户切换,成就解锁,本地令牌。"></Run>
|
||||
<LineBreak/>
|
||||
<Run Text="    "/>
|
||||
<Run Text="次要功能:强制无边框窗口化以及CSGO VAC屏蔽修复。"></Run>
|
||||
</Paragraph>
|
||||
</FlowDocument>
|
||||
</FlowDocumentScrollViewer>
|
||||
</Border>
|
||||
</DockPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -20,8 +20,6 @@ namespace SteamTools.Views.Content
|
||||
/// </summary>
|
||||
public partial class AboutUpdateHistory : UserControl
|
||||
{
|
||||
private const string UpdateLogText = "";
|
||||
|
||||
public AboutUpdateHistory()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<TextBlock Style="{StaticResource DetailTextStyleKey}" Margin="20,6,0,0">
|
||||
<Run Text="*置于壁纸层的游戏可能会无法操控,这个问题可以解决但是目前发开精力不在这,目前这个功能就这样了。游戏结束后桌面会依然留下冻结的画面,这时可以点击刷新壁纸来恢复默认壁纸。"/>
|
||||
<Run Text="*置于壁纸层的游戏可能会无法操控,这个问题可以解决但是目前开发精力不在这,目前这个功能就这样了。游戏结束后桌面会依然留下冻结的画面,这时可以点击刷新壁纸来恢复默认壁纸。"/>
|
||||
<Run Text="并且将窗口放置于桌面壁纸层功能与Wallpaper Engine和其它动态桌面软件不兼容,使用时注意关掉Wallpaper Engine等软件。"/>
|
||||
</TextBlock>
|
||||
<Rectangle Style="{DynamicResource SeparatorStyleKey}" />
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
<UserControl x:Class="SteamTools.Views.Content.SettingsAuth"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:SteamTools.Views.Content"
|
||||
xmlns:viewModel="clr-namespace:SteamTools.ViewModels"
|
||||
xmlns:services="clr-namespace:SteamTools.Services"
|
||||
xmlns:metro="http://schemes.grabacr.net/winfx/2014/controls"
|
||||
xmlns:metro2="http://schemes.grabacr.net/winfx/2015/personal/controls"
|
||||
xmlns:model="clr-namespace:SteamTool.Model;assembly=SteamTool.Model"
|
||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:livet="http://schemas.livet-mvvm.net/2011/wpf"
|
||||
xmlns:ms="clr-namespace:SteamTools.Models.Settings"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="400"
|
||||
d:DesignWidth="600"
|
||||
Background="{DynamicResource ThemeBrushKey}"
|
||||
d:DataContext="{d:DesignInstance viewModel:SettingsAuthViewModel}">
|
||||
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Margin="8,0,8,8">
|
||||
<Panel.Resources>
|
||||
<Style TargetType="{x:Type WrapPanel}">
|
||||
<Setter Property="VerticalAlignment"
|
||||
Value="Center" />
|
||||
</Style>
|
||||
<Style TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="VerticalAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="Margin"
|
||||
Value="0,2,12,2" />
|
||||
</Style>
|
||||
<Style TargetType="{x:Type RadioButton}"
|
||||
BasedOn="{StaticResource {x:Type RadioButton}}">
|
||||
<Setter Property="VerticalAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="Margin"
|
||||
Value="0,2,12,2" />
|
||||
</Style>
|
||||
</Panel.Resources>
|
||||
|
||||
<StackPanel Margin="20,0,0,0">
|
||||
<TextBlock Margin="-20,0,0,10" Text="{Binding Resources.Settings_Auth, Source={x:Static services:ResourceService.Current}, Mode=OneWay}" Style="{DynamicResource SettingsHeaderTextStyleKey}" />
|
||||
<StackPanel>
|
||||
<Panel.Resources>
|
||||
<Style TargetType="{x:Type RadioButton}"
|
||||
BasedOn="{StaticResource {x:Type RadioButton}}">
|
||||
<Setter Property="GroupName"
|
||||
Value="Themes" />
|
||||
</Style>
|
||||
</Panel.Resources>
|
||||
<CheckBox Content="令牌数据保存到Steam++程序目录下"
|
||||
IsChecked="{Binding Source={x:Static ms:AuthSettings.IsCurrentDirectorySaveAuthData}, Path=Value, Mode=TwoWay}" />
|
||||
<TextBlock Style="{StaticResource DetailTextStyleKey}" Margin="0,6,0,0">
|
||||
<Run Text="*下次启动时生效,启用后Steam++的令牌数据文件将会保存在Steam++程序目录内,方便备份保存令牌数据。"></Run>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<Separator Opacity="0" Height="10"/>
|
||||
<WrapPanel>
|
||||
<metro2:CallMethodButton Content="读取并导入Steam++旧版本的令牌数据"
|
||||
Width="300"
|
||||
Height="30"
|
||||
HorizontalAlignment="Left"
|
||||
MethodName="ImportOldVersionAuthData"
|
||||
MethodTarget="{Binding}"/>
|
||||
<TextBlock Style="{StaticResource DetailTextStyleKey}" Margin="10,0,0,0">
|
||||
<Run Text="*导入1.0.4版本之前的令牌数据"></Run>
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
<Border Height="1"
|
||||
Background="{DynamicResource BorderBrushKey}"
|
||||
Margin="-20,8" />
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace SteamTools.Views.Content
|
||||
{
|
||||
/// <summary>
|
||||
/// SettingsAuth.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SettingsAuth : UserControl
|
||||
{
|
||||
public SettingsAuth()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ using System.Windows.Shapes;
|
||||
namespace SteamTools.Views.Content
|
||||
{
|
||||
/// <summary>
|
||||
/// AboutDonate.xaml 的交互逻辑
|
||||
/// SettingsGeneral.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SettingsGeneral : UserControl
|
||||
{
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
<UserControl x:Class="SteamTools.Views.Controls.StatusBar"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:SteamTools.Views.Controls"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:SteamTools.Views.Controls"
|
||||
xmlns:metro="http://schemes.grabacr.net/winfx/2014/controls"
|
||||
xmlns:metro2="http://schemes.grabacr.net/winfx/2015/personal/controls"
|
||||
xmlns:services="clr-namespace:SteamTools.Services"
|
||||
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
||||
xmlns:livet="http://schemas.livet-mvvm.net/2011/wpf"
|
||||
xmlns:vm="clr-namespace:SteamTools.ViewModels"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="25" d:DesignWidth="780"
|
||||
@@ -25,7 +28,31 @@
|
||||
Margin="8,0" >
|
||||
<Run
|
||||
Text="{Binding Source={x:Static services:StatusService.Current}, Path=Message}"/>
|
||||
|
||||
<metro2:HyperlinkEx
|
||||
Foreground="{DynamicResource AccentForegroundBrushKey}">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<livet:LivetCallMethodAction
|
||||
MethodName="DownloadUpdate"
|
||||
MethodTarget="{Binding Source={x:Static services:AutoUpdateService.Current}}" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
|
||||
<Run FontSize="12">
|
||||
<Run.Style>
|
||||
<Style TargetType="{x:Type Run}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Source={x:Static services:AutoUpdateService.Current}, Path=IsExistUpdate,Mode=OneWay}" Value="True">
|
||||
<Setter Property="Text" Value="{Binding Source={x:Static services:ResourceService.Current}, Path=Resources.UpdateTips,Mode=OneWay}"></Setter>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Source={x:Static services:AutoUpdateService.Current}, Path=IsExistUpdate,Mode=OneWay}" Value="False">
|
||||
<Setter Property="Text" Value=""></Setter>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Run.Style>
|
||||
</Run>
|
||||
</metro2:HyperlinkEx>
|
||||
</TextBlock>
|
||||
<ContentControl Grid.Column="1"
|
||||
Content="{Binding}">
|
||||
|
||||
@@ -175,6 +175,9 @@
|
||||
<DataTemplate DataType="{x:Type vm:SteamAccountPageViewModel}">
|
||||
<pages:SwitchSteamAccountPage />
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type vm:SteamIdlePageViewModel}">
|
||||
<pages:SteamIdleCardPage />
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type vm:CommunityProxyPageViewModel}">
|
||||
<pages:CommunityProxyPage />
|
||||
</DataTemplate>
|
||||
|
||||
@@ -17,7 +17,7 @@ using MetroRadiance.UI;
|
||||
namespace SteamTools.Views.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// SwitchTheme.xaml 的交互逻辑
|
||||
/// AboutPage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class AboutPage : UserControl
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ using System.Windows.Shapes;
|
||||
namespace SteamTools.Views.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// SwitchSteamAccount.xaml 的交互逻辑
|
||||
/// ArchiSteamFarmPlusPage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ArchiSteamFarmPlusPage : UserControl
|
||||
{
|
||||
|
||||
@@ -114,14 +114,13 @@
|
||||
Style="{DynamicResource SeparatorRectangleStyleKey}" />
|
||||
</StackPanel>
|
||||
<ListBox DockPanel.Dock="Bottom"
|
||||
IsEnabled="{Binding ElementName=service,Path=IsChecked,Mode=OneWay,Converter={StaticResource ReverseBooleanConverter}}"
|
||||
BorderThickness="0"
|
||||
Style="{StaticResource MetroListBox}"
|
||||
ItemsSource="{Binding ProxyDomains.Value,Source={x:Static services:ProxyService.Current}, Mode=OneWay}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<DockPanel Height="30" ToolTip="{Binding DomainTag}">
|
||||
<CheckBox HorizontalAlignment="Left"
|
||||
<CheckBox HorizontalAlignment="Left" IsEnabled="{Binding ElementName=service,Path=IsChecked,Mode=OneWay,Converter={StaticResource ReverseBooleanConverter}}"
|
||||
Content="{Binding Name}"
|
||||
IsChecked="{Binding IsEnable}">
|
||||
<i:Interaction.Triggers>
|
||||
|
||||
@@ -17,7 +17,7 @@ using MetroRadiance.UI;
|
||||
namespace SteamTools.Views.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// SwitchTheme.xaml 的交互逻辑
|
||||
/// GameRelatedPage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class GameRelatedPage : UserControl
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Margin="8,0,8,8">
|
||||
<Grid Margin="8,4,8,8">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
</Image>
|
||||
<Separator Opacity="0" Width="10"/>
|
||||
<Image Width="22" Cursor="Hand" VerticalAlignment="Center">
|
||||
<Image Width="24" Cursor="Hand" VerticalAlignment="Center">
|
||||
<Image.Style>
|
||||
<Style TargetType="{x:Type Image}">
|
||||
<Style.Triggers>
|
||||
@@ -66,7 +66,16 @@
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Image>
|
||||
<Separator Opacity="0" Width="10"/>
|
||||
<Separator Opacity="0" Width="12"/>
|
||||
<Image Width="23" Cursor="Hand" VerticalAlignment="Center" Source="/Resources/Asstes/export.png" ToolTip="{Binding Resources.Auth_Export,Source={x:Static services:ResourceService.Current},Mode=OneWay}">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="MouseLeftButtonUp">
|
||||
<livet:LivetCallMethodAction
|
||||
MethodName="ImageAuthExport_Click"
|
||||
MethodTarget="{Binding}" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Image>
|
||||
</StackPanel>
|
||||
<Rectangle DockPanel.Dock="Bottom" Height=".99"
|
||||
Fill="{DynamicResource InactiveForegroundBrushKey}"
|
||||
@@ -75,7 +84,7 @@
|
||||
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
|
||||
<ItemsControl
|
||||
Foreground="{DynamicResource HighlightForegroundBrushKey}"
|
||||
ItemsSource="{Binding Authenticators,Mode=OneWay}">
|
||||
ItemsSource="{Binding Authenticators,Source={x:Static services:AuthService.Current},Mode=OneWay}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
@@ -145,6 +154,17 @@
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Image>
|
||||
<!--<Separator Opacity="0" Width="5"/>
|
||||
<Image Source="/Resources/Asstes/trade.png" Width="26" Cursor="Hand" ToolTip="{Binding Resources.Auth_Trade,Source={x:Static services:ResourceService.Current},Mode=OneWay}" Visibility="{Binding ElementName=u,Path=DataContext.IsEdit,Mode=OneWay,Converter={StaticResource ReverseBooleanToVisibilityConverter}}">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="MouseLeftButtonUp">
|
||||
<livet:LivetCallMethodAction
|
||||
MethodName="ImageAuthTrade_Click"
|
||||
MethodParameter="{Binding}"
|
||||
MethodTarget="{Binding DataContext,ElementName=u}" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Image>-->
|
||||
<Separator Opacity="0" Width="5"/>
|
||||
<Image Source="/Resources/Asstes/seek.png" Width="24" Cursor="Hand" ToolTip="{Binding Resources.Auth_See,Source={x:Static services:ResourceService.Current},Mode=OneWay}" Visibility="{Binding ElementName=u,Path=DataContext.IsEdit,Mode=OneWay,Converter={StaticResource ReverseBooleanToVisibilityConverter}}">
|
||||
<i:Interaction.Triggers>
|
||||
|
||||
@@ -16,7 +16,7 @@ using System.Windows.Shapes;
|
||||
namespace SteamTools.Views.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// SwitchSteamAccount.xaml 的交互逻辑
|
||||
/// LocalAuthPage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class LocalAuthPage : UserControl
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ using MetroRadiance.UI;
|
||||
namespace SteamTools.Views.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// SwitchTheme.xaml 的交互逻辑
|
||||
/// OtherPlatformPage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class OtherPlatformPage : UserControl
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
Style="{StaticResource TabHeaderTextStyleKey}" />
|
||||
</TabItem.Header>
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled"
|
||||
VerticalScrollBarVisibility="Auto">
|
||||
VerticalScrollBarVisibility="Auto" Background="{DynamicResource ThemeBrushKey}">
|
||||
<StackPanel Margin="8,0,8,8">
|
||||
<Panel.Resources>
|
||||
<Style TargetType="{x:Type WrapPanel}">
|
||||
@@ -179,7 +179,19 @@
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
|
||||
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<TextBlock Text="{Binding Resources.Settings_Auth,Source={x:Static services:ResourceService.Current}, Mode=OneWay}"
|
||||
Style="{StaticResource TabHeaderTextStyleKey}" />
|
||||
</TabItem.Header>
|
||||
<contents:SettingsAuth>
|
||||
<contents:SettingsAuth.DataContext>
|
||||
<vm:SettingsAuthViewModel/>
|
||||
</contents:SettingsAuth.DataContext>
|
||||
</contents:SettingsAuth>
|
||||
</TabItem>
|
||||
|
||||
<!--<TabItem>
|
||||
<TabItem.Header>
|
||||
<TextBlock Text="{Binding Resources.Settings_Proxy,Source={x:Static services:ResourceService.Current}, Mode=OneWay}"
|
||||
|
||||
@@ -11,7 +11,7 @@ using MetroRadiance.UI;
|
||||
namespace SteamTools.Views.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// SwitchTheme.xaml 的交互逻辑
|
||||
/// SettingsPage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SettingsPage : UserControl
|
||||
{
|
||||
|
||||
@@ -285,7 +285,7 @@
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="/Resources/Asstes/unlock.png" Margin="6,0" Width="24" Cursor="Hand" ToolTip="{Binding Resources.Sam,Source={x:Static services:ResourceService.Current},Mode=OneWay}">
|
||||
<Image Source="/Resources/Asstes/unlock.png" Margin="6,0" Width="25" Cursor="Hand" ToolTip="{Binding Resources.Sam,Source={x:Static services:ResourceService.Current},Mode=OneWay}">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="MouseLeftButtonUp">
|
||||
<livet:LivetCallMethodAction
|
||||
|
||||
@@ -16,7 +16,7 @@ using System.Windows.Shapes;
|
||||
namespace SteamTools.Views.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// SwitchSteamAccount.xaml 的交互逻辑
|
||||
/// SteamAppPage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SteamAppPage : UserControl
|
||||
{
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
<UserControl x:Class="SteamTools.Views.Pages.SteamIdleCardPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:control="clr-namespace:SteamTools.Views.Pages"
|
||||
xmlns:services="clr-namespace:SteamTools.Services"
|
||||
mc:Ignorable="d"
|
||||
d:DesignWidth="600"
|
||||
d:DesignHeight="400">
|
||||
|
||||
<TabControl Grid.Row="1" Style="{StaticResource VerticalTabControlStyleKey}"
|
||||
FontFamily="{DynamicResource DefaultFontFamilyKey}" FontSize="14">
|
||||
<TabControl.Resources>
|
||||
<Style x:Key="TabHeaderTextStyleKey"
|
||||
TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="Foreground"
|
||||
Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type TabItem}}, Path=Foreground}" />
|
||||
<Setter Property="Margin"
|
||||
Value="14,0" />
|
||||
<Setter Property="VerticalAlignment"
|
||||
Value="Center" />
|
||||
</Style>
|
||||
</TabControl.Resources>
|
||||
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<TextBlock Text="{Binding Resources.Origin,Source={x:Static services:ResourceService.Current}, Mode=OneWay}"
|
||||
Style="{StaticResource TabHeaderTextStyleKey}" />
|
||||
</TabItem.Header>
|
||||
</TabItem>
|
||||
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<TextBlock Text="{Binding Resources.Uplay,Source={x:Static services:ResourceService.Current}, Mode=OneWay}"
|
||||
Style="{StaticResource TabHeaderTextStyleKey}" />
|
||||
</TabItem.Header>
|
||||
|
||||
</TabItem>
|
||||
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<TextBlock Text="{Binding Resources.WinStore,Source={x:Static services:ResourceService.Current}, Mode=OneWay}"
|
||||
Style="{StaticResource TabHeaderTextStyleKey}" />
|
||||
</TabItem.Header>
|
||||
|
||||
</TabItem>
|
||||
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<TextBlock Text="{Binding Resources.GOG,Source={x:Static services:ResourceService.Current}, Mode=OneWay}"
|
||||
Style="{StaticResource TabHeaderTextStyleKey}" />
|
||||
</TabItem.Header>
|
||||
|
||||
</TabItem>
|
||||
|
||||
<TabItem>
|
||||
<TabItem.Header>
|
||||
<TextBlock Text="{Binding Resources.Epic,Source={x:Static services:ResourceService.Current}, Mode=OneWay}"
|
||||
Style="{StaticResource TabHeaderTextStyleKey}" />
|
||||
</TabItem.Header>
|
||||
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using MetroRadiance.UI;
|
||||
|
||||
namespace SteamTools.Views.Pages
|
||||
{
|
||||
/// <summary>
|
||||
/// SteamIdleCardPage.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SteamIdleCardPage : UserControl
|
||||
{
|
||||
public SteamIdleCardPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -59,7 +59,7 @@
|
||||
</Path>
|
||||
</StackPanel>
|
||||
<Separator Opacity="0" Width="20"/>
|
||||
<metro:LinkButton Text="{Binding SteamID,Mode=OneWay}" ToolTip="{Binding Resources.UserChangeTootlip,Source={x:Static services:ResourceService.Current}, Mode=OneWay}" VerticalAlignment="Center" FontSize="24" Width="Auto">
|
||||
<metro:LinkButton Text="{Binding SteamNickName,Mode=OneWay}" ToolTip="{Binding Resources.UserChangeTootlip,Source={x:Static services:ResourceService.Current}, Mode=OneWay}" VerticalAlignment="Center" FontSize="24" Width="Auto">
|
||||
<!--<metro:LinkButton.InputBindings >
|
||||
<MouseBinding Command="{Binding DataContext.SteamIdOnClick,ElementName=u}" MouseAction="LeftClick"></MouseBinding>
|
||||
</metro:LinkButton.InputBindings>-->
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
xmlns:controls="clr-namespace:SteamTools.Views.Controls"
|
||||
mc:Ignorable="d"
|
||||
Width="600"
|
||||
Height="540"
|
||||
Height="550"
|
||||
IsRestoringWindowPlacement="True"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
UseLayoutRounding="True"
|
||||
@@ -144,120 +144,146 @@
|
||||
</Style>
|
||||
</ScrollViewer.Resources>
|
||||
<StackPanel Margin="8">
|
||||
<StackPanel Margin="2">
|
||||
<RadioButton x:Name="ImportWinAuth"
|
||||
<RadioButton x:Name="ImportAuth"
|
||||
GroupName="Import" IsChecked="{Binding IsSpp,Mode=TwoWay}"
|
||||
Content="从Steam++导入" />
|
||||
<StackPanel Margin="20,2,0,0"
|
||||
Grid.IsSharedSizeScope="True">
|
||||
<TextBlock Style="{DynamicResource DetailTextStyleKey}">
|
||||
<Run Text="导入Steam++里导出的令牌数据。" />
|
||||
</TextBlock>
|
||||
<Grid Visibility="{Binding ElementName=ImportAuth,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition SharedSizeGroup="Col0" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition SharedSizeGroup="Col1" />
|
||||
<!--<ColumnDefinition SharedSizeGroup="Col2" />-->
|
||||
</Grid.ColumnDefinitions>
|
||||
<metro:PromptTextBox Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Text="{Binding AuthFileName, Mode=OneWay}"
|
||||
IsEnabled="False"
|
||||
Prompt="选择从Steam++导出的dat令牌数据文件" />
|
||||
<metro2:CallMethodButton Grid.Column="2"
|
||||
Content="选择文件"
|
||||
MethodName="OpenSppAuthFile"
|
||||
Margin="6,0" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<Border Height="8" />
|
||||
<RadioButton x:Name="ImportWinAuth"
|
||||
GroupName="Import" IsChecked="{Binding IsWinAuth,Mode=TwoWay}"
|
||||
Content="从WinAuth导入" />
|
||||
<StackPanel Margin="20,2,0,0"
|
||||
<StackPanel Margin="20,2,0,0"
|
||||
Grid.IsSharedSizeScope="True">
|
||||
<TextBlock Style="{DynamicResource DetailTextStyleKey}">
|
||||
<TextBlock Style="{DynamicResource DetailTextStyleKey}">
|
||||
<Run Text="WinAuth是Windows的便携式开放源代码身份验证器,它提供基于计数器或基于时间的RFC 6238身份验证器和常见的实现。" />
|
||||
<metro2:HyperlinkEx Uri="https://github.com/Jessecar96/SteamDesktopAuthenticator"><Run Text="Github"></Run></metro2:HyperlinkEx>
|
||||
<LineBreak/>
|
||||
<Run Text="导入方法:从WinAuth导出txt文件之后在此选择从WinAuth导出的txt文件进行导入。"></Run>
|
||||
</TextBlock>
|
||||
<Grid Visibility="{Binding ElementName=ImportWinAuth,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition SharedSizeGroup="Col0" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition SharedSizeGroup="Col1" />
|
||||
<!--<ColumnDefinition SharedSizeGroup="Col2" />-->
|
||||
</Grid.ColumnDefinitions>
|
||||
<metro:PromptTextBox Grid.Row="0"
|
||||
</TextBlock>
|
||||
<Grid Visibility="{Binding ElementName=ImportWinAuth,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition SharedSizeGroup="Col0" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition SharedSizeGroup="Col1" />
|
||||
<!--<ColumnDefinition SharedSizeGroup="Col2" />-->
|
||||
</Grid.ColumnDefinitions>
|
||||
<metro:PromptTextBox Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Text="{Binding WinAuthFileName, Mode=OneWay}"
|
||||
IsEnabled="False"
|
||||
Prompt="选择从WinAuth导出的txt文件" />
|
||||
<metro2:CallMethodButton Grid.Column="2"
|
||||
<metro2:CallMethodButton Grid.Column="2"
|
||||
Content="选择文件"
|
||||
MethodName="OpenWinAuthFile"
|
||||
Margin="6,0" />
|
||||
<!--<Button Grid.Column="3" Content="导入"></Button>-->
|
||||
<!--<metro2:CallMethodButton Grid.Column="3"
|
||||
<!--<Button Grid.Column="3" Content="导入"></Button>-->
|
||||
<!--<metro2:CallMethodButton Grid.Column="3"
|
||||
Content="导入"
|
||||
MethodName="ImportWinAuthFile"
|
||||
Margin="0" />-->
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<Border Height="8" />
|
||||
<RadioButton x:Name="ImportSDA"
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<Border Height="8" />
|
||||
<RadioButton x:Name="ImportSDA"
|
||||
GroupName="Import" IsChecked="{Binding IsSDA,Mode=TwoWay}"
|
||||
Content="从Steam Desktop Auth导入" />
|
||||
<StackPanel Margin="20,0,0,0"
|
||||
<StackPanel Margin="20,0,0,0"
|
||||
Grid.IsSharedSizeScope="True">
|
||||
<StackPanel.Resources>
|
||||
<Style TargetType="{x:Type metro:PromptTextBox}">
|
||||
<Setter Property="Margin"
|
||||
<StackPanel.Resources>
|
||||
<Style TargetType="{x:Type metro:PromptTextBox}">
|
||||
<Setter Property="Margin"
|
||||
Value="0,3" />
|
||||
</Style>
|
||||
</StackPanel.Resources>
|
||||
<TextBlock Style="{DynamicResource DetailTextStyleKey}"
|
||||
</Style>
|
||||
</StackPanel.Resources>
|
||||
<TextBlock Style="{DynamicResource DetailTextStyleKey}"
|
||||
Margin="0,2">
|
||||
<Run Text="Steam的移动身份验证器应用程序的桌面实现。" />
|
||||
<metro2:HyperlinkEx Uri="https://github.com/Jessecar96/SteamDesktopAuthenticator"><Run Text="Github"></Run></metro2:HyperlinkEx>
|
||||
<LineBreak/>
|
||||
<Run Text="导入方法:选择SDA目录下maFiles文件夹的maFile文件进行导入。(不支持导入加密文件)" />
|
||||
</TextBlock>
|
||||
<Grid Visibility="{Binding ElementName=ImportSDA,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition SharedSizeGroup="Col0" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition SharedSizeGroup="Col1" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<metro:PromptTextBox Grid.Row="0"
|
||||
</TextBlock>
|
||||
<Grid Visibility="{Binding ElementName=ImportSDA,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition SharedSizeGroup="Col0" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition SharedSizeGroup="Col1" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<metro:PromptTextBox Grid.Row="0"
|
||||
Grid.Column="0" Grid.ColumnSpan="2"
|
||||
Text="{Binding SDAFile, Mode=OneWay}"
|
||||
Prompt="选择*.maFile文件" />
|
||||
<metro2:CallMethodButton Grid.Row="0" Grid.Column="2"
|
||||
<metro2:CallMethodButton Grid.Row="0" Grid.Column="2"
|
||||
Content="选择文件" Height="30"
|
||||
MethodName="OpenSDAFile"
|
||||
Margin="6,0,0,0" />
|
||||
<metro:PromptTextBox Grid.Row="1"
|
||||
<metro:PromptTextBox Grid.Row="1"
|
||||
Grid.Column="0" Grid.ColumnSpan="3"
|
||||
Text="{Binding SDAPassword, Mode=TwoWay}"
|
||||
Prompt="如果设定了密码请输入密码" Visibility="Collapsed" />
|
||||
<!--<metro2:CallMethodButton Grid.Column="2" Grid.Row="1"
|
||||
<!--<metro2:CallMethodButton Grid.Column="2" Grid.Row="1"
|
||||
Content="导入"
|
||||
MethodName="ImportWinAuthFile"
|
||||
Margin="6,0" />-->
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<Border Height="8" />
|
||||
<RadioButton x:Name="ImportSteamApp"
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
<Border Height="8" />
|
||||
<RadioButton x:Name="ImportSteamApp"
|
||||
GroupName="Import" IsChecked="{Binding IsSteamApp,Mode=TwoWay}"
|
||||
Content="从Android App导入" />
|
||||
<StackPanel Margin="20,2,0,0"
|
||||
<StackPanel Margin="20,2,0,0"
|
||||
Grid.IsSharedSizeScope="True">
|
||||
<TextBlock Style="{DynamicResource DetailTextStyleKey}">
|
||||
<TextBlock Style="{DynamicResource DetailTextStyleKey}">
|
||||
<Run Text="您可以从已root的Android设备中导入您的SteamGuard身份验证器" />
|
||||
<LineBreak />
|
||||
<Run Text="路径: /data/data/com.valvesoftware.android.steam.community"></Run>
|
||||
<LineBreak />
|
||||
<Run Text="然后将以下两个文件的内容复制到下面的对应输入框中"/>
|
||||
</TextBlock>
|
||||
<StackPanel Visibility="{Binding ElementName=ImportSteamApp,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<metro:PromptTextBox Margin="0,5,0,0" Grid.Row="1"
|
||||
</TextBlock>
|
||||
<StackPanel Visibility="{Binding ElementName=ImportSteamApp,Path=IsChecked, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<metro:PromptTextBox Margin="0,5,0,0" Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Text="{Binding AuthName, Mode=TwoWay}"
|
||||
Prompt="输入令牌的自定义名称" />
|
||||
<TextBlock Grid.Row="0" Grid.Column="0">
|
||||
<TextBlock Grid.Row="0" Grid.Column="0">
|
||||
<Run Text="从shared_prefs文件夹中,粘贴'steam_uuid.xml'的uuidKey" />
|
||||
<LineBreak/>
|
||||
<Run Text="格式:android:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" />
|
||||
</TextBlock>
|
||||
<metro:PromptTextBox Grid.Row="0"
|
||||
</TextBlock>
|
||||
<metro:PromptTextBox Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Text="{Binding UUID, Mode=TwoWay}"
|
||||
Prompt="" />
|
||||
|
||||
<TextBlock Grid.Row="1" Grid.Column="0">
|
||||
<Run Text="从文件文件夹中,粘贴'SteamGuard-NNNNNNNN'的全部内容" />
|
||||
</TextBlock>
|
||||
<metro:PromptTextBox Grid.Row="1"
|
||||
<TextBlock Grid.Row="1" Grid.Column="0">
|
||||
<Run Text="从files文件夹中,粘贴'SteamGuard-NNNNNNNN'的全部内容" />
|
||||
</TextBlock>
|
||||
<metro:PromptTextBox Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
TextWrapping="Wrap"
|
||||
AcceptsReturn="True"
|
||||
@@ -265,30 +291,28 @@
|
||||
MaxLines="3"
|
||||
Text="{Binding SteamGuard, Mode=TwoWay}"
|
||||
Prompt="" />
|
||||
<!--<metro2:CallMethodButton Width="80"
|
||||
<!--<metro2:CallMethodButton Width="80"
|
||||
Content="导入"
|
||||
HorizontalAlignment="Right"
|
||||
MethodName="ImportSteamGuard"
|
||||
Margin="6" />-->
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<Border Height="8" />
|
||||
<Border Height="8" />
|
||||
<StackPanel Orientation="Horizontal"
|
||||
</StackPanel>
|
||||
<Border Height="8" />
|
||||
<Border Height="8" />
|
||||
<StackPanel Orientation="Horizontal"
|
||||
HorizontalAlignment="Right">
|
||||
<metro2:CallMethodButton MethodTarget="{Binding}"
|
||||
<metro2:CallMethodButton MethodTarget="{Binding}"
|
||||
MethodName="Apply"
|
||||
Content="确认导入"
|
||||
MinWidth="110"
|
||||
Padding="16,6" />
|
||||
<Border Width="8" />
|
||||
<!--<metro2:CallMethodButton MethodTarget="{Binding}"
|
||||
<Border Width="8" />
|
||||
<!--<metro2:CallMethodButton MethodTarget="{Binding}"
|
||||
MethodName="Cancel"
|
||||
Content="取消"
|
||||
MinWidth="110"
|
||||
Padding="16,6" />-->
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
Foreground="{DynamicResource ActiveForegroundBrushKey}"
|
||||
FontFamily="{StaticResource DefaultFontFamilyKey}"
|
||||
FontSize="16"
|
||||
ResizeMode="NoResize"
|
||||
UseLayoutRounding="True"
|
||||
TextOptions.TextFormattingMode="Display"
|
||||
SnapsToDevicePixels="True"
|
||||
@@ -56,6 +55,7 @@
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<!--Title-->
|
||||
<Border Grid.Row="0"
|
||||
@@ -86,12 +86,12 @@
|
||||
</Border>
|
||||
|
||||
<!--Body-->
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid Margin="0,8,0,0">
|
||||
|
||||
|
||||
</Grid>
|
||||
<Grid Margin="0,8,0,0" Grid.Row="1">
|
||||
<WebBrowser x:Name="web" LoadCompleted="web_LoadCompleted" Navigated="web_Navigated"/>
|
||||
</Grid>
|
||||
|
||||
<!--Footer-->
|
||||
<controls:StatusBar Grid.Row="2" DataContext="{Binding StatusBar}">
|
||||
</controls:StatusBar>
|
||||
</Grid>
|
||||
</metro:MetroWindow>
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
using SteamTools.Models;
|
||||
using SteamTool.Model;
|
||||
using SteamTools.Models;
|
||||
using SteamTools.Services;
|
||||
using SteamTools.ViewModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
@@ -19,10 +22,45 @@ namespace SteamTools
|
||||
{
|
||||
public partial class AuthTradeWindow
|
||||
{
|
||||
private AuthTradeWindowViewModel ViewModel => this.DataContext as AuthTradeWindowViewModel;
|
||||
|
||||
public AuthTradeWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
App.Current.MainWindow.Closed += (sender, args) => this.Close();
|
||||
|
||||
web.Navigate(new Uri(Const.STEAM_LOGIN_URL));
|
||||
}
|
||||
|
||||
public void SuppressScriptErrors(WebBrowser webBrowser, bool Hide)
|
||||
{
|
||||
FieldInfo fiComWebBrowser = typeof(WebBrowser).GetField("_axIWebBrowser2", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
if (fiComWebBrowser == null) return;
|
||||
|
||||
object objComWebBrowser = fiComWebBrowser.GetValue(webBrowser);
|
||||
if (objComWebBrowser == null) return;
|
||||
|
||||
objComWebBrowser.GetType().InvokeMember("Silent", BindingFlags.SetProperty, null, objComWebBrowser, new object[] { Hide });
|
||||
}
|
||||
|
||||
private void web_Navigated(object sender, System.Windows.Navigation.NavigationEventArgs e)
|
||||
{
|
||||
var url = web.Source.AbsoluteUri;
|
||||
SuppressScriptErrors(web, true);
|
||||
if (url.StartsWith("https://steamcommunity.com/id/") == true)
|
||||
{
|
||||
ViewModel.ExtractSteamCookies();
|
||||
}
|
||||
}
|
||||
|
||||
private void web_LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs e)
|
||||
{
|
||||
var url = web.Source.AbsoluteUri;
|
||||
if (url.StartsWith("https://steamcommunity.com/login/home/?goto=my/profile"))
|
||||
{
|
||||
web.InvokeScript("eval", new object[] { "function V_SetCookie() {} function V_GetCookie() {}" });
|
||||
web.InvokeScript("LoginUsingSteamClient", new object[] { "https://steamcommunity.com/" });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
Foreground="{DynamicResource ActiveForegroundBrushKey}"
|
||||
FontFamily="{StaticResource DefaultFontFamilyKey}"
|
||||
FontSize="16"
|
||||
ResizeMode="NoResize"
|
||||
UseLayoutRounding="True"
|
||||
TextOptions.TextFormattingMode="Display"
|
||||
SnapsToDevicePixels="True"
|
||||
|
||||
+119
-64
@@ -1,79 +1,134 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME;
|
||||
|
||||
namespace SteamTools.Win32
|
||||
{
|
||||
internal class WinInet
|
||||
{
|
||||
// For PInvoke: Initiates the enumeration of the cache groups in the Internet cache
|
||||
[DllImport(@"wininet",
|
||||
SetLastError = true,
|
||||
CharSet = CharSet.Auto,
|
||||
EntryPoint = "FindFirstUrlCacheGroup",
|
||||
CallingConvention = CallingConvention.StdCall)]
|
||||
public static extern IntPtr FindFirstUrlCacheGroup(
|
||||
int dwFlags,
|
||||
int dwFilter,
|
||||
IntPtr lpSearchCondition,
|
||||
int dwSearchCondition,
|
||||
ref long lpGroupId,
|
||||
IntPtr lpReserved);
|
||||
internal class WinInet
|
||||
{
|
||||
// For PInvoke: Initiates the enumeration of the cache groups in the Internet cache
|
||||
[DllImport(@"wininet",
|
||||
SetLastError = true,
|
||||
CharSet = CharSet.Auto,
|
||||
EntryPoint = "FindFirstUrlCacheGroup",
|
||||
CallingConvention = CallingConvention.StdCall)]
|
||||
public static extern IntPtr FindFirstUrlCacheGroup(
|
||||
int dwFlags,
|
||||
int dwFilter,
|
||||
IntPtr lpSearchCondition,
|
||||
int dwSearchCondition,
|
||||
ref long lpGroupId,
|
||||
IntPtr lpReserved);
|
||||
|
||||
// For PInvoke: Retrieves the next cache group in a cache group enumeration
|
||||
[DllImport(@"wininet",
|
||||
SetLastError = true,
|
||||
CharSet = CharSet.Auto,
|
||||
EntryPoint = "FindNextUrlCacheGroup",
|
||||
CallingConvention = CallingConvention.StdCall)]
|
||||
public static extern bool FindNextUrlCacheGroup(
|
||||
IntPtr hFind,
|
||||
ref long lpGroupId,
|
||||
IntPtr lpReserved);
|
||||
// For PInvoke: Retrieves the next cache group in a cache group enumeration
|
||||
[DllImport(@"wininet",
|
||||
SetLastError = true,
|
||||
CharSet = CharSet.Auto,
|
||||
EntryPoint = "FindNextUrlCacheGroup",
|
||||
CallingConvention = CallingConvention.StdCall)]
|
||||
public static extern bool FindNextUrlCacheGroup(
|
||||
IntPtr hFind,
|
||||
ref long lpGroupId,
|
||||
IntPtr lpReserved);
|
||||
|
||||
// For PInvoke: Releases the specified GROUPID and any associated state in the cache index file
|
||||
[DllImport(@"wininet",
|
||||
SetLastError = true,
|
||||
CharSet = CharSet.Auto,
|
||||
EntryPoint = "DeleteUrlCacheGroup",
|
||||
CallingConvention = CallingConvention.StdCall)]
|
||||
public static extern bool DeleteUrlCacheGroup(
|
||||
long groupId,
|
||||
int dwFlags,
|
||||
IntPtr lpReserved);
|
||||
// For PInvoke: Releases the specified GROUPID and any associated state in the cache index file
|
||||
[DllImport(@"wininet",
|
||||
SetLastError = true,
|
||||
CharSet = CharSet.Auto,
|
||||
EntryPoint = "DeleteUrlCacheGroup",
|
||||
CallingConvention = CallingConvention.StdCall)]
|
||||
public static extern bool DeleteUrlCacheGroup(
|
||||
long groupId,
|
||||
int dwFlags,
|
||||
IntPtr lpReserved);
|
||||
|
||||
// For PInvoke: Begins the enumeration of the Internet cache
|
||||
[DllImport(@"wininet",
|
||||
SetLastError = true,
|
||||
CharSet = CharSet.Auto,
|
||||
EntryPoint = "FindFirstUrlCacheEntryA",
|
||||
CallingConvention = CallingConvention.StdCall)]
|
||||
public static extern IntPtr FindFirstUrlCacheEntry(
|
||||
[MarshalAs(UnmanagedType.LPTStr)] string lpszUrlSearchPattern,
|
||||
IntPtr lpFirstCacheEntryInfo,
|
||||
ref int lpdwFirstCacheEntryInfoBufferSize);
|
||||
// For PInvoke: Begins the enumeration of the Internet cache
|
||||
[DllImport(@"wininet",
|
||||
SetLastError = true,
|
||||
CharSet = CharSet.Auto,
|
||||
EntryPoint = "FindFirstUrlCacheEntryA",
|
||||
CallingConvention = CallingConvention.StdCall)]
|
||||
public static extern IntPtr FindFirstUrlCacheEntry(
|
||||
[MarshalAs(UnmanagedType.LPTStr)] string lpszUrlSearchPattern,
|
||||
IntPtr lpFirstCacheEntryInfo,
|
||||
ref int lpdwFirstCacheEntryInfoBufferSize);
|
||||
|
||||
// For PInvoke: Retrieves the next entry in the Internet cache
|
||||
[DllImport(@"wininet",
|
||||
SetLastError = true,
|
||||
CharSet = CharSet.Auto,
|
||||
EntryPoint = "FindNextUrlCacheEntryA",
|
||||
CallingConvention = CallingConvention.StdCall)]
|
||||
public static extern bool FindNextUrlCacheEntry(
|
||||
IntPtr hFind,
|
||||
IntPtr lpNextCacheEntryInfo,
|
||||
ref int lpdwNextCacheEntryInfoBufferSize);
|
||||
// For PInvoke: Retrieves the next entry in the Internet cache
|
||||
[DllImport(@"wininet",
|
||||
SetLastError = true,
|
||||
CharSet = CharSet.Auto,
|
||||
EntryPoint = "FindNextUrlCacheEntryA",
|
||||
CallingConvention = CallingConvention.StdCall)]
|
||||
public static extern bool FindNextUrlCacheEntry(
|
||||
IntPtr hFind,
|
||||
IntPtr lpNextCacheEntryInfo,
|
||||
ref int lpdwNextCacheEntryInfoBufferSize);
|
||||
|
||||
// For PInvoke: Removes the file that is associated with the source name from the cache, if the file exists
|
||||
[DllImport(@"wininet",
|
||||
SetLastError = true,
|
||||
CharSet = CharSet.Auto,
|
||||
EntryPoint = "DeleteUrlCacheEntryA",
|
||||
CallingConvention = CallingConvention.StdCall)]
|
||||
public static extern bool DeleteUrlCacheEntry(
|
||||
IntPtr lpszUrlName);
|
||||
}
|
||||
// For PInvoke: Removes the file that is associated with the source name from the cache, if the file exists
|
||||
[DllImport(@"wininet",
|
||||
SetLastError = true,
|
||||
CharSet = CharSet.Auto,
|
||||
EntryPoint = "DeleteUrlCacheEntryA",
|
||||
CallingConvention = CallingConvention.StdCall)]
|
||||
public static extern bool DeleteUrlCacheEntry(
|
||||
IntPtr lpszUrlName);
|
||||
|
||||
|
||||
[DllImport("wininet.dll",
|
||||
SetLastError = true,
|
||||
CharSet = CharSet.Auto,
|
||||
EntryPoint = "InternetGetCookieEx",
|
||||
CallingConvention = CallingConvention.StdCall)]
|
||||
public static extern bool InternetGetCookieEx(
|
||||
string url,
|
||||
string cookieName,
|
||||
StringBuilder cookieData,
|
||||
ref int size,
|
||||
int dwFlags,
|
||||
IntPtr lpReserved);
|
||||
|
||||
//Read HTTP Only
|
||||
private const int InternetCookieHttponly = 0x2000;
|
||||
|
||||
public static CookieContainer GetUriCookieContainer(Uri uri)
|
||||
{
|
||||
// First, create a null cookie container
|
||||
CookieContainer cookies = null;
|
||||
|
||||
// Determine the size of the cookie
|
||||
var datasize = 8192 * 16;
|
||||
var cookieData = new StringBuilder(datasize);
|
||||
|
||||
// Call InternetGetCookieEx from wininet.dll
|
||||
if (!WinInet.InternetGetCookieEx(uri.ToString(), null, cookieData, ref datasize, InternetCookieHttponly, IntPtr.Zero))
|
||||
{
|
||||
if (datasize < 0)
|
||||
return null;
|
||||
// Allocate stringbuilder large enough to hold the cookie
|
||||
cookieData = new StringBuilder(datasize);
|
||||
if (!InternetGetCookieEx(
|
||||
uri.ToString(),
|
||||
null, cookieData,
|
||||
ref datasize,
|
||||
InternetCookieHttponly,
|
||||
IntPtr.Zero))
|
||||
return null;
|
||||
}
|
||||
|
||||
// If the cookie contains data, add it to the cookie container
|
||||
if (cookieData.Length > 0)
|
||||
{
|
||||
cookies = new CookieContainer();
|
||||
cookies.SetCookies(uri, cookieData.ToString().Replace(';', ','));
|
||||
}
|
||||
|
||||
// Return the cookie container
|
||||
return cookies;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+38
-24
@@ -8,31 +8,44 @@ Steam++只在keylol论坛与github发布,为了账号安全,请不要到其
|
||||
|
||||
|
||||
## 已知的未修复问题
|
||||
|
||||
|
||||
|
||||
|
||||
* (严重)经反馈,程序运行时可能会影响部分steam游戏掉帧,GPU占用率变低,这个BUG目前在作者的机器上无法复现所以暂时没有修复,如果你遇到这个问题可以手动关闭steam++解决。
|
||||
* 程序在高DPI缩放分辨率下可能会UI布局错位,目前暂时拖动程序可恢复。
|
||||
* 部分用户无法加载游戏列表,无法复现,原因暂时不明。
|
||||
* 部分用户无法加载游戏列表,原因可能是因为第一次加载游戏列表时未加载完成程序停止运行了,导致生成了错误的缓存文件apps.json,如果遇到此问题可尝试手动删除程序目录下的apps.json然后重启程序。
|
||||
|
||||
|
||||
## 更新内容
|
||||
|
||||
### 1.0.3.3
|
||||
一直在修BUG,下个版本开始要做新功能了。
|
||||
```
|
||||
新增pixiv本地反代服务支持
|
||||
新增在欢迎页steam昵称后显示steam的登陆区域
|
||||
添加steam图片修复的本地反代支持
|
||||
修复最小化恢复时UI边框错位的BUG
|
||||
修复令牌编辑和导入时出现的非空报错
|
||||
帐户切换功能的最近登陆时间从北京时间改为当前系统时区时间
|
||||
修复一个因为DNS解析错误会导致程序内存溢出闪退的BUG
|
||||
SDA令牌导入不再支持导入加密文件,如果要导入加密的maFile请先在SDA移除加密
|
||||
修改初始化的方式和steam api的连接逻辑来避免steam游戏掉帧的BUG
|
||||
解决程序最小化启动时弹窗报错
|
||||
优化本地令牌的加载
|
||||
修复托盘图标单击启动多个窗口
|
||||
修复设置界面设置UI错位
|
||||
修复成就窗口关闭游戏依然运行
|
||||
修改steam社区商店图片代理上游地址为steampowered.com
|
||||
```
|
||||
|
||||
### 1.0.2
|
||||
|
||||
```
|
||||
更新了由Benares制作的图标
|
||||
新增帐户切换删除功能
|
||||
添加github图片资源文件代理服务与discord代理服务支持
|
||||
因为有问题暂时去掉了GOG Galaxy代理选项
|
||||
修复一个会导致程序启动没有反应的bug
|
||||
修复托盘菜单steam昵称过长ui错位bug
|
||||
新增steam启动参数设置
|
||||
新增启动时程序最小化到托盘菜单设置
|
||||
新增捐助列表的展示
|
||||
新增工具自动更新功能
|
||||
更新了由Benares制作的图标
|
||||
新增帐户切换删除功能
|
||||
添加github图片资源文件代理服务与discord代理服务支持
|
||||
因为有问题暂时去掉了GOG Galaxy代理选项
|
||||
修复一个会导致程序启动没有反应的bug
|
||||
修复托盘菜单steam昵称过长ui错位bug
|
||||
新增steam启动参数设置
|
||||
新增启动时程序最小化到托盘菜单设置
|
||||
新增捐助列表的展示
|
||||
新增工具自动更新功能
|
||||
```
|
||||
|
||||
## 工具介绍
|
||||
@@ -40,8 +53,7 @@ Steam++只在keylol论坛与github发布,为了账号安全,请不要到其
|
||||
`Steam++`是一个包含多种Steam工具功能的工具箱,开源发布于[Github](https://github.com/rmbadmin/SteamTools),如果您对发布的二进制文件不放心,可以自行下载源码编译运行。
|
||||
此工具的大部分功能都是需要您下载安装Steam才能使用。
|
||||
工具预计将整合进大部分常用的Steam相关工具,并且尽力做到比原工具更好用,在各种整合添加功能的同时,也会注意体积尽量的控制到最小。
|
||||
查毒链接[https://www.virustotal.com/gui/file/3889babb8b0dcf79b16045679a5cb57a70cc6d60447078fb65b8a8979da2f14d/detection](https://www.virustotal.com/gui/file/3889babb8b0dcf79b16045679a5cb57a70cc6d60447078fb65b8a8979da2f14d/detection)
|
||||
虽然没有什么杀毒软件报毒,但是使用过程中可能遇到windows defender误报,您可以选择添加信任。
|
||||
|
||||
软件截图
|
||||
[hide]
|
||||
[attachimg]1228394[/attachimg]
|
||||
@@ -116,9 +128,11 @@ Steam++只在keylol论坛与github发布,为了账号安全,请不要到其
|
||||
> [Github](https://github.com/rmbadmin/SteamTools/releases)
|
||||
> 分流下载:
|
||||
> [hide]
|
||||
> [蓝奏云](https://wws.lanzous.com/ihW80jkylcb)
|
||||
> [百度云](https://pan.baidu.com/s/1um0YboiVGZTs4rC6uCCa1g)
|
||||
> 提取码:pz3t
|
||||
> [蓝奏云](https://wws.lanzous.com/iqrxLjrm2kf)
|
||||
> [百度云](https://pan.baidu.com/s/1yCimLO0HvptR0OOgpZVBCQ)
|
||||
> 提取码:7h66
|
||||
> [/hide]
|
||||
> EXE 大小:4.85MB
|
||||
> MD5:F819FEAA3463E0B9DED7E94AB87088B0
|
||||
> EXE 大小:4.75MB
|
||||
> MD5:BF6B5196FD95C8D689BA75243FBF8C96
|
||||
> [查毒链接](https://www.virustotal.com/gui/file/1073fc19c3208228b1a00eb9bceab771cbf77ffbf1a6c2de666a0e9a4967db60/detection)
|
||||
虽然没有什么杀毒软件报毒,但是使用过程中可能遇到windows defender误报,您可以选择添加信任。
|
||||
Reference in New Issue
Block a user