[TestFlight] 支持自定义storefrontId

This commit is contained in:
blackmatrix7 2022-12-23 10:25:49 +08:00
parent c4b66cf934
commit e232240291
2 changed files with 10 additions and 1 deletions

View File

@ -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": [

View File

@ -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)];
}