mirror of
https://github.com/HolographicHat/Yae.git
synced 2025-12-17 03:48:16 +08:00
Update message
This commit is contained in:
10
README.md
10
README.md
@@ -1,9 +1,13 @@
|
|||||||
# 原神成就导出工具
|
<div align="center">
|
||||||
|
|
||||||
|
# YaeAchievement
|
||||||
|
|
||||||
    
|
    
|
||||||
|
|
||||||
- 支持导出所有成就
|
</div>
|
||||||
- 支持官服,B服与国际服
|
|
||||||
|
- 支持导出所有类别的成就
|
||||||
|
- 支持官服,渠道服与国际服
|
||||||
- 支持导出至[椰羊](https://cocogoat.work/achievement)、[SnapGenshin](https://github.com/DGP-Studio/Snap.Genshin)、[Paimon.moe](https://paimon.moe/achievement/)、[Seelie.me](https://seelie.me/achievements)和表格文件(csv)
|
- 支持导出至[椰羊](https://cocogoat.work/achievement)、[SnapGenshin](https://github.com/DGP-Studio/Snap.Genshin)、[Paimon.moe](https://paimon.moe/achievement/)、[Seelie.me](https://seelie.me/achievements)和表格文件(csv)
|
||||||
- 没有窗口大小、游戏语言等要求
|
- 没有窗口大小、游戏语言等要求
|
||||||
|
|
||||||
|
|||||||
6
app.js
6
app.js
@@ -2,12 +2,13 @@ const proxy = require("udp-proxy")
|
|||||||
const cp = require("child_process")
|
const cp = require("child_process")
|
||||||
const appcenter = require("./appcenter")
|
const appcenter = require("./appcenter")
|
||||||
const regionServer = require("./regionServer")
|
const regionServer = require("./regionServer")
|
||||||
|
const cloud = require("./generated/secret")
|
||||||
const {
|
const {
|
||||||
initConfig, splitPacket, upload, decodeProto, log, setupHost, KPacket, debug, checkUpdate,
|
initConfig, splitPacket, upload, decodeProto, log, setupHost, KPacket, debug, checkUpdate,
|
||||||
brotliCompressSync, brotliDecompressSync, checkGameIsRunning, checkPortIsUsing
|
brotliCompressSync, brotliDecompressSync, checkGameIsRunning, checkPortIsUsing
|
||||||
} = require("./utils")
|
} = require("./utils")
|
||||||
const { exportData } = require("./export")
|
const { exportData } = require("./export")
|
||||||
const { enablePrivilege, pause } = require("./native")
|
const { enablePrivilege, pause } = require("./generated/native")
|
||||||
|
|
||||||
const onExit = () => {
|
const onExit = () => {
|
||||||
setupHost(true)
|
setupHost(true)
|
||||||
@@ -37,6 +38,7 @@ const onExit = () => {
|
|||||||
}
|
}
|
||||||
appcenter.startup()
|
appcenter.startup()
|
||||||
let conf = await initConfig()
|
let conf = await initConfig()
|
||||||
|
cloud.init(conf)
|
||||||
checkPortIsUsing()
|
checkPortIsUsing()
|
||||||
checkGameIsRunning()
|
checkGameIsRunning()
|
||||||
log("检查更新")
|
log("检查更新")
|
||||||
@@ -121,7 +123,7 @@ const onExit = () => {
|
|||||||
log(`请求ID: ${response.headers["x-api-requestid"]}`)
|
log(`请求ID: ${response.headers["x-api-requestid"]}`)
|
||||||
log("请联系开发者以获取帮助")
|
log("请联系开发者以获取帮助")
|
||||||
} else {
|
} else {
|
||||||
const proto = await decodeProto(data,"AllAchievement")
|
const proto = await decodeProto(data, "Notify1")
|
||||||
await exportData(proto)
|
await exportData(proto)
|
||||||
}
|
}
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
const axios = require("axios")
|
const axios = require("axios")
|
||||||
const crypto = require("crypto")
|
const crypto = require("crypto")
|
||||||
const { version } = require("./version")
|
const { version } = require("./version")
|
||||||
const { getDeviceID, getDeviceInfo } = require("./native")
|
const { getDeviceID, getDeviceInfo } = require("./generated/native")
|
||||||
|
|
||||||
const getTimestamp = (d = new Date()) => {
|
const getTimestamp = (d = new Date()) => {
|
||||||
const p = i => i.toString().padStart(2, "0")
|
const p = i => i.toString().padStart(2, "0")
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ const axios = require("axios")
|
|||||||
const readline = require("readline")
|
const readline = require("readline")
|
||||||
const { version } = require("./version")
|
const { version } = require("./version")
|
||||||
const { loadCache, log, openUrl } = require("./utils")
|
const { loadCache, log, openUrl } = require("./utils")
|
||||||
const { checkSnapFastcall, copyToClipboard } = require("./native")
|
const { checkSnapFastcall, copyToClipboard } = require("./generated/native")
|
||||||
|
|
||||||
const exportToSeelie = proto => {
|
const exportToSeelie = proto => {
|
||||||
const out = { achievements: {} }
|
const out = { achievements: {} }
|
||||||
@@ -76,7 +76,7 @@ const exportToCocogoat = async proto => {
|
|||||||
if (retcode > 32) {
|
if (retcode > 32) {
|
||||||
log("在浏览器内进行下一步操作")
|
log("在浏览器内进行下一步操作")
|
||||||
} else {
|
} else {
|
||||||
log(`导出失败,请联系开发者以获取帮助 (26-3-${retcode})`)
|
log(`打开此链接以进行下一步操作: https://cocogoat.work/achievement?memo=${response.data.key}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
"src/wmi/wmi.cpp",
|
"src/wmi/wmi.cpp",
|
||||||
"src/wmi/wmi.hpp",
|
"src/wmi/wmi.hpp",
|
||||||
"src/wmi/unistd.h",
|
"src/wmi/unistd.h",
|
||||||
|
"src/VMProtectSDK.h",
|
||||||
"src/wmi/wmiresult.cpp",
|
"src/wmi/wmiresult.cpp",
|
||||||
"src/wmi/wmiresult.hpp",
|
"src/wmi/wmiresult.hpp",
|
||||||
"src/wmi/wmiclasses.hpp",
|
"src/wmi/wmiclasses.hpp",
|
||||||
@@ -35,7 +36,12 @@
|
|||||||
"AdditionalOptions": [
|
"AdditionalOptions": [
|
||||||
"-std:c++latest",
|
"-std:c++latest",
|
||||||
"-DUNICODE",
|
"-DUNICODE",
|
||||||
"-sdl"
|
"-sdl",
|
||||||
|
"-O2",
|
||||||
|
"-Ot",
|
||||||
|
"-Oi",
|
||||||
|
"-GL",
|
||||||
|
"-Gw"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "node-gyp rebuild && copy .\\build\\Release\\native.node ..\\genshin-export\\generated",
|
"build": "node-gyp build && copy .\\build\\Release\\native.node ..\\genshin-export\\generated",
|
||||||
|
"rebuild": "node-gyp rebuild && copy .\\build\\Release\\native.node ..\\genshin-export\\generated",
|
||||||
"build-for-win7": "node-gyp rebuild --target=v14.17.0 && copy .\\build\\Release\\native.node ..\\genshin-export\\generated"
|
"build-for-win7": "node-gyp rebuild --target=v14.17.0 && copy .\\build\\Release\\native.node ..\\genshin-export\\generated"
|
||||||
},
|
},
|
||||||
"gypfile": true,
|
"gypfile": true,
|
||||||
|
|||||||
@@ -1,89 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
message QueryRegionList {
|
|
||||||
message SimpleInfo {
|
|
||||||
string name = 2;
|
|
||||||
string url = 4;
|
|
||||||
}
|
|
||||||
int32 retcode = 1;
|
|
||||||
repeated SimpleInfo list = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message QueryCurRegion {
|
|
||||||
message ResVersion {
|
|
||||||
uint32 v = 1;
|
|
||||||
}
|
|
||||||
message RegionInfo {
|
|
||||||
string ip = 1;
|
|
||||||
uint32 port = 2;
|
|
||||||
uint32 cdv = 14;
|
|
||||||
uint32 csv = 18;
|
|
||||||
ResVersion res = 22;
|
|
||||||
bytes sec = 23;
|
|
||||||
}
|
|
||||||
int32 retcode = 1;
|
|
||||||
string message = 2;
|
|
||||||
RegionInfo info = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
message Req1 {
|
|
||||||
uint32 t = 1;
|
|
||||||
string u = 2;
|
|
||||||
string tk = 3;
|
|
||||||
uint32 pl = 7;
|
|
||||||
uint32 ch = 11;
|
|
||||||
uint32 sc = 12;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Rsp1 {
|
|
||||||
int32 ret = 1;
|
|
||||||
string msg = 2;
|
|
||||||
uint32 uid = 3;
|
|
||||||
uint64 sd = 11;
|
|
||||||
bytes rc = 12;
|
|
||||||
string cv = 22;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Req2 {
|
|
||||||
string tk = 1;
|
|
||||||
string cv = 2;
|
|
||||||
string sv = 3;
|
|
||||||
string dn = 4;
|
|
||||||
string du = 5;
|
|
||||||
uint32 ln = 9;
|
|
||||||
uint32 at = 10;
|
|
||||||
string di = 13;
|
|
||||||
uint32 pf = 14;
|
|
||||||
string cs = 18;
|
|
||||||
bytes rc = 21;
|
|
||||||
uint32 sc = 25;
|
|
||||||
string cvc = 26;
|
|
||||||
uint32 cvd = 30;
|
|
||||||
string cvh = 34;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Notify1 {
|
|
||||||
message Achievement {
|
|
||||||
enum Status {
|
|
||||||
INVALID = 0;
|
|
||||||
UNFINISHED = 1;
|
|
||||||
FINISHED = 2;
|
|
||||||
REWARD_TAKEN = 3;
|
|
||||||
}
|
|
||||||
uint32 id = 1;
|
|
||||||
Status status = 2;
|
|
||||||
uint32 current = 3;
|
|
||||||
uint32 require = 4;
|
|
||||||
uint32 finishTimestamp = 5;
|
|
||||||
}
|
|
||||||
repeated Achievement list = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Notify2 { // 4612 HWAvatarReward
|
|
||||||
repeated uint32 id = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message Notify3 { // 4571 HWBGM
|
|
||||||
repeated uint32 id = 1;
|
|
||||||
}
|
|
||||||
@@ -3,7 +3,7 @@ const https = require("https")
|
|||||||
const axios = require("axios")
|
const axios = require("axios")
|
||||||
const { decodeProto, encodeProto, debug } = require("./utils")
|
const { decodeProto, encodeProto, debug } = require("./utils")
|
||||||
const path = require("path")
|
const path = require("path")
|
||||||
const cert = path.join(__dirname, "./cert/root.p12")
|
const cert = path.join(__dirname, "./cache/cert/root.p12")
|
||||||
|
|
||||||
const preparedRegions = {}
|
const preparedRegions = {}
|
||||||
let currentProxy = undefined
|
let currentProxy = undefined
|
||||||
|
|||||||
26
utils.js
26
utils.js
@@ -2,8 +2,8 @@ const fs = require("fs")
|
|||||||
const dns = require("dns")
|
const dns = require("dns")
|
||||||
const ini = require("ini")
|
const ini = require("ini")
|
||||||
const zlib = require("zlib")
|
const zlib = require("zlib")
|
||||||
const cloud = require("./secret")
|
const cloud = require("./generated/secret")
|
||||||
const native = require("./native")
|
const native = require("./generated/native")
|
||||||
const readline = require("readline")
|
const readline = require("readline")
|
||||||
const protobuf = require("protobufjs")
|
const protobuf = require("protobufjs")
|
||||||
const { version } = require("./version")
|
const { version } = require("./version")
|
||||||
@@ -11,17 +11,16 @@ const { promisify } = require("util")
|
|||||||
const { createHash } = require("crypto")
|
const { createHash } = require("crypto")
|
||||||
const path = require("path")
|
const path = require("path")
|
||||||
const { uploadEvent } = require("./appcenter")
|
const { uploadEvent } = require("./appcenter")
|
||||||
const messages = path.join(__dirname, "./proto/Messages.proto")
|
|
||||||
|
|
||||||
const encodeProto = (object, name) => protobuf.load(messages).then(r => {
|
const messages = protobuf.loadSync(path.join(__dirname, "./generated/Messages.proto"))
|
||||||
const msgType = r.lookupType(name)
|
|
||||||
|
const encodeProto = (object, name) => {
|
||||||
|
const msgType = messages.lookupType(name)
|
||||||
const msgInst = msgType.create(object)
|
const msgInst = msgType.create(object)
|
||||||
return msgType.encode(msgInst).finish()
|
return msgType.encode(msgInst).finish()
|
||||||
})
|
}
|
||||||
|
|
||||||
const decodeProto = (buf, name) => protobuf.load(messages).then(r => {
|
const decodeProto = (buf, name) => messages.lookupType(name).decode(buf)
|
||||||
return r.lookupType(name).decode(buf)
|
|
||||||
})
|
|
||||||
|
|
||||||
const checkPath = path => new Promise((resolve, reject) => {
|
const checkPath = path => new Promise((resolve, reject) => {
|
||||||
if (!fs.existsSync(`${path}/UnityPlayer.dll`) || !fs.existsSync(`${path}/pkg_version`)) {
|
if (!fs.existsSync(`${path}/UnityPlayer.dll`) || !fs.existsSync(`${path}/pkg_version`)) {
|
||||||
@@ -189,7 +188,7 @@ const loadCache = async (fp = "latest-data") => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const isDebug = false
|
const isDebug = true
|
||||||
|
|
||||||
const debug = (msg, ...params) => {
|
const debug = (msg, ...params) => {
|
||||||
if (isDebug) log(msg, ...params)
|
if (isDebug) log(msg, ...params)
|
||||||
@@ -208,11 +207,12 @@ const upload = async data => {
|
|||||||
const checkUpdate = async () => {
|
const checkUpdate = async () => {
|
||||||
const data = (await cloud.fetchBucket("/latest.json")).data
|
const data = (await cloud.fetchBucket("/latest.json")).data
|
||||||
if (data["vc"] !== version.code) {
|
if (data["vc"] !== version.code) {
|
||||||
log(`有可用更新: ${version.name} => ${data["vn"]}`)
|
console.log(`有可用更新: ${version.name} => ${data["vn"]}`)
|
||||||
log(`更新内容: \n${data["ds"]}`)
|
console.log(`更新内容: \n${data["ds"]}`)
|
||||||
log("下载地址: https://github.com/HolographicHat/genshin-achievement-export/releases\n")
|
console.log("下载地址: https://github.com/HolographicHat/YaeAchievement/releases")
|
||||||
}
|
}
|
||||||
if (data["fc"] === true) {
|
if (data["fc"] === true) {
|
||||||
|
console.log(" * 这是一次强制更新")
|
||||||
process.exit(410)
|
process.exit(410)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user