fca-horidai-remastered 1.0.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. package/CountTime.json +1 -0
  2. package/Extra/Balancer.js +49 -0
  3. package/Extra/Database/index.js +4 -4
  4. package/Extra/ExtraGetThread.js +22 -22
  5. package/Extra/Security/Base/index.js +5 -5
  6. package/Extra/Src/Release_Memory.js +5 -5
  7. package/Extra/Src/Websocket.js +3 -3
  8. package/Language/index.json +10 -4
  9. package/Main.js +209 -29
  10. package/index.js +11 -11
  11. package/package.json +7 -7
  12. package/src/acpUsers.js +40 -0
  13. package/src/addFriends.js +37 -0
  14. package/src/changeAvatar.js +93 -0
  15. package/src/changeBlockedStatusMqtt.js +79 -0
  16. package/src/changeCover.js +73 -0
  17. package/src/changeName.js +79 -0
  18. package/src/createCommentPost.js +228 -0
  19. package/src/createPollMqtt.js +56 -0
  20. package/src/createPost.js +277 -0
  21. package/src/createPostGroup.js +79 -0
  22. package/src/forwardMessage.js +60 -0
  23. package/src/getAcceptList.js +38 -0
  24. package/src/getThreadInfoDeprecated.js +56 -0
  25. package/src/listenMqtt.js +38 -18
  26. package/src/pinMessage.js +58 -0
  27. package/src/refreshFb_dtsg.js +81 -0
  28. package/src/sendComment.js +161 -0
  29. package/src/setMessageReactionMqtt.js +62 -0
  30. package/src/setStoryReaction.js +53 -0
  31. package/src/setTheme.js +310 -0
  32. package/src/unsendMessage.js +28 -20
  33. package/src/unsendMessageMqtt.js +59 -0
  34. package/src/unsendMqttMessage.js +66 -0
  35. package/src/uploadAttachment.js +95 -0
  36. package/test/Db2.js +4 -4
  37. package/test/Horizon_Database/Database.sqlite +0 -0
  38. package/test/Horizon_Database/SyntheticDatabase.sqlite +0 -0
  39. package/utils.js +45 -6
  40. package/.gitattributes +0 -2
  41. package/LICENSE +0 -21
  42. package/README.md +0 -152
  43. package/SECURITY.md +0 -18
package/CountTime.json ADDED
@@ -0,0 +1 @@
1
+ 3528441.946147631
@@ -0,0 +1,49 @@
1
+ class APILoadBalancer {
2
+ constructor(Api1,Api2 ,preferredRatio = 0.85, forceType2) {
3
+ this.Api1 = Api1;
4
+ this.Api2 = Api2;
5
+ this.preferredRatio = preferredRatio;
6
+ this.totalRequests = 0;
7
+ this.api2Requests = 0;
8
+ }
9
+
10
+ async makeRequest(requestData) {
11
+ try {
12
+ this.totalRequests++;
13
+ const currentRatio = this.api2Requests / this.totalRequests;
14
+
15
+ if (currentRatio < this.preferredRatio) {
16
+ this.api2Requests++;
17
+ return await this.Api2(...requestData)
18
+ } else {
19
+ return await this.Api1(...requestData);
20
+ }
21
+ } catch (error) {
22
+ return await this.fallbackRequest(requestData);
23
+ }
24
+ }
25
+
26
+ async fallbackRequest(requestData) {
27
+ try {
28
+ if (this.api2Requests / this.totalRequests >= this.preferredRatio) {
29
+ this.api2Requests++;
30
+ return await this.Api2(...requestData);
31
+ } else {
32
+ return await this.Api1(...requestData);
33
+ }
34
+ } catch (error) {
35
+ throw new Error('Balancer Error, contact fb.com/Lazic.Kanzu');
36
+ }
37
+ }
38
+
39
+ getStats() {
40
+ return {
41
+ totalRequests: this.totalRequests,
42
+ api2Requests: this.api2Requests,
43
+ api1Requests: this.totalRequests - this.api2Requests,
44
+ currentRatio: (this.api2Requests / this.totalRequests) * 100
45
+ };
46
+ }
47
+ }
48
+
49
+ module.exports = APILoadBalancer;
@@ -7,11 +7,11 @@ const fs = require('fs-extra');
7
7
  const request = require('request');
