forked from sngxpro/AutoSyncScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmygmcSign.js
More file actions
359 lines (209 loc) · 6.8 KB
/
mygmcSign.js
File metadata and controls
359 lines (209 loc) · 6.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
/*
@𝐗𝐢𝐝𝐍 𝐃𝐃
//++++++++++++++++++++++++++++++++-
说明:
民盈国贸城小程序 签到可以获得积分兑换物品
群友需要就写了 不是羊毛
圈x获取不到ck就把body改成header
打开软件签到获取ck 签过到可能获取不到ck
surge:远程
民盈国贸城 = type=http-request,pattern=^https:\/\/appsmall\.rtmap\.com\/*,requires-body=1,max-size=0,script-path=mygmcSign.js
定时 民盈国贸城 = type=cron,cronexp=0 10 0 * * *,script-path=mygmcSign.js
圈x:远程
签到获取ck
^https:\/\/appsmall\.rtmap\.com\/* url script-request-body mygmcSign.js
定时 0 10 0 * * * mygmcSign.js, tag=民盈国贸城, enabled=true
loon:远程
签到获取ck
http-request ^https:\/\/appsmall\.rtmap\.com\/* script-path=mygmcSign.js, requires-body=true, timeout=10, tag=民盈国贸城
定时 cron "0 10 0 * * *" script-path=mygmcSign.js
MITM= appsmall.rtmap.com
*/
const $XidN = XidN();
const logs=0;//设置0关闭日志,1开启日志
//++++++++++++++++++++++++++++++++-
var dd="民盈国贸城小程序";
//++++++++++++++++++++++++++++++++
function main()
{
XidN_degin();}
async function XidN_degin()
{
let d0=await XidN_infosign();
let d1=await XidN_Sign();
log(dd,"",d0+d1);
}
function XidN_Sign()
{
return new Promise((resolve, reject) => {
var result1="每日打卡🏝🏝";
var result2="";
var Recordurl=$XidN.read("Recordurlname");
var Recordhd=$XidN.read("Recordhdname");
var Recordbd=$XidN.read("Recordbdname");
const Record={
url:Recordurl,
headers:JSON.parse(Recordhd),
body:Recordbd,
timeout:60000};
$XidN.post(Record,function(error, response, data) {
if (logs==1)console.log(data)
var obj=JSON.parse(data);
if(obj.code== 200)
result2="打卡✅,"+obj.data.today;
else
if(obj.code== 400)
result2="签到失败说明:"+obj.msg;
else
if(obj.code== 500)
result2="签到失败说明:"+obj.msg;
else
result2="签到失败获取cookie";
var Recordgeturl=$XidN.read("Recordgeturlname");
var Recordgethd=$XidN.read("Recordgethdname");
const Recordget={
url:Recordgeturl,
headers:JSON.parse(Recordgethd),
timeout:60000};
$XidN.get(Recordget,function(error, response, data) {
if (logs==1)console.log(data)
var obj=JSON.parse(data);
if(obj.code== 200)
result2+="[连续打卡]"+obj.data.serialSignDays+"天";
for(let i=0;i<obj.data.days.length;i++)
{
result2+="[已签到日期]"+obj.data.days[i];
}
var accounturl=$XidN.read("accounturlname");
var accounthd=$XidN.read("accounthdname");
const accountget={
url:accounturl,
headers:JSON.parse(accounthd),
timeout:60000};
$XidN.get(accountget,function(error, response, data) {
if (logs==1)console.log(data)
var obj=JSON.parse(data);
if(obj.code== 200)
result2+="[当前账户积分]"+obj.data.balance+"分";
result2="<"+result1+">"+result2+"\n";
console.log(result2);
resolve(result2);
})
})
})
})
}
function XidN_infosign()
{
return new Promise((resolve, reject) => {
var result1="查询账户信息🔍";
var result2="";
var customerurl=$XidN.read("customerurlname");
var customerhd=$XidN.read("customerhdname");
const customer={
url:customerurl,
headers:JSON.parse(customerhd),
timeout:60000};
$XidN.get(customer,function(error, response, data) {
if (logs==1)console.log(data)
var obj=JSON.parse(data);
if(obj.code== 200)
result2="昵称"+obj.data.member.nickname+",当前会员等级"+obj.data.member.cardName+"会员";
else
result2="失败获取cookie";
result2="<"+result1+">"+result2+"\n";
console.log(result2);
resolve(result2);
})
})
}
function XidN_mygmc() {
if ($request.headers) {
var urlval = $request.url;
var md_hd=$request.headers;
var md_bd=$request.body;
if(urlval.indexOf("sign/signRecord/get?")>=0)
{
var ko= $XidN.write(urlval,"Recordgeturlname");
var po= $XidN.write(JSON.stringify(md_hd),"Recordgethdname");
if (po==true&&ko==true)
log(dd,"[获取签到日期数据]","✅成功");}
else if(urlval.indexOf("wxapp-root/api/v1/score/account?")>=0)
{
var ko= $XidN.write(urlval,"accounturlname");
var po= $XidN.write(JSON.stringify(md_hd),"accounthdname");
if (po==true&&ko==true)
log(dd,"[获取积分数据]","✅成功");}
else if(urlval.indexOf("wxapp-root/api/v1/customer/info?")>=0)
{
var ko= $XidN.write(urlval,"customerurlname");
var po= $XidN.write(JSON.stringify(md_hd),"customerhdname");
if (po==true&&ko==true)
log(dd,"[获取个人信息数据]","✅成功");}
else if(urlval.indexOf("sign/signRecord")>=0)
{
var ao= $XidN.write(urlval,"Recordurlname");
var so= $XidN.write(md_bd,"Recordbdname");
var bo= $XidN.write(JSON.stringify(md_hd),"Recordhdname");
if (ao==true&&bo==true&&so==true)
log(dd,"[获取签到数据]","✅成功");}
}
}
function log(x,y,z){
$XidN.notify(x,y,z);}
function getRandom(start, end, fixed = 0) {
let differ = end - start
let random = Math.random()
return (start + differ * random).toFixed(fixed)
}
if ($XidN.isRequest) {
XidN_mygmc()
$XidN.end()
} else {
main();
$XidN.end()
}
function XidN() {
const isRequest = typeof $request != "undefined"
const isSurge = typeof $httpClient != "undefined"
const isQuanX = typeof $task != "undefined"
const notify = (title, subtitle, message) => {
if (isQuanX) $notify(title, subtitle, message)
if (isSurge) $notification.post(title, subtitle, message)
}
const write = (value, key) => {
if (isQuanX) return $prefs.setValueForKey(value, key)
if (isSurge) return $persistentStore.write(value, key)
}
const read = (key) => {
if (isQuanX) return $prefs.valueForKey(key)
if (isSurge) return $persistentStore.read(key)
}
const get = (options, callback) => {
if (isQuanX) {
if (typeof options == "string") options = { url: options }
options["method"] = "GET"
$task.fetch(options).then(response => {
response["status"] = response.statusCode
callback(null, response, response.body)
}, reason => callback(reason.error, null, null))
}
if (isSurge) $httpClient.get(options, callback)
}
const post = (options, callback) => {
if (isQuanX) {
if (typeof options == "string") options = { url: options }
options["method"] = "POST"
$task.fetch(options).then(response => {
response["status"] = response.statusCode
callback(null, response, response.body)
}, reason => callback(reason.error, null, null))
}
if (isSurge) $httpClient.post(options, callback)
}
const end = () => {
if (isQuanX) isRequest ? $done({}) : ""
if (isSurge) isRequest ? $done({}) : $done()
}
return { isRequest, isQuanX, isSurge, notify, write, read, get, post, end }
};