fca-priyansh 16.0.0 → 17.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. package/Extra/Balancer.js +49 -0
  2. package/Extra/Bypass/956/index.js +234 -0
  3. package/Extra/Bypass/test/aaaa.json +170 -0
  4. package/Extra/Bypass/test/index.js +188 -0
  5. package/Extra/Database/index.js +249 -140
  6. package/Extra/ExtraAddons.js +35 -33
  7. package/Extra/ExtraFindUID.js +3 -1
  8. package/Extra/ExtraGetThread.js +303 -56
  9. package/Extra/ExtraUptimeRobot.js +15 -3
  10. package/Extra/Html/Classic/script.js +3 -3
  11. package/Extra/Security/AES_256_GCM/index.js +0 -0
  12. package/Extra/Security/Base/Step_1.js +6 -0
  13. package/Extra/Security/Base/Step_2.js +22 -0
  14. package/Extra/Security/Base/Step_3.js +22 -0
  15. package/Extra/Security/Base/index.js +191 -0
  16. package/Extra/Security/Index.js +5 -146
  17. package/Extra/Security/Step_1.js +4 -9
  18. package/Extra/Security/Step_2.js +2 -0
  19. package/Extra/Security/Step_3.js +4 -2
  20. package/Extra/Src/Change_Environment.js +1 -1
  21. package/Extra/Src/Check_Update.js +67 -0
  22. package/Extra/Src/History.js +2 -2
  23. package/Extra/Src/Instant_Update.js +65 -0
  24. package/Extra/Src/Premium.js +35 -38
  25. package/Extra/Src/Release_Memory.js +160 -0
  26. package/Extra/Src/Websocket.js +213 -0
  27. package/Extra/Src/image/checkmate.jpg +0 -0
  28. package/Extra/Src/test.js +28 -0
  29. package/Extra/Src/uuid.js +1 -1
  30. package/Func/AcceptAgreement.js +4 -5
  31. package/Func/ClearCache.js +7 -7
  32. package/Func/ReportV1.js +5 -5
  33. package/LICENSE +1 -4
  34. package/Language/index.json +59 -8
  35. package/Main.js +1444 -0
  36. package/README.md +198 -1
  37. package/broadcast.js +43 -37
  38. package/index.js +303 -1704
  39. package/logger.js +4 -4
  40. package/package.json +16 -11
  41. package/src/Dev_Horizon_Data.js +3 -3
  42. package/src/Dev_getThreadInfoOLD.js +422 -0
  43. package/src/Dev_shareTest2.js +68 -0
  44. package/src/Dev_shareTest3.js +71 -0
  45. package/src/Premium.js +8 -13
  46. package/src/Screenshot.js +4 -6
  47. package/src/editMessage.js +53 -0
  48. package/src/getAccessToken.js +0 -4
  49. package/src/getFriendsList.js +1 -1
  50. package/src/getMessage.js +26 -3
  51. package/src/getThreadHistory.js +1 -1
  52. package/src/getThreadInfo.js +237 -161
  53. package/src/getThreadInfoOLD.js +422 -0
  54. package/src/getThreadMain.js +1 -1
  55. package/src/getUID.js +3 -3
  56. package/src/getUserInfo.js +56 -73
  57. package/src/getUserInfoMain.js +2 -2
  58. package/src/getUserInfoV2.js +0 -4
  59. package/src/getUserInfoV3.js +3 -3
  60. package/src/getUserInfoV4.js +5 -5
  61. package/src/getUserInfoV5.js +4 -4
  62. package/src/listenMqtt.js +905 -625
  63. package/src/listenMqttV1.js +846 -0
  64. package/src/sendMessage.js +54 -2
  65. package/src/sendMqttMessage.js +71 -0
  66. package/src/setPostReaction.js +3 -3
  67. package/src/shareContact.js +55 -0
  68. package/src/shareLink.js +58 -0
  69. package/src/unsendMessage.js +28 -20
  70. package/src/unsendMqttMessage.js +66 -0
  71. package/utils.js +1567 -138
  72. package/.gitattributes +0 -2
  73. package/gitattributes +0 -2
  74. package/gitignore.txt +0 -10
package/index.js CHANGED
@@ -1,16 +1,6 @@
1
1
  'use strict';
