node-ainzfb 0.0.1-security → 1.3.3-beta

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of node-ainzfb might be problematic. Click here for more details.

Files changed (76) hide show
  1. package/.gitattributes +2 -0
  2. package/.github/dependabot.yml +11 -0
  3. package/.github/workflows/nodejs.yml +26 -0
  4. package/.github/workflows/npmpublish.yml +30 -0
  5. package/CHANGELOG.md +2 -0
  6. package/DOCS.md +1738 -0
  7. package/Extra/Database/index.js +399 -0
  8. package/Extra/Database/methods.js +286 -0
  9. package/Extra/ExtraAddons.js +213 -0
  10. package/Extra/ExtraGetThread.js +1 -0
  11. package/Extra/ExtraUptimeRobot.js +59 -0
  12. package/Extra/PM2/ecosystem.config.js +23 -0
  13. package/Extra/Src/Last-Run.js +48 -0
  14. package/LICENSE-MIT +21 -0
  15. package/Language/index.json +151 -0
  16. package/README.md +225 -3
  17. package/StateCrypt.js +22 -0
  18. package/broadcast.js +42 -0
  19. package/index-backup.js +1079 -0
  20. package/index.js +1083 -0
  21. package/logger.js +21 -0
  22. package/package.json +87 -3
  23. package/src/addExternalModule.js +16 -0
  24. package/src/addUserToGroup.js +78 -0
  25. package/src/changeAdminStatus.js +79 -0
  26. package/src/changeArchivedStatus.js +41 -0
  27. package/src/changeBio.js +65 -0
  28. package/src/changeBlockedStatus.js +36 -0
  29. package/src/changeGroupImage.js +106 -0
  30. package/src/changeNickname.js +45 -0
  31. package/src/changeThreadColor.js +62 -0
  32. package/src/changeThreadEmoji.js +42 -0
  33. package/src/createNewGroup.js +70 -0
  34. package/src/createPoll.js +60 -0
  35. package/src/deleteMessage.js +45 -0
  36. package/src/deleteThread.js +43 -0
  37. package/src/forwardAttachment.js +48 -0
  38. package/src/getAccessToken.js +31 -0
  39. package/src/getCurrentUserID.js +7 -0
  40. package/src/getEmojiUrl.js +27 -0
  41. package/src/getFriendsList.js +73 -0
  42. package/src/getMessage.js +80 -0
  43. package/src/getThreadHistory.js +537 -0
  44. package/src/getThreadHistoryDeprecated.js +71 -0
  45. package/src/getThreadInfo.js +197 -0
  46. package/src/getThreadInfoDeprecated.js +56 -0
  47. package/src/getThreadList.js +213 -0
  48. package/src/getThreadListDeprecated.js +46 -0
  49. package/src/getThreadPictures.js +59 -0
  50. package/src/getUserID.js +62 -0
  51. package/src/getUserInfo.js +65 -0
  52. package/src/getUserInfoV2.js +35 -0
  53. package/src/handleFriendRequest.js +46 -0
  54. package/src/handleMessageRequest.js +49 -0
  55. package/src/httpGet.js +49 -0
  56. package/src/httpPost.js +48 -0
  57. package/src/httpPostFormData.js +41 -0
  58. package/src/listenMqtt.js +633 -0
  59. package/src/logout.js +68 -0
  60. package/src/markAsDelivered.js +48 -0
  61. package/src/markAsRead.js +70 -0
  62. package/src/markAsReadAll.js +43 -0
  63. package/src/markAsSeen.js +51 -0
  64. package/src/muteThread.js +47 -0
  65. package/src/removeUserFromGroup.js +49 -0
  66. package/src/resolvePhotoUrl.js +37 -0
  67. package/src/searchForThread.js +43 -0
  68. package/src/sendMessage.js +342 -0
  69. package/src/sendTypingIndicator.js +80 -0
  70. package/src/setMessageReaction.js +109 -0
  71. package/src/setPostReaction.js +102 -0
  72. package/src/setTitle.js +74 -0
  73. package/src/threadColors.js +39 -0
  74. package/src/unfriend.js +43 -0
  75. package/src/unsendMessage.js +40 -0
  76. package/utils.js +1240 -0
