forked from sngxpro/AutoSyncScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsjdjSign.js
More file actions
304 lines (186 loc) · 6.73 KB
/
sjdjSign.js
File metadata and controls
304 lines (186 loc) · 6.73 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
/*
@𝐗𝐢𝐝𝐍 𝐃𝐃 感谢红鲤鱼大佬
//++++++++++++++++++++++++++++++++-
⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️
先看说明 先看说明 先看说明
说明:
水晶DJ签到获得水晶听歌用 不是什么羊毛软件
圈x获取不到ck就把body改成header
⚠️签到的地方获取ck 1处获取ck的地方
小火箭:签到获取ck
水晶DJ = type=http-request,script-path=https://raw.githubusercontent.com/XidNDD/2020scripts/master/sjdjSign.js,pattern=^http:\/\/app\.oscaches\.com\/*,max-size=131072,requires-body=true,timeout=10,enable=true
定时 水晶DJ = type=cron,script-path=https://raw.githubusercontent.com/XidNDD/2020scripts/master/sjdjSign.js,cronexpr="0 0 0 * * *",timeout=10,enable=true
surge:签到获取ck
水晶DJ = type=http-request,pattern=^http:\/\/app\.oscaches\.com\/*,requires-body=1,max-size=0,script-path=https://raw.githubusercontent.com/XidNDD/2020scripts/master/sjdjSign.js
定时 水晶DJ = type=cron,cronexp=0 10 0 * * *,script-path=https://raw.githubusercontent.com/XidNDD/2020scripts/master/sjdjSign.js
圈x:签到获取ck
^http:\/\/app\.oscaches\.com\/* url script-request-body https://raw.githubusercontent.com/XidNDD/2020scripts/master/sjdjSign.js
定时 0 10 0 * * * https://raw.githubusercontent.com/XidNDD/2020scripts/master/sjdjSign.js, tag=水晶DJ, enabled=true
loon:签到获取ck
http-request ^http:\/\/app\.oscaches\.com\/* script-path=https://raw.githubusercontent.com/XidNDD/2020scripts/master/sjdjSign.js, requires-body=true, timeout=10, tag=水晶DJ
定时 cron "0 10 0 * * *" script-path=https://raw.githubusercontent.com/XidNDD/2020scripts/master/sjdjSign.js
MITM=app.oscaches.com
*/
const $XidN = XidN();
const logs=0;//设置0关闭日志,1开启日志
//++++++++++++++++++++++++++++++++-
var dd="水晶DJAPP";
//++++++++++++++++++++++++++++++++
function main()
{
XidN_degin();}
async function XidN_degin()
{
let a0=await XidN_Sign();
let a1=await XidN_completeTask();
let a2=await XidN_getTask();
log(dd,"",a0+a1+a2);
}
function XidN_Sign()
{
return new Promise((resolve, reject) => {
var result1="每日签到打卡";
var result2="";
var appinterfacehd=$XidN.read("appinterfacehdname");
const appinterface={
url:"http://app.oscaches.com/index/appinterface/sign",
headers:JSON.parse(appinterfacehd),
timeout:60000};
$XidN.post(appinterface,function(error, response, data) {
if (logs==1)console.log(data)
var obj=JSON.parse(data);
if(obj.code== 200)
result2="打卡成功✅";
else
if(obj.code== 0)
result2=obj.msg;
else
result2="签到失败获取cookie";
result2="【"+result1+"】"+result2+"\n";
console.log(result2);
resolve(result2);
})
})
}
function XidN_completeTask()
{
return new Promise((resolve, reject) => {
var result1="首页签到打卡";
var result2="";
var appinterfacehd=$XidN.read("appinterfacehdname");
const completeTask={
url:"http://app.oscaches.com/index/appinterface/completeTask",
headers:JSON.parse(appinterfacehd),
body:'rule_id=2',
timeout:60000};
$XidN.post(completeTask,function(error, response, data) {
if (logs==1)console.log(data)
var obj=JSON.parse(data);
if(obj.code== 200)
result2="打卡成功✅";
else
if(obj.code==0)
result2=obj.msg;
else
result2="失败获取cookie";
result2="【"+result1+"】"+result2+"\n";
console.log(result2);
resolve(result2);
})
})
}
function XidN_getTask()
{
return new Promise((resolve, reject) => {
var result1="账户信息查询";
var result2="";
var appinterfacehd=$XidN.read("appinterfacehdname");
const getTask={
url:"http://app.oscaches.com/index/appinterface/getTask",
headers:JSON.parse(appinterfacehd),
timeout:60000};
$XidN.get(getTask,function(error, response, data) {
if (logs==1)console.log(data)
var obj=JSON.parse(data);
if(obj.code== 200)
result2="累计获🉐️"+obj.data.integral+"💎水晶";
else
result2="失败获取cookie";
result2="【"+result1+"】"+result2+"\n";
console.log(result2);
resolve(result2);
})
})
}
function XidN_sjdj() {
if ($request.headers) {
var urlval = $request.url;
var md_hd=$request.headers;
var md_bd=$request.body;
if(urlval.indexOf("index/appinterface/getTask")>=0)
{
var bo= $XidN.write(JSON.stringify(md_hd),"appinterfacehdname");
if (bo==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_sjdj()
$XidN.end()
} else {
main();
$XidN.end()
}
function XidN() {
const isRequest = typeof $request != "undefined"
const isSurge = typeof $httpClient != "undefined"
const isQuanX = typeof $task != "undefined"
var link = {"open-url": "https://github.com",
"media-url" : "https://img01.sogoucdn.com/app/a/100520146/451bff539e596f3f04be6f7d230c68cc"};
const notify = (title, subtitle, message) => {
if (isQuanX) $notify(title, subtitle, message,link)
if (isSurge) $notification.post(title, subtitle, message,{'openUrl':'wechat://','mediaUrl':'https://img01.sogoucdn.com/app/a/100520146/451bff539e596f3f04be6f7d230c68cc'})
}
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}
};