2
-
3
- /**
4
- * Developers: @KanzuWakazaki - @HarryWakazaki
5
- ** A few words about developer appstate security.
6
- *! Statement renouncing responsibility for the security of appstate encryption of the following operating systems: windows, Android, Linux operating systems,.. (maybe repl.it?),
7
- *! because the above operating systems are private (except rep.it if the fraudster does not own your account or invite link to join).
8
- *! If the intruder owns the computer, these private operating systems,the security of this fca cannot guarantee 100% of the time.
9
- ** If the grammar is wrong, please understand because I'm just a kid 🍵.
10
- */
11
-
12
- /!-[ Global Set ]-!/
13
-
2
+ /* eslint-disable linebreak-style */
3
+ const utils = require('./utils');
14
4
  global.Fca = new Object({
15
5
  isThread: new Array(),
16
6
  isUser: new Array(),
@@ -21,11 +11,10 @@ global.Fca = new Object({
21
11
  fs: require("fs"),
22
12
  Fetch: require('got'),
23
13
  log: require("npmlog"),
24
- utils: require("./utils"),
25
- logger: require('./logger'),
14
+ utils: require("./utils.js"),
15
+ logger: require('./logger.js'),
26
16
  languageFile: require('./Language/index.json'),
27
- Database: require("./Extra/Database"),
28
- Security: require('./Extra/Src/uuid')
17
+ Security: require('./Extra/Src/uuid.js')
29
18
  }),
30
19
  getText: function(/** @type {any[]} */...Data) {
31
20
  var Main = (Data.splice(0,1)).toString();
@@ -36,23 +25,58 @@ global.Fca = new Object({
36
25
  ObjPriyansh: {
37
26
  "Language": "en",
38
27
  "PreKey": "",
39
- "AutoUpdate": false,
28
+ "AutoUpdate": true,
40
29
  "MainColor": "#9900FF",
41
30
  "MainName": "[ FCA-PRIYANSH ]",
42
- "Logo": true,
43
- "Uptime": true,
31
+ "Uptime": false,
44
32
  "Config": "default",
33
+ "DevMode": false,
45
34
  "Login2Fa": false,
46
35
  "AutoLogin": false,
47
36
  "BroadCast": true,
48
- "AuthString": "SD4S XQ32 O2JA WXB3 FUX2 OPJ7 Q7JZ 4R6Z",
37
+ "AuthString": "SD4S XQ32 O2JA WXB3 FUX2 OPJ7 Q7JZ 4R6Z | https://i.imgur.com/RAg3rvw.png Please remove this !, Recommend If You Using getUserInfoV2",
49
38
  "EncryptFeature": true,
50
39
  "ResetDataLogin": false,
40
+ "AutoInstallNode": false,
41
+ "AntiSendAppState": true,
51
42
  "AutoRestartMinutes": 0,
43
+ "RestartMQTT_Minutes": 0,
44
+ "Websocket_Extension": {
45
+ "Status": false,
46
+ "ResetData": false,
47
+ "AppState_Path": "appstate.json"
48
+ },
52
49
  "HTML": {
53
50
  "HTML": true,
54
- "UserName": "Guest"
55
- }
51
+ "UserName": "Guest",
52
+ "MusicLink": "https://drive.google.com/uc?id=1zlAALlxk1TnO7jXtEP_O6yvemtzA2ukA&export=download"
53
+ },
54
+ "AntiGetInfo": {
55
+ "Database_Type": "default", //json or default
56
+ "AntiGetThreadInfo": true,
57
+ "AntiGetUserInfo": true
58
+ },
59
+ "Stable_Version": {
60
+ "Accept": false,
61
+ "Version": ""
62
+ },
63
+ "CheckPointBypass": {
64
+ "956": {
65
+ "Allow": false,
66
+ "Difficult": "Easy",
67
+ "Notification": "Turn on with AutoLogin!"
68
+ }
69
+ },
70
+ "AntiStuckAndMemoryLeak": {
71
+ "AutoRestart": {
72
+ "Use": true,
73
+ "Explain": "When this feature is turned on, the system will continuously check and confirm that if memory usage reaches 90%, it will automatically restart to avoid freezing or stopping."
74
+ },
75
+ "LogFile": {
76
+ "Use": false,
77
+ "Explain": "Record memory usage logs to fix errors. Default location: Horizon_Database/memory.logs"
78
+ }
79
+ }
56
80
  },
57
81
  CountTime: function() {
58
82
  var fs = global.Fca.Require.fs;
@@ -72,1778 +96,353 @@ global.Fca = new Object({
72
96
  return `${hours} Hours`;
73
97
  }
74
98
  }),
75
- AutoLogin: async function () {
76
- var Database = global.Fca.Require.Database;
77
- var logger = global.Fca.Require.logger;
78
- var Email = (await global.Fca.Require.Database.get('Account')).replace(RegExp('"', 'g'), ''); //hmm IDK
79
- var PassWord = (await global.Fca.Require.Database.get('Password')).replace(RegExp('"', 'g'), '');
80
- login({ email: Email, password: PassWord},async (error, api) => {
81
- if (error) {
82
- logger.Error(JSON.stringify(error,null,2), function() { logger.Error("AutoLogin Failed!", function() { process.exit(0); }) });
83
- }
84
- try {
85
- await Database.set("TempState", api.getAppState());
99
+ Action: async function(Type, ctx, Code, defaultFuncs) {
100
+ switch (Type) {
101
+ case "AutoLogin": {
102
+ var Database = require('./Extra/Database');
103
+ var logger = global.Fca.Require.logger;
104
+ var Email = (Database().get('Account')).replace(RegExp('"', 'g'), ''); //hmm IDK
105
+ var PassWord = (Database().get('Password')).replace(RegExp('"', 'g'), '');
106
+ require('./Main')({ email: Email, password: PassWord},async (error, api) => {
107
+ if (error) {
108
+ logger.Error(JSON.stringify(error,null,2), function() { logger.Error("AutoLogin Failed!", function() { process.exit(0); }) });
109
+ }
110
+ try {
111
+ Database().set("TempState", Database().get('Through2Fa'));
112
+ }
113
+ catch(e) {
114
+ logger.Warning(global.Fca.Require.Language.Index.ErrDatabase);
115
+ logger.Error();
116
+ process.exit(0);
117
+ }
118
+ process.exit(1);
119
+ });
86
120
  }
87
- catch(e) {
88
- logger.Warning(global.Fca.Require.Language.Index.ErrDatabase);
89
- logger.Error();
90
- process.exit(0);
121
+ break;
122
+ case "Bypass": {
123
+ const Bypass_Module = require(`./Extra/Bypass/${Code}`);
124
+ const logger = global.Fca.Require.logger;
125
+ switch (Code) {
126
+ case 956: {
127
+ async function P1() {
128
+ return new Promise((resolve, reject) => {
129
+ try {
130
+ utils.get('https://www.facebook.com/checkpoint/828281030927956/?next=https%3A%2F%2Faccountscenter.facebook.com%2Fpassword_and_security', ctx.jar, null, ctx.globalOptions).then(function(data) {
131
+ resolve(Bypass_Module.Check(data.body));
132
+ })
133
+ }
134
+ catch (error) {
135
+ reject(error);
136
+ }
137
+ })
138
+ }
139
+ try {
140
+ const test = await P1();
141
+ if (test != null && test != '' && test != undefined) {
142
+ const resp = await Bypass_Module.Cook_And_Work(ctx, defaultFuncs)
143
+ if (resp == true) return logger.Success("Bypassing 956 successfully!", function() { return process.exit(1); })
144
+ else return logger.Error("Bypass 956 failed ! DO YOUR SELF :>", function() { process.exit(0) });
145
+ }
146
+ }
147
+ catch (e) {
148
+ logger.Error("Bypass 956 failed ! DO YOUR SELF :>", function() { process.exit(0) })
149
+ }
150
+ }
151
+ }
91
152
  }
92
- process.exit(1);
93
- });
153
+ break;
154
+ default: {
155
+ require('npmlog').Error("Invalid Message!");
156
+ };
157
+ }
94
158
  }
95
159
  });
96
160
 
97
- /!-[ Check File To Run Process ]-!/
161
+ try {
162
+ let Boolean_Fca = ["AntiSendAppState","AutoUpdate","Uptime","BroadCast","EncryptFeature","AutoLogin","ResetDataLogin","Login2Fa", "DevMode","AutoInstallNode"];
163
+ let String_Fca = ["MainName","PreKey","Language","AuthString","Config"]
164
+ let Number_Fca = ["AutoRestartMinutes","RestartMQTT_Minutes"];
165
+ let Object_Fca = ["HTML","Stable_Version","AntiGetInfo","Websocket_Extension", "CheckPointBypass", "AntiStuckAndMemoryLeak"];
166
+ let All_Variable = Boolean_Fca.concat(String_Fca,Number_Fca,Object_Fca);
98
167
 
99
- let Boolean_Fca = ["AutoUpdate","Uptime","BroadCast","EncryptFeature","AutoLogin","ResetDataLogin","Login2Fa","Logo"];
100
- let String_Fca = ["MainName","PreKey","Language","AuthString","Config"]
101
- let Number_Fca = ["AutoRestartMinutes"];
102
- let All_Variable = Boolean_Fca.concat(String_Fca,Number_Fca);
103
168
 
104
- try {
105
169
  if (!global.Fca.Require.fs.existsSync(process.cwd() + '/PriyanshFca.json')) {
106
170
  global.Fca.Require.fs.writeFileSync(process.cwd() + "/PriyanshFca.json", JSON.stringify(global.Fca.Data.ObjPriyansh, null, "\t"));
107
171
  process.exit(1);
108
172
  }
109
173
 
110
174
  try {
111
- var DataLanguageSetting = require(process.cwd() + "/PriyanshFca.json");
175
+ var Data_Setting = require(process.cwd() + "/PriyanshFca.json");
112
176
  }
113
177
  catch (e) {
114
- global.Fca.Require.logger.Error('Detect Your FastConfigFca Settings Invalid!, Carry out default restoration');
178
+ global.Fca.Require.logger.Error('Detect Your PriyanshFca Settings Invalid!, Carry out default restoration');
115
179
  global.Fca.Require.fs.writeFileSync(process.cwd() + "/PriyanshFca.json", JSON.stringify(global.Fca.Data.ObjPriyansh, null, "\t"));
116
180
  process.exit(1)
117
181
  }
118
182
  if (global.Fca.Require.fs.existsSync(process.cwd() + '/PriyanshFca.json')) {
119
- try {
120
- if (DataLanguageSetting.Logo != undefined) {
121
- delete DataLanguageSetting.Logo
122
- global.Fca.Require.fs.writeFileSync(process.cwd() + "/PriyanshFca.json", JSON.stringify(DataLanguageSetting, null, "\t"));
183
+
184
+ for (let i of All_Variable) {
185
+ if (Data_Setting[i] == undefined) {
186
+ Data_Setting[i] = global.Fca.Data.ObjPriyansh[i];
187
+ global.Fca.Require.fs.writeFileSync(process.cwd() + "/PriyanshFca.json", JSON.stringify(Data_Setting, null, "\t"));
123
188
  }
124
- }
125
- catch (e) {
126
- console.log(e);
127
- }
128
- if (!global.Fca.Require.languageFile.some((/** @type {{ Language: string; }} */i) => i.Language == DataLanguageSetting.Language)) {
129
- global.Fca.Require.logger.Warning("Not Support Language: " + DataLanguageSetting.Language + " Only 'en' and 'vi'");
130
- process.exit(0);
131
- }
132
- var Language = global.Fca.Require.languageFile.find((/** @type {{ Language: string; }} */i) => i.Language == DataLanguageSetting.Language).Folder.Index;
133
- global.Fca.Require.Language = global.Fca.Require.languageFile.find((/** @type {{ Language: string; }} */i) => i.Language == DataLanguageSetting.Language).Folder;
134
- } else process.exit(1);
135
- for (let i in DataLanguageSetting) {
189
+ else continue;
190
+ } //Check Variable
191
+
192
+ for (let i in Data_Setting) {
136
193
  if (Boolean_Fca.includes(i)) {
137
- if (global.Fca.Require.utils.getType(DataLanguageSetting[i]) != "Boolean") return logger.Error(i + " Is Not A Boolean, Need To Be true Or false !", function() { process.exit(0) });
194
+ if (global.Fca.Require.utils.getType(Data_Setting[i]) != "Boolean") logger.Error(i + " Is Not A Boolean, Need To Be true Or false !", function() { process.exit(0) });
138
195
  else continue;
139
196
  }
140
197
  else if (String_Fca.includes(i)) {
141
- if (global.Fca.Require.utils.getType(DataLanguageSetting[i]) != "String") return logger.Error(i + " Is Not A String, Need To Be String!", function() { process.exit(0) });
198
+ if (global.Fca.Require.utils.getType(Data_Setting[i]) != "String") logger.Error(i + " Is Not A String, Need To Be String!", function() { process.exit(0) });
142
199
  else continue;
143
200
  }
144
201
  else if (Number_Fca.includes(i)) {
145
- if (global.Fca.Require.utils.getType(DataLanguageSetting[i]) != "Number") return logger.Error(i + " Is Not A Number, Need To Be Number !", function() { process.exit(0) });
202
+ if (global.Fca.Require.utils.getType(Data_Setting[i]) != "Number") logger.Error(i + " Is Not A Number, Need To Be Number !", function() { process.exit(0) });
146
203
  else continue;
147
204
  }
148
- }
149
- for (let i of All_Variable) {
150
- if (!DataLanguageSetting[All_Variable[i]] == undefined) {
151
- DataLanguageSetting[All_Variable[i]] = global.Fca.Data.ObjPriyansh[All_Variable[i]];
152
- global.Fca.Require.fs.writeFileSync(process.cwd() + "/PriyanshFca.json", JSON.stringify(DataLanguageSetting, null, "\t"));
153
- }
154
- else continue;
155
- }
156
- global.Fca.Require.Priyansh = DataLanguageSetting;
157
- }
158
- catch (e) {
159
- console.log(e);
160
- global.Fca.Require.logger.Error();
161
- }
162
-
163
- /!-[ Require config and use ]-!/
164
-
165
- if (global.Fca.Require.Priyansh.Config != 'default') {
166
- //do ssth
167
- }
168
-
169
- /!-[ Require All Package Need Use ]-!/
170
-
171
- var utils = global.Fca.Require.utils,
172
- logger = global.Fca.Require.logger,
173
- fs = global.Fca.Require.fs,
174
- getText = global.Fca.getText,
175
- log = global.Fca.Require.log,
176
- Fetch = global.Fca.Require.Fetch,
177
- express = require("express")(),
178
- { join, resolve } = require('path'),
179
- cheerio = require("cheerio"),
180
- StateCrypt = {},
181
- { readFileSync } = require('fs-extra'),
182
- Database = require("./Extra/Database"),
183
- readline = require("readline"),
184
- chalk = require("chalk"),
185
- figlet = require("figlet"),
186
- os = require("os"),
187
- Security = require("./Extra/Security/Index");
188
-
189
- /!-[ Set Variable For Process ]-!/
190
-
191
- log.maxRecordSize = 100;
192
- var checkVerified = null;
193
- var Boolean_Option = ['online','selfListen','listenEvents','updatePresence','forceLogin','autoMarkDelivery','autoMarkRead','listenTyping','autoReconnect','emitReady'];
194
-
195
- /!-[ Set And Check Template HTML ]-!/
196
-
197
- var css = readFileSync(join(__dirname, 'Extra', 'Html', 'Classic', 'style.css'));
198
- var js = readFileSync(join(__dirname, 'Extra', 'Html', 'Classic', 'script.js'));
199
-
200
- /!-[ Function Generate HTML Template ]-!/
201
-
202
- /**
203
- * It returns a string of HTML code.
204
- * @param UserName - The username of the user
205
- * @param Type - The type of user, either "Free" or "Premium"
206
- * @param link - The link to the music you want to play
207
- * @returns A HTML file
208
- */
209
-
210
- function ClassicHTML(UserName,Type,link) {
211
- return `<!DOCTYPE html>
212
- <html lang="en">
213
- <head>
214
- <meta charset="UTF-8">
215
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
216
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
217
- <title>Priyanshu Rajput Info</title>
218
- <!--font awasome icons-->
219
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" integrity="sha512-9usAa10IRO0HhonpyAIVpjrylPvoDwiPUiKdWk5t3PyolY1cOd4DSE0Ga+ri4AuTroPR5aQvXU9xC6qOPnzFeg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
220
- <link rel="preconnect" href="https://fonts.googleapis.com">
221
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
222
- <link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
223
- <!--my css file-->
224
- <link rel="stylesheet" href="style.css">
225
- </head>
226
- <body >
227
- <video autoplay muted plays-inline loop>
228
- <source src="https://imgur.com/aoGxVLX.mp4" type="video/mp4">
229
- </video>
230
- <div class="container">
231
- <button class="call"><i class="fa-solid fa-phone"></i></button>
232
- <div class="card move">
233
- <div class="imgbox">
234
- <img src="https://i.imgur.com/eDbdlvd.jpg" alt="">
235
- </div>
236
- <div class="name-job">
237
- <h3>Priyansh Rajput</h3>
238
- <h5>Web Developer</h5>
239
- </div>
240
- <div class="skills">
241
- <button class="btn-Follow"><a href="https://facebook.com/Priyanshu.Rajput.Official" target="_blank">Follow</a></button>
242
- <button class="btn-Message"><a href=" https://telegram.me/Priyanshrajput" target="_blank">Message!</a></button>
243
- </div>
244
-
245
- </div>
246
- <div class="icons">
247
- <div class="icon">
248
- <i class="fa-brands fa-twitter front"></i>
249
- <i class="fa-brands fa-twitter back"></i>
250
- <i class="fa-brands fa-twitter left"></i>
251
- <i class="fa-brands fa-twitter right"></i>
252
- <i class="fa-brands fa-twitter top"></i>
253
- <i class="fa-brands fa-twitter bottom"></i>
254
- </div>
255
- <div class="icon">
256
- <i class="fa-brands fa-youtube front"></i>
257
- <i class="fa-brands fa-youtube back"></i>
258
- <i class="fa-brands fa-youtube left"></i>
259
- <i class="fa-brands fa-youtube right"></i>
260
- <i class="fa-brands fa-youtube top"></i>
261
- <i class="fa-brands fa-youtube bottom"></i>
262
- </div>
263
- <div class="icon">
264
- <i class="fa-brands fa-facebook-f front"></i>
265
- <i class="fa-brands fa-facebook-f back"></i>
266
- <i class="fa-brands fa-facebook-f left"></i>
267
- <i class="fa-brands fa-facebook-f right"></i>
268
- <i class="fa-brands fa-facebook-f top"></i>
269
- <i class="fa-brands fa-facebook-f bottom"></i>
270
- </div>
271
- <div class="icon">
272
- <i class="fa-brands fa-whatsapp front"></i>
273
- <i class="fa-brands fa-whatsapp back"></i>
274
- <i class="fa-brands fa-whatsapp left"></i>
275
- <i class="fa-brands fa-whatsapp right"></i>
276
- <i class="fa-brands fa-whatsapp top"></i>
277
- <i class="fa-brands fa-whatsapp bottom"></i>
278
- </div>
279
- </div>
280
- </div>
281
- </body>
282
- </html>
283
- <script>
284
- var container=document.querySelector('.container')
285
- var icons=document.querySelector('.icons')
286
- var call=document.querySelector('.call')
287
- var body =document.querySelector('body')
288
- var card=document.querySelector('.card')
289
- // body.addEventListener('onload',function(){
290
- setTimeout(function(){
291
- container.classList.add('move')
292
- },3000)
293
- // })
294
- setTimeout(function(){
295
- icons.style="opacity: 0"
296
- call.style="opacity: 0"
297
- },2000)
298
- setTimeout(function(){
299
- card.classList.remove('move')
300
- icons.style="opacity: 1"
301
- call.style="opacity: 1"
302
- },6000)
303
-
304
- </script>
305
-
306
- <style>/* @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300&display=swap'); */
307
- * {
308
- padding: 0;
309
- margin: 0;
310
- box-sizing: border-box;
311
- font-family: 'Roboto', sans-serif;
312
- }
313
- :root {
314
- --width: 250px;
315
- --height: 260px;
316
- --i-width: calc(var(--height)*0.25 - 23px);
317
- }
318
-
319
- @media only screen and (min-width:64.1875em){
320
- video{
321
- height: 100%;
322
- width: 100%;
323
- }
324
-
325
- }
326
- @media only screen and (min-width:46.1875em) and (max-width:63.9375em){
327
- video{
328
- position: fixed;
329
- top:0;
330
- left: 0;
331
- right: 0;
332
- bottom: 0;
333
- background-color: #000;
334
- height: 100%;
335
- display: block;
336
- }
337
- }
338
- @media only screen and (max-width:46.1875em){
339
- video{
340
- position: fixed;
341
- top:0;
342
- left: 0;
343
- right: 0;
344
- bottom: 0;
345
- background-color: #000;
346
- height: 100%;
347
- display: block;
348
- }
349
-
350
- }
351
- body {
352
- height: 100vh;
353
- width: 100vw;
354
- background-color: black;
355
- display: flex;
356
- justify-content: center;
357
- align-items: center;
358
- perspective: 600px;
359
- overflow: hidden;
360
- }
361
- body::before {
362
- content: '';
363
- position: absolute;
364
- left: 0;
365
- top: 0;
366
- width: 100%;
367
- height: 100%;
368
- background: linear-gradient(#E91e63, #FF0);
369
- clip-path: circle(22% at 30% 22%);
370
- z-index: -1;
371
- }
372
- body::after {
373
- content: '';
374
- position: absolute;
375
- left: 0;
376
- top: 0;
377
- width: 100%;
378
- height: 100%;
379
- background: linear-gradient(#FFF, #DA00FF);
380
- clip-path: circle(25% at 70% 80%);
381
- z-index: -1;
382
- }
383
- .container {
384
- position: fixed;
385
- transform-style: preserve-3d;
386
-
387
- display: none;
388
-
389
- z-index: 99;
390
-
391
-
392
- }
393
- @keyframes move{
394
- 0% {
395
- transform: scale(0);
396
- /* opacity: 0; */
397
- border-radius: 50%;
398
- }
399
- 25% {
400
- transform: scale(0.20);
401
- /* opacity: 0.3; */
402
- border-radius: 25%;
403
- }
404
- 50% {
405
- transform: scale(0.50);
406
- /* opacity: 0,6; */
407
- }
408
- 75% {
409
- transform: scale(0.75);
410
- /* opacity: 0,6; */
411
- }
412
- 100% {
413
- transform: scale(1);
414
- /* opacity: 1; */
415
- }
416
- }
417
- .container.move{
418
- animation: move linear 1.5s;
419
- display: block;
420
- }
421
- .container::before{
422
- content: "";
423
- position: absolute;
424
- top:-2px;
425
- left: -2px;
426
- width:calc(100% + 5px) ;
427
- height: calc(100% + 5px);
428
- border:3px solid linear-gradient(45deg,#e6fb04,#00ff66,#00ffff,#ff00ff
429
- ,#ff0099,#6e0dde,#ff3300,#099fff);
430
- /* background: linear-gradient(45deg,#e6fb04,#00ff66,#00ffff,#ff00ff
431
- ,#ff0099,#6e0dde,#ff3300,#099fff); */
432
- animation: animate 20s linear infinite;
433
- background-size: 400%;
434
- /* background:linear-gradient(transparent,#45f3ff,#45f3ff,#45f3ff,transparent); */
435
- z-index: -1;
436
-
437
- }
438
- /* .container::after{
439
- content: "";
440
- position: absolute;
441
-
442
- inset: 3px;
443
- } */
444
- @keyframes animate{
445
- 0%{
446
- /* transform: translate(-50%,-50%) rotate(0deg); */
447
-
448
- background-position: 0 0;
449
- }
450
- 50%{
451
- background-position:100% 0;
452
- }
453
- 100%{
454
- /* transform: translate(-50%,-50%) rotate(360deg); */
455
- background-position: 0 0;
456
- }
457
- }
458
- .card {
459
- position: relative;
460
- width: var(--width);
461
- height: var(--height);
462
- background-color: rgba(255, 255, 255, 0.02);
463
- backdrop-filter: blur(9px);
464
- border-top: 1px solid #FFF2;
465
- border-left: 1px solid #FFF2;
466
- box-shadow: 4px 4px 12px #0004;
467
-
468
-
469
- color: #FFF;
470
- overflow: hidden;
471
- transition: transform 0.7s;
472
- display: flex;
473
- flex-wrap: wrap;
474
- justify-content: center;
475
- transition: 1s linear;
476
- }
477
- .card.move{
478
- width: 120px;
479
- height: 120px;
480
- border-radius: 50%;
481
- overflow: hidden;
482
- padding: 0px;
483
-
484
- }
485
- .card.move .imgbox{
486
- transform: translateY(0);
487
- }
488
- .card.move.card:before{
489
- opacity: 0;
490
- }
491
- .card::before {
492
- content: '';
493
- position: absolute;
494
- left: -99%;
495
- width: 70px;
496
- height: 400px;
497
- background-color: #FFFB;
498
- transform: rotate(38deg) translateY(-25%);
499
- z-index: 1;
500
- }
501
- .container:hover .card:before {
502
- animation: brightness 0.8s 1 forwards;
503
- }
504
- @keyframes brightness {
505
- 0% {
506
- left: -99%;
507
- }
508
- 100% {
509
- left: 120%;
510
- }
511
- }
512
- .imgbox {
513
- width: 115px;
514
- height: 115px;
515
- border: 5px solid transparent;
516
- box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.533);
517
- border-radius: 50%;
518
- overflow: hidden;
519
- text-align: center;
520
- transition: 1s;
521
- transform: translateY(10px);
522
- }
523
- .imgbox:hover{
524
- width: 100%;
525
- height: 100%;
526
- border: none;
527
- border-radius: unset;
528
- transform: translateY(0px);
529
- }
530
- .imgbox:hover.card{
531
- padding: 0;
532
- }
533
- .imgbox img {
534
- width: 100%;
535
- height: 100%;
536
-
537
- }
538
- .name-job {
539
- width: 100%;
540
- text-align: center;
541
- text-shadow: 1px 2px 2px #000;
542
- /* margin-bottom: 40px; */
543
- margin-top: 10px
544
- }
545
-
546
- .name-job h3 {
547
- margin-bottom: 0.1em;
548
- }
549
- .name-job h5 {
550
- color: rgb(36, 219, 36);
551
- line-height: 25px;
552
- }
553
- .info {
554
- grid-column: 2 / 4;
555
- grid-row: 1 / 3;
556
- padding: 7px;
557
- line-height: 1.8;
558
- font-weight: 200;
559
- }
560
- .skills {
561
- display: flex;
562
- justify-content: space-around;
563
- align-items: center;
564
- margin-bottom: 6px;
565
- }
566
- .skills button{
567
- padding: 5px 10px;
568
- width: 85px;
569
- margin: 5px;
570
-
571
-
572
- cursor: pointer;
573
- }
574
- .btn-Follow a{
575
- text-decoration: none;
576
- color: black;
577
- }
578
- .btn-Follow{
579
- background-color: rgb(36, 219, 36);
580
- border-radius: 1px;
581
- border: none;
582
- }
583
- .btn-Follow:hover{
584
- background-color: rgb(2, 250, 2);
585
-
586
- }
587
- .btn-Message a{
588
- text-decoration: none;
589
- color: rgb(36, 219, 36);
590
- }
591
- .btn-Message a:hover{
592
- color: #000;
593
- }
594
- .btn-Message{
595
- border: 1px solid rgb(36, 219, 36);
596
- border-radius: 3px;
597
- background-color: transparent;
598
- color: #fff;
599
- }
600
- .btn-Message:hover{
601
- background-color: rgb(2, 250, 2);
602
- color: red;
603
- }
604
- .skills .fa-brands {
605
- cursor: pointer;
606
- position: relative;
607
- width: 45px;
608
- height: 45px;
609
- background-color: #FFF5;
610
- box-shadow: 0px 2px 4px #0008, 0px -1px 1px #FFF;
611
- display: grid;
612
- place-content: center;
613
- font-size: 1.22em;
614
- border-radius: 50%;
615
- transition: 0.3s;
616
- }
617
- .skills .fa-brands:hover {
618
- background-color: #FFF;
619
- color: #222;
620
- }
621
- .call {
622
- cursor: pointer;
623
- position: absolute;
624
- left: 10px;
625
- top: 10px;
626
- width: 40px;
627
- height: 40px;
628
- background-color: #555;
629
- color: #FFF;
630
- border: 2px solid #FFF;
631
- display: grid;
632
- place-content: center;
633
- border-radius: 50%;
634
- z-index: 1;
635
- transition: 0.4s;
636
- }
637
- .call:focus {
638
- transform: rotateY(45deg) translateX(120px) translateZ(-70px);
639
- }
640
- .call:focus ~ .card {
641
- transform: rotateY(45deg) translateX(140px) translateZ(-120px);
642
- }
643
- .call:focus ~ .icons {
644
- height: var(--height);
645
- transform: translateZ(var(--i-width)) translateY(-50%);
646
- }
647
- .icon {
648
- position: relative;
649
- width: var(--i-width);
650
- height: var(--i-width);
651
- transform-style: preserve-3d;
652
- transform: rotateX(-40deg) rotateY(45deg);
653
- transition: 0.7s;
654
- }
655
- .icons {
656
- position: absolute;
657
- left: 5px;
658
- top: 50%;
659
- width: var(--i-width);
660
- height: calc(var(--i-width)*4);
661
- transition: 0.6s;
662
- display: flex;
663
- flex-direction: column;
664
- justify-content: space-between;
665
- transform: translateZ(calc(var(--i-width) * -1)) translateY(-50%);
666
- transform-style: preserve-3d;
667
- }
668
- .icon .fa-brands {
669
- position: absolute;
670
- left: 0;
671
- top: 0;
672
- width: 100%;
673
- height: 100%;
674
- background-color: #222;
675
- color: #0FF;
676
- border: 1px dashed #0FF;
677
- display: grid;
678
- place-content: center;
679
- font-size: 1.2em;
680
- transition: 0.5s;
681
- }
682
- .call:hover {
683
- border-color: #222;
684
- color: #000;
685
- background-color: #FC0;
686
- }
687
- .icon:hover {
688
- cursor: pointer;
689
- transform: rotateX(-40deg) rotateY(315deg);
690
- }
691
- .icon:hover .fa-brands {
692
- border-color: inherit;
693
- background-color: #FFF;
694
- }
695
- .icon:hover .fa-facebook-f {
696
- color: #0000dd;
697
- }
698
- .icon:hover .fa-twitter {
699
- color: #002fff;
700
- }
701
- .icon:hover .fa-youtube {
702
- color: #F00;
703
- }
704
- .icon:hover .fa-whatsapp {
705
- color: #0F0;
706
- }
707
- .front {
708
- transform: translateZ(calc(var(--i-width)*0.5));
709
- }
710
- .back {
711
- transform: translateZ(calc(var(--i-width)* -0.5));
712
- }
713
- .left {
714
- transform: rotateY(-90deg) translateZ(calc(var(--i-width)* 0.5));
715
- }
716
- .right {
717
- transform: rotateY(90deg) translateZ(calc(var(--i-width)* 0.5));
718
- }
719
- .bottom {
720
- transform: rotateX(-90deg) translateZ(calc(var(--i-width)* 0.5));
721
- }
722
- .top {
723
- transform: rotateX(90deg) translateZ(calc(var(--i-width)* 0.5));
724
- }</style>`
725
- //lazy to change
726
- }
727
-
728
- /!-[ Stating Http Infomation ]-!/
729
-
730
- express.set('DFP', (process.env.port || 8000));
731
- express.use(function(req, res, next) {
732
- switch (req.url.split('?')[0]) {
733
- case '/script.js': {
734
- res.writeHead(200, { 'Content-Type': 'text/javascript' });
735
- res.write(js);
736
- break;
737
- }
738
- case '/style.css': {
739
- res.writeHead(200, { 'Content-Type': 'text/css' });
740
- res.write(css);
741
- break;
742
- }
743
- // case '/History': {
744
- // if (req.query.PassWord == process.env.REPL_OWNER) {
745
- // res.writeHead(200, { 'Content-Type': 'application/json charset=utf-8' });
746
- // res.write(JSON.stringify(console.history,null,2),'utf8');
747
- // res.end();
748
- // }
749
- // else res.json({
750
- // Status: false,
751
- // Error: "Thiếu Params ?PassWord=PassWordCuaBan =))"
752
- // });
753
- // break;
754
- // }
755
- default: {
756
- res.writeHead(200, "OK", { "Content-Type": "text/html" });
757
- res.write(ClassicHTML(global.Fca.Require.Priyansh.HTML.UserName, global.Fca.Data.PremText.includes("Premium") ? "Premium": "Free", global.Fca.Require.Priyansh.HTML.MusicLink));
758
- }
759
- }
760
- res.end();
761
- })
762
-
763
- global.Fca.Require.Web = express;
764
-
765
- /!-[ Function setOptions ]-!/
766
-
767
- /**
768
- * @param {{ [x: string]: boolean; selfListen?: boolean; listenEvents?: boolean; listenTyping?: boolean; updatePresence?: boolean; forceLogin?: boolean; autoMarkDelivery?: boolean; autoMarkRead?: boolean; autoReconnect?: boolean; logRecordSize: any; online?: boolean; emitReady?: boolean; userAgent: any; logLevel?: any; pageID?: any; proxy?: any; }} globalOptions
769
- * @param {{ [x: string]: any; logLevel?: any; forceLogin?: boolean; userAgent?: any; pauseLog?: any; logRecordSize?: any; pageID?: any; proxy?: any; }} options
770
- */
771
-
772
- function setOptions(globalOptions, options) {
773
- Object.keys(options).map(function(key) {
774
- switch (Boolean_Option.includes(key)) {
775
- case true: {
776
- globalOptions[key] = Boolean(options[key]);
777
- break;
778
- }
779
- case false: {
780
- switch (key) {
781
- case 'pauseLog': {
782
- if (options.pauseLog) log.pause();
783
- else log.resume();
784
- break;
785
- }
786
- case 'logLevel': {
787
- log.level = options.logLevel;
788
- globalOptions.logLevel = options.logLevel;
789
- break;
790
- }
791
- case 'logRecordSize': {
792
- log.maxRecordSize = options.logRecordSize;
793
- globalOptions.logRecordSize = options.logRecordSize;
794
- break;
795
- }
796
- case 'pageID': {
797
- globalOptions.pageID = options.pageID.toString();
798
- break;
799
- }
800
- case 'userAgent': {
801
- globalOptions.userAgent = (options.userAgent || 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36');
802
- break;
803
- }
804
- case 'proxy': {
805
- if (typeof options.proxy != "string") {
806
- delete globalOptions.proxy;
807
- utils.setProxy();
808
- } else {
809
- globalOptions.proxy = options.proxy;
810
- utils.setProxy(globalOptions.proxy);
811
- }
812
- break;
813
- }
814
- default: {
815
- log.warn("setOptions", "Unrecognized option given to setOptions: " + key);
816
- break;
817
- }
205
+ else if (Object_Fca.includes(i)) {
206
+ if (global.Fca.Require.utils.getType(Data_Setting[i]) != "Object") {
207
+ Data_Setting[i] = global.Fca.Data.ObjPriyansh[i];
208
+ global.Fca.Require.fs.writeFileSync(process.cwd() + "/PriyanshFca.json", JSON.stringify(Data_Setting, null, "\t"));
818
209
  }
819
- break;
820
- }
821
- }
822
- });
823
- }
824
-
825
- /!-[ Function BuildAPI ]-!/
826
-
827
- /**
828
- * @param {any} globalOptions
829
- * @param {string} html
830
- * @param {{ getCookies: (arg0: string) => any[]; }} jar
831
- */
832
-
833
- function buildAPI(globalOptions, html, jar) {
834
- var maybeCookie = jar.getCookies("https://www.facebook.com").filter(function(/** @type {{ cookieString: () => string; }} */val) { return val.cookieString().split("=")[0] === "c_user"; });
835
-
836
- if (maybeCookie.length === 0) {
837
- switch (global.Fca.Require.Priyansh.AutoLogin) {
838
- case true: {
839
- global.Fca.Require.logger.Warning(global.Fca.Require.Language.Index.AutoLogin, function() {
840
- return global.Fca.AutoLogin();
841
- });
842
- break;
843
- }
844
- case false: {
845
- throw { error: global.Fca.Require.Language.Index.ErrAppState };
846
-
210
+ else continue;
847
211
  }
848
212
  }
849
- }
850
-
851
- if (html.indexOf("/checkpoint/block/?next") > -1) log.warn("login", Language.CheckPointLevelI);
852
-
853
- var userID = maybeCookie[0].cookieString().split("=")[1].toString();
854
- process.env['UID'] = logger.Normal(getText(Language.UID,userID), userID);
855
213
 
856
- try {
857
- clearInterval(checkVerified);
858
- } catch (e) {
859
- console.log(e);
860
- }
861
-
862
- var clientID = (Math.random() * 2147483648 | 0).toString(16);
863
-
864
- var CHECK_MQTT = {
865
- oldFBMQTTMatch: html.match(/irisSeqID:"(.+?)",appID:219994525426954,endpoint:"(.+?)"/),
866
- newFBMQTTMatch: html.match(/{"app_id":"219994525426954","endpoint":"(.+?)","iris_seq_id":"(.+?)"}/),
867
- legacyFBMQTTMatch: html.match(/(\["MqttWebConfig",\[\],{fbid:")(.+?)(",appID:219994525426954,endpoint:")(.+?)(",pollingEndpoint:")(.+?)(3790])/)
868
- }
869
-
870
- let Slot = Object.keys(CHECK_MQTT);
871
-
872
- var mqttEndpoint,region,irisSeqID;
873
- Object.keys(CHECK_MQTT).map(function(MQTT) {
874
- if (CHECK_MQTT[MQTT] && !region) {
875
- switch (Slot.indexOf(MQTT)) {
876
- case 0: {
877
- irisSeqID = CHECK_MQTT[MQTT][1];
878
- mqttEndpoint = CHECK_MQTT[MQTT][2];
879
- region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
880
- return;
214
+ for (let i of Object_Fca) {
215
+ const All_Paths = utils.getPaths(global.Fca.Data.ObjPriyansh[i]);
216
+ const Mission = { Main_Path: i, Data_Path: All_Paths }
217
+ for (let i of Mission.Data_Path) {
218
+ if (Data_Setting[Mission.Main_Path] == undefined) {
219
+ Data_Setting[Mission.Main_Path] = global.Fca.Data.ObjPriyansh[Mission.Main_Path];
220
+ global.Fca.Require.fs.writeFileSync(process.cwd() + "/PriyanshFca.json", JSON.stringify(Data_Setting, null, "\t"));
881
221
  }
882
- case 1: {
883
- irisSeqID = CHECK_MQTT[MQTT][2];
884
- mqttEndpoint = CHECK_MQTT[MQTT][1].replace(/\\\//g, "/");
885
- region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
886
- return;
887
- }
888
- case 2: {
889
- mqttEndpoint = CHECK_MQTT[MQTT][4];
890
- region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
891
- return;
222
+ const User_Data = (utils.getData_Path(Data_Setting[Mission.Main_Path], i, 0))
223
+ const User_Data_Type = utils.getType(User_Data);
224
+ if (User_Data_Type == "Number") {
225
+ const Mission_Path = User_Data == 0 ? i : i.slice(0, User_Data);
226
+ const Mission_Obj = utils.getData_Path(global.Fca.Data.ObjPriyansh[Mission.Main_Path], Mission_Path, 0);
227
+ Data_Setting[Mission.Main_Path] = utils.setData_Path(Data_Setting[Mission.Main_Path], Mission_Path, Mission_Obj)
228
+ global.Fca.Require.fs.writeFileSync(process.cwd() + "/PriyanshFca.json", JSON.stringify(Data_Setting, null, "\t"));
892
229
  }
893
230
  }
894
- return;
895
231
  }
896
- });
897
-
898
- var ctx = {
899
- userID: userID,
900
- jar: jar,
901
- clientID: clientID,
902
- globalOptions: globalOptions,
903
- loggedIn: true,
904
- access_token: 'NONE',
905
- clientMutationId: 0,
906
- mqttClient: undefined,
907
- lastSeqId: irisSeqID,
908
- syncToken: undefined,
909
- mqttEndpoint: mqttEndpoint,
910
- region: region,
911
- firstListen: true
912
- };
913
232
 
914
- var api = {
915
- setOptions: setOptions.bind(null, globalOptions),
916
- getAppState: function getAppState() {
917
- return utils.getAppState(jar);
233
+ if (!global.Fca.Require.languageFile.some((/** @type {{ Language: string; }} */i) => i.Language == Data_Setting.Language)) {
234
+ global.Fca.Require.logger.Warning("Not Support Language: " + Data_Setting.Language + " Only 'en' and 'vi'");
235
+ process.exit(0);
918
236
  }
919
- };
920
-
921
- if (region && mqttEndpoint) {
922
- //do sth
923
- }
924
- else {
925
- log.warn("login", getText(Language.NoAreaData));
926
- api["htmlData"] = html;
927
- }
928
-
929
- var defaultFuncs = utils.makeDefaults(html, userID, ctx);
930
-
931
- fs.readdirSync(__dirname + "/src").filter((/** @type {string} */File) => File.endsWith(".js") && !File.includes('Dev_')).map((/** @type {string} */File) => api[File.split('.').slice(0, -1).join('.')] = require('./src/' + File)(defaultFuncs, api, ctx));
932
-
933
- return {
934
- ctx,
935
- defaultFuncs,
936
- api
937
- };
237
+ global.Fca.Require.Language = global.Fca.Require.languageFile.find((/** @type {{ Language: string; }} */i) => i.Language == Data_Setting.Language).Folder;
238
+ } else process.exit(1);
239
+ global.Fca.Require.Priyansh = Data_Setting;
938
240
  }
939
-
940
- /!-[ Function makeLogin ]-!/
941
-
942
- /**
943
- * @param {{ setCookie: (arg0: any, arg1: string) => void; }} jar
944
- * @param {any} email
945
- * @param {any} password
946
- * @param {{ forceLogin: any; }} loginOptions
947
- * @param {(err: any, api: any) => any} callback
948
- * @param {any} prCallback
949
- */
950
-
951
- function makeLogin(jar, email, password, loginOptions, callback, prCallback) {
952
- return function(/** @type {{ body: any; }} */res) {
953
- var html = res.body,$ = cheerio.load(html),arr = [];
954
-
955
- $("#login_form input").map((i, v) => arr.push({ val: $(v).val(), name: $(v).attr("name") }));
956
-
957
- arr = arr.filter(function(v) {
958
- return v.val && v.val.length;
959
- });
960
-
961
- var form = utils.arrToForm(arr);
962
- form.lsd = utils.getFrom(html, "[\"LSD\",[],{\"token\":\"", "\"}");
963
- form.lgndim = Buffer.from("{\"w\":1440,\"h\":900,\"aw\":1440,\"ah\":834,\"c\":24}").toString('base64');
964
- form.email = email;
965
- form.pass = password;
966
- form.default_persistent = '0';
967
- form.locale = 'en_US';
968
- form.timezone = '240';
969
- form.lgnjs = ~~(Date.now() / 1000);
970
-
971
- html.split("\"_js_").slice(1).map((/** @type {any} */val) => {
972
- jar.setCookie(utils.formatCookie(JSON.parse("[\"" + utils.getFrom(val, "", "]") + "]"), "facebook"),"https://www.facebook.com")
973
- });
974
-
975
- logger.Normal(Language.OnLogin);
976
- return utils
977
- .post("https://www.facebook.com/login/device-based/regular/login/?login_attempt=1&lwv=110", jar, form, loginOptions)
978
- .then(utils.saveCookies(jar))
979
- .then(function(/** @type {{ headers: any; }} */res) {
980
- var headers = res.headers;
981
- if (!headers.location) throw { error: Language.InvaildAccount };
982
-
983
- // This means the account has login approvals turned on.
984
- if (headers.location.indexOf('https://www.facebook.com/checkpoint/') > -1) {
985
- logger.Warning(Language.TwoAuth);
986
- var nextURL = 'https://www.facebook.com/checkpoint/?next=https%3A%2F%2Fwww.facebook.com%2Fhome.php';
987
-
988
- return utils
989
- .get(headers.location, jar, null, loginOptions)
990
- .then(utils.saveCookies(jar))
991
- .then(async function(/** @type {{ body: any; }} */res) {
992
- if (!await Database.get('ThroughAcc')) {
993
- await Database.set('ThroughAcc', email);
994
- }
995
- else {
996
- if (String((await Database.get('ThroughAcc'))).replace(RegExp('"','g'), '') != String(email).replace(RegExp('"','g'), '')) {
997
- await Database.set('ThroughAcc', email);
998
- if (await Database.get('Through2Fa')) {
999
- await Database.delete('Through2Fa');
1000
- }
1001
- }
1002
- }
1003
- var html = res.body,$ = cheerio.load(html), arr = [];
1004
- $("form input").map((i, v) => arr.push({ val: $(v).val(), name: $(v).attr("name") }));
1005
- arr = arr.filter(v => { return v.val && v.val.length });
1006
- var form = utils.arrToForm(arr);
1007
- if (html.indexOf("checkpoint/?next") > -1) {
1008
- setTimeout(() => {
1009
- checkVerified = setInterval((_form) => {}, 5000, {
1010
- fb_dtsg: form.fb_dtsg,
1011
- jazoest: form.jazoest,
1012
- dpr: 1
1013
- });
1014
- }, 2500);
1015
- switch (global.Fca.Require.Priyansh.Login2Fa) {
1016
- case true: {
1017
- try {
1018
- const question = question => {
1019
- const rl = readline.createInterface({
1020
- input: process.stdin,
1021
- output: process.stdout
1022
- });
1023
- return new Promise(resolve => {
1024
- rl.question(question, answer => {
1025
- rl.close();
1026
- return resolve(answer);
1027
- });
1028
- });
1029
- };
1030
- async function EnterSecurityCode() {
1031
- try {
1032
- var Through2Fa = await Database.get('Through2Fa');
1033
- if (Through2Fa) {
1034
- Through2Fa.map(function(/** @type {{ key: string; value: string; expires: string; domain: string; path: string; }} */c) {
1035
- let str = c.key + "=" + c.value + "; expires=" + c.expires + "; domain=" + c.domain + "; path=" + c.path + ";";
1036
- jar.setCookie(str, "http://" + c.domain);
1037
- })
1038
- var from2 = utils.arrToForm(arr);
1039
- from2.lsd = utils.getFrom(html, "[\"LSD\",[],{\"token\":\"", "\"}");
1040
- from2.lgndim = Buffer.from("{\"w\":1440,\"h\":900,\"aw\":1440,\"ah\":834,\"c\":24}").toString('base64');
1041
- from2.email = email;
1042
- from2.pass = password;
1043
- from2.default_persistent = '0';
1044
- from2.locale = 'en_US';
1045
- from2.timezone = '240';
1046
- from2.lgnjs = ~~(Date.now() / 1000);
1047
- return utils
1048
- .post("https://www.facebook.com/login/device-based/regular/login/?login_attempt=1&lwv=110", jar, from2, loginOptions)
1049
- .then(utils.saveCookies(jar))
1050
- .then(function(/** @type {{ headers: any; }} */res) {
1051
- var headers = res.headers;
1052
- if (!headers['set-cookie'][0].includes('deleted')) {
1053
- logger.Warning(Language.ErrThroughCookies, async function() {
1054
- await Database.delete('Through2Fa');
1055
- });
1056
- process.exit(1);
1057
- }
1058
- if (headers.location && headers.location.indexOf('https://www.facebook.com/checkpoint/') > -1) {
1059
- return utils
1060
- .get(headers.location, jar, null, loginOptions)
1061
- .then(utils.saveCookies(jar))
1062
- .then(function(/** @type {{ body: any; }} */res) {
1063
- var html = res.body,$ = cheerio.load(html), arr = [];
1064
- $("form input").map((i, v) => arr.push({ val: $(v).val(), name: $(v).attr("name") }));
1065
- arr = arr.filter(v => { return v.val && v.val.length });
1066
- var from2 = utils.arrToForm(arr);
1067
-
1068
- if (html.indexOf("checkpoint/?next") > -1) {
1069
- setTimeout(() => {
1070
- checkVerified = setInterval((_form) => {}, 5000, {
1071
- fb_dtsg: from2.fb_dtsg,
1072
- jazoest: from2.jazoest,
1073
- dpr: 1
1074
- });
1075
- }, 2500);
1076
- if (!res.headers.location && res.headers['set-cookie'][0].includes('checkpoint')) {
1077
- try {
1078
- delete from2.name_action_selected;
1079
- from2['submit[Continue]'] = $("#checkpointSubmitButton").html();
1080
- return utils
1081
- .post(nextURL, jar, from2, loginOptions)
1082
- .then(utils.saveCookies(jar))
1083
- .then(function() {
1084
- from2['submit[This was me]'] = "This was me";
1085
- return utils.post(nextURL, jar, from2, loginOptions).then(utils.saveCookies(jar));
1086
- })
1087
- .then(function() {
1088
- delete from2['submit[This was me]'];
1089
- from2.name_action_selected = 'save_device';
1090
- from2['submit[Continue]'] = $("#checkpointSubmitButton").html();
1091
- return utils.post(nextURL, jar, from2, loginOptions).then(utils.saveCookies(jar));
1092
- })
1093
- .then(async function(/** @type {{ headers: any; body: string | string[]; }} */res) {
1094
- var headers = res.headers;
1095
- if (!headers.location && res.headers['set-cookie'][0].includes('checkpoint')) throw { error: "wtf ??:D" };
1096
- var appState = utils.getAppState(jar,false);
1097
- await Database.set('Through2Fa', appState);
1098
- return loginHelper(appState, email, password, loginOptions, callback);
1099
- })
1100
- .catch((/** @type {any} */e) => callback(e));
1101
- }
1102
- catch (e) {
1103
- console.log(e)
1104
- }
1105
- }
1106
- }
1107
- })
1108
- }
1109
- return utils.get('https://www.facebook.com/', jar, null, loginOptions).then(utils.saveCookies(jar));
1110
- }).catch((/** @type {any} */e) => console.log(e));
1111
- }
1112
- }
1113
- catch (e) {
1114
- await Database.delete('Through2Fa');
1115
- }
1116
- var code = await question(Language.EnterSecurityCode);
1117
- try {
1118
- form.approvals_code = code;
1119
- form['submit[Continue]'] = $("#checkpointSubmitButton").html();
1120
- var prResolve,prReject;
1121
- var rtPromise = new Promise((resolve, reject) => { prResolve = resolve; prReject = reject; });
1122
- if (typeof code == "string") { //always strings
1123
- utils
1124
- .post(nextURL, jar, form, loginOptions)
1125
- .then(utils.saveCookies(jar))
1126
- .then(function(/** @type {{ body: string | Buffer; }} */res) {
1127
- var $ = cheerio.load(res.body);
1128
- var error = $("#approvals_code").parent().attr("data-xui-error");
1129
- if (error) {
1130
- logger.Warning(Language.InvaildTwoAuthCode,function() { EnterSecurityCode(); }); //bruh loop
1131
- };
1132
- })
1133
- .then(function() {
1134
- delete form.no_fido;delete form.approvals_code;
1135
- form.name_action_selected = 'save_device'; //'save_device' || 'dont_save;
1136
- return utils.post(nextURL, jar, form, loginOptions).then(utils.saveCookies(jar));
1137
- })
1138
- .then(async function(/** @type {{ headers: any; body: string | string[]; }} */res) {
1139
- var headers = res.headers;
1140
- if (!headers.location && res.headers['set-cookie'][0].includes('checkpoint')) {
1141
- try {
1142
- delete form.name_action_selected;
1143
- form['submit[Continue]'] = $("#checkpointSubmitButton").html();
1144
- return utils
1145
- .post(nextURL, jar, form, loginOptions)
1146
- .then(utils.saveCookies(jar))
1147
- .then(function() {
1148
- form['submit[This was me]'] = "This was me";
1149
- return utils.post(nextURL, jar, form, loginOptions).then(utils.saveCookies(jar));
1150
- })
1151
- .then(function() {
1152
- delete form['submit[This was me]'];
1153
- form.name_action_selected = 'save_device';
1154
- form['submit[Continue]'] = $("#checkpointSubmitButton").html();
1155
- return utils.post(nextURL, jar, form, loginOptions).then(utils.saveCookies(jar));
1156
- })
1157
- .then(async function(/** @type {{ headers: any; body: string | string[]; }} */res) {
1158
- var headers = res.headers;
1159
- if (!headers.location && res.headers['set-cookie'][0].includes('checkpoint')) throw { error: "wtf ??:D" };
1160
- var appState = utils.getAppState(jar,false);
1161
- await Database.set('Through2Fa', appState);
1162
- return loginHelper(appState, email, password, loginOptions, callback);
1163
- })
1164
- .catch((/** @type {any} */e) => callback(e));
1165
- }
1166
- catch (e) {
1167
- console.log(e)
1168
- }
1169
- }
1170
- var appState = utils.getAppState(jar,false);
1171
- if (callback === prCallback) {
1172
- callback = function(/** @type {any} */err, /** @type {any} */api) {
1173
- if (err) return prReject(err);
1174
- return prResolve(api);
1175
- };
1176
- }
1177
- await Database.set('Through2Fa', appState);
1178
- return loginHelper(appState, email, password, loginOptions, callback);
1179
- })
1180
- .catch(function(/** @type {any} */err) {
1181
- if (callback === prCallback) prReject(err);
1182
- else callback(err);
1183
- });
1184
- } else {
1185
- utils
1186
- .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" })
1187
- .then(utils.saveCookies(jar))
1188
- .then(async function(/** @type {{ body: string; }} */res) {
1189
- try {
1190
- JSON.parse(res.body.replace(/for\s*\(\s*;\s*;\s*\)\s*;\s*/, ""));
1191
- } catch (ex) {
1192
- clearInterval(checkVerified);
1193
- logger.Warning(Language.VerifiedCheck);
1194
- if (callback === prCallback) {
1195
- callback = function(/** @type {any} */err, /** @type {any} */api) {
1196
- if (err) return prReject(err);
1197
- return prResolve(api);
1198
- };
1199
- }
1200
- let appState = utils.getAppState(jar,false);
1201
- return loginHelper(appState, email, password, loginOptions, callback);
1202
- }
1203
- })
1204
- .catch((/** @type {any} */ex) => {
1205
- log.error("login", ex);
1206
- if (callback === prCallback) prReject(ex);
1207
- else callback(ex);
1208
- });
1209
- }
1210
- return rtPromise;
1211
- }
1212
- catch (e) {
1213
- logger.Error(e)
1214
- logger.Error()
1215
- process.exit(0)
1216
- }
1217
- }
1218
- await EnterSecurityCode()
1219
- }
1220
- catch (e) {
1221
- logger.Error(e)
1222
- logger.Error();
1223
- process.exit(0);
1224
- }
1225
- }
1226
- break;
1227
- case false: {
1228
- throw {
1229
- error: 'login-approval',
1230
- continue: function submit2FA(/** @type {any} */code) {
1231
- form.approvals_code = code;
1232
- form['submit[Continue]'] = $("#checkpointSubmitButton").html(); //'Continue';
1233
- var prResolve,prReject;
1234
- var rtPromise = new Promise((resolve, reject) => { prResolve = resolve; prReject = reject; });
1235
- if (typeof code == "string") {
1236
- utils
1237
- .post(nextURL, jar, form, loginOptions)
1238
- .then(utils.saveCookies(jar))
1239
- .then(function(/** @type {{ body: string | Buffer; }} */res) {
1240
- var $ = cheerio.load(res.body);
1241
- var error = $("#approvals_code").parent().attr("data-xui-error");
1242
- if (error) {
1243
- throw {
1244
- error: 'login-approval',
1245
- errordesc: Language.InvaildTwoAuthCode,
1246
- lerror: error,
1247
- continue: submit2FA
1248
- };
1249
- }
1250
- })
1251
- .then(function() {
1252
- delete form.no_fido;delete form.approvals_code;
1253
- form.name_action_selected = 'dont_save'; //'save_device' || 'dont_save;
1254
- return utils.post(nextURL, jar, form, loginOptions).then(utils.saveCookies(jar));
1255
- })
1256
- .then(function(/** @type {{ headers: any; body: string | string[]; }} */res) {
1257
- var headers = res.headers;
1258
- if (!headers.location && res.headers['set-cookie'][0].includes('checkpoint')) throw { error: Language.ApprovalsErr };
1259
- var appState = utils.getAppState(jar,false);
1260
- if (callback === prCallback) {
1261
- callback = function(/** @type {any} */err, /** @type {any} */api) {
1262
- if (err) return prReject(err);
1263
- return prResolve(api);
1264
- };
1265
- }
1266
- return loginHelper(appState, email, password, loginOptions, callback);
1267
- })
1268
- .catch(function(/** @type {any} */err) {
1269
- if (callback === prCallback) prReject(err);
1270
- else callback(err);
1271
- });
1272
- } else {
1273
- utils
1274
- .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" })
1275
- .then(utils.saveCookies(jar))
1276
- .then((/** @type {{ body: string; }} */res) => {
1277
- try {
1278
- JSON.parse(res.body.replace(/for\s*\(\s*;\s*;\s*\)\s*;\s*/, ""));
1279
- } catch (ex) {
1280
- clearInterval(checkVerified);
1281
- logger.Warning(Language.VerifiedCheck);
1282
- if (callback === prCallback) {
1283
- callback = function(/** @type {any} */err, /** @type {any} */api) {
1284
- if (err) return prReject(err);
1285
- return prResolve(api);
1286
- };
1287
- }
1288
- return loginHelper(utils.getAppState(jar,false), email, password, loginOptions, callback);
1289
- }
1290
- })
1291
- .catch((/** @type {any} */ex) => {
1292
- log.error("login", ex);
1293
- if (callback === prCallback) prReject(ex);
1294
- else callback(ex);
1295
- });
1296
- }
1297
- return rtPromise;
1298
- }
1299
- };
1300
- }
1301
- }
1302
- } else {
1303
- if (!loginOptions.forceLogin) throw { error: Language.ForceLoginNotEnable };
1304
-
1305
- if (html.indexOf("Suspicious Login Attempt") > -1) form['submit[This was me]'] = "This was me";
1306
- else form['submit[This Is Okay]'] = "This Is Okay";
1307
-
1308
- return utils
1309
- .post(nextURL, jar, form, loginOptions)
1310
- .then(utils.saveCookies(jar))
1311
- .then(function() {
1312
- form.name_action_selected = 'dont_save';
1313
-
1314
- return utils.post(nextURL, jar, form, loginOptions).then(utils.saveCookies(jar));
1315
- })
1316
- .then(function(/** @type {{ headers: any; body: string | string[]; }} */res) {
1317
- var headers = res.headers;
1318
-
1319
- if (!headers.location && res.body.indexOf('Review Recent Login') > -1) throw { error: "Something went wrong with review recent login." };
1320
-
1321
- var appState = utils.getAppState(jar,false);
1322
-
1323
- return loginHelper(appState, email, password, loginOptions, callback);
1324
- })
1325
- .catch((/** @type {any} */e) => callback(e));
1326
- }
1327
- });
1328
- }
1329
- return utils.get('https://www.facebook.com/', jar, null, loginOptions).then(utils.saveCookies(jar));
1330
- });
1331
- };
241
+ catch (e) {
242
+ console.log(e);
243
+ global.Fca.Require.logger.Error();
1332
244
  }
1333
245
 
1334
- /!-[ Function backup ]-!/
1335
-
1336
- /**
1337
- * @param {string} data
1338
- * @param {any} globalOptions
1339
- * @param {any} callback
1340
- * @param {any} prCallback
1341
- */
1342
-
1343
- function backup(data,globalOptions, callback, prCallback) {
1344
- try {
1345
- var appstate;
1346
- try {
1347
- appstate = JSON.parse(data)
1348
- }
1349
- catch(e) {
1350
- appstate = data;
1351
- }
1352
- logger.Warning(Language.BackupNoti);
1353
- try {
1354
- loginHelper(appstate,null,null,globalOptions, callback, prCallback)
246
+ /*
247
+ if (global.Fca.Require.FastConfig.Websocket_Extension.Status) {
248
+ console.history = new Array();
249
+ var Convert = require('ansi-to-html');
250
+ var convert = new Convert();
251
+ console.__log = console.log;
252
+ console.log = function (data) {
253
+ const log = convert.toHtml(data)
254
+ console.history.push(log)
255
+ console.__log.apply(console,arguments)
256
+ if (console.history.length > 80) {
257
+ console.history.shift();
1355
258
  }
1356
- catch (e) {
1357
- logger.Error(Language.ErrBackup);
1358
- process.exit(0);
1359
- }
1360
- }
1361
- catch (e) {
1362
- return logger.Error();
1363
259
  }
1364
260
  }
261
+ **/
1365
262
 
1366
- /!-[ async function loginHelper ]-!/
1367
-
1368
- /**
1369
- * @param {string | any[]} appState
1370
- * @param {any} email
1371
- * @param {any} password
1372
- * @param {{ selfListen?: boolean; listenEvents?: boolean; listenTyping?: boolean; updatePresence?: boolean; forceLogin?: boolean; autoMarkDelivery?: boolean; autoMarkRead?: boolean; autoReconnect?: boolean; logRecordSize?: number; online?: boolean; emitReady?: boolean; userAgent?: string; pageID?: any; }} globalOptions
1373
- * @param {(arg0: any, arg1: undefined) => void} callback
1374
- * @param {(error: any, api: any) => any} [prCallback]
1375
- */
1376
-
1377
- async function loginHelper(appState, email, password, globalOptions, callback, prCallback) {
1378
- var mainPromise = null;
1379
- var jar = utils.getJar();
1380
-
1381
- if (fs.existsSync('./backupappstate.json')) {
1382
- fs.unlinkSync('./backupappstate.json');
263
+ module.exports = function(loginData, options, callback) {
264
+ //const Language = global.Fca.Require.languageFile.find((/** @type {{ Language: string; }} */i) => i.Language == global.Fca.Require.FastConfig.Language).Folder.Index;
265
+ var login;
266
+ try {
267
+ login = require('./Main');
1383
268
  }
1384
-
1385
- try {
1386
- if (appState) {
1387
- logger.Normal(Language.OnProcess);
1388
- switch (await Database.has("FBKEY")) {
269
+ catch (e) {
270
+ console.log(e)
271
+ }
272
+ //const fs = require('fs-extra');
273
+ //const got = require('got');
274
+ //const log = require('npmlog');
275
+ //const { execSync } = require('child_process');
276
+ require('./Extra/Database');
277
+
278
+ /*
279
+ return got.get('https://github.com/KanzuXHorizon/Global_Horizon/raw/main/InstantAction.json').then(async function(res) {
280
+ if (global.Fca.Require.FastConfig.AutoInstallNode) {
281
+ switch (fs.existsSync(process.cwd() + "/replit.nix") && process.env["REPL_ID"] != undefined) {
1389
282
  case true: {
1390
- process.env.FBKEY = await Database.get("FBKEY");
1391
- }
1392
- break;
1393
- case false: {
1394
- const SecurityKey = global.Fca.Require.Security.create().apiKey;
1395
- process.env['FBKEY'] = SecurityKey;
1396
- await Database.set('FBKEY', SecurityKey);
1397
- }
283
+ await require('./Extra/Src/Change_Environment.js')();
1398
284
  break;
1399
- default: {
1400
- const SecurityKey = global.Fca.Require.Security.create().apiKey;
1401
- process.env['FBKEY'] = SecurityKey;
1402
- await Database.set('FBKEY', SecurityKey);
1403
285
  }
1404
- }
1405
- try {
1406
- switch (global.Fca.Require.Priyansh.EncryptFeature) {
1407
- case true: {
1408
- appState = JSON.parse(JSON.stringify(appState, null, "\t"));
1409
- switch (utils.getType(appState)) {
1410
- case "Array": {
1411
- switch (utils.getType(appState[0])) {
1412
- case "Object": {
1413
- logger.Normal(Language.NotReadyToDecrypt);
1414
- }
1415
- break;
1416
- case "String": {
1417
- appState = Security(appState,process.env['FBKEY'],'Decrypt');
1418
- logger.Normal(Language.DecryptSuccess);
1419
- }
1420
- }
1421
- }
1422
- break;
1423
- case "Object": {
1424
- try {
1425
- appState = StateCrypt.decryptState(appState, process.env['FBKEY']);
1426
- logger.Normal(Language.DecryptSuccess);
1427
- }
1428
- catch (e) {
1429
- if (process.env.Backup != undefined && process.env.Backup) {
1430
- await backup(process.env.Backup,globalOptions, callback, prCallback);
1431
- }
1432
- else {
286
+ case false: {
287
+ const NodeVersion = execSync('node -v').toString().replace(/(\r\n|\n|\r)/gm, "");
288
+ if (!NodeVersion.includes("v14") && !NodeVersion.includes("v16") && !Database(true).has('SkipReplitNix')) {
289
+ log.warn("[ FCA-UPDATE ] •",global.Fca.getText(Language.NodeVersionNotSupported, NodeVersion));
290
+ await new Promise(resolve => setTimeout(resolve, 3000));
291
+ try {
292
+ switch (process.platform) {
293
+ case "win32": {
1433
294
  try {
1434
- if (await Database.has('Backup')) {
1435
- return await backup(await Database.get('Backup'),globalOptions, callback, prCallback);
1436
- }
1437
- else {
1438
- logger.Normal(Language.ErrBackup);
295
+ //check if user using nvm
296
+ if (fs.existsSync(process.env.APPDATA + "/nvm/nvm.exe")) {
297
+ log.warn("[ FCA-UPDATE ] •", Language.UsingNVM);
1439
298
  process.exit(0);
1440
299
  }
300
+ //download NodeJS v14 for Windows and slient install
301
+ await got('https://nodejs.org/dist/v14.17.0/node-v14.17.0-x64.msi').pipe(fs.createWriteStream(process.cwd() + "/node-v14.17.0-x64.msi"));
302
+ log.info("[ FCA-UPDATE ] •", Language.DownloadingNode);
303
+ await new Promise(resolve => setTimeout(resolve, 3000));
304
+ execSync('msiexec /i node-v14.17.0-x64.msi /qn');
305
+ log.info("[ FCA-UPDATE ] •", Language.NodeDownloadingComplete);
306
+ await new Promise(resolve => setTimeout(resolve, 3000));
307
+ log.info("[ FCA-UPDATE ] •", Language.RestartRequire);
308
+ Database(true).set("NeedRebuild", true);
309
+ process.exit(0);
1441
310
  }
1442
311
  catch (e) {
1443
- logger.Warning(Language.ErrBackup);
1444
- logger.Error();
312
+ log.error("[ FCA-UPDATE ] •",Language.ErrNodeDownload);
1445
313
  process.exit(0);
1446
314
  }
1447
315
  }
1448
- logger.Warning(Language.DecryptFailed);
1449
- return logger.Error();
1450
- }
1451
- }
1452
- break;
1453
- case "String": {
1454
- try {
1455
- appState = StateCrypt.decryptState(appState, process.env['FBKEY']);
1456
- logger.Normal(Language.DecryptSuccess);
1457
- }
1458
- catch (e) {
1459
- if (process.env.Backup != undefined && process.env.Backup) {
1460
- await backup(process.env.Backup,globalOptions, callback, prCallback);
1461
- }
1462
- else {
316
+ case "linux": {
317
+
1463
318
  try {
1464
- if (await Database.has('Backup')) {
1465
- return await backup(await Database.get('Backup'),globalOptions, callback, prCallback);
319
+ if (process.env["REPL_ID"] != undefined) {
320
+ log.warn("[ FCA-UPDATE ] •", "Look like you are using Replit, and didn't have replit.nix file in your project, i don't know how to help you, hmm i will help you pass this step, but you need to install NodeJS v14 by yourself, and restart your repl");
321
+ Database(true).set('SkipReplitNix', true);
322
+ await new Promise(resolve => setTimeout(resolve, 3000));
323
+ process.exit(1);
324
+ }
325
+ //check if user using nvm
326
+ if (fs.existsSync(process.env.HOME + "/.nvm/nvm.sh")) {
327
+ log.warn("[ FCA-UPDATE ] •", Language.UsingNVM);
328
+ process.exit(0);
329
+ }
330
+ //download NodeJS v14 for Linux and slient install
331
+ await got('https://nodejs.org/dist/v14.17.0/node-v14.17.0-linux-x64.tar.xz').pipe(fs.createWriteStream(process.cwd() + "/node-v14.17.0-linux-x64.tar.xz"));
332
+ log.info("[ FCA-UPDATE ] •", Language.DownloadingNode);
333
+ await new Promise(resolve => setTimeout(resolve, 3000));
334
+ execSync('tar -xf node-v14.17.0-linux-x64.tar.xz');
335
+ execSync('cd node-v14.17.0-linux-x64');
336
+ execSync('sudo cp -R * /usr/local/');
337
+ log.info("[ FCA-UPDATE ] •", Language.NodeDownloadingComplete);
338
+ await new Promise(resolve => setTimeout(resolve, 3000));
339
+ log.info("[ FCA-UPDATE ] •",Language.RestartingN);
340
+ Database(true).set("NeedRebuild", true);
341
+ process.exit(1);
1466
342
  }
1467
- else {
1468
- logger.Normal(Language.ErrBackup);
343
+ catch (e) {
344
+ log.error("[ FCA-UPDATE ] •",Language.ErrNodeDownload);
1469
345
  process.exit(0);
1470
346
  }
1471
- }
1472
- catch (e) {
1473
- logger.Warning(Language.ErrBackup);
1474
- logger.Error();
1475
- process.exit(0);
1476
- }
1477
- }
1478
- logger.Warning(Language.DecryptFailed);
1479
- return logger.Error();
1480
- }
1481
- }
1482
- break;
1483
- default: {
1484
- logger.Warning(Language.InvaildAppState);
1485
- process.exit(0)
1486
- }
1487
- }
1488
- }
1489
- break;
1490
- case false: {
1491
- switch (utils.getType(appState)) {
1492
- case "Array": {
1493
- logger.Normal(Language.EncryptStateOff);
1494
- }
1495
- break;
1496
- case "Object": {
1497
- logger.Normal(Language.EncryptStateOff);
1498
- try {
1499
- appState = StateCrypt.decryptState(appState, process.env['FBKEY']);
1500
- logger.Normal(Language.DecryptSuccess);
1501
347
  }
1502
- catch (e) {
1503
- if (process.env.Backup != undefined && process.env.Backup) {
1504
- await backup(process.env.Backup,globalOptions, callback, prCallback);
1505
- }
1506
- else {
348
+ case "darwin": {
1507
349
  try {
1508
- if (await Database.has('Backup')) {
1509
- return await backup(await Database.get('Backup'),globalOptions, callback, prCallback);
1510
- }
1511
- else {
1512
- logger.Warning(Language.ErrBackup);
350
+ //check if user using nvm
351
+ if (fs.existsSync(process.env.HOME + "/.nvm/nvm.sh")) {
352
+ log.warn("[ FCA-UPDATE ] •", Language.UsingNVM);
1513
353
  process.exit(0);
1514
354
  }
355
+ //download NodeJS v14 for MacOS and slient install
356
+ await got('https://nodejs.org/dist/v14.17.0/node-v14.17.0-darwin-x64.tar.gz').pipe(fs.createWriteStream(process.cwd() + "/node-v14.17.0-darwin-x64.tar.gz"));
357
+ log.info("[ FCA-UPDATE ] •", Language.DownloadingNode);
358
+ await new Promise(resolve => setTimeout(resolve, 3000));
359
+ execSync('tar -xf node-v14.17.0-darwin-x64.tar.gz');
360
+ execSync('cd node-v14.17.0-darwin-x64');
361
+ execSync('sudo cp -R * /usr/local/');
362
+ log.info("[ FCA-UPDATE ] •", Language.NodeDownloadingComplete);
363
+ await new Promise(resolve => setTimeout(resolve, 3000));
364
+ log.info("[ FCA-UPDATE ] •",Language.RestartingN);
365
+ Database(true).set("NeedRebuild", true);
366
+ process.exit(1);
1515
367
  }
1516
368
  catch (e) {
1517
- logger.Warning(Language.ErrBackup);
1518
- logger.Error();
369
+ log.error("[ FCA-UPDATE ] •",Language.ErrNodeDownload);
1519
370
  process.exit(0);
1520
371
  }
1521
372
  }
1522
- logger.Warning(Language.DecryptFailed);
1523
- return logger.Error();
1524
- }
1525
373
  }
1526
- break;
1527
- default: {
1528
- logger.Warning(Language.InvaildAppState);
1529
- process.exit(0)
1530
- }
1531
- }
1532
- }
1533
- break;
1534
- default: {
1535
- logger.Warning(getText(Language.IsNotABoolean,global.Fca.Require.Priyansh.EncryptFeature))
1536
- process.exit(0);
374
+ }
375
+ catch (e) {
376
+ console.log(e);
377
+ log.error("[ FCA-UPDATE ] •","NodeJS v14 Installation Failed, Please Try Again and Contact fb.com/Lazic.Kanzu!");
378
+ process.exit(0);
379
+ }
1537
380
  }
1538
381
  }
1539
382
  }
1540
- catch (e) {
1541
- console.log(e);
1542
- }
1543
-
1544
- try {
1545
- appState = JSON.parse(appState);
1546
383
  }
1547
- catch (e) {
384
+ if ((Database(true).get("NeedRebuild")) == true) {
385
+ Database(true).set("NeedRebuild", false);
386
+ log.info("[ FCA-UPDATE ] •",Language.Rebuilding);
387
+ await new Promise(resolve => setTimeout(resolve, 3000));
1548
388
  try {
1549
- appState = appState;
389
+ execSync('npm rebuild', {stdio: 'inherit'});
1550
390
  }
1551
391
  catch (e) {
1552
- return logger.Error();
392
+ console.log(e);
393
+ log.error("[ FCA-UPDATE ] •",Language.ErrRebuilding);
1553
394
  }
395
+ log.info("[ FCA-UPDATE ] •",Language.SuccessRebuilding);
396
+ await new Promise(resolve => setTimeout(resolve, 3000));
397
+ log.info("[ FCA-UPDATE ] •",Language.RestartingN);
398
+ process.exit(1);
1554
399
  }
1555
-
1556
- try {
1557
- global.Fca.Data.AppState = appState;
1558
- appState.map(function(/** @type {{ key: string; value: string; expires: string; domain: string; path: string; }} */c) {
1559
- var str = c.key + "=" + c.value + "; expires=" + c.expires + "; domain=" + c.domain + "; path=" + c.path + ";";
1560
- jar.setCookie(str, "http://" + c.domain);
1561
- });
1562
400
 
1563
- process.env.Backup = appState;
1564
- await Database.set('Backup', appState);
1565
- mainPromise = utils.get('https://www.facebook.com/', jar, null, globalOptions, { noRef: true }).then(utils.saveCookies(jar));
1566
- } catch (e) {
1567
- console.log(e)
1568
- if (process.env.Backup != undefined && process.env.Backup) {
1569
- return await backup(process.env.Backup,globalOptions, callback, prCallback);
1570
- }
1571
- try {
1572
- if (await Database.has('Backup')) {
1573
- return await backup(await Database.get('Backup'),globalOptions, callback, prCallback);
401
+ let Data = JSON.parse(res.body);
402
+ if (global.Fca.Require.FastConfig.Stable_Version.Accept == true) {
403
+ if (Data.Stable_Version.Valid_Version.includes(global.Fca.Require.FastConfig.Stable_Version.Version)) {
404
+ let TimeStamp = Database(true).get('Check_Update');
405
+ if (TimeStamp == null || TimeStamp == undefined || Date.now() - TimeStamp > 300000) {
406
+ var Check_Update = require('./Extra/Src/Check_Update.js');
407
+ await Check_Update(global.Fca.Require.FastConfig.Stable_Version.Version);
408
+ }
1574
409
  }
1575
410
  else {
1576
- logger.Warning(Language.ErrBackup);
1577
- process.exit(0);
411
+ log.warn("[ FCA-UPDATE ] •", "Error Stable Version, Please Check Your Stable Version in FastConfig.json, Automatically turn off Stable Version!");
412
+ global.Fca.Require.FastConfig.Stable_Version.Accept = false;
413
+ global.Fca.Require.fs.writeFileSync(process.cwd() + "/PriyanshFca.json", JSON.stringify(global.Fca.Require.FastConfig, null, "\t"));
414
+ process.exit(1);
1578
415
  }
1579
416
  }
1580
- catch (e) {
1581
- logger.Warning(Language.ErrBackup);
1582
- process.exit(0);
1583
- }
1584
- return logger.Warning(Language.ErrBackup); // unreachable 👑
1585
- }
1586
- } else {
1587
- mainPromise = utils
1588
- .get("https://www.facebook.com/", null, null, globalOptions, { noRef: true })
1589
- .then(utils.saveCookies(jar))
1590
- .then(makeLogin(jar, email, password, globalOptions, callback, prCallback))
1591
- .then(function() {
1592
- return utils.get('https://www.facebook.com/', jar, null, globalOptions).then(utils.saveCookies(jar));
1593
- });
1594
- }
1595
- } catch (e) {
1596
- console.log(e);
1597
- }
1598
- function CheckAndFixErr(res) {
1599
- let reg_antierr = /This browser is not supported/gs; // =))))))
1600
- if (reg_antierr.test(res.body)) {
1601
- const Data = JSON.stringify(res.body);
1602
- const Dt_Check = Data.split('2Fhome.php&amp;gfid=')[1];
1603
- if (Dt_Check == undefined) return res
1604
- const fid = Dt_Check.split("\\\\")[0];//fix sau
1605
- if (Dt_Check == undefined || Dt_Check == "") return res
1606
- const final_fid = fid.split(`\\`)[0];
1607
- if (final_fid == undefined || final_fid == '') return res;
1608
- const redirectlink = redirect[1] + "a/preferences.php?basic_site_devices=m_basic&uri=" + encodeURIComponent("https://m.facebook.com/home.php") + "&gfid=" + final_fid;
1609
- bypass_region_err = true;
1610
- return utils.get(redirectlink, jar, null, globalOptions).then(utils.saveCookies(jar));
1611
- }
1612
- else return res
1613
- }
1614
-
1615
- function Redirect(res) {
1616
- var reg = /<meta http-equiv="refresh" content="0;url=([^"]+)[^>]+>/;
1617
- redirect = reg.exec(res.body);
1618
- if (redirect && redirect[1]) return utils.get(redirect[1], jar, null, globalOptions).then(utils.saveCookies(jar));
1619
- return res;
1620
- }
1621
-
1622
- let redirect = [1, "https://m.facebook.com/"];
1623
- let bypass_region_err = false;
1624
- var ctx,api;
1625
- mainPromise = mainPromise
1626
- .then(res => Redirect(res))
1627
- .then(res => CheckAndFixErr(res))
1628
-
1629
- //fix via login with defaut UA return WWW.facebook.com not m.facebook.com
1630
-
1631
- .then(function(res) {
1632
- let Regex_Via = /MPageLoadClientMetrics/gs; //default for normal account, can easily get region, without this u can't get region in some case but u can run normal
1633
- if (!Regex_Via.test(res.body)) {
1634
- //www.facebook.com
1635
- globalOptions.userAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1";
1636
- return utils.get('https://www.facebook.com/', jar, null, globalOptions, { noRef: true }).then(utils.saveCookies(jar));
417
+ else {
418
+ if (Data.HasProblem == true || Data.ForceUpdate == true) {
419
+ let TimeStamp = Database(true).get('Instant_Update');
420
+ if (TimeStamp == null || TimeStamp == undefined || Date.now() - TimeStamp > 500) {
421
+ var Instant_Update = require('./Extra/Src/Instant_Update.js');
422
+ await Instant_Update()
1637
423
  }
1638
- else return res
1639
- })
1640
- .then(res => Redirect(res))
1641
- .then(res => CheckAndFixErr(res))
1642
- // .then(function(res) {
1643
- // let reg_old_web = /Switch Default Site/gs;
1644
- // if (reg_old_web.test(res.body)) {
1645
- // let Data_Resp = JSON.stringify(res.body);
1646
- // const link = Data_Resp.split('settings/site')[1].split("\"")[0].replace('\\', '')
1647
- // const redirect_link2 = redirect[1] + "settings/site" + utils.cleanHTML(link)
1648
- // console.log(redirect_link2)
1649
- // return utils.get("https://www.facebook.com/", jar, null, globalOptions).then(utils.saveCookies(jar)); // try ag
1650
- // }
1651
- // else return res;
1652
- // })
1653
- // .then(function(res) {
1654
- // var reg = /<meta http-equiv="refresh" content="0;url=([^"]+)[^>]+>/;
1655
- // redirect = reg.exec(res.body);
1656
- // if (redirect && redirect[1]) return utils.get(redirect[1], jar, null, globalOptions).then(utils.saveCookies(jar));
1657
- // return res;
1658
- // })
1659
- .then(function(res){
1660
- var html = res.body,Obj = buildAPI(globalOptions, html, jar,bypass_region_err);
1661
- ctx = Obj.ctx;
1662
- api = Obj.api;
1663
- return res;
1664
- });
1665
- if (globalOptions.pageID) {
1666
- mainPromise = mainPromise
1667
- .then(function() {
1668
- return utils.get('https://www.facebook.com/' + ctx.globalOptions.pageID + '/messages/?section=messages&subsection=inbox', ctx.jar, null, globalOptions);
1669
- })
1670
- .then(function(resData) {
1671
- var url = utils.getFrom(resData.body, 'window.location.replace("https:\\/\\/www.facebook.com\\', '");').split('\\').join('');
1672
- url = url.substring(0, url.length - 1);
1673
- return utils.get('https://www.facebook.com' + url, ctx.jar, null, globalOptions);
1674
- });
424
+ }
425
+ else {
426
+ let TimeStamp = Database(true).get('Check_Update');
427
+ if (TimeStamp == null || TimeStamp == undefined || Date.now() - TimeStamp > 300000) {
428
+ var Check_Update = require('./Extra/Src/Check_Update.js');
429
+ await Check_Update()
430
+ }
431
+ }
1675
432
  }
1676
- mainPromise
1677
- .then(async() => {
1678
- logger.Normal(getText(Language.LocalVersion,global.Fca.Version));
1679
- logger.Normal(getText(Language.CountTime,global.Fca.Data.CountTime()))
1680
- logger.Normal(Language.WishMessage[Math.floor(Math.random()*Language.WishMessage.length)]);
1681
- require('./Extra/ExtraUptimeRobot')();
1682
- callback(null, api);
1683
- }).catch(function(/** @type {{ error: any; }} */e) {
1684
- log.error("login", e.error || e);
1685
- callback(e);
1686
- });
1687
- }
1688
-
1689
- /**
1690
- * It asks the user for their account and password, and then saves it to the database.
1691
- */
1692
-
1693
- function setUserNameAndPassWord() {
1694
- let rl = readline.createInterface({
1695
- input: process.stdin,
1696
- output: process.stdout
433
+ return login(loginData, options, callback);
434
+ }).catch(function(err) {
435
+ console.log(err)
436
+ log.error("[ FCA-UPDATE ] •",Language.UnableToConnect);
437
+ log.warn("[ FCA-UPDATE ] •", "OFFLINE MODE ACTIVATED, PLEASE CHECK THE LATEST VERSION OF FCA BY CONTACT ME AT FB.COM/LAZIC.KANZU");
438
+ return login(loginData, options, callback);
1697
439
  });
1698
- let localbrand2 = global.Fca.Version
1699
- console.clear();
1700
- console.log(figlet.textSync('Horizon', {font: 'ANSI Shadow',horizontalLayout: 'default',verticalLayout: 'default',width: 0,whitespaceBreak: true }));
1701
- console.log(chalk.bold.hex('#9900FF')("[</>]") + chalk.bold.yellow(' => ') + "Operating System: " + chalk.bold.red(os.type()));
1702
- console.log(chalk.bold.hex('#9900FF')("[</>]") + chalk.bold.yellow(' => ') + "Machine Version: " + chalk.bold.red(os.version()));
1703
- console.log(chalk.bold.hex('#9900FF')("[</>]") + chalk.bold.yellow(' => ') + "Fca Version: " + chalk.bold.red(localbrand2) + '\n');
440
+ **/
441
+ //temp disabled
1704
442
  try {
1705
- rl.question(Language.TypeAccount, (Account) => {
1706
- if (!Account.includes("@") && global.Fca.Require.utils.getType(parseInt(Account)) != "Number") return logger.Normal(Language.TypeAccountError, function () { process.exit(1) }); //Very Human
1707
- else rl.question(Language.TypePassword,async function (Password) {
1708
- rl.close();
1709
- try {
1710
- await Database.set("Account", Account);
1711
- await Database.set("Password", Password);
1712
- }
1713
- catch (e) {
1714
- logger.Warning(Language.ErrDataBase);
1715
- logger.Error();
1716
- process.exit(0);
1717
- }
1718
- if (global.Fca.Require.Priyansh.ResetDataLogin) {
1719
- global.Fca.Require.Priyansh.ResetDataLogin = false;
1720
- global.Fca.Require.fs.writeFileSync(process.cwd() + '/PriyanshFca.json', JSON.stringify(global.Fca.Require.Priyansh, null, 4));
1721
- }
1722
- logger.Success(Language.SuccessSetData);
1723
- process.exit(1);
1724
- });
1725
- })
443
+ login(loginData, options, callback);
1726
444
  }
1727
445
  catch (e) {
1728
- logger.Error(e)
1729
- }
1730
- }
1731
-
1732
- /**
1733
- * @param {{ email: any; password: any; appState: any; }} loginData
1734
- * @param {{}} options
1735
- * @param {(error: any, api: any) => any} callback
1736
- */
1737
-
1738
- function login(loginData, options, callback) {
1739
-
1740
- if (utils.getType(loginData) == "Array") {
1741
- if (loginData.length == 3) {
1742
- options = loginData[1];
1743
- callback = loginData[2];
1744
- loginData = loginData[0]
1745
- }
1746
- else if (loginData.length == 2) {
1747
- options = loginData[1];
1748
- loginData = loginData[0]
1749
- }
1750
- else {
1751
- loginData = loginData[0]
1752
- }
1753
- }
1754
-
1755
- if (utils.getType(options) === 'Function' || utils.getType(options) === 'AsyncFunction') {
1756
- callback = options;
1757
- options = {};
1758
- }
1759
-
1760
- var globalOptions = {
1761
- selfListen: true,
1762
- listenEvents: true,
1763
- listenTyping: true,
1764
- updatePresence: false,
1765
- forceLogin: false,
1766
- autoMarkDelivery: true,
1767
- autoMarkRead: true,
1768
- autoReconnect: true,
1769
- logRecordSize: 100,
1770
- online: true,
1771
- emitReady: false,
1772
- 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"
1773
- };
1774
-
1775
- if (loginData.email && loginData.password) {
1776
- setOptions(globalOptions, {
1777
- logLevel: "silent",
1778
- forceLogin: true,
1779
- userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.114 Safari/537.36"
1780
- });
1781
- }
1782
- else if (loginData.appState) {
1783
- setOptions(globalOptions, options);
1784
- }
1785
-
1786
- var prCallback = null;
1787
- if (utils.getType(callback) !== "Function" && utils.getType(callback) !== "AsyncFunction") {
1788
- var rejectFunc = null;
1789
- var resolveFunc = null;
1790
- var returnPromise = new Promise(function(resolve, reject) {
1791
- resolveFunc = resolve;
1792
- rejectFunc = reject;
1793
- });
1794
- prCallback = function(/** @type {any} */error, /** @type {any} */api) {
1795
- if (error) return rejectFunc(error);
1796
- return resolveFunc(api);
1797
- };
1798
- callback = prCallback;
446
+ console.log(e)
1799
447
  }
1800
-
1801
- (async function() {
1802
- var Premium = require("./Extra/Src/Premium");
1803
- global.Fca.Data.PremText = await Premium(global.Fca.Require.Security.create().uuid) || "Bạn Đang Sài Phiên Bản: Free !";
1804
- if (!loginData.email && !loginData.password) {
1805
- switch (global.Fca.Require.Priyansh.AutoLogin) {
1806
- case true: {
1807
- if (global.Fca.Require.Priyansh.ResetDataLogin) return setUserNameAndPassWord();
1808
- else {
1809
- try {
1810
- if (await Database.get("TempState")) {
1811
- try {
1812
- loginData.appState = JSON.parse(await Database.get("TempState"));
1813
- }
1814
- catch (_) {
1815
- loginData.appState = await Database.get("TempState");
1816
- }
1817
- await Database.delete("TempState");
1818
- }
1819
- }
1820
- catch (e) {
1821
- console.log(e)
1822
- await Database.delete("TempState");
1823
- logger.Warning(Language.ErrDataBase);
1824
- logger.Error();
1825
- process.exit(0);
1826
- }
1827
- try {
1828
- if (await Database.has('Account') && await Database.has('Password')) return loginHelper(loginData.appState, loginData.email, loginData.password, globalOptions, callback, prCallback);
1829
- else return setUserNameAndPassWord();
1830
- }
1831
- catch (e) {
1832
- console.log(e)
1833
- logger.Warning(Language.ErrDataBase);
1834
- logger.Error();
1835
- process.exit(0);
1836
- }
1837
- }
1838
- }
1839
- case false: {
1840
- loginHelper(loginData.appState, loginData.email, loginData.password, globalOptions, callback, prCallback);
1841
- }
1842
- }
1843
- }
1844
- else loginHelper(loginData.appState, loginData.email, loginData.password, globalOptions, callback, prCallback);
1845
- })()
1846
- return returnPromise;
1847
- }
1848
-
1849
- module.exports = login;
448
+ };