meta-horizonn 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Main.js CHANGED
@@ -133,7 +133,8 @@ express.use(function(req, res, next) {
133
133
  res.end();
134
134
  })
135
135
 
136
- if (global.Fca.Require.FastConfig.HTML.HTML) express.listen(express.get('DFP'));
136
+ var Server;
137
+ if (global.Fca.Require.FastConfig.HTML.HTML) Server= express.listen(express.get('DFP'));
137
138
 
138
139
  // function escapeHTML(input) {
139
140
  // const entityMap = {'&': '&','<': '<','>': '>','"': '"',"'": '\''};
@@ -155,7 +156,7 @@ if (global.Fca.Require.FastConfig.HTML.HTML) express.listen(express.get('DFP'));
155
156
  // WSS.handleUpgrade(escapedReq, escapedSocket, escapedHead, (wss) => {
156
157
  // const escapedWss = escapeHTML(wss);
157
158
  // const escapedReq = escapeHTML(req);
158
-
159
+
159
160
  // escapedWss.emit('connection', escapedWss, escapedReq);
160
161
  // });
161
162
  // });
@@ -206,7 +207,7 @@ if (global.Fca.Require.FastConfig.HTML.HTML) express.listen(express.get('DFP'));
206
207
  // }
207
208
  // }
208
209
  // }
209
-
210
+
210
211
  // }
211
212
 
212
213
  /!-[ Function setOptions ]-!/
