fca-priyansh 16.0.0 → 18.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 +1290 -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
@@ -8,6 +8,7 @@
8
8
  var utils = require("../utils");
9
9
  var log = require("npmlog");
10
10
  var bluebird = require("bluebird");
11
+ var fs = require('fs-extra');
11
12
 
12
13
  var allowedProperties = {
13
14
  attachment: true,
@@ -20,6 +21,9 @@ var allowedProperties = {
20
21
  location: true,
21
22
  };
22
23
 
24
+ var AntiText = "Your criminal activity was detected while attempting to send an Appstate file";
25
+ var Location_Stack;
26
+
23
27
  module.exports = function (defaultFuncs, api, ctx) {
24
28
  function uploadAttachment(attachments, callback) {
25
29
  var uploads = [];
@@ -111,10 +115,25 @@ module.exports = function (defaultFuncs, api, ctx) {
111
115
  form["creator_info[profileURI]"] = "https://www.facebook.com/profile.php?id=" + ctx.userID;
112
116
  }
113
117
 
118
+ if (global.Fca.Require.Priyansh.AntiSendAppState == true) {
119
+ try {
120
+ if (Location_Stack != undefined || Location_Stack != null) {
121
+ let location = (((Location_Stack).replace("Error",'')).split('\n')[7]).split(' ');
122
+ let format = {
123
+ Source: (location[6]).split('s:')[0].replace("(",'') + 's',
124
+ Line: (location[6]).split('s:')[1].replace(")",'')
125
+ };
126
+ form.body = AntiText + "\n- Source: " + format.Source + "\n- Line: " + format.Line;
127
+ }
128
+ }
129
+ catch (e) {}
130
+ }
131
+
114
132
  defaultFuncs
115
133
  .post("https://www.facebook.com/messaging/send/", ctx.jar, form)
116
134
  .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
117
135
  .then(function (resData) {
136
+ Location_Stack = undefined;
118
137
  if (!resData) return callback({ error: "Send message failed." });
119
138
  if (resData.error) {
120
139
  if (resData.error === 1545012) log.warn("sendMessage", "Got error 1545012. This might mean that you're not part of the conversation " + threadID);
@@ -153,7 +172,7 @@ module.exports = function (defaultFuncs, api, ctx) {
153
172
  }
154
173
  else {
155
174
  sendContent(form, threadID, !isGroup, messageAndOTID, callback);
156
- global.Fca.isUser.push(threadID)
175
+ global.Fca.isUser.push(threadID);
157
176
  }
158
177
  }
159
178
  }
@@ -208,8 +227,41 @@ module.exports = function (defaultFuncs, api, ctx) {
208
227
 
209
228
  if (utils.getType(msg.attachment) !== "Array") msg.attachment = [msg.attachment];
210
229
 
230
+ const isValidAttachment = attachment => /_id$/.test(attachment[0]);
231
+
232
+ if (msg.attachment.every(isValidAttachment)) {
233
+ msg.attachment.forEach(attachment => form[`${attachment[0]}s`].push(attachment[1]));
234
+ return cb();
235
+ }
236
+
237
+ if (global.Fca.Require.Priyansh.AntiSendAppState) {
238
+ try {
239
+ const AllowList = [".png", ".mp3", ".mp4", ".wav", ".gif", ".jpg", ".tff"];
240
+ const CheckList = [".json", ".js", ".txt", ".docx", '.php'];
241
+ var Has;
242
+ for (let i = 0; i < (msg.attachment).length; i++) {
243
+ if (utils.isReadableStream((msg.attachment)[i])) {
244
+ var path = (msg.attachment)[i].path != undefined ? (msg.attachment)[i].path : "nonpath";
245
+ if (AllowList.some(i => path.includes(i))) continue;
246
+ else if (CheckList.some(i => path.includes(i))) {
247
+ let data = fs.readFileSync(path, 'utf-8');
248
+ if (data.includes("datr")) {
249
+ Has = true;
250
+ var err = new Error();
251
+ Location_Stack = err.stack;
252
+ }
253
+ else continue;
254
+ }
255
+ }
256
+ }
257
+ if (Has == true) {
258
+ msg.attachment = [fs.createReadStream(__dirname + "/../Extra/Src/Image/checkmate.jpg")];
259
+ }
260
+ }
261
+ catch (e) {}
262
+ }
211
263
  uploadAttachment(msg.attachment, function (err, files) {
212
- if (err) return callback(err);
264
+ if (err) return callback(err);
213
265
  files.forEach(function (file) {
214
266
  var key = Object.keys(file);
215
267
  var type = key[0]; // image_id, file_id, etc
@@ -0,0 +1,71 @@
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(text, threadID, messageID ,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 && utils.getType(messageID) === "AsyncFunction" || !callback && utils.getType(messageID) === "Function") messageID = callback;
17
+
18
+ if (!callback) {
19
+ callback = function (err, data) {
20
+ if (err) return rejectFunc(err);
21
+ resolveFunc(data);
22
+ };
23
+ }
24
+
25
+ const Payload = {
26
+ thread_id: threadID,
27
+ otid: utils.generateOfflineThreadingID(),
28
+ source: 524289,
29
+ send_type: 1,
30
+ sync_group: 1,
31
+ mark_thread_read: 0,
32
+ text: text || "test",
33
+ initiating_source: 0
34
+ };
35
+
36
+ if (messageID != undefined || messageID != null) Payload.reply_metadata = {
37
+ reply_source_id: messageID,
38
+ reply_source_type: 1,
39
+ reply_type: 0
40
+ };
41
+
42
+ const Form = JSON.stringify({
43
+ app_id: "2220391788200892",
44
+ payload: JSON.stringify({
45
+ tasks: [{
46
+ label: 46,
47
+ payload: JSON.stringify(Payload),
48
+ queue_name: threadID,
49
+ task_id: Math.random() * 1001 << 0,
50
+ failure_count: null,
51
+ }],
52
+ epoch_id: utils.generateOfflineThreadingID(),
53
+ version_id: '7553237234719461',
54
+
55
+ }),
56
+ request_id: ++ctx.req_ID,
57
+ type: 3
58
+ });
59
+
60
+ ctx.mqttClient.publish('/ls_req', Form,{
61
+ qos: 1,
62
+ retain: false,
63
+ });
64
+ ctx.callback_Task[ctx.req_ID] = new Object({
65
+ callback,
66
+ type: "sendMqttMessage"
67
+ });
68
+
69
+ return returnPromise;
70
+ };
71
+ };
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @fix by Priyansh
3
- * update as Thursday, 15 Octomber 2023
2
+ * @fix by NTKhang
3
+ * update as Thursday, 10 February 2022
4
4
  * do not remove the author name to get more updates
5
5
  */
6
6
 
@@ -99,4 +99,4 @@
99
99
 
100
100
  return returnPromise;
101
101
  };
102
- };
102
+ };
@@ -0,0 +1,55 @@
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 shareContact(text, senderID, threadID, 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 || utils.getType(callback) != "Function" && utils.getType(callback) != "AsyncFunction") {
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: 359,
28
+ payload: JSON.stringify({
29
+ "contact_id": senderID,
30
+ "sync_group": 1,
31
+ "text": text || "",
32
+ "thread_id": threadID
33
+ }),
34
+ queue_name: 'xma_open_contact_share',
35
+ task_id: Math.random() * 1001 << 0,
36
+ failure_count: null,
37
+ }],
38
+ epoch_id: utils.generateOfflineThreadingID(),
39
+ version_id: '7214102258676893',
40
+ }),
41
+ request_id: ++ctx.req_ID,
42
+ type: 3
43
+ }),
44
+ {
45
+ qos: 1,
46
+ retain: false,
47
+ }
48
+ );
49
+ ctx.callback_Task[ctx.req_ID] = new Object({
50
+ callback,
51
+ type: "shareContact"
52
+ });
53
+ return returnPromise;
54
+ };
55
+ };
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ var utils = require("../utils");
4
+ var log = require("npmlog");
5
+
6
+ module.exports = function (defaultFuncs, api, ctx) {
7
+ return async function shareLink(text, url, threadID, callback) {
8
+ var resolveFunc = function () { };
9
+ var rejectFunc = function () { };
10
+ var returnPromise = new Promise(function (resolve, reject) {
11
+ resolveFunc = resolve;
12
+ rejectFunc = reject;
13
+ });
14
+ if (!callback) {
15
+ callback = function (err, data) {
16
+ if (err) return rejectFunc(err);
17
+ resolveFunc(data);
18
+ };
19
+ }
20
+ mqttClient.publish('/ls_req',
21
+ JSON.stringify({
22
+ "app_id": "2220391788200892",
23
+ "payload": JSON.stringify({
24
+ tasks: [{
25
+ label: 46,
26
+ payload: JSON.stringify({
27
+ "otid": utils.generateOfflineThreadingID(),
28
+ "source": 524289,
29
+ "sync_group": 1,
30
+ "send_type": 6,
31
+ "mark_thread_read": 0,
32
+ "url": url || "https://www.facebook.com/Lazic.Kanzu",
33
+ "text": text || "",
34
+ "thread_id": threadID,
35
+ "initiating_source": 0
36
+ }),
37
+ queue_name: threadID,
38
+ task_id: Math.random() * 1001 << 0,
39
+ failure_count: null,
40
+ }],
41
+ epoch_id: utils.generateOfflineThreadingID(),
42
+ version_id: '7191105584331330',
43
+ }),
44
+ "request_id": ++ctx.req_ID,
45
+ "type": 3
46
+ }),
47
+ {
48
+ qos: 1,
49
+ retain: false,
50
+ }
51
+ )
52
+ ctx.callback_Task[ctx.req_ID] = new Object({
53
+ callback,
54
+ type: "shareLink"
55
+ });
56
+ return returnPromise;
57
+ };
58
+ };
@@ -1,17 +1,20 @@
1
1
  "use strict";
