fca-test-mtx 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. package/.cache/nix/binary-cache-v6.sqlite-journal +0 -0
  2. package/.cache/replit/__replit_disk_meta.json +1 -0
  3. package/.cache/replit/modules/nodejs-20:v22-20240103-2da4911.res +1 -0
  4. package/.cache/replit/modules.stamp +0 -0
  5. package/.cache/replit/nix/env.json +1 -0
  6. package/.cache/typescript/5.0/package.json +1 -0
  7. package/.cache/typescript/5.3/package.json +1 -0
  8. package/.gitattributes +2 -0
  9. package/.prettierrc +4 -0
  10. package/.replit +14 -0
  11. package/.upm/store.json +1 -0
  12. package/Extra/Database/index.js +469 -0
  13. package/Extra/ExtraAddons.js +82 -0
  14. package/Extra/ExtraFindUID.js +62 -0
  15. package/Extra/ExtraGetThread.js +340 -0
  16. package/Extra/ExtraScreenShot.js +430 -0
  17. package/Extra/ExtraUptimeRobot.js +38 -0
  18. package/Extra/Html/Classic/script.js +119 -0
  19. package/Extra/Html/Classic/style.css +8 -0
  20. package/Extra/Security/AES_256_GCM/index.js +0 -0
  21. package/Extra/Security/Base/Step_1.js +6 -0
  22. package/Extra/Security/Base/Step_2.js +22 -0
  23. package/Extra/Security/Base/Step_3.js +22 -0
  24. package/Extra/Security/Base/index.js +173 -0
  25. package/Extra/Security/Index.js +5 -0
  26. package/Extra/Security/Step_1.js +6 -0
  27. package/Extra/Security/Step_2.js +22 -0
  28. package/Extra/Security/Step_3.js +22 -0
  29. package/Extra/Src/Change_Environment.js +24 -0
  30. package/Extra/Src/Check_Update.js +66 -0
  31. package/Extra/Src/History.js +115 -0
  32. package/Extra/Src/Instant_Update.js +65 -0
  33. package/Extra/Src/Last-Run.js +65 -0
  34. package/Extra/Src/Premium.js +81 -0
  35. package/Extra/Src/Release_Memory.js +41 -0
  36. package/Extra/Src/Websocket.js +213 -0
  37. package/Extra/Src/images/checkmate.jpg +0 -0
  38. package/Extra/Src/uuid.js +137 -0
  39. package/ExtraGetThread.js +1217 -0
  40. package/Func/AcceptAgreement.js +31 -0
  41. package/Func/ClearCache.js +64 -0
  42. package/Func/ReportV1.js +54 -0
  43. package/LICENSE +21 -0
  44. package/Language/index.json +110 -0
  45. package/README.md +136 -0
  46. package/SECURITY.md +18 -0
  47. package/broadcast.js +40 -0
  48. package/index.js +387 -0
  49. package/ivancotacte1.png +0 -0
  50. package/ivancotacte2.jpg +0 -0
  51. package/ivancotacte3.png +0 -0
  52. package/logger.js +67 -0
  53. package/package.json +93 -0
  54. package/replit.nix +3 -0
  55. package/src/Dev_Horizon_Data.js +125 -0
  56. package/src/Premium.js +25 -0
  57. package/src/Screenshot.js +83 -0
  58. package/src/addExternalModule.js +16 -0
  59. package/src/addUserToGroup.js +79 -0
  60. package/src/changeAdminStatus.js +79 -0
  61. package/src/changeArchivedStatus.js +41 -0
  62. package/src/changeAvt.js +85 -0
  63. package/src/changeBio.js +65 -0
  64. package/src/changeBlockedStatus.js +36 -0
  65. package/src/changeGroupImage.js +106 -0
  66. package/src/changeNickname.js +45 -0
  67. package/src/changeThreadColor.js +62 -0
  68. package/src/changeThreadEmoji.js +42 -0
  69. package/src/createNewGroup.js +70 -0
  70. package/src/createPoll.js +60 -0
  71. package/src/deleteMessage.js +45 -0
  72. package/src/deleteThread.js +43 -0
  73. package/src/forwardAttachment.js +48 -0
  74. package/src/getAccessToken.js +28 -0
  75. package/src/getCurrentUserID.js +7 -0
  76. package/src/getEmojiUrl.js +27 -0
  77. package/src/getFriendsList.js +73 -0
  78. package/src/getMessage.js +80 -0
  79. package/src/getThreadHistory.js +537 -0
  80. package/src/getThreadInfo.js +425 -0
  81. package/src/getThreadList.js +213 -0
  82. package/src/getThreadMain.js +220 -0
  83. package/src/getThreadPictures.js +59 -0
  84. package/src/getUID.js +59 -0
  85. package/src/getUserID.js +62 -0
  86. package/src/getUserInfo.js +113 -0
  87. package/src/getUserInfoMain.js +65 -0
  88. package/src/getUserInfoV2.js +32 -0
  89. package/src/getUserInfoV3.js +63 -0
  90. package/src/getUserInfoV4.js +55 -0
  91. package/src/getUserInfoV5.js +61 -0
  92. package/src/handleFriendRequest.js +46 -0
  93. package/src/handleMessageRequest.js +49 -0
  94. package/src/httpGet.js +49 -0
  95. package/src/httpPost.js +48 -0
  96. package/src/httpPostFormData.js +41 -0
  97. package/src/listenMqtt.js +787 -0
  98. package/src/logout.js +68 -0
  99. package/src/markAsDelivered.js +48 -0
  100. package/src/markAsRead.js +70 -0
  101. package/src/markAsReadAll.js +43 -0
  102. package/src/markAsSeen.js +51 -0
  103. package/src/muteThread.js +47 -0
  104. package/src/removeUserFromGroup.js +49 -0
  105. package/src/resolvePhotoUrl.js +37 -0
  106. package/src/searchForThread.js +43 -0
  107. package/src/sendMessage.js +455 -0
  108. package/src/sendTypingIndicator.js +80 -0
  109. package/src/setMessageReaction.js +109 -0
  110. package/src/setPostReaction.js +102 -0
  111. package/src/setTitle.js +74 -0
  112. package/src/threadColors.js +39 -0
  113. package/src/unfriend.js +43 -0
  114. package/src/unsendMessage.js +40 -0
  115. package/test/Database_Test.js +4 -0
  116. package/test/ExtraGetThread.js +530 -0
  117. package/test/Horizon_Database/A_README.md +1 -0
  118. package/test/Horizon_Database/Database.db +0 -0
  119. package/test/data/shareAttach.js +146 -0
  120. package/test/data/something.mov +0 -0
  121. package/test/data/test.png +0 -0
  122. package/test/data/test.txt +7 -0
  123. package/test/example-config.json +18 -0
  124. package/test/example-db.db +0 -0
  125. package/test/memoryleak.js +18 -0
  126. package/test/test-page.js +140 -0
  127. package/test/test.js +385 -0
  128. package/test/testv2.js +18 -0
  129. package/utils.js +1683 -0