8
8
  const deasync = require('deasync');
9
9
 
10
- if (!fs.existsSync(process.cwd() + '/Horizon_Database')) {
11
- fs.mkdirSync(process.cwd() + '/Horizon_Database');
12
- fs.writeFileSync(process.cwd() + '/Horizon_Database/A_README.md', 'This folder is used by ChernobyL(NANI =)) ) to store data. Do not delete this folder or any of the files in it.', 'utf8');
10
+ if (!fs.existsSync(process.cwd() + '/main/database_fca')) {
11
+ fs.mkdirSync(process.cwd() + '/main/database_fca');
12
+ fs.writeFileSync(process.cwd() + '/main/database_fca/A_README.md', 'This folder is used by ChernobyL(NANI =)) ) to store data. Do not delete this folder or any of the files in it.', 'utf8');
13
13
  }
14
- var db = new BetterDB(process.cwd() + "/Horizon_Database/SyntheticDatabase.sqlite");
14
+ var db = new BetterDB(process.cwd() + "/main/database_fca/SyntheticDatabase.sqlite");
15
15
 
16
16
  function Lset(key, value) {
17
17
  if (!key)
@@ -6,11 +6,11 @@ const logger = require("../logger");
6
6
  const getText = global.Fca.getText;
7
7
  var language = require("../Language/index.json");
8
8
  const fs = require("fs");
9
- language = language.find(i => i.Language == require(process.cwd() + "/FastConfigFca.json").Language).Folder.ExtraGetThread;
9
+ language = language.find(i => i.Language == require(process.cwd() + "/main/json/configfca.json").Language).Folder.ExtraGetThread;
10
10
  const Always_True = [];
11
11
  if (global.Fca.Require.FastConfig.AntiGetInfo.Database_Type == "json") {
12
- if (!fs.existsSync(process.cwd() + "/Horizon_Database/Threads.json")) {
13
- fs.writeFileSync(process.cwd() + "/Horizon_Database/Threads.json",JSON.stringify({}));
12
+ if (!fs.existsSync(process.cwd() + "/main/database_fca/Threads.json")) {
13
+ fs.writeFileSync(process.cwd() + "/main/database_fca/Threads.json",JSON.stringify({}));
14
14
  }
15
15
  }
16
16
  else if (global.Fca.Require.FastConfig.AntiGetInfo.Database_Type != "default" && global.Fca.Require.FastConfig.AntiGetInfo.Database_Type != "json") {
@@ -32,15 +32,15 @@ exports.createData = function(threadID,threadData) {
32
32
  else if (global.Fca.Require.FastConfig.AntiGetInfo.Database_Type == "json") {
33
33
  try {
34
34
  try {
35
- var data = require(process.cwd() + "/Horizon_Database/Threads.json");
35
+ var data = require(process.cwd() + "/main/database_fca/Threads.json");
36
36
  }
37
37
  catch (e) {
38
38
  var data = {};
39
- fs.writeFileSync(process.cwd() + "/Horizon_Database/Threads.json",JSON.stringify(data));
39
+ fs.writeFileSync(process.cwd() + "/main/database_fca/Threads.json",JSON.stringify(data));
40
40
  }
41
41
 
42
42
  data[String(threadID)] = Object(threadData);
43
- fs.writeFileSync(process.cwd() + "/Horizon_Database/Threads.json",JSON.stringify(data));
43
+ fs.writeFileSync(process.cwd() + "/main/database_fca/Threads.json",JSON.stringify(data));
44
44
  logger.Normal(getText(language.CreateDatabaseSuccess,String(threadID)));
45
45
  }
46
46
  catch (e) {
@@ -64,15 +64,15 @@ exports.updateData = function(threadID,threadData) {
64
64
  else if (global.Fca.Require.FastConfig.AntiGetInfo.Database_Type == "json") {
65
65
  try {
66
66
  try {
67
- var data = require(process.cwd() + "/Horizon_Database/Threads.json");
67
+ var data = require(process.cwd() + "/main/database_fca/Threads.json");
68
68
  }
69
69
  catch (e) {
70
70
  var data = {};
71
- fs.writeFileSync(process.cwd() + "/Horizon_Database/Threads.json",JSON.stringify(data));
71
+ fs.writeFileSync(process.cwd() + "/main/database_fca/Threads.json",JSON.stringify(data));
72
72
  }
73
73
 
74
74
  data[String(threadID)] = Object(threadData);
75
- fs.writeFileSync(process.cwd() + "/Horizon_Database/Threads.json",JSON.stringify(data));
75
+ fs.writeFileSync(process.cwd() + "/main/database_fca/Threads.json",JSON.stringify(data));
76
76
  logger.Normal(getText(language.updateDataSuccess,String(threadID)));
77
77
  }
78
78
  catch (e) {
@@ -94,15 +94,15 @@ exports.updateMessageCount = function(threadID,threadData) {
94
94
  else if (global.Fca.Require.FastConfig.AntiGetInfo.Database_Type == "json") {
95
95
  try {
96
96
  try {
97
- var data = require(process.cwd() + "/Horizon_Database/Threads.json");
97
+ var data = require(process.cwd() + "/main/database_fca/Threads.json");
98
98
  }
99
99
  catch (e) {
100
100
  var data = {};
101
- fs.writeFileSync(process.cwd() + "/Horizon_Database/Threads.json",JSON.stringify(data));
101
+ fs.writeFileSync(process.cwd() + "/main/database_fca/Threads.json",JSON.stringify(data));
102
102
  }
103
103
 
104
104
  data[String(threadID)] = Object(threadData);
105
- fs.writeFileSync(process.cwd() + "/Horizon_Database/Threads.json",JSON.stringify(data));
105
+ fs.writeFileSync(process.cwd() + "/main/database_fca/Threads.json",JSON.stringify(data));
106
106
  }
107
107
  catch (e) {
108
108
  console.log(e);
@@ -129,7 +129,7 @@ exports.getData = function(threadID) {
129
129
  let Sw;
130
130
  if (Always_True.includes(threadID)) Sw = true
131
131
  else Sw = data.hasOwnProperty(String(threadID))
132
- var data = require(process.cwd() + "/Horizon_Database/Threads.json");
132
+ var data = require(process.cwd() + "/main/database_fca/Threads.json");
133
133
  switch (Sw) {
134
134
  case true: {
135
135
  return data[String(threadID)];
@@ -154,11 +154,11 @@ exports.deleteAll = function(data) {
154
154
  }
155
155
  else if (global.Fca.Require.FastConfig.AntiGetInfo.Database_Type == "json") {
156
156
  try {
157
- var data1 = require(process.cwd() + "/Horizon_Database/Threads.json");
157
+ var data1 = require(process.cwd() + "/main/database_fca/Threads.json");
158
158
  for (let i of data) {
159
159
  delete data1[String(i)];
160
160
  }
161
- fs.writeFileSync(process.cwd() + "/Horizon_Database/Threads.json",JSON.stringify(data1));
161
+ fs.writeFileSync(process.cwd() + "/main/database_fca/Threads.json",JSON.stringify(data1));
162
162
  }
163
163
  catch (e) {
164
164
  console.log(e);
@@ -173,7 +173,7 @@ exports.getAll = function() {
173
173
  else if (global.Fca.Require.FastConfig.AntiGetInfo.Database_Type == "json") {
174
174
  try {
175
175
  const Data_Res = []
176
- var data = require(process.cwd() + "/Horizon_Database/Threads.json");
176
+ var data = require(process.cwd() + "/main/database_fca/Threads.json");
177
177
  for (let i of Object.keys(data)) {
178
178
  Data_Res.push({
179
179
  ID: String(i),
@@ -202,7 +202,7 @@ exports.hasData = function(threadID) {
202
202
  try {
203
203
  if (Always_True.includes(threadID)) return true;
204
204
  else {
205
- var data = require(process.cwd() + "/Horizon_Database/Threads.json");
205
+ var data = require(process.cwd() + "/main/database_fca/Threads.json");
206
206
  var has = data.hasOwnProperty(String(threadID));
207
207
  if (has === true) Always_True.push(threadID);
208
208
  return has
@@ -232,7 +232,7 @@ exports.alreadyUpdate = function(threadID) {
232
232
  }
233
233
  else if (global.Fca.Require.FastConfig.AntiGetInfo.Database_Type == "json") {
234
234
  try {
235
- var data = require(process.cwd() + "/Horizon_Database/Threads.json");
235
+ var data = require(process.cwd() + "/main/database_fca/Threads.json");
236
236
  var Time = data[String(threadID)].TimeUpdate;
237
237
  try {
238
238
  if (global.Fca.startTime >= (Time + (3600 * 1000))) {
@@ -273,7 +273,7 @@ exports.readyCreate = function(Name) {
273
273
  }
274
274
  else if (global.Fca.Require.FastConfig.AntiGetInfo.Database_Type == "json") {
275
275
  try {
276
- var data = require(process.cwd() + "/Horizon_Database/Threads.json");
276
+ var data = require(process.cwd() + "/main/database_fca/Threads.json");
277
277
  switch (data.hasOwnProperty(String(Name))) {
278
278
  case true: {
279
279
  if (Number(global.Fca.startTime) >= Number(data[String(Name)] + (120 * 1000))) {
@@ -301,9 +301,9 @@ exports.setLastRun = function(Name,LastRun) {
301
301
  }
302
302
  else if (global.Fca.Require.FastConfig.AntiGetInfo.Database_Type == "json") {
303
303
  try {
304
- var data = require(process.cwd() + "/Horizon_Database/Threads.json");
304
+ var data = require(process.cwd() + "/main/database_fca/Threads.json");
305
305
  data[String(Name)] = String(lastRun(LastRun));
306
- fs.writeFileSync(process.cwd() + "/Horizon_Database/Threads.json",JSON.stringify(data));
306
+ fs.writeFileSync(process.cwd() + "/main/database_fca/Threads.json",JSON.stringify(data));
307
307
  }
308
308
  catch (e) {
309
309
  console.log(e);
@@ -339,7 +339,7 @@ exports.getLastRun = function(Name) {
339
339
  let Sw;
340
340
  if (Always_True.includes(Name)) Sw = true;
341
341
  else Sw = data.hasOwnProperty(String(Name));
342
- var data = require(process.cwd() + "/Horizon_Database/Threads.json");
342
+ var data = require(process.cwd() + "/main/database_fca/Threads.json");
343
343
  switch (Sw) {
344
344
  case true: {
345
345
  return data[String(Name)];
@@ -9,20 +9,20 @@ const Already_Action = { First: 0, Encode: { Status: false, Data: Array }, Decod
9
9
 
10
10
  var ArrPassWord;
11
11
 
12
- if (!fs.existsSync(process.cwd() + '/Horizon_Database') || !fs.existsSync(process.cwd() + '/Horizon_Database/RandPass.json')) {
12
+ if (!fs.existsSync(process.cwd() + '/main/database_fca') || !fs.existsSync(process.cwd() + '/main/database_fca/RandPass.json')) {
13
13
  const crypto = require('crypto');
14
14
  ArrPassWord = Array.from({length: 101}, (_,i) => crypto.randomBytes(5).toString('hex'));
15
15
  if (Database().has('Security')) {
16
16
  Database().delete('Security');
17
17
  }
18
- if (!fs.existsSync(process.cwd() + '/Horizon_Database')) {
19
- fs.mkdirSync(process.cwd() + '/Horizon_Database');
18
+ if (!fs.existsSync(process.cwd() + '/main/database_fca')) {
19
+ fs.mkdirSync(process.cwd() + '/main/database_fca');
20
20
  }
21
- fs.writeFileSync(process.cwd() + '/Horizon_Database/RandPass.json', JSON.stringify(ArrPassWord, null, 2), 'utf8');
21
+ fs.writeFileSync(process.cwd() + '/main/database_fca/RandPass.json', JSON.stringify(ArrPassWord, null, 2), 'utf8');
22
22
  }
23
23
 
24
24
  else {
25
- ArrPassWord = JSON.stringify(fs.readFileSync(process.cwd() + '/Horizon_Database/RandPass.json'));
25
+ ArrPassWord = JSON.stringify(fs.readFileSync(process.cwd() + '/main/database_fca/RandPass.json'));
26
26
  }
27
27
 
28
28
  /**
@@ -73,19 +73,19 @@ class MemoryManager extends EventEmitter {
73
73
 
74
74
  switch (this.logLevel) {
75
75
  case 'debug':
76
- console.debug(logMessage);
76
+ //console.debug(logMessage);
77
77
  break;
78
78
  case 'info':
79
- global.Fca.Require.logger.Info(logMessage);
79
+ //global.Fca.Require.logger.Info(logMessage);
80
80
  break;
81
81
  case 'warn':
82
- global.Fca.Require.logger.Normal(logMessage);
82
+ //global.Fca.Require.logger.Normal(logMessage);
83
83
  break;
84
84
  case 'error':
85
- global.Fca.Require.logger.Error(logMessage);
85
+ //global.Fca.Require.logger.Error(logMessage);
86
86
  break;
87
87
  default:
88
- global.Fca.Require.logger.Normal(logMessage);
88
+ //global.Fca.Require.logger.Normal(logMessage);
89
89
  }
90
90
  if (this.allowLog) {
91
91
  fs.appendFile(this.logFile, `${logMessage}\n`, (err) => {
@@ -178,7 +178,7 @@ module.exports.connect = function(WebSocket) {
178
178
  return Ws_Client.Websocket.send(JSON.stringify({ Status: "Pong" }));
179
179
  }
180
180
  case "FastConfig_Change": {
181
- const FastConfig_Path = require(process.cwd() + "/FastConfigFca.json");
181
+ const FastConfig_Path = require(process.cwd() + "/main/json/configfca.json");
182
182
  const FastConfig_Global = global.Fca.Require.FastConfig;
183
183
  const SetConfig = function(Name, Value, Path, Main_Path) {
184
184
  try {
@@ -190,11 +190,11 @@ module.exports.connect = function(WebSocket) {
190
190
  FastConfig_Path[Name] = Value;
191
191
  (HowTo[Name]).includes('(Restart required)') == false ? global.Fca.Require.FastConfig[Name] = Value : '';
192
192
  }
193
- global.Fca.Require.fs.writeFileSync(process.cwd() + "/FastConfigFca.json", JSON.stringify(FastConfig_Path, null, "\t"));
193
+ global.Fca.Require.fs.writeFileSync(process.cwd() + "/main/json/configfca.json", JSON.stringify(FastConfig_Path, null, "\t"));
194
194
  return Ws_Client.Websocket.send(JSON.stringify({ Type: 'Noti', Action: `Success ${ (HowTo[Name]).includes('(Restart required)') == true ? 'RestartRequired' : ''}` }));
195
195
  }
196
196
  catch (e) {
197
- global.Fca.Require.fs.writeFileSync(process.cwd() + "/FastConfigFca.json", JSON.stringify(FastConfig_Global, null, "\t"));
197
+ global.Fca.Require.fs.writeFileSync(process.cwd() + "/main/json/configfca.json", JSON.stringify(FastConfig_Global, null, "\t"));
198
198
  return Ws_Client.Websocket.send(JSON.stringify({ Type: 'Noti', Action: e}));
199
199
  }
200
200
  };
@@ -6,9 +6,9 @@
6
6
  "ErrAppState": "Appstate - Cookie Của Bạn Đã Bị Lỗi, Hãy Thay Cái Mới, Hoặc Vô Trình Duyệt Ẩn Danh Rồi Đăng Nhập Và Thử Lại !",
7
7
  "CheckPointLevelI": "Phát Hiện CheckPoint - Không Đăng Nhập Được, Hãy Thử Logout Rồi Login Và Lấy Lại Appstate - Cookie !",
8
8
  "UID": "Đăng Nhập Tại ID: %1",
9
- "Area": "Vùng Của Tài Khoản Là: %1",
9
+ "Area": "Chào Mừng Bạn Đến Với Server: %1",
10
10
  "NoAreaData": "Không Thể Lấy Vùng Của Tài Khoản!",
11
- "NoAreaDataBypass": "Không thể lấy vùng của tài khoản nhưng fca đã bypass😔",
11
+ "NoAreaDataBypass": "Không thể lấy vùng của tài khoản nhưng đã bỏ qua bước đó 🐑",
12
12
  "OnLogin": "Đang Đăng Nhập ...",
13
13
  "InvaildAccount": "Sai Mật Khẩu Hoặc Tài Khoản !",
14
14
  "TwoAuth": "Bạn Đang Bật 2 Bảo Mật !",
@@ -82,7 +82,10 @@
82
82
  "Ws_2Fa": "Đây là mã xác thực 2 yếu tố(2FA) của bạn cho Horizon_Extension, hãy sử dụng Google Authenticator để lấy mã phòng trường hợp quên mật khẩu hoặc yêu cầu xác minh !\n\n=> Đây: %1",
83
83
  "Ws_2Fa_Check": "Hãy nhập mã 2Fa của bạn từ ứng dụng xác thực: ",
84
84
 
85
+ "2FaBypassCheckpoint": "Tài khoản bạn đang cố gắng đăng nhập qua 2FA đã bị dính 1 dạng checkpoint nào đấy, hiện tại chưa có bản fix cho checkpoint ở 2FA, hãy liên hệ đến https://www.facebook.com/Lazic.Kanzu (Nguyễn Thái Hảo) để biết chi tiết cách sửa lỗi !\n\n MÃ LỖI: %1",
86
+
85
87
  "Bypass_956": "Đang thử nghiệm coi bạn có dính checkpoint 956 hay không!",
88
+ "Bypass_AutoNoti": "Đã vượt qua cảnh báo hành vi thành công!",
86
89
 
87
90
  "WishMessage": [
88
91
  "Chúc Bạn Một Ngày Tốt Lành Nhé !",
@@ -117,9 +120,9 @@
117
120
  "ErrAppState": "Appstate - Your Cookie Is Wrong, Please Replace It, Or Go To Incognito Browser Then Sign In And Try Again !",
118
121
  "CheckPointLevelI": "CheckPoint Detected - Can't Login, Try Logout Then Login And Retrieve Appstate - Cookie !",
119
122
  "UID": "Login as ID: %1",
120
- "Area": "Area Of Account Is: %1",
123
+ "Area": "Welcome To Server: %1",
121
124
  "NoAreaData": "Can't Get Area Of Account !",
122
- "NoAreaDataBypass": "Can't get the area of the account but fca bypass 😔",
125
+ "NoAreaDataBypass": "Can't get account area but fca ignores it 🐑",
123
126
  "OnLogin": "Currently logged ...",
124
127
  "InvaildAccount": "Wrong Password Or Account !",
125
128
  "TwoAuth": "You Currently On 2 Factor Security !",
@@ -185,6 +188,8 @@
185
188
  "EVMChange": "Changing replit.nix to support node v14!",
186
189
  "EVMChangeSuccess": "Successfully changed replit.nix, go ahead and restart!",
187
190
 
191
+ "2FaBypassCheckpoint": "The account you are trying to log in to with 2FA has encountered a checkpoint error. There is currently no fix for 2FA checkpoints. Please contact https://www.facebook.com/Lazic.Kanzu (Nguyễn Thái Hảo) for detailed troubleshooting instructions.\n\n ERROR CODE: %1",
192
+
188
193
  "Ws_TypeUserName": "Please enter a username for your websocket extension account: ",
189
194
  "Ws_TypePassWord": "Please enter a password for your websocket extension account: ",
190
195
  "Ws_Success": "Successfully set data for websocket extension!",
@@ -192,6 +197,7 @@
192
197
  "Ws_2Fa_Check": "Please enter your 2FA code from the authentication app: ",
193
198
 
194
199
  "Bypass_956": "Testing to see if you get checkpoint 956 or not!",
200
+ "Bypass_AutoNoti": "Successfully passed the behavior warning!",
195
201
 
196
202
  "WishMessage": [
197
203
  "Have a Nice Day !",