alicezetion 1.7.5 → 1.7.7
Sign up to get free protection for your applications and to get access to all the features.
- package/.cache/replit/__replit_disk_meta.json +1 -1
- package/.cache/replit/nix/env.json +1 -1
- package/.travis.yml +6 -0
- package/index.js +120 -655
- package/package.json +25 -37
- package/replit.nix +4 -3
- package/src/addExternalModule.js +5 -13
- package/src/addUserToGroup.js +12 -36
- package/src/changeAdminStatus.js +37 -85
- package/src/changeArchivedStatus.js +9 -15
- package/src/changeBio.js +8 -13
- package/src/changeBlockedStatus.js +8 -14
- package/src/changeGroupImage.js +13 -28
- package/src/changeNickname.js +11 -22
- package/src/changeThreadColor.js +10 -16
- package/src/changeThreadEmoji.js +9 -18
- package/src/chat.js +280 -401
- package/src/createNewGroup.js +10 -18
- package/src/createPoll.js +11 -17
- package/src/deleteMessage.js +10 -17
- package/src/deleteThread.js +10 -17
- package/src/forwardAttachment.js +9 -15
- package/src/forwardMessage.js +0 -0
- package/src/getCurrentUserID.js +1 -1
- package/src/getEmojiUrl.js +2 -3
- package/src/getFriendsList.js +10 -18
- package/src/getThreadHistory.js +59 -156
- package/src/getThreadHistoryDeprecated.js +15 -26
- package/src/getThreadInfo.js +42 -68
- package/src/getThreadInfoDeprecated.js +13 -25
- package/src/getThreadList.js +53 -112
- package/src/getThreadListDeprecated.js +12 -30
- package/src/getThreadPictures.js +13 -25
- package/src/getUserID.js +7 -9
- package/src/getUserInfo.js +10 -12
- package/src/handleFriendRequest.js +35 -36
- package/src/handleMessageRequest.js +10 -18
- package/src/httpGet.js +13 -20
- package/src/httpPost.js +13 -19
- package/src/listen.js +553 -0
- package/src/listenMqtt-Test.js +687 -0
- package/src/listenMqtt.js +621 -1224
- package/src/logout.js +13 -18
- package/src/markAsDelivered.js +10 -17
- package/src/markAsRead.js +24 -36
- package/src/{seen.js → markAsReadAll.js} +10 -17
- package/src/markAsSeen.js +12 -22
- package/src/muteThread.js +9 -15
- package/src/removeUserFromGroup.js +11 -38
- package/src/resolvePhotoUrl.js +6 -9
- package/src/searchForThread.js +8 -14
- package/src/sendMessage.js +315 -0
- package/src/sendTypingIndicator.js +19 -44
- package/src/{react.js → setMessageReaction.js} +9 -20
- package/src/setPostReaction.js +22 -63
- package/src/setTitle.js +12 -22
- package/src/threadColors.js +19 -17
- package/src/unfriend.js +9 -15
- package/src/{unsend.js → unsendMessage.js} +8 -9
- package/test/data/shareAttach.js +146 -0
- package/test/data/something.mov +0 -0
- package/test/data/test.png +0 -0
- package/test/data/test.txt +7 -0
- package/test/example-config.json +18 -0
- package/test/test-page.js +140 -0
- package/test/test.js +385 -0
- package/utils.js +27 -120
- package/Extra/Database/index.js +0 -399
- package/Extra/Database/methods.js +0 -286
- package/Extra/ExtraAddons.js +0 -213
- package/Extra/ExtraGetThread.js +0 -1
- package/Extra/ExtraUptimeRobot.js +0 -59
- package/Extra/PM2/ecosystem.config.js +0 -23
- package/Extra/Src/Last-Run.js +0 -48
- package/Language/index.json +0 -151
- package/StateCrypt.js +0 -22
- package/broadcast.js +0 -42
- package/logger.js +0 -21
- package/src/changeAvt.js +0 -91
- package/src/getAccessToken.js +0 -32
- package/src/getMessage.js +0 -84
- package/src/getUserInfoV2.js +0 -35
- package/src/httpPostFormData.js +0 -46
package/index.js
CHANGED
@@ -1,93 +1,13 @@
|
|
1
|
-
|
1
|
+
"use strict";
|
2
2
|
|
3
|
-
|
3
|
+
var utils = require("./utils");
|
4
|
+
var cheerio = require("cheerio");
|
5
|
+
var log = require("npmlog");
|
4
6
|
|
5
|
-
process.env.UV_THREADPOOL_SIZE = require('os').cpus().length;
|
6
|
-
|
7
|
-
/!-[ Global Set ]-!/
|
8
|
-
|
9
|
-
global.isThread = new Array();
|
10
|
-
global.isUser = new Array();
|
11
|
-
global.startTime = Date.now();
|
12
|
-
global.getText = require('gettext.js')();
|
13
|
-
|
14
|
-
/!-[ Require All Package Need Use ]-!/
|
15
|
-
/*globalThis.Fca = new Object({
|
16
|
-
test: console,log("test"),
|
17
|
-
Require: new Object({})
|
18
|
-
});*/
|
19
|
-
var utils = require("./utils"),
|
20
|
-
cheerio = require("cheerio"),
|
21
|
-
log = require("npmlog"),
|
22
|
-
//{ getAccessToken } = require('./Extra/ExtraAddons'),
|
23
|
-
logger = require('./logger'),
|
24
|
-
fs = require('fs-extra'),
|
25
|
-
getText = require('gettext.js')(),
|
26
|
-
logger = require('./logger'),
|
27
|
-
Fetch = require('got'),
|
28
|
-
fs = require('fs-extra'),
|
29
|
-
StateCrypt = require('./StateCrypt'),
|
30
|
-
Client = require("@replit/database"),
|
31
|
-
languageFile = require('./Language/index.json'),
|
32
|
-
ObjFastConfig = {
|
33
|
-
"Language": "en",
|
34
|
-
"MainColor": "#9900FF",
|
35
|
-
"BroadCast": true,
|
36
|
-
"EncryptFeature": true,
|
37
|
-
"PreKey": "",
|
38
|
-
"Uptime": false
|
39
|
-
};
|
40
|
-
|
41
|
-
|
42
|
-
/!-[ Check File To Run Process ]-!/
|
43
|
-
|
44
|
-
try {
|
45
|
-
if (!fs.existsSync('./alice/alicezetion.json')) {
|
46
|
-
fs.writeFileSync("./alice/alicezetion.json", JSON.stringify(ObjFastConfig, null, "\t"));
|
47
|
-
process.exit(1);
|
48
|
-
} else if (fs.existsSync('./alice/alicezetion.json')) {
|
49
|
-
try {
|
50
|
-
var DataLanguageSetting = require("./alice/alicezetion.json");
|
51
|
-
} catch (e) {
|
52
|
-
logger("Invalid Config Settings, Restoring Default...");
|
53
|
-
fs.writeFileSync("./alice/alicezetion.json", JSON.stringify(ObjFastConfig, null, "\t"));
|
54
|
-
process.exit(1);
|
55
|
-
}
|
56
|
-
try {
|
57
|
-
if (DataLanguageSetting && !DataLanguageSetting.PreKey) {
|
58
|
-
DataLanguageSetting.PreKey = "";
|
59
|
-
fs.writeFileSync("./alice/alicezetion.json", JSON.stringify(DataLanguageSetting, null, "\t"));
|
60
|
-
}
|
61
|
-
} catch (e) {
|
62
|
-
console.log(e);
|
63
|
-
}
|
64
|
-
if (!languageFile.some(i => i.Language == DataLanguageSetting.Language)) {
|
65
|
-
logger("Not Support Language: " + DataLanguageSetting.Language + " Only 'en' and 'vi'", "[ Alicezetion ]");
|
66
|
-
process.exit(0);
|
67
|
-
}
|
68
|
-
var Language = languageFile.find(i => i.Language == DataLanguageSetting.Language).Folder.Index;
|
69
|
-
} else process.exit(1);
|
70
|
-
if (utils.getType(DataLanguageSetting.BroadCast) != "Boolean" && DataLanguageSetting.BroadCast != undefined) {
|
71
|
-
log.warn("FastConfig-BroadCast", getText.gettext(Language.IsNotABoolean, DataLanguageSetting.BroadCast));
|
72
|
-
process.exit(0)
|
73
|
-
} else if (DataLanguageSetting.BroadCast == undefined) {
|
74
|
-
fs.writeFileSync("./alice/alicezetion.json", JSON.stringify(ObjFastConfig, null, "\t"));
|
75
|
-
process.exit(1);
|
76
|
-
}
|
77
|
-
|
78
|
-
global.FastConfig = DataLanguageSetting;
|
79
|
-
|
80
|
-
} catch (e) {
|
81
|
-
console.log(e);
|
82
|
-
logger.Error();
|
83
|
-
}
|
84
|
-
|
85
|
-
/!-[ Set Variable For Process ]-!/
|
86
|
-
|
87
|
-
log.maxRecordSize = 100;
|
88
7
|
var checkVerified = null;
|
89
8
|
|
90
|
-
|
9
|
+
var defaultLogRecordSize = 100;
|
10
|
+
log.maxRecordSize = defaultLogRecordSize;
|
91
11
|
|
92
12
|
function setOptions(globalOptions, options) {
|
93
13
|
Object.keys(options).map(function(key) {
|
@@ -155,23 +75,21 @@ function setOptions(globalOptions, options) {
|
|
155
75
|
});
|
156
76
|
}
|
157
77
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
78
|
+
function buildAPI(globalOptions, html, jar) {
|
79
|
+
var maybeCookie = jar.getCookies("https://www.facebook.com").filter(function(val) {
|
80
|
+
return val.cookieString().split("=")[0] === "c_user";
|
81
|
+
});
|
162
82
|
|
163
|
-
if (maybeCookie.length === 0) throw { error:
|
83
|
+
if (maybeCookie.length === 0) throw { error: "Error retrieving userID. This can be caused by a lot of things, including getting blocked by Facebook for logging in from an unknown location. Try logging in with a browser to verify." };
|
164
84
|
|
165
|
-
if (html.indexOf("/checkpoint/block/?next") > -1) log.warn("login",
|
85
|
+
if (html.indexOf("/checkpoint/block/?next") > -1) log.warn("login", "Checkpoint detected. Please log in with a browser to verify.");
|
166
86
|
|
167
87
|
var userID = maybeCookie[0].cookieString().split("=")[1].toString();
|
168
|
-
|
88
|
+
//log.info("login", `Logged in as ${userID}`);
|
169
89
|
|
170
90
|
try {
|
171
91
|
clearInterval(checkVerified);
|
172
|
-
} catch (
|
173
|
-
console.log(e);
|
174
|
-
}
|
92
|
+
} catch (_) {}
|
175
93
|
|
176
94
|
var clientID = (Math.random() * 2147483648 | 0).toString(16);
|
177
95
|
|
@@ -185,34 +103,39 @@ async function buildAPI(globalOptions, html, jar) {
|
|
185
103
|
irisSeqID = oldFBMQTTMatch[1];
|
186
104
|
mqttEndpoint = oldFBMQTTMatch[2];
|
187
105
|
region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
|
188
|
-
|
106
|
+
//log.info("login", `Got this account's message region: ${region}`);
|
189
107
|
} else {
|
190
108
|
let newFBMQTTMatch = html.match(/{"app_id":"219994525426954","endpoint":"(.+?)","iris_seq_id":"(.+?)"}/);
|
191
109
|
if (newFBMQTTMatch) {
|
192
110
|
irisSeqID = newFBMQTTMatch[2];
|
193
111
|
mqttEndpoint = newFBMQTTMatch[1].replace(/\\\//g, "/");
|
194
112
|
region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
|
113
|
+
// log.info("login", `Got this account's message region: ${region}`);
|
195
114
|
} else {
|
196
115
|
let legacyFBMQTTMatch = html.match(/(\["MqttWebConfig",\[\],{fbid:")(.+?)(",appID:219994525426954,endpoint:")(.+?)(",pollingEndpoint:")(.+?)(3790])/);
|
197
116
|
if (legacyFBMQTTMatch) {
|
198
117
|
mqttEndpoint = legacyFBMQTTMatch[4];
|
199
118
|
region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
|
200
|
-
|
201
|
-
|
119
|
+
/* log.warn("login", `Cannot get sequence ID with new RegExp. Fallback to old RegExp (without seqID)...`);
|
120
|
+
log.info("login", `Got this account's message region: ${region}`);
|
121
|
+
log.info("login", `[Unused] Polling endpoint: ${legacyFBMQTTMatch[6]}`);*/
|
202
122
|
} else {
|
203
|
-
log.warn("login",
|
123
|
+
/*log.warn("login", "» Cannot get MQTT region & sequence ID.");
|
124
|
+
log.error("login", "» Please try closing and reopening your browser window or get new fbstate.");*/
|
204
125
|
noMqttData = html;
|
126
|
+
process.exit();
|
205
127
|
}
|
206
128
|
}
|
207
129
|
}
|
208
130
|
|
131
|
+
// All data available to api functions
|
209
132
|
var ctx = {
|
210
133
|
userID: userID,
|
211
134
|
jar: jar,
|
212
135
|
clientID: clientID,
|
213
136
|
globalOptions: globalOptions,
|
214
137
|
loggedIn: true,
|
215
|
-
access_token: '
|
138
|
+
access_token: 'NONE',
|
216
139
|
clientMutationId: 0,
|
217
140
|
mqttClient: undefined,
|
218
141
|
lastSeqId: irisSeqID,
|
@@ -231,12 +154,67 @@ async function buildAPI(globalOptions, html, jar) {
|
|
231
154
|
|
232
155
|
if (noMqttData) api["htmlData"] = noMqttData;
|
233
156
|
|
234
|
-
const apiFuncNames =
|
157
|
+
const apiFuncNames = [
|
158
|
+
'addExternalModule',
|
159
|
+
'addUserToGroup',
|
160
|
+
'changeAdminStatus',
|
161
|
+
'changeArchivedStatus',
|
162
|
+
'changeBio',
|
163
|
+
'changeBlockedStatus',
|
164
|
+
'changeGroupImage',
|
165
|
+
'changeNickname',
|
166
|
+
'chat',
|
167
|
+
'changeThreadColor',
|
168
|
+
'changeThreadEmoji',
|
169
|
+
'createNewGroup',
|
170
|
+
'createPoll',
|
171
|
+
'deleteMessage',
|
172
|
+
'deleteThread',
|
173
|
+
'forwardAttachment',
|
174
|
+
'getCurrentUserID',
|
175
|
+
'getEmojiUrl',
|
176
|
+
'getFriendsList',
|
177
|
+
'getThreadHistory',
|
178
|
+
'getThreadInfo',
|
179
|
+
'getThreadList',
|
180
|
+
'getThreadPictures',
|
181
|
+
'getUserID',
|
182
|
+
'getUserInfo',
|
183
|
+
'handleFriendRequest',
|
184
|
+
'handleMessageRequest',
|
185
|
+
'listenMqtt',
|
186
|
+
'logout',
|
187
|
+
'markAsDelivered',
|
188
|
+
'markAsRead',
|
189
|
+
'markAsReadAll',
|
190
|
+
'markAsSeen',
|
191
|
+
'muteThread',
|
192
|
+
'removeUserFromGroup',
|
193
|
+
'resolvePhotoUrl',
|
194
|
+
'searchForThread',
|
195
|
+
'sendMessage',
|
196
|
+
'sendTypingIndicator',
|
197
|
+
'setMessageReaction',
|
198
|
+
'setTitle',
|
199
|
+
'threadColors',
|
200
|
+
'unsendMessage',
|
201
|
+
'unfriend',
|
202
|
+
|
203
|
+
// HTTP
|
204
|
+
'httpGet',
|
205
|
+
'httpPost',
|
206
|
+
|
207
|
+
// Deprecated features
|
208
|
+
"getThreadListDeprecated",
|
209
|
+
'getThreadHistoryDeprecated',
|
210
|
+
'getThreadInfoDeprecated',
|
211
|
+
];
|
235
212
|
|
236
213
|
var defaultFuncs = utils.makeDefaults(html, userID, ctx);
|
237
214
|
|
238
215
|
// Load all api functions in a loop
|
239
|
-
apiFuncNames.map(v => api[v
|
216
|
+
apiFuncNames.map(v => api[v] = require('./src/' + v)(defaultFuncs, api, ctx));
|
217
|
+
|
240
218
|
return [ctx, defaultFuncs, api];
|
241
219
|
}
|
242
220
|
|
@@ -281,15 +259,17 @@ function makeLogin(jar, email, password, loginOptions, callback, prCallback) {
|
|
281
259
|
});
|
282
260
|
// ---------- Very Hacky Part Ends -----------------
|
283
261
|
|
262
|
+
//log.info("login", "Logging in...");
|
284
263
|
return utils
|
285
264
|
.post("https://www.facebook.com/login/device-based/regular/login/?login_attempt=1&lwv=110", jar, form, loginOptions)
|
286
265
|
.then(utils.saveCookies(jar))
|
287
266
|
.then(function(res) {
|
288
267
|
var headers = res.headers;
|
289
|
-
if (!headers.location) throw { error:
|
268
|
+
if (!headers.location) throw { error: "Wrong username/password." };
|
290
269
|
|
291
270
|
// This means the account has login approvals turned on.
|
292
271
|
if (headers.location.indexOf('https://www.facebook.com/checkpoint/') > -1) {
|
272
|
+
log.info("login", "You have login approvals turned on.");
|
293
273
|
var nextURL = 'https://www.facebook.com/checkpoint/?next=https%3A%2F%2Fwww.facebook.com%2Fhome.php';
|
294
274
|
|
295
275
|
return utils
|
@@ -336,7 +316,7 @@ function makeLogin(jar, email, password, loginOptions, callback, prCallback) {
|
|
336
316
|
if (error) {
|
337
317
|
throw {
|
338
318
|
error: 'login-approval',
|
339
|
-
errordesc:
|
319
|
+
errordesc: "Invalid 2FA code.",
|
340
320
|
lerror: error,
|
341
321
|
continue: submit2FA
|
342
322
|
};
|
@@ -346,13 +326,13 @@ function makeLogin(jar, email, password, loginOptions, callback, prCallback) {
|
|
346
326
|
// Use the same form (safe I hope)
|
347
327
|
delete form.no_fido;
|
348
328
|
delete form.approvals_code;
|
349
|
-
form.name_action_selected = '
|
329
|
+
form.name_action_selected = 'dont_save'; //'save_device';
|
350
330
|
|
351
331
|
return utils.post(nextURL, jar, form, loginOptions).then(utils.saveCookies(jar));
|
352
332
|
})
|
353
333
|
.then(function(res) {
|
354
334
|
var headers = res.headers;
|
355
|
-
if (!headers.location && res.body.indexOf('Review Recent Login') > -1) throw { error:
|
335
|
+
if (!headers.location && res.body.indexOf('Review Recent Login') > -1) throw { error: "Something went wrong with login approvals." };
|
356
336
|
|
357
337
|
var appState = utils.getAppState(jar);
|
358
338
|
|
@@ -381,6 +361,7 @@ function makeLogin(jar, email, password, loginOptions, callback, prCallback) {
|
|
381
361
|
JSON.parse(res.body.replace(/for\s*\(\s*;\s*;\s*\)\s*;\s*/, ""));
|
382
362
|
} catch (ex) {
|
383
363
|
clearInterval(checkVerified);
|
364
|
+
log.info("login", "Verified from browser. Logging in...");
|
384
365
|
if (callback === prCallback) {
|
385
366
|
callback = function(err, api) {
|
386
367
|
if (err) return prReject(err);
|
@@ -400,7 +381,7 @@ function makeLogin(jar, email, password, loginOptions, callback, prCallback) {
|
|
400
381
|
}
|
401
382
|
};
|
402
383
|
} else {
|
403
|
-
if (!loginOptions.forceLogin) throw { error:
|
384
|
+
if (!loginOptions.forceLogin) throw { error: "Couldn't login. Facebook might have blocked this account. Please login with a browser or enable the option 'forceLogin' and try again." };
|
404
385
|
|
405
386
|
if (html.indexOf("Suspicious Login Attempt") > -1) form['submit[This was me]'] = "This was me";
|
406
387
|
else form['submit[This Is Okay]'] = "This Is Okay";
|
@@ -435,496 +416,33 @@ function makeLogin(jar, email, password, loginOptions, callback, prCallback) {
|
|
435
416
|
};
|
436
417
|
}
|
437
418
|
|
438
|
-
function makeid(length) {
|
439
|
-
var result = '';
|
440
|
-
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
441
|
-
var charactersLength = characters.length;
|
442
|
-
for (var i = 0; i < length; i++) {
|
443
|
-
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
444
|
-
}
|
445
|
-
return result;
|
446
|
-
}
|
447
|
-
|
448
|
-
|
449
419
|
// Helps the login
|
450
|
-
|
420
|
+
function loginHelper(appState, email, password, globalOptions, callback, prCallback) {
|
451
421
|
var mainPromise = null;
|
452
422
|
var jar = utils.getJar();
|
453
423
|
|
454
424
|
// If we're given an appState we loop through it and save each cookie
|
455
425
|
// back into the jar.
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
//const os = require("os");
|
462
|
-
//const { execSync } = require('child_process');
|
463
|
-
// let rl = readline.createInterface({
|
464
|
-
// input: process.stdin,
|
465
|
-
// output: process.stdout,
|
466
|
-
// prompt: chalk.hex('#00CCCC').bold('[FCA-SUS] • ')
|
467
|
-
// });
|
468
|
-
// let type = {
|
469
|
-
// 1: {
|
470
|
-
// "name": "Tạo Mật Khẩu Cho Appstate",
|
471
|
-
// onRun: async function() {
|
472
|
-
// try {
|
473
|
-
// rl.question("Hãy Nhập Mật Khẩu Bạn Muốn Đặt Cho Appstate !", (answer) => {
|
474
|
-
// console.log("Được Rồi Mật Khẩu Của Bạn Là: " + answer + ", Bạn Hãy Nhớ Kĩ Nhé !");
|
475
|
-
// process.env["FBKEY"] = answer;
|
476
|
-
// fs.writeFile('../.env', `FBKEY=${answer}`, function (err) {
|
477
|
-
// if (err) {
|
478
|
-
// submiterr(err)
|
479
|
-
// logger("Tạo File ENV Thất Bại !", "[ FCA-SUS ]")
|
480
|
-
// rl.pause();
|
481
|
-
// }
|
482
|
-
// else logger("Tạo Thành Công File ENV !","[ FCA-SUS ]")
|
483
|
-
// rl.pause();
|
484
|
-
// });
|
485
|
-
// })
|
486
|
-
// }
|
487
|
-
// catch (e) {
|
488
|
-
// console.log(e);
|
489
|
-
// logger("Đã Có Lỗi Khi Đang Try Tạo Ra Câu Hỏi =))", "[ FCA-SUS ]");
|
490
|
-
// rl.pause();
|
491
|
-
// }
|
492
|
-
// }
|
493
|
-
// },
|
494
|
-
// 2: {
|
495
|
-
// "name": "Tiếp Tục Chạy Fca Mà Không Cần Mã Hóa AppState",
|
496
|
-
// onRun: async function () {
|
497
|
-
// rl.pause();
|
498
|
-
// }
|
499
|
-
// },
|
500
|
-
// 3: {
|
501
|
-
// "name": "Đổi Mật Khẩu AppState (Comming Soon..)",
|
502
|
-
// onRun: async function () {
|
503
|
-
// console.log(chalk.red.bold("Đã bảo là comming soon rồi mà >:v"));
|
504
|
-
// }
|
505
|
-
// }
|
506
|
-
// }
|
507
|
-
// const localbrand = JSON.parse(readFileSync('./package.json')).name;
|
508
|
-
// const localbrand2 = JSON.parse(readFileSync('./node_modules/fca-sus/package.json')).version;
|
509
|
-
// var axios = require('axios');
|
510
|
-
// axios.get('https://raw.githubusercontent.com/amogusdevlol/fca-sus/main/package.json').then(async (res) => {
|
511
|
-
// if (localbrand.toUpperCase() == 'HORIZON') {
|
512
|
-
// console.group(chalk.bold.cyan('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'))
|
513
|
-
// console.log(chalk.bold.hex('#00FFCC')("[</>]") + chalk.bold.yellow(' => ') + "Hệ Điều Hành: " + chalk.bold.red(os.type()));
|
514
|
-
// console.log(chalk.bold.hex('#00FFCC')("[</>]") + chalk.bold.yellow(' => ') + "Thông Tin Máy: " + chalk.bold.red(os.version()));
|
515
|
-
// console.log(chalk.bold.hex('#00FFCC')("[</>]") + chalk.bold.yellow(' => ') + "Phiên Bản Hiện Tại: " + chalk.bold.red(localbrand2));
|
516
|
-
// console.log(chalk.bold.hex('#00FFCC')("[</>]") + chalk.bold.yellow(' => ') + "Phiên Bản Mới Nhất: " + chalk.bold.red(res.data.version));
|
517
|
-
// console.groupEnd();
|
518
|
-
// }
|
519
|
-
// else {
|
520
|
-
// console.clear();
|
521
|
-
// console.log(figlet.textSync('TeamHorizon', {font: 'ANSI Shadow',horizontalLayout: 'default',verticalLayout: 'default',width: 0,whitespaceBreak: true }))
|
522
|
-
// console.log(chalk.hex('#9966CC')(`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`));
|
523
|
-
// }
|
524
|
-
// });
|
525
|
-
|
526
|
-
var backup = async(data) => {
|
527
|
-
if (fs.existsSync('./alicestate.json')) {
|
528
|
-
try {
|
529
|
-
fs.writeFileSync('./alicestate.json', data);
|
530
|
-
} catch (e) {
|
531
|
-
fs.writeFileSync('./alicestate.json', JSON.stringify(data, null, "\t"));
|
532
|
-
}
|
533
|
-
await new Promise(resolve => setTimeout(resolve, 5 * 1000));
|
534
|
-
process.exit(1);
|
535
|
-
} else return logger.Error();
|
536
|
-
}
|
537
|
-
|
538
|
-
switch (process.platform) {
|
539
|
-
case "win32":
|
540
|
-
{
|
541
|
-
try {
|
542
|
-
var { body } = await Fetch('https://decrypt-appstate-production.up.railway.app/getKey');
|
543
|
-
process.env['FBKEY'] = JSON.parse(body).Data;
|
544
|
-
} catch (e) {
|
545
|
-
logger(Language.ErrGetPassWord);
|
546
|
-
logger.Error();
|
547
|
-
process.exit(1);
|
548
|
-
}
|
549
|
-
}
|
550
|
-
break;
|
551
|
-
case "linux":
|
552
|
-
{
|
553
|
-
if (process.env["REPL_ID"] == undefined) {
|
554
|
-
try {
|
555
|
-
var { body } = await Fetch.get('https://decrypt-appstate-production.up.railway.app/getKey');
|
556
|
-
process.env['FBKEY'] = JSON.parse(body).Data;
|
557
|
-
} catch (e) {
|
558
|
-
logger.Error();
|
559
|
-
process.exit(1);
|
560
|
-
}
|
561
|
-
} else {
|
562
|
-
/* try {
|
563
|
-
const client = new Client();
|
564
|
-
let key = await client.get("FBKEY");
|
565
|
-
if (!key) {
|
566
|
-
await client.set("FBKEY", makeid(49));
|
567
|
-
let key = await client.get("FBKEY");
|
568
|
-
process.env['FBKEY'] = key;
|
569
|
-
} else {
|
570
|
-
process.env['FBKEY'] = key;
|
571
|
-
}
|
572
|
-
} catch (e) {
|
573
|
-
logger(Language.ErrGenerateKey, '[ FCA-SUS ]');
|
574
|
-
logger(e, '[ FCA-SUS ]');
|
575
|
-
logger.Error();
|
576
|
-
process.exit(0)
|
577
|
-
}*/
|
578
|
-
}
|
579
|
-
}
|
580
|
-
break;
|
581
|
-
case "android":
|
582
|
-
{
|
583
|
-
try {
|
584
|
-
var { body } = await Fetch.get('https://decrypt-appstate-production.up.railway.app/getKey');
|
585
|
-
process.env['FBKEY'] = JSON.parse(body).Data;
|
586
|
-
} catch (e) {
|
587
|
-
|
588
|
-
return logger.Error();
|
589
|
-
}
|
590
|
-
}
|
591
|
-
break;
|
592
|
-
default:
|
593
|
-
{
|
594
|
-
|
595
|
-
logger.Error();
|
596
|
-
process.exit(0);
|
597
|
-
}
|
598
|
-
}
|
599
|
-
|
600
|
-
try {
|
601
|
-
switch (require("./alice/alicezetion.json").EncryptFeature) {
|
602
|
-
case true:
|
603
|
-
{
|
604
|
-
appState = JSON.parse(JSON.stringify(appState, null, "\t"));
|
605
|
-
switch (utils.getType(appState)) {
|
606
|
-
case "Array":
|
607
|
-
{
|
608
|
-
|
609
|
-
}
|
610
|
-
break;
|
611
|
-
case "String":
|
612
|
-
{
|
613
|
-
try {
|
614
|
-
appState = StateCrypt.decryptState(appState, process.env['FBKEY']);
|
615
|
-
logger(Language.DecryptSuccess, '[ FCA-SUS ]');
|
616
|
-
} catch (e) {
|
617
|
-
if (process.env.Backup != undefined && process.env.Backup) {
|
618
|
-
backup(process.env.Backup);
|
619
|
-
} else switch (process.platform) {
|
620
|
-
case "win32":
|
621
|
-
{
|
622
|
-
try {
|
623
|
-
if (fs.existsSync('./backupappstate.json')) {
|
624
|
-
let content = fs.readFileSync('./backupappstate.json', 'utf8');
|
625
|
-
return backup(content);
|
626
|
-
}
|
627
|
-
} catch (e) {
|
628
|
-
|
629
|
-
logger.Error();
|
630
|
-
process.exit(0);
|
631
|
-
}
|
632
|
-
}
|
633
|
-
break;
|
634
|
-
case "linux":
|
635
|
-
{
|
636
|
-
if (process.env["REPL_ID"] == undefined) {
|
637
|
-
try {
|
638
|
-
if (fs.existsSync('./backupappstate.json')) {
|
639
|
-
let content = fs.readFileSync('./backupappstate.json', 'utf8');
|
640
|
-
return backup(content);
|
641
|
-
}
|
642
|
-
} catch (e) {
|
643
|
-
//logger(Language.ErrBackup, '[ FCA-SUS ]');
|
644
|
-
logger.Error();
|
645
|
-
process.exit(0);
|
646
|
-
}
|
647
|
-
} else {
|
648
|
-
try {
|
649
|
-
const client = new Client();
|
650
|
-
let key = await client.get("Backup");
|
651
|
-
if (key) {
|
652
|
-
return backup(JSON.stringify(key));
|
653
|
-
} else {
|
654
|
-
logger(Language.ErrBackup, '[ FCA-SUS ]');
|
655
|
-
}
|
656
|
-
} catch (e) {
|
657
|
-
logger(Language.ErrBackup, '[ FCA-SUS ]');
|
658
|
-
}
|
659
|
-
}
|
660
|
-
}
|
661
|
-
break;
|
662
|
-
case "android":
|
663
|
-
{
|
664
|
-
try {
|
665
|
-
if (fs.existsSync('./backupappstate.json')) {
|
666
|
-
let content = fs.readFileSync('./backupappstate.json', 'utf8');
|
667
|
-
return backup(content);
|
668
|
-
}
|
669
|
-
} catch (e) {
|
670
|
-
logger(Language.ErrBackup, '[ FCA-SUS ]');
|
671
|
-
logger.Error();
|
672
|
-
process.exit(0);
|
673
|
-
}
|
674
|
-
}
|
675
|
-
}
|
676
|
-
logger(Language.DecryptFailed, '[ FCA-SUS ]');
|
677
|
-
return logger.Error();
|
678
|
-
}
|
679
|
-
logger(getText.gettext(Language.YourAppStatePass, process.env.FBKEY), '[ FCA-SUS ]');
|
680
|
-
}
|
681
|
-
break;
|
682
|
-
default:
|
683
|
-
{
|
684
|
-
logger(Language.InvaildAppState, "[ FCA-SUS ]");
|
685
|
-
process.exit(0)
|
686
|
-
}
|
687
|
-
}
|
688
|
-
}
|
689
|
-
break;
|
690
|
-
case false:
|
691
|
-
{
|
692
|
-
switch (utils.getType(appState)) {
|
693
|
-
case "Array":
|
694
|
-
{
|
695
|
-
logger(Language.EncryptStateOff, "[ FCA-SUS ]");
|
696
|
-
}
|
697
|
-
break;
|
698
|
-
case "String":
|
699
|
-
{
|
700
|
-
logger(Language.EncryptStateOff, "[ FCA-SUS ]");
|
701
|
-
try {
|
702
|
-
appState = StateCrypt.decryptState(appState, process.env['FBKEY']);
|
703
|
-
logger(Language.DecryptSuccess, '[ FCA-SUS ]');
|
704
|
-
} catch (e) {
|
705
|
-
if (process.env.Backup != undefined && process.env.Backup) {
|
706
|
-
backup(process.env.Backup);
|
707
|
-
} else switch (process.platform) {
|
708
|
-
case "win32":
|
709
|
-
{
|
710
|
-
try {
|
711
|
-
if (fs.existsSync('./backupappstate.json')) {
|
712
|
-
let content = fs.readFileSync('./backupappstate.json', 'utf8');
|
713
|
-
return backup(content);
|
714
|
-
}
|
715
|
-
} catch (e) {
|
716
|
-
logger(Language.ErrBackup, '[ FCA-SUS ]');
|
717
|
-
logger.Error();
|
718
|
-
process.exit(0);
|
719
|
-
}
|
720
|
-
}
|
721
|
-
break;
|
722
|
-
case "linux":
|
723
|
-
{
|
724
|
-
if (process.env["REPL_ID"] == undefined) {
|
725
|
-
try {
|
726
|
-
if (fs.existsSync('./backupappstate.json')) {
|
727
|
-
let content = fs.readFileSync('./backupappstate.json', 'utf8');
|
728
|
-
return backup(content);
|
729
|
-
}
|
730
|
-
} catch (e) {
|
731
|
-
logger(Language.ErrBackup, '[ FCA-SUS ]');
|
732
|
-
logger.Error();
|
733
|
-
process.exit(0);
|
734
|
-
}
|
735
|
-
} else {
|
736
|
-
try {
|
737
|
-
const client = new Client();
|
738
|
-
let key = await client.get("Backup");
|
739
|
-
if (key) {
|
740
|
-
return backup(JSON.stringify(key));
|
741
|
-
} else {
|
742
|
-
logger(Language.ErrBackup, '[ FCA-SUS ]');
|
743
|
-
}
|
744
|
-
} catch (e) {
|
745
|
-
logger(Language.ErrBackup, '[ FCA-SUS ]');
|
746
|
-
}
|
747
|
-
}
|
748
|
-
}
|
749
|
-
break;
|
750
|
-
case "android":
|
751
|
-
{
|
752
|
-
try {
|
753
|
-
if (fs.existsSync('./backupappstate.json')) {
|
754
|
-
let content = fs.readFileSync('./backupappstate.json', 'utf8');
|
755
|
-
return backup(content);
|
756
|
-
}
|
757
|
-
} catch (e) {
|
758
|
-
logger(Language.ErrBackup, '[ FCA-SUS ]');
|
759
|
-
logger.Error();
|
760
|
-
process.exit(0);
|
761
|
-
}
|
762
|
-
}
|
763
|
-
}
|
764
|
-
logger(Language.DecryptFailed, '[ FCA-SUS ]');
|
765
|
-
return logger.Error();
|
766
|
-
}
|
767
|
-
}
|
768
|
-
break;
|
769
|
-
default:
|
770
|
-
{
|
771
|
-
logger(Language.InvaildAppState, "[ FCA-SUS ]");
|
772
|
-
process.exit(0)
|
773
|
-
}
|
774
|
-
}
|
775
|
-
}
|
776
|
-
break;
|
777
|
-
default:
|
778
|
-
{
|
779
|
-
logger(getText.gettext(Language.IsNotABoolean, require("./alice/alicezetion.json").EncryptFeature), "[ FCA-SUS ]")
|
780
|
-
process.exit(0);
|
781
|
-
}
|
782
|
-
}
|
783
|
-
} catch (e) {
|
784
|
-
console.log(e);
|
785
|
-
}
|
786
|
-
|
787
|
-
try {
|
788
|
-
appState = JSON.parse(appState);
|
789
|
-
} catch (e) {
|
790
|
-
try {
|
791
|
-
appState = appState;
|
792
|
-
} catch (e) {
|
793
|
-
return logger.Error();
|
794
|
-
}
|
795
|
-
}
|
796
|
-
try {
|
797
|
-
appState.map(function(c) {
|
798
|
-
var str = c.key + "=" + c.value + "; expires=" + c.expires + "; domain=" + c.domain + "; path=" + c.path + ";";
|
799
|
-
jar.setCookie(str, "http://" + c.domain);
|
800
|
-
});
|
801
|
-
switch (process.platform) {
|
802
|
-
case "win32":
|
803
|
-
{
|
804
|
-
try {
|
805
|
-
fs.writeFileSync("./backupappstate.json", JSON.stringify(appState, null, "\t"));
|
806
|
-
process.env.Backup = JSON.stringify(appState, null, "\t");
|
807
|
-
} catch (e) {
|
808
|
-
logger(Language.BackupFailed, '[ FCA-SUS ]');
|
809
|
-
}
|
810
|
-
}
|
811
|
-
break;
|
812
|
-
case "linux":
|
813
|
-
{
|
814
|
-
if (process.env["REPL_ID"] == undefined) {
|
815
|
-
try {
|
816
|
-
fs.writeFileSync("./backupappstate.json", JSON.stringify(appState, null, "\t"));
|
817
|
-
process.env.Backup = JSON.stringify(appState, null, "\t");
|
818
|
-
} catch (e) {
|
819
|
-
logger(Language.BackupFailed, '[ FCA-SUS ]');
|
820
|
-
}
|
821
|
-
} else {
|
822
|
-
try {
|
823
|
-
if (fs.existsSync('./backupappstate.json')) {
|
824
|
-
fs.unlinkSync('./backupappstate.json');
|
825
|
-
}
|
826
|
-
const client = new Client();
|
827
|
-
await client.set("Backup", appState);
|
828
|
-
process.env.Backup = JSON.stringify(appState, null, "\t");
|
829
|
-
} catch (e) {
|
830
|
-
logger(Language.BackupFailed, '[ FCA-SUS ]');
|
831
|
-
}
|
832
|
-
}
|
833
|
-
}
|
834
|
-
break;
|
835
|
-
case "android":
|
836
|
-
{
|
837
|
-
try {
|
838
|
-
fs.writeFileSync("./backupappstate.json", JSON.stringify(appState, null, "\t"));
|
839
|
-
process.env.Backup = JSON.stringify(appState, null, "\t");
|
840
|
-
} catch (e) {
|
841
|
-
logger(Language.BackupFailed, '[ FCA-SUS ]');
|
842
|
-
}
|
843
|
-
}
|
844
|
-
}
|
845
|
-
|
846
|
-
mainPromise = utils.get('https://www.facebook.com/', jar, null, globalOptions, { noRef: true }).then(utils.saveCookies(jar));
|
847
|
-
} catch (e) {
|
848
|
-
|
849
|
-
if (process.env.Backup != undefined && process.env.Backup) {
|
850
|
-
return backup(process.env.Backup);
|
851
|
-
}
|
852
|
-
switch (process.platform) {
|
853
|
-
case "win32":
|
854
|
-
{
|
855
|
-
try {
|
856
|
-
if (fs.existsSync('./backupappstate.json')) {
|
857
|
-
let content = fs.readFileSync('./backupappstate.json', 'utf8');
|
858
|
-
return backup(content);
|
859
|
-
}
|
860
|
-
} catch (e) {
|
861
|
-
logger(Language.ErrBackup, '[ FCA-SUS ]');
|
862
|
-
logger.Error();
|
863
|
-
process.exit(0);
|
864
|
-
}
|
865
|
-
}
|
866
|
-
break;
|
867
|
-
case "linux":
|
868
|
-
{
|
869
|
-
if (process.env["REPL_ID"] == undefined) {
|
870
|
-
try {
|
871
|
-
if (fs.existsSync('./backupappstate.json')) {
|
872
|
-
let content = fs.readFileSync('./backupappstate.json', 'utf8');
|
873
|
-
return backup(content);
|
874
|
-
}
|
875
|
-
} catch (e) {
|
876
|
-
logger(Language.ErrBackup, '[ FCA-SUS ]');
|
877
|
-
logger.Error();
|
878
|
-
process.exit(0);
|
879
|
-
}
|
880
|
-
} else {
|
881
|
-
try {
|
882
|
-
const client = new Client();
|
883
|
-
let key = await client.get("Backup");
|
884
|
-
if (key) {
|
885
|
-
backup(JSON.stringify(key));
|
886
|
-
} else {
|
887
|
-
logger(Language.ErrBackup, '[ FCA-SUS ]');
|
888
|
-
}
|
889
|
-
} catch (e) {
|
890
|
-
logger(Language.ErrBackup, '[ FCA-SUS ]');
|
891
|
-
}
|
892
|
-
}
|
893
|
-
}
|
894
|
-
break;
|
895
|
-
case "android":
|
896
|
-
{
|
897
|
-
try {
|
898
|
-
if (fs.existsSync('./backupappstate.json')) {
|
899
|
-
let content = fs.readFileSync('./backupappstate.json', 'utf8');
|
900
|
-
return backup(content);
|
901
|
-
}
|
902
|
-
} catch (e) {
|
903
|
-
logger(Language.ErrBackup, '[ FCA-SUS ]');
|
904
|
-
logger.Error();
|
905
|
-
process.exit(0);
|
906
|
-
}
|
907
|
-
}
|
908
|
-
break;
|
909
|
-
}
|
426
|
+
if (appState) {
|
427
|
+
appState.map(function(c) {
|
428
|
+
var str = c.key + "=" + c.value + "; expires=" + c.expires + "; domain=" + c.domain + "; path=" + c.path + ";";
|
429
|
+
jar.setCookie(str, "http://" + c.domain);
|
430
|
+
});
|
910
431
|
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
.then(
|
922
|
-
|
923
|
-
});
|
924
|
-
}
|
925
|
-
} catch (e) {
|
926
|
-
console.log(e);
|
432
|
+
// Load the main page.
|
433
|
+
mainPromise = utils.get('https://www.facebook.com/', jar, null, globalOptions, { noRef: true }).then(utils.saveCookies(jar));
|
434
|
+
} else {
|
435
|
+
// Open the main page, then we login with the given credentials and finally
|
436
|
+
// load the main page again (it'll give us some IDs that we need)
|
437
|
+
mainPromise = utils
|
438
|
+
.get("https://www.facebook.com/", null, null, globalOptions, { noRef: true })
|
439
|
+
.then(utils.saveCookies(jar))
|
440
|
+
.then(makeLogin(jar, email, password, globalOptions, callback, prCallback))
|
441
|
+
.then(function() {
|
442
|
+
return utils.get('https://www.facebook.com/', jar, null, globalOptions).then(utils.saveCookies(jar));
|
443
|
+
});
|
927
444
|
}
|
445
|
+
|
928
446
|
var ctx = null;
|
929
447
|
var _defaultFuncs = null;
|
930
448
|
var api = null;
|
@@ -937,14 +455,15 @@ async function loginHelper(appState, email, password, globalOptions, callback, p
|
|
937
455
|
if (redirect && redirect[1]) return utils.get(redirect[1], jar, null, globalOptions).then(utils.saveCookies(jar));
|
938
456
|
return res;
|
939
457
|
})
|
940
|
-
.then(
|
458
|
+
.then(function(res) {
|
941
459
|
var html = res.body;
|
942
|
-
var stuff =
|
460
|
+
var stuff = buildAPI(globalOptions, html, jar);
|
943
461
|
ctx = stuff[0];
|
944
462
|
_defaultFuncs = stuff[1];
|
945
463
|
api = stuff[2];
|
946
464
|
return res;
|
947
465
|
});
|
466
|
+
|
948
467
|
// given a pageID we log in as a page
|
949
468
|
if (globalOptions.pageID) {
|
950
469
|
mainPromise = mainPromise
|
@@ -961,60 +480,16 @@ async function loginHelper(appState, email, password, globalOptions, callback, p
|
|
961
480
|
// At the end we call the callback or catch an exception
|
962
481
|
mainPromise
|
963
482
|
.then(function() {
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
var { readFileSync } = require('fs-extra');
|
969
|
-
const { execSync } = require('child_process');
|
970
|
-
Fetch('https://raw.githubusercontent.com/amogusdevlol/node-ainzfb/main/package.json').then(async(res) => {
|
971
|
-
const localbrand = JSON.parse(readFileSync('./node_modules/node-ainzfb-new/package.json')).version;
|
972
|
-
if (Number(localbrand.replace(/\./g, "")) < Number(JSON.parse(res.body.toString()).version.replace(/\./g, ""))) {
|
973
|
-
// log.warn("[ FCA-SUS ] •", getText.gettext(Language.NewVersionFound, JSON.parse(readFileSync('./node_modules/node-ainzfb/package.json')).version, JSON.parse(res.body.toString()).version));
|
974
|
-
log.warn("[ FCA-SUS ] •", Language.AutoUpdate);
|
975
|
-
try {
|
976
|
-
execSync('npm install node-ainzfb-new@latest', { stdio: 'inherit' });
|
977
|
-
logger(Language.UpdateSuccess, "[ FCA-SUS ]")
|
978
|
-
logger(Language.RestartAfterUpdate, '[ FCA-SUS ]');
|
979
|
-
await new Promise(resolve => setTimeout(resolve, 5 * 1000));
|
980
|
-
console.clear();
|
981
|
-
process.exit(1);
|
982
|
-
} catch (err) {
|
983
|
-
log.warn('Error Update: ' + err);
|
984
|
-
logger(Language.UpdateFailed, "[ FCA-SUS ]");
|
985
|
-
try {
|
986
|
-
require.resolve('sus-support');
|
987
|
-
} catch (e) {
|
988
|
-
logger(Language.InstallSupportTool, "[ FCA-SUS ]");
|
989
|
-
execSync('npm install git+https://github.com/amogusdevlol/sus-support.git', { stdio: 'inherit' });
|
990
|
-
process.exit(1);
|
991
|
-
}
|
992
|
-
var fcasp = require('sus-support');
|
993
|
-
try {
|
994
|
-
fcasp.onError()
|
995
|
-
} catch (e) {
|
996
|
-
//logger(Language.NotiAfterUseToolFail, "[ Fca - Helper ]")
|
997
|
-
//logger("rmdir ./node_modules then enter npm i && npm start", "[ Fca - Helper ]");
|
998
|
-
process.exit(0);
|
999
|
-
}
|
1000
|
-
|
1001
|
-
}
|
1002
|
-
} else {
|
1003
|
-
/*logger(getText.gettext(Language.LocalVersion, localbrand), "[ FCA-SUS ]");
|
1004
|
-
logger(Language.WishMessage[Math.floor(Math.random() * Language.WishMessage.length)], "[ FCA-SUS ]");*/
|
1005
|
-
require('./Extra/ExtraUptimeRobot')()
|
1006
|
-
await new Promise(resolve => setTimeout(resolve, 5 * 1000));
|
1007
|
-
callback(null, api);
|
1008
|
-
}
|
1009
|
-
});
|
1010
|
-
}).catch(function(e) {
|
483
|
+
//log.info("login", 'Done logging in.');
|
484
|
+
return callback(null, api);
|
485
|
+
})
|
486
|
+
.catch(function(e) {
|
1011
487
|
log.error("login", e.error || e);
|
1012
488
|
callback(e);
|
1013
489
|
});
|
1014
|
-
//!---------- Auto Check, Update END -----------------!//
|
1015
490
|
}
|
1016
491
|
|
1017
|
-
function
|
492
|
+
function login(loginData, options, callback) {
|
1018
493
|
if (utils.getType(options) === 'Function' || utils.getType(options) === 'AsyncFunction') {
|
1019
494
|
callback = options;
|
1020
495
|
options = {};
|
@@ -1027,17 +502,14 @@ function alice(loginData, options, callback) {
|
|
1027
502
|
updatePresence: false,
|
1028
503
|
forceLogin: false,
|
1029
504
|
autoMarkDelivery: false,
|
1030
|
-
autoMarkRead:
|
505
|
+
autoMarkRead: true,
|
1031
506
|
autoReconnect: true,
|
1032
|
-
logRecordSize:
|
507
|
+
logRecordSize: defaultLogRecordSize,
|
1033
508
|
online: false,
|
1034
509
|
emitReady: false,
|
1035
|
-
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X
|
510
|
+
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/600.3.18 (KHTML, like Gecko) Version/8.0.3 Safari/600.3.18"
|
1036
511
|
};
|
1037
512
|
|
1038
|
-
//! bằng 1 cách nào đó tắt online sẽ đánh lừa được facebook :v
|
1039
|
-
//! phải có that có this chứ :v
|
1040
|
-
|
1041
513
|
setOptions(globalOptions, options);
|
1042
514
|
|
1043
515
|
var prCallback = null;
|
@@ -1058,11 +530,4 @@ function alice(loginData, options, callback) {
|
|
1058
530
|
return returnPromise;
|
1059
531
|
}
|
1060
532
|
|
1061
|
-
module.exports =
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
533
|
+
module.exports = login;
|