Skip to content

Commit

Permalink
refactor: request
Browse files Browse the repository at this point in the history
Update arguments-builder.config.ts
Update boxjs.settings.json
Update package-lock.json
Delete Location.srmodule
Update CHANGELOG.md
Update request.dev.js
Create Location.yaml
Update package.json
Update request.js
Update types.d.ts
  • Loading branch information
VirgilClyne committed Nov 18, 2024
1 parent 71fc760 commit f436dfb
Show file tree
Hide file tree
Showing 11 changed files with 177 additions and 302 deletions.
2 changes: 0 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* 升级了 `@nsnanocat/util`
* `util``submodule` 更改为 `package`
* `$platform` 改为 `$app`
* 增加了 `@nsnanocat/url`
* 使用了全新的 `URL``URLSearchParams` polyfill

### 🔄 Other Changes
* 打包器由 `rollup` 更改为 `rspack`
47 changes: 13 additions & 34 deletions arguments-builder.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ export default defineConfig({
output: {
surge: {
path: "./dist/Maps.sgmodule",
transformEgern: {
enable: true,
path: "./dist/Maps.yaml",
},
},
loon: {
path: "./dist/Maps.plugin",
Expand All @@ -16,10 +20,6 @@ export default defineConfig({
path: "./dist/Maps.stoverride",
template: "./template/stash.handlebars",
},
{
path: "./dist/Maps.srmodule",
template: "./template/shadowrocket.handlebars",
},
],
dts: { isExported: true, path: "./src/types.d.ts" },
boxjsSettings: {
Expand All @@ -31,29 +31,8 @@ export default defineConfig({
{
defaultValue: "CN",
description: "此选项影响“地图”整体配置内容,包括以下的地图功能与服务。",
key: "GeoManifest.Dynamic.Config.CountryCode.default",
name: "[全局 动态配置] 资源清单的国家或地区代码",
options: [
{ key: "AUTO", label: "🇺🇳自动(跟随用户当前所在地区)" },
{ key: "CN", label: "🇨🇳中国大陆" },
{ key: "HK", label: "🇭🇰中国香港" },
{ key: "TW", label: "🇹🇼中国台湾" },
{ key: "SG", label: "🇸🇬新加坡" },
{ key: "US", label: "🇺🇸美国" },
{ key: "JP", label: "🇯🇵日本" },
{ key: "AU", label: "🇦🇺澳大利亚" },
{ key: "GB", label: "🇬🇧英国" },
{ key: "KR", label: "🇰🇷韩国" },
{ key: "CA", label: "🇨🇦加拿大" },
{ key: "IE", label: "🇮🇪爱尔兰" },
],
type: "string",
},
{
defaultValue: "US",
description: "此选项影响 watchOS “地图”整体配置内容,包括以下的地图功能与服务。",
key: "GeoManifest.Dynamic.Config.CountryCode.watchOS",
name: "[watchOS 动态配置] 资源清单的国家或地区代码",
key: "GeoManifest.Dynamic.Config.CountryCode",
name: "[动态配置] 资源清单的国家或地区代码",
options: [
{ key: "AUTO", label: "🇺🇳自动(跟随用户当前所在地区)" },
{ key: "CN", label: "🇨🇳中国大陆" },
Expand All @@ -77,7 +56,7 @@ export default defineConfig({
key: "UrlInfoSet.Dispatcher",
name: "[URL信息集] 调度器",
options: [
{ key: "AUTO", label: "自动(随[动态配置]版本自动选择)" },
{ key: "AUTO", label: "🇺🇳自动(随[动态配置]版本自动选择)" },
{
key: "AutoNavi",
label:
Expand All @@ -93,7 +72,7 @@ export default defineConfig({
key: "UrlInfoSet.Directions",
name: "[URL信息集] 导航与ETA",
options: [
{ key: "AUTO", label: "自动(随[动态配置]版本自动选择)" },
{ key: "AUTO", label: "🇺🇳自动(随[动态配置]版本自动选择)" },
{ key: "AutoNavi", label: "🧭高德(🇨🇳:高德地图 | 🇺🇳:TomTom)" },
{ key: "Apple", label: "Apple(🇨🇳:🈚️ | 🇺🇳:TomTom)" },
],
Expand All @@ -105,7 +84,7 @@ export default defineConfig({
key: "UrlInfoSet.RAP",
name: "[URL信息集] 评分和照片",
options: [
{ key: "AUTO", label: "自动(随[动态配置]版本自动选择)" },
{ key: "AUTO", label: "🇺🇳自动(随[动态配置]版本自动选择)" },
{ key: "AutoNavi", label: "🧭高德(🇨🇳:🈶️但未开放 | 🇺🇳:🈚️)" },
{ key: "Apple", label: "Apple(🇨🇳:🈚️ | 🇺🇳:🈶️)" },
],
Expand All @@ -118,7 +97,7 @@ export default defineConfig({
key: "UrlInfoSet.LocationShift",
name: "[URL信息集] 定位漂移",
options: [
{ key: "AUTO", label: "自动(随[动态配置]版本自动选择)" },
{ key: "AUTO", label: "🇺🇳自动(随[动态配置]版本自动选择)" },
{ key: "AutoNavi", label: "🧭高德(🈚️坐标,使用🇨🇳GCJ-02坐标)" },
{ key: "Apple", label: "Apple(🈶️坐标,使用🇺🇳WGS-84坐标)" },
],
Expand All @@ -130,7 +109,7 @@ export default defineConfig({
key: "TileSet.Satellite",
name: "[瓦片数据集] 卫星图像",
options: [
{ key: "AUTO", label: "自动(随[动态配置]版本自动选择)" },
{ key: "AUTO", label: "🇺🇳自动(随[动态配置]版本自动选择)" },
{ key: "HYBRID", label: "混合(🇨🇳:2D较新 | 🇺🇳:主要城市3D)" },
{ key: "CN", label: "🇨🇳中国四维(🇨🇳:2D较新 | 🇺🇳:🈚️)" },
{ key: "XX", label: "🇺🇳DigitalGlobe(🇨🇳:2D较旧 | 🇺🇳:2D+主要城市3D)" },
Expand All @@ -143,7 +122,7 @@ export default defineConfig({
key: "TileSet.Flyover",
name: "[瓦片数据集] 飞行俯瞰",
options: [
{ key: "AUTO", label: "自动(随[动态配置]版本自动选择)" },
{ key: "AUTO", label: "🇺🇳自动(随[动态配置]版本自动选择)" },
{ key: "CN", label: "🇨🇳Apple(🇨🇳:🈚️ | 🇺🇳:🈚️)" },
{ key: "XX", label: "🇺🇳Apple(🇨🇳:🈚️ | 🇺🇳:🈶️)" },
],
Expand All @@ -155,7 +134,7 @@ export default defineConfig({
key: "TileSet.Munin",
name: "[瓦片数据集] 四处看看",
options: [
{ key: "AUTO", label: "自动(随[动态配置]版本自动选择)" },
{ key: "AUTO", label: "🇺🇳自动(随[动态配置]版本自动选择)" },
{ key: "CN", label: "🇨🇳Apple(🇨🇳:🈚️ | 🇺🇳:🈚️)" },
{ key: "XX", label: "🇺🇳Apple(🇨🇳:🈚️ | 🇺🇳:🈶️)" },
],
Expand Down
19 changes: 0 additions & 19 deletions modules/Location.srmodule

This file was deleted.

28 changes: 28 additions & 0 deletions modules/Location.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: ' iRingo: 📍 Location'
description: |-
自定义「定位服务」
通过「基于网络的地区检测」结果始终为用户设置的地区
注:该覆写包含代理规则。
compat_arguments:
GeoCountryCode: US
compat_arguments_desc: 'GeoCountryCode: [地区检测] 地理国家或地区代码'
open_url: http://boxjs.com/#/app/iRingo.Location
author: VirgilClyne[https://github.com/VirgilClyne]
homepage: https://NSRingo.github.io/guide/GeoServices/location
icon: https://images.macrumors.com/article-new/2019/07/ios_location_services-250x250.jpg
rules:
- domain:
match: gspe1-ssl.ls.apple.com
policy: DIRECT
scriptings:
- http_response:
name: 📍 Location.pep.gcc.response
match: ^https?:\/\/gspe1-ssl\.ls\.apple\.com\/pep\/gcc
script_url: https://github.com/NSRingo/GeoServices/releases/latest/download/response.bundle.js
arguments:
_compat.$argument: PEP.GCC={{{GeoCountryCode}}}
body_required: true
mitm:
hostnames:
includes:
- gspe1-ssl.ls.apple.com
26 changes: 11 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"@rspack/core": "^1.0.11"
},
"dependencies": {
"@nsnanocat/url": "^1.2.0",
"@nsnanocat/util": "^1.4.8",
"@protobuf-ts/runtime": "^2.9.3",
"node-polyfill-webpack-plugin": "^4.0.0"
Expand Down
37 changes: 21 additions & 16 deletions src/function/database.mjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
export default {
"Location": {
"Settings": {
"Switch": true,
"PEP": {
"GCC": "US"
}
}
},
"Maps": {
"Settings": {
"Switch": true,
"UrlInfoSet": {
"Dispatcher": "AutoNavi",
"Directions": "AutoNavi",
Expand All @@ -27,28 +25,35 @@ export default {
"GeoManifest": {
"Dynamic": {
"Config": {
"CountryCode": {
"default": "CN",
"iOS": "AUTO",
"iPadOS": "AUTO",
"watchOS": "US",
"macOS": "AUTO"
}
"CountryCode": "CN"
}
}
},
"Config": {
"Announcements": {
"Environment:": {
"default": "AUTO",
"iOS": "AUTO",
"iPadOS": "AUTO",
"watchOS": "AUTO",
"macOS": "AUTO"
}
"Environment:": "CN"
}
}
},
"Configs": {}
},
"Watch": {
"Settings": {
"UrlInfoSet": {
"LocationShift": "Apple"
},
"GeoManifest": {
"Dynamic": {
"Config": {
"CountryCode": "US"
}
}
},
"Config": {
"Announcements": {
"Environment:": "CN"
}
}
}
}
}
Loading

0 comments on commit f436dfb

Please sign in to comment.