\n \n \n `}async doResponseAction(t,e){return!1}async doScriptAction(){let t=!0;if("network-changed"==$argument)this.log("network-changed:当网络改变时等待2s 保证VPN已经自动连接"),await this.sleep(2e3),t=!0;else if("network-check"==$argument){this.log("network-check:检查网络状态");const e=await this.checkConnectStatus();e&&(t=!1),this.log(e?"已连接":"连接异常,尝试重新连接")}else"network-token"==$argument&&(this.log("network-token:更新TOKEN"),t=!0);return t?await this.fetchGuidTokenToConnect():this.log("本次不更新token"),{}}async checkConnectStatus(t=!1){let e=!1,s="";try{const t=await this.get({url:"http://www.gstatic.com/generate_204"});204==t.status?e=!0:s=JSON.stringify(t)}catch(t){s=t}if(e)return!0;if(t)throw new i("测试连接状态,连接失败,"+s,n.HTTP);return!1}async fetchGuidTokenToConnect(){this.log("开始更新token");const t=await this.get({url:a.TOKEN_URL}),[e,s]=t.body.split(",");if(!/\w+/.test(e)||!/\w+/.test(s))throw new i("读取token失败!",n.HTTP);return this.log("连接代理服务器。。。",{guid:e,token:s}),this.get({url:`http://${e}.${s}.iikira.com.token`}).then().catch(),await this.sleep(100),this.log("连接代理完成 待测试。。。",{guid:e,token:s}),await this.checkConnectStatus(!0)}}a.VERSION="1.0.2",a.TOKEN_URL="http://kc.iikira.com/kingcard",new a("腾讯大王卡动态","gsonhub.tencent").run()})()})();
--------------------------------------------------------------------------------
/dist/tencent.sgmodule:
--------------------------------------------------------------------------------
1 | #!name= 腾讯大王卡动态免流@prod
2 | #!desc= 腾讯大王卡动态免流@author=gsonhub @version=rmup
3 |
4 | [General]
5 | force-http-engine-hosts = %APPEND% tencent.log tencent.json
6 |
7 | [Script]
8 |
9 | # 接口服务 http://tencent.json http://tencent.log
10 | tencent-http-service = type=http-request,pattern=^https?:\/\/tencent\.(json|log),script-path=https://charming-gnome-9c9592.netlify.app/tencent.js?v=rmup,requires-body=true,max-size=0,timeout=10
11 |
12 | # 轮询1检查网络
13 | tencent-for-cron1 = type=cron,cronexp=*/1 * * * *,timeout=30,script-path=https://charming-gnome-9c9592.netlify.app/tencent.js?v=rmup,argument=network-check
14 |
15 | # 轮询5更新TOKEN
16 | tencent-for-cron5 = type=cron,cronexp=*/10 * * * *,timeout=30,script-path=https://charming-gnome-9c9592.netlify.app/tencent.js?v=rmup,argument=network-token
17 |
18 | #network-changed
19 | tencent-network-changed = script-path=https://charming-gnome-9c9592.netlify.app/tencent.js?v=rmup,argument=network-changed,type=event,event-name=network-changed
--------------------------------------------------------------------------------
/dist/tencent/TencentVideo.list:
--------------------------------------------------------------------------------
1 | # NAME: TencentVideo
2 | # AUTHOR: blackmatrix7
3 | # REPO: https://github.com/blackmatrix7/ios_rule_script
4 | # UPDATED: 2024-01-08 16:00:43
5 | # DOMAIN: 14
6 | # DOMAIN-SUFFIX: 5
7 | # IP-CIDR: 3
8 | # IP-CIDR6: 29
9 | # USER-AGENT: 2
10 | # TOTAL: 53
11 | DOMAIN,00713915daab0be43def5c338c02c80b.dlied1.cdntips.net
12 | DOMAIN,17caa75e77d31e1f5a7841e0b3374569.dlied1.cdntips.net
13 | DOMAIN,apd-pcdnvodstat.teg.tencent-cloud.net
14 | DOMAIN,dldir1.qq.com
15 | DOMAIN,iacc.qq.com
16 | DOMAIN,ins-eeww7kom.ias.tencent-cloud.net
17 | DOMAIN,ios.video.mpush.qq.com
18 | DOMAIN,rdelivery.qq.com
19 | DOMAIN,ts.qq.com
20 | DOMAIN,v.streaming.qq.com
21 | DOMAIN,video-public-1258344701.shiply-cdn.qq.com
22 | DOMAIN,video-search-1258344701.shiply-cdn.qq.com
23 | DOMAIN,video-vip-1258344701.shiply-cdn.qq.com
24 | DOMAIN,yoo.gtimg.com
25 | DOMAIN-SUFFIX,pgdt.gtimg.cn
26 | DOMAIN-SUFFIX,qqvideo.gtimg.com
27 | DOMAIN-SUFFIX,v.qq.com
28 | DOMAIN-SUFFIX,v.smtcdns.com
29 | DOMAIN-SUFFIX,video.qq.com
30 | IP-CIDR,58.49.111.117/32,no-resolve
31 | IP-CIDR,58.49.111.79/32,no-resolve
32 | IP-CIDR,58.49.111.95/32,no-resolve
33 | IP-CIDR6,::ffff:113.248.172.245/128,no-resolve
34 | IP-CIDR6,::ffff:114.235.96.186/128,no-resolve
35 | IP-CIDR6,::ffff:115.236.128.112/128,no-resolve
36 | IP-CIDR6,::ffff:115.236.128.120/128,no-resolve
37 | IP-CIDR6,::ffff:115.236.128.24/128,no-resolve
38 | IP-CIDR6,::ffff:115.236.128.80/128,no-resolve
39 | IP-CIDR6,::ffff:117.64.75.196/128,no-resolve
40 | IP-CIDR6,::ffff:117.68.200.210/128,no-resolve
41 | IP-CIDR6,::ffff:117.87.144.24/128,no-resolve
42 | IP-CIDR6,::ffff:121.56.126.255/128,no-resolve
43 | IP-CIDR6,::ffff:124.73.198.81/128,no-resolve
44 | IP-CIDR6,::ffff:124.73.200.142/128,no-resolve
45 | IP-CIDR6,::ffff:175.6.84.30/128,no-resolve
46 | IP-CIDR6,::ffff:175.6.84.96/128,no-resolve
47 | IP-CIDR6,::ffff:183.161.144.133/128,no-resolve
48 | IP-CIDR6,::ffff:183.161.144.230/128,no-resolve
49 | IP-CIDR6,::ffff:183.161.149.105/128,no-resolve
50 | IP-CIDR6,::ffff:198.18.5.138/128,no-resolve
51 | IP-CIDR6,::ffff:198.18.6.81/128,no-resolve
52 | IP-CIDR6,::ffff:198.18.6.83/128,no-resolve
53 | IP-CIDR6,::ffff:223.240.191.238/128,no-resolve
54 | IP-CIDR6,::ffff:27.157.209.46/128,no-resolve
55 | IP-CIDR6,::ffff:58.217.232.117/128,no-resolve
56 | IP-CIDR6,::ffff:58.217.232.68/128,no-resolve
57 | IP-CIDR6,::ffff:58.217.232.79/128,no-resolve
58 | IP-CIDR6,::ffff:58.58.0.90/128,no-resolve
59 | IP-CIDR6,::ffff:60.171.183.161/128,no-resolve
60 | IP-CIDR6,::ffff:60.171.183.186/128,no-resolve
61 | IP-CIDR6,::ffff:60.171.183.98/128,no-resolve
62 | # USER-AGENT,MOO*
63 | USER-AGENT,TencentMidasConnect*
64 |
--------------------------------------------------------------------------------
/dist/tencent/WeChat.list:
--------------------------------------------------------------------------------
1 | # NAME: WeChat
2 | # AUTHOR: blackmatrix7
3 | # REPO: https://github.com/blackmatrix7/ios_rule_script
4 | # UPDATED: 2024-01-08 16:01:34
5 | # DOMAIN: 7
6 | # DOMAIN-KEYWORD: 233
7 | # DOMAIN-SUFFIX: 22
8 | # IP-ASN: 1
9 | # IP-CIDR: 3
10 | # IP-CIDR6: 64
11 | # USER-AGENT: 2
12 | # TOTAL: 332
13 | DOMAIN,apd-pcdnwxlogin.teg.tencent-cloud.net
14 | DOMAIN,dldir1.qq.com
15 | DOMAIN,slife.xy-asia.com
16 | DOMAIN,soup.v.qq.com
17 | DOMAIN,vweixinf.tc.qq.com
18 | DOMAIN,weixin110.qq.com
19 | DOMAIN,wup.imtt.qq.com
20 | DOMAIN-SUFFIX,iot-tencent.com
21 | DOMAIN-SUFFIX,lbs.gtimg.com
22 | DOMAIN-SUFFIX,map.qq.com
23 | DOMAIN-SUFFIX,qlogo.cn
24 | DOMAIN-SUFFIX,qpic.cn
25 | DOMAIN-SUFFIX,servicewechat.com
26 | DOMAIN-SUFFIX,tenpay.com
27 | DOMAIN-SUFFIX,up-hl.3g.qq.com
28 | DOMAIN-SUFFIX,vweixinthumb.tc.qq.com
29 | DOMAIN-SUFFIX,wechat.com
30 | DOMAIN-SUFFIX,wechatlegal.net
31 | DOMAIN-SUFFIX,wechatos.net
32 | DOMAIN-SUFFIX,wechatpay.com
33 | DOMAIN-SUFFIX,weixin.com
34 | DOMAIN-SUFFIX,weixin.qq.com
35 | DOMAIN-SUFFIX,weixinbridge.com
36 | DOMAIN-SUFFIX,weixinsxy.com
37 | DOMAIN-SUFFIX,wx.gtimg.com
38 | DOMAIN-SUFFIX,wx.qq.com
39 | DOMAIN-SUFFIX,wxapp.tc.qq.com
40 | DOMAIN-SUFFIX,wxs.qq.com
41 | DOMAIN-SUFFIX,yun-hl.3g.qq.com
42 | DOMAIN-KEYWORD,101.226.129.
43 | DOMAIN-KEYWORD,101.226.211.
44 | DOMAIN-KEYWORD,101.226.222.
45 | DOMAIN-KEYWORD,101.226.226.
46 | DOMAIN-KEYWORD,101.227.162.
47 | DOMAIN-KEYWORD,101.32.104.
48 | DOMAIN-KEYWORD,101.32.118.
49 | DOMAIN-KEYWORD,101.32.133.
50 | DOMAIN-KEYWORD,101.33.110.
51 | DOMAIN-KEYWORD,101.89.15.
52 | DOMAIN-KEYWORD,101.89.38.
53 | DOMAIN-KEYWORD,101.89.50.
54 | DOMAIN-KEYWORD,101.91.22.
55 | DOMAIN-KEYWORD,101.91.34.
56 | DOMAIN-KEYWORD,101.91.37.
57 | DOMAIN-KEYWORD,101.91.5.
58 | DOMAIN-KEYWORD,101.91.69.
59 | DOMAIN-KEYWORD,101.91.71.
60 | DOMAIN-KEYWORD,106.225.231.
61 | DOMAIN-KEYWORD,109.244.169.
62 | DOMAIN-KEYWORD,110.52.193.
63 | DOMAIN-KEYWORD,110.53.246.
64 | DOMAIN-KEYWORD,111.0.26.
65 | DOMAIN-KEYWORD,111.30.164.
66 | DOMAIN-KEYWORD,111.45.68.
67 | DOMAIN-KEYWORD,111.45.69.
68 | DOMAIN-KEYWORD,111.45.70.
69 | DOMAIN-KEYWORD,112.53.25.
70 | DOMAIN-KEYWORD,112.53.36.
71 | DOMAIN-KEYWORD,112.60.0.
72 | DOMAIN-KEYWORD,112.60.13.
73 | DOMAIN-KEYWORD,112.60.14.
74 | DOMAIN-KEYWORD,112.60.8.
75 | DOMAIN-KEYWORD,112.65.193.
76 | DOMAIN-KEYWORD,112.90.43.
77 | DOMAIN-KEYWORD,113.105.154.
78 | DOMAIN-KEYWORD,113.105.165.
79 | DOMAIN-KEYWORD,113.105.166.
80 | DOMAIN-KEYWORD,113.96.154.
81 | DOMAIN-KEYWORD,113.96.156.
82 | DOMAIN-KEYWORD,113.96.16.
83 | DOMAIN-KEYWORD,113.96.18.
84 | DOMAIN-KEYWORD,113.96.202.
85 | DOMAIN-KEYWORD,113.96.208.
86 | DOMAIN-KEYWORD,113.96.209.
87 | DOMAIN-KEYWORD,113.96.210.
88 | DOMAIN-KEYWORD,113.96.232.
89 | DOMAIN-KEYWORD,113.96.233.
90 | DOMAIN-KEYWORD,113.96.237.
91 | DOMAIN-KEYWORD,113.96.83.
92 | DOMAIN-KEYWORD,113.96.98.
93 | DOMAIN-KEYWORD,115.231.229.
94 | DOMAIN-KEYWORD,115.238.197.
95 | DOMAIN-KEYWORD,116.128.133.
96 | DOMAIN-KEYWORD,116.128.163.
97 | DOMAIN-KEYWORD,116.128.171.
98 | DOMAIN-KEYWORD,116.253.60.
99 | DOMAIN-KEYWORD,116.253.61.
100 | DOMAIN-KEYWORD,117.135.133.
101 | DOMAIN-KEYWORD,117.184.242.
102 | DOMAIN-KEYWORD,117.187.243.
103 | DOMAIN-KEYWORD,117.41.224.
104 | DOMAIN-KEYWORD,119.147.190.
105 | DOMAIN-KEYWORD,119.147.227.
106 | DOMAIN-KEYWORD,119.147.83.
107 | DOMAIN-KEYWORD,119.188.155.
108 | DOMAIN-KEYWORD,119.39.81.
109 | DOMAIN-KEYWORD,120.204.0.
110 | DOMAIN-KEYWORD,120.204.10.
111 | DOMAIN-KEYWORD,120.221.179.
112 | DOMAIN-KEYWORD,120.232.27.
113 | DOMAIN-KEYWORD,120.232.33.
114 | DOMAIN-KEYWORD,120.232.65.
115 | DOMAIN-KEYWORD,120.232.68.
116 | DOMAIN-KEYWORD,120.233.36.
117 | DOMAIN-KEYWORD,120.237.199.
118 | DOMAIN-KEYWORD,120.241.149.
119 | DOMAIN-KEYWORD,120.241.150.
120 | DOMAIN-KEYWORD,120.241.17.
121 | DOMAIN-KEYWORD,120.241.186.
122 | DOMAIN-KEYWORD,120.241.189.
123 | DOMAIN-KEYWORD,120.241.190.
124 | DOMAIN-KEYWORD,120.241.21.
125 | DOMAIN-KEYWORD,120.241.25.
126 | DOMAIN-KEYWORD,120.241.92.
127 | DOMAIN-KEYWORD,121.12.115.
128 | DOMAIN-KEYWORD,121.14.142.
129 | DOMAIN-KEYWORD,121.14.98.
130 | DOMAIN-KEYWORD,121.51.124.
131 | DOMAIN-KEYWORD,121.51.130.
132 | DOMAIN-KEYWORD,122.225.36.
133 | DOMAIN-KEYWORD,122.246.25.
134 | DOMAIN-KEYWORD,123.150.208.
135 | DOMAIN-KEYWORD,123.150.76.
136 | DOMAIN-KEYWORD,123.151.190.
137 | DOMAIN-KEYWORD,123.161.61.
138 | DOMAIN-KEYWORD,123.184.36.
139 | DOMAIN-KEYWORD,124.232.162.
140 | DOMAIN-KEYWORD,129.226.107.
141 | DOMAIN-KEYWORD,129.226.3.
142 | DOMAIN-KEYWORD,14.17.41.
143 | DOMAIN-KEYWORD,14.17.73.
144 | DOMAIN-KEYWORD,14.18.175.
145 | DOMAIN-KEYWORD,14.18.178.
146 | DOMAIN-KEYWORD,14.18.180.
147 | DOMAIN-KEYWORD,14.18.200.
148 | DOMAIN-KEYWORD,14.18.245.
149 | DOMAIN-KEYWORD,14.215.138.
150 | DOMAIN-KEYWORD,14.215.158.
151 | DOMAIN-KEYWORD,14.215.166.
152 | DOMAIN-KEYWORD,14.215.167.
153 | DOMAIN-KEYWORD,14.215.85.
154 | DOMAIN-KEYWORD,14.22.0.
155 | DOMAIN-KEYWORD,14.22.33.
156 | DOMAIN-KEYWORD,14.22.4.
157 | DOMAIN-KEYWORD,14.22.5.
158 | DOMAIN-KEYWORD,14.29.100.
159 | DOMAIN-KEYWORD,14.29.101.
160 | DOMAIN-KEYWORD,140.207.119.
161 | DOMAIN-KEYWORD,150.109.90.
162 | DOMAIN-KEYWORD,157.148.33.
163 | DOMAIN-KEYWORD,157.148.42.
164 | DOMAIN-KEYWORD,157.148.45.
165 | DOMAIN-KEYWORD,157.148.51.
166 | DOMAIN-KEYWORD,157.148.55.
167 | DOMAIN-KEYWORD,157.255.135.
168 | DOMAIN-KEYWORD,157.255.173.
169 | DOMAIN-KEYWORD,157.255.174.
170 | DOMAIN-KEYWORD,157.255.192.
171 | DOMAIN-KEYWORD,157.255.243.
172 | DOMAIN-KEYWORD,157.255.244.
173 | DOMAIN-KEYWORD,157.255.245.
174 | DOMAIN-KEYWORD,163.177.81.
175 | DOMAIN-KEYWORD,163.177.89.
176 | DOMAIN-KEYWORD,163.177.90.
177 | DOMAIN-KEYWORD,175.27.0.
178 | DOMAIN-KEYWORD,175.6.13.
179 | DOMAIN-KEYWORD,180.111.199.
180 | DOMAIN-KEYWORD,180.163.15.
181 | DOMAIN-KEYWORD,180.163.25.
182 | DOMAIN-KEYWORD,180.163.26.
183 | DOMAIN-KEYWORD,180.96.0.
184 | DOMAIN-KEYWORD,180.96.2.
185 | DOMAIN-KEYWORD,180.97.8.
186 | DOMAIN-KEYWORD,182.254.78.
187 | DOMAIN-KEYWORD,182.254.92.
188 | DOMAIN-KEYWORD,183.131.56.
189 | DOMAIN-KEYWORD,183.131.57.
190 | DOMAIN-KEYWORD,183.192.169.
191 | DOMAIN-KEYWORD,183.194.238.
192 | DOMAIN-KEYWORD,183.195.236.
193 | DOMAIN-KEYWORD,183.232.175.
194 | DOMAIN-KEYWORD,183.232.246.
195 | DOMAIN-KEYWORD,183.232.94.
196 | DOMAIN-KEYWORD,183.232.95.
197 | DOMAIN-KEYWORD,183.232.96.
198 | DOMAIN-KEYWORD,183.240.115.
199 | DOMAIN-KEYWORD,183.240.118.
200 | DOMAIN-KEYWORD,183.240.48.
201 | DOMAIN-KEYWORD,183.240.56.
202 | DOMAIN-KEYWORD,183.240.80.
203 | DOMAIN-KEYWORD,183.240.81.
204 | DOMAIN-KEYWORD,183.3.224.
205 | DOMAIN-KEYWORD,183.3.226.
206 | DOMAIN-KEYWORD,183.3.233.
207 | DOMAIN-KEYWORD,183.3.234.
208 | DOMAIN-KEYWORD,183.3.235.
209 | DOMAIN-KEYWORD,183.47.101.
210 | DOMAIN-KEYWORD,183.47.115.
211 | DOMAIN-KEYWORD,183.47.117.
212 | DOMAIN-KEYWORD,183.47.97.
213 | DOMAIN-KEYWORD,183.60.131.
214 | DOMAIN-KEYWORD,183.60.155.
215 | DOMAIN-KEYWORD,183.61.13.
216 | DOMAIN-KEYWORD,203.205.232.
217 | DOMAIN-KEYWORD,203.205.234.
218 | DOMAIN-KEYWORD,203.205.235.
219 | DOMAIN-KEYWORD,203.205.253.
220 | DOMAIN-KEYWORD,203.205.254.
221 | DOMAIN-KEYWORD,211.95.137.
222 | DOMAIN-KEYWORD,211.95.138.
223 | DOMAIN-KEYWORD,218.68.88.
224 | DOMAIN-KEYWORD,218.68.90.
225 | DOMAIN-KEYWORD,219.135.59.
226 | DOMAIN-KEYWORD,220.194.91.
227 | DOMAIN-KEYWORD,220.194.93.
228 | DOMAIN-KEYWORD,220.196.144.
229 | DOMAIN-KEYWORD,220.249.243.
230 | DOMAIN-KEYWORD,221.181.97.
231 | DOMAIN-KEYWORD,221.181.99.
232 | DOMAIN-KEYWORD,223.166.152.
233 | DOMAIN-KEYWORD,27.19.222.
234 | DOMAIN-KEYWORD,36.136.108.
235 | DOMAIN-KEYWORD,36.152.4.
236 | DOMAIN-KEYWORD,36.155.202.
237 | DOMAIN-KEYWORD,36.158.189.
238 | DOMAIN-KEYWORD,36.158.242.
239 | DOMAIN-KEYWORD,36.250.230.
240 | DOMAIN-KEYWORD,42.187.131.
241 | DOMAIN-KEYWORD,42.187.182.
242 | DOMAIN-KEYWORD,42.187.184.
243 | DOMAIN-KEYWORD,42.202.141.
244 | DOMAIN-KEYWORD,43.156.222.
245 | DOMAIN-KEYWORD,43.156.86.
246 | DOMAIN-KEYWORD,58.144.193.
247 | DOMAIN-KEYWORD,58.144.248.
248 | DOMAIN-KEYWORD,58.247.204.
249 | DOMAIN-KEYWORD,58.247.205.
250 | DOMAIN-KEYWORD,58.250.136.
251 | DOMAIN-KEYWORD,58.251.100.
252 | DOMAIN-KEYWORD,58.251.111.
253 | DOMAIN-KEYWORD,58.251.117.
254 | DOMAIN-KEYWORD,58.251.80.
255 | DOMAIN-KEYWORD,58.251.81.
256 | DOMAIN-KEYWORD,58.251.82.
257 | DOMAIN-KEYWORD,58.49.138.
258 | DOMAIN-KEYWORD,59.36.89.
259 | DOMAIN-KEYWORD,59.36.97.
260 | DOMAIN-KEYWORD,59.37.96.
261 | DOMAIN-KEYWORD,59.37.97.
262 | DOMAIN-KEYWORD,60.13.97.
263 | DOMAIN-KEYWORD,61.151.165.
264 | DOMAIN-KEYWORD,61.151.167.
265 | DOMAIN-KEYWORD,61.151.168.
266 | DOMAIN-KEYWORD,61.151.183.
267 | DOMAIN-KEYWORD,61.151.206.
268 | DOMAIN-KEYWORD,61.151.207.
269 | DOMAIN-KEYWORD,61.190.114.
270 | DOMAIN-KEYWORD,61.191.60.
271 | DOMAIN-KEYWORD,61.241.31.
272 | DOMAIN-KEYWORD,61.241.44.
273 | DOMAIN-KEYWORD,61.241.47.
274 | DOMAIN-KEYWORD,61.241.49.
275 | IP-CIDR,111.30.160.0/20,no-resolve
276 | IP-CIDR,112.53.11.0/24,no-resolve
277 | IP-CIDR,112.53.20.0/24,no-resolve
278 | IP-CIDR6,2402:4e00:1020:10fb:0:9466::/112,no-resolve
279 | IP-CIDR6,2402:4e00:1430:2264:0:9467::/96,no-resolve
280 | IP-CIDR6,2402:4e00:1900:1700:0:9554:1ad0:140a/128,no-resolve
281 | IP-CIDR6,2402:4e00:8010::/112,no-resolve
282 | IP-CIDR6,2402:4e00:8020:101::2:0/112,no-resolve
283 | IP-CIDR6,2408:80f1:21::/48,no-resolve
284 | IP-CIDR6,2408:80f1:31::/48,no-resolve
285 | IP-CIDR6,2408:8711:10:10::/112,no-resolve
286 | IP-CIDR6,2408:8752:0:10::/60,no-resolve
287 | IP-CIDR6,2408:8752:0:2:30::/112,no-resolve
288 | IP-CIDR6,2408:8752:0:30::/64,no-resolve
289 | IP-CIDR6,2408:8752:0:f::/64,no-resolve
290 | IP-CIDR6,2408:8756:2cf2:19::/112,no-resolve
291 | IP-CIDR6,2408:8756:2cff:10::/60,no-resolve
292 | IP-CIDR6,2408:8756:3af0:10::/112,no-resolve
293 | IP-CIDR6,2408:8756:3af0:2013::/112,no-resolve
294 | IP-CIDR6,2408:8756:f50::/48,no-resolve
295 | IP-CIDR6,2408:8763:0:200::/60,no-resolve
296 | IP-CIDR6,2409:8702:4860:10::/112,no-resolve
297 | IP-CIDR6,2409:8754:f111::/60,no-resolve
298 | IP-CIDR6,2409:8c02:24c:45::/72,no-resolve
299 | IP-CIDR6,2409:8c1e:75b0:1010::/112,no-resolve
300 | IP-CIDR6,2409:8c1e:75b0:13::/112,no-resolve
301 | IP-CIDR6,2409:8c1e:8f60::/60,no-resolve
302 | IP-CIDR6,2409:8c1e:8f60:bb::/72,no-resolve
303 | IP-CIDR6,2409:8c1e:8fd0::/56,no-resolve
304 | IP-CIDR6,2409:8c20:818:110::/60,no-resolve
305 | IP-CIDR6,2409:8c34:2220:20::/60,no-resolve
306 | IP-CIDR6,2409:8c34:22a0:10::/60,no-resolve
307 | IP-CIDR6,2409:8c34:d00:200::/60,no-resolve
308 | IP-CIDR6,2409:8c38:80:150::/72,no-resolve
309 | IP-CIDR6,2409:8c50:2400::/60,no-resolve
310 | IP-CIDR6,2409:8c50:a00:2122::/72,no-resolve
311 | IP-CIDR6,2409:8c54:1003:1019::/112,no-resolve
312 | IP-CIDR6,2409:8c54:1003:10::/112,no-resolve
313 | IP-CIDR6,2409:8c54:1050:10::/112,no-resolve
314 | IP-CIDR6,2409:8c54:1801:10::/60,no-resolve
315 | IP-CIDR6,2409:8c54:1821:70::/60,no-resolve
316 | IP-CIDR6,2409:8c54:2000:400::/60,no-resolve
317 | IP-CIDR6,2409:8c54:2800:9110::/60,no-resolve
318 | IP-CIDR6,2409:8c54:5100::/56,no-resolve
319 | IP-CIDR6,2409:8c54:810:208:2d::/112,no-resolve
320 | IP-CIDR6,2409:8c54:871::/60,no-resolve
321 | IP-CIDR6,2409:8c5c:110:63::/72,no-resolve
322 | IP-CIDR6,240e:928:1400:10::/112,no-resolve
323 | IP-CIDR6,240e:93c:8:10::/60,no-resolve
324 | IP-CIDR6,240e:95c:2003:20::/60,no-resolve
325 | IP-CIDR6,240e:965:802:620::/60,no-resolve
326 | IP-CIDR6,240e:96c:6400:700::/60,no-resolve
327 | IP-CIDR6,240e:97c:18:601::/64,no-resolve
328 | IP-CIDR6,240e:97c:18:910::/60,no-resolve
329 | IP-CIDR6,240e:97c:2f::/60,no-resolve
330 | IP-CIDR6,240e:97d:2010:100::/60,no-resolve
331 | IP-CIDR6,240e:97d:4:1e00::/60,no-resolve
332 | IP-CIDR6,240e:97f:3000:1102::/64,no-resolve
333 | IP-CIDR6,240e:cf:8800::/56,no-resolve
334 | IP-CIDR6,240e:e1:a800::/46,no-resolve
335 | IP-CIDR6,240e:e1:a900::/48,no-resolve
336 | IP-CIDR6,240e:e1:aa00::/48,no-resolve
337 | IP-CIDR6,240e:e9:6003::/48,no-resolve
338 | IP-CIDR6,240e:f7:4f00:1f10::/60,no-resolve
339 | IP-CIDR6,240e:f7:a070:100::/60,no-resolve
340 | IP-CIDR6,240e:ff:9018:100::/60,no-resolve
341 | IP-CIDR6,240e:ff:f100::/44,no-resolve
342 | IP-ASN,132203,no-resolve
343 | USER-AGENT,MicroMessenger*
344 | USER-AGENT,WeChat*
345 |
--------------------------------------------------------------------------------
/dist/tencent/custom.list:
--------------------------------------------------------------------------------
1 | DOMAIN-KEYWORD,183.60.8.
2 | DOMAIN-KEYWORD,14.116.242.
3 | DOMAIN-KEYWORD,183.61.247.
4 | DOMAIN-KEYWORD,113.105.153.
5 | DOMAIN-KEYWORD,113.105.171.
6 | DOMAIN,kc.iikira.com
7 |
--------------------------------------------------------------------------------
/dist/tencent_link.conf:
--------------------------------------------------------------------------------
1 | [General]
2 | #!name= 腾讯大王卡动态免流@prod
3 | #!desc= 腾讯大王卡动态免流@author=gsonhub @version=rmup
4 |
5 | bypass-system = true
6 | skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, localhost, *.local, captive.apple.com, kc.iikira.com
7 | tun-excluded-routes = 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.2.0/24, 192.88.99.0/24, 192.168.0.0/16, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 224.0.0.0/4
8 | dns-server = 1.1.1.1,114.114.114.114,8.8.8.8,119.29.29.29
9 | ipv6 = false
10 |
11 |
12 | force-http-engine-hosts = %APPEND% tencent.log tencent.json
13 |
14 | update-url = https://charming-gnome-9c9592.netlify.app/tencent.conf
15 |
16 | [Proxy Group]
17 | 国内王卡跳板 = select,腾讯大王卡,interval=86400,timeout=5,select=0,url=http://www.gstatic.com/generate_204
18 | 最终王卡跳板 = select,腾讯大王卡,interval=86400,timeout=5,select=0,url=http://www.gstatic.com/generate_204
19 |
20 | [Rule]
21 | # 登录大王卡
22 | DOMAIN-SUFFIX,iikira.com.token,腾讯大王卡
23 | DOMAIN,kc.iikira.com,DIRECT
24 |
25 | # 腾讯系直连
26 | USER-AGENT,WeChatShareExtension*,DIRECT
27 | DOMAIN-SUFFIX,tencent.com,DIRECT
28 | DOMAIN-SUFFIX,qlogo.cn,DIRECT
29 | DOMAIN-SUFFIX,gtimg.cn,DIRECT
30 | DOMAIN-SUFFIX,qq.com,DIRECT
31 | RULE-SET,https://charming-gnome-9c9592.netlify.app/tencent/Tencent.list,DIRECT
32 | RULE-SET,https://charming-gnome-9c9592.netlify.app/tencent/TencentVideo.list,DIRECT
33 | RULE-SET,https://charming-gnome-9c9592.netlify.app/tencent/WeChat.list,DIRECT
34 | RULE-SET,https://charming-gnome-9c9592.netlify.app/tencent/custom.list,DIRECT
35 | #DOMAIN-SUFFIX,charming-gnome-9c9592.netlify.app,DIRECT
36 | #DOMAIN-SUFFIX,cdn.jsdelivr.net,腾讯大王卡
37 | DOMAIN-SET,https://fastly.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Surge/ChinaMax/ChinaMax_Domain.list,腾讯大王卡
38 | GEOIP,CN,国内王卡跳板
39 | FINAL,最终王卡跳板
40 |
41 | [Script]
42 | # 接口服务 http://tencent.json http://tencent.log
43 | tencent-http-service = type=http-request,pattern=^https?:\/\/tencent\.(json|log),script-path=https://charming-gnome-9c9592.netlify.app/tencent.js?v=rmup,requires-body=true,max-size=0,timeout=10
44 | # 轮询1检查网络
45 | tencent-for-cron1 = type=cron,cronexp=*/1 * * * *,timeout=30,script-path=https://charming-gnome-9c9592.netlify.app/tencent.js?v=rmup,argument=network-check
46 | # 轮询5更新TOKEN
47 | tencent-for-cron5 = type=cron,cronexp=*/5 * * * *,timeout=30,script-path=https://charming-gnome-9c9592.netlify.app/tencent.js?v=rmup,argument=network-token
48 | #network-changed
49 | tencent-network-changed = script-path=https://charming-gnome-9c9592.netlify.app/tencent.js?v=rmup,argument=network-changed,type=event,event-name=network-changed
50 |
--------------------------------------------------------------------------------
/dist/txdwk.conf:
--------------------------------------------------------------------------------
1 | # Shadowrocket: 2024-01-09 16:10:02
2 | [General]
3 | bypass-system = true
4 | skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, localhost, *.local, captive.apple.com
5 | tun-excluded-routes = 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.2.0/24, 192.88.99.0/24, 192.168.0.0/16, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 224.0.0.0/4
6 | dns-server = 1.1.1.1,114.114.114.114,8.8.8.8,119.29.29.29
7 | ipv6 = false
8 | force-http-engine-hosts = %APPEND% txdwk.log txdwk.json
9 | update-url = https://charming-gnome-9c9592.netlify.app/txdwk.conf
10 |
11 | [Proxy Group]
12 | PROXYWK = select,腾讯大王卡,interval=86400,timeout=5,select=0,url=http://www.gstatic.com/generate_204
13 |
14 | [Rule]
15 | USER-AGENT,WeChatShareExtension*,DIRECT
16 | #IP-CIDR,123.125.0.195/32,PROXY
17 | #IP-CIDR,157.148.42.198/32,PROXY
18 | IP-CIDR,123.125.0.194/32,DIRECT
19 | #IP-CIDR,157.255.5.249/32,PROXY
20 | DOMAIN-SUFFIX,tencent.com,DIRECT
21 | #IP-CIDR,112.86.231.165/32,DIRECT
22 | DOMAIN-SUFFIX,qlogo.cn,DIRECT
23 | DOMAIN-SUFFIX,charming-gnome-9c9592.netlify.app,DIRECT
24 | #USER-AGENT,QQ/*,DIRECT
25 | DOMAIN-SUFFIX,gtimg.cn,DIRECT
26 | DOMAIN-SUFFIX,qq.com,DIRECT
27 | DOMAIN-SUFFIX,kc.iikira.com,DIRECT
28 | DOMAIN-SUFFIX,cdn.jsdelivr.net,PROXYWK
29 | DOMAIN-SUFFIX,iikira.com.token,PROXYWK
30 | GEOIP,CN,PROXYWK
31 | FINAL,PROXYWK
32 |
33 | [Script]
34 | # 接口服务 http://txdwk.json http://txdwk.log
35 | txdwk-http-service = type=http-request,pattern=^https?:\/\/txdwk\.(json|log),script-path=https://charming-gnome-9c9592.netlify.app/txdwk.js?v=0.02,requires-body=true,max-size=0,timeout=10
36 | # 轮询
37 | txdwk-for-cron = type=cron,cronexp=*/5 * * * *,timeout=30,script-path=https://charming-gnome-9c9592.netlify.app/txdwk.js?v=0.02,argument=auto
38 | #network-changed
39 | txdwk-network-changed = script-path=https://charming-gnome-9c9592.netlify.app/txdwk.js?v=0.02,argument=auto,type=event,event-name=network-changed
40 |
--------------------------------------------------------------------------------
/dist/txdwk.js:
--------------------------------------------------------------------------------
1 | (()=>{var t={577:()=>{},949:()=>{},690:()=>{},843:t=>{"use strict";t.exports={}}},e={};function s(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,s),o.exports}(()=>{"use strict";var t,e,n;!function(t){t.Surge="Surge",t.Loon="Loon",t.QuanX="QuanX",t.Shadowrocket="Shadowrocket",t.Node="Node"}(t||(t={})),function(t){t.Response="http-response",t.Request="http-request",t.Script="run-script"}(e||(e={})),function(t){t[t.BASE=0]="BASE",t[t.HTTP=1]="HTTP",t[t.SYS=2]="SYS",t[t.OTHER=3]="OTHER"}(n||(n={}));class i extends Error{constructor(t,e=n.BASE){super(t),this.name="baseErr",this.code=e,this.stack=(new Error).stack,Object.setPrototypeOf(this,i.prototype)}}class o{constructor(t,e){this.isMute=!1,this.logList=[],this.logSeparator="\n\n",this.appName=t,this.namespace=e,this.startTime=(new Date).getTime(),this.log(`🔔${this.appName}, 开始!`),this.initAction(),this.initEnv();let n=this.getStore("mute");this.isMute="true"==n,s(843),s(690),s(577)}initAction(){"undefined"!=typeof $response?this.action=e.Response:"undefined"!=typeof $request?this.action=e.Request:this.action=e.Script,this.log("脚本类型为:"+this.action)}async doAction(){switch(this.action){case e.Request:this.result=await this.doRequestAction($request);break;case e.Response:this.result=await this.doResponseAction($request,$response);break;case e.Script:this.result=await this.doScriptAction();break;default:this.log(this.appName,"Unknow Action","未知的脚本类型"),this.result=!1}!1===this.result&&this.msg(this.appName,"不合法的脚本","请检查脚本配置信息")}run(){this.doAction().catch((t=>{t instanceof i?(this.log(""+t.code),t.code==n.BASE?this.msg(this.appName,t.message,""):t.code==n.HTTP?Math.random()>.8?this.msg(this.appName,"网络异常:"+t.message,""):this.log(this.appName,"网络异常Log:"+t.message,""):this.log(t.message,"")):this.log(t),this.result=this.ajaxFailResult(t.message||t)})).finally((()=>{this.done()}))}transParams(t){return Object.keys(t).map((e=>`${e}=${encodeURIComponent(t[e])}`)).join("&")}httpResponseResult(e,s={}){return{response:{status:this.env===t.QuanX?"HTTP/1.1 200":200,body:"string"==typeof e?e:JSON.stringify(e),headers:{"Content-Type":"application/json; charset=utf-8","Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"POST,GET","Access-Control-Allow-Headers":"Origin, X-Requested-With, Content-Type, Accept",...s}}}}randomString(t){for(var e="",s=0;s
"),this.httpResponseResult(t,{"Content-Type":"text/html;charset=utf-8"})}send(t){return new Promise(((e,s)=>{this.doRequest(t,((t,o,r)=>{t?s(new i(t,n.HTTP)):e(o)}))}))}async post(t){return t.method="post",await this.send(t)}async get(t){return t.method="get",await this.send(t)}doRequest(e,s=((t,e,s)=>{})){const n=e.method?e.method.toLocaleLowerCase():"post";e.body&&e.headers&&!e.headers["Content-Type"]&&(e.headers["Content-Type"]="application/x-www-form-urlencoded"),e.headers&&delete e.headers["Content-Length"],this.env==t.Surge||this.env==t.Shadowrocket||this.env==t.Loon?(this.env==t.Surge&&this.isNeedRewrite&&(e.headers=e.headers||{},Object.assign(e.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient[n](e,((t,e,n)=>{!t&&e&&(e.body=n,e.statusCode=e.status?e.status:e.statusCode,e.status=e.statusCode),s(t,e,n)}))):this.env==t.QuanX?(e.method=n,this.isNeedRewrite&&(e.opts=e.opts||{},Object.assign(e.opts,{hints:!1})),$task.fetch(e).then((t=>{const{statusCode:e,statusCode:n,headers:i,body:o}=t;s(null,{status:e,statusCode:n,headers:i,body:o},o)}),(t=>s(t&&t.error||"UndefinedError",null,null)))):this.env==t.Node&&this.print("nodejs http request",e,this.env)}sleep(t){return new Promise((e=>setTimeout(e,t)))}ajaxSuccessResult(t,e=null){let s={time:+new Date,datetime:this.date("yyyy-MM-dd HH:mm:ss"),code:1,msg:t,data:e};return this.httpResponseResult(s)}ajaxFailResult(t,e=null){let s={time:+new Date,datetime:this.date("yyyy-MM-dd HH:mm:ss"),code:0,msg:t,data:e};return this.httpResponseResult(s)}done(){const s=((new Date).getTime()-this.startTime)/1e3;if(this.action===e.Script&&this.print("运行 response: "+JSON.stringify(this.result)),this.log(`🔔${this.appName}, 结束! 🕛 ${s} 秒 ${this.logSeparator}`),this.env==t.Node)process.exit(1);else{let t=this.getStore(o.APP_LOG_KEY)||"";t=t.split(this.logSeparator).slice(0,1e4).join(this.logSeparator),t=this.logList.join("")+t,this.setStore(o.APP_LOG_KEY,t),this.print("注意本次运行日志已缓存到变量 "+this.namespace+"."+o.APP_LOG_KEY),this.result?$done(this.result):$done({})}}msg(e,s,n){this.isMute||(this.log("==============📣系统通知📣=============="+this.logSeparator+e+this.logSeparator+s+this.logSeparator+n),this.env==t.Surge||this.env==t.Shadowrocket||this.env==t.Loon?$notification.post(e,s,n):this.env==t.QuanX&&$notify(e,s,n))}print(...t){t=t.map((t=>this.date("yyyy-MM-dd HH:mm:ss")+" "+t+this.logSeparator)),console.log(t.join(this.logSeparator))}log(...t){(t=t.map((t=>this.date("yyyy-MM-dd HH:mm:ss")+" "+("string"==typeof t?t:JSON.stringify(t))+this.logSeparator))).length>0&&(this.logList=[...this.logList,...t]),console.log(t.join(this.logSeparator))}getStore(e,s=!0){return s&&(e=this.namespace+"."+e),this.env==t.Surge||this.env==t.Shadowrocket||this.env==t.Loon?$persistentStore.read(e):this.env==t.QuanX?$prefs.valueForKey(e):null}setStore(e,s,n=!0){return n&&(e=this.namespace+"."+e),this.env==t.Surge||this.env==t.Shadowrocket||this.env==t.Loon?$persistentStore.write(s,e):this.env==t.QuanX&&$prefs.setValueForKey(s,e)}initEnv(){"undefined"!=typeof $task?this.env=t.QuanX:"undefined"!=typeof $loon?this.env=t.Loon:"undefined"!=typeof $rocket?this.env=t.Shadowrocket:"undefined"!=typeof $httpClient&&"undefined"==typeof $loon?this.env=t.Surge:this.env=t.Node,this.log("当前APP为: "+this.env)}date(t,e=""){const s=e?new Date(e):new Date;let n={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in n){let s=n[e];new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?s:("00"+s).substr((""+s).length)))}return t}getSignCount(){let t=this.getStore("sign_count"),e=this.date("yyyyMMdd");if(t){let[s,n]=t.split("_");return s==e&&n?Number(n):(this.setStore("sign_count",`${e}_0`),0)}return this.setStore("sign_count",`${e}_0`),0}incSignCount(){let t=this.getSignCount();t++;let e=this.date("yyyyMMdd");this.setStore("sign_count",`${e}_${t}`)}}o.APP_LOG_KEY="boxjs-log";const r=o;s(949);class a extends r{async doRequestAction(t){if(t.url.includes("txdwk.log"))return this.handelLogHttp();if(t.url.includes("txdwk.json")){let t="",e=!1;try{const s=await this.fetchGuidTokenToConnect();204==s.status?(t="连接成功!",e=!0):t="连接失败!系统错误,"+JSON.stringify(s)}catch(e){let s="";e instanceof i&&(s=e.message),t="连接失败!系统异常,"+s}this.log(t);let s=this.renderHtml(t);return this.httpResponseResult(s,{"Content-Type":"text/html;charset=utf-8"})}return!1}renderHtml(t){return`\n \n 大王卡动态免流\n \n \n \n \n \n 腾讯大王卡动态免流
\n ${t}
\n \n \n `}async doResponseAction(t,e){return!1}async doScriptAction(){return await this.fetchGuidTokenToConnect(),{}}async fetchGuidTokenToConnect(){const t=await this.get({url:a.TOKEN_URL}),[e,s]=t.body.split(",");if(!/\w+/.test(e)||!/\w+/.test(s))throw new i("读取token失败!",n.HTTP);this.log("连接代理服务器。。。",{guid:e,token:s}),this.get({url:`http://${e}.${s}.iikira.com.token`}).then().catch(),this.log("连接代理完成 待测试。。。",{guid:e,token:s});const o=await this.get({url:"http://www.gstatic.com/generate_204"});return this.log(o),o}}a.TOKEN_URL="http://kc.iikira.com/kingcard",new a("腾讯大王卡动态","gsonhub.txdwk").run()})()})();
--------------------------------------------------------------------------------
/dist/txdwk.lua:
--------------------------------------------------------------------------------
1 | -- 腾讯大王卡动态免流
2 | -- @author gsonhub
3 | -- @date 2024-01-08
4 |
5 |
6 | local http = require 'http'
7 | local backend = require 'backend'
8 |
9 | local char = string.char
10 | local byte = string.byte
11 | local find = string.find
12 | local sub = string.sub
13 |
14 | local ADDRESS = backend.ADDRESS
15 | local PROXY = backend.PROXY
16 | local DIRECT_WRITE = backend.SUPPORT.DIRECT_WRITE
17 |
18 | local SUCCESS = backend.RESULT.SUCCESS
19 | local HANDSHAKE = backend.RESULT.HANDSHAKE
20 | local DIRECT = backend.RESULT.DIRECT
21 |
22 | local ctx_uuid = backend.get_uuid
23 | local ctx_proxy_type = backend.get_proxy_type
24 | local ctx_address_type = backend.get_address_type
25 | local ctx_address_host = backend.get_address_host
26 | local ctx_address_bytes = backend.get_address_bytes
27 | local ctx_address_port = backend.get_address_port
28 | local ctx_write = backend.write
29 | local ctx_free = backend.free
30 | local ctx_debug = backend.debug
31 |
32 | local flags = {}
33 | local kHttpHeaderSent = 1
34 | local kHttpHeaderRecived = 2
35 |
36 | local GUID = 'NULL'
37 | local TOKEN = 'NULL'
38 |
39 | function wa_lua_on_flags_cb(ctx)
40 | return DIRECT_WRITE
41 | end
42 |
43 | function wa_lua_on_handshake_cb(ctx)
44 | ctx_debug('wa_lua_on_handshake_cb')
45 | local uuid = ctx_uuid(ctx)
46 | local host = ctx_address_host(ctx)
47 | local port = ctx_address_port(ctx)
48 |
49 | if(find(host,'iikira.com.token')) then
50 | GUID,TOKEN = host:match("(%w+)%.(%w+)%.(%w+)")
51 | ctx_debug('GUID:'..GUID)
52 | ctx_debug('TOKEN:'..TOKEN)
53 | end
54 |
55 | if flags[uuid] == kHttpHeaderRecived then
56 | return true
57 | end
58 |
59 | if flags[uuid] ~= kHttpHeaderSent then
60 | local res = 'CONNECT ' .. host .. ':' .. port .. ' HTTP/1.1\r\n' ..
61 | 'Q-GUID: '..GUID..'\r\n' ..
62 | 'Q-Token: '..TOKEN..'\r\n' ..
63 | 'Proxy-Connection: Keep-Alive\r\n\r\n'
64 | ctx_write(ctx, res)
65 | -- ctx_debug('wa_lua_on_handshake_cb res '..res)
66 | flags[uuid] = kHttpHeaderSent
67 | end
68 |
69 | return false
70 | end
71 |
72 | function wa_lua_on_read_cb(ctx, buf)
73 | ctx_debug('wa_lua_on_read_cb')
74 | local uuid = ctx_uuid(ctx)
75 | if flags[uuid] == kHttpHeaderSent then
76 | flags[uuid] = kHttpHeaderRecived
77 | return HANDSHAKE, nil
78 | end
79 | return DIRECT, buf
80 | end
81 |
82 | function wa_lua_on_write_cb(ctx, buf)
83 | ctx_debug('wa_lua_on_write_cb')
84 | return DIRECT, buf
85 | end
86 |
87 | function wa_lua_on_close_cb(ctx)
88 | ctx_debug('wa_lua_on_close_cb')
89 | local uuid = ctx_uuid(ctx)
90 | flags[uuid] = nil
91 | ctx_free(ctx)
92 | return SUCCESS
93 | end
94 |
--------------------------------------------------------------------------------
/dist/txdwk.sgmodule:
--------------------------------------------------------------------------------
1 | #!name= 腾讯大王卡动态免流@prod
2 | #!desc= 腾讯大王卡动态免流@author=gsonhub @version=mvsj
3 |
4 | [General]
5 | force-http-engine-hosts = %APPEND% txdwk.log txdwk.json
6 |
7 | [Script]
8 |
9 | # 接口服务 http://txdwk.json http://txdwk.log
10 | txdwk-http-service = type=http-request,pattern=^https?:\/\/txdwk\.(json|log),script-path=https://charming-gnome-9c9592.netlify.app/txdwk.js?v=mvsj,requires-body=true,max-size=0,timeout=10
11 |
12 | # 轮询
13 | txdwk-for-cron = type=cron,cronexp=*/1 * * * *,timeout=30,script-path=https://charming-gnome-9c9592.netlify.app/txdwk.js?v=mvsj,argument=auto
14 |
15 | #network-changed
16 | txdwk-network-changed = script-path=https://charming-gnome-9c9592.netlify.app/txdwk.js?v=mvsj,argument=auto,type=event,event-name=network-changed
--------------------------------------------------------------------------------
/dist/txdwk_link.conf:
--------------------------------------------------------------------------------
1 | #!name= 腾讯大王卡动态免流@prod
2 | #!desc= 腾讯大王卡动态免流@author=gsonhub @version=mvsj
3 |
4 | [General]
5 | bypass-system = true
6 | skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, localhost, *.local, captive.apple.com
7 | tun-excluded-routes = 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.2.0/24, 192.88.99.0/24, 192.168.0.0/16, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 224.0.0.0/4
8 | dns-server = 1.1.1.1,114.114.114.114,8.8.8.8,119.29.29.29
9 | ipv6 = false
10 | force-http-engine-hosts = %APPEND% txdwk.log txdwk.json
11 |
12 | update-url = https://charming-gnome-9c9592.netlify.app/txdwk.conf
13 |
14 | [Proxy Group]
15 |
16 | 国内王卡跳板 = url-test,上海专区-钉钉,上海专区-腾讯,interval=300,tolerance=20,timeout=10,select=0,url=http://www.gstatic.com/generate_204
17 |
18 | 最终王卡跳板 = select,白菜云慢速节点-CANADA_VLESS_0,白菜云慢速节点-CANADA_VLESS_1,interval=86400,timeout=5,select=1,url=http://www.gstatic.com/generate_204
19 |
20 | [Rule]
21 |
22 | #王卡登录以及下载脚本操作
23 | DOMAIN-SUFFIX,charming-gnome-9c9592.netlify.app,DIRECT
24 | DOMAIN-SUFFIX,kc.iikira.com,DIRECT
25 | DOMAIN-SUFFIX,gstatic.com,腾讯大王卡
26 | DOMAIN-SUFFIX,iikira.com.token,腾讯大王卡
27 | DOMAIN-SUFFIX,cdn.jsdelivr.net,腾讯大王卡
28 |
29 | #王卡专线 腾讯系规则 直连
30 | USER-AGENT,WeChatShareExtension*,DIRECT
31 | DOMAIN-SUFFIX,tencent.com,DIRECT
32 | #USER-AGENT,QQ/*,DIRECT
33 | DOMAIN-SUFFIX,qlogo.cn,DIRECT
34 | DOMAIN-SUFFIX,qq.com,DIRECT
35 |
36 | #RULE-SET,https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Surge/Tencent/Tencent.list,DIRECT
37 | #RULE-SET,https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Surge/TencentVideo/TencentVideo.list,DIRECT
38 | #RULE-SET,https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Surge/WeChat/WeChat.list,DIRECT
39 |
40 | #国内域名使用腾讯大王卡节点
41 | DOMAIN-SET,https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Surge/ChinaMax/ChinaMax_Domain.list,腾讯大王卡
42 |
43 | #国内IP使用腾讯大王卡跳板节点
44 | GEOIP,CN,国内王卡跳板
45 |
46 | FINAL,最终王卡跳板
47 |
48 | [Script]
49 | # 接口服务 http://txdwk.json http://txdwk.log
50 | txdwk-http-service = type=http-request,pattern=^https?:\/\/txdwk\.(json|log),script-path=https://charming-gnome-9c9592.netlify.app/txdwk.js?v=mvsj,requires-body=true,max-size=0,timeout=10
51 | # 轮询
52 | txdwk-for-cron = type=cron,cronexp=*/5 * * * *,timeout=30,script-path=https://charming-gnome-9c9592.netlify.app/txdwk.js?v=mvsj,argument=auto
53 | #network-changed
54 | txdwk-network-changed = script-path=https://charming-gnome-9c9592.netlify.app/txdwk.js?v=mvsj,argument=auto,type=event,event-name=network-changed
55 |
--------------------------------------------------------------------------------
/dist/txdwk_new.conf:
--------------------------------------------------------------------------------
1 | # Shadowrocket: 2024-01-26 17:55:27
2 | [General]
3 | bypass-system = true
4 | skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, localhost, *.local, captive.apple.com
5 | tun-excluded-routes = 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.2.0/24, 192.88.99.0/24, 192.168.0.0/16, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 224.0.0.0/4
6 | dns-server = 1.1.1.1,114.114.114.114,8.8.8.8,119.29.29.29
7 | ipv6 = false
8 | force-http-engine-hosts = %APPEND% txdwk.log txdwk.json
9 | update-url = https://charming-gnome-9c9592.netlify.app/txdwk.conf
10 |
11 | [Proxy Group]
12 | PROXYWK = select,腾讯大王卡,interval=86400,timeout=5,select=0,url=http://www.gstatic.com/generate_204
13 |
14 | [Rule]
15 | USER-AGENT,WeChatShareExtension*,DIRECT
16 | #IP-CIDR,123.125.0.195/32,PROXY
17 | #IP-CIDR,157.148.42.198/32,PROXY
18 | IP-CIDR,123.125.0.194/32,DIRECT
19 | #IP-CIDR,157.255.5.249/32,PROXY
20 | DOMAIN-SUFFIX,tencent.com,DIRECT
21 | #IP-CIDR,112.86.231.165/32,DIRECT
22 | DOMAIN-SUFFIX,qlogo.cn,DIRECT
23 | DOMAIN-SUFFIX,charming-gnome-9c9592.netlify.app,DIRECT
24 | #USER-AGENT,QQ/*,DIRECT
25 | DOMAIN-SUFFIX,gtimg.cn,DIRECT
26 | DOMAIN-SUFFIX,qq.com,DIRECT
27 | DOMAIN-SUFFIX,kc.iikira.com,DIRECT
28 | DOMAIN-SUFFIX,cdn.jsdelivr.net,PROXYWK
29 | DOMAIN-SUFFIX,iikira.com.token,PROXYWK
30 | GEOIP,CN,PROXYWK
31 | FINAL,PROXYWK
32 |
33 | [Script]
34 | # 接口服务 http://tencent.json http://tencent.log
35 | tencent-http-service = type=http-request,pattern=^https?:\/\/tencent\.(json|log),script-path=https://charming-gnome-9c9592.netlify.app/tencent.js?v=12urpu,requires-body=true,max-size=0,timeout=10
36 | # 轮询1检查网络
37 | tencent-for-cron1 = type=cron,cronexp=*/1 * * * *,timeout=30,script-path=https://charming-gnome-9c9592.netlify.app/tencent.js?v=12urpu,argument=network-check
38 | # 轮询5更新TOKEN
39 | tencent-for-cron5 = type=cron,cronexp=*/5 * * * *,timeout=30,script-path=https://charming-gnome-9c9592.netlify.app/tencent.js?v=12urpu,argument=network-token
40 | #network-changed
41 | tencent-network-changed = script-path=https://charming-gnome-9c9592.netlify.app/tencent.js?v=12urpu,argument=network-changed,type=event,event-name=network-changed
42 |
--------------------------------------------------------------------------------
/dist/unicom.sgmodule:
--------------------------------------------------------------------------------
1 | #!name= 中国联通@prod
2 | #!desc= 中国联通@author=gsonhub @version=rmup
3 |
4 | [General]
5 | force-http-engine-hosts = %APPEND% 10010.log 10010.json
6 |
7 | [Script]
8 |
9 | # 轮询 查询中国联通流量
10 | unicom-for-cron = type=cron,cronexp=*/5 * * * *,timeout=10,script-path=https://charming-gnome-9c9592.netlify.app/unicom.js?v=rmup
11 |
12 | # 查询中国联通流量接口服务 http://10010.json 查询联通日志 http://10010.log
13 | unicom-http-service = type=http-request,pattern=^https?:\/\/10010\.(json|log),script-path=https://charming-gnome-9c9592.netlify.app/unicom.js?v=rmup,requires-body=true,max-size=0,timeout=10
14 |
--------------------------------------------------------------------------------
/dist/wps.js:
--------------------------------------------------------------------------------
1 | (()=>{var t={764:()=>{},843:t=>{"use strict";t.exports={}}},e={};function s(o){var i=e[o];if(void 0!==i)return i.exports;var n=e[o]={exports:{}};return t[o](n,n.exports,s),n.exports}(()=>{"use strict";var t,e,o;!function(t){t.Surge="Surge",t.Loon="Loon",t.QuanX="QuanX",t.Shadowrocket="Shadowrocket",t.Node="Node"}(t||(t={})),function(t){t.Response="http-response",t.Request="http-request",t.Script="run-script"}(e||(e={})),function(t){t[t.BASE=0]="BASE",t[t.HTTP=1]="HTTP",t[t.SYS=2]="SYS",t[t.OTHER=3]="OTHER"}(o||(o={}));class i extends Error{constructor(t,e=o.BASE){super(t),this.name="baseErr",this.code=e,this.stack=(new Error).stack,Object.setPrototypeOf(this,i.prototype)}}class n{constructor(t,e){this.isMute=!1,this.logList=[],this.logSeparator="\n\n",this.appName=t,this.namespace=e,this.startTime=(new Date).getTime(),this.log(`🔔${this.appName}, 开始!`),this.initAction(),this.initEnv();let o=this.getStore("mute");this.isMute="true"==o,s(843)}initAction(){"undefined"!=typeof $response?this.action=e.Response:"undefined"!=typeof $request?this.action=e.Request:this.action=e.Script,this.log("脚本类型为:"+this.action)}async doAction(){switch(this.action){case e.Request:this.result=await this.doRequestAction($request);break;case e.Response:this.result=await this.doResponseAction($request,$response);break;case e.Script:this.result=await this.doScriptAction();break;default:this.log(this.appName,"Unknow Action","未知的脚本类型"),this.result=!1}!1===this.result&&this.msg(this.appName,"不合法的脚本","请检查脚本配置信息")}run(){this.doAction().catch((t=>{t instanceof i?(this.log(""+t.code),t.code==o.BASE?this.msg(this.appName,t.message,""):t.code==o.HTTP?Math.random()>.8?this.msg(this.appName,"网络异常:"+t.message,""):this.log(this.appName,"网络异常Log:"+t.message,""):this.log(t.message,"")):this.log(t),this.result=this.ajaxFailResult(t.message||t)})).finally((()=>{this.done()}))}transParams(t){return Object.keys(t).map((e=>`${e}=${encodeURIComponent(t[e])}`)).join("&")}httpResponseResult(e,s={}){const o={status:this.env===t.QuanX?"HTTP/1.1 200":200,body:"string"==typeof e?e:JSON.stringify(e),headers:{"Content-Type":"application/json; charset=utf-8","Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"POST,GET","Access-Control-Allow-Headers":"Origin, X-Requested-With, Content-Type, Accept",...s}};return this.env===t.QuanX?o:{response:o}}randomString(t){for(var e="",s=0;s"),this.httpResponseResult(t,{"Content-Type":"text/html;charset=utf-8"})}send(t){return new Promise(((e,s)=>{this.doRequest(t,((t,n,r)=>{t?s(new i(t,o.HTTP)):e(n)}))}))}async post(t){return t.method="post",await this.send(t)}async get(t){return t.method="get",await this.send(t)}doRequest(e,s=((t,e,s)=>{})){const o=e.method?e.method.toLocaleLowerCase():"post";e.body&&e.headers&&!e.headers["Content-Type"]&&(e.headers["Content-Type"]="application/x-www-form-urlencoded"),e.headers&&delete e.headers["Content-Length"],this.env==t.Surge||this.env==t.Shadowrocket||this.env==t.Loon?(this.env==t.Surge&&this.isNeedRewrite&&(e.headers=e.headers||{},Object.assign(e.headers,{"X-Surge-Skip-Scripting":!1})),$httpClient[o](e,((t,e,o)=>{!t&&e&&(e.body=o,e.statusCode=e.status?e.status:e.statusCode,e.status=e.statusCode),s(t,e,o)}))):this.env==t.QuanX?(e.method=o,this.isNeedRewrite&&(e.opts=e.opts||{},Object.assign(e.opts,{hints:!1})),$task.fetch(e).then((t=>{const{statusCode:e,statusCode:o,headers:i,body:n}=t;s(null,{status:e,statusCode:o,headers:i,body:n},n)}),(t=>s(t&&t.error||"UndefinedError",null,null)))):this.env==t.Node&&this.print("nodejs http request",e,this.env)}sleep(t){return new Promise((e=>setTimeout(e,t)))}ajaxSuccessResult(t,e=null){let s={time:+new Date,datetime:this.date("yyyy-MM-dd HH:mm:ss"),code:1,msg:t,data:e};return this.httpResponseResult(s)}ajaxFailResult(t,e=null){let s={time:+new Date,datetime:this.date("yyyy-MM-dd HH:mm:ss"),code:0,msg:t,data:e};return this.httpResponseResult(s)}done(){const s=((new Date).getTime()-this.startTime)/1e3;if(this.action===e.Script&&this.print("运行 response: "+JSON.stringify(this.result)),this.log(`🔔${this.appName}, 结束! 🕛 ${s} 秒 ${this.logSeparator}`),this.env==t.Node)process.exit(1);else{let t=this.getStore(n.APP_LOG_KEY)||"";t=t.split(this.logSeparator).slice(0,1e4).join(this.logSeparator),t=this.logList.join("")+t,this.setStore(n.APP_LOG_KEY,t),this.print("注意本次运行日志已缓存到变量 "+this.namespace+"."+n.APP_LOG_KEY),this.result?$done(this.result):$done({})}}msg(e,s,o){this.isMute||(this.log("==============📣系统通知📣=============="+this.logSeparator+e+this.logSeparator+s+this.logSeparator+o),this.env==t.Surge||this.env==t.Shadowrocket||this.env==t.Loon?$notification.post(e,s,o):this.env==t.QuanX&&$notify(e,s,o))}print(...t){t=t.map((t=>this.date("yyyy-MM-dd HH:mm:ss")+" "+t+this.logSeparator)),console.log(t.join(this.logSeparator))}log(...t){(t=t.map((t=>this.date("yyyy-MM-dd HH:mm:ss")+" "+("string"==typeof t?t:JSON.stringify(t))+this.logSeparator))).length>0&&(this.logList=[...this.logList,...t]),console.log(t.join(this.logSeparator))}getStore(e,s=!0){return s&&(e=this.namespace+"."+e),this.env==t.Surge||this.env==t.Shadowrocket||this.env==t.Loon?$persistentStore.read(e):this.env==t.QuanX?$prefs.valueForKey(e):null}setStore(e,s,o=!0){return o&&(e=this.namespace+"."+e),this.env==t.Surge||this.env==t.Shadowrocket||this.env==t.Loon?$persistentStore.write(s,e):this.env==t.QuanX&&$prefs.setValueForKey(s,e)}initEnv(){"undefined"!=typeof $task?this.env=t.QuanX:"undefined"!=typeof $loon?this.env=t.Loon:"undefined"!=typeof $rocket?this.env=t.Shadowrocket:"undefined"!=typeof $httpClient&&"undefined"==typeof $loon?this.env=t.Surge:this.env=t.Node,this.log("当前APP为: "+this.env)}date(t,e=""){const s=e?new Date(e):new Date;let o={"M+":s.getMonth()+1,"d+":s.getDate(),"H+":s.getHours(),"m+":s.getMinutes(),"s+":s.getSeconds(),"q+":Math.floor((s.getMonth()+3)/3),S:s.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(s.getFullYear()+"").substr(4-RegExp.$1.length)));for(let e in o){let s=o[e];new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?s:("00"+s).substr((""+s).length)))}return t}getSignCount(){let t=this.getStore("sign_count"),e=this.date("yyyyMMdd");if(t){let[s,o]=t.split("_");return s==e&&o?Number(o):(this.setStore("sign_count",`${e}_0`),0)}return this.setStore("sign_count",`${e}_0`),0}incSignCount(){let t=this.getSignCount();t++;let e=this.date("yyyyMMdd");this.setStore("sign_count",`${e}_${t}`)}}n.APP_LOG_KEY="boxjs-log";const r=n;s(764),new class extends r{doRequestAction(t){return!!t.url.includes("wps.log")&&this.handelLogHttp()}doResponseAction(t,e){if(!t.url.includes("proxy/msg-sender/api/v1/masshelper/c/detail"))return!1;try{let t=JSON.parse(e.body),s=t.data.data[0].pairs;s=s.map((t=>(/岗位 工资|岗位工资|工资合计|个人应发合计/.test(t.field)?t.value=2500+parseFloat(t.value)+"":/本月应代扣个税额/.test(t.field)?t.value=parseFloat(t.value)+75+"":/实发工资/.test(t.field)?t.value=(2500+parseFloat(t.value)-75).toFixed(2):/入职时间/.test(t.field)&&(t.value="2020-07-27"),t))),t.data.data[0].pairs=s;let o=JSON.stringify(t);return this.log(o),{body:o}}catch(s){throw this.log("解析json失败,修改响应体失败",{url:t.url,body:e.body}),new i("修改响应数据失败",o.BASE)}}doScriptAction(){return!1}}("WPS","gsonhub.wps").run()})()})();
--------------------------------------------------------------------------------
/dist/wps.sgmodule:
--------------------------------------------------------------------------------
1 | #!name= WPS@prod
2 | #!desc= WPS@author=gsonhub @version=rmup
3 |
4 | [MITM]
5 | hostname = %APPEND% vaf.wps.cn
6 |
7 | [General]
8 | force-http-engine-hosts = %APPEND% wps.log
9 |
10 | [Script]
11 |
12 | # WPS
13 | wps-service = type=http-response,pattern=^https?:\/\/vaf\.wps\.cn\/proxy\/msg-sender\/api\/v1\/masshelper\/c\/detail,script-path=https://charming-gnome-9c9592.netlify.app/wps.js?v=rmup,requires-body=true,max-size=0
14 |
15 | # 查询WPS日志 http://wps.log
16 | wps-http-service = type=http-request,pattern=^https?:\/\/wps\.log,script-path=https://charming-gnome-9c9592.netlify.app/wps.js?v=rmup,requires-body=true,max-size=0,timeout=10
17 |
18 |
--------------------------------------------------------------------------------
/git.sh:
--------------------------------------------------------------------------------
1 | npm run build
2 |
3 | git pull
4 | git add .
5 | git commit -m 'auto'
6 | git push
7 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "1.0.0",
3 | "description": "My webpack project",
4 | "name": "my-webpack-project",
5 | "scripts": {
6 | "dev": "node server.js",
7 | "build": "webpack --mode=production --node-env=production"
8 | },
9 | "devDependencies": {
10 | "@types/node": "^20.2.5",
11 | "dotenv": "^16.3.1",
12 | "express": "^4.18.2",
13 | "glob": "^10.2.7",
14 | "http-server": "^14.1.1",
15 | "ts-loader": "^9.4.3",
16 | "typescript": "^5.0.4",
17 | "webpack": "^5.74.0",
18 | "webpack-cli": "^4.10.0",
19 | "webpack-dev-middleware": "^6.1.1"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/server.js:
--------------------------------------------------------------------------------
1 | const httpServer = require("http-server");
2 | const webpack = require("webpack");
3 | const webpackDevMiddleware = require("webpack-dev-middleware");
4 | require("dotenv").config();
5 |
6 | const webpackConfig = require("./webpack.config.js")();
7 | const compiler = webpack(webpackConfig);
8 | webpackDevMiddleware(compiler, {writeToDisk:true})
9 |
10 | var server = httpServer.createServer({ root: process.env.ROOT_DIR,cache:1 });
11 | server.listen(process.env.LOCAL_PORT, process.env.LOCAL_HOST);
12 |
--------------------------------------------------------------------------------
/src/10086.ts:
--------------------------------------------------------------------------------
1 | import VpnBox, { BaseErr, Err } from "./lib/VpnBox";
2 | require('./tpl/10086.tpl.sgmodule');
3 | class App extends VpnBox {
4 | public doRequestAction($request: ScriptRequest): VpnResult | Promise {
5 | if ($request.url.includes("/qhmcc_wap/newQueryPackage/index.json")) {
6 | if ($request.headers && $request.headers['Cookie']) {
7 | this.log("读取header成功", $request.headers);
8 | this.setStore('login_cookie', $request.headers['Cookie']);
9 | this.log("读取cookie成功", $request.headers['Cookie']);
10 | this.msg(this.appName, "读取cookie成功", '');
11 | } else {
12 | this.log("读取cookie失败", $request.headers);
13 | this.msg(this.appName, "读取cookie失败", '');
14 | }
15 | }
16 | return false;
17 | }
18 | public async doResponseAction($request: ScriptRequest, $response: ScriptResponse): Promise {
19 | throw new BaseErr("Method not implemented.");
20 | }
21 | public doScriptAction(): VpnResult | Promise {
22 | throw new BaseErr("Method not implemented.");
23 | }
24 | }
25 |
26 | new App("青海移动", 'gsonhub.10086').run();
27 |
28 |
29 | //https://www.app.qh.chinamobile.com/qhmcc_wap/newQueryPackage/index.json
30 |
--------------------------------------------------------------------------------
/src/baiduwp.ts:
--------------------------------------------------------------------------------
1 | import VpnBox, { BaseErr, Err } from "./lib/VpnBox";
2 | require('./tpl/baiduwp.tpl.sgmodule');
3 | class App extends VpnBox {
4 | public async doRequestAction($request: ScriptRequest): Promise {
5 | if ($request.url.includes("baiduwp.log")) {
6 | return this.handelLogHttp();
7 | }
8 | else if ($request.url.includes('baidupcs.com/file')) {
9 | let headers = $request.headers;
10 |
11 | let user_agent = this.getStore('user_agent');
12 | //设置默认值
13 | if (!user_agent) {
14 | user_agent = 'LogStatistic';
15 | this.setStore('user_agent', user_agent);
16 | }
17 | headers['User-Agent'] = user_agent;
18 |
19 | let aria2_ip = this.getStore('aria2_ip');
20 | let is_aria2 = this.getStore('is_aria2') == 'true';
21 |
22 | //远程电脑下载
23 | if (aria2_ip && is_aria2) {
24 | let aria2_urls = this.getStore('aria2_urls');
25 | //设置默认值
26 | if (!aria2_urls) {
27 | aria2_urls = '[]';
28 | this.setStore('aria2_urls', aria2_urls);
29 | }
30 | let aria2_url_list: Array = JSON.parse(aria2_urls);
31 |
32 | if (aria2_url_list.includes($request.url)) {
33 | throw new BaseErr('该链接已下载,请勿重复下载。。。' + $request.url, Err.SYS);
34 | } else {
35 | aria2_url_list.push($request.url);
36 | }
37 |
38 | headers['User-Agent'] = '';//禁用手机本地下载
39 | let param = {
40 | "id": this.randomString(10),
41 | "jsonrpc": "2.0",
42 | "method": "aria2.addUri",
43 | "params": [[$request.url], {
44 | "header": ["User-Agent:" + user_agent]
45 | }]
46 | }
47 | const url = aria2_ip == 'auto' ? await this.fetchAria2Url() : aria2_ip;
48 | this.log("ARIA2 RPC URL:", url);
49 | this.log("ARIA2 RPC param:", param)
50 | const res = await this.post({ url: url, body: JSON.stringify(param) });
51 | const data = JSON.parse(res.body);
52 | if (data['result']) {
53 | this.setStore('aria2_urls', JSON.stringify(aria2_url_list));
54 | this.msg(this.appName, '下载成功!', res.body);
55 | } else {
56 | this.msg(this.appName, '下载失败!', res.body);
57 | }
58 | }
59 |
60 | this.log('读取到百度直链URL:' + $request.url);
61 | return { headers };
62 | } else {
63 | return false;
64 | }
65 | }
66 |
67 | private async fetchAria2Url() {
68 | const url = "https://gitee.com/jsonp/jsonp/raw/master/get_cpolar_list.js";
69 | const res = await this.get({ url: url });
70 | const [, body] = /get_cpolar_list\((.*?)\)/.exec(res.body) ?? [];
71 | const list: Array = JSON.parse(body);
72 | const obj = list.find(obj => obj.name === 'aria2');
73 | if (obj && obj.domain) {
74 | const rpcUrl = `http://${obj.domain}/jsonrpc`;
75 | return rpcUrl;
76 | } else {
77 | throw new BaseErr('无法读取Aria2域名', Err.BASE);
78 | }
79 | }
80 |
81 | public doResponseAction($request: ScriptRequest, $response: ScriptResponse): VpnResult | Promise {
82 | throw new Error("Method not implemented.");
83 | }
84 | public doScriptAction(): VpnResult | Promise {
85 | throw new Error("Method not implemented.");
86 | }
87 | }
88 |
89 | new App("百度网盘直链", 'gsonhub.baiduwp').run();
--------------------------------------------------------------------------------
/src/bing.ts:
--------------------------------------------------------------------------------
1 | import VpnBox, { BaseErr, Err } from "./lib/VpnBox";
2 | require('./tpl/bing.tpl.sgmodule');
3 | class App extends VpnBox {
4 |
5 | public doRequestAction($request: ScriptRequest): VpnResult | Promise {
6 | // this.log('http request url ',$request.url);
7 | if($request.url.includes("bing.log")){
8 | return this.handelLogHttp();
9 | }
10 | else if($request.url.includes("bing.com")){
11 | const headers={...$request.headers,...{"X-Forwarded-For":'1.1.1.1'}};
12 | // this.log('new http headers',headers);
13 | return {headers}
14 | }else{
15 | return false;
16 | }
17 | }
18 | public doResponseAction($request: ScriptRequest, $response: ScriptResponse): VpnResult | Promise {
19 | return false;
20 | }
21 | public doScriptAction(): VpnResult | Promise {
22 | return false;
23 | }
24 |
25 | }
26 |
27 | new App('必应AI','gsonhub.bing').run();
--------------------------------------------------------------------------------
/src/cloud.ts:
--------------------------------------------------------------------------------
1 | import VpnBox, { BaseErr } from "./lib/VpnBox";
2 | require('./tpl/cloud.tpl.sgmodule');
3 |
4 | class App extends VpnBox {
5 |
6 | public BASE_URL = "";
7 |
8 | constructor(appName: string, namespace: string){
9 | super(appName, namespace);
10 | this.BASE_URL=this.getStore('domain_url')??'https://www.somersaultcloud.xyz';
11 | }
12 |
13 |
14 | public async doRequestAction($request: ScriptRequest): Promise {
15 | if ($request.url.includes("cloud.log")) {
16 | return this.handelLogHttp();
17 | } else if ($request.url.includes("/user/profile")) {
18 | if ($request.headers && $request.headers['Cookie']) {
19 | this.log("读取header成功", $request.headers);
20 | this.setStore('login_cookie', $request.headers['Cookie']);
21 | this.log("读取cookie成功", $request.headers['Cookie']);
22 | this.msg(this.appName, "读取cookie成功", '');
23 | const [domain_url]=/^https?:\/\/(www\.|)somersaultcloud\.(xyz|top)/.exec($request.url)??[];
24 | this.setStore('domain_url',domain_url??this.BASE_URL);
25 | this.log('domain_url '+domain_url);
26 | } else {
27 | this.log("读取cookie失败", $request.headers);
28 | this.msg(this.appName, "读取cookie失败", '');
29 | }
30 | return {};
31 | }
32 | else if ($request.url.includes("cloud.json")) {
33 | const url = `${this.BASE_URL}/user`;
34 | const opt = {
35 | url: url,
36 | headers: {
37 | Cookie: this.getStore('login_cookie') ?? '',
38 | "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42",
39 | referer: url
40 | }
41 | };
42 | const res = await this.get(opt);
43 | try {
44 | const data = this.exportData(res.body);
45 | return this.ajaxSuccessResult('获取个人信息', data);
46 | } catch (error) {
47 | throw new BaseErr('登录状态可能已经失效,' + error?.message);
48 | }
49 | }
50 | else {
51 | return false;
52 | }
53 | }
54 | public doResponseAction($request: ScriptRequest, $response: ScriptResponse): VpnResult | Promise {
55 | return false;
56 | }
57 | public async doScriptAction(): Promise {
58 | if($argument=='auto_sign_ip'){
59 | await this.sleep(10*1000);
60 | let res=await this.get({'url':'https://whois.pconline.com.cn/ipJson.jsp'});
61 | let ip='';
62 | try {
63 | let arr=res.body.match(/\d+\.\d+\.\d+\.\d+/);
64 | if(arr&&arr[0]){
65 | ip=arr[0];
66 | this.log('获取到当前外网ip地址 '+ip);
67 | let ip_list_str=this.getStore('ip_list');
68 | let ip_list=[];
69 | if(ip_list_str){
70 | ip_list=JSON.parse(ip_list_str);
71 | }
72 | if(ip_list.includes(ip)){
73 | this.log('ip地址 '+ip+'已经加白,无需加白!');
74 | return {};
75 | }else{
76 | ip_list.push(ip);
77 | this.setStore('ip_list',JSON.stringify(ip_list));
78 | }
79 | }else{
80 | throw new BaseErr('获取IP外网失败,'+res.body);
81 | }
82 |
83 | } catch (error) {
84 | throw new BaseErr('获取IP外网失败 '+error+'=>res.body'+res.body);
85 | }
86 |
87 | this.log(`IP白名单start $argument=${$argument}`);
88 | let url_arr=["http://hk-trail.somnode.top","http://us-trail.somnode.top","http://jp-trail.somnode.top","http://sg-trail.somnode.top","http://tw-trail.somnode.top","http://ru-trail.somnode.top","http://hk-i.somnode.top","http://hk-ii.somnode.top","http://hk-iii.somnode.top","http://hk-a.somnode.top","http://hk-b.somnode.top","http://hk-c.somnode.top","http://hk-d.somnode.top","http://hk-e.somnode.top","http://hk-f.somnode.top","http://hk-m.somnode.top"];
89 | let random_url=url_arr[Math.floor(Math.random()*url_arr.length)]+'/addallip.php';
90 | url_arr=url_arr.map((url=>{return url+'/addip.php'}));
91 | url_arr.push(random_url);
92 | const promises = url_arr.map(async url => {
93 | const opts = {
94 | url: url,
95 | headers: {
96 | Cookie: this.getStore('login_cookie') ?? '',
97 | "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42",
98 | referer: url
99 | }
100 | };
101 | try {
102 | let res=await this.get(opts);
103 | if(res.body.includes('Cloudflare')){
104 | this.log(`加白失败!Cloudflare,${url}`);
105 | }else{
106 | this.log(`加白成功!,${url}`);
107 | }
108 | } catch (error) {
109 | this.log(`http request error:${error} url:${url}`);
110 | }
111 | });
112 | await Promise.all(promises).catch((err)=>{
113 | this.log('http promise all error:'+err);
114 | });
115 | this.log(`IP白名单end $random_url=${random_url}`);
116 | return {};
117 | }else{
118 | await this.handelSign();
119 | return {};
120 | }
121 | }
122 |
123 | public async handelSign() {
124 | this.log('运行 》 筋斗云签到');
125 | const url = `${this.BASE_URL}/user/checkin`;
126 | const opts = {
127 | url: url,
128 | headers: {
129 | Cookie: this.getStore('login_cookie') ?? '',
130 | "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42",
131 | referer: url
132 | }
133 | };
134 | this.log('Http request:' + opts.url);
135 | let res = await this.post(opts);
136 | try {
137 | const data = JSON.parse(res.body);
138 | if(data&&data?.ret){
139 | this.msg(this.appName, data.msg, (JSON.stringify(data)));
140 | }
141 | else{
142 | this.log(res.body);
143 | }
144 | } catch (error) {
145 | throw new BaseErr('登录状态可能已经失效,' + error?.message);
146 | }
147 | }
148 |
149 |
150 | private exportData(html: string) {
151 | let [, remain_flow, unit] = /剩余流量<\/h4>\n\s+<\/div>\n\s+\n\s+
(.*)?<\/span> (MB|GB|KB)/.exec(html) ?? [];
152 | let [, online, sum] = /同时在线设备数<\/h4>\n\s+<\/div>\n\s+\n\s+
(\d+)<\/span> \/ (\d+)<\/span>/.exec(html) ?? [];
153 | let [, used_flow] = /今日已用: (.*?)<\/li>/.exec(html) ?? [];
154 | let [, last_used_date] = /上次使用时间: (.*?)<\/li>/.exec(html) ?? [];
155 | let [, momey] = /钱包余额<\/h4>\n\s+<\/div>\n\s+\n\s+¥\s+
(.*)?<\/span>/.exec(html) ?? [];
156 | let [, commission] = /累计获得返利金额: ¥(.*?)<\/li>/.exec(html) ?? [];
157 | let res = {
158 | remain_flow: remain_flow + unit,
159 | online: online,
160 | sum: sum,
161 | used_flow: used_flow,
162 | last_used_date: last_used_date,
163 | momey: momey,
164 | commission: commission
165 | };
166 | this.log('↓ exportData');
167 | this.log(JSON.stringify(res));
168 | return res;
169 | }
170 | }
171 |
172 | new App("筋斗云", 'gsonhub.cloud').run();
--------------------------------------------------------------------------------
/src/demo.ts:
--------------------------------------------------------------------------------
1 | import VpnBox, { BaseErr, Err } from "./lib/VpnBox";
2 | require('./tpl/demo.tpl.sgmodule');
3 | class App extends VpnBox {
4 | public doRequestAction($request: ScriptRequest): VpnResult | Promise {
5 | throw new Error("Method not implemented.");
6 | }
7 | public async doResponseAction($request: ScriptRequest, $response: ScriptResponse): Promise {
8 | throw new Error("Method not implemented.");
9 | }
10 | public doScriptAction(): VpnResult | Promise {
11 | throw new Error("Method not implemented.");
12 | }
13 | }
14 |
15 | new App("开发示s例", 'gsonhub.demo').run();
--------------------------------------------------------------------------------
/src/lib/JSEncrypt.d.ts:
--------------------------------------------------------------------------------
1 | export declare function RSAEncrypt(message:string): string;
2 | export declare function Encrypt(message:string,key:string): string;
3 |
4 |
--------------------------------------------------------------------------------
/src/lib/global.d.ts:
--------------------------------------------------------------------------------
1 | type ScriptResponse = {
2 | status: number|string,
3 | headers: Record,
4 | body: string,
5 | }
6 |
7 | type VpnResult = (Partial & { url?: string, response?: Partial }) | false;
8 |
9 | type ScriptRequest = {
10 | url: string,
11 | body: string,
12 | method: 'get' | 'GET' | 'post' | 'POST' | 'put' | 'PUT' | 'delete' | 'DELETE' | 'options' | 'OPTIONS' | 'patch' | 'PATCH',
13 | headers: Record
14 | }
15 |
16 |
17 | type HttpOption = Partial & { url: string ,timeout?:number};
18 |
19 | type HttpResponse = ScriptResponse & { statusCode: number};
20 |
21 | type HttpClient = {
22 | [key in Lowercase]: (options: HttpOption, callback: (error: string, response: Pick, body: string) => void) => void;
23 | };
24 |
25 | declare let $task: {fetch(opts:any):Promise};
26 |
27 | declare let $persistentStore: {
28 | write(key: string, val: string): boolean,
29 | read(key: string): string | null
30 | };
31 | declare let $prefs: {
32 | setValueForKey(key: string, val: string): boolean,
33 | valueForKey(key: string): string | null
34 | };
35 | declare let $httpClient: any;
36 | declare let $loon: unknown;
37 | declare let $rocket: unknown;
38 | declare let $notification: { post(title: string, subtitle: string, body: string): void };
39 | declare let $notify: (title: string, subtitle: string, body: string) => void;
40 | declare let $done: (obj: VpnResult) => void;
41 | declare let $request: ScriptRequest;
42 | declare let $argument: string;
43 | declare let $response: ScriptResponse;
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/src/pingan.ts:
--------------------------------------------------------------------------------
1 | import VpnBox, { BaseErr, Err } from "./lib/VpnBox";
2 | require('./tpl/pingan.tpl.sgmodule');
3 |
4 | const default_lock_list = [
5 | {
6 | "id": "46608c206462494495bbfed4893ea0e6",
7 | "name": "门禁地址8号",
8 | "code": "10447942",
9 | "bluetoothUUID": "E2C56DB5-DFFB-4848-D2B0-60D0F5A71096",
10 | "bluetoothName": "BYB764D6F0F",
11 | "bluetoothMajor": "30285",
12 | "bluetoothMinor": "28431",
13 | "attendanceCode": "",
14 | "sn": "DBA49E76",
15 | "address": "门禁地址8号",
16 | "crtUser": "null",
17 | "crtTime": "2018-12-20 16:16:14",
18 | "crtName": "null",
19 | "updUser": "null",
20 | "updTime": "2024-06-13 16:31:51",
21 | "status": 0,
22 | "productKey": "3B62A31470525ADF",
23 | "limitTime": "2399-09-19",
24 | "macNum": "7F:2B:76:4D:6F:0F",
25 | "companyId": "e5f08eee82d44ddbb8ea0d28a0585299",
26 | "companyName": "门禁系统",
27 | "houseNumberCode": "b236cc2b-f61d-462a-bc4f-dc68134fb344"
28 | },
29 | {
30 | "id": "3914b00107a64e9b87a150718d8dc14c",
31 | "name": "默认大门",
32 | "code": "36339320",
33 | "bluetoothUUID": "E2C56DB5-DFFB-4848-D2B0-60D0F5A71096",
34 | "bluetoothName": "BY58F3CB61C",
35 | "bluetoothMajor": "36668",
36 | "bluetoothMinor": "46620",
37 | "attendanceCode": "",
38 | "sn": "8472858A",
39 | "address": "门禁地址1号",
40 | "crtUser": "null",
41 | "crtTime": "2018-12-20 13:57:37",
42 | "crtName": "null",
43 | "updUser": "null",
44 | "updTime": "2024-03-10 13:06:49",
45 | "status": 0,
46 | "productKey": "7FBE27A26E9EE52F",
47 | "limitTime": "2399-09-23",
48 | "macNum": "80:85:8F:3C:B6:1C",
49 | "companyId": "e5f08eee82d44ddbb8ea0d28a0585299",
50 | "companyName": "门禁系统",
51 | "houseNumberCode": "5e8d5d9b-77c4-b15a-e053-0a29005eb15a"
52 | }
53 | ];
54 |
55 | class App extends VpnBox {
56 |
57 | private cache_key_lock_json = "cache_key_lock_json";
58 |
59 | public doRequestAction($request: ScriptRequest): VpnResult | Promise {
60 | if ($request.url.includes('pingan.log')) {
61 | return this.handelLogHttp();
62 | }
63 | else if ($request.url.includes('pingan.json')) {
64 | const lock_json = this.getStore(this.cache_key_lock_json) || '[]';
65 | return this.ajaxSuccessResult('', JSON.parse(lock_json));
66 | }
67 | else {
68 | return false;
69 | }
70 | }
71 |
72 | public doResponseAction($request: ScriptRequest, $response: ScriptResponse): VpnResult | Promise {
73 | if ($request.url.includes('baiyunuser/entranceguard/getList')) {
74 | try {
75 | let res = JSON.parse($response.body);
76 | let list = res.obj.map((vo: Record) => { vo.limitTime = '2099-09-17'; return vo });
77 | if ($argument == 'gsonhub') {
78 | default_lock_list.forEach((item) => {
79 | const find = list.find((v: Record) => v.id == item.id);
80 | if (!find) list.push(item);
81 | })
82 | }
83 | res.obj = list;
84 | let body = JSON.stringify(res);
85 | this.log(body);
86 | this.setStore(this.cache_key_lock_json, JSON.stringify(list));
87 | return { body };
88 | } catch (error) {
89 | this.log('解析json失败,修改响应体失败', { url: $request.url, body: $response.body })
90 | throw new BaseErr('修改响应数据失败', Err.BASE);
91 | }
92 | } else {
93 | return false;
94 | }
95 | }
96 |
97 | public doScriptAction(): VpnResult | Promise {
98 | return false;
99 | }
100 | }
101 | new App('平安白云', 'gsonhub.pingan').run();
102 |
103 |
--------------------------------------------------------------------------------
/src/sniff.ts:
--------------------------------------------------------------------------------
1 | import VpnBox, { BaseErr, Err } from "./lib/VpnBox";
2 | require('./tpl/sniff.tpl.sgmodule');
3 |
4 |
5 | class App extends VpnBox {
6 |
7 | public doRequestAction($request: ScriptRequest): VpnResult | Promise {
8 | const isStream = /\.(flv|m3u8)\?/.test($request.url);
9 | if (isStream) {
10 | let streamList_str = this.getStore('stream_list');
11 | let streamList: Array> = streamList_str ? JSON.parse(streamList_str) : [];
12 | streamList=streamList.slice(0,18);
13 | streamList.unshift({ link: $request.url, record_time: this.date('yyyy-MM-dd HH:mm:ss') });
14 | this.setStore('stream_list', JSON.stringify(streamList));
15 | return {};
16 | }
17 | if ($request.url.includes('sniff.json')) {
18 | let streamList_str = this.getStore('stream_list');
19 | let stream_list: Array = streamList_str ? JSON.parse(streamList_str) : [];
20 | return this.httpResponseResult({ stream_list });
21 | }
22 | else if ($request.url.includes('sniff.log')) {
23 | return this.handelLogHttp();
24 | }
25 | else {
26 | return false;
27 | }
28 | }
29 |
30 | public async doResponseAction($request: ScriptRequest, $response: ScriptResponse): Promise {
31 | throw new Error("Method not implemented.");
32 | }
33 | public doScriptAction(): VpnResult | Promise {
34 | throw new Error("Method not implemented.");
35 | }
36 | }
37 |
38 | new App("流媒体资源嗅探", 'gsonhub.sniff').run();
--------------------------------------------------------------------------------
/src/tencent.ts:
--------------------------------------------------------------------------------
1 | import VpnBox, { BaseErr, Err } from "./lib/VpnBox";
2 | require('./tpl/tencent.tpl.sgmodule');
3 | require('./tpl/tencent_link.tpl.conf');
4 | require('./tpl/tencent.tpl.conf');
5 |
6 | class App extends VpnBox {
7 |
8 | public static readonly VERSION = '1.0.2'
9 |
10 | public static readonly TOKEN_URL = 'http://kc.iikira.com/kingcard';
11 |
12 | public async doRequestAction($request: ScriptRequest): Promise {
13 | if ($request.url.includes('tencent.log')) {
14 | return this.handelLogHttp();
15 | } else if ($request.url.includes('tencent.json')) {
16 | let message = '';
17 | try {
18 | const res = await this.fetchGuidTokenToConnect();
19 | if (res) {
20 | message = '连接成功!'
21 | } else {
22 | message = '连接失败!';
23 | }
24 | } catch (err) {
25 | let msg = '';
26 | if (err instanceof BaseErr) {
27 | msg = err.message;
28 | }
29 | message = '连接失败!出现异常,' + msg;
30 | }
31 | this.log(message)
32 | let html = this.renderHtml(message)
33 | return this.httpResponseResult(html, { 'Content-Type': 'text/html;charset=utf-8' });
34 | }
35 | return false;
36 | }
37 |
38 |
39 |
40 | private renderHtml(htm: string) {
41 | const version = App.VERSION
42 | const html = `
43 |
44 | 大王卡动态免流
45 |
46 |
47 |
48 |
49 |
53 |
54 | 腾讯大王卡动态免流
55 | ${htm}
56 |
57 |
@author gsonhub
58 |
@version ${version}
59 |
power by shadowrocket script
60 |
查看程序运行日志
61 |
62 |
63 |
64 | `
65 | return html;
66 | }
67 |
68 | public async doResponseAction($request: ScriptRequest, $response: ScriptResponse): Promise
{
69 | return false;
70 | }
71 |
72 |
73 | public async doScriptAction(): Promise {
74 | let isConnect = true;
75 | if ($argument == 'network-changed') {
76 | this.log('network-changed:当网络改变时等待2s 保证VPN已经自动连接');
77 | await this.sleep(2000);
78 | isConnect = true;
79 | }
80 | else if ($argument == 'network-check') {
81 | this.log('network-check:检查网络状态');
82 | const status = await this.checkConnectStatus();
83 | if (status) {
84 | isConnect = false;
85 | }
86 | this.log(status ? '已连接' : '连接异常,尝试重新连接');
87 | }
88 | else if ($argument == 'network-token') {
89 | this.log('network-token:更新TOKEN');
90 | isConnect = true;
91 | }
92 |
93 | if (isConnect) {
94 | await this.fetchGuidTokenToConnect();
95 | } else {
96 | this.log('本次不更新token');
97 | }
98 | return {};
99 | }
100 |
101 | private async checkConnectStatus(isThrow:boolean=false): Promise {
102 | let connected=false,err_msg='';
103 | try{
104 | const response = await this.get({ url: `http://www.gstatic.com/generate_204` });
105 | if(response.status == 204){
106 | connected= true;
107 | }else{
108 | err_msg=JSON.stringify(response);
109 | }
110 | }catch(err){
111 | err_msg=err;
112 | }
113 | if(connected){
114 | return true;
115 | }else{
116 | if(isThrow) throw new BaseErr('测试连接状态,连接失败,'+err_msg,Err.HTTP);
117 | return false;
118 | }
119 | }
120 |
121 | private async fetchGuidTokenToConnect(): Promise {
122 | this.log('开始更新token');
123 | const res = await this.get({ url: App.TOKEN_URL });
124 | const [guid, token] = res.body.split(',');
125 | if (!/\w+/.test(guid) || !/\w+/.test(token)) {
126 | throw new BaseErr('读取token失败!', Err.HTTP);
127 | }
128 | this.log('连接代理服务器。。。', { guid, token })
129 | this.get({ url: `http://${guid}.${token}.iikira.com.token` }).then().catch();
130 | //稍微等等再测试
131 | await this.sleep(100);
132 | this.log('连接代理完成 待测试。。。', { guid, token })
133 | const status = await this.checkConnectStatus(true);
134 | return status;
135 | }
136 | }
137 |
138 | new App("腾讯大王卡动态", 'gsonhub.tencent').run();
--------------------------------------------------------------------------------
/src/tpl/10086.tpl.sgmodule:
--------------------------------------------------------------------------------
1 | #!name= 青海移动@${env}
2 | #!desc= 青海移动@author=gsonhub @version=${version}
3 |
4 | [General]
5 | force-http-engine-hosts = %APPEND% 10086.log 10086.json
6 |
7 | [Script]
8 |
9 | # 查询青海移动流量接口服务 http://10086.json 查询电信日志 http://10086.log
10 | 10086-http-service = type=http-request,pattern=^https?:\/\/10086\.(json|log),script-path=${baseUrl}/10086.js?v=${version},requires-body=true,max-size=0,timeout=10
11 |
12 | # 轮询 查询青海移动
13 | 10086-for-cron = type=cron,cronexp=*/5 * * * *,timeout=10,script-path=${baseUrl}/10086.js?v=${version}
14 |
15 |
--------------------------------------------------------------------------------
/src/tpl/baiduwp.tpl.sgmodule:
--------------------------------------------------------------------------------
1 | #!name= 百度网盘直链@${env}
2 | #!desc= 百度网盘直链@author=gsonhub @version=${version}
3 |
4 | [MITM]
5 | hostname = %APPEND% *.baidupcs.com,passport.baidu.com
6 |
7 |
8 | [General]
9 | force-http-engine-hosts = %APPEND% baiduwp.log
10 |
11 | [Script]
12 |
13 | # 日志
14 | baiduwp-http-service = type=http-request,pattern=^https?:\/\/baiduwp\.log,script-path=${baseUrl}/baiduwp.js?v=${version},requires-body=true,max-size=0,timeout=10
15 |
16 | # 百度网盘直链
17 | baiduwp-request-service = type=http-request,pattern=^https?:\/\/([0-9a-zA-Z-_]+)\.baidupcs\.com\/file,script-path=${baseUrl}/baiduwp.js?v=${version},max-size=0,timeout=10
18 |
19 | # 百度网盘模拟登录
20 | baiduwp-qrcode-login = type=http-response,pattern=^https?:\/\/passport\.baidu\.com\/v2\/api\/qrcode,script-path=${baseUrl}/baiduwp.js?v=${version},max-size=1310720,requires-body=true,binary-mode=true,binary-body-mode=true,timeout=100
21 |
--------------------------------------------------------------------------------
/src/tpl/bing.tpl.sgmodule:
--------------------------------------------------------------------------------
1 | #!name= 必应@${env}
2 | #!desc= 必应@author=gsonhub @version=${version}
3 |
4 | [General]
5 | force-http-engine-hosts = %APPEND% bing.log
6 |
7 | [Script]
8 |
9 | # 必应
10 | bing-request-service = type=http-request,pattern=^https?:\/\/www\.bing\.com,script-path=${baseUrl}/bing.js?v=${version},max-size=0,timeout=10
11 |
12 | # 必应日志 http://bing.log
13 | bing-http-service = type=http-request,pattern=^https?:\/\/bing\.log,script-path=${baseUrl}/bing.js?v=${version},requires-body=true,max-size=0,timeout=10
14 |
15 |
--------------------------------------------------------------------------------
/src/tpl/boxjs.tpl.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "gsonhub.application.${env}",
3 | "name": "@gsonhub的应用订阅v=${env}.${version}",
4 | "author": "@gsonhub",
5 | "apps": [
6 | {
7 | "id": "gson.${env}.10010",
8 | "name": "中国联通",
9 | "descs_html": [
10 | "查看日志",
11 | "刷新",
12 | "发送验证码",
13 | "验证码登录"
14 | ],
15 | "scripts": [
16 | {
17 | "name": "中国联通流量查询",
18 | "script": "${baseUrl}/unicom.js?v=${version}"
19 | }
20 | ],
21 | "keys": [
22 | "gsonhub.10010.mobile",
23 | "gsonhub.10010.appId",
24 | "gsonhub.10010.password",
25 | "gsonhub.10010.cookie",
26 | "gsonhub.10010.smscode",
27 | "gsonhub.10010.login_num",
28 | "gsonhub.10010.mute"
29 | ],
30 |
31 | "author": "@gsonhub",
32 | "settings": [
33 | {
34 | "id": "gsonhub.10010.mobile",
35 | "name": "手机号",
36 | "val": "",
37 | "type": "text",
38 | "desc": "手机号"
39 | },
40 | {
41 | "id": "gsonhub.10010.smscode",
42 | "name": "验证码",
43 | "val": "",
44 | "type": "text",
45 | "desc": "验证码"
46 | },
47 | {
48 | "id": "gsonhub.10010.password",
49 | "name": "密码",
50 | "val": "",
51 | "type": "text",
52 | "desc": "密码"
53 | },
54 | {
55 | "id": "gsonhub.10010.mute",
56 | "name": "禁音模式",
57 | "val": false,
58 | "type": "boolean"
59 | }
60 | ]
61 | },
62 | {
63 | "id": "gson.${env}.10000",
64 | "name": "中国电信",
65 | "descs_html": [
66 | "查看日志",
67 | "刷新"
68 | ],
69 | "scripts": [
70 | {
71 | "name": "中国电信流量查询",
72 | "script": "${baseUrl}/telecom.js?v=${version}"
73 | }
74 | ],
75 | "keys": [
76 | "gsonhub.10000.mobile",
77 | "gsonhub.10000.password",
78 | "gsonhub.10000.token",
79 | "gsonhub.10000.mute",
80 | "gsonhub.10000.vvv_flow",
81 | "gsonhub.10000.login_num",
82 | "gsonhub.10000.login_info"
83 | ],
84 |
85 | "author": "@gsonhub",
86 | "settings": [
87 | {
88 | "id": "gsonhub.10000.mobile",
89 | "name": "手机号",
90 | "val": "",
91 | "type": "text",
92 | "desc": "手机号"
93 | },
94 | {
95 | "id": "gsonhub.10000.password",
96 | "name": "密码",
97 | "val": "",
98 | "type": "text",
99 | "desc": "密码"
100 | },
101 | {
102 | "id": "gsonhub.10000.mute",
103 | "name": "禁音模式",
104 | "val": false,
105 | "type": "boolean"
106 | }
107 | ]
108 | },
109 | {
110 | "id": "gson.${env}.cloud",
111 | "name": "筋斗云",
112 | "descs_html": [
113 | "刷新",
114 | "查看筋斗云日志",
115 | "查看平安白云日志",
116 | "查看中国电信日志"
117 | ],
118 | "scripts": [
119 | {
120 | "name": "筋斗云签到",
121 | "script": "${baseUrl}/cloud.js?v=${version}"
122 | }
123 | ],
124 | "keys": [
125 | "gsonhub.cloud.ip_list",
126 | "gsonhub.cloud.domain_url",
127 | "gsonhub.cloud.login_cookie",
128 | "gsonhub.cloud.mute"
129 | ],
130 | "author": "@gsonhub",
131 | "settings": [
132 | {
133 | "id": "gsonhub.cloud.mute",
134 | "name": "禁音模式",
135 | "val": false,
136 | "type": "boolean"
137 | }
138 | ]
139 | },
140 | {
141 | "id": "gson.${env}.baiduwp",
142 | "name": "百度网盘直连",
143 | "descs_html": [
144 | "查看日志",
145 | "刷新"
146 | ],
147 | "scripts": [
148 | {
149 | "name": "百度网盘直链",
150 | "script": "${baseUrl}/baiduwp.js?v=${version}"
151 | }
152 | ],
153 | "keys": [
154 | "gsonhub.baiduwp.user_agent",
155 | "gsonhub.baiduwp.mute",
156 | "gsonhub.baiduwp.aria_ip",
157 | "gsonhub.baiduwp.is_aria2"
158 | ],
159 |
160 | "author": "@gsonhub",
161 | "settings": [
162 | {
163 | "id": "gsonhub.baiduwp.user_agent",
164 | "name": "User-Agent",
165 | "val": "",
166 | "type": "text",
167 | "desc": "User-Agent"
168 | },
169 | {
170 | "id": "gsonhub.baiduwp.is_aria2",
171 | "name": "aria2下载",
172 | "val": false,
173 | "type": "boolean"
174 | },
175 | {
176 | "id": "gsonhub.baiduwp.aria2_ip",
177 | "name": "aria2-RPC地址",
178 | "val": "",
179 | "type": "text",
180 | "desc": "aria2-RPC地址"
181 | },
182 | {
183 | "id": "gsonhub.baiduwp.mute",
184 | "name": "禁音模式",
185 | "val": false,
186 | "type": "boolean"
187 | }
188 | ]
189 | }
190 | ]
191 | }
--------------------------------------------------------------------------------
/src/tpl/cloud.tpl.sgmodule:
--------------------------------------------------------------------------------
1 | #!name= 筋斗云@${env}
2 | #!desc= 筋斗云@author=gsonhub @version=${version}
3 |
4 | [MITM]
5 | hostname = %APPEND% www.somersaultcloud.top,www.somersaultcloud.xyz
6 |
7 | [General]
8 | force-http-engine-hosts = %APPEND% cloud.log cloud.json
9 |
10 | [Script]
11 |
12 | # 筋斗云获取cookie
13 | somersaultcloud = type=http-request,pattern=^https?:\/\/(www\.|)somersaultcloud\.(xyz|top)\/user\/profile,script-path=${baseUrl}/cloud.js?v=${version},timeout=10
14 |
15 | # 筋斗云定时签到
16 | somersaultcloud-cron = type=cron,cronexp=0 */1 * * *,timeout=30,script-path=${baseUrl}/cloud.js?v=${version},timeout=30
17 |
18 | # 查询筋斗云个人信息接口服务 http://cloud.json 查询筋斗云运行日志 http://cloud.log
19 | somersaultcloud-service = type=http-request,pattern=^https?:\/\/cloud\.(json|log),script-path=${baseUrl}/cloud.js?v=${version},requires-body=true,max-size=0,timeout=10
20 |
21 | # 轮询
22 | somersaultcloud-for-cron = type=cron,cronexp=*/5 * * * *,timeout=30,script-path=${baseUrl}/cloud.js?v=${version},argument=auto_sign_ip
23 |
24 | # network-changed
25 | somersaultcloud-network-changed = script-path=${baseUrl}/cloud.js?v=${version},argument=auto_sign_ip,type=event,event-name=network-changed
--------------------------------------------------------------------------------
/src/tpl/demo.tpl.sgmodule:
--------------------------------------------------------------------------------
1 | #!name= 开发示例@${env}
2 | #!desc= 开发示例@author=gsonhub @version=${version}
3 |
4 | [General]
5 | force-http-engine-hosts = %APPEND% demo.log
6 |
7 | [Script]
8 |
9 | # 开发示例de日志 http://demo.log
10 | bing-http-service = type=http-request,pattern=^https?:\/\/demo\.log,script-path=${baseUrl}/demo.js?v=${version},requires-body=true,max-size=0,timeout=10
11 |
12 |
--------------------------------------------------------------------------------
/src/tpl/pingan.tpl.sgmodule:
--------------------------------------------------------------------------------
1 | #!name= 平安白云@${env}
2 | #!desc= 平安白云@author=gsonhub @version=${version}
3 |
4 | [MITM]
5 | hostname = %APPEND% www.pinganbaiyun.cn,pingan.json.cpolar.cn,pingan.json
6 |
7 | [General]
8 | force-http-engine-hosts = %APPEND% pingan.log pingan.json.cpolar.cn pingan.json
9 |
10 | [Script]
11 |
12 | # 平安白云
13 | pingan-service = type=http-response,pattern=^https?:\/\/(www\.|)pinganbaiyun\.(cn|com)\/baiyunuser\/entranceguard\/getList$,script-path=${baseUrl}/pingan.js?v=${version},requires-body=true,max-size=0,argument=gsonhub
14 |
15 | # 查询平安白云日志 http://pingan.log http://pingan.json
16 | pingan-http-service = type=http-request,pattern=^https?:\/\/pingan\.(json|log|),script-path=${baseUrl}/pingan.js?v=${version},requires-body=true,max-size=0,timeout=10
17 |
18 |
--------------------------------------------------------------------------------
/src/tpl/sniff.tpl.sgmodule:
--------------------------------------------------------------------------------
1 | #!name= 流媒体资源嗅探@${env}
2 | #!desc= 流媒体资源嗅探@author=gsonhub @version=${version}
3 |
4 | [General]
5 | force-http-engine-hosts = %APPEND% sniff.log sniff.json
6 |
7 | [Script]
8 |
9 | # http://sniff.log http://sniff.json
10 | sniff-http-service = type=http-request,pattern=^https?:\/\/sniff\.(log|json),script-path=${baseUrl}/sniff.js?v=${version},requires-body=true,max-size=0,timeout=10
11 |
12 | #
13 | sniff-request-service = type=http-request,pattern=\.(flv|m3u8)\?,script-path=${baseUrl}/sniff.js?v=${version},max-size=0,timeout=10
14 |
--------------------------------------------------------------------------------
/src/tpl/telecom.tpl.sgmodule:
--------------------------------------------------------------------------------
1 | #!name= 中国电信@${env}
2 | #!desc= 中国电信@author=gsonhub @version=${version}
3 |
4 | [General]
5 | force-http-engine-hosts = %APPEND% 10000.log 10000.json
6 |
7 | [Script]
8 |
9 | # 查询中国电信流量接口服务 http://10000.json 查询电信日志 http://10000.log
10 | telecom-http-service = type=http-request,pattern=^https?:\/\/10000\.(json|log),script-path=${baseUrl}/telecom.js?v=${version},requires-body=true,max-size=0,timeout=10
11 |
12 | # 轮询 查询电信流量
13 | telecom-for-cron = type=cron,cronexp=*/5 * * * *,timeout=10,script-path=${baseUrl}/telecom.js?v=${version}
14 |
15 |
--------------------------------------------------------------------------------
/src/tpl/tencent.tpl.conf:
--------------------------------------------------------------------------------
1 | [General]
2 | #!name= 腾讯大王卡动态免流@${env}
3 | #!desc= 腾讯大王卡动态免流@author=gsonhub @version=${version}
4 |
5 | bypass-system = true
6 | skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, localhost, *.local, captive.apple.com
7 | tun-excluded-routes = 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.2.0/24, 192.88.99.0/24, 192.168.0.0/16, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 224.0.0.0/4
8 | dns-server = 1.1.1.1,114.114.114.114,8.8.8.8,119.29.29.29
9 | ipv6 = false
10 |
11 | force-http-engine-hosts = %APPEND% tencent.log tencent.json
12 |
13 | update-url = ${baseUrl}/tencent.conf
14 |
15 | [Proxy Group]
16 |
17 | [Rule]
18 | DOMAIN-SUFFIX,netlify.app,DIRECT
19 | # 登录大王卡
20 | DOMAIN-SUFFIX,iikira.com.token,腾讯大王卡
21 | DOMAIN,kc.iikira.com,DIRECT
22 |
23 | # 腾讯系直连
24 | USER-AGENT,WeChatShareExtension*,DIRECT
25 | DOMAIN-SUFFIX,tencent.com,DIRECT
26 | DOMAIN-SUFFIX,qlogo.cn,DIRECT
27 | DOMAIN-SUFFIX,gtimg.cn,DIRECT
28 | DOMAIN-SUFFIX,qq.com,DIRECT
29 | RULE-SET,${baseUrl}/tencent/Tencent.list,DIRECT
30 | RULE-SET,${baseUrl}/tencent/TencentVideo.list,DIRECT
31 | RULE-SET,${baseUrl}/tencent/WeChat.list,DIRECT
32 | RULE-SET,${baseUrl}/tencent/custom.list,DIRECT
33 |
34 | GEOIP,CN,腾讯大王卡
35 | FINAL,腾讯大王卡
36 |
37 | [Script]
38 | # 接口服务 http://tencent.json http://tencent.log
39 | tencent-http-service = type=http-request,pattern=^https?:\/\/tencent\.(json|log),script-path=${baseUrl}/tencent.js?v=${version},requires-body=true,max-size=0,timeout=10
40 | # 轮询1检查网络
41 | tencent-for-cron1 = type=cron,cronexp=*/1 * * * *,timeout=30,script-path=${baseUrl}/tencent.js?v=${version},argument=network-check
42 | # 轮询5更新TOKEN
43 | tencent-for-cron5 = type=cron,cronexp=*/5 * * * *,timeout=30,script-path=${baseUrl}/tencent.js?v=${version},argument=network-token
44 | #network-changed
45 | tencent-network-changed = script-path=${baseUrl}/tencent.js?v=${version},argument=network-changed,type=event,event-name=network-changed
46 |
--------------------------------------------------------------------------------
/src/tpl/tencent.tpl.sgmodule:
--------------------------------------------------------------------------------
1 | #!name= 腾讯大王卡动态免流@${env}
2 | #!desc= 腾讯大王卡动态免流@author=gsonhub @version=${version}
3 |
4 | [General]
5 | force-http-engine-hosts = %APPEND% tencent.log tencent.json
6 |
7 | [Script]
8 |
9 | # 接口服务 http://tencent.json http://tencent.log
10 | tencent-http-service = type=http-request,pattern=^https?:\/\/tencent\.(json|log),script-path=${baseUrl}/tencent.js?v=${version},requires-body=true,max-size=0,timeout=10
11 |
12 | # 轮询1检查网络
13 | tencent-for-cron1 = type=cron,cronexp=*/1 * * * *,timeout=30,script-path=${baseUrl}/tencent.js?v=${version},argument=network-check
14 |
15 | # 轮询5更新TOKEN
16 | tencent-for-cron5 = type=cron,cronexp=*/10 * * * *,timeout=30,script-path=${baseUrl}/tencent.js?v=${version},argument=network-token
17 |
18 | #network-changed
19 | tencent-network-changed = script-path=${baseUrl}/tencent.js?v=${version},argument=network-changed,type=event,event-name=network-changed
--------------------------------------------------------------------------------
/src/tpl/tencent_link.tpl.conf:
--------------------------------------------------------------------------------
1 | [General]
2 | #!name= 腾讯大王卡动态免流@${env}
3 | #!desc= 腾讯大王卡动态免流@author=gsonhub @version=${version}
4 |
5 | bypass-system = true
6 | skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, localhost, *.local, captive.apple.com, kc.iikira.com
7 | tun-excluded-routes = 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.2.0/24, 192.88.99.0/24, 192.168.0.0/16, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 224.0.0.0/4
8 | dns-server = 1.1.1.1,114.114.114.114,8.8.8.8,119.29.29.29
9 | ipv6 = false
10 |
11 |
12 | force-http-engine-hosts = %APPEND% tencent.log tencent.json
13 |
14 | update-url = ${baseUrl}/tencent.conf
15 |
16 | [Proxy Group]
17 | 国内王卡跳板 = select,腾讯大王卡,interval=86400,timeout=5,select=0,url=http://www.gstatic.com/generate_204
18 | 最终王卡跳板 = select,腾讯大王卡,interval=86400,timeout=5,select=0,url=http://www.gstatic.com/generate_204
19 |
20 | [Rule]
21 | # 登录大王卡
22 | DOMAIN-SUFFIX,iikira.com.token,腾讯大王卡
23 | DOMAIN,kc.iikira.com,DIRECT
24 |
25 | # 腾讯系直连
26 | USER-AGENT,WeChatShareExtension*,DIRECT
27 | DOMAIN-SUFFIX,tencent.com,DIRECT
28 | DOMAIN-SUFFIX,qlogo.cn,DIRECT
29 | DOMAIN-SUFFIX,gtimg.cn,DIRECT
30 | DOMAIN-SUFFIX,qq.com,DIRECT
31 | RULE-SET,${baseUrl}/tencent/Tencent.list,DIRECT
32 | RULE-SET,${baseUrl}/tencent/TencentVideo.list,DIRECT
33 | RULE-SET,${baseUrl}/tencent/WeChat.list,DIRECT
34 | RULE-SET,${baseUrl}/tencent/custom.list,DIRECT
35 | #DOMAIN-SUFFIX,charming-gnome-9c9592.netlify.app,DIRECT
36 | #DOMAIN-SUFFIX,cdn.jsdelivr.net,腾讯大王卡
37 | DOMAIN-SET,https://fastly.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Surge/ChinaMax/ChinaMax_Domain.list,腾讯大王卡
38 | GEOIP,CN,国内王卡跳板
39 | FINAL,最终王卡跳板
40 |
41 | [Script]
42 | # 接口服务 http://tencent.json http://tencent.log
43 | tencent-http-service = type=http-request,pattern=^https?:\/\/tencent\.(json|log),script-path=${baseUrl}/tencent.js?v=${version},requires-body=true,max-size=0,timeout=10
44 | # 轮询1检查网络
45 | tencent-for-cron1 = type=cron,cronexp=*/1 * * * *,timeout=30,script-path=${baseUrl}/tencent.js?v=${version},argument=network-check
46 | # 轮询5更新TOKEN
47 | tencent-for-cron5 = type=cron,cronexp=*/5 * * * *,timeout=30,script-path=${baseUrl}/tencent.js?v=${version},argument=network-token
48 | #network-changed
49 | tencent-network-changed = script-path=${baseUrl}/tencent.js?v=${version},argument=network-changed,type=event,event-name=network-changed
50 |
--------------------------------------------------------------------------------
/src/tpl/unicom.tpl.sgmodule:
--------------------------------------------------------------------------------
1 | #!name= 中国联通@${env}
2 | #!desc= 中国联通@author=gsonhub @version=${version}
3 |
4 | [General]
5 | force-http-engine-hosts = %APPEND% 10010.log 10010.json
6 |
7 | [Script]
8 |
9 | # 轮询 查询中国联通流量
10 | unicom-for-cron = type=cron,cronexp=*/5 * * * *,timeout=10,script-path=${baseUrl}/unicom.js?v=${version}
11 |
12 | # 查询中国联通流量接口服务 http://10010.json 查询联通日志 http://10010.log
13 | unicom-http-service = type=http-request,pattern=^https?:\/\/10010\.(json|log),script-path=${baseUrl}/unicom.js?v=${version},requires-body=true,max-size=0,timeout=10
14 |
--------------------------------------------------------------------------------
/src/tpl/wps.tpl.sgmodule:
--------------------------------------------------------------------------------
1 | #!name= WPS@${env}
2 | #!desc= WPS@author=gsonhub @version=${version}
3 |
4 | [MITM]
5 | hostname = %APPEND% vaf.wps.cn
6 |
7 | [General]
8 | force-http-engine-hosts = %APPEND% wps.log
9 |
10 | [Script]
11 |
12 | # WPS
13 | wps-service = type=http-response,pattern=^https?:\/\/vaf\.wps\.cn\/proxy\/msg-sender\/api\/v1\/masshelper\/c\/detail,script-path=${baseUrl}/wps.js?v=${version},requires-body=true,max-size=0
14 |
15 | # 查询WPS日志 http://wps.log
16 | wps-http-service = type=http-request,pattern=^https?:\/\/wps\.log,script-path=${baseUrl}/wps.js?v=${version},requires-body=true,max-size=0,timeout=10
17 |
18 |
--------------------------------------------------------------------------------
/src/unicom.ts:
--------------------------------------------------------------------------------
1 | import VpnBox, { BaseErr } from "./lib/VpnBox";
2 | import { RSAEncrypt } from "./lib/JSEncrypt";
3 | require('./tpl/unicom.tpl.sgmodule');
4 |
5 | class App extends VpnBox {
6 | appId: string;
7 | mobile: string;
8 | password: string;
9 | cookie: string;
10 | smscode: string;
11 |
12 | constructor(name: string, namespace: string) {
13 | super(name, namespace);
14 | this.init();
15 | }
16 |
17 | init() {
18 | this.appId = this.getStore(`appId`) ?? '';
19 | this.mobile = this.getStore(`mobile`) ?? '';
20 | this.password = this.getStore(`password`) ?? '';
21 | this.cookie = this.getStore(`cookie`) ?? '';
22 | this.smscode = this.getStore(`smscode`) ?? '';
23 | const obj = {
24 | appId: this.appId,
25 | mobile: this.mobile,
26 | password: this.password,
27 | cookie: this.cookie,
28 | smscode: this.smscode
29 | };
30 | console.log(JSON.stringify(obj));
31 |
32 | }
33 |
34 | async query() {
35 | this.log('--- 开始尝试查询流量');
36 | var cookie = this.cookie;
37 | let vo = await this.post({
38 | url: 'https://m.client.10010.com/servicequerybusiness/operationservice/queryOcsPackageFlowLeftContentRevisedInJune',
39 | headers: { cookie },
40 | })
41 | let body = vo.body;
42 |
43 | let res;
44 | try {
45 | res = JSON.parse(body);
46 | } catch (e) {
47 | throw new BaseErr("查询流量失败!JSON数据解析异常");
48 | }
49 |
50 | console.log('↓ res body')
51 | console.log(JSON.stringify(res))
52 |
53 |
54 | if (vo.status == 200 && res.code === '0000') {
55 | this.log('🍪查询流量成功!');
56 | return res;
57 | } else {
58 | const desc = res.desc;
59 | let errMsg = '查询流量失败!未知错误';
60 | if (String(body) === '999999' || String(body) === '999998') {
61 | return false;
62 | } else if (res.code === '4114030182') {
63 | errMsg = '"查询流量失败!系统升级';
64 | } else if (desc) {
65 | errMsg = "查询流量失败!" + desc;
66 | }
67 | throw new BaseErr(errMsg);
68 | }
69 | }
70 |
71 | async dologin() {
72 | this.log('--- 开始尝试密码方式登录');
73 |
74 | if (this.getSignCount() > 4) {
75 | throw new BaseErr('⚠️ 当日登录已超过四次!请明天再试')
76 | }
77 |
78 | let appId = this.appId;
79 | let vo = await this.post({
80 | url: 'https://m.client.10010.com/mobileService/login.htm',
81 | body: this.transParams({
82 | mobile: RSAEncrypt(this.mobile),
83 | password: RSAEncrypt(this.password),
84 | appId,
85 | version: 'iphone_c@9.0100',
86 | }),
87 | headers: {
88 | 'Content-Type': 'application/x-www-form-urlencoded',
89 | },
90 | })
91 |
92 | this.incSignCount();
93 |
94 | let body = vo.body;
95 |
96 | console.log('↓ res body')
97 | console.log(body);
98 |
99 | let res;
100 | try {
101 | res = JSON.parse(body)
102 | } catch (e) {
103 | throw new BaseErr("密码方式登录失败!JSON数据解析异常");
104 | }
105 |
106 |
107 |
108 | let code = res.code;
109 | if (code === '0') {
110 | const headers = vo.headers;
111 | let cookie = headers['set-cookie'] || headers['Set-Cookie'];
112 | if (Array.isArray(cookie)) {
113 | cookie = cookie.join('; ')
114 | }
115 | this.log(` 密码方式登录 Cookie`)
116 | if (!cookie) {
117 | throw new BaseErr(`获取到的密码方式登录 Cookie 为空!`)
118 | }
119 | this.cookie = cookie;
120 | this.log(cookie)
121 | this.setStore('cookie', cookie, true);
122 | this.log('🍪 密码方式登录成功!');
123 | return true;
124 | } else {
125 | let desc = res.dsc;
126 | throw new BaseErr('密码方式登录失败!' + (desc || '未知错误'))
127 | }
128 | }
129 |
130 | public async doRequestAction($request: ScriptRequest): Promise {
131 | let [, action] = /action=(\w+)/.exec($request.url) ?? [];
132 | switch (action) {
133 | case 'send_code':
134 | return await this.handleSendCodeAction();
135 | case 'login':
136 | return await this.handleLoginAction();
137 | case 'query':
138 | return await this.handleQueryAction();
139 | default:
140 | if ($request.url.includes("10010.log")) {
141 | return this.handelLogHttp();
142 | } else if ($request.url.includes("10010.json")) {
143 | return await this.handleQueryAction();
144 | } else {
145 | return false;
146 | }
147 | }
148 | }
149 | public doResponseAction($request: ScriptRequest, $response: ScriptResponse): VpnResult | Promise {
150 | return false;
151 | }
152 | public async doScriptAction(): Promise {
153 | this.log('以脚本方式运行');
154 | return await this.handleQueryAction();
155 | }
156 |
157 | async handleLoginAction() {
158 | this.log('运行 》 中国联通验证码登录');
159 |
160 | if (!this.mobile || !this.smscode) {
161 | throw new BaseErr('⚠️ 请配置 手机号(mobile), 验证码(smscode)')
162 | }
163 |
164 | this.log('〽️ 开始尝试验证码方式登录');
165 | let appId = this.appId;
166 | let vo = await this.post({
167 | url: 'https://m.client.10010.com/mobileService/radomLogin.htm',
168 | body: this.transParams({
169 | mobile: RSAEncrypt(this.mobile),
170 | password: RSAEncrypt(this.smscode),
171 | appId: this.randomString(160),
172 | version: 'iphone_c@9.0100',
173 | }),
174 | headers: {
175 | 'Content-Type': 'application/x-www-form-urlencoded',
176 | },
177 | })
178 |
179 | let body = vo.body;
180 | this.log('↓ res body')
181 | this.log(body);
182 |
183 | let res;
184 | try {
185 | res = JSON.parse(body)
186 | } catch (e) {
187 | throw new BaseErr("验证码方式登录失败,JSON数据解析异常Z");
188 | }
189 |
190 | let code = res.code;
191 | if (code === '0') {
192 | const headers = vo.headers;
193 | let cookie = headers['set-cookie'] || headers['Set-Cookie'];
194 | if (Array.isArray(cookie)) {
195 | cookie = cookie.join('; ')
196 | }
197 | this.log(` 验证码方式登录 Cookie`)
198 | if (!cookie) {
199 | throw new BaseErr(`获取到的验证码方式登录 Cookie 为空!`)
200 | }
201 | this.cookie = cookie;
202 | this.log('cookie:\n' + cookie)
203 | this.setStore('cookie', cookie, true);
204 | this.setStore('appId', res.appId, true);
205 | this.log('appId:\n' + appId)
206 | this.msg(this.appName, '🍪 验证码方式登录成功!', '');
207 | return this.ajaxSuccessResult('验证码方式登录成功!');
208 | } else {
209 | let desc = res.dsc;
210 | throw new BaseErr('验证码方式登录失败!' + (desc || '未知错误'))
211 | }
212 | }
213 |
214 |
215 | async handleSendCodeAction() {
216 | this.log('运行 》 中国联通发送验证码');
217 |
218 | if (!this.mobile) {
219 | throw new BaseErr('⚠️ 请配置 手机号(mobile))');
220 | }
221 |
222 | this.log('〽️ 开始尝试发送验证码');
223 | let vo = await this.post({
224 | url: 'https://m.client.10010.com/mobileService/sendRadomNum.htm',
225 | body: this.transParams({
226 | mobile: RSAEncrypt(this.mobile),
227 | version: 'iphone_c@9.0100',
228 | }),
229 | headers: {
230 | 'Content-Type': 'application/x-www-form-urlencoded',
231 | },
232 | })
233 |
234 | let body = vo.body;
235 | let res;
236 | try {
237 | res = JSON.parse(body)
238 | } catch (e) {
239 | throw new BaseErr("发送验证码失败!JSON数据解析异常," + body);
240 | }
241 |
242 | if (res.rsp_code == '0000') {
243 | this.msg(this.appName, '发送验证码成功', '');
244 | return this.ajaxSuccessResult('发送验证码成功');
245 | } else {
246 | throw new BaseErr("发送验证码失败!" + body);
247 | }
248 | }
249 |
250 | async handleQueryAction() {
251 | this.log('运行 》 中国联通查询流量');
252 |
253 | if (!this.cookie && (!this.appId || !this.mobile || !this.password)) {
254 | throw new BaseErr('⚠️ 请配置 Cookie 或 appId, 手机号(mobile), 密码(password)')
255 | }
256 | let res = await this.query();
257 | if (res) {
258 | } else {
259 | await this.dologin();
260 | res = await this.query();
261 | }
262 | return this.handleQuery(res);
263 | }
264 |
265 |
266 | getFeeFlowLimt(feeflow: number) {
267 | var dd = new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).getDate() - new Date().getDate() + 1;
268 | return parseInt((feeflow / dd).toFixed(0));
269 | }
270 |
271 | handleQuery(res: any) {
272 | if (res) {
273 | let old_obj: any = null;
274 | try {
275 | old_obj = JSON.parse(this.getStore(`vvv_flow`) ?? '');
276 | } catch (error) {
277 | //throw new BaseErr('解析JSON异常');
278 | }
279 | const query_date = this.date('yyyy-MM-dd', res.time.replace(/-/g, '/'));
280 |
281 | const fee_used_flow = parseFloat((res.summary.sum - res.summary.freeFlow).toFixed(2));
282 | const fee_remain_flow = parseFloat(res.resources[0].remainResource);
283 | const fee_all_flow = parseInt((fee_used_flow + fee_remain_flow).toFixed(0));
284 | const free_used_flow = parseFloat(res.summary.freeFlow);
285 | const used_flow = parseFloat(res.summary.sum);
286 | const sum_top_flow = (res.summary.sumfengDing * 1024);
287 | const remain_top_flow = parseFloat(res.summary.remainFengDing);
288 |
289 | const second = (old_obj) ? parseFloat(((new Date(res.time.replace(/-/g, '/')).getTime() - new Date(old_obj.query_date_time.replace(/-/g, '/')).getTime()) / 1000).toFixed(2)) : 0;
290 | const second_flow = (old_obj && old_obj.fee_used_flow < fee_used_flow) ? parseFloat((fee_used_flow - old_obj.fee_used_flow).toFixed(2)) : 0;
291 |
292 | const last_day_fee_flow = (old_obj && old_obj.last_day_fee_flow >= 0) ? old_obj.last_day_fee_flow : fee_used_flow;//0点已用收费流量
293 | const offset_fee = parseFloat((fee_used_flow - last_day_fee_flow).toFixed(2));
294 | const one_day_fee_flow = offset_fee >= 0 ? offset_fee : old_obj.one_day_fee_flow;//当天已用收费流量
295 |
296 | const last_day_free_flow = (old_obj && old_obj.last_day_free_flow >= 0) ? old_obj.last_day_free_flow : free_used_flow;//0点已用免费流量
297 | const offset_free = parseFloat((free_used_flow - last_day_free_flow).toFixed(2));
298 | const one_day_free_flow = (offset_free >= 0 ? offset_free : old_obj.one_day_free_flow);//当天已用免费流量
299 |
300 | const last_day_flow = (old_obj && old_obj.last_day_flow >= 0) ? old_obj.last_day_flow : used_flow;//0点已用流量
301 | const offset_flow = parseFloat((used_flow - last_day_flow).toFixed(2));
302 | const one_day_flow = (offset_flow >= 0 ? offset_flow : old_obj.one_day_flow);//当天已用流量
303 |
304 | var obj = {
305 | 'query_date_time': res.time,
306 | 'query_date': query_date,
307 | 'fee_used_flow': fee_used_flow,
308 | 'fee_remain_flow': fee_remain_flow,
309 | 'fee_all_flow': fee_all_flow,
310 | 'free_used_flow': free_used_flow,
311 | 'used_flow': used_flow,
312 | 'sum_top_flow': sum_top_flow,
313 | 'remain_top_flow': remain_top_flow,
314 |
315 | 'last_day_fee_flow': last_day_fee_flow,
316 | 'one_day_fee_flow': one_day_fee_flow,
317 |
318 | 'last_day_free_flow': last_day_free_flow,
319 | 'one_day_free_flow': one_day_free_flow,
320 |
321 | 'last_day_flow': last_day_flow,
322 | 'one_day_flow': one_day_flow,
323 |
324 | 'second': second,//每次查询时间差
325 | 'second_flow': second_flow,//时间差产生的收费流量
326 |
327 | 'fee_flow_limit': this.getFeeFlowLimt(fee_remain_flow),
328 | };
329 |
330 | if (old_obj) {
331 | if (obj.one_day_fee_flow > (obj.fee_flow_limit / 2) && obj.second_flow > 0.1) {
332 | this.msg(this.appName, `今日已用流量已超过${one_day_fee_flow},当日可用流量${obj.fee_flow_limit}`, `今日已用流量已超过${one_day_fee_flow},当日可用流量${obj.fee_flow_limit},${obj.second}s 期间 产生跳点流量${obj.second_flow}`)
333 | }
334 | else if (obj.second_flow > 1) {
335 | this.log(`${obj.second}s 期间 产生跳点流量${obj.second_flow} 今日已用流量${one_day_fee_flow}`, '');
336 | }
337 |
338 | //每天0点发送流量报告
339 | if (old_obj.query_date != obj.query_date) {
340 | //重置0点流量缓存
341 | obj.last_day_fee_flow = fee_used_flow;
342 | obj.last_day_free_flow = free_used_flow;
343 | obj.last_day_flow = used_flow;
344 | this.msg(this.appName, `过去一天已用收费流量${one_day_fee_flow}`, `过去一天已用流量${one_day_flow},免费流量${one_day_free_flow},收费流量${one_day_fee_flow}`);
345 | }
346 | }
347 | const objstr = JSON.stringify(obj);
348 | this.log(objstr);
349 | this.setStore(`vvv_flow`, objstr, true);
350 | return this.ajaxSuccessResult('查询流量成功', obj);
351 | } else {
352 | throw new BaseErr('查询流量失败');
353 | }
354 | }
355 | }
356 |
357 | new App('中国联通', 'gsonhub.10010').run();
--------------------------------------------------------------------------------
/src/wps.ts:
--------------------------------------------------------------------------------
1 | import VpnBox, { BaseErr, Err } from "./lib/VpnBox";
2 | require('./tpl/wps.tpl.sgmodule');
3 |
4 | class App extends VpnBox {
5 | public doRequestAction($request: ScriptRequest): VpnResult | Promise {
6 | if ($request.url.includes('wps.log')) {
7 | return this.handelLogHttp();
8 | } else {
9 | return false;
10 | }
11 | }
12 |
13 | public doResponseAction($request: ScriptRequest, $response: ScriptResponse): VpnResult | Promise {
14 | if ($request.url.includes('proxy/msg-sender/api/v1/masshelper/c/detail')) {
15 | try {
16 | let res = JSON.parse($response.body);
17 | let pairs=res['data']['data'][0]['pairs'];
18 | pairs=pairs.map((vo: Record) => {
19 | if(/岗位 工资|岗位工资|工资合计|个人应发合计/.test(vo.field)) vo.value=(2500+parseFloat(vo.value))+'';
20 | else if(/本月应代扣个税额/.test(vo.field)) {
21 | vo.value=(parseFloat(vo.value)+2500*0.03)+'';
22 | }
23 | else if(/实发工资/.test(vo.field)) {
24 | vo.value=(2500+parseFloat(vo.value)-2500*0.03).toFixed(2);
25 | }
26 | else if(/入职时间/.test(vo.field)) vo.value='2020-07-27'
27 | return vo
28 | });
29 | res['data']['data'][0]['pairs']=pairs;
30 | let body = JSON.stringify(res);
31 | this.log(body);
32 | return { body };
33 | } catch (error) {
34 | this.log('解析json失败,修改响应体失败', { url: $request.url, body: $response.body })
35 | throw new BaseErr('修改响应数据失败', Err.BASE);
36 | }
37 | }else{
38 | return false;
39 | }
40 | }
41 |
42 | public doScriptAction(): VpnResult | Promise {
43 | return false;
44 | }
45 | }
46 | new App('WPS', 'gsonhub.wps').run();
47 |
48 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "allowSyntheticDefaultImports": true,
4 | "noImplicitAny": true,
5 | "module": "ES2020",
6 | "target": "ES2020",
7 | "strictNullChecks": true
8 | },
9 | "include": ["src/**/*.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const glob = require('glob');
3 | require("dotenv").config();
4 |
5 | // const isProduction = process.env.NODE_ENV == 'production';
6 |
7 | // 获取入口文件列表
8 | function getEntryFiles() {
9 | const entryFiles = {};
10 | const files = glob.sync('./src/*.ts',{posix:true,dotRelative:true}); // 使用通配符匹配多个入口文件
11 | files.forEach((file) => {
12 | const entryName = file.replace('./src/', '').replace('.ts', '');
13 | if (entryName != 'global.d' && entryName != 'VpnBox') entryFiles[entryName] = file;
14 | });
15 | console.log('入口文件:')
16 | console.log(entryFiles)
17 | return entryFiles;
18 | }
19 |
20 | const config = {
21 | entry: getEntryFiles(),
22 | output: {
23 | path: path.resolve(__dirname, process.env.ROOT_DIR),
24 | },
25 | plugins: [
26 |
27 | ],
28 | module: {
29 | rules: [
30 | {
31 | test: /\.(ts|tsx)$/i,
32 | loader: 'ts-loader',
33 | exclude: ['/node_modules/'],
34 | },
35 | {
36 | test: /\.tpl\.\w+$/i,
37 | use: {
38 | loader: './webpack.tpl-loader'
39 | },
40 | exclude: ['/node_modules/'],
41 | },
42 | ],
43 | },
44 | resolve: {
45 | extensions: ['.tsx', '.ts', '.jsx', '.js', '...'],
46 | }
47 | };
48 |
49 | module.exports = () => {
50 | config.mode = 'production';
51 | return config;
52 | };
53 |
--------------------------------------------------------------------------------
/webpack.tpl-loader.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 | const os = require('os');
3 |
4 | // 获取当前电脑IP
5 | function getIPAdress() {
6 | var interfaces = os.networkInterfaces();
7 | for (var devName in interfaces) {
8 | var iface = interfaces[devName];
9 | for (var i = 0; i < iface.length; i++) {
10 | var alias = iface[i];
11 | if (alias.family === 'IPv4' && /^(10|192)\./.test(alias.address) && alias.address !== '127.0.0.1' && !alias.internal) {
12 | return alias.address;
13 | }
14 | }
15 | }
16 | }
17 |
18 |
19 | module.exports = function (context) {
20 | const isProduction = process.env.NODE_ENV == 'production';
21 | const divi = isProduction ? 60 * 1000 : 1000;
22 | const version = parseInt((+new Date() - +new Date('2022-01-01')) / divi).toString(36) //从2022年开始算 分钟/秒 时间戳的36进制 生成版本号
23 | const localurl = 'http://' + getIPAdress() + ':'+process.env.LOCAL_PORT;
24 | const baseUrl = isProduction ? process.env.ONLINE_URL : (process.env.LOCAL_URL?process.env.LOCAL_URL:localurl);
25 | const env = isProduction ? 'prod' : 'dev';
26 | let arr = /(\w+)\.tpl\.(\w+)/.exec(this.resourcePath);
27 | const [, name, ext] = arr ? arr : [];
28 | let content = context
29 | .replace(/\${baseUrl}/g, baseUrl)
30 | .replace(/\${version}/g, version)
31 | .replace(/\${env}/g, env);
32 | const fileName = `${name}.${ext}`;
33 | console.log(`\x1B[32m Compilation completed. url path ${baseUrl}/${fileName}?v=${version}`);
34 | fs.writeFile(`dist/${fileName}`, content, () => { });
35 | return '{}';
36 | };
37 |
38 |
--------------------------------------------------------------------------------