package/index.js ADDED
@@ -0,0 +1,387 @@
1
+ 'use strict';
2
+ /* eslint-disable linebreak-style */
3
+ const utils = require('./utils');
4
+ global.Fca = new Object({
5
+ isThread: new Array(),
6
+ isUser: new Array(),
7
+ startTime: Date.now(),
8
+ Setting: new Map(),
9
+ Version: require('./package.json').version,
10
+ Require: new Object({
11
+ fs: require("fs"),
12
+ Fetch: require('got'),
13
+ log: require("npmlog"),
14
+ utils: require("./utils.js"),
15
+ logger: require('./logger.js'),
16
+ languageFile: require('./Language/index.json'),
17
+ Security: require('./Extra/Src/uuid.js')
18
+ }),
19
+ getText: function(/** @type {any[]} */...Data) {
20
+ var Main = (Data.splice(0,1)).toString();
21
+ for (let i = 0; i < Data.length; i++) Main = Main.replace(RegExp(`%${i + 1}`, 'g'), Data[i]);
22
+ return Main;
23
+ },
24
+ Data: new Object({
25
+ ObjFastConfig: {
26
+ "Language": "en",
27
+ "PreKey": "",
28
+ "AutoUpdate": false,
29
+ "CustomFont": true,
30
+ "MainColor": "#FFFF00",
31
+ "MainName": "[ FCA-MrTomXxX ]",
32
+ "Uptime": false,
33
+ "Config": "default",
34
+ "DevMode": false,
35
+ "Login2Fa": false,
36
+ "AutoLogin": false,
37
+ "BroadCast": true,
38
+ "AuthString": "SD4S XQ32 O2JA WXB3 FUX2 OPJ7 Q7JZ 4R6Z | https://i.imgur.com/RAg3rvw.png Please remove this !, Recommend If You Using getUserInfoV2",
39
+ "EncryptFeature": true,
40
+ "ResetDataLogin": false,
41
+ "AutoInstallNode": false,
42
+ "AntiSendAppState": true,
43
+ "AutoRestartMinutes": 0,
44
+ "RestartMQTT_Minutes": 0,
45
+ "Websocket_Extension": {
46
+ "Status": false,
47
+ "ResetData": false,
48
+ "AppState_Path": "appstate.json"
49
+ },
50
+ "HTML": {
51
+ "HTML": true,
52
+ "UserName": "Guest",
53
+ "MusicLink": ""
54
+ },
55
+ "AntiGetInfo": {
56
+ "Database_Type": "default", //json or default
57
+ "AntiGetThreadInfo": true,
58
+ "AntiGetUserInfo": true
59
+ },
60
+ "Stable_Version": {
61
+ "Accept": false,
62
+ "Version": ""
63
+ }
64
+ },
65
+ CountTime: function() {
66
+ var fs = global.Fca.Require.fs;
67
+ if (fs.existsSync(__dirname + '/CountTime.json')) {
68
+ try {
69
+ var data = Number(fs.readFileSync(__dirname + '/CountTime.json', 'utf8')),
70
+ hours = Math.floor(data / (60 * 60));
71
+ }
72
+ catch (e) {
73
+ fs.writeFileSync(__dirname + '/CountTime.json', 0);
74
+ hours = 0;
75
+ }
76
+ }
77
+ else {
78
+ hours = 0;
79
+ }
80
+ return `${hours} Hours`;
81
+ }
82
+ }),
83
+ Action: function(Type) {
84
+ switch (Type) {
85
+ case "AutoLogin": {
86
+ var Database = require('./Extra/Database');
87
+ var logger = global.Fca.Require.logger;
88
+ var Email = (Database().get('Account')).replace(RegExp('"', 'g'), ''); //hmm IDK
89
+ var PassWord = (Database().get('Password')).replace(RegExp('"', 'g'), '');
90
+ require('./Main')({ email: Email, password: PassWord},async (error, api) => {
91
+ if (error) {
92
+ logger.Error(JSON.stringify(error,null,2), function() { logger.Error("AutoLogin Failed!", function() { process.exit(0); }) });
93
+ }
94
+ try {
95
+ Database().set("TempState", Database().get('Through2Fa'));
96
+ }
97
+ catch(e) {
98
+ logger.Warning(global.Fca.Require.Language.Index.ErrDatabase);
99
+ logger.Error();
100
+ process.exit(0);
101
+ }
102
+ process.exit(1);
103
+ });
104
+ }
105
+ break;
106
+ default: {
107
+ require('npmlog').Error("Invalid Message!");
108
+ };
109
+ }
110
+ }
111
+ });
112
+
113
+ try {
114
+ let Boolean_Fca = ["AntiSendAppState","AutoUpdate","CustomFont","Uptime","BroadCast","EncryptFeature","AutoLogin","ResetDataLogin","Login2Fa", "DevMode","AutoInstallNode"];
115
+ let String_Fca = ["MainName","PreKey","Language","AuthString","Config"]
116
+ let Number_Fca = ["AutoRestartMinutes","RestartMQTT_Minutes"];
117
+ let Object_Fca = ["HTML","Stable_Version","AntiGetInfo","Websocket_Extension"];
118
+ let All_Variable = Boolean_Fca.concat(String_Fca,Number_Fca,Object_Fca);
119
+
120
+
121
+ if (!global.Fca.Require.fs.existsSync(process.cwd() + '/MTX_Database/FastConfigFca.json')) {
122
+ global.Fca.Require.fs.writeFileSync(process.cwd() + "/MTX_Database/FastConfigFca.json", JSON.stringify(global.Fca.Data.ObjFastConfig, null, "\t"));
123
+ process.exit(1);
124
+ }
125
+
126
+ try {
127
+ var Data_Setting = require(process.cwd() + "/MTX_Database/FastConfigFca.json");
128
+ }
129
+ catch (e) {
130
+ global.Fca.Require.logger.Error('Detect Your /MTX_Database/FastConfigFca.json Settings Invalid!, Carry out default restoration');
131
+ global.Fca.Require.fs.writeFileSync(process.cwd() + "/MTX_Database/FastConfigFca.json", JSON.stringify(global.Fca.Data.ObjFastConfig, null, "\t"));
132
+ process.exit(1)
133
+ }
134
+ if (global.Fca.Require.fs.existsSync(process.cwd() + '/MTX_Database/FastConfigFca.json')) {
135
+
136
+ for (let i of All_Variable) {
137
+ if (Data_Setting[i] == undefined) {
138
+ Data_Setting[i] = global.Fca.Data.ObjFastConfig[i];
139
+ global.Fca.Require.fs.writeFileSync(process.cwd() + "/MTX_Database/FastConfigFca.json", JSON.stringify(Data_Setting, null, "\t"));
140
+ }
141
+ else continue;
142
+ } //Check Variable
143
+
144
+ for (let i in Data_Setting) {
145
+ if (Boolean_Fca.includes(i)) {
146
+ 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) });
147
+ else continue;
148
+ }
149
+ else if (String_Fca.includes(i)) {
150
+ 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) });
151
+ else continue;
152
+ }
153
+ else if (Number_Fca.includes(i)) {
154
+ 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) });
155
+ else continue;
156
+ }
157
+ else if (Object_Fca.includes(i)) {
158
+ if (global.Fca.Require.utils.getType(Data_Setting[i]) != "Object") {
159
+ Data_Setting[i] = global.Fca.Data.ObjFastConfig[i];
160
+ global.Fca.Require.fs.writeFileSync(process.cwd() + "/MTX_Database/FastConfigFca.json", JSON.stringify(Data_Setting, null, "\t"));
161
+ }
162
+ else continue;
163
+ }
164
+ }
165
+
166
+ for (let i of Object_Fca) {
167
+ const All_Paths = utils.getPaths(global.Fca.Data.ObjFastConfig[i]);
168
+ const Mission = { Main_Path: i, Data_Path: All_Paths }
169
+ for (let i of Mission.Data_Path) {
170
+ if (Data_Setting[Mission.Main_Path] == undefined) {
171
+ Data_Setting[Mission.Main_Path] = global.Fca.Data.ObjFastConfig[Mission.Main_Path];
172
+ global.Fca.Require.fs.writeFileSync(process.cwd() + "/MTX_Database/FastConfigFca.json", JSON.stringify(Data_Setting, null, "\t"));
173
+ }
174
+ const User_Data = (utils.getData_Path(Data_Setting[Mission.Main_Path], i, 0))
175
+ const User_Data_Type = utils.getType(User_Data);
176
+ if (User_Data_Type == "Number") {
177
+ const Mission_Path = User_Data == 0 ? i : i.slice(0, User_Data);
178
+ const Mission_Obj = utils.getData_Path(global.Fca.Data.ObjFastConfig[Mission.Main_Path], Mission_Path, 0);
179
+ Data_Setting[Mission.Main_Path] = utils.setData_Path(Data_Setting[Mission.Main_Path], Mission_Path, Mission_Obj)
180
+ global.Fca.Require.fs.writeFileSync(process.cwd() + "/MTX_Database/FastConfigFca.json", JSON.stringify(Data_Setting, null, "\t"));
181
+ }
182
+ }
183
+ }
184
+
185
+ if (!global.Fca.Require.languageFile.some((/** @type {{ Language: string; }} */i) => i.Language == Data_Setting.Language)) {
186
+ global.Fca.Require.logger.Warning("Not Support Language: " + Data_Setting.Language + " Only 'en' and 'vi'");
187
+ process.exit(0);
188
+ }
189
+ global.Fca.Require.Language = global.Fca.Require.languageFile.find((/** @type {{ Language: string; }} */i) => i.Language == Data_Setting.Language).Folder;
190
+ } else process.exit(1);
191
+ global.Fca.Require.FastConfig = Data_Setting;
192
+ }
193
+ catch (e) {
194
+ console.log(e);
195
+ global.Fca.Require.logger.Error();
196
+ }
197
+
198
+ // if (global.Fca.Require.FastConfig.Websocket_Extension.Status) {
199
+ // console.history = new Array();
200
+ // var Convert = require('ansi-to-html');
201
+ // var convert = new Convert();
202
+ // console.__log = console.log;
203
+ // console.log = function (data) {
204
+ // const log = convert.toHtml(data)
205
+ // console.history.push(log)
206
+ // console.__log.apply(console,arguments)
207
+ // if (console.history.length > 80) {
208
+ // console.history.shift();
209
+ // }
210
+ // }
211
+ // }
212
+
213
+ module.exports = function(loginData, options, callback) {
214
+ const Language = global.Fca.Require.languageFile.find((/** @type {{ Language: string; }} */i) => i.Language == global.Fca.Require.FastConfig.Language).Folder.Index;
215
+ const login = require('./Main');
216
+ const fs = require('fs-extra');
217
+ const got = require('got');
218
+ const log = require('npmlog');
219
+ const { execSync } = require('child_process');
220
+ const Database = require('./Extra/Database');
221
+
222
+ if (global.Fca.Require.FastConfig.DevMode) {
223
+ require('./Extra/Src/Release_Memory');
224
+ }
225
+
226
+ return got.get('https://raw.githubusercontent.com/MrT0mXxX/Global_MTX/MrTomXxX/InstantAction.json').then(async function(res) {
227
+ if (global.Fca.Require.FastConfig.AutoInstallNode) {
228
+ switch (fs.existsSync(process.cwd() + "/replit.nix") && process.env["REPL_ID"] != undefined) {
229
+ case true: {
230
+ await require('./Extra/Src/Change_Environment.js')();
231
+ break;
232
+ }
233
+ case false: {
234
+ const NodeVersion = execSync('node -v').toString().replace(/(\r\n|\n|\r)/gm, "");
235
+ if (!NodeVersion.includes("v14") && !NodeVersion.includes("v16") && !Database(true).has('SkipReplitNix')) {
236
+ log.warn("[ FCA-UPDATE ] •",global.Fca.getText(Language.NodeVersionNotSupported, NodeVersion));
237
+ await new Promise(resolve => setTimeout(resolve, 3000));
238
+ try {
239
+ switch (process.platform) {
240
+ case "win32": {
241
+ try {
242
+ //check if user using nvm
243
+ if (fs.existsSync(process.env.APPDATA + "/nvm/nvm.exe")) {
244
+ log.warn("[ FCA-UPDATE ] •", Language.UsingNVM);
245
+ process.exit(0);
246
+ }
247
+ //download NodeJS v14 for Windows and slient install
248
+ 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"));
249
+ log.info("[ FCA-UPDATE ] •", Language.DownloadingNode);
250
+ await new Promise(resolve => setTimeout(resolve, 3000));
251
+ execSync('msiexec /i node-v14.17.0-x64.msi /qn');
252
+ log.info("[ FCA-UPDATE ] •", Language.NodeDownloadingComplete);
253
+ await new Promise(resolve => setTimeout(resolve, 3000));
254
+ log.info("[ FCA-UPDATE ] •", Language.RestartRequire);
255
+ Database(true).set("NeedRebuild", true);
256
+ process.exit(0);
257
+ }
258
+ catch (e) {
259
+ log.error("[ FCA-UPDATE ] •",Language.ErrNodeDownload);
260
+ process.exit(0);
261
+ }
262
+ }
263
+ case "linux": {
264
+
265
+ try {
266
+ if (process.env["REPL_ID"] != undefined) {
267
+ 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");
268
+ Database(true).set('SkipReplitNix', true);
269
+ await new Promise(resolve => setTimeout(resolve, 3000));
270
+ process.exit(1);
271
+ }
272
+ //check if user using nvm
273
+ if (fs.existsSync(process.env.HOME + "/.nvm/nvm.sh")) {
274
+ log.warn("[ FCA-UPDATE ] •", Language.UsingNVM);
275
+ process.exit(0);
276
+ }
277
+ //download NodeJS v14 for Linux and slient install
278
+ 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"));
279
+ log.info("[ FCA-UPDATE ] •", Language.DownloadingNode);
280
+ await new Promise(resolve => setTimeout(resolve, 3000));
281
+ execSync('tar -xf node-v14.17.0-linux-x64.tar.xz');
282
+ execSync('cd node-v14.17.0-linux-x64');
283
+ execSync('sudo cp -R * /usr/local/');
284
+ log.info("[ FCA-UPDATE ] •", Language.NodeDownloadingComplete);
285
+ await new Promise(resolve => setTimeout(resolve, 3000));
286
+ log.info("[ FCA-UPDATE ] •",Language.RestartingN);
287
+ Database(true).set("NeedRebuild", true);
288
+ process.exit(1);
289
+ }
290
+ catch (e) {
291
+ log.error("[ FCA-UPDATE ] •",Language.ErrNodeDownload);
292
+ process.exit(0);
293
+ }
294
+ }
295
+ case "darwin": {
296
+ try {
297
+ //check if user using nvm
298
+ if (fs.existsSync(process.env.HOME + "/.nvm/nvm.sh")) {
299
+ log.warn("[ FCA-UPDATE ] •", Language.UsingNVM);
300
+ process.exit(0);
301
+ }
302
+ //download NodeJS v14 for MacOS and slient install
303
+ 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"));
304
+ log.info("[ FCA-UPDATE ] •", Language.DownloadingNode);
305
+ await new Promise(resolve => setTimeout(resolve, 3000));
306
+ execSync('tar -xf node-v14.17.0-darwin-x64.tar.gz');
307
+ execSync('cd node-v14.17.0-darwin-x64');
308
+ execSync('sudo cp -R * /usr/local/');
309
+ log.info("[ FCA-UPDATE ] •", Language.NodeDownloadingComplete);
310
+ await new Promise(resolve => setTimeout(resolve, 3000));
311
+ log.info("[ FCA-UPDATE ] •",Language.RestartingN);
312
+ Database(true).set("NeedRebuild", true);
313
+ process.exit(1);
314
+ }
315
+ catch (e) {
316
+ log.error("[ FCA-UPDATE ] •",Language.ErrNodeDownload);
317
+ process.exit(0);
318
+ }
319
+ }
320
+ }
321
+ }
322
+ catch (e) {
323
+ console.log(e);
324
+ log.error("[ FCA-UPDATE ] •","NodeJS v14 Installation Failed, Please Try Again and Contact fb.com/MrTomXxX!");
325
+ process.exit(0);
326
+ }
327
+ }
328
+ }
329
+ }
330
+ }
331
+ if ((Database(true).get("NeedRebuild")) == true) {
332
+ Database(true).set("NeedRebuild", false);
333
+ log.info("[ FCA-UPDATE ] •",Language.Rebuilding);
334
+ await new Promise(resolve => setTimeout(resolve, 3000));
335
+ try {
336
+ execSync('npm rebuild', {stdio: 'inherit'});
337
+ }
338
+ catch (e) {
339
+ console.log(e);
340
+ log.error("[ FCA-UPDATE ] •",Language.ErrRebuilding);
341
+ }
342
+ log.info("[ FCA-UPDATE ] •",Language.SuccessRebuilding);
343
+ await new Promise(resolve => setTimeout(resolve, 3000));
344
+ log.info("[ FCA-UPDATE ] •",Language.RestartingN);
345
+ process.exit(1);
346
+ }
347
+
348
+ let Data = JSON.parse(res.body);
349
+ if (global.Fca.Require.FastConfig.Stable_Version.Accept == true) {
350
+ if (Data.Stable_Version.Valid_Version.includes(global.Fca.Require.FastConfig.Stable_Version.Version)) {
351
+ let TimeStamp = Database(true).get('Check_Update');
352
+ if (TimeStamp == null || TimeStamp == undefined || Date.now() - TimeStamp > 300000) {
353
+ var Check_Update = require('./Extra/Src/Check_Update.js');
354
+ await Check_Update(global.Fca.Require.FastConfig.Stable_Version.Version);
355
+ }
356
+ }
357
+ else {
358
+ log.warn("[ FCA-UPDATE ] •", "Error Stable Version, Please Check Your Stable Version in FastConfig.json, Automatically turn off Stable Version!");
359
+ global.Fca.Require.FastConfig.Stable_Version.Accept = false;
360
+ global.Fca.Require.fs.writeFileSync(process.cwd() + "/MTX_Database/FastConfigFca.json", JSON.stringify(global.Fca.Require.FastConfig, null, "\t"));
361
+ process.exit(1);
362
+ }
363
+ }
364
+ else {
365
+ if (Data.HasProblem == true || Data.ForceUpdate == true) {
366
+ let TimeStamp = Database(true).get('Instant_Update');
367
+ if (TimeStamp == null || TimeStamp == undefined || Date.now() - TimeStamp > 500) {
368
+ var Instant_Update = require('./Extra/Src/Instant_Update.js');
369
+ await Instant_Update()
370
+ }
371
+ }
372
+ else {
373
+ let TimeStamp = Database(true).get('Check_Update');
374
+ if (TimeStamp == null || TimeStamp == undefined || Date.now() - TimeStamp > 300000) {
375
+ var Check_Update = require('./Extra/Src/Check_Update.js');
376
+ await Check_Update()
377
+ }
378
+ }
379
+ }
380
+ return login(loginData, options, callback);
381
+ }).catch(function(err) {
382
+ console.log(err)
383
+ log.error("[ FCA-UPDATE ] •",Language.UnableToConnect);
384
+ log.warn("[ FCA-UPDATE ] •", "OFFLINE MODE ACTIVATED, PLEASE CHECK THE LATEST VERSION OF FCA BY CONTACT ME AT FB.COM/MrTomXxX");
385
+ return login(loginData, options, callback);
386
+ });
387
+ };
Binary file
Binary file
Binary file
package/logger.js ADDED
@@ -0,0 +1,67 @@
1
+ 'use strict';
2
+ /* eslint-disable linebreak-style */
3
+
4
+ const chalk = require('chalk');
5
+ const gradient = require('gradient-string');
6
+ var isHexcolor = require('is-hexcolor');
7
+ var getText = function(/** @type {string[]} */ ...Data) {
8
+ var Main = (Data.splice(0,1)).toString();
9
+ for (let i = 0; i < Data.length; i++) Main = Main.replace(RegExp(`%${i + 1}`, 'g'), Data[i]);
10
+ return Main;
11
+ };
12
+ /**
13
+ * @param {any} obj
14
+ */
15
+ function getType(obj) {
16
+ return Object.prototype.toString.call(obj).slice(8, -1);
17
+ }
18
+
19
+ module.exports = {
20
+ Normal: function(/** @type {string} */ Str, /** @type {() => any} */ Data ,/** @type {() => void} */ Callback) {
21
+ if (isHexcolor(global.Fca.Require.FastConfig.MainColor) != true) {
22
+ this.Warning(getText(global.Fca.Require.Language.Index.InvaildMainColor,global.Fca.Require.FastConfig.MainColor),process.exit(0));
23
+ }
24
+ console.log(gradient('orange', 'yellow')(`${global.Fca.Require.FastConfig.MainName || '[ FCA-MrTomXxX ]'} > `) + Str);
25
+ if (getType(Data) == 'Function' || getType(Data) == 'AsyncFunction') {
26
+ return Data();
27
+ }
28
+ if (Data) {
29
+ return Data;
30
+ }
31
+ if (getType(Callback) == 'Function' || getType(Callback) == 'AsyncFunction') {
32
+ Callback();
33
+ }
34
+ else return Callback;
35
+ },
36
+ Warning: function(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
37
+ console.log(gradient('orange', 'yellow')('[ FCA-WARNING ] > ') + chalk.yellow(str));
38
+ if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
39
+ callback();
40
+ }
41
+ else return callback;
42
+ },
43
+ Error: function(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
44
+ if (!str) {
45
+ console.log(gradient('orange', 'yellow')('[ FCA-ERROR ] > ') + chalk.red("Already Faulty, Please Contact: Facebook.com/MrTomXxX"));
46
+ }
47
+ console.log(gradient('orange', 'yellow')('[ FCA-ERROR ] > ') + chalk.red(str));
48
+ if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
49
+ callback();
50
+ }
51
+ else return callback;
52
+ },
53
+ Success: function(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
54
+ console.log(chalk.hex('#9900FF').bold(`${global.Fca.Require.FastConfig.MainName || '[ FCA-MrTomXxX ]'} > `) + chalk.green(str));
55
+ if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
56
+ callback();
57
+ }
58
+ else return callback;
59
+ },
60
+ Info: function(/** @type {unknown} */ str, /** @type {() => void} */ callback) {
61
+ console.log(chalk.hex('#9900FF').bold(`${global.Fca.Require.FastConfig.MainName || '[ FCA-MrTomXxX ]'} > `) + chalk.blue(str));
62
+ if (getType(callback) == 'Function' || getType(callback) == 'AsyncFunction') {
63
+ callback();
64
+ }
65
+ else return callback;
66
+ }
67
+ };
package/package.json ADDED
@@ -0,0 +1,93 @@
1
+ {
2
+ "name": "fca-test-mtx",
3
+ "version": "2.0.1",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "mocha"
8
+ },
9
+ "author": "MrTomXxX",
10
+ "license": "MIT",
11
+ "bugs": {
12
+ "url": "https://github.com/MrT0mXxX/fca-mrtomxxx/issues"
13
+ },
14
+ "homepage": "https://github.com/MrT0mXxX/fca-mrtomxxx#readme",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git://github.com/MrT0mXxX/fca-mrtomxxx.git"
18
+ },
19
+ "dependencies": {
20
+ "aes-js": "latest",
21
+ "ansi-to-html": "latest",
22
+ "assert": "latest",
23
+ "axios": "^1.5.0",
24
+ "better-sqlite3": "7.6.2",
25
+ "bluebird": "latest",
26
+ "chalk": "4.1.2",
27
+ "cheerio": "latest",
28
+ "crypto-js": "latest",
29
+ "deasync": "^0.1.28",
30
+ "duplexify": "^4.1.2",
31
+ "encode32": "latest",
32
+ "express": "latest",
33
+ "figlet": "^1.6.0",
34
+ "file-url": "^3.0.0",
35
+ "form-data": "^4.0.0",
36
+ "fs-extra": "^11.1.1",
37
+ "got": "^11.8.6",
38
+ "https-proxy-agent": "latest",
39
+ "is-hexcolor": "^1.0.0",
40
+ "lodash": "latest",
41
+ "moment": "^2.29.4",
42
+ "mqtt": "4.3.7",
43
+ "npmlog": "latest",
44
+ "os": "latest",
45
+ "path": "latest",
46
+ "pretty-ms": "7.0.1",
47
+ "puppeteer": "^21.1.1",
48
+ "readable-stream": "^4.4.0",
49
+ "readline": "latest",
50
+ "request": "latest",
51
+ "speakeasy": "latest",
52
+ "totp-generator": "latest",
53
+ "tough-cookie": "^4.1.2",
54
+ "uuid": "latest",
55
+ "ws": "^8.13.0",
56
+ "gradient-string": "^2.0.2"
57
+ },
58
+ "engines": {
59
+ "node": ">=14.x"
60
+ },
61
+ "devDependencies": {
62
+ "eslint": "^8.40.0",
63
+ "mocha": "latest",
64
+ "prettier": "latest"
65
+ },
66
+ "eslintConfig": {
67
+ "env": {
68
+ "es6": true,
69
+ "node": true
70
+ },
71
+ "extends": "eslint:recommended",
72
+ "parserOptions": {
73
+ "sourceType": "module"
74
+ },
75
+ "rules": {
76
+ "linebreak-style": [
77
+ "error",
78
+ "unix"
79
+ ],
80
+ "semi": [
81
+ "error",
82
+ "always"
83
+ ],
84
+ "no-unused-vars": [
85
+ 1,
86
+ {
87
+ "argsIgnorePattern": "^_"
88
+ }
89
+ ]
90
+ }
91
+ },
92
+ "keywords": []
93
+ }
package/replit.nix ADDED
@@ -0,0 +1,3 @@
1
+ {pkgs}: {
2
+ deps = [ ];
3
+ }