26 Commits
2.8.0 ... 3.1.0

Author SHA1 Message Date
HolographicHat
f41fe6fb12 4.1
* #71
2023-09-28 18:48:00 +08:00
HolographicHat
78bda3f49c Merge pull request #70 from BTMuli/master
#67
2023-09-23 00:00:30 +08:00
BTMuli
a10dc22461 🎨 修正检测方式 2023-09-22 23:39:37 +08:00
HolographicHat
74dda750ef Merge pull request #69 from Masterain98/master
Update GitLab CI configuration
2023-09-22 21:15:21 +08:00
Masterain
099270ad29 Update .gitlab-ci.yml 2023-09-21 23:42:47 -07:00
Masterain
fe5b2c0c12 Update .gitlab-ci.yml 2023-09-21 23:35:17 -07:00
HolographicHat
ed5d99745c Merge pull request #68 from Masterain98/master
Create GitLab CI Config File
2023-09-21 23:46:58 +08:00
Masterain
7175cd7427 Create .gitlab-ci.yml 2023-09-21 00:01:13 -07:00
HolographicHat
73747bcce5 #67 2023-09-19 22:28:58 +08:00
HolographicHat
b12c3209d7 fix ci 2023-08-27 11:39:40 +08:00
HolographicHat
5805070627 4.0.1 (fix #64) 2023-08-24 00:16:44 +08:00
HolographicHat
811daba164 4.0 2023-08-16 20:00:06 +08:00
HolographicHat
849f379ca5 3.8 2023-07-06 14:31:55 +08:00
HolographicHat
29c57cbc1e Merge pull request #62 from Lightczx/master
Improve export experience for Snap Hutao
2023-06-29 21:30:58 +08:00
DismissedLight
8fdb10898a Improve export experience for Snap Hutao 2023-06-29 14:38:19 +08:00
HolographicHat
f4f1f14651 Merge pull request #61 from prpjzz/master
Add Readme_EN.md
2023-06-22 15:03:23 +08:00
prpjzz
390af6cd85 Update Tutorial_EN.md 2023-06-19 22:00:38 +07:00
prpjzz
a78f36dfa8 Update README_EN.md 2023-06-19 21:56:51 +07:00
prpjzz
e3d7152da2 Update Tutorial_EN.md 2023-06-19 21:14:20 +07:00
prpjzz
60a4dd04c4 Merge branch 'HolographicHat:master' into master 2023-06-19 18:49:45 +07:00
prpjzz
d9034ec635 Update Tutorial_EN.md 2023-05-03 14:06:04 +07:00
prpjzz
f742cf37d5 Create Tutorial_EN.md 2023-05-03 13:27:26 +07:00
prpjzz
4136a1b0c4 Update README_EN.md 2023-05-03 13:26:38 +07:00
prpjzz
e039d2f944 Update README_EN.md 2023-05-03 13:26:21 +07:00
prpjzz
0e23a05a78 Update README_EN.md 2023-05-03 13:25:26 +07:00
prpjzz
5f5a0614a6 Update README_EN.md 2023-05-03 13:20:02 +07:00
18 changed files with 305 additions and 2443 deletions

View File

@@ -20,7 +20,7 @@ jobs:
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
run: dotnet build -c Release --no-restore
- name: Publish
run: dotnet publish --property:OutputPath=.\publish\
- name: Upload artifact

64
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,64 @@
stages:
- test
- build
- release
Test:
stage: test
image: mcr.microsoft.com/windows/server
tags:
- windows
script:
- dotnet restore
- dotnet build -c Release --no-restore
- dotnet publish --property:OutputPath=.\publish\
- Move-Item -Path .\publish\publish\*.exe -Destination ..\ -Force
Build:
stage: build
only:
- tags
tags:
- windows
needs:
- job: Test
script:
- echo "This is build stage."
- Move-Item -Path ..\YaeAchievement.exe .\ -Force
after_script:
- echo "Current Job ID is $CI_JOB_ID"
- echo "THIS_JOB_ID=$CI_JOB_ID" >> build.env
artifacts:
paths:
- .\*.exe
expire_in: 90 days
reports:
dotenv: build.env
release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
only:
- tags
needs:
- job: Build
artifacts: true
variables:
TAG: '$CI_COMMIT_TAG'
script:
- echo "Create Release $TAG"
- echo "$THIS_JOB_ID"
release:
name: '$TAG'
tag_name: '$TAG'
ref: '$TAG'
description: 'Release $TAG by CI'
assets:
links:
- name: "YaeAchievement.exe"
url: "https://$CI_SERVER_SHELL_SSH_HOST/$CI_PROJECT_PATH/-/jobs/$THIS_JOB_ID/artifacts/raw/YaeAchievement.exe?inline=false"
link_type: package
- name: ".NET 7.0 Desktop Runtime"
url: "https://dotnet.microsoft.com/zh-cn/download/dotnet/thank-you/runtime-desktop-7.0.11-windows-x64-installer"
link_type: other

View File

@@ -16,12 +16,8 @@
- Support for exporting to [Cocogoat](https://cocogoat.work/achievement), [Snap·HuTao](https://github.com/DGP-Studio/Snap.HuTao), [Paimon.moe](https://paimon.moe/achievement/), [Seelie.me](https://seelie.me/achievements)、[XunKong](https://github.com/xunkong/xunkong) and form files (csv)
- There are no requirements for window size, game language, etc.
## How to use:
The first time you open it, you need to set the path that contains the Genshin main program (YuanShen.exe / GenshinIimpact.exe)
![alt](https://upload-bbs.mihoyo.com/upload/2022/04/06/165631158/e540a5a6d50cd5fdee19665435548e00_514247033566841954.jpg)
After setting up, wait for the game to start.
When you see the door, press in to enter the game, the game will automatically exit.
After the game exits, enter a number inside the program to select the site/application to export to
## Instructions for Use:
→ [Tutorial_EN.md](Tutorial_EN.md)
## Download: [Here](https://github.com/HolographicHat/YaeAchievement/releases/latest)
@@ -30,7 +26,8 @@ After the game exits, enter a number inside the program to select the site/appli
## Frequently asked questions
0. Q: Unable to start
A: Download and install [.NET Runtime 6](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-7.0.3-windows-x64-installer)
A: Download and install [.NET Runtime 7](https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-7.0.7-windows-x64-installer) or ` winget install Microsoft.DotNet.Runtime.7`
1. Q: Error while Genshin started: Data Exception (31-4302)
A: Don't place software in the directory containing Genshin Impact.

73
Tutorial_EN.md Normal file
View File

@@ -0,0 +1,73 @@
## Instructions for Use
1.Download YaeAchievementLatest Version
Click Herehttps://github.com/HolographicHat/YaeAchievement/releases
Click on the file named "YaeAchievement.exe" in the red box to automatically pop up and download.It is recommended that you save this file in a desktop or other easy-to-see folder.
![image](https://github.com/prpjzz/yae-markdown-en/blob/main/image/Guide1.png)
2.Install .NET Runtime 7 (this step can be ignored if the runtime is already installed)
Click Herehttps://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-7.0.7-windows-x64-installer .
Or `winget install Microsoft.DotNet.Runtime.7` if you use Windows 11 or have Winget installed.
The browser automatically pops up and downloads when you enter the web page, as well as saving files in a desktop or other easy-to-see folder.
When you open a file with the name dotnet-runtime-x.x.x-win-x64.exe after the download is complete, an installation window pops up, as shown below.
![image](https://github.com/prpjzz/yae-markdown-en/blob/main/image/Guide2.png)
Just click Install.
3.The actions required to open the main program and the options for the achievement export
Double-click the file named "YaeAchievement.exe" downloaded in the first step to open it successfully, indicating that the original god is starting, as shown below.
![image](https://github.com/prpjzz/yae-markdown-en/blob/main/image/Guide3.png)
Once the primordial startup is complete, click to enter the game.
When you click into the game, the tool prompts you to choose which tool to export, as shown below.
![image](https://github.com/prpjzz/yae-markdown-en/blob/main/image/Guide4.png)
For global user, you should select [3] Seelie.me or [4] Export to csv file。
After selecting, each page exports the tool as follows:
#### Snap.Hutao
![image](https://github.com/prpjzz/yae-markdown-en/blob/main/image/Guide5.png)
#### Seelie.me
At this point, Yae Achievement will remind that performance data has been exported. Please find the file named export-20xxxxxxxxxxxx-seelie.json in the Yae Achievement save directory.
![image](https://github.com/prpjzz/yae-markdown-en/blob/main/image/Guide6.png)
Then click on the URL: https://seelie.me/settings, enter the website and select Import Account, as illustrated in the figure below.
![image](https://github.com/prpjzz/yae-markdown-en/blob/main/image/Guide7.png)
After clicking Import, select a file named export-20xxxxxxxxxxxx-seelie.json, as shown in the figure below.
![image](https://github.com/prpjzz/yae-markdown-en/blob/main/image/Guide8.png)
When the prompt as shown in the image below pops up, the import process succeeds.
![image](https://github.com/prpjzz/yae-markdown-en/blob/main/image/Guide9.png)
At this time, you can select the Achievements in the left column to view the imported performance data.
### For the introduction of different tools, please visit the official page of each tool to see:
1. [Snap·HuTao](https://github.com/DGP-Studio/Snap.HuTao)
2. [Paimon.moe](https://paimon.moe/achievement/)
3. [Seelie.me](https://seelie.me/achievements)

View File

@@ -8,8 +8,8 @@ using std::to_string;
HWND unityWnd = nullptr;
HANDLE hPipe = nullptr;
// Allow Protocol: GetPlayerToken, PlayerLogin, AchievementAllDataNotify, Ping
std::set<UINT16> PacketWhitelist = { 175, 196, 102, 172, 2678, 55, 48, 160 };
// Allow Protocol: GetPlayerTokenRsp, PlayerLoginRsp, AchievementAllDataNotify, PingRsp
std::set<UINT16> PacketWhitelist = { 1347, 4424, 20342, 25731 };
bool OnPacket(KcpPacket* pkt) {
if (pkt->data == nullptr) return true;
@@ -30,11 +30,10 @@ bool OnPacket(KcpPacket* pkt) {
return false;
}
printf("Passed cmdid: %d\n", ReadMapped<UINT16>(data->vector, 2));
if (ReadMapped<UINT16>(data->vector, 2) == 2678) {
auto headLength = ReadMapped<UINT16>(data->vector, 4);
auto dataLength = ReadMapped<UINT32>(data->vector, 6);
auto iStr = Genshin::ToBase64String(data, 10 + headLength, dataLength, nullptr);
auto cStr = ToString(iStr) + "\n";
if (ReadMapped<UINT16>(data->vector, 2) == 20342) {
const auto headLength = ReadMapped<UINT16>(data->vector, 4);
const auto dataLength = ReadMapped<UINT32>(data->vector, 6);
const auto cStr = base64_encode(data->vector + 10 + headLength, dataLength) + "\n";
WriteFile(hPipe, cStr.c_str(), cStr.length(), nullptr, nullptr);
CloseHandle(hPipe);
auto manager = Genshin::GetSingletonInstance(Genshin::GetSingletonManager(), il2cpp_string_new("GameManager"));
@@ -48,18 +47,14 @@ std::string checksum;
namespace Hook {
int KcpSend(void* client, KcpPacket* pkt, void* method) {
return OnPacket(pkt) ? CALL_ORIGIN(KcpSend, client, pkt, method) : 0;
}
void SetVersion(void* obj, Il2CppString* value, void* method) {
auto version = ToString(value);
const auto version = ToString(value);
value = string_new(version + " YaeAchievement");
CALL_ORIGIN(SetVersion, obj, value, method);
}
bool KcpRecv(void* client, ClientKcpEvent* evt, void* method) {
auto result = CALL_ORIGIN(KcpRecv, client, evt, method);
const auto result = CALL_ORIGIN(KcpRecv, client, evt, method);
if (result == 0 || evt->fields.type != KcpEventType::EventRecvMsg) {
return result;
}
@@ -67,40 +62,22 @@ namespace Hook {
}
ByteArray* UnityEngine_RecordUserData(INT type) {
return Genshin::GetBytes(Genshin::GetDefaultEncoding(), il2cpp_string_new(""));
}
VOID SetChecksum(LPVOID obj, Il2CppString* value) {
CALL_ORIGIN(SetChecksum, obj, il2cpp_string_new(checksum.c_str()));
}
VOID RequestLogin(LPVOID obj, LPVOID token, UINT32 uid) {
HookManager::install(Genshin::SetChecksum, SetChecksum);
CALL_ORIGIN(RequestLogin, obj, token, uid);
HookManager::detach(SetChecksum);
return new ByteArray {};
}
// 不再使用checksum(?
}
void Run(HMODULE* phModule) {
//AllocConsole();
//freopen_s((FILE**)stdout, "CONOUT$", "w", stdout);
while (
GetModuleHandle("UserAssembly.dll") == nullptr ||
(unityWnd = FindMainWindowByPID(GetCurrentProcessId())) == nullptr
) {
while ((unityWnd = FindMainWindowByPID(GetCurrentProcessId())) == nullptr) {
Sleep(1000);
}
Sleep(5000);
DisableVMProtect();
InitIL2CPP();
auto enc = Genshin::GetDefaultEncoding();
for (int i = 0; i < 3; i++) {
checksum += ToString(Genshin::GetString(enc, Genshin::RecordUserData(i)));
}
HookManager::install(Genshin::KcpSend, Hook::KcpSend);
HookManager::install(Genshin::KcpRecv, Hook::KcpRecv);
HookManager::install(Genshin::SetVersion, Hook::SetVersion);
HookManager::install(Genshin::RequestLogin, Hook::RequestLogin);
HookManager::install(Genshin::UnityEngine_RecordUserData, Hook::UnityEngine_RecordUserData);
hPipe = CreateFile(R"(\\.\pipe\YaeAchievementPipe)", GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, 0, nullptr);
if (hPipe == INVALID_HANDLE_VALUE) {

View File

@@ -1 +1 @@
DO_API(0x92e180, 0x92e1f0, Il2CppString*, il2cpp_string_new, (const char* str));
DO_API(0x9D1AC0, 0x9CADC0, Il2CppString*, il2cpp_string_new, (const char* str));

View File

@@ -2,30 +2,14 @@ using namespace Genshin;
// DO_APP_FUNC(CN_OFFSET, OS_OFFSET, RETURN, FUNC_NAME, (ARGS...));
DO_APP_FUNC(0x68df290, 0x6822570, Il2CppString*, ToBase64String, (ByteArray* value, int offset, int length, void* method));
DO_APP_FUNC(0x258fd40, 0x2548e50, void, SetVersion, (void* obj, Il2CppString* value, void* method));
DO_APP_FUNC(0x272fe00, 0x26df410, void, SetVersion, (void* obj, Il2CppString* value, void* method));
DO_APP_FUNC(0x3220f00, 0x31c1650, void, XorEncrypt, (ByteArray** data, int length, void* method));
DO_APP_FUNC(0x710a730, 0x70401b0, ByteArray*, RecordUserData, (int32_t nType));
DO_APP_FUNC(0x12f5df0, 0x12ddd80, bool, KcpRecv, (void* client, ClientKcpEvent* evt, void* method));
DO_APP_FUNC(0x26a7940, 0x2658ae0, void, XorEncrypt, (ByteArray** data, int length, void* method));
DO_APP_FUNC(0x264ee90, 0x2606720, VOID, ForceQuit, (LPVOID obj));
DO_APP_FUNC(0x19d99a0, 0x19b12f0, int, KcpSend, (void* client, KcpPacket* pkt, void* method));
DO_APP_FUNC(0x624d630, 0x61bd630, LPVOID, GetSingletonManager, ());
DO_APP_FUNC(0x306e0e0, 0x3001bf0, bool, KcpRecv, (void* client, ClientKcpEvent* evt, void* method));
DO_APP_FUNC(0x6b832c0, 0x6ac2040, LPVOID, GetDefaultEncoding, ());
DO_APP_FUNC(0x6b82b50, 0x6ac18d0, Il2CppString*, GetString, (LPVOID encoding, LPVOID bytes));
DO_APP_FUNC(0x6b81980, 0x6ac0760, ByteArray*, GetBytes, (LPVOID encoding, LPVOID str));
DO_APP_FUNC(0x18a0490, 0x187a070, VOID, RequestLogin, (LPVOID obj, LPVOID token, UINT uid));
DO_APP_FUNC(0x3669cd0, 0x1b323c0, VOID, SetChecksum, (LPVOID obj, Il2CppString* value));
DO_APP_FUNC(0xed5d70, 0xecc910, VOID, ForceQuit, (LPVOID obj));
DO_APP_FUNC(0x57fb490, 0x574b7f0, LPVOID, GetSingletonManager, ());
DO_APP_FUNC(0x57fb1c0, 0x574b520, LPVOID, GetSingletonInstance, (LPVOID obj, Il2CppString* value));
DO_APP_FUNC(0x624d360, 0x61bd360, LPVOID, GetSingletonInstance, (LPVOID obj, Il2CppString* value));

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,3 @@
using namespace Genshin;
DO_UNI_FUNC(0x1003e0, 0x1003e0, ByteArray*, UnityEngine_RecordUserData, (int32_t nType));
DO_UNI_FUNC(0x103420, 0x103420, ByteArray*, UnityEngine_RecordUserData, (int32_t nType));

View File

@@ -68,3 +68,38 @@ HWND FindMainWindowByPID(DWORD pid) {
}
#pragma endregion
static const std::string base64_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
std::string base64_encode(BYTE const* buf, unsigned int bufLen) {
std::string ret;
int i = 0;
BYTE char_array_3[3];
BYTE char_array_4[4];
while (bufLen--) {
char_array_3[i++] = *buf++;
if (i == 3) {
char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
char_array_4[3] = char_array_3[2] & 0x3f;
for (i = 0; (i < 4); i++)
ret += base64_chars[char_array_4[i]];
i = 0;
}
}
if (i) {
int j;
for (j = i; j < 3; j++)
char_array_3[j] = '\0';
char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
char_array_4[3] = char_array_3[2] & 0x3f;
for (j = 0; j < i + 1; j++)
ret += base64_chars[char_array_4[j]];
while (i++ < 3)
ret += '=';
}
return ret;
}

View File

@@ -6,6 +6,7 @@ VOID DisableVMProtect();
bool IsLittleEndian();
HWND FindMainWindowByPID(DWORD pid);
string ToString(Il2CppString* str, UINT codePage = CP_ACP);
std::string base64_encode(BYTE const* buf, unsigned int bufLen);
#define cstring_new(str) il2cpp_string_new(str)
#define string_new(str) cstring_new((str).c_str())

26
res/App.Designer.cs generated
View File

@@ -121,7 +121,9 @@ namespace YaeAchievement.res {
///[3] Seelie.me
///[4] Csv file
///[5] Xunkong
///Input a number (0-5): .
///[7] Teyvat Guide
///[8] UIAF JSON File
///Input a number (0-8): .
/// </summary>
internal static string ExportChoose {
get {
@@ -157,7 +159,7 @@ namespace YaeAchievement.res {
}
/// <summary>
/// Looks up a localized string similar to Please update SnapGenshin and retry..
/// Looks up a localized string similar to Please update Snap Hutao and retry..
/// </summary>
internal static string ExportToSnapGenshinNeedUpdate {
get {
@@ -166,7 +168,7 @@ namespace YaeAchievement.res {
}
/// <summary>
/// Looks up a localized string similar to Successfully exported to snap genshin..
/// Looks up a localized string similar to Successfully exported to Snap Hutao..
/// </summary>
internal static string ExportToSnapGenshinSuccess {
get {
@@ -174,6 +176,24 @@ namespace YaeAchievement.res {
}
}
/// <summary>
/// Looks up a localized string similar to Please launch/update Teyvat Guide and retry..
/// </summary>
internal static string ExportToTauriFail {
get {
return ResourceManager.GetString("ExportToTauriFail", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Successfully exported to Teyvat Guide..
/// </summary>
internal static string ExportToTauriSuccess {
get {
return ResourceManager.GetString("ExportToTauriSuccess", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0}.
/// </summary>

View File

@@ -32,7 +32,9 @@
[3] Seelie.me
[4] Csv file
[5] Xunkong
Input a number (0-5): </value>
[7] Teyvat Guide
[8] UIAF JSON File
Input a number (0-8): </value>
</data>
<data name="ExportToCocogoatSuccess" xml:space="preserve">
<value>Successfully exported to cocogoat.</value>
@@ -41,10 +43,10 @@ Input a number (0-5): </value>
<value>{0}</value>
</data>
<data name="ExportToSnapGenshinSuccess" xml:space="preserve">
<value>Successfully exported to snap genshin.</value>
<value>Successfully exported to Snap Hutao.</value>
</data>
<data name="ExportToSnapGenshinNeedUpdate" xml:space="preserve">
<value>Please update SnapGenshin and retry.</value>
<value>Please update Snap Hutao and retry.</value>
</data>
<data name="ExportToFileSuccess" xml:space="preserve">
<value>Successfully exported to {0}</value>
@@ -129,4 +131,10 @@ Input a number (0-5): </value>
<data name="NoWritePermission" xml:space="preserve">
<value>No write permission on {0}.</value>
</data>
<data name="ExportToTauriSuccess" xml:space="preserve">
<value>Successfully exported to Teyvat Guide.</value>
</data>
<data name="ExportToTauriFail" xml:space="preserve">
<value>Please launch/update Teyvat Guide and retry.</value>
</data>
</root>

View File

@@ -20,14 +20,15 @@
<data name="ExportChoose" xml:space="preserve">
<value>导出至:
[0] 椰羊 (https://cocogoat.work/achievement, 默认)
[1] Snap.HuTao
[1] Snap Hutao
[2] Paimon.moe
[3] Seelie.me
[4] 表格文件
[5] 寻空
[6] 原魔工具箱
[7] UIAF JSON文件
输入一个数字 (0-7): </value>
[7] Teyvat Guide
[8] UIAF JSON 文件
输入一个数字 (0-8): </value>
</data>
<data name="ExportToCocogoatSuccess" xml:space="preserve">
<value>在浏览器内进行下一步操作</value>
@@ -36,10 +37,10 @@
<value>在小程序导入页面输入以下代码: {0}</value>
</data>
<data name="ExportToSnapGenshinSuccess" xml:space="preserve">
<value>在 SnapHutao 进行下一步操作</value>
<value>在 Snap Hutao 进行下一步操作</value>
</data>
<data name="ExportToSnapGenshinNeedUpdate" xml:space="preserve">
<value>更新 SnapHutao 最新版本后重试</value>
<value>更新/安装 Snap Hutao 最新版本后重试</value>
</data>
<data name="ExportToFileSuccess" xml:space="preserve">
<value>成就数据已导出至 {0}</value>
@@ -115,9 +116,15 @@
<value>网络错误,请检查网络后重试 ({0}: {1})</value>
</data>
<data name="GenshinHashError" xml:space="preserve">
<value>请将原神更新至最新版本后重试</value>
<value>当前适配版本不匹配,请更新原神至最新版本后重试或等待工具更新。</value>
</data>
<data name="NoWritePermission" xml:space="preserve">
<value>无法写入文件,请更换软件所在目录后重试</value>
</data>
<data name="ExportToTauriFail" xml:space="preserve">
<value>启动 Teyvat Guide 或更新 Teyvat Guide 至最新版本后重试</value>
</data>
<data name="ExportToTauriSuccess" xml:space="preserve">
<value>在 Teyvat Guide 进行下一步操作</value>
</data>
</root>

View File

@@ -9,13 +9,13 @@ message Achievement {
FINISHED = 2;
REWARD_TAKEN = 3;
}
uint32 timestamp = 15;
uint32 current = 5;
uint32 total = 14;
uint32 id = 3;
Status status = 10;
uint32 timestamp = 3;
uint32 current = 14;
uint32 total = 8;
uint32 id = 1;
Status status = 13;
}
message AchievementAllDataNotify {
repeated Achievement list = 4;
repeated Achievement list = 2;
}

View File

@@ -32,8 +32,9 @@ public static class Export {
4 => ToCSV,
5 => ToXunkong,
6 => ToWxApp1,
7 => ToUIAFJson,
8 => ToRawJson,
7 => ToTeyvatGuide,
8 => ToUIAFJson,
9 => ToRawJson,
_ => ToCocogoat
})).Invoke(data);
}
@@ -77,11 +78,38 @@ public static class Export {
}
private static void ToHuTao(AchievementAllDataNotify data) {
Utils.CopyToClipboard(JsonSerializer.Serialize(ExportToUIAFApp(data)));
Utils.ShellOpen("hutao://achievement/import");
Console.WriteLine(App.ExportToSnapGenshinSuccess);
if (CheckWinUIAppScheme("hutao")) {
Utils.CopyToClipboard(JsonSerializer.Serialize(ExportToUIAFApp(data)));
Utils.ShellOpen("hutao://achievement/import");
Console.WriteLine(App.ExportToSnapGenshinSuccess);
} else {
Console.WriteLine(App.ExportToSnapGenshinNeedUpdate);
Utils.ShellOpen("ms-windows-store://pdp/?productid=9PH4NXJ2JN52");
}
}
private static void ToXunkong(AchievementAllDataNotify data) {
if (CheckWinUIAppScheme("xunkong")) {
Utils.CopyToClipboard(JsonSerializer.Serialize(ExportToUIAFApp(data)));
Utils.ShellOpen("xunkong://import-achievement?caller=YaeAchievement&from=clipboard");
Console.WriteLine(App.ExportToXunkongSuccess);
} else {
Console.WriteLine(App.ExportToXunkongNeedUpdate);
Utils.ShellOpen("ms-windows-store://pdp/?productid=9N2SVG0JMT12");
}
}
private static void ToTeyvatGuide(AchievementAllDataNotify data) {
if (Process.GetProcessesByName("TeyvatGuide").Any()) {
Utils.CopyToClipboard(JsonSerializer.Serialize(ExportToUIAFApp(data)));
Utils.ShellOpen("teyvatguide://import_uigf?app=YaeAchievement");
Console.WriteLine(App.ExportToTauriSuccess);
} else {
Console.WriteLine(App.ExportToTauriFail);
Utils.ShellOpen("ms-windows-store://pdp/?productid=9NLBNNNBNSJN");
}
}
// ReSharper disable once InconsistentNaming
private static void ToUIAFJson(AchievementAllDataNotify data) {
var path = Path.GetFullPath($"uiaf-{DateTime.Now:yyyyMMddHHmmss}.json");
@@ -160,17 +188,6 @@ public static class Export {
}
}
private static void ToXunkong(AchievementAllDataNotify data) {
if (CheckXunkongScheme()) {
Utils.CopyToClipboard(JsonSerializer.Serialize(ExportToUIAFApp(data)));
Utils.ShellOpen("xunkong://import-achievement?caller=YaeAchievement&from=clipboard");
Console.WriteLine(App.ExportToXunkongSuccess);
} else {
Console.WriteLine(App.ExportToXunkongNeedUpdate);
Utils.ShellOpen("ms-windows-store://pdp/?productid=9N2SVG0JMT12");
}
}
private static void ToRawJson(AchievementAllDataNotify data) {
var path = Path.GetFullPath($"export-{DateTime.Now:yyyyMMddHHmmss}-raw.json");
var text = JsonSerializer.Serialize(data, new JsonSerializerOptions {
@@ -203,8 +220,8 @@ public static class Export {
};
}
private static bool CheckXunkongScheme() {
return (string?)Registry.ClassesRoot.OpenSubKey("xunkong")?.GetValue("") == "URL:xunkong";
private static bool CheckWinUIAppScheme(string protocol) {
return (string?)Registry.ClassesRoot.OpenSubKey(protocol)?.GetValue("") == $"URL:{protocol}";
}
private static string JoinToString(this IEnumerable<object> list, string separator) {

View File

@@ -20,8 +20,8 @@ public static class GlobalVars {
public static readonly string CachePath = Path.Combine(DataPath, "cache");
public static readonly string LibFilePath = Path.Combine(DataPath, "YaeAchievement.dll");
public const uint AppVersionCode = 38;
public const string AppVersionName = "2.8";
public const uint AppVersionCode = 41;
public const string AppVersionName = "3.1";
public const string PipeName = "YaeAchievementPipe";
public const string BucketHost = "https://cn-cd-1259389942.file.myqcloud.com";

View File

@@ -92,7 +92,7 @@ public static class Utils {
public static void CheckUpdate(bool useLocalLib) {
var info = UpdateInfo.Parser.ParseFrom(GetBucketFileAsByteArray("schicksal/version"))!;
if (GlobalVars.AppVersionCode != info.VersionCode) {
if (GlobalVars.AppVersionCode < info.VersionCode) {
Console.WriteLine(App.UpdateNewVersion, GlobalVars.AppVersionName, info.VersionName);
Console.WriteLine(App.UpdateDescription, info.Description);
if (info.EnableAutoDownload) {