Skip to content

Commit d23221d

Browse files
committed
🔄 Sync from main repo - 2026-01-29 08:33:34
1 parent 31218cf commit d23221d

11 files changed

Lines changed: 145 additions & 353 deletions

File tree

API.en.md

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,36 +1095,6 @@ Download a file from a URL
10951095

10961096
---
10971097

1098-
### `network.getAirplaneMode`
1099-
1100-
**Signature:** `getAirplaneMode()`
1101-
1102-
Get Airplane Mode status
1103-
1104-
**Returns:** `boolean`
1105-
1106-
*Whether Airplane Mode is enabled*
1107-
1108-
---
1109-
1110-
### `network.setAirplaneMode`
1111-
1112-
**Signature:** `setAirplaneMode(enabled)`
1113-
1114-
Set Airplane Mode status
1115-
1116-
**Parameters:**
1117-
1118-
| Name | Type | Description | Optional |
1119-
|------|------|-------------|----------|
1120-
| `enabled` | `boolean` | True to enable, false to disable | No |
1121-
1122-
**Returns:** `boolean`
1123-
1124-
*Whether the setting was successfully updated*
1125-
1126-
---
1127-
11281098
### `network.listVPNs`
11291099

11301100
**Signature:** `listVPNs()`
@@ -1179,36 +1149,6 @@ Get current VPN connection status
11791149

11801150
---
11811151

1182-
### `network.getWiFiEnabled`
1183-
1184-
**Signature:** `getWiFiEnabled()`
1185-
1186-
Check if Wi-Fi is powered on
1187-
1188-
**Returns:** `boolean`
1189-
1190-
*Whether Wi-Fi is enabled*
1191-
1192-
---
1193-
1194-
### `network.setWiFi`
1195-
1196-
**Signature:** `setWiFi(enabled)`
1197-
1198-
Toggle Wi-Fi power state
1199-
1200-
**Parameters:**
1201-
1202-
| Name | Type | Description | Optional |
1203-
|------|------|-------------|----------|
1204-
| `enabled` | `boolean` | True to enable, false to disable | No |
1205-
1206-
**Returns:** `boolean`
1207-
1208-
*Whether the state was successfully updated*
1209-
1210-
---
1211-
12121152
### `network.openSettings`
12131153

