Skip to content

Commit c0d627d

Browse files
committed
feat: 同步配置文件
Update request.dev.js Update request.js
1 parent c0beec9 commit c0d627d

File tree

4 files changed

+17
-95
lines changed

4 files changed

+17
-95
lines changed

src/request.dev.js

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,6 @@ Console.info(`PLATFORM: ${PLATFORM}`);
8080
//Console.debug(`$request: ${JSON.stringify($request, null, 2)}`);
8181
let rawBody = $app === "Quantumult X" ? new Uint8Array($request.bodyBytes ?? []) : ($request.body ?? new Uint8Array());
8282
//Console.debug(`isBuffer? ${ArrayBuffer.isView(rawBody)}: ${JSON.stringify(rawBody, null, 2)}`);
83-
switch (url.hostname) {
84-
case "dispatcher.is.autonavi.com":
85-
switch (url.pathname) {
86-
case "/dispatcher": {
87-
break;
88-
}
89-
}
90-
break;
91-
case "gsp-ssl.ls.apple.com":
92-
switch (url.pathname) {
93-
case "/dispatcher.arpc": {
94-
break;
95-
}
96-
}
97-
break;
98-
}
9983
// 写入二进制数据
10084
$request.body = rawBody;
10185
break;
@@ -117,14 +101,7 @@ Console.info(`PLATFORM: ${PLATFORM}`);
117101
break;
118102
}
119103
break;
120-
case "gspe1-ssl.ls.apple.com":
121-
switch (url.pathname) {
122-
case "/pep/gcc":
123-
break;
124-
}
125-
break;
126104
case "gspe35-ssl.ls.apple.com":
127-
case "gspe35-ssl.ls.apple.cn":
128105
switch (url.pathname) {
129106
case "/config/announcements":
130107
switch (Settings?.Config?.Announcements?.Environment) {
@@ -155,7 +132,7 @@ Console.info(`PLATFORM: ${PLATFORM}`);
155132
case "AUTO":
156133
switch (Caches?.pep?.gcc) {
157134
default:
158-
url.searchParams.set("country_code", Caches?.pep?.gcc ?? "US");
135+
url.searchParams.set("country_code", Caches.pep.gcc);
159136
break;
160137
case "CN":
161138
case undefined:

src/request.js

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -101,27 +101,7 @@ Console.info(`PLATFORM: ${PLATFORM}`);
101101
break;
102102
}
103103
break;
104-
case "gspe1-ssl.ls.apple.com":
105-
switch (url.pathname) {
106-
case "/pep/gcc":
107-
/* // 不使用 echo response
108-
$response = {
109-
status: 200,
110-
headers: {
111-
"Content-Type": "text/html",
112-
Date: new Date().toUTCString(),
113-
Connection: "keep-alive",
114-
"Content-Encoding": "identity",
115-
},
116-
body: Settings.PEP.GCC,
117-
};
118-
Console.debug(JSON.stringify($response));
119-
*/
120-
break;
121-
}
122-
break;
123104
case "gspe35-ssl.ls.apple.com":
124-
case "gspe35-ssl.ls.apple.cn":
125105
switch (url.pathname) {
126106
case "/config/announcements":
127107
switch (Settings?.Config?.Announcements?.Environment) {
@@ -141,7 +121,7 @@ Console.info(`PLATFORM: ${PLATFORM}`);
141121
case "AUTO":
142122
switch (Caches?.pep?.gcc) {
143123
default:
144-
url.searchParams.set("country_code", Caches?.pep?.gcc ?? "US");
124+
url.searchParams.set("country_code", Caches.pep.gcc);
145125
break;
146126
case "CN":
147127
case undefined:

src/response.dev.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,6 @@ Console.info(`PLATFORM: ${PLATFORM}`);
5252
case "application/x-plist":
5353
// 主机判断
5454
switch (url.hostname) {
55-
case "gspe1-ssl.ls.apple.com":
56-
//body = new DOMParser().parseFromString($response.body, FORMAT);
57-
// 路径判断
58-
switch (url.pathname) {
59-
case "/pep/gcc":
60-
break;
61-
}
62-
//$repsonse.body = new XMLSerializer().serializeToString(body);
63-
break;
6455
case "configuration.ls.apple.com":
6556
//body = await PLISTs("plist2json", $response.body);
6657
BigInt.prototype.toJSON = function () {
@@ -92,7 +83,7 @@ Console.info(`PLATFORM: ${PLATFORM}`);
9283
//PLIST["com.apple.GEO"].CountryProviders.CN.WiFiQualityNetworkDisabled = undefined; // CN
9384
//PLIST["com.apple.GEO"].CountryProviders.CN.WiFiQualityTileDisabled = undefined; // CN
9485
//PLIST["com.apple.GEO"].CountryProviders.CN.SupportsOffline = true; // 支持离线地图(不需要,macOS 不支持)
95-
PLIST["com.apple.GEO"].CountryProviders.CN.SupportsCarIntegration = true; // 支持 CarPlay 集成
86+
PLIST["com.apple.GEO"].CountryProviders.CN.SupportsCarIntegration = true; // 支持车辆集成
9687
// TW
9788
//PLIST["com.apple.GEO"].CountryProviders.CN.GEOShouldSpeakWrittenAddresses = true; // TW
9889
//PLIST["com.apple.GEO"].CountryProviders.CN.GEOShouldSpeakWrittenPlaceNames = true; // TW

src/response.js

Lines changed: 14 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,6 @@ Console.info(`PLATFORM: ${PLATFORM}`);
4747
case "application/x-plist":
4848
// 主机判断
4949
switch (url.hostname) {
50-
case "gspe1-ssl.ls.apple.com":
51-
//body = new DOMParser().parseFromString($response.body, FORMAT);
52-
// 路径判断
53-
switch (url.pathname) {
54-
case "/pep/gcc":
55-
_.set(Caches, "pep.gcc", $response.body);
56-
Storage.setItem("@iRingo.Location.Caches", Caches);
57-
switch (Settings.PEP.GCC) {
58-
case "AUTO":
59-
break;
60-
default:
61-
$response.body = Settings.PEP.GCC;
62-
break;
63-
}
64-
break;
65-
}
66-
break;
6750
case "configuration.ls.apple.com":
6851
BigInt.prototype.toJSON = function () {
6952
return this.toString();
@@ -76,29 +59,20 @@ Console.info(`PLATFORM: ${PLATFORM}`);
7659
if (PLIST) {
7760
// CN
7861
PLIST["com.apple.GEO"].CountryProviders.CN.ShouldEnableLagunaBeach = true; // XX
79-
PLIST["com.apple.GEO"].CountryProviders.CN.DrivingMultiWaypointRoutesEnabled = true; // 驾驶导航途径点
80-
//PLIST["com.apple.GEO"].CountryProviders.CN.EnableAlberta = false; // CN
81-
PLIST["com.apple.GEO"].CountryProviders.CN.EnableClientDrapedVectorPolygons = true; // CN
82-
PLIST["com.apple.GEO"].CountryProviders.CN.GEOAddressCorrectionEnabled = true; // CN
83-
delete PLIST["com.apple.GEO"].CountryProviders.CN.GEOBatchSpatialEventLookupMaxParametersCount; // CN
84-
delete PLIST["com.apple.GEO"].CountryProviders.CN.GEOBatchSpatialPlaceLookupMaxParametersCount; // CN
85-
PLIST["com.apple.GEO"].CountryProviders.CN.LocalitiesAndLandmarksSupported = true; // CN
86-
PLIST["com.apple.GEO"].CountryProviders.CN.NavigationShowHeadingKey = true;
87-
PLIST["com.apple.GEO"].CountryProviders.CN.POIBusynessDifferentialPrivacy = true; // CN
88-
PLIST["com.apple.GEO"].CountryProviders.CN.POIBusynessRealTime = true; // CN
89-
PLIST["com.apple.GEO"].CountryProviders.CN.TransitPayEnabled = true; // CN
90-
//PLIST["com.apple.GEO"].CountryProviders.CN.WiFiQualityNetworkDisabled = Settings?.Config?.Defaults?.WiFiQualityNetworkDisabled ?? true; // CN
91-
//PLIST["com.apple.GEO"].CountryProviders.CN.WiFiQualityTileDisabled = Settings?.Config?.Defaults?.WiFiQualityTileDisabled ?? true; // CN
92-
PLIST["com.apple.GEO"].CountryProviders.CN.SupportsOffline = true; // CN
93-
PLIST["com.apple.GEO"].CountryProviders.CN.SupportsCarIntegration = true; // CN
94-
// TW
95-
PLIST["com.apple.GEO"].CountryProviders.CN.GEOShouldSpeakWrittenAddresses = true; // TW
96-
PLIST["com.apple.GEO"].CountryProviders.CN.GEOShouldSpeakWrittenPlaceNames = true; // TW
97-
// US
98-
PLIST["com.apple.GEO"].CountryProviders.CN["6694982d2b14e95815e44e970235e230"] = true; // US
99-
PLIST["com.apple.GEO"].CountryProviders.CN.PedestrianAREnabled = true; // 现实世界中的线路
100-
PLIST["com.apple.GEO"].CountryProviders.CN.OpticalHeadingEnabled = true; // 举起以查看
101-
PLIST["com.apple.GEO"].CountryProviders.CN.UseCLPedestrianMapMatchedLocations = true; // 导航准确性-增强
62+
delete PLIST["com.apple.GEO"]?.CountryProviders?.CN?.DrivingMultiWaypointRoutesEnabled; // 路线-驾驶-停靠点
63+
delete PLIST["com.apple.GEO"]?.CountryProviders?.CN?.LocalitiesAndLandmarksSupported; // 支持地名和地标
64+
delete PLIST["com.apple.GEO"]?.CountryProviders?.CN?.NavigationShowHeadingKey; // 导航时显示朝向按钮
65+
delete PLIST["com.apple.GEO"]?.CountryProviders?.CN?.POIBusynessRealTime; // 兴趣点繁忙度的实时展示?(需要,默认仅 CN 停用)
66+
delete PLIST["com.apple.GEO"]?.CountryProviders?.CN?.PedestrianAREnabled; // 步行-现实世界中的线路-举起以查看
67+
PLIST["com.apple.GEO"].CountryProviders.CN.SupportsCarIntegration = true; // 支持车辆集成
68+
PLIST["com.apple.GEO"].DrivingMultiWaypointRoutesEnabled = true; // 路线-驾驶-停靠点(不需要,默认全局启用)
69+
PLIST["com.apple.GEO"].LocalitiesAndLandmarksSupported = true; // 支持地名和地标(不需要,默认全局启用)
70+
PLIST["com.apple.GEO"].NavigationShowHeadingKey = true; // 导航时显示朝向按钮(需要,默认全局停用)
71+
PLIST["com.apple.GEO"]["6694982d2b14e95815e44e970235e230"] = true; // ?(需要,默认仅 US 启用)
72+
PLIST["com.apple.GEO"].OpticalHeadingEnabled = true; // 步行-导航精确度-增强(需要,默认仅 US 启用)
73+
PLIST["com.apple.GEO"].PedestrianAREnabled = true; // 步行-现实世界中的线路-举起以查看(不需要,默认全局启用)
74+
PLIST["com.apple.GEO"].TransitPayEnabled = true; // 地图 App 中的交通卡和支付卡(不需要,默认全局启用)
75+
PLIST["com.apple.GEO"].UseCLPedestrianMapMatchedLocations = true; // 使用 Pedestrian 地图匹配位置?(需要,默认仅 US 启用)
10276
}
10377
break;
10478
}

0 commit comments

Comments
 (0)