Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
SteamTools
提交
540dfbc2
S
SteamTools
项目概览
jobily
/
SteamTools
9 个月 前同步成功
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SteamTools
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
540dfbc2
编写于
7月 28, 2023
作者:
J
john.jiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
🎨
令牌插件代码多余空格取出,WinAuth子模块更新
上级
5d35de8f
变更
34
隐藏空白更改
内联
并排
Showing
34 changed file
with
151 addition
and
140 deletion
+151
-140
ref/WinAuth
ref/WinAuth
+1
-1
src/BD.WTTS.Client.Plugins.Authenticator/Models/Abstractions/IAuthenticatorImport.cs
...Authenticator/Models/Abstractions/IAuthenticatorImport.cs
+2
-2
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthImportFileModels/ImportFileModelJsonContext.cs
...Models/AuthImportFileModels/ImportFileModelJsonContext.cs
+1
-1
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthImportFileModels/SDAFileModel.cs
...Authenticator/Models/AuthImportFileModels/SDAFileModel.cs
+22
-22
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthImportFileModels/SteamGuardModel.cs
...henticator/Models/AuthImportFileModels/SteamGuardModel.cs
+1
-1
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorFileImportBase.cs
...ugins.Authenticator/Models/AuthenticatorFileImportBase.cs
+5
-5
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorGeneralImportBase.cs
...ns.Authenticator/Models/AuthenticatorGeneralImportBase.cs
+3
-3
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorGoogleGeneralImport.cs
....Authenticator/Models/AuthenticatorGoogleGeneralImport.cs
+4
-4
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorHOTPGeneralImport.cs
...ns.Authenticator/Models/AuthenticatorHOTPGeneralImport.cs
+3
-3
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorImportBase.cs
...t.Plugins.Authenticator/Models/AuthenticatorImportBase.cs
+5
-5
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorItemModel.cs
...nt.Plugins.Authenticator/Models/AuthenticatorItemModel.cs
+3
-3
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorItemModel.props.cs
...gins.Authenticator/Models/AuthenticatorItemModel.props.cs
+1
-1
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorMicrosoftGeneralImport.cs
...thenticator/Models/AuthenticatorMicrosoftGeneralImport.cs
+3
-3
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorRecoverModel.cs
...Plugins.Authenticator/Models/AuthenticatorRecoverModel.cs
+1
-1
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorSdaFileImport.cs
...lugins.Authenticator/Models/AuthenticatorSdaFileImport.cs
+8
-6
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorSteamLoginImport.cs
...ins.Authenticator/Models/AuthenticatorSteamLoginImport.cs
+1
-1
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorWattToolKitV1Import.cs
....Authenticator/Models/AuthenticatorWattToolKitV1Import.cs
+2
-2
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorWattToolKitV2Import.cs
....Authenticator/Models/AuthenticatorWattToolKitV2Import.cs
+4
-4
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorWinAuthFileImport.cs
...ns.Authenticator/Models/AuthenticatorWinAuthFileImport.cs
+5
-5
src/BD.WTTS.Client.Plugins.Authenticator/Models/SteamTradeConfirmationModel.cs
...ugins.Authenticator/Models/SteamTradeConfirmationModel.cs
+11
-11
src/BD.WTTS.Client.Plugins.Authenticator/Repositories/AccountPlatformAuthenticatorRepository.cs
...or/Repositories/AccountPlatformAuthenticatorRepository.cs
+1
-1
src/BD.WTTS.Client.Plugins.Authenticator/Services/AuthenticatorService.cs
...nt.Plugins.Authenticator/Services/AuthenticatorService.cs
+9
-8
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/AuthenticatorExportViewModel.cs
...thenticator/UI/ViewModels/AuthenticatorExportViewModel.cs
+2
-2
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/AuthenticatorGeneralImportPageViewModel.cs
.../UI/ViewModels/AuthenticatorGeneralImportPageViewModel.cs
+4
-4
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/AuthenticatorImportPageViewModel.cs
...ticator/UI/ViewModels/AuthenticatorImportPageViewModel.cs
+2
-2
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/AuthenticatorPageViewModel.cs
...Authenticator/UI/ViewModels/AuthenticatorPageViewModel.cs
+16
-12
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/AuthenticatorRecoverPageViewModel.cs
...icator/UI/ViewModels/AuthenticatorRecoverPageViewModel.cs
+2
-1
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/AuthenticatorSteamGuardViewModel.cs
...ticator/UI/ViewModels/AuthenticatorSteamGuardViewModel.cs
+10
-5
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/ShowSteamDataViewModel.cs
...ins.Authenticator/UI/ViewModels/ShowSteamDataViewModel.cs
+1
-2
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/SteamLoginImportViewModel.cs
....Authenticator/UI/ViewModels/SteamLoginImportViewModel.cs
+15
-15
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/SteamLoginImportViewModel.props.cs
...nticator/UI/ViewModels/SteamLoginImportViewModel.props.cs
+1
-1
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/SteamTradePageViewModel.cs
...ns.Authenticator/UI/ViewModels/SteamTradePageViewModel.cs
+1
-1
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/SteamTradePageViewModel.props.cs
...henticator/UI/ViewModels/SteamTradePageViewModel.props.cs
+0
-1
src/BD.WTTS.Client.Plugins.Authenticator/UI/Views/Pages/SteamTradePage.axaml.cs
...gins.Authenticator/UI/Views/Pages/SteamTradePage.axaml.cs
+1
-1
未找到文件。
WinAuth
@
b2ee8199
比较
19d34141
...
b2ee8199
Subproject commit
19d3414133184c1981a3094aa7360b6cc624b3ee
Subproject commit
b2ee8199c6a3488c31077dae86c72a9c8e8d0dab
src/BD.WTTS.Client.Plugins.Authenticator/Models/Abstractions/IAuthenticatorImport.cs
浏览文件 @
540dfbc2
...
...
@@ -9,8 +9,8 @@ public interface IAuthenticatorImport
public
ResIcon
IconName
{
get
;
}
public
ICommand
AuthenticatorImportCommand
{
get
;
set
;
}
Task
<
bool
>
VerifyMaxValue
();
Task
SaveAuthenticator
(
IAuthenticatorDTO
authenticatorDto
);
}
\ No newline at end of file
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthImportFileModels/ImportFileModelJsonContext.cs
浏览文件 @
540dfbc2
...
...
@@ -5,5 +5,5 @@ namespace BD.WTTS.Models;
[
JsonSerializable
(
typeof
(
SdaFileConvertToSteamDataModel
))]
public
partial
class
ImportFileModelJsonContext
:
JsonSerializerContext
{
}
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthImportFileModels/SDAFileModel.cs
浏览文件 @
540dfbc2
...
...
@@ -7,37 +7,37 @@ public class SdaFileModel
[
JsonPropertyName
(
"serial_number"
)]
public
string
SerialNumber
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"revocation_code"
)]
public
string
RevocationCode
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"uri"
)]
public
string
Uri
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"server_time"
)]
public
string
ServerTime
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"account_name"
)]
public
string
AccountName
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"token_gid"
)]
public
string
TokenGid
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"identity_secret"
)]
public
string
IdentitySecret
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"secret_1"
)]
public
string
Secret1
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"status"
)]
public
int
Status
{
get
;
set
;
}
[
JsonPropertyName
(
"device_id"
)]
public
string
DeviceId
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"fully_enrolled"
)]
public
bool
FullyEnrolled
{
get
;
set
;
}
[
JsonPropertyName
(
"Session"
)]
public
Session
?
Session
{
get
;
set
;
}
}
...
...
@@ -49,28 +49,28 @@ public class SdaFileConvertToSteamDataModel
[
JsonPropertyName
(
"serial_number"
)]
public
string
SerialNumber
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"revocation_code"
)]
public
string
RevocationCode
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"uri"
)]
public
string
Uri
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"server_time"
)]
public
string
ServerTime
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"account_name"
)]
public
string
AccountName
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"token_gid"
)]
public
string
TokenGid
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"identity_secret"
)]
public
string
IdentitySecret
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"secret_1"
)]
public
string
Secret1
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"status"
)]
public
int
Status
{
get
;
set
;
}
...
...
@@ -93,19 +93,19 @@ public class Session
{
[
JsonPropertyName
(
"SessionID"
)]
public
string
SessionId
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"SteamLogin"
)]
public
string
SteamLogin
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"SteamLoginSecure"
)]
public
string
SteamLoginSecure
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"WebCookie"
)]
public
string
WebCookie
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"OAuthToken"
)]
public
string
OAuthToken
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"SteamID"
)]
public
long
SteamId
{
get
;
set
;
}
}
...
...
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthImportFileModels/SteamGuardModel.cs
浏览文件 @
540dfbc2
...
...
@@ -2,7 +2,7 @@ namespace BD.WTTS.Models;
public
class
SteamGuardModel
{
[
JsonPropertyName
(
"shared_secret"
)]
[
JsonPropertyName
(
"shared_secret"
)]
public
string
SharedSecret
{
get
;
set
;
}
=
string
.
Empty
;
[
JsonPropertyName
(
"serial_number"
)]
...
...
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorFileImportBase.cs
浏览文件 @
540dfbc2
...
...
@@ -5,11 +5,11 @@ namespace BD.WTTS.Models;
public
abstract
class
AuthenticatorFileImportBase
:
AuthenticatorImportBase
{
public
abstract
override
string
Name
{
get
;
}
public
abstract
override
string
Description
{
get
;
}
protected
abstract
string
?
FileExtension
{
get
;
}
public
abstract
override
ICommand
AuthenticatorImportCommand
{
get
;
set
;
}
protected
async
Task
<
string
?>
SelectFolderPath
()
...
...
@@ -28,11 +28,11 @@ public abstract class AuthenticatorFileImportBase : AuthenticatorImportBase
options
.
FileTypes
=
fileTypes
;
return
await
FilePicker2
.
PickAsync
(
options
);
}
protected
bool
ReadXml
(
ref
AuthenticatorDTO
authenticatorDto
,
XmlReader
reader
,
string
?
password
)
{
bool
changed
=
false
;
var
authenticatorType
=
reader
.
GetAttribute
(
"type"
);
switch
(
authenticatorType
)
{
...
...
@@ -121,7 +121,7 @@ public abstract class AuthenticatorFileImportBase : AuthenticatorImportBase
return
changed
;
}
protected
IEnumerable
<
string
>
ReadUrlsByFilePath
(
string
filePath
)
{
StringBuilder
lines
=
new
();
...
...
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorGeneralImportBase.cs
浏览文件 @
540dfbc2
...
...
@@ -3,11 +3,11 @@ namespace BD.WTTS.Models;
public
abstract
class
AuthenticatorGeneralImportBase
:
AuthenticatorImportBase
{
public
abstract
override
string
Name
{
get
;
}
public
abstract
override
string
Description
{
get
;
}
public
abstract
override
ResIcon
IconName
{
get
;
}
public
abstract
override
ICommand
AuthenticatorImportCommand
{
get
;
set
;
}
protected
abstract
Task
<
IAuthenticatorValueDTO
?>
CreateAuthenticatorValueDto
(
string
secretCode
);
...
...
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorGoogleGeneralImport.cs
浏览文件 @
540dfbc2
...
...
@@ -10,9 +10,9 @@ public class AuthenticatorGoogleGeneralImport : AuthenticatorGeneralImportBase
public
override
string
Description
=>
Strings
.
LocalAuth_GoogleImport
;
public
override
ResIcon
IconName
=>
ResIcon
.
Attach
;
public
sealed
override
ICommand
AuthenticatorImportCommand
{
get
;
set
;
}
public
AuthenticatorGoogleGeneralImport
()
{
AuthenticatorImportCommand
=
ReactiveCommand
.
Create
(
async
()
=>
...
...
@@ -24,7 +24,7 @@ public class AuthenticatorGoogleGeneralImport : AuthenticatorGeneralImportBase
pageContent
:
new
AuthenticatorGeneralImportPage
(),
isOkButton
:
false
);
});
}
protected
override
async
Task
<
IAuthenticatorValueDTO
?>
CreateAuthenticatorValueDto
(
string
secretCode
)
{
try
...
...
@@ -36,7 +36,7 @@ public class AuthenticatorGoogleGeneralImport : AuthenticatorGeneralImportBase
Toast
.
Show
(
ToastIcon
.
Error
,
Strings
.
LocalAuth_Import_DecodePrivateKeyError
.
Format
(
"Google"
));
return
null
;
}
var
auth
=
new
GoogleAuthenticator
();
auth
.
Enroll
(
privateKey
);
...
...
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorHOTPGeneralImport.cs
浏览文件 @
540dfbc2
...
...
@@ -10,7 +10,7 @@ public class AuthenticatorHOTPGeneralImport : AuthenticatorGeneralImportBase
public
override
string
Description
=>
Strings
.
LocalAuth_HOTPImport
;
public
override
ResIcon
IconName
=>
ResIcon
.
Attach
;
public
sealed
override
ICommand
AuthenticatorImportCommand
{
get
;
set
;
}
public
AuthenticatorHOTPGeneralImport
()
...
...
@@ -24,7 +24,7 @@ public class AuthenticatorHOTPGeneralImport : AuthenticatorGeneralImportBase
pageContent
:
new
AuthenticatorGeneralImportPage
(),
isOkButton
:
false
);
});
}
protected
override
async
Task
<
IAuthenticatorValueDTO
?>
CreateAuthenticatorValueDto
(
string
secretCode
)
{
try
...
...
@@ -36,7 +36,7 @@ public class AuthenticatorHOTPGeneralImport : AuthenticatorGeneralImportBase
Toast
.
Show
(
ToastIcon
.
Error
,
Strings
.
LocalAuth_Import_DecodePrivateKeyError
.
Format
(
"HOTP"
));
return
null
;
}
var
auth
=
new
HOTPAuthenticator
();
auth
.
Enroll
(
privateKey
);
return
auth
;
...
...
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorImportBase.cs
浏览文件 @
540dfbc2
...
...
@@ -3,13 +3,13 @@ namespace BD.WTTS.Models;
public
abstract
partial
class
AuthenticatorImportBase
:
IAuthenticatorImport
{
public
abstract
string
Name
{
get
;
}
public
abstract
string
Description
{
get
;
}
public
abstract
ResIcon
IconName
{
get
;
}
public
abstract
ICommand
AuthenticatorImportCommand
{
get
;
set
;
}
string
?
_currentPassword
{
get
;
set
;
}
public
async
Task
<
bool
>
VerifyMaxValue
()
...
...
@@ -22,8 +22,8 @@ public abstract partial class AuthenticatorImportBase : IAuthenticatorImport
public
async
Task
SaveAuthenticator
(
IAuthenticatorDTO
authenticatorDto
)
{
var
sourceList
=
await
AuthenticatorService
.
GetAllSourceAuthenticatorAsync
();
var
sourceList
=
await
AuthenticatorService
.
GetAllSourceAuthenticatorAsync
();
var
(
hasLocalPcEncrypt
,
hasPasswordEncrypt
)
=
AuthenticatorService
.
HasEncrypt
(
sourceList
);
if
(
hasPasswordEncrypt
&&
string
.
IsNullOrEmpty
(
_currentPassword
))
...
...
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorItemModel.cs
浏览文件 @
540dfbc2
...
...
@@ -17,7 +17,7 @@ public partial class AuthenticatorItemModel : ItemViewModel
readonly
DispatcherTimer
_progressTimer
;
int
_progress
;
public
void
OnPointerLeftPressed
()
{
IsSelected
=
!
IsSelected
;
...
...
@@ -32,7 +32,7 @@ public partial class AuthenticatorItemModel : ItemViewModel
{
await
CopyCode
();
}
async
Task
CopyCode
()
{
if
(!
IsShowCode
)
return
;
...
...
@@ -49,7 +49,7 @@ public partial class AuthenticatorItemModel : ItemViewModel
_progressTimer
=
new
DispatcherTimer
{
Interval
=
TimeSpan
.
FromMilliseconds
(
1000
)
};
_progressTimer
.
Tick
+=
ShowCode
;
}
async
void
ShowCode
(
object
?
sender
,
EventArgs
e
)
{
_progress
-=
1
;
...
...
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorItemModel.props.cs
浏览文件 @
540dfbc2
...
...
@@ -49,7 +49,7 @@ public partial class AuthenticatorItemModel
get
=>
_strokeColor
;
set
=>
this
.
RaiseAndSetIfChanged
(
ref
_strokeColor
,
value
);
}
public
double
Value
{
get
=>
_value
;
...
...
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorMicrosoftGeneralImport.cs
浏览文件 @
540dfbc2
...
...
@@ -10,7 +10,7 @@ public class AuthenticatorMicrosoftGeneralImport : AuthenticatorGeneralImportBas
public
override
string
Description
=>
Strings
.
LocalAuth_MicrosoftImport
;
public
override
ResIcon
IconName
=>
ResIcon
.
Attach
;
public
sealed
override
ICommand
AuthenticatorImportCommand
{
get
;
set
;
}
public
AuthenticatorMicrosoftGeneralImport
()
...
...
@@ -24,7 +24,7 @@ public class AuthenticatorMicrosoftGeneralImport : AuthenticatorGeneralImportBas
pageContent
:
new
AuthenticatorGeneralImportPage
(),
isOkButton
:
false
);
});
}
protected
override
async
Task
<
IAuthenticatorValueDTO
?>
CreateAuthenticatorValueDto
(
string
secretCode
)
{
try
...
...
@@ -36,7 +36,7 @@ public class AuthenticatorMicrosoftGeneralImport : AuthenticatorGeneralImportBas
Toast
.
Show
(
ToastIcon
.
Error
,
Strings
.
LocalAuth_Import_DecodePrivateKeyError
.
Format
(
"Microsoft"
));
return
null
;
}
var
auth
=
new
MicrosoftAuthenticator
();
auth
.
Enroll
(
privateKey
);
...
...
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorRecoverModel.cs
浏览文件 @
540dfbc2
...
...
@@ -2,7 +2,7 @@ namespace BD.WTTS.Models;
public
class
AuthenticatorRecoverModel
{
[
Reactive
]
[
Reactive
]
public
UserAuthenticatorDeleteBackupResponse
AuthenticatorDeleteBackup
{
get
;
set
;
}
[
Reactive
]
...
...
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorSdaFileImport.cs
浏览文件 @
540dfbc2
...
...
@@ -22,17 +22,17 @@ public class AuthenticatorSdaFileImport : AuthenticatorFileImportBase
await
ImportFromSdaFile
(
password
);
});
}
async
Task
ImportFromSdaFile
(
string
?
password
=
null
)
{
try
{
var
filePath
=
await
SelectFolderPath
();
if
(
string
.
IsNullOrEmpty
(
filePath
))
return
;
var
text
=
await
File
.
ReadAllTextAsync
(
filePath
);
var
index
=
text
.
IndexOf
(
"\"server_time\":"
,
StringComparison
.
Ordinal
)
+
14
;
if
(
index
!=
-
1
)
{
...
...
@@ -47,7 +47,7 @@ public class AuthenticatorSdaFileImport : AuthenticatorFileImportBase
var
sdaFileModel
=
JsonSerializer
.
Deserialize
(
text
,
ImportFileModelJsonContext
.
Default
.
SdaFileModel
);
sdaFileModel
.
ThrowIsNull
();
var
steamDataModel
=
new
SdaFileConvertToSteamDataModel
(
sdaFileModel
);
SteamAuthenticator
steamAuthenticator
=
new
()
{
DeviceId
=
sdaFileModel
.
DeviceId
,
...
...
@@ -55,11 +55,13 @@ public class AuthenticatorSdaFileImport : AuthenticatorFileImportBase
SecretKey
=
Convert
.
FromBase64String
(
sdaFileModel
.
SharedSecret
),
SteamData
=
JsonSerializer
.
Serialize
(
steamDataModel
,
ImportFileModelJsonContext
.
Default
.
SdaFileConvertToSteamDataModel
),
};
var
authDto
=
new
AuthenticatorDTO
()
{
Name
=
$"(Steam)
{
steamAuthenticator
.
AccountName
}
"
,
Value
=
steamAuthenticator
,
Created
=
DateTimeOffset
.
Now
,
Name
=
$"(Steam)
{
steamAuthenticator
.
AccountName
}
"
,
Value
=
steamAuthenticator
,
Created
=
DateTimeOffset
.
Now
,
};
await
SaveAuthenticator
(
authDto
);
Toast
.
Show
(
ToastIcon
.
Success
,
Strings
.
ModelContent_ImportSuccessful_
.
Format
(
authDto
.
Name
));
...
...
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorSteamLoginImport.cs
浏览文件 @
540dfbc2
...
...
@@ -9,7 +9,7 @@ public class AuthenticatorSteamLoginImport : AuthenticatorImportBase
public
override
string
Description
=>
Strings
.
Steam_UserLoginTip
;
public
override
ResIcon
IconName
=>
ResIcon
.
Contact
;
public
sealed
override
ICommand
AuthenticatorImportCommand
{
get
;
set
;
}
public
AuthenticatorSteamLoginImport
()
...
...
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorWattToolKitV1Import.cs
浏览文件 @
540dfbc2
...
...
@@ -20,11 +20,11 @@ public class AuthenticatorWattToolKitV1Import : AuthenticatorFileImportBase
await
ImportFromWattToolKitV1
(
password
);
});
}
async
Task
ImportFromWattToolKitV1
(
string
?
password
=
null
)
{
var
filePath
=
await
SelectFolderPath
();
if
(
string
.
IsNullOrEmpty
(
filePath
))
return
;
if
(
IOPath
.
TryReadAllText
(
filePath
,
out
var
content
,
out
var
_
))
...
...
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorWattToolKitV2Import.cs
浏览文件 @
540dfbc2
...
...
@@ -5,7 +5,7 @@ public class AuthenticatorWattToolKitV2Import : AuthenticatorFileImportBase
public
override
string
Name
=>
Strings
.
LocalAuth_Import
.
Format
(
Strings
.
WattToolKitV2
);
public
override
string
Description
=>
Strings
.
LocalAuth_WattToolKitV2Import
;
public
override
ResIcon
IconName
=>
ResIcon
.
OpenFile
;
public
sealed
override
ICommand
AuthenticatorImportCommand
{
get
;
set
;
}
...
...
@@ -20,13 +20,13 @@ public class AuthenticatorWattToolKitV2Import : AuthenticatorFileImportBase
await
ImportFromWattToolKitV2
(
password
:
password
);
});
}
async
Task
ImportFromWattToolKitV2
(
string
?
exportPassword
=
null
,
string
?
password
=
null
)
{
var
filePath
=
await
SelectFolderPath
();
if
(
string
.
IsNullOrEmpty
(
filePath
))
return
;
var
metadata
=
await
IOPath
.
TryReadAllBytesAsync
(
filePath
);
if
(!
metadata
.
success
||
metadata
.
byteArray
==
null
)
return
;
var
result
=
await
AuthenticatorService
.
ImportAsync
(
exportPassword
,
metadata
.
byteArray
);
...
...
src/BD.WTTS.Client.Plugins.Authenticator/Models/AuthenticatorWinAuthFileImport.cs
浏览文件 @
540dfbc2
...
...
@@ -7,7 +7,7 @@ public class AuthenticatorWinAuthFileImport : AuthenticatorFileImportBase
public
override
string
Name
=>
Strings
.
LocalAuth_Import
.
Format
(
Strings
.
WinAuth
);
public
override
string
Description
=>
Strings
.
LocalAuth_WinAuthImport
;
public
override
ResIcon
IconName
=>
ResIcon
.
OpenFile
;
public
sealed
override
ICommand
AuthenticatorImportCommand
{
get
;
set
;
}
...
...
@@ -22,7 +22,7 @@ public class AuthenticatorWinAuthFileImport : AuthenticatorFileImportBase
await
ImportFromWinAuthFile
(
password
);
});
}
async
Task
ImportFromWinAuthFile
(
string
?
password
=
null
)
{
var
filePath
=
await
SelectFolderPath
();
...
...
@@ -99,7 +99,7 @@ public class AuthenticatorWinAuthFileImport : AuthenticatorFileImportBase
}
AuthenticatorDTO
authenticatorDto
=
new
();
AuthenticatorValueDTO
auth
;
if
(
string
.
Compare
(
issuer
,
"BattleNet"
,
StringComparison
.
OrdinalIgnoreCase
)
==
0
)
{
...
...
@@ -177,7 +177,7 @@ public class AuthenticatorWinAuthFileImport : AuthenticatorFileImportBase
{
auth
.
HMACType
=
hmactype
;
}
if
(
label
.
Length
!=
0
)
{
authenticatorDto
.
Name
=
issuer
.
Length
!=
0
?
issuer
+
" ("
+
label
+
")"
:
label
;
...
...
@@ -190,7 +190,7 @@ public class AuthenticatorWinAuthFileImport : AuthenticatorFileImportBase
{
authenticatorDto
.
Name
=
"Imported"
;
}
authenticatorDto
.
Value
=
auth
;
// sync
...
...
src/BD.WTTS.Client.Plugins.Authenticator/Models/SteamTradeConfirmationModel.cs
浏览文件 @
540dfbc2
...
...
@@ -8,31 +8,31 @@ public class SteamTradeConfirmationModel : ReactiveObject
public
int
Type
{
get
;
set
;
}
public
string
TypeName
{
get
;
set
;
}
=
string
.
Empty
;
public
string
Id
{
get
;
set
;
}
=
string
.
Empty
;
public
string
CreatorId
{
get
;
set
;
}
=
string
.
Empty
;
public
string
Nonce
{
get
;
set
;
}
=
string
.
Empty
;
long
CreationTime
{
get
;
set
;
}
public
string
Cancel
{
get
;
set
;
}
=
string
.
Empty
;
public
string
Accept
{
get
;
set
;
}
=
string
.
Empty
;
public
string
Icon
{
get
;
set
;
}
=
string
.
Empty
;
public
bool
Multi
{
get
;
set
;
}
public
string
Headline
{
get
;
set
;
}
=
string
.
Empty
;
string
[]?
Summary
{
get
;
set
;
}
public
string
?
Warn
{
get
;
set
;
}
public
string
?
SelfIcon
{
get
;
set
;
}
public
string
SendSummary
=>
Summary
![
0
];
public
string
ReceiveSummary
=>
Summary
![
1
];
...
...
@@ -45,7 +45,7 @@ public class SteamTradeConfirmationModel : ReactiveObject
[
Reactive
]
public
ObservableCollection
<
string
>
SendItemImageUrls
{
get
;
set
;
}
[
Reactive
]
public
ObservableCollection
<
string
>
ReceiveItemImageUrls
{
get
;
set
;
}
...
...
@@ -103,14 +103,14 @@ public class SteamTradeConfirmationModel : ReactiveObject
{
ReceiveItemImageUrls
.
Add
(
item
);
}
SendItemImageUrls
.
Clear
();
foreach
(
var
item
in
imageUrls
.
sendItems
)
{
SendItemImageUrls
.
Add
(
item
);
}
}
async
Task
<
T
?>
RunTaskAndExceptionHandlingAsync
<
T
>(
Task
<
T
>
task
)
{
try
...
...
src/BD.WTTS.Client.Plugins.Authenticator/Repositories/AccountPlatformAuthenticatorRepository.cs
浏览文件 @
540dfbc2
...
...
@@ -83,7 +83,7 @@ internal sealed class AccountPlatformAuthenticatorRepository : Repository<Accoun
var
resultCode__
=
(
ImportResultCode
)
resultCode_
;
return
resultCode__
;
}
public
async
Task
<
bool
>
Exists
(
IEnumerable
<
AccountPlatformAuthenticator
>
sourceList
,
IAuthenticatorDTO
item
,
bool
isLocal
,
string
?
secondaryPassword
=
null
)
{
...
...
src/BD.WTTS.Client.Plugins.Authenticator/Services/AuthenticatorService.cs
浏览文件 @
540dfbc2
...
...
@@ -178,7 +178,7 @@ public sealed partial class AuthenticatorService
else
{
fileTypes
=
null
;
}
}
exportFile
=
await
FilePicker2
.
SaveAsync
(
new
PickOptions
{
FileTypes
=
fileTypes
,
...
...
@@ -186,13 +186,13 @@ public sealed partial class AuthenticatorService
PickerTitle
=
"Watt Toolkit"
,
});
if
(
exportFile
==
null
)
return
exportFile
;
var
filestream
=
exportFile
.
OpenWrite
();
if
(
filestream
.
CanSeek
&&
filestream
.
Position
!=
0
)
filestream
.
Position
=
0
;
await
repository
.
ExportAsync
(
filestream
,
isLocal
,
password
,
items
);
await
filestream
.
FlushAsync
();
await
filestream
.
DisposeAsync
();
}
...
...
@@ -275,7 +275,7 @@ public sealed partial class AuthenticatorService
Toast
.
Show
(
ToastIcon
.
Warning
,
AppResources
.
Error_UpdateCloudData
);
return
0
;
}
/// <summary>
/// 验证安全问题
/// </summary>
...
...
@@ -301,7 +301,8 @@ public sealed partial class AuthenticatorService
var
setPassword
=
await
IMicroServiceClient
.
Instance
.
AuthenticatorClient
.
SetIndependentPassword
(
new
()
{
PwdQuestion
=
question
,
Answer
=
answer
,
PwdQuestion
=
question
,
Answer
=
answer
,
});
if
(!
setPassword
.
IsSuccess
)
{
...
...
@@ -316,7 +317,7 @@ public sealed partial class AuthenticatorService
AppResources
.
Title_PleaseEnterTheAnswer
,
subHeader
:
AppResources
.
SubHeader_SecurityIssues_
.
Format
(
question
),
isCancelButton
:
true
))
{
answer
=
answerTextViewModel
.
Value
;
if
(
string
.
IsNullOrEmpty
(
answer
))
{
Toast
.
Show
(
ToastIcon
.
Error
,
AppResources
.
Error_PleaseEnterAnswer
);
...
...
@@ -411,7 +412,7 @@ public sealed partial class AuthenticatorService
if
(
response
.
StatusCode
==
HttpStatusCode
.
OK
)
{
//response.Content.Headers.ContentType.;
using
(
var
bitmap
=
(
System
.
Drawing
.
Bitmap
)
System
.
Drawing
.
Image
.
FromStream
(
await
response
.
Content
.
ReadAsStreamAsync
()))
{
//二维码解析
...
...
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/AuthenticatorExportViewModel.cs
浏览文件 @
540dfbc2
...
...
@@ -78,9 +78,9 @@ public class AuthenticatorExportViewModel : ViewModelBase
public
AuthenticatorExportViewModel
()
{
}
public
AuthenticatorExportViewModel
(
string
?
password
=
null
)
{
_currentPassword
=
password
;
...
...
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/AuthenticatorGeneralImportPageViewModel.cs
浏览文件 @
540dfbc2
...
...
@@ -5,7 +5,7 @@ public partial class AuthenticatorGeneralImportPageViewModel
readonly
Func
<
IAuthenticatorDTO
,
Task
>
_saveAuth
;
readonly
Func
<
string
,
Task
<
IAuthenticatorValueDTO
?>>
_createAuthenticatorValueDto
;
IAuthenticatorValueDTO
?
_importAuthenticatorValueDto
;
public
AuthenticatorGeneralImportPageViewModel
()
...
...
@@ -28,9 +28,9 @@ public partial class AuthenticatorGeneralImportPageViewModel
Toast
.
Show
(
ToastIcon
.
Info
,
Strings
.
Info_PleaseEnterImportText
);
return
;
}
_importAuthenticatorValueDto
=
await
_createAuthenticatorValueDto
.
Invoke
(
SecretCode
);
if
(
_importAuthenticatorValueDto
!=
null
)
CurrentCode
=
_importAuthenticatorValueDto
.
CurrentCode
;
}
...
...
@@ -48,7 +48,7 @@ public partial class AuthenticatorGeneralImportPageViewModel
Toast
.
Show
(
ToastIcon
.
Warning
,
Strings
.
Warning_PleaseEnterAuthName
);
return
;
}
var
iAuthenticatorDtoDto
=
new
AuthenticatorDTO
()
{
Name
=
$"
{
_importAuthenticatorValueDto
.
Platform
}
(
{
AuthenticatorName
}
)"
,
...
...
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/AuthenticatorImportPageViewModel.cs
浏览文件 @
540dfbc2
...
...
@@ -4,11 +4,11 @@ public class AuthenticatorImportPageViewModel : ViewModelBase
{
[
Reactive
]
public
ObservableCollection
<
AuthenticatorImportBase
>
AuthenticatorImportBases
{
get
;
set
;
}
public
AuthenticatorImportPageViewModel
()
{
AuthenticatorImportBases
=
new
ObservableCollection
<
AuthenticatorImportBase
>();
Initialize
();
}
...
...
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/AuthenticatorPageViewModel.cs
浏览文件 @
540dfbc2
...
...
@@ -13,7 +13,7 @@ public sealed partial class AuthenticatorPageViewModel : ViewModelBase
const
int
MAX_SYNC_VALUE
=
100
;
string
?
_currentAnswer
;
string
?
_currentPassword
;
DateTime
_initializeTime
;
...
...
@@ -256,7 +256,7 @@ public sealed partial class AuthenticatorPageViewModel : ViewModelBase
response
.
Content
.
ThrowIsNull
();
var
cloudAuths
=
response
.
Content
.
Select
(
AuthenticatorService
.
ConvertToAuthenticatorDto
).
ToList
();
if
(
cloudAuths
.
Count
>=
Auths
.
Count
)
{
int
changes
=
0
;
...
...
@@ -308,7 +308,8 @@ public sealed partial class AuthenticatorPageViewModel : ViewModelBase
return
;
}
var
pushItems
=
(
from
item
in
Auths
var
pushItems
=
(
from
item
in
Auths
let
cloudAuth
=
cloudAuths
.
FirstOrDefault
(
i
=>
i
.
ServerId
==
item
.
AuthData
.
ServerId
)
where
cloudAuth
==
null
select
new
UserAuthenticatorPushItem
()
...
...
@@ -330,7 +331,8 @@ public sealed partial class AuthenticatorPageViewModel : ViewModelBase
var
syncResponse
=
await
IMicroServiceClient
.
Instance
.
AuthenticatorClient
.
SyncAuthenticatorsToCloud
(
new
()
{
Difference
=
pushItems
,
Answer
=
_currentAnswer
,
Difference
=
pushItems
,
Answer
=
_currentAnswer
,
});
if
(!
syncResponse
.
IsSuccess
)
...
...
@@ -391,7 +393,7 @@ public sealed partial class AuthenticatorPageViewModel : ViewModelBase
isCancelButton
:
true
))
return
;
var
answer
=
textViewModel
.
Value
;
if
(
string
.
IsNullOrEmpty
(
question
)
||
string
.
IsNullOrEmpty
(
answer
))
return
;
var
resetPassword
=
await
IMicroServiceClient
.
Instance
.
AuthenticatorClient
.
ResetIndependentPassword
(
new
()
var
resetPassword
=
await
IMicroServiceClient
.
Instance
.
AuthenticatorClient
.
ResetIndependentPassword
(
new
()
{
Answer
=
_currentAnswer
,
NewPwdQuestion
=
question
,
...
...
@@ -450,7 +452,8 @@ public sealed partial class AuthenticatorPageViewModel : ViewModelBase
var
textViewmodel
=
new
TextBoxWindowViewModel
{
InputType
=
TextBoxWindowViewModel
.
TextBoxInputType
.
TextBox
,
Value
=
CurrentSelectedAuth
.
AuthName
InputType
=
TextBoxWindowViewModel
.
TextBoxInputType
.
TextBox
,
Value
=
CurrentSelectedAuth
.
AuthName
};
if
(
await
IWindowManager
.
Instance
.
ShowTaskDialogAsync
(
textViewmodel
,
AppResources
.
Title_PleaseEnterNewAuthName
,
isDialog
:
false
,
isCancelButton
:
true
))
...
...
@@ -559,15 +562,16 @@ public sealed partial class AuthenticatorPageViewModel : ViewModelBase
await
IWindowManager
.
Instance
.
ShowTaskDialogAsync
(
new
TextBoxWindowViewModel
()
{
InputType
=
TextBoxWindowViewModel
.
TextBoxInputType
.
TextBox
,
Value
=
temp
,
InputType
=
TextBoxWindowViewModel
.
TextBoxInputType
.
TextBox
,
Value
=
temp
,
},
AppResources
.
ModelContent_SecretKey_
.
Format
(
CurrentSelectedAuth
.
AuthName
),
isDialog
:
false
,
isOkButton
:
false
);
}
}
public
async
void
ExportAuthWithSdaFile
(
object
sender
)
{
if
(
sender
is
not
AuthenticatorItemModel
authenticatorItemModel
)
return
;
if
(
authenticatorItemModel
.
AuthData
.
Value
is
SteamAuthenticator
steamAuthenticator
)
{
if
(
string
.
IsNullOrEmpty
(
steamAuthenticator
.
SteamData
))
return
;
...
...
@@ -656,7 +660,7 @@ public sealed partial class AuthenticatorPageViewModel : ViewModelBase
}
Auths
.
Move
(
index
,
index
-
1
);
}
public
async
Task
AuthenticatorIndexMoveDown
(
object
sender
)
{
if
(
sender
is
not
AuthenticatorItemModel
authenticatorItemModel
)
return
;
...
...
@@ -707,11 +711,11 @@ public sealed partial class AuthenticatorPageViewModel : ViewModelBase
if
(
exportFile
==
null
)
return
;
Toast
.
Show
(
ToastIcon
.
Success
,
Strings
.
ExportedToPath_
.
Format
(
exportFile
.
ToString
()));
}
public
async
Task
UnbindingSteamAuthAsync
(
object
sender
)
{
if
(
sender
is
not
AuthenticatorItemModel
authenticatorItemModel
)
return
;
if
(
authenticatorItemModel
.
AuthData
.
Platform
!=
AuthenticatorPlatform
.
Steam
)
{
Toast
.
Show
(
ToastIcon
.
Warning
,
AppResources
.
Warning_OnlySupportSteamAuth
);
...
...
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/AuthenticatorRecoverPageViewModel.cs
浏览文件 @
540dfbc2
...
...
@@ -41,7 +41,8 @@ public class AuthenticatorRecoverPageViewModel : ViewModelBase
var
ids
=
list
.
Select
(
a
=>
a
.
AuthenticatorDeleteBackup
.
Id
).
ToArray
();
var
response
=
await
IMicroServiceClient
.
Instance
.
AuthenticatorClient
.
RecoverAuthenticatorsFromDeleteBackups
(
new
()
{
Answer
=
_currentAnswer
,
Id
=
ids
,
Answer
=
_currentAnswer
,
Id
=
ids
,
});
if
(!
response
.
IsSuccess
)
return
;
AuthenticatorDeleteBackups
.
Remove
(
list
);
...
...
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/AuthenticatorSteamGuardViewModel.cs
浏览文件 @
540dfbc2
...
...
@@ -33,7 +33,7 @@ public class AuthenticatorSteamGuardViewModel : ViewModelBase
this
.
RaisePropertyChanged
();
}
}
public
string
?
ImportAuthNewName
{
get
=>
_importAuthNewName
;
...
...
@@ -48,7 +48,7 @@ public class AuthenticatorSteamGuardViewModel : ViewModelBase
this
.
RaisePropertyChanged
();
}
}
readonly
Func
<
IAuthenticatorDTO
,
Task
>
_saveAuth
;
public
AuthenticatorSteamGuardViewModel
()
...
...
@@ -103,7 +103,7 @@ public class AuthenticatorSteamGuardViewModel : ViewModelBase
RegexOptions
.
Singleline
|
RegexOptions
.
IgnoreCase
)
==
false
)
{
//WinAuthForm.ErrorDialog(this, "Invalid deviceid, expecting \"android:NNNN...\"");
return
;
return
;
}
// check the steamguard
...
...
@@ -140,12 +140,17 @@ public class AuthenticatorSteamGuardViewModel : ViewModelBase
var
auth
=
new
SteamAuthenticator
{
SecretKey
=
secret
,
Serial
=
serial
,
SteamData
=
PhoneImportSteamGuard
,
DeviceId
=
deviceId
SecretKey
=
secret
,
Serial
=
serial
,
SteamData
=
PhoneImportSteamGuard
,
DeviceId
=
deviceId
};
await
_saveAuth
.
Invoke
(
new
AuthenticatorDTO
()
{
Name
=
$"(Steam)
{
ImportAuthNewName
}
"
,
Value
=
auth
,
Created
=
DateTimeOffset
.
Now
,
Name
=
$"(Steam)
{
ImportAuthNewName
}
"
,
Value
=
auth
,
Created
=
DateTimeOffset
.
Now
,
});
}
}
\ No newline at end of file
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/ShowSteamDataViewModel.cs
浏览文件 @
540dfbc2
...
...
@@ -47,7 +47,7 @@ public class ShowSteamDataViewModel : ViewModelBase
public
ShowSteamDataViewModel
()
{
}
public
ShowSteamDataViewModel
(
IAuthenticatorDTO
authenticatorDto
)
...
...
@@ -68,5 +68,4 @@ public class ShowSteamDataViewModel : ViewModelBase
//await IWindowManager.Instance.ShowTaskDialogAsync(viewModel, Strings.LocalAuth_ShowAuthInfo);
}
}
}
\ No newline at end of file
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/SteamLoginImportViewModel.cs
浏览文件 @
540dfbc2
...
...
@@ -15,7 +15,7 @@ public sealed partial class SteamLoginImportViewModel
bool
_isFirstLogin
=
true
;
bool
_isConfirmMailUrl
;
readonly
ISteamAccountService
_steamAccountService
;
readonly
Func
<
IAuthenticatorDTO
,
Task
>
_saveAuth
;
...
...
@@ -25,7 +25,7 @@ public sealed partial class SteamLoginImportViewModel
_steamAccountService
=
Ioc
.
Get
<
ISteamAccountService
>();
_saveAuth
=
(
authenticatorDto
)
=>
Task
.
CompletedTask
;
}
public
SteamLoginImportViewModel
(
Func
<
IAuthenticatorDTO
,
Task
>
saveAuthFunc
)
{
_steamAccountService
=
Ioc
.
Get
<
ISteamAccountService
>();
...
...
@@ -33,7 +33,7 @@ public sealed partial class SteamLoginImportViewModel
}
SteamAuthenticator
steamAuthenticator
=
new
();
SteamLoginState
_steamLoginState
=
new
();
SteamAuthenticator
.
EnrollState
_enrollState
=
new
SteamAuthenticator
.
EnrollState
();
...
...
@@ -68,7 +68,7 @@ public sealed partial class SteamLoginImportViewModel
_steamLoginState
.
Password
=
PasswordText
;
_steamLoginState
.
Language
=
ResourceService
.
GetCurrentCultureSteamLanguageName
();
_IsLogining
=
true
;
await
_steamAccountService
.
DoLoginV2Async
(
_steamLoginState
);
_isFirstLogin
=
false
;
}
...
...
@@ -81,7 +81,7 @@ public sealed partial class SteamLoginImportViewModel
}
else
_steamLoginState
.
CaptchaText
=
CaptchaCodeText
;
await
_steamAccountService
.
DoLoginV2Async
(
_steamLoginState
);
CaptchaCodeText
=
null
;
...
...
@@ -97,7 +97,7 @@ public sealed partial class SteamLoginImportViewModel
_steamLoginState
.
EmailCode
=
EmailAuthText
;
await
_steamAccountService
.
DoLoginV2Async
(
_steamLoginState
);
EmailAuthText
=
null
;
EmailDomainText
=
null
;
}
...
...
@@ -106,7 +106,7 @@ public sealed partial class SteamLoginImportViewModel
{
return
await
steamAuthenticator
.
AddAuthenticatorAsync
(
_enrollState
);
}
public
async
Task
<
bool
>
FinalizeAddAuthenticatorAsync
()
{
if
(
string
.
IsNullOrEmpty
(
PhoneCodeText
))
...
...
@@ -115,10 +115,10 @@ public sealed partial class SteamLoginImportViewModel
}
else
_enrollState
.
ActivationCode
=
PhoneCodeText
;
await
steamAuthenticator
.
FinalizeAddAuthenticatorAsync
(
_enrollState
);
PhoneCodeText
=
null
;
return
_steamLoginState
.
Success
;
}
...
...
@@ -151,7 +151,7 @@ public sealed partial class SteamLoginImportViewModel
SelectIndex
=
3
;
}
}
/// <summary>
/// 检查登陆是否成功
/// </summary>
...
...
@@ -207,7 +207,7 @@ public sealed partial class SteamLoginImportViewModel
return
;
}
_IsLogining
=
true
;
try
{
if
(
ToastService
.
IsSupported
)
...
...
@@ -227,7 +227,7 @@ public sealed partial class SteamLoginImportViewModel
}
else
if
(
_steamLoginState
.
RequiresEmailAuth
)
{
await
LoginSteamWithEmailCodeAsync
();
await
LoginSteamWithEmailCodeAsync
();
}
if
(
await
CheckLoginResult
())
...
...
@@ -235,7 +235,7 @@ public sealed partial class SteamLoginImportViewModel
_enrollState
.
AccessToken
??=
_steamLoginState
.
AccessToken
;
_enrollState
.
RefreshToken
??=
_steamLoginState
.
RefreshToken
;
_enrollState
.
SteamId
??=
_steamLoginState
.
SteamId
.
ToString
();
if
(
_enrollState
.
RequiresActivation
)
{
if
(
await
FinalizeAddAuthenticatorAsync
())
...
...
@@ -268,11 +268,11 @@ public sealed partial class SteamLoginImportViewModel
Toast
.
Show
(
ToastIcon
.
Warning
,
AppResources
.
Warning_PleaseEnterTel
);
return
;
}
var
reslut
=
await
steamAuthenticator
.
AddPhoneNumberAsync
(
_enrollState
.
AccessToken
!,
_enrollState
.
SteamId
,
PhoneNumberText
,
_isConfirmMailUrl
);
if
(!
string
.
IsNullOrEmpty
(
reslut
))
{
Toast
.
Show
(
ToastIcon
.
Info
,
reslut
);
...
...
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/SteamLoginImportViewModel.props.cs
浏览文件 @
540dfbc2
...
...
@@ -10,7 +10,7 @@ public sealed partial class SteamLoginImportViewModel : ViewModelBase
{
[
Reactive
]
public
bool
IsLoading
{
get
;
set
;
}
private
int
index
;
public
int
SelectIndex
...
...
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/SteamTradePageViewModel.cs
浏览文件 @
540dfbc2
...
...
@@ -235,7 +235,7 @@ public sealed partial class SteamTradePageViewModel
// _steamClient.Logout();
// }
// }
// void RefreshConfirmationsList()
// {
// var items = _confirmationsSourceList.Items.Where(s => s.IsOperate == 0);
...
...
src/BD.WTTS.Client.Plugins.Authenticator/UI/ViewModels/SteamTradePageViewModel.props.cs
浏览文件 @
540dfbc2
...
...
@@ -92,5 +92,4 @@ public sealed partial class SteamTradePageViewModel : ViewModelBase
}
public
bool
IsConfirmationsAny
=>
Confirmations
.
Any_Nullable
();
}
\ No newline at end of file
src/BD.WTTS.Client.Plugins.Authenticator/UI/Views/Pages/SteamTradePage.axaml.cs
浏览文件 @
540dfbc2
...
...
@@ -9,7 +9,7 @@ public partial class SteamTradePage : UserControl
public
SteamTradePage
()
{
InitializeComponent
();
PasswordText
.
KeyUp
+=
(
_
,
e
)
=>
{
if
(
e
.
Key
!=
Avalonia
.
Input
.
Key
.
Return
)
return
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录