12141154
![Not Supported](https://img.shields.io/badge/Trigger-None-red)

API.md

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -973,18 +973,6 @@ iCloud 文件操作
973973

974974
---
975975

976-
### `network.getWiFiInfo`
977-
978-
**Signature:** `getWiFiInfo()`
979-
980-
获取 WiFi 信息
981-
982-
**Returns:** `{ ssid: string, bssid: string } \| null`
983-
984-
*包含 SSID 和 BSSID 的对象*
985-
986-
---
987-
988976
### `network.encodeURL`
989977

990978
**Signature:** `encodeURL(string)`
@@ -1095,36 +1083,6 @@ Ping 主机
10951083

10961084
---
10971085

1098-
### `network.getAirplaneMode`
1099-
1100-
**Signature:** `getAirplaneMode()`
1101-
1102-
获取飞行模式状态
1103-
1104-
**Returns:** `boolean`
1105-
1106-
*是否开启*
1107-
1108-
---
1109-
1110-
### `network.setAirplaneMode`
1111-
1112-
**Signature:** `setAirplaneMode(enabled)`
1113-
1114-
设置飞行模式
1115-
1116-
**Parameters:**
1117-
1118-
| Name | Type | Description | Optional |
1119-
|------|------|-------------|----------|
1120-
| `enabled` | `boolean` | 是否开启 | No |
1121-
1122-
**Returns:** `boolean`
1123-
1124-
*是否设置成功*
1125-
1126-
---
1127-
11281086
### `network.listVPNs`
11291087

11301088
**Signature:** `listVPNs()`
@@ -1179,36 +1137,6 @@ Ping 主机
11791137

11801138
---
11811139

1182-
### `network.getWiFiEnabled`
1183-
1184-
**Signature:** `getWiFiEnabled()`
1185-
1186-
获取 WiFi 开关状态
1187-
1188-
**Returns:** `boolean`
1189-
1190-
*是否开启*
1191-
1192-
---
1193-
1194-
### `network.setWiFi`
1195-
1196-
**Signature:** `setWiFi(enabled)`
1197-
1198-
设置 WiFi 开关
1199-
1200-
**Parameters:**
1201-
1202-
| Name | Type | Description | Optional |
1203-
|------|------|-------------|----------|
1204-
| `enabled` | `boolean` | 是否开启 | No |
1205-
1206-
**Returns:** `boolean`
1207-
1208-
*是否设置成功*
1209-
1210-
---
1211-
12121140
### `network.openSettings`
12131141

12141142
![Not Supported](https://img.shields.io/badge/Trigger-None-red)

JSModulesAPI/en/network.json

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -130,27 +130,6 @@
130130
"returns": "Promise<{ path: string }>",
131131
"returnsDescription": "Object containing the local file path"
132132
},
133-
{
134-
"name": "getAirplaneMode",
135-
"signature": "getAirplaneMode()",
136-
"description": "Get Airplane Mode status",
137-
"returns": "boolean",
138-
"returnsDescription": "Whether Airplane Mode is enabled"
139-
},
140-
{
141-
"name": "setAirplaneMode",
142-
"signature": "setAirplaneMode(enabled)",
143-
"description": "Set Airplane Mode status",
144-
"parameters": [
145-
{
146-
"name": "enabled",
147-
"type": "boolean",
148-
"description": "True to enable, false to disable"
149-
}
150-
],
151-
"returns": "boolean",
152-
"returnsDescription": "Whether the setting was successfully updated"
153-
},
154133
{
155134
"name": "listVPNs",
156135
"signature": "listVPNs()",
@@ -187,27 +166,6 @@
187166
"returns": "{ connected: boolean, name?: string }",
188167
"returnsDescription": "Object containing connection state and VPN name"
189168
},
190-
{
191-
"name": "getWiFiEnabled",
192-
"signature": "getWiFiEnabled()",
193-
"description": "Check if Wi-Fi is powered on",
194-
"returns": "boolean",
195-
"returnsDescription": "Whether Wi-Fi is enabled"
196-
},
197-
{
198-
"name": "setWiFi",
199-
"signature": "setWiFi(enabled)",
200-
"description": "Toggle Wi-Fi power state",
201-
"parameters": [
202-
{
203-
"name": "enabled",
204-
"type": "boolean",
205-
"description": "True to enable, false to disable"
206-
}
207-
],
208-
"returns": "boolean",
209-
"returnsDescription": "Whether the state was successfully updated"
210-
},
211169
{
212170
"name": "openSettings",
213171
"signature": "openSettings(section?)",

JSModulesAPI/zh/network.json

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,6 @@
2727
"returns": "string | null",
2828
"returnsDescription": "IP 地址"
2929
},
30-
{
31-
"name": "getWiFiInfo",
32-
"signature": "getWiFiInfo()",
33-
"description": "获取 WiFi 信息",
34-
"returns": "{ ssid: string, bssid: string } | null",
35-
"returnsDescription": "包含 SSID 和 BSSID 的对象"
36-
},
3730
{
3831
"name": "encodeURL",
3932
"signature": "encodeURL(string)",
@@ -130,27 +123,6 @@
130123
"returns": "Promise<{ path: string }>",
131124
"returnsDescription": "包含本地文件路径的对象"
132125
},
133-
{
134-
"name": "getAirplaneMode",
135-
"signature": "getAirplaneMode()",
136-
"description": "获取飞行模式状态",
137-
"returns": "boolean",
138-
"returnsDescription": "是否开启"
139-
},
140-
{
141-
"name": "setAirplaneMode",
142-
"signature": "setAirplaneMode(enabled)",
143-
"description": "设置飞行模式",
144-
"parameters": [
145-
{
146-
"name": "enabled",
147-
"type": "boolean",
148-
"description": "是否开启"
149-
}
150-
],
151-
"returns": "boolean",
152-
"returnsDescription": "是否设置成功"
153-
},
154126
{
155127
"name": "listVPNs",
156128
"signature": "listVPNs()",
@@ -187,27 +159,6 @@
187159
"returns": "{ connected: boolean, name?: string }",
188160
"returnsDescription": "包含连接状态和 VPN 名称的对象"
189161
},
190-
{
191-
"name": "getWiFiEnabled",
192-
"signature": "getWiFiEnabled()",
193-
"description": "获取 WiFi 开关状态",
194-
"returns": "boolean",
195-
"returnsDescription": "是否开启"
196-
},
197-
{
198-
"name": "setWiFi",
199-
"signature": "setWiFi(enabled)",
200-
"description": "设置 WiFi 开关",
201-
"parameters": [
202-
{
203-
"name": "enabled",
204-
"type": "boolean",
205-
"description": "是否开启"
206-
}
207-
],
208-
"returns": "boolean",
209-
"returnsDescription": "是否设置成功"
210-
},
211162
{
212163
"name": "openSettings",
213164
"signature": "openSettings(section?)",

README.md

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -64,40 +64,30 @@ TrollScript 内置丰富的原生模块,[查看完整中文 API 文档](API.md
6464

6565
> [示例脚本 (TrollScript-Store)](https://github.com/dompling/TrollScript-Release/tree/main/templates/TestScripts)
6666
67-
### 基础模块
67+
## 触发器
6868

69-
| 模块 | 功能 |
70-
|------|------|
71-
| `http` | HTTP 请求 (GET/POST/PUT/DELETE) |
72-
| `console` | 控制台输出 |
73-
| `storage` | 数据持久化存储 |
74-
| `clipboard` | 剪贴板读写 |
75-
| `file` | 文件读写操作(沙盒内) |
76-
| `device` | 设备信息获取 |
77-
78-
### 系统功能模块
69+
| 类型 | 说明 |
70+
|------|---------------------------------------------------------------------------|
71+
| 定时任务 | Cron 定时执行脚本 |
72+
| 剪切板 | 复制了特定的文字内容之后触发脚本 |
73+
| 文件监控 | 文件变化的时候触发 |
74+
| 通知监控 | APP 发送通知的时候,触发脚本(兼容性未知 作者的手机系统:IOS 16.3.1) |
7975

80-
| 模块 | 功能 |
81-
|------|------|
82-
| `notification` | 本地通知发送与管理 |
83-
| `location` | 位置服务、地理编码 |
84-
| `app` | 应用管理、URL Scheme 调用 |
85-
| `alarm` | 闹钟与定时提醒(基于本地通知) |
76+
> 脚本同时触发,可能会发生崩溃或者其他未知问题,请注意使用。可以反馈修复。
8677
87-
### 媒体与数据模块
88-
89-
| 模块 | 功能 |
90-
|------|------|
91-
| `media` | 音乐库访问、播放控制、专辑/艺术家/播放列表管理 |
92-
| `contacts` | 通讯录读写、联系人搜索与分组 |
93-
| `weather` | 天气查询(wttr.in API) |
78+
### 全局参数
9479

95-
### 扩展交互模块
96-
97-
| 模块 | 功能 |
98-
|------|------|
99-
| `mail` | 邮件发送、模板管理 |
100-
| `shortcuts` | 快捷指令调用与集成 |
80+
1. **$triggerInput**
81+
- 通知监控
82+
```
83+
interface $triggerInput {
84+
type: "notification"; // 触发类型
85+
bundleId: string; // 来源 App Bundle ID
86+
title: string; // 通知标题
87+
message: string; // 通知内容
88+
timestamp: number; // 时间戳 (毫秒)
89+
}
90+
```
10191

10292
## 高级功能
10393

TrollScript/Resources/en.lproj/Localizable.strings

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"settings.download_tipa" = "Download TIPA";
3838
"settings.install_trollstore" = "Install via TrollStore";
3939
"settings.view_on_github" = "View on GitHub";
40+
"settings.view" = "View";
4041
"settings.feedback" = "Feedback";
4142
"settings.debug_mode" = "Debug Mode";
4243
"settings.enabled" = "Enabled";
@@ -1040,6 +1041,8 @@
10401041
"preset_path.sms_database.desc" = "SMS/iMessage storage, triggers on send/receive";
10411042
"preset_path.sms_database_wal" = "SMS Database (Real-time)";
10421043
"preset_path.sms_database_wal.desc" = "WAL log file, updates faster than main database";
1044+
"preset_path.sms_face_icloud_database_wal" = "SMS Database (Real-time Silent)";
1045+
"preset_path.sms_face_icloud_database_wal.desc" = "WAL log file; updates are quieter than the SMS Database (Real-time).";
10431046
"preset_path.call_history" = "Call History";
10441047
"preset_path.call_history.desc" = "Incoming/outgoing/missed calls";
10451048
"preset_path.safari_history" = "Safari History";
@@ -1088,3 +1091,24 @@
10881091
/* Notification Copy on Tap */
10891092
"notification.copy_success_title" = "Copied";
10901093
"notification.copy_success_body" = "Content copied: %@";
1094+
1095+
/* Notification Trigger */
1096+
"trigger.type.notification" = "Notification";
1097+
"trigger.hint.notification" = "Trigger when a matching system notification is received.";
1098+
"trigger.notification.config" = "Notification Settings";
1099+
"trigger.notification.config_footer" = "Monitor system notifications from specified apps. Requires TrollStore environment.";
1100+
"trigger.notification.bundle_id" = "App Bundle ID (Regex)";
1101+
"trigger.notification.bundle_id_placeholder" = "e.g. com.apple.MobileSMS";
1102+
"trigger.notification.title_filter" = "Title Filter (Regex)";
1103+
"trigger.notification.title_filter_placeholder" = "Optional regex pattern...";
1104+
"trigger.notification.message_filter" = "Content Filter (Regex)";
1105+
"trigger.notification.message_filter_placeholder" = "Optional regex pattern...";
1106+
"trigger.notification.debounce" = "Debounce Interval";
1107+
"trigger.notification.ignore_script" = "Ignore Script Notifications";
1108+
"trigger.notification.ignore_script_footer" = "Prevent infinite loops when scripts send notifications.";
1109+
"trigger.notification.selected_apps" = "Selected Apps";
1110+
"trigger.notification.search_apps" = "Search apps...";
1111+
"trigger.notification.app_list" = "Available Apps";
1112+
"trigger.notification.no_apps" = "No apps found";
1113+
"trigger.notification.no_search_results" = "No results found";
1114+
"trigger.notification.more_apps" = "+%d more apps, use search to find";

0 commit comments

Comments
 (0)