package/index.js ADDED
@@ -0,0 +1,1083 @@
1
+ 'use strict';
2
+
3
+ /!-[ Max Cpu Speed ]-!/
4
+
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
+
13
+ /!-[ Require All Package Need Use ]-!/
14
+
15
+ var utils = require("./utils"),
16
+ cheerio = require("cheerio"),
17
+ log = require("npmlog"),
18
+ { getAccessToken } = require('./Extra/ExtraAddons'),
19
+ logger = require('./logger'),
20
+ fs = require('fs-extra'),
21
+ getText = require('gettext.js')(),
22
+ logger = require('./logger'),
23
+ Fetch = require('got'),
24
+ fs = require('fs-extra'),
25
+ StateCrypt = require('./StateCrypt'),
26
+ Client = require("@replit/database"),
27
+ languageFile = require('./Language/index.json'),
28
+ ObjFastConfig = {
29
+ "Language": "en",
30
+ "MainColor": "#9900FF",
31
+ "BroadCast": true,
32
+ "EncryptFeature": true,
33
+ "PreKey": ""
34
+ };
35
+
36
+
37
+ /!-[ Check File To Run Process ]-!/
38
+
39
+ try {
40
+ if (!fs.existsSync('./FastConfigFca.json')) {
41
+ fs.writeFileSync("./FastConfigFca.json", JSON.stringify(ObjFastConfig, null, "\t"));
42
+ process.exit(1);
43
+ } else if (fs.existsSync('./FastConfigFca.json')) {
44
+ try {
45
+ var DataLanguageSetting = require("../../FastConfigFca.json");
46
+ } catch (e) {
47
+ logger("Invalid Config Settings, Restoring Default...");
48
+ fs.writeFileSync("./FastConfigFca.json", JSON.stringify(ObjFastConfig, null, "\t"));
49
+ process.exit(1);
50
+ }
51
+ try {
52
+ if (DataLanguageSetting && !DataLanguageSetting.PreKey) {
53
+ DataLanguageSetting.PreKey = "";
54
+ fs.writeFileSync("./FastConfigFca.json", JSON.stringify(DataLanguageSetting, null, "\t"));
55
+ }
56
+ } catch (e) {
57
+ console.log(e);
58
+ }
59
+ if (!languageFile.some(i => i.Language == DataLanguageSetting.Language)) {
60
+ logger("Not Support Language: " + DataLanguageSetting.Language + " Only 'en' and 'vi'", "[ FCA-SUS ]");
61
+ process.exit(0);
62
+ }
63
+ var Language = languageFile.find(i => i.Language == DataLanguageSetting.Language).Folder.Index;
64
+ } else process.exit(1);
65
+ if (utils.getType(DataLanguageSetting.BroadCast) != "Boolean" && DataLanguageSetting.BroadCast != undefined) {
66
+ log.warn("FastConfig-BroadCast", getText.gettext(Language.IsNotABoolean, DataLanguageSetting.BroadCast));
67
+ process.exit(0)
68
+ } else if (DataLanguageSetting.BroadCast == undefined) {
69
+ fs.writeFileSync("./FastConfigFca.json", JSON.stringify(ObjFastConfig, null, "\t"));
70
+ process.exit(1);
71
+ }
72
+
73
+ globalThis.Fca.Require.FastConfig = DataLanguageSetting;
74
+
75
+ } catch (e) {
76
+ console.log(e);
77
+ logger.Error();
78
+ }
79
+
80
+ /!-[ Set Variable For Process ]-!/
81
+
82
+ log.maxRecordSize = 100;
83
+ var checkVerified = null;
84
+
85
+ /!-[ Function setOptions ]-!/
86
+
87
+ function setOptions(globalOptions, options) {
88
+ Object.keys(options).map(function(key) {
89
+ switch (key) {
90
+ case 'pauseLog':
91
+ if (options.pauseLog) log.pause();
92
+ break;
93
+ case 'online':
94
+ globalOptions.online = Boolean(options.online);
95
+ break;
96
+ case 'logLevel':
97
+ log.level = options.logLevel;
98
+ globalOptions.logLevel = options.logLevel;
99
+ break;
100
+ case 'logRecordSize':
101
+ log.maxRecordSize = options.logRecordSize;
102
+ globalOptions.logRecordSize = options.logRecordSize;
103
+ break;
104
+ case 'selfListen':
105
+ globalOptions.selfListen = Boolean(options.selfListen);
106
+ break;
107
+ case 'listenEvents':
108
+ globalOptions.listenEvents = Boolean(options.listenEvents);
109
+ break;
110
+ case 'pageID':
111
+ globalOptions.pageID = options.pageID.toString();
112
+ break;
113
+ case 'updatePresence':
114
+ globalOptions.updatePresence = Boolean(options.updatePresence);
115
+ break;
116
+ case 'forceLogin':
117
+ globalOptions.forceLogin = Boolean(options.forceLogin);
118
+ break;
119
+ case 'userAgent':
120
+ globalOptions.userAgent = options.userAgent;
121
+ break;
122
+ case 'autoMarkDelivery':
123
+ globalOptions.autoMarkDelivery = Boolean(options.autoMarkDelivery);
124
+ break;
125
+ case 'autoMarkRead':
126
+ globalOptions.autoMarkRead = Boolean(options.autoMarkRead);
127
+ break;
128
+ case 'listenTyping':
129
+ globalOptions.listenTyping = Boolean(options.listenTyping);
130
+ break;
131
+ case 'proxy':
132
+ if (typeof options.proxy != "string") {
133
+ delete globalOptions.proxy;
134
+ utils.setProxy();
135
+ } else {
136
+ globalOptions.proxy = options.proxy;
137
+ utils.setProxy(globalOptions.proxy);
138
+ }
139
+ break;
140
+ case 'autoReconnect':
141
+ globalOptions.autoReconnect = Boolean(options.autoReconnect);
142
+ break;
143
+ case 'emitReady':
144
+ globalOptions.emitReady = Boolean(options.emitReady);
145
+ break;
146
+ default:
147
+ log.warn("setOptions", "Unrecognized option given to setOptions: " + key);
148
+ break;
149
+ }
150
+ });
151
+ }
152
+
153
+ /!-[ Function BuildAPI ]-!/
154
+
155
+ async function buildAPI(globalOptions, html, jar) {
156
+ var maybeCookie = jar.getCookies("https://www.facebook.com").filter(function(val) { return val.cookieString().split("=")[0] === "c_user"; });
157
+
158
+ if (maybeCookie.length === 0) throw { error: Language.ErrAppState };
159
+
160
+ if (html.indexOf("/checkpoint/block/?next") > -1) log.warn("login", Language.CheckPointLevelI);
161
+
162
+ var userID = maybeCookie[0].cookieString().split("=")[1].toString();
163
+ logger(getText.gettext(Language.UID, userID), "[ FCA-SUS ]");
164
+ process.env['UID'] = userID;
165
+
166
+ try {
167
+ clearInterval(checkVerified);
168
+ } catch (e) {
169
+ console.log(e);
170
+ }
171
+
172
+ var clientID = (Math.random() * 2147483648 | 0).toString(16);
173
+
174
+ let oldFBMQTTMatch = html.match(/irisSeqID:"(.+?)",appID:219994525426954,endpoint:"(.+?)"/);
175
+ let mqttEndpoint = null;
176
+ let region = null;
177
+ let irisSeqID = null;
178
+ var noMqttData = null;
179
+
180
+ if (oldFBMQTTMatch) {
181
+ irisSeqID = oldFBMQTTMatch[1];
182
+ mqttEndpoint = oldFBMQTTMatch[2];
183
+ region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
184
+ logger(getText.gettext(Language.Area, region), "[ FCA-SUS ]");
185
+ } else {
186
+ let newFBMQTTMatch = html.match(/{"app_id":"219994525426954","endpoint":"(.+?)","iris_seq_id":"(.+?)"}/);
187
+ if (newFBMQTTMatch) {
188
+ irisSeqID = newFBMQTTMatch[2];
189
+ mqttEndpoint = newFBMQTTMatch[1].replace(/\\\//g, "/");
190
+ region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
191
+ logger(getText.gettext(Language.Area, region), "[ FCA-SUS ]");
192
+ } else {
193
+ let legacyFBMQTTMatch = html.match(/(\["MqttWebConfig",\[\],{fbid:")(.+?)(",appID:219994525426954,endpoint:")(.+?)(",pollingEndpoint:")(.+?)(3790])/);
194
+ if (legacyFBMQTTMatch) {
195
+ mqttEndpoint = legacyFBMQTTMatch[4];
196
+ region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
197
+ log.warn("login", `Cannot get sequence ID with new RegExp. Fallback to old RegExp (without seqID)...`);
198
+ logger(getText.gettext(Language.Area, region), "[ FCA-SUS ]");
199
+ logger("login", `[Unused] Polling endpoint: ${legacyFBMQTTMatch[6]}`);
200
+ } else {
201
+ log.warn("login", getText.gettext(Language.NoAreaData));
202
+ noMqttData = html;
203
+ }
204
+ }
205
+ }
206
+
207
+ var ctx = {
208
+ userID: userID,
209
+ jar: jar,
210
+ clientID: clientID,
211
+ globalOptions: globalOptions,
212
+ loggedIn: true,
213
+ access_token: await getAccessToken(),
214
+ clientMutationId: 0,
215
+ mqttClient: undefined,
216
+ lastSeqId: irisSeqID,
217
+ syncToken: undefined,
218
+ mqttEndpoint,
219
+ region,
220
+ firstListen: true
221
+ };
222
+
223
+ var api = {
224
+ setOptions: setOptions.bind(null, globalOptions),
225
+ getAppState: function getAppState() {
226
+ return utils.getAppState(jar);
227
+ }
228
+ };
229
+
230
+ if (noMqttData) api["htmlData"] = noMqttData;
231
+
232
+ const apiFuncNames = fs.readdirSync(__dirname + "/src").filter((File) => File.endsWith(".js") && !File.includes('Dev'));
233
+
234
+ var defaultFuncs = utils.makeDefaults(html, userID, ctx);
235
+
236
+ // Load all api functions in a loop
237
+ apiFuncNames.map(v => api[v.replace(".js", "")] = require('./src/' + v)(defaultFuncs, api, ctx));
238
+ return [ctx, defaultFuncs, api];
239
+ }
240
+
241
+ function makeLogin(jar, email, password, loginOptions, callback, prCallback) {
242
+ return function(res) {
243
+ var html = res.body;
244
+ var $ = cheerio.load(html);
245
+ var arr = [];
246
+
247
+ // This will be empty, but just to be sure we leave it
248
+ $("#login_form input").map((i, v) => arr.push({ val: $(v).val(), name: $(v).attr("name") }));
249
+
250
+ arr = arr.filter(function(v) {
251
+ return v.val && v.val.length;
252
+ });
253
+
254
+ var form = utils.arrToForm(arr);
255
+ form.lsd = utils.getFrom(html, "[\"LSD\",[],{\"token\":\"", "\"}");
256
+ form.lgndim = Buffer.from("{\"w\":1440,\"h\":900,\"aw\":1440,\"ah\":834,\"c\":24}").toString('base64');
257
+ form.email = email;
258
+ form.pass = password;
259
+ form.default_persistent = '0';
260
+ form.lgnrnd = utils.getFrom(html, "name=\"lgnrnd\" value=\"", "\"");
261
+ form.locale = 'en_US';
262
+ form.timezone = '240';
263
+ form.lgnjs = ~~(Date.now() / 1000);
264
+
265
+
266
+ // Getting cookies from the HTML page... (kill me now plz)
267
+ // we used to get a bunch of cookies in the headers of the response of the
268
+ // request, but FB changed and they now send those cookies inside the JS.
269
+ // They run the JS which then injects the cookies in the page.
270
+ // The "solution" is to parse through the html and find those cookies
271
+ // which happen to be conveniently indicated with a _js_ in front of their
272
+ // variable name.
273
+ //
274
+ // ---------- Very Hacky Part Starts -----------------
275
+ var willBeCookies = html.split("\"_js_");
276
+ willBeCookies.slice(1).map(function(val) {
277
+ var cookieData = JSON.parse("[\"" + utils.getFrom(val, "", "]") + "]");
278
+ jar.setCookie(utils.formatCookie(cookieData, "facebook"), "https://www.facebook.com");
279
+ });
280
+ // ---------- Very Hacky Part Ends -----------------
281
+
282
+ logger(Language.OnLogin, "[ FCA-SUS ]");
283
+ return utils
284
+ .post("https://www.facebook.com/login/device-based/regular/login/?login_attempt=1&lwv=110", jar, form, loginOptions)
285
+ .then(utils.saveCookies(jar))
286
+ .then(function(res) {
287
+ var headers = res.headers;
288
+ if (!headers.location) throw { error: Language.InvaildAccount };
289
+
290
+ // This means the account has login approvals turned on.
291
+ if (headers.location.indexOf('https://www.facebook.com/checkpoint/') > -1) {
292
+ logger(Language.TwoAuth, "[ FCA-SUS ]");
293
+ var nextURL = 'https://www.facebook.com/checkpoint/?next=https%3A%2F%2Fwww.facebook.com%2Fhome.php';
294
+
295
+ return utils
296
+ .get(headers.location, jar, null, loginOptions)
297
+ .then(utils.saveCookies(jar))
298
+ .then(function(res) {
299
+ var html = res.body;
300
+ // Make the form in advance which will contain the fb_dtsg and nh
301
+ var $ = cheerio.load(html);
302
+ var arr = [];
303
+ $("form input").map((i, v) => arr.push({ val: $(v).val(), name: $(v).attr("name") }));
304
+
305
+ arr = arr.filter(function(v) {
306
+ return v.val && v.val.length;
307
+ });
308
+
309
+ var form = utils.arrToForm(arr);
310
+ if (html.indexOf("checkpoint/?next") > -1) {
311
+ setTimeout(() => {
312
+ checkVerified = setInterval((_form) => {}, 5000, {
313
+ fb_dtsg: form.fb_dtsg,
314
+ jazoest: form.jazoest,
315
+ dpr: 1
316
+ });
317
+ }, 2500);
318
+ throw {
319
+ error: 'login-approval',
320
+ continue: function submit2FA(code) {
321
+ form.approvals_code = code;
322
+ form['submit[Continue]'] = $("#checkpointSubmitButton").html(); //'Continue';
323
+ var prResolve = null;
324
+ var prReject = null;
325
+ var rtPromise = new Promise(function(resolve, reject) {
326
+ prResolve = resolve;
327
+ prReject = reject;
328
+ });
329
+ if (typeof code == "string") {
330
+ utils
331
+ .post(nextURL, jar, form, loginOptions)
332
+ .then(utils.saveCookies(jar))
333
+ .then(function(res) {
334
+ var $ = cheerio.load(res.body);
335
+ var error = $("#approvals_code").parent().attr("data-xui-error");
336
+ if (error) {
337
+ throw {
338
+ error: 'login-approval',
339
+ errordesc: Language.InvaildTwoAuthCode,
340
+ lerror: error,
341
+ continue: submit2FA
342
+ };
343
+ }
344
+ })
345
+ .then(function() {
346
+ // Use the same form (safe I hope)
347
+ delete form.no_fido;
348
+ delete form.approvals_code;
349
+ form.name_action_selected = 'save_device'; //'save_device' || 'dont_save;
350
+
351
+ return utils.post(nextURL, jar, form, loginOptions).then(utils.saveCookies(jar));
352
+ })
353
+ .then(function(res) {
354
+ var headers = res.headers;
355
+ if (!headers.location && res.body.indexOf('Review Recent Login') > -1) throw { error: Language.ApprovalsErr };
356
+
357
+ var appState = utils.getAppState(jar);
358
+
359
+ if (callback === prCallback) {
360
+ callback = function(err, api) {
361
+ if (err) return prReject(err);
362
+ return prResolve(api);
363
+ };
364
+ }
365
+
366
+ // Simply call loginHelper because all it needs is the jar
367
+ // and will then complete the login process
368
+ return loginHelper(appState, email, password, loginOptions, callback);
369
+ })
370
+ .catch(function(err) {
371
+ // Check if using Promise instead of callback
372
+ if (callback === prCallback) prReject(err);
373
+ else callback(err);
374
+ });
375
+ } else {
376
+ utils
377
+ .post("https://www.facebook.com/checkpoint/?next=https%3A%2F%2Fwww.facebook.com%2Fhome.php", jar, form, loginOptions, null, { "Referer": "https://www.facebook.com/checkpoint/?next" })
378
+ .then(utils.saveCookies(jar))
379
+ .then(res => {
380
+ try {
381
+ JSON.parse(res.body.replace(/for\s*\(\s*;\s*;\s*\)\s*;\s*/, ""));
382
+ } catch (ex) {
383
+ clearInterval(checkVerified);
384
+ logger(Language.VerifiedCheck, "[ FCA-SUS ]");
385
+ if (callback === prCallback) {
386
+ callback = function(err, api) {
387
+ if (err) return prReject(err);
388
+ return prResolve(api);
389
+ };
390
+ }
391
+ return loginHelper(utils.getAppState(jar), email, password, loginOptions, callback);
392
+ }
393
+ })
394
+ .catch(ex => {
395
+ log.error("login", ex);
396
+ if (callback === prCallback) prReject(ex);
397
+ else callback(ex);
398
+ });
399
+ }
400
+ return rtPromise;
401
+ }
402
+ };
403
+ } else {
404
+ if (!loginOptions.forceLogin) throw { error: Language.ForceLoginNotEnable };
405
+
406
+ if (html.indexOf("Suspicious Login Attempt") > -1) form['submit[This was me]'] = "This was me";
407
+ else form['submit[This Is Okay]'] = "This Is Okay";
408
+
409
+ return utils
410
+ .post(nextURL, jar, form, loginOptions)
411
+ .then(utils.saveCookies(jar))
412
+ .then(function() {
413
+ // Use the same form (safe I hope)
414
+ form.name_action_selected = 'save_device';
415
+
416
+ return utils.post(nextURL, jar, form, loginOptions).then(utils.saveCookies(jar));
417
+ })
418
+ .then(function(res) {
419
+ var headers = res.headers;
420
+
421
+ if (!headers.location && res.body.indexOf('Review Recent Login') > -1) throw { error: "Something went wrong with review recent login." };
422
+
423
+ var appState = utils.getAppState(jar);
424
+
425
+ // Simply call loginHelper because all it needs is the jar
426
+ // and will then complete the login process
427
+ return loginHelper(appState, email, password, loginOptions, callback);
428
+ })
429
+ .catch(e => callback(e));
430
+ }
431
+ });
432
+ }
433
+
434
+ return utils.get('https://www.facebook.com/', jar, null, loginOptions).then(utils.saveCookies(jar));
435
+ });
436
+ };
437
+ }
438
+
439
+ function makeid(length) {
440
+ var result = '';
441
+ var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
442
+ var charactersLength = characters.length;
443
+ for (var i = 0; i < length; i++) {
444
+ result += characters.charAt(Math.floor(Math.random() * charactersLength));
445
+ }
446
+ return result;
447
+ }
448
+
449
+
450
+ // Helps the login
451
+ async function loginHelper(appState, email, password, globalOptions, callback, prCallback) {
452
+ var mainPromise = null;
453
+ var jar = utils.getJar();
454
+
455
+ // If we're given an appState we loop through it and save each cookie
456
+ // back into the jar.
457
+ try {
458
+ if (appState) {
459
+ //const readline = require("readline");
460
+ //const chalk = require("chalk");
461
+ //const figlet = require("figlet");
462
+ //const os = require("os");
463
+ //const { execSync } = require('child_process');
464
+ // let rl = readline.createInterface({
465
+ // input: process.stdin,
466
+ // output: process.stdout,
467
+ // prompt: chalk.hex('#00CCCC').bold('[FCA-SUS] • ')
468
+ // });
469
+ // let type = {
470
+ // 1: {
471
+ // "name": "Tạo Mật Khẩu Cho Appstate",
472
+ // onRun: async function() {
473
+ // try {
474
+ // rl.question("Hãy Nhập Mật Khẩu Bạn Muốn Đặt Cho Appstate !", (answer) => {
475
+ // console.log("Được Rồi Mật Khẩu Của Bạn Là: " + answer + ", Bạn Hãy Nhớ Kĩ Nhé !");
476
+ // process.env["FBKEY"] = answer;
477
+ // fs.writeFile('../.env', `FBKEY=${answer}`, function (err) {
478
+ // if (err) {
479
+ // submiterr(err)
480
+ // logger("Tạo File ENV Thất Bại !", "[ FCA-SUS ]")
481
+ // rl.pause();
482
+ // }
483
+ // else logger("Tạo Thành Công File ENV !","[ FCA-SUS ]")
484
+ // rl.pause();
485
+ // });
486
+ // })
487
+ // }
488
+ // catch (e) {
489
+ // console.log(e);
490
+ // logger("Đã Có Lỗi Khi Đang Try Tạo Ra Câu Hỏi =))", "[ FCA-SUS ]");
491
+ // rl.pause();
492
+ // }
493
+ // }
494
+ // },
495
+ // 2: {
496
+ // "name": "Tiếp Tục Chạy Fca Mà Không Cần Mã Hóa AppState",
497
+ // onRun: async function () {
498
+ // rl.pause();
499
+ // }
500
+ // },
501
+ // 3: {
502
+ // "name": "Đổi Mật Khẩu AppState (Comming Soon..)",
503
+ // onRun: async function () {
504
+ // console.log(chalk.red.bold("Đã bảo là comming soon rồi mà >:v"));
505
+ // }
506
+ // }
507
+ // }
508
+ // const localbrand = JSON.parse(readFileSync('./package.json')).name;
509
+ // const localbrand2 = JSON.parse(readFileSync('./node_modules/fca-sus/package.json')).version;
510
+ // var axios = require('axios');
511
+ // axios.get('https://raw.githubusercontent.com/amogusdevlol/fca-sus/main/package.json').then(async (res) => {
512
+ // if (localbrand.toUpperCase() == 'HORIZON') {
513
+ // console.group(chalk.bold.cyan('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'))
514
+ // console.log(chalk.bold.hex('#00FFCC')("[</>]") + chalk.bold.yellow(' => ') + "Hệ Điều Hành: " + chalk.bold.red(os.type()));
515
+ // console.log(chalk.bold.hex('#00FFCC')("[</>]") + chalk.bold.yellow(' => ') + "Thông Tin Máy: " + chalk.bold.red(os.version()));
516
+ // console.log(chalk.bold.hex('#00FFCC')("[</>]") + chalk.bold.yellow(' => ') + "Phiên Bản Hiện Tại: " + chalk.bold.red(localbrand2));
517
+ // console.log(chalk.bold.hex('#00FFCC')("[</>]") + chalk.bold.yellow(' => ') + "Phiên Bản Mới Nhất: " + chalk.bold.red(res.data.version));
518
+ // console.groupEnd();
519
+ // }
520
+ // else {
521
+ // console.clear();
522
+ // console.log(figlet.textSync('TeamHorizon', {font: 'ANSI Shadow',horizontalLayout: 'default',verticalLayout: 'default',width: 0,whitespaceBreak: true }))
523
+ // console.log(chalk.hex('#9966CC')(`━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`));
524
+ // }
525
+ // });
526
+
527
+ logger(Language.OnProcess, "[ FCA-SUS ]");
528
+ var backup = async(data) => {
529
+ if (fs.existsSync('./appstate.json')) {
530
+ try {
531
+ fs.writeFileSync('./appstate.json', data);
532
+ } catch (e) {
533
+ fs.writeFileSync('./appstate.json', JSON.stringify(data, null, "\t"));
534
+ }
535
+ logger(Language.BackupNoti, "[ FCA-SUS ]");
536
+ await new Promise(resolve => setTimeout(resolve, 5 * 1000));
537
+ process.exit(1);
538
+ } else if (fs.existsSync('./Facebook.json')) {
539
+ try {
540
+ fs.writeFileSync('./Facebook.json', data);
541
+ } catch (e) {
542
+ fs.writeFileSync('./Facebook.json', JSON.stringify(data, null, "\t"));
543
+ }
544
+ logger(Language.BackupNoti, "[ FCA-SUS ]");
545
+ await new Promise(resolve => setTimeout(resolve, 5 * 1000));
546
+ process.exit(1);
547
+ } else if (fs.existsSync('fbstate.json')) {
548
+ try {
549
+ fs.writeFileSync('./fbstate.json', data);
550
+ } catch (e) {
551
+ fs.writeFileSync('./fbstate.json', JSON.stringify(data), null, "\t");
552
+ }
553
+ logger(Language.BackupNoti, "[ FCA-SUS ]");
554
+ await new Promise(resolve => setTimeout(resolve, 5 * 1000));
555
+ process.exit(1);
556
+ } else return logger.Error();
557
+ }
558
+
559
+ switch (process.platform) {
560
+ case "win32":
561
+ {
562
+ try {
563
+ var { body } = await Fetch('https://decrypt-appstate-production.up.railway.app/getKey');
564
+ process.env['FBKEY'] = JSON.parse(body).Data;
565
+ } catch (e) {
566
+ logger(Language.ErrGetPassWord);
567
+ logger.Error();
568
+ process.exit(1);
569
+ }
570
+ }
571
+ break;
572
+ case "linux":
573
+ {
574
+ if (process.env["REPL_ID"] == undefined) {
575
+ try {
576
+ var { body } = await Fetch.get('https://decrypt-appstate-production.up.railway.app/getKey');
577
+ process.env['FBKEY'] = JSON.parse(body).Data;
578
+ } catch (e) {
579
+ logger(Language.ErrGetPassWord, '[ FCA-SUS ]');
580
+ logger.Error();
581
+ process.exit(1);
582
+ }
583
+ } else {
584
+ try {
585
+ const client = new Client();
586
+ let key = await client.get("FBKEY");
587
+ if (!key) {
588
+ await client.set("FBKEY", makeid(49));
589
+ let key = await client.get("FBKEY");
590
+ process.env['FBKEY'] = key;
591
+ } else {
592
+ process.env['FBKEY'] = key;
593
+ }
594
+ } catch (e) {
595
+ logger(Language.ErrGenerateKey, '[ FCA-SUS ]');
596
+ logger(e, '[ FCA-SUS ]');
597
+ logger.Error();
598
+ process.exit(0)
599
+ }
600
+ }
601
+ }
602
+ break;
603
+ case "android":
604
+ {
605
+ try {
606
+ var { body } = await Fetch.get('https://decrypt-appstate-production.up.railway.app/getKey');
607
+ process.env['FBKEY'] = JSON.parse(body).Data;
608
+ } catch (e) {
609
+ logger(Language.ErrGetPassWord, '[ FCA-SUS ]');
610
+ return logger.Error();
611
+ }
612
+ }
613
+ break;
614
+ default:
615
+ {
616
+ logger(Language.UnsupportedDevice, '[ FCA-SUS ]');
617
+ logger.Error();
618
+ process.exit(0);
619
+ }
620
+ }
621
+
622
+ try {
623
+ switch (require("../../FastConfigFca.json").EncryptFeature) {
624
+ case true:
625
+ {
626
+ appState = JSON.parse(JSON.stringify(appState, null, "\t"));
627
+ switch (utils.getType(appState)) {
628
+ case "Array":
629
+ {
630
+ logger(Language.NotReadyToDecrypt, '[ FCA-SUS ]');
631
+ }
632
+ break;
633
+ case "String":
634
+ {
635
+ try {
636
+ appState = StateCrypt.decryptState(appState, process.env['FBKEY']);
637
+ logger(Language.DecryptSuccess, '[ FCA-SUS ]');
638
+ } catch (e) {
639
+ if (process.env.Backup != undefined && process.env.Backup) {
640
+ backup(process.env.Backup);
641
+ } else switch (process.platform) {
642
+ case "win32":
643
+ {
644
+ try {
645
+ if (fs.existsSync('./backupappstate.json')) {
646
+ let content = fs.readFileSync('./backupappstate.json', 'utf8');
647
+ return backup(content);
648
+ }
649
+ } catch (e) {
650
+ logger(Language.ErrBackup, '[ FCA-SUS ]');
651
+ logger.Error();
652
+ process.exit(0);
653
+ }
654
+ }
655
+ break;
656
+ case "linux":
657
+ {
658
+ if (process.env["REPL_ID"] == undefined) {
659
+ try {
660
+ if (fs.existsSync('./backupappstate.json')) {
661
+ let content = fs.readFileSync('./backupappstate.json', 'utf8');
662
+ return backup(content);
663
+ }
664
+ } catch (e) {
665
+ logger(Language.ErrBackup, '[ FCA-SUS ]');
666
+ logger.Error();
667
+ process.exit(0);
668
+ }
669
+ } else {
670
+ try {
671
+ const client = new Client();
672
+ let key = await client.get("Backup");
673
+ if (key) {
674
+ return backup(JSON.stringify(key));
675
+ } else {
676
+ logger(Language.ErrBackup, '[ FCA-SUS ]');
677
+ }
678
+ } catch (e) {
679
+ logger(Language.ErrBackup, '[ FCA-SUS ]');
680
+ }
681
+ }
682
+ }
683
+ break;
684
+ case "android":
685
+ {
686
+ try {
687
+ if (fs.existsSync('./backupappstate.json')) {
688
+ let content = fs.readFileSync('./backupappstate.json', 'utf8');
689
+ return backup(content);
690
+ }
691
+ } catch (e) {
692
+ logger(Language.ErrBackup, '[ FCA-SUS ]');
693
+ logger.Error();
694
+ process.exit(0);
695
+ }
696
+ }
697
+ }
698
+ logger(Language.DecryptFailed, '[ FCA-SUS ]');
699
+ return logger.Error();
700
+ }
701
+ logger(getText.gettext(Language.YourAppStatePass, process.env.FBKEY), '[ FCA-SUS ]');
702
+ }
703
+ break;
704
+ default:
705
+ {
706
+ logger(Language.InvaildAppState, "[ FCA-SUS ]");
707
+ process.exit(0)
708
+ }
709
+ }
710
+ }
711
+ break;
712
+ case false:
713
+ {
714
+ switch (utils.getType(appState)) {
715
+ case "Array":
716
+ {
717
+ logger(Language.EncryptStateOff, "[ FCA-SUS ]");
718
+ }
719
+ break;
720
+ case "String":
721
+ {
722
+ logger(Language.EncryptStateOff, "[ FCA-SUS ]");
723
+ try {
724
+ appState = StateCrypt.decryptState(appState, process.env['FBKEY']);
725
+ logger(Language.DecryptSuccess, '[ FCA-SUS ]');
726
+ } catch (e) {
727
+ if (process.env.Backup != undefined && process.env.Backup) {
728
+ backup(process.env.Backup);
729
+ } else switch (process.platform) {
730
+ case "win32":
731
+ {
732
+ try {
733
+ if (fs.existsSync('./backupappstate.json')) {
734
+ let content = fs.readFileSync('./backupappstate.json', 'utf8');
735
+ return backup(content);
736
+ }
737
+ } catch (e) {
738
+ logger(Language.ErrBackup, '[ FCA-SUS ]');
739
+ logger.Error();
740
+ process.exit(0);
741
+ }
742
+ }
743
+ break;
744
+ case "linux":
745
+ {
746
+ if (process.env["REPL_ID"] == undefined) {
747
+ try {
748
+ if (fs.existsSync('./backupappstate.json')) {
749
+ let content = fs.readFileSync('./backupappstate.json', 'utf8');
750
+ return backup(content);
751
+ }
752
+ } catch (e) {
753
+ logger(Language.ErrBackup, '[ FCA-SUS ]');
754
+ logger.Error();
755
+ process.exit(0);
756
+ }
757
+ } else {
758
+ try {
759
+ const client = new Client();
760
+ let key = await client.get("Backup");
761
+ if (key) {
762
+ return backup(JSON.stringify(key));
763
+ } else {
764
+ logger(Language.ErrBackup, '[ FCA-SUS ]');
765
+ }
766
+ } catch (e) {
767
+ logger(Language.ErrBackup, '[ FCA-SUS ]');
768
+ }
769
+ }
770
+ }
771
+ break;
772
+ case "android":
773
+ {
774
+ try {
775
+ if (fs.existsSync('./backupappstate.json')) {
776
+ let content = fs.readFileSync('./backupappstate.json', 'utf8');
777
+ return backup(content);
778
+ }
779
+ } catch (e) {
780
+ logger(Language.ErrBackup, '[ FCA-SUS ]');
781
+ logger.Error();
782
+ process.exit(0);
783
+ }
784
+ }
785
+ }
786
+ logger(Language.DecryptFailed, '[ FCA-SUS ]');
787
+ return logger.Error();
788
+ }
789
+ }
790
+ break;
791
+ default:
792
+ {
793
+ logger(Language.InvaildAppState, "[ FCA-SUS ]");
794
+ process.exit(0)
795
+ }
796
+ }
797
+ }
798
+ break;
799
+ default:
800
+ {
801
+ logger(getText.gettext(Language.IsNotABoolean, require("../../FastConfigFca.json").EncryptFeature), "[ FCA-SUS ]")
802
+ process.exit(0);
803
+ }
804
+ }
805
+ } catch (e) {
806
+ console.log(e);
807
+ }
808
+
809
+ try {
810
+ appState = JSON.parse(appState);
811
+ } catch (e) {
812
+ try {
813
+ appState = appState;
814
+ } catch (e) {
815
+ return logger.Error();
816
+ }
817
+ }
818
+ try {
819
+ appState.map(function(c) {
820
+ var str = c.key + "=" + c.value + "; expires=" + c.expires + "; domain=" + c.domain + "; path=" + c.path + ";";
821
+ jar.setCookie(str, "http://" + c.domain);
822
+ });
823
+ switch (process.platform) {
824
+ case "win32":
825
+ {
826
+ try {
827
+ fs.writeFileSync("./backupappstate.json", JSON.stringify(appState, null, "\t"));
828
+ process.env.Backup = JSON.stringify(appState, null, "\t");
829
+ } catch (e) {
830
+ logger(Language.BackupFailed, '[ FCA-SUS ]');
831
+ }
832
+ }
833
+ break;
834
+ case "linux":
835
+ {
836
+ if (process.env["REPL_ID"] == undefined) {
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
+ } else {
844
+ try {
845
+ if (fs.existsSync('./backupappstate.json')) {
846
+ fs.unlinkSync('./backupappstate.json');
847
+ }
848
+ const client = new Client();
849
+ await client.set("Backup", appState);
850
+ process.env.Backup = JSON.stringify(appState, null, "\t");
851
+ } catch (e) {
852
+ logger(Language.BackupFailed, '[ FCA-SUS ]');
853
+ }
854
+ }
855
+ }
856
+ break;
857
+ case "android":
858
+ {
859
+ try {
860
+ fs.writeFileSync("./backupappstate.json", JSON.stringify(appState, null, "\t"));
861
+ process.env.Backup = JSON.stringify(appState, null, "\t");
862
+ } catch (e) {
863
+ logger(Language.BackupFailed, '[ FCA-SUS ]');
864
+ }
865
+ }
866
+ }
867
+
868
+ mainPromise = utils.get('https://www.facebook.com/', jar, null, globalOptions, { noRef: true }).then(utils.saveCookies(jar));
869
+ } catch (e) {
870
+
871
+ if (process.env.Backup != undefined && process.env.Backup) {
872
+ return backup(process.env.Backup);
873
+ }
874
+ switch (process.platform) {
875
+ case "win32":
876
+ {
877
+ try {
878
+ if (fs.existsSync('./backupappstate.json')) {
879
+ let content = fs.readFileSync('./backupappstate.json', 'utf8');
880
+ return backup(content);
881
+ }
882
+ } catch (e) {
883
+ logger(Language.ErrBackup, '[ FCA-SUS ]');
884
+ logger.Error();
885
+ process.exit(0);
886
+ }
887
+ }
888
+ break;
889
+ case "linux":
890
+ {
891
+ if (process.env["REPL_ID"] == undefined) {
892
+ try {
893
+ if (fs.existsSync('./backupappstate.json')) {
894
+ let content = fs.readFileSync('./backupappstate.json', 'utf8');
895
+ return backup(content);
896
+ }
897
+ } catch (e) {
898
+ logger(Language.ErrBackup, '[ FCA-SUS ]');
899
+ logger.Error();
900
+ process.exit(0);
901
+ }
902
+ } else {
903
+ try {
904
+ const client = new Client();
905
+ let key = await client.get("Backup");
906
+ if (key) {
907
+ backup(JSON.stringify(key));
908
+ } else {
909
+ logger(Language.ErrBackup, '[ FCA-SUS ]');
910
+ }
911
+ } catch (e) {
912
+ logger(Language.ErrBackup, '[ FCA-SUS ]');
913
+ }
914
+ }
915
+ }
916
+ break;
917
+ case "android":
918
+ {
919
+ try {
920
+ if (fs.existsSync('./backupappstate.json')) {
921
+ let content = fs.readFileSync('./backupappstate.json', 'utf8');
922
+ return backup(content);
923
+ }
924
+ } catch (e) {
925
+ logger(Language.ErrBackup, '[ FCA-SUS ]');
926
+ logger.Error();
927
+ process.exit(0);
928
+ }
929
+ }
930
+ break;
931
+ }
932
+
933
+ console.log(e);
934
+ return logger(Language.ScreenShotConsoleAndSendToAdmin, '[ FCA-HSP ]');
935
+ }
936
+ } else {
937
+ // Open the main page, then we login with the given credentials and finally
938
+ // load the main page again (it'll give us some IDs that we need)
939
+ mainPromise = utils
940
+ .get("https://www.facebook.com/", null, null, globalOptions, { noRef: true })
941
+ .then(utils.saveCookies(jar))
942
+ .then(makeLogin(jar, email, password, globalOptions, callback, prCallback))
943
+ .then(function() {
944
+ return utils.get('https://www.facebook.com/', jar, null, globalOptions).then(utils.saveCookies(jar));
945
+ });
946
+ }
947
+ } catch (e) {
948
+ console.log(e);
949
+ }
950
+ var ctx = null;
951
+ var _defaultFuncs = null;
952
+ var api = null;
953
+
954
+ mainPromise = mainPromise
955
+ .then(function(res) {
956
+ // Hacky check for the redirection that happens on some ISPs, which doesn't return statusCode 3xx
957
+ var reg = /<meta http-equiv="refresh" content="0;url=([^"]+)[^>]+>/;
958
+ var redirect = reg.exec(res.body);
959
+ if (redirect && redirect[1]) return utils.get(redirect[1], jar, null, globalOptions).then(utils.saveCookies(jar));
960
+ return res;
961
+ })
962
+ .then(async function(res) {
963
+ var html = res.body;
964
+ var stuff = await buildAPI(globalOptions, html, jar);
965
+ ctx = stuff[0];
966
+ _defaultFuncs = stuff[1];
967
+ api = stuff[2];
968
+ return res;
969
+ });
970
+ // given a pageID we log in as a page
971
+ if (globalOptions.pageID) {
972
+ mainPromise = mainPromise
973
+ .then(function() {
974
+ return utils.get('https://www.facebook.com/' + ctx.globalOptions.pageID + '/messages/?section=messages&subsection=inbox', ctx.jar, null, globalOptions);
975
+ })
976
+ .then(function(resData) {
977
+ var url = utils.getFrom(resData.body, 'window.location.replace("https:\\/\\/www.facebook.com\\', '");').split('\\').join('');
978
+ url = url.substring(0, url.length - 1);
979
+ return utils.get('https://www.facebook.com' + url, ctx.jar, null, globalOptions);
980
+ });
981
+ }
982
+
983
+ // At the end we call the callback or catch an exception
984
+ mainPromise
985
+ .then(function() {
986
+ logger(Language.DoneLogin, "[ FCA-SUS ]");
987
+ logger(Language.AutoCheckUpdate, "[ FCA-SUS ]");
988
+ //!---------- Auto Check, Update START -----------------!//
989
+ var Fetch = require('got');
990
+ var { readFileSync } = require('fs-extra');
991
+ const { execSync } = require('child_process');
992
+ Fetch('https://raw.githubusercontent.com/amogusdevlol/node-ainzfb/main/package.json').then(async(res) => {
993
+ const localbrand = JSON.parse(readFileSync('./node_modules/node-ainzfb/package.json')).version;
994
+ if (Number(localbrand.replace(/\./g, "")) < Number(JSON.parse(res.body.toString()).version.replace(/\./g, ""))) {
995
+ log.warn("[ FCA-SUS ] •", getText.gettext(Language.NewVersionFound, JSON.parse(readFileSync('./node_modules/node-ainzfb/package.json')).version, JSON.parse(res.body.toString()).version));
996
+ log.warn("[ FCA-SUS ] •", Language.AutoUpdate);
997
+ try {
998
+ execSync('npm install node-ainzfb@latest', { stdio: 'inherit' });
999
+ logger(Language.UpdateSuccess, "[ FCA-SUS ]")
1000
+ logger(Language.RestartAfterUpdate, '[ FCA-SUS ]');
1001
+ await new Promise(resolve => setTimeout(resolve, 5 * 1000));
1002
+ console.clear();
1003
+ process.exit(1);
1004
+ } catch (err) {
1005
+ log.warn('Error Update: ' + err);
1006
+ logger(Language.UpdateFailed, "[ FCA-SUS ]");
1007
+ try {
1008
+ require.resolve('sus-support');
1009
+ } catch (e) {
1010
+ logger(Language.InstallSupportTool, "[ FCA-SUS ]");
1011
+ execSync('npm install git+https://github.com/amogusdevlol/sus-support.git', { stdio: 'inherit' });
1012
+ process.exit(1);
1013
+ }
1014
+ var fcasp = require('sus-support');
1015
+ try {
1016
+ fcasp.onError()
1017
+ } catch (e) {
1018
+ logger(Language.NotiAfterUseToolFail, "[ Fca - Helper ]")
1019
+ logger("rmdir ./node_modules then enter npm i && npm start", "[ Fca - Helper ]");
1020
+ process.exit(0);
1021
+ }
1022
+
1023
+ }
1024
+ } else {
1025
+ logger(getText.gettext(Language.LocalVersion, localbrand), "[ FCA-SUS ]");
1026
+ logger(Language.WishMessage[Math.floor(Math.random() * Language.WishMessage.length)], "[ FCA-SUS ]");
1027
+ require('./Extra/ExtraUptimeRobot')()
1028
+ await new Promise(resolve => setTimeout(resolve, 5 * 1000));
1029
+ callback(null, api);
1030
+ }
1031
+ });
1032
+ }).catch(function(e) {
1033
+ log.error("login", e.error || e);
1034
+ callback(e);
1035
+ });
1036
+ //!---------- Auto Check, Update END -----------------!//
1037
+ }
1038
+
1039
+ function login(loginData, options, callback) {
1040
+ if (utils.getType(options) === 'Function' || utils.getType(options) === 'AsyncFunction') {
1041
+ callback = options;
1042
+ options = {};
1043
+ }
1044
+
1045
+ var globalOptions = {
1046
+ selfListen: false,
1047
+ listenEvents: true,
1048
+ listenTyping: false,
1049
+ updatePresence: false,
1050
+ forceLogin: false,
1051
+ autoMarkDelivery: false,
1052
+ autoMarkRead: false,
1053
+ autoReconnect: true,
1054
+ logRecordSize: 100,
1055
+ online: false,
1056
+ emitReady: false,
1057
+ userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8"
1058
+ };
1059
+
1060
+ //! bằng 1 cách nào đó tắt online sẽ đánh lừa được facebook :v
1061
+ //! phải có that có this chứ :v
1062
+
1063
+ setOptions(globalOptions, options);
1064
+
1065
+ var prCallback = null;
1066
+ if (utils.getType(callback) !== "Function" && utils.getType(callback) !== "AsyncFunction") {
1067
+ var rejectFunc = null;
1068
+ var resolveFunc = null;
1069
+ var returnPromise = new Promise(function(resolve, reject) {
1070
+ resolveFunc = resolve;
1071
+ rejectFunc = reject;
1072
+ });
1073
+ prCallback = function(error, api) {
1074
+ if (error) return rejectFunc(error);
1075
+ return resolveFunc(api);
1076
+ };
1077
+ callback = prCallback;
1078
+ }
1079
+ loginHelper(loginData.appState, loginData.email, loginData.password, globalOptions, callback, prCallback);
1080
+ return returnPromise;
1081
+ }
1082
+
1083
+ module.exports = login;