From 30b23c85cbbd357012f8d43dcbb08acde1076393 Mon Sep 17 00:00:00 2001 From: Zichao Lin Date: Wed, 18 Jan 2023 09:55:25 +0800 Subject: [PATCH 1/2] update appversion --- .gitignore | 3 ++- config.js | 2 +- index.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 4c4b9b9..93fb242 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ configs/ node_modules/ -pnpm-lock.yaml \ No newline at end of file +pnpm-lock.yaml +yarn.lock \ No newline at end of file diff --git a/config.js b/config.js index 8b0b63b..a0859dc 100644 --- a/config.js +++ b/config.js @@ -6,7 +6,7 @@ const nodemailer = require('nodemailer') exports.NotificationURL = 'https://api-cloudgame.mihoyo.com/hk4e_cg_cn/gamer/api/listNotifications?status=NotificationStatusUnread&type=NotificationTypePopup&is_sort=true' exports.WalletURL = 'https://api-cloudgame.mihoyo.com/hk4e_cg_cn/wallet/wallet/get' exports.AnnouncementURL = 'https://api-cloudgame.mihoyo.com/hk4e_cg_cn/gamer/api/getAnnouncementInfo' -exports.AppVersionURL = 'https://api-cloudgame-static.mihoyo.com/hk4e_cg_cn/gamer/api/getFunctionShieldNew?client_type=1' +exports.AppVersionURL = 'https://sdk-static.mihoyo.com/hk4e_cn/mdk/launcher/api/resource?key=eYd89JmJ&launcher_id=18' exports.Notification = function(header) { let tmp = JSON.parse(request("GET",exports.NotificationURL,{ diff --git a/index.js b/index.js index 0a3e015..389b09c 100644 --- a/index.js +++ b/index.js @@ -48,7 +48,7 @@ log.info("检测完毕!") log.info("正在获取版本号") var appversion = AppVersion(); -appversion = appversion.data.config["cg.key_function_video_mode"].versions["0"] +appversion = appversion.data.game.latest.version log.info(`获取成功!当前版本号:${appversion}`) var successNum = 0,totalNum = 0; for(key in configs) { From d7961d4d038b2572bf018cc5f5973492b8096be1 Mon Sep 17 00:00:00 2001 From: Zichao Lin Date: Fri, 3 Feb 2023 12:11:08 +0800 Subject: [PATCH 2/2] update appversion url update appversion url to the official cloud game update check url --- config.js | 3 ++- index.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config.js b/config.js index a0859dc..7dd828c 100644 --- a/config.js +++ b/config.js @@ -6,7 +6,8 @@ const nodemailer = require('nodemailer') exports.NotificationURL = 'https://api-cloudgame.mihoyo.com/hk4e_cg_cn/gamer/api/listNotifications?status=NotificationStatusUnread&type=NotificationTypePopup&is_sort=true' exports.WalletURL = 'https://api-cloudgame.mihoyo.com/hk4e_cg_cn/wallet/wallet/get' exports.AnnouncementURL = 'https://api-cloudgame.mihoyo.com/hk4e_cg_cn/gamer/api/getAnnouncementInfo' -exports.AppVersionURL = 'https://sdk-static.mihoyo.com/hk4e_cn/mdk/launcher/api/resource?key=eYd89JmJ&launcher_id=18' +// Here must be an earlier version so that the response won't be null +exports.AppVersionURL = 'https://api-takumi.mihoyo.com/ptolemaios/api/getLatestRelease?app_id=1953443910&app_version=3.3.0&channel=mihoyo' exports.Notification = function(header) { let tmp = JSON.parse(request("GET",exports.NotificationURL,{ diff --git a/index.js b/index.js index 389b09c..8e40021 100644 --- a/index.js +++ b/index.js @@ -48,7 +48,7 @@ log.info("检测完毕!") log.info("正在获取版本号") var appversion = AppVersion(); -appversion = appversion.data.game.latest.version +appversion = appversion.data.package_version log.info(`获取成功!当前版本号:${appversion}`) var successNum = 0,totalNum = 0; for(key in configs) {