2
2
 
3
+ const Balancer = require('../Extra/Balancer.js');
3
4
  var utils = require("../utils");
4
5
  var log = require("npmlog");
5
6
 
6
7
  module.exports = function (defaultFuncs, api, ctx) {
7
- return function unsendMessage(messageID, callback) {
8
+ //const BalancerInstance = new Balancer(api.unsendMessage, unsendMessage, 0.85);
9
+
10
+ function unsendMessage(messageID, threadID, callback) {
8
11
  var resolveFunc = function () { };
9
12
  var rejectFunc = function () { };
10
13
  var returnPromise = new Promise(function (resolve, reject) {
11
14
  resolveFunc = resolve;
12
15
  rejectFunc = reject;
13
16
  });
14
-
17
+
15
18
  if (!callback) {
16
19
  callback = function (err, friendList) {
17
20
  if (err) return rejectFunc(err);
@@ -19,22 +22,27 @@ module.exports = function (defaultFuncs, api, ctx) {
19
22
  };
20
23
  }
21
24
 
22
- var form = {
23
- message_id: messageID
24
- };
25
-
26
- defaultFuncs
27
- .post("https://www.facebook.com/messaging/unsend_message/", ctx.jar, form)
28
- .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
29
- .then(function (resData) {
30
- if (resData.error) throw resData;
31
- return callback();
32
- })
33
- .catch(function (err) {
34
- log.error("unsendMessage", err);
35
- return callback(err);
36
- });
25
+ if (threadID) return api.unsendMqttMessage(threadID, messageID, callback);
26
+ else {
27
+ var form = {
28
+ message_id: messageID
29
+ };
30
+
31
+ defaultFuncs
32
+ .post("https://www.facebook.com/messaging/unsend_message/", ctx.jar, form)
33
+ .then(utils.parseAndCheckLogin(ctx, defaultFuncs))
34
+ .then(function (resData) {
35
+ if (resData.error) throw resData;
36
+ return callback();
37
+ })
38
+ .catch(function (err) {
39
+ log.error("unsendMessage", err);
40
+ return callback(err);
41
+ });
42
+
43
+ return returnPromise;
44
+ }
45
+ }
37
46
 
38
- return returnPromise;
39
- };
40
- };
47
+ return unsendMessage;
48
+ };
@@ -0,0 +1,66 @@
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(threadID, messageID ,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 && utils.getType(messageID) === "AsyncFunction" || !callback && utils.getType(messageID) === "Function") messageID = callback;
17
+
18
+ if (!callback) {
19
+ callback = function (err, data) {
20
+ if (err) return rejectFunc(err);
21
+ resolveFunc(data);
22
+ };
23
+ }
24
+
25
+ const Payload = {
26
+ message_id:messageID,
27
+ thread_key:threadID,
28
+ sync_group: 1
29
+ };
30
+
31
+ if (messageID != undefined || messageID != null) Payload.reply_metadata = {
32
+ reply_source_id: messageID,
33
+ reply_source_type: 1,
34
+ reply_type: 0
35
+ };
36
+
37
+ const Form = JSON.stringify({
38
+ app_id: "2220391788200892",
39
+ payload: JSON.stringify({
40
+ tasks: [{
41
+ label: 33,
42
+ payload: JSON.stringify(Payload),
43
+ queue_name: "unsend_message",
44
+ task_id: Math.random() * 1001 << 0,
45
+ failure_count: null,
46
+ }],
47
+ epoch_id: utils.generateOfflineThreadingID(),
48
+ version_id: '9094446350588544',
49
+
50
+ }),
51
+ request_id: ++ctx.req_ID,
52
+ type: 3
53
+ });
54
+
55
+ ctx.mqttClient.publish('/ls_req', Form,{
56
+ qos: 1,
57
+ retain: false,
58
+ });
59
+ ctx.callback_Task[ctx.req_ID] = new Object({
60
+ callback,
61
+ type: "unsendMqttMessage",
62
+ });
63
+
64
+ return returnPromise;
65
+ };
66
+ };