From e2322402914b2a0d230be4a2ee6d9e8f298ab238 Mon Sep 17 00:00:00 2001 From: blackmatrix7 <27717518+blackmatrix7@users.noreply.github.com> Date: Fri, 23 Dec 2022 10:25:49 +0800 Subject: [PATCH] =?UTF-8?q?[TestFlight]=20=E6=94=AF=E6=8C=81=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89storefrontId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/boxjs.json | 8 ++++++++ script/testflight/testflight.js | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/script/boxjs.json b/script/boxjs.json index a87933adcf1..6e825b02ed4 100644 --- a/script/boxjs.json +++ b/script/boxjs.json @@ -545,6 +545,7 @@ "tf_loop_count", "tf_session_info", "tf_joined_app_id", + "tf_storefront_id", "tf_invalid_app_id", "tf_check_account_id", "tf_join_concurrency", @@ -645,6 +646,13 @@ "placeholder": "", "autoGrow": true, "desc": "选择一个账号专门用于检测TF是否可以加入,以保护主号" + }, + { + "id": "tf_storefront_id", + "name": "自定义storefrontId", + "val": "143441-19,29", + "type": "input", + "desc": "自定义storefrontId,以解决国区账号TestFlight下载App受限问题" } ], "icons": [ diff --git a/script/testflight/testflight.js b/script/testflight/testflight.js index 682ea6c248b..5258baacc7a 100644 --- a/script/testflight/testflight.js +++ b/script/testflight/testflight.js @@ -6,6 +6,7 @@ const tfSessionInfoKey = "tf_session_info"; const tfCheckSessionTimeKey = "tf_check_session_time"; const tfCheckSessionTimeDiffKey = "tf_check_session_time_diff"; const tfAppUseAccountIdKey = "tf_app_use_account_id"; +const tfStorefrontId = "tf_storefront_id"; const getSessionRegex = /^https:\/\/testflight\.apple\.com\/v3\/accounts\/(\w{8}-\w{4}-\w{4}-\w{4}-\w{12})\/apps$/; const getFullAppIdRegex = /^https:\/\/testflight\.apple\.com\/v3\/accounts\/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}\/ru\/([a-zA-Z0-9]{8})$/; const modifyTFRequest = /^https:\/\/testflight\.apple\.com\/v\d\/accounts\/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}\/apps\/\d+/ @@ -79,7 +80,7 @@ function modifyRequest() { } } if (/\/install$/.test($.request.url) && Object.keys(body).length > 0) { - body.storefrontId = "143441-19,29"; + body.storefrontId = $.data.read(tfStorefrontId, "143441-19,29"); } return [url, headers, JSON.stringify(body)]; }