Compare commits

...

14 Commits

7 changed files with 36 additions and 24 deletions

View File

@ -35,7 +35,7 @@ const start = async () => {
await fs.outputJSON(path.join(outputPath, 'manifest.json'), { await fs.outputJSON(path.join(outputPath, 'manifest.json'), {
active: true, active: true,
version, version,
from: '0.1.5', from: '0.0.1',
name: `${hashName}.zip`, name: `${hashName}.zip`,
hash: sha256 hash: sha256
}) })

View File

@ -14,7 +14,7 @@
## 使用说明 ## 使用说明
1. 下载工具后解压 - 下载地址: [Github](https://github.com/biuuu/star-rail-warp-export/releases/latest/download/StarRailWarpExport.zip) / [蓝奏云]() 1. 下载工具后解压 - 下载地址: [Github](https://github.com/biuuu/star-rail-warp-export/releases/latest/download/StarRailWarpExport.zip) / [蓝奏云](https://wwvt.lanzoum.com/b022mikwh) 密码:f1iy
2. 打开游戏的跃迁历史记录 2. 打开游戏的跃迁历史记录
3. 点击工具的“加载数据”按钮 3. 点击工具的“加载数据”按钮

View File

@ -1,6 +1,6 @@
{ {
"name": "star-rail-warp-export", "name": "star-rail-warp-export",
"version": "0.0.1", "version": "0.0.7",
"main": "./dist/electron/main/main.js", "main": "./dist/electron/main/main.js",
"author": "biuuu <https://github.com/biuuu>", "author": "biuuu <https://github.com/biuuu>",
"license": "MIT", "license": "MIT",

View File

@ -83,6 +83,6 @@
"excel.customFont": "微软雅黑", "excel.customFont": "微软雅黑",
"excel.filePrefix": "星穹铁道跃迁记录", "excel.filePrefix": "星穹铁道跃迁记录",
"excel.fileType": "Excel文件", "excel.fileType": "Excel文件",
"ui.extra.cacheClean": "1. 确认是否已经打开游戏内的抽卡历史记录,如果仍然出现“身份认证已过期”的错误,再尝试下面的步骤\n2. 关闭原神的游戏窗口\n3. 点击上方的“打开缓存文件夹”按钮打开Cache文件夹\n4. 删除Cache_Data文件夹\n5. 启动原神游戏,打开游戏内抽卡历史记录页面\n6. 关闭这个对话框,再点击“更新数据”按钮", "ui.extra.cacheClean": "1. 确认是否已经打开游戏内的抽卡历史记录,如果仍然出现“身份认证已过期”的错误,再尝试下面的步骤\n2. 关闭星穹铁道的游戏窗口\n3. 点击上方的“打开缓存文件夹”按钮打开Cache文件夹\n4. 删除Cache_Data文件夹\n5. 启动星穹铁道游戏,打开游戏内抽卡历史记录页面\n6. 关闭这个对话框,再点击“更新数据”按钮",
"ui.extra.findCacheFolder": "如果点“打开缓存文件夹”按钮没有反应,可以手动找到游戏的网页缓存文件夹,目录为“你的游戏安装路径/Star Rail/Game/StarRail_Data/webCaches/Cache/”" "ui.extra.findCacheFolder": "如果点“打开缓存文件夹”按钮没有反应,可以手动找到游戏的网页缓存文件夹,目录为“你的游戏安装路径/Star Rail/Game/StarRail_Data/webCaches/Cache/”"
} }

View File

@ -18,7 +18,6 @@ const saveData = async (data, url) => {
const obj = Object.assign({}, data) const obj = Object.assign({}, data)
obj.result = [...obj.result] obj.result = [...obj.result]
obj.typeMap = [...obj.typeMap] obj.typeMap = [...obj.typeMap]
config.urls.set(data.uid, url)
await config.save() await config.save()
await saveJSON(`gacha-list-${data.uid}.json`, obj) await saveJSON(`gacha-list-${data.uid}.json`, obj)
} }
@ -85,17 +84,17 @@ const detectGameLocale = async (userPath) => {
const getLatestUrl = (list) => { const getLatestUrl = (list) => {
let result = list[list.length - 1] let result = list[list.length - 1]
let time = 0 // let time = 0
for (let i = 0; i < list.length; i++) { // for (let i = 0; i < list.length; i++) {
const tsMch = list[i].match(/timestamp=(\d+)/) // const tsMch = list[i].match(/timestamp=(\d+)/)
if (tsMch?.[1]) { // if (tsMch?.[1]) {
const ts = parseInt(tsMch[1]) // const ts = parseInt(tsMch[1])
if (time < parseInt(tsMch[1])) { // if (time <= parseInt(tsMch[1])) {
time = ts // time = ts
result = list[i] // result = list[i]
} // }
} // }
} // }
return result return result
} }
@ -116,10 +115,13 @@ const readLog = async () => {
} }
const promises = logPaths.map(async logpath => { const promises = logPaths.map(async logpath => {
const logText = await fs.readFile(logpath, 'utf8') const logText = await fs.readFile(logpath, 'utf8')
const gamePathMch = logText.match(/\w:\/.+(Star\sRail\/Game\/StarRail_Data)/) const gamePathMch = logText.match(/\w:\/.*?\/StarRail_Data\//)
if (gamePathMch) { if (gamePathMch) {
const cacheText = await fs.readFile(path.join(gamePathMch[0], '/webCaches/Cache/Cache_Data/data_2'), 'utf8') let cacheText = ''
const urlMch = cacheText.match(/https.+?&auth_appid=webview_gacha&.+?authkey=.+?&game_biz=hkrpg_.+/g) try {
cacheText = await fs.readFile(path.join(gamePathMch[0], '/webCaches/Cache/Cache_Data/data_2'), 'utf8')
} catch (e) {}
const urlMch = cacheText.match(/https.+?&auth_appid=webview_gacha&.+?authkey=.+?&game_biz=hkrpg_.+?&plat_type=pc/g)
if (urlMch) { if (urlMch) {
cacheFolder = path.join(gamePathMch[0], '/webCaches/Cache/') cacheFolder = path.join(gamePathMch[0], '/webCaches/Cache/')
return getLatestUrl(urlMch) return getLatestUrl(urlMch)
@ -457,7 +459,7 @@ ipcMain.handle('READ_DATA', async () => {
}) })
ipcMain.handle('CHANGE_UID', (event, uid) => { ipcMain.handle('CHANGE_UID', (event, uid) => {
config.current = uid changeCurrent(uid)
}) })
ipcMain.handle('GET_CONFIG', () => { ipcMain.handle('GET_CONFIG', () => {

View File

@ -42,14 +42,24 @@ const parseData = (data) => {
return result return result
} }
const assignData = (objA, objB) => {
const temp = { ...objA }
for (let key in objB) {
if (objB[key]) {
temp[key] = objB[key]
}
}
return temp
}
const i18nMap = new Map() const i18nMap = new Map()
const prepareData = () => { const prepareData = () => {
for (let key in raw) { for (let key in raw) {
let temp = {} let temp = {}
if (key === 'zh-tw') { if (key === 'zh-tw') {
Object.assign(temp, raw['zh-cn'], raw[key]) temp = assignData(raw['zh-cn'], raw[key])
} else { } else {
Object.assign(temp, raw['zh-cn'], raw['en-us'], raw[key]) temp = assignData(raw['zh-cn'], assignData(raw['en-us'], raw[key]))
} }
i18nMap.set(key, parseData(temp)) i18nMap.set(key, parseData(temp))
} }

View File

@ -1,11 +1,11 @@
import * as IconComponents from '@element-plus/icons-vue' import * as IconComponents from '@element-plus/icons-vue'
const weaponTypeNames = new Set([ const weaponTypeNames = new Set([
'光锥', 'Light Cone', '光錐', 'Lichtkegel', 'Conos de luz', 'cônes de lumière', '光円錐', '광추', 'Cones de Luz', 'Световые конусы', 'Nón Ánh Sáng' '光锥', '光錐', 'Lichtkegel', 'Light Cone', 'Conos de luz', 'cônes de lumière', '光円錐', '광추', 'Cones de Luz', 'Световые конусы', 'Nón Ánh Sáng'
]) ])
const characterTypeNames = new Set([ const characterTypeNames = new Set([
'角色', 'Character', '캐릭터', 'キャラクター', 'Personaje', 'Personnage', 'Персонажи', 'ตัวละคร', 'Nhân Vật', 'Figur', 'Karakter', 'Personagem' '角色', 'Figur', 'Character', 'Personajes', 'Personnages', 'Karakter', 'キャラクター', '캐릭터', 'Personagens', 'Персонажи', 'ตัวละคร', 'Nhân Vật'
]) ])
const isCharacter = (name) => characterTypeNames.has(name) const isCharacter = (name) => characterTypeNames.has(name)