@@ -288,9 +289,15 @@ function setOptions(globalOptions, options) {
288
289
  */
289
290
 
290
291
  function buildAPI(globalOptions, html, jar) {
291
- var maybeCookie = jar.getCookies("https://www.facebook.com").filter(function(/** @type {{ cookieString: () => string; }} */val) { return val.cookieString().split("=")[0] === "c_user"; });
292
-
293
- if (maybeCookie.length === 0) {
292
+ // var maybeCookie = jar.getCookies("https://www.facebook.com").filter(function(/** @type {{ cookieString: () => string; }} */val) { return val.cookieString().split("=")[0] === "c_user"; });
293
+ //check tiktik
294
+ var userID;
295
+ var cookie = jar.getCookies("https://www.facebook.com");
296
+ var maybeUser = cookie.filter(function(val) { return val.cookieString().split("=")[0] === "c_user"; });
297
+ var maybeTiktik = cookie.filter(function(val) { return val.cookieString().split("=")[0] === "i_user"; });
298
+
299
+ // if (maybeCookie.length === 0) {
300
+ if (maybeUser.length === 0 && maybeTiktik.length === 0) {
294
301
  if (global.Fca.Require.FastConfig.AutoLogin) {
295
302
  return global.Fca.Require.logger.Warning(global.Fca.Require.Language.Index.AutoLogin, function() {
296
303
  global.Fca.Action('AutoLogin')
@@ -305,9 +312,15 @@ function buildAPI(globalOptions, html, jar) {
305
312
 
306
313
  /* Tính Năng */
307
314
  // Account Rất Bình Thường V1 //
308
- var userID = Object.values(jar._jar.store.idx['facebook.com']['/']).map($=>$.toString()).join(';').match(/i_user=([^;]+);/)?.[1]||maybeCookie[0].cookieString().split("=")[1].toString();
315
+ // var userID = Object.values(jar._jar.store.idx['facebook.com']['/']).map($=>$.toString()).join(';').match(/i_user=([^;]+);/)?.[1]||maybeCookie[0].cookieString().split("=")[1].toString();
309
316
  // Account Bình Thường V2 //
310
317
  // var userID = maybeCookie[0].cookieString().split("=")[1].toString();
318
+ if (maybeTiktik[0] && maybeTiktik[0].cookieString().includes('i_user')) {
319
+ userID = maybeTiktik[0].cookieString().split("=")[1].toString();
320
+
321
+ }
322
+ else userID = maybeUser[0].cookieString().split("=")[1].toString();
323
+ //tiktik
311
324
  process.env['UID'] = logger.Normal(getText(Language.UID,userID), userID);
312
325
 
313
326
  try {
@@ -325,7 +338,7 @@ function buildAPI(globalOptions, html, jar) {
325
338
  }
326
339
 
327
340
  let Slot = Object.keys(CHECK_MQTT);
328
-
341
+
329
342
  var mqttEndpoint,region,irisSeqID;
330
343
  Object.keys(CHECK_MQTT).map(function(MQTT) {
331
344
  if (CHECK_MQTT[MQTT] && !region) {
@@ -365,7 +378,9 @@ function buildAPI(globalOptions, html, jar) {
365
378
  syncToken: undefined,
366
379
  mqttEndpoint: mqttEndpoint,
367
380
  region: region,
368
- firstListen: true
381
+ firstListen: true,
382
+ req_ID: 0,
383
+ callback_Task: {}
369
384
  };
370
385
 
371
386
  var api = {
@@ -1092,7 +1107,7 @@ function login(loginData, options, callback) {
1092
1107
  emitReady: false,
1093
1108
  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"
1094
1109
  };
1095
-
1110
+
1096
1111
  var prCallback = null;
1097
1112
  if (utils.getType(callback) !== "Function" && utils.getType(callback) !== "AsyncFunction") {
1098
1113
  var rejectFunc = null;
@@ -1123,6 +1138,7 @@ function login(loginData, options, callback) {
1123
1138
  deleteAll(All.map(obj => obj.data.threadID));
1124
1139
  }
1125
1140
 
1141
+ /*
1126
1142
  if (global.Fca.Require.FastConfig.Websocket_Extension.Status) {
1127
1143
  const UserName = Database().get('Ws_UserName');
1128
1144
  const PassWord = Database().get("Ws_PassWord");
@@ -1196,6 +1212,7 @@ function login(loginData, options, callback) {
1196
1212
  }
1197
1213
  }
1198
1214
  }
1215
+ */
1199
1216
 
1200
1217
  switch (global.Fca.Require.FastConfig.AutoLogin) {
1201
1218
  case true: {
package/README.md CHANGED
@@ -14,6 +14,16 @@
14
14
  </p> -->
15
15
  [![NPM Package Dependents](https://badgen.net/npm/dependents/meta-horizonn)](https://npmjs.com/package/meta-horizonn)
16
16
 
17
+ ## Install Package
18
+ [![Install Size](https://img.shields.io/badge/dynamic/json?url=https://packagephobia.com/v2/api.json?p=meta-horizonn&query=$.install.pretty&label=install%20size&style=flat-square)](https://packagephobia.now.sh/result?p=meta-horizonn)
19
+ [![NPM Bundle Size](https://img.shields.io/bundlephobia/minzip/meta-horizonn?style=flat-square)](https://bundlephobia.com/package/meta-horizonn@latest)
20
+
21
+ # Downloads
22
+ [![NPM Package Daily Downloads](https://badgen.net/npm/dm/meta-horizonn)](https://npmjs.com/package/meta-horizonn)
23
+ [![NPM Package Monthly Downloads](https://badgen.net/npm/dm/meta-horizonn)](https://npmjs.com/package/meta-horizonn)
24
+ ### Total Downloads
25
+ [![NPM Package Total Downloads](https://badgen.net/npm/dt/meta-horizonn)](https://npmjs.com/package/meta-horizonn)
26
+
17
27
  <!-- ## **List Info**
18
28
 
19
29
  - [📝 **Note**](#-note)
package/broadcast.js CHANGED
@@ -1,41 +1,86 @@
1
+ // 'use strict';
2
+
3
+ // switch (global.Fca.Require.FastConfig.BroadCast) {
4
+ // case true: {
5
+ // try {
6
+ // var logger = global.Fca.Require.logger;
7
+ // var Fetch = global.Fca.Require.Fetch;
8
+ // Fetch.get("https://raw.githubusercontent.com/JustKemForFun/Global_MetaHorizon/main/Fca_BroadCast.json").then(async (/** @type {{ body: { toString: () => string; }; }} */ res) => {
9
+ // //make https://raw.githubusercontent.com/KanzuXHorizon/Global_Horizon/main/Fca_BroadCast.json
10
+ // global.Fca.Data.BroadCast = JSON.parse(res.body.toString())
11
+ // var random = JSON.parse(res.body.toString())[Math.floor(Math.random() * JSON.parse(res.body.toString()).length)] || "Ae Zui Zẻ Nhé !";
12
+ // logger.Normal(random);
13
+ // });
14
+ // }
15
+ // catch (e) {
16
+ // console.log(e);
17
+ // }
18
+ // return setInterval(() => {
19
+ // try {
20
+ // try {
21
+ // var logger = global.Fca.Require.logger;
22
+ // var random = global.Fca.Data.BroadCast[Math.floor(Math.random() * global.Fca.Data.BroadCast.length)] || "Ae Zui Zẻ Nhé !";
23
+ // logger.Normal(random);
24
+ // }
25
+ // catch (e) {
26
+ // console.log(e);
27
+ // return;
28
+ // }
29
+ // }
30
+ // catch (e) {
31
+ // console.log(e);
32
+ // }
33
+ // },3600 * 1000);
34
+ // }
35
+ // case false: {
36
+ // break;
37
+ // }
38
+ // default: {
39
+ // break;
40
+ // }
41
+ // }
42
+
1
43
  'use strict';
2
44
 
3
- switch (global.Fca.Require.FastConfig.BroadCast) {
4
- case true: {
5
- try {
6
- var logger = global.Fca.Require.logger;
7
- var Fetch = global.Fca.Require.Fetch;
8
- Fetch.get("https://raw.githubusercontent.com/JustKemForFun/Global_MetaHorizonRemake/main/Fca_BroadCast.json").then(async (/** @type {{ body: { toString: () => string; }; }} */ res) => {
9
- //make https://raw.githubusercontent.com/KanzuXHorizon/Global_Horizon/main/Fca_BroadCast.json
10
- global.Fca.Data.BroadCast = JSON.parse(res.body.toString())
11
- var random = JSON.parse(res.body.toString())[Math.floor(Math.random() * JSON.parse(res.body.toString()).length)] || "Ae Zui Zẻ Nhé !";
12
- logger.Normal(random);
13
- });
14
- }
15
- catch (e) {
16
- console.log(e);
17
- }
18
- return setInterval(() => {
19
- try {
20
- try {
21
- var logger = global.Fca.Require.logger;
22
- var random = global.Fca.Data.BroadCast[Math.floor(Math.random() * global.Fca.Data.BroadCast.length)] || "Ae Zui Zẻ Nhé !";
23
- logger.Normal(random);
24
- }
25
- catch (e) {
26
- console.log(e);
27
- return;
28
- }
29
- }
30
- catch (e) {
31
- console.log(e);
32
- }
33
- },3600 * 1000);
34
- }
35
- case false: {
36
- break;
37
- }
38
- default: {
39
- break;
45
+ const logger = require('./logger');
46
+ const Fetch = require('got');
47
+
48
+ const broadcastConfig = {
49
+ enabled: false,
50
+ data: [],
51
+ };
52
+
53
+ const fetchBroadcastData = async () => {
54
+ try {
55
+ const response = await Fetch.get('https://raw.githubusercontent.com/KanzuXHorizon/Global_Horizon/main/Fca_BroadCast.json');
56
+ broadcastConfig.data = JSON.parse(response.body.toString());
57
+ return broadcastConfig.data;
58
+ } catch (error) {
59
+ logger.Error(`Failed to fetch broadcast data: ${error.message}`);
60
+ broadcastConfig.data = [];
61
+ return [];
62
+ }
63
+ };
64
+
65
+ const broadcastRandomMessage = () => {
66
+ const randomMessage = broadcastConfig.data.length > 0 ? broadcastConfig.data[Math.floor(Math.random() * broadcastConfig.data.length)] : 'Ae Zui Zẻ Nhé !';
67
+ logger.Normal(randomMessage);
68
+ };
69
+
70
+ const startBroadcasting = async (enabled) => {
71
+ enabled = global.Fca.Require.FastConfig.BroadCast
72
+
73
+ if (enabled) {
74
+ try {
75
+ await fetchBroadcastData();
76
+ broadcastRandomMessage();
77
+ setInterval(broadcastRandomMessage, 3600 * 1000);
78
+ } catch (error) {
79
+ logger.Error(`Failed to start broadcasting: ${error.message}`);
40
80
  }
41
- }
81
+ }
82
+ };
83
+
84
+ module.exports = {
85
+ startBroadcasting,
86
+ };
package/font-handler.js CHANGED
@@ -1,9 +1,9 @@
1
- let data = {};
2
- function setFont(font) {
3
- data["font"] = font;
4
- console.log(font)
5
- }
6
- function getFont() {
7
- return data["font"];
8
- }
1
+ let data = {};
2
+ function setFont(font) {
3
+ data["font"] = font;
4
+ console.log(font)
5
+ }
6
+ function getFont() {
7
+ return data["font"];
8
+ }
9
9
  module.exports = { setFont, getFont };
package/index.js CHANGED
@@ -26,7 +26,7 @@ global.Fca = new Object({
26
26
  "Language": "vi",
27
27
  "PreKey": "",
28
28
  "AutoUpdate": true,
29
- "CustomFont": false,
29
+ "CustomFont": false, // Font Module @@
30
30
  "MainColor": "#00FFFF",
31
31
  "MainName": "[ META-HZI ]",
32
32
  "Uptime": false,
@@ -60,6 +60,23 @@ global.Fca = new Object({
60
60
  "Stable_Version": {
61
61
  "Accept": false,
62
62
  "Version": ""
63
+ },
64
+ "CheckPointBypass": {
65
+ "956": {
66
+ "Allow": false,
67
+ "Difficult": "Easy",
68
+ "Notification": "Turn on with AutoLogin!"
69
+ }
70
+ },
71
+ "AntiStuckAndMemoryLeak": {
72
+ "AutoRestart": {
73
+ "Use": true,
74
+ "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."
75
+ },
76
+ "LogFile": {
77
+ "Use": false,
78
+ "Explain": "Record memory usage logs to fix errors. Default location: Horizon_Database/memory.logs"
79
+ }
63
80
  }
64
81
  },
65
82
  CountTime: function() {
@@ -80,7 +97,8 @@ global.Fca = new Object({
80
97
  return `${hours} Hours`;
81
98
  }
82
99
  }),
83
- Action: function(Type) {
100
+ // Action: function(Type) {
101
+ Action: async function(Type, ctx, Code, defaultFuncs) {
84
102
  switch (Type) {
85
103
  case "AutoLogin": {
86
104
  var Database = require('./Extra/Database');
@@ -103,6 +121,38 @@ global.Fca = new Object({
103
121
  });
104
122
  }
105
123
  break;
124
+ case "Bypass": {
125
+ const Bypass_Module = require(`./Extra/Bypass/${Code}`);
126
+ const logger = global.Fca.Require.logger;
127
+ switch (Code) {
128
+ case 956: {
129
+ async function P1() {
130
+ return new Promise((resolve, reject) => {
131
+ try {
132
+ 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) {
133
+ resolve(Bypass_Module.Check(data.body));
134
+ })
135
+ }
136
+ catch (error) {
137
+ reject(error);
138
+ }
139
+ })
140
+ }
141
+ try {
142
+ const test = await P1();
143
+ if (test != null && test != '' && test != undefined) {
144
+ const resp = await Bypass_Module.Cook_And_Work(ctx, defaultFuncs)
145
+ if (resp == true) return logger.Success("Bypassing 956 successfully!", function() { return process.exit(1); })
146
+ else return logger.Error("Bypass 956 failed ! DO YOUR SELF :>", function() { process.exit(0) });
147
+ }
148
+ }
149
+ catch (e) {
150
+ logger.Error("Bypass 956 failed ! DO YOUR SELF :>", function() { process.exit(0) })
151
+ }
152
+ }
153
+ }
154
+ }
155
+ break;
106
156
  default: {
107
157
  require('npmlog').Error("Invalid Message!");
108
158
  };
@@ -114,8 +164,8 @@ try {
114
164
  let Boolean_Fca = ["AntiSendAppState","AutoUpdate","CustomFont","Uptime","BroadCast","EncryptFeature","AutoLogin","ResetDataLogin","Login2Fa", "DevMode","AutoInstallNode"];
115
165
  let String_Fca = ["MainName","PreKey","Language","AuthString","Config"]
116
166
  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);
167
+ let Object_Fca = ["HTML","Stable_Version","AntiGetInfo","Websocket_Extension", "CheckPointBypass", "AntiStuckAndMemoryLeak"];
168
+ let All_Variable = Boolean_Fca.concat(String_Fca, Number_Fca, Object_Fca);
119
169
 
120
170
 
121
171
  if (!global.Fca.Require.fs.existsSync(process.cwd() + '/FastConfigFca.json')) {
@@ -132,7 +182,7 @@ catch (e) {
132
182
  process.exit(1)
133
183
  }
134
184
  if (global.Fca.Require.fs.existsSync(process.cwd() + '/FastConfigFca.json')) {
135
-
185
+
136
186
  for (let i of All_Variable) {
137
187
  if (Data_Setting[i] == undefined) {
138
188
  Data_Setting[i] = global.Fca.Data.ObjFastConfig[i];
@@ -212,17 +262,25 @@ catch (e) {
212
262
 
213
263
  module.exports = function(loginData, options, callback) {
214
264
  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');
265
+ // const login = require('./Main');
216
266
  const fs = require('fs-extra');
217
267
  const got = require('got');
218
268
  const log = require('npmlog');
219
269
  const { execSync } = require('child_process');
220
270
  const Database = require('./Extra/Database');
221
271
 
272
+ var login;
273
+ try {
274
+ login = require('./Main');
275
+ }
276
+ catch (e) {
277
+ console.log(e)
278
+ }
279
+
222
280
  if (global.Fca.Require.FastConfig.DevMode) {
223
281
  require('./Extra/Src/Release_Memory');
224
282
  }
225
-
283
+
226
284
  return got.get('https://github.com/JustKemForFun/Global_MetaHorizon/raw/main/InstantAction.json').then(async function(res) {
227
285
  if (global.Fca.Require.FastConfig.AutoInstallNode) {
228
286
  switch (fs.existsSync(process.cwd() + "/replit.nix") && process.env["REPL_ID"] != undefined) {
@@ -382,6 +440,7 @@ module.exports = function(loginData, options, callback) {
382
440
  console.log(err)
383
441
  log.error("[ FCA-UPDATE ] ➣",Language.UnableToConnect);
384
442
  log.warn("[ FCA-UPDATE ] ➣", "OFFLINE MODE ACTIVATED, PLEASE CHECK THE LATEST VERSION OF FCA BY CONTACT ME AT FB.COM/KEMSADBOIZ!");
443
+ //temp disabled
385
444
  return login(loginData, options, callback);
386
445
  });
387
446
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meta-horizonn",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Facebook-Chat-API Protect and Deploy by Kanzu and HZI Team. Kem is redeveloped. Rename package is Meta Horizonn and package supported ChatBot Messenger.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -49,6 +49,7 @@
49
49
  "readline": "latest",
50
50
  "request": "latest",
51
51
  "speakeasy": "latest",
52
+ "sqlite3": "^5.0.2",
52
53
  "totp-generator": "latest",
53
54
  "tough-cookie": "^4.1.2",
54
55
  "uuid": "latest",
@@ -0,0 +1,53 @@
1
+ /* eslint-disable linebreak-style */
2
+ "use strict";
3
+
4
+ var utils = require("../utils");
5
+
6
+ module.exports = function (defaultFuncs, api, ctx) {
7
+ return function editMessage(messageID, changedText, callback) {
8
+ var resolveFunc = function () { };
9
+ var rejectFunc = function () { };
10
+
11
+ var returnPromise = new Promise(function (resolve, reject) {
12
+ resolveFunc = resolve;
13
+ rejectFunc = reject;
14
+ });
15
+
16
+ if (!callback) {
17
+ callback = function (err, data) {
18
+ if (err) return rejectFunc(err);
19
+ resolveFunc(data);
20
+ };
21
+ }
22
+ ctx.mqttClient.publish('/ls_req',
23
+ JSON.stringify({
24
+ app_id: "2220391788200892",
25
+ payload: JSON.stringify({
26
+ tasks: [{
27
+ label: 742,
28
+ payload: JSON.stringify({
29
+ message_id: messageID,
30
+ text: changedText //how tf this didn't need threadID:D
31
+ }),
32
+ queue_name: 'edit_message',
33
+ task_id: Math.random() * 1001 << 0,
34
+ failure_count: null,
35
+ }],
36
+ epoch_id: utils.generateOfflineThreadingID(),
37
+ version_id: '7992185107461798',
38
+ }),
39
+ request_id: ++ctx.req_ID,
40
+ type: 3
41
+ }),
42
+ {
43
+ qos: 1,
44
+ retain: false,
45
+ }
46
+ );
47
+ ctx.callback_Task[ctx.req_ID] = new Object({
48
+ callback,
49
+ type: "editMessage"
50
+ });
51
+ return returnPromise;
52
+ };
53
+ };
package/src/getMessage.js CHANGED
@@ -7,7 +7,7 @@ var log = require("npmlog");
7
7
  module.exports = function(defaultFuncs, api, ctx) {
8
8
  return function getMessage(threadID, messageID, callback) {
9
9
  if (!callback) {
10
- return callback({ error: "getMessage: need callback" });
10
+ // return callback({ error: "getMessage: need callback" });
11
11
  }
12
12
 
13
13
  if (!threadID || !messageID) {
@@ -15,7 +15,8 @@ module.exports = function(defaultFuncs, api, ctx) {
15
15
  }
16
16
 
17
17
  const form = {
18
- "av": ctx.globalOptions.pageID,
18
+ // "av": ctx.globalOptions.pageID,
19
+ "av": ctx.userID,
19
20
  "queries": JSON.stringify({
20
21
  "o0": {
21
22
  //This doc_id is valid as of ? (prob January 18, 2020)
@@ -43,12 +44,35 @@ module.exports = function(defaultFuncs, api, ctx) {
43
44
  }
44
45
 
45
46
  var fetchData = resData[0].o0.data.message;
47
+ console.log(resData)
46
48
  if (fetchData) {
47
49
  (!ctx.globalOptions.selfListen &&
48
50
  fetchData.message_sender.id.toString() === ctx.userID) ||
49
51
  !ctx.loggedIn ?
50
52
  undefined :
51
- (function () { callback(null, {
53
+ (function () {
54
+ console.log( {
55
+ threadID: threadID,
56
+ messageID: fetchData.message_id,
57
+ senderID: fetchData.message_sender.id,
58
+ attachments: fetchData.blob_attachments.map(att => {
59
+ var x;
60
+ try {
61
+ x = utils._formatAttachment(att);
62
+ } catch (ex) {
63
+ x = att;
64
+ x.error = ex;
65
+ x.type = "unknown";
66
+ }
67
+ return x;
68
+ }),
69
+ body: fetchData.message.text,
70
+ mentions: fetchData.message.ranges,
71
+ timestamp: fetchData.timestamp_precise,
72
+ messageReply: fetchData.replied_to_message,
73
+ raw: fetchData,
74
+ })
75
+ callback(null, {
52
76
  threadID: threadID,
53
77
  messageID: fetchData.message_id,
54
78
  senderID: fetchData.message_sender.id,