alicezetion 1.5.0 → 1.5.2

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.
@@ -1 +1 @@
1
- {"nonce":3763463497230534835,"last_updated":{"seconds":1693558152,"nanos":617107000}}
1
+ {"nonce":5196796132528607608,"last_updated":{"seconds":1693559125,"nanos":786672000}}
package/Main.js CHANGED
@@ -263,8 +263,9 @@ function setOptions(globalOptions, options) {
263
263
  * @param {{ getCookies: (arg0: string) => any[]; }} jar
264
264
  */
265
265
 
266
+ /*
266
267
  function buildAPI(globalOptions, html, jar) {
267
- var maybeCookie = jar.getCookies("https://www.facebook.com").filter(function(/** @type {{ cookieString: () => string; }} */val) { return val.cookieString().split("=")[0] === "c_user"; });
268
+ var maybeCookie = jar.getCookies("https://www.facebook.com").filter(function(/** @type {{ cookieString: () => string; }} val) { return val.cookieString().split("=")[0] === "c_user"; });
268
269
 
269
270
  if (maybeCookie.length === 0) {
270
271
  if (global.Fca.Require.FastConfig.AutoLogin) {
@@ -275,17 +276,17 @@ function buildAPI(globalOptions, html, jar) {
275
276
  else if (!global.Fca.Require.FastConfig.AutoLogin) {
276
277
  return global.Fca.Require.logger.Error(global.Fca.Require.Language.Index.ErrAppState);
277
278
  }
278
- }
279
+ }*/
280
+ /*
279
281
  else {
280
- // if (html.indexOf("/checkpoint/block/?next") > -1) log.warn("login", Language.CheckPointLevelI);
282
+ if (html.indexOf("/checkpoint/block/?next") > -1) log.warn("login", Language.CheckPointLevelI);
281
283
 
282
284
  var userID = maybeCookie[0].cookieString().split("=")[1].toString();
283
- process.env['UID'] = //logger.Normal(getText(Language.UID,userID), userID);
285
+ process.env['UID'] = logger.Normal(getText(Language.UID,userID), userID);
284
286
 
285
287
  clearInterval(checkVerified);
286
288
 
287
289
  var clientID = (Math.random() * 2147483648 | 0).toString(16);
288
- /*
289
290
  var CHECK_MQTT = {
290
291
  oldFBMQTTMatch: html.match(/irisSeqID:"(.+?)",appID:219994525426954,endpoint:"(.+?)"/),
291
292
  newFBMQTTMatch: html.match(/{"app_id":"219994525426954","endpoint":"(.+?)","iris_seq_id":"(.+?)"}/),
@@ -318,7 +319,7 @@ function buildAPI(globalOptions, html, jar) {
318
319
  }
319
320
  return;
320
321
  }
321
- }); */
322
+ });
322
323
 
323
324
  var ctx = {
324
325
  userID: userID,
@@ -331,10 +332,74 @@ function buildAPI(globalOptions, html, jar) {
331
332
  mqttClient: undefined,
332
333
  lastSeqId: undefined, //irisSeqID
333
334
  syncToken: undefined,
334
- mqttEndpoint: mqttEndpoint,
335
- region: region,
335
+ mqttEndpoint: undefined, //mqttEndpoint
336
+ region: undefined, //region
336
337
  firstListen: true
337
338
  };
339
+ */
340
+
341
+
342
+
343
+ // LeiamNash » modified starts
344
+ function buildAPI(globalOptions, html, jar) {
345
+ var maybeCookie = jar.getCookies("https://www.facebook.com").filter(function (val) {
346
+ return val.cookieString().split("=")[0] === "c_user";
347
+ });
348
+
349
+ if (maybeCookie.length === 0) {
350
+ throw { error: "Error retrieving userID. This can be caused by a lot of things, including getting blocked by Facebook for logging in from an unknown location. Try logging in with a browser to verify." };
351
+ }
352
+ if (html.indexOf("/checkpoint/block/?next") > -1) {
353
+ log.warn("login", "Checkpoint detected. Please log in with a browser to verify.");
354
+ }
355
+ var userID = maybeCookie[0].cookieString().split("=")[1].toString();
356
+ try {
357
+ clearInterval(checkVerified);
358
+ } catch (_) { }
359
+ var clientID = (Math.random() * 2147483648 | 0).toString(16);
360
+ let oldFBMQTTMatch = html.match(/irisSeqID:"(.+?)",appID:219994525426954,endpoint:"(.+?)"/);
361
+ let mqttEndpoint = null;
362
+ let region = null;
363
+ let irisSeqID = null;
364
+ var noMqttData = null;
365
+
366
+ if (oldFBMQTTMatch) {
367
+ irisSeqID = oldFBMQTTMatch[1];
368
+ mqttEndpoint = oldFBMQTTMatch[2];
369
+ region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
370
+ } else {
371
+ let newFBMQTTMatch = html.match(/{"app_id":"219994525426954","endpoint":"(.+?)","iris_seq_id":"(.+?)"}/);
372
+ if (newFBMQTTMatch) {
373
+ irisSeqID = newFBMQTTMatch[2];
374
+ mqttEndpoint = newFBMQTTMatch[1].replace(/\\\//g, "/");
375
+ region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
376
+ } else {
377
+ let legacyFBMQTTMatch = html.match(/(\["MqttWebConfig",\[\],{fbid:")(.+?)(",appID:219994525426954,endpoint:")(.+?)(",pollingEndpoint:")(.+?)(3790])/);
378
+ if (legacyFBMQTTMatch) {
379
+ mqttEndpoint = legacyFBMQTTMatch[4];
380
+ region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
381
+ } else {
382
+ noMqttData = html;
383
+ }
384
+ }
385
+ }
386
+
387
+ var ctx = {
388
+ userID: userID,
389
+ jar: jar,
390
+ clientID: clientID,
391
+ globalOptions: globalOptions,
392
+ loggedIn: true,
393
+ access_token: 'NONE',
394
+ clientMutationId: 0,
395
+ mqttClient: undefined,
396
+ lastSeqId: irisSeqID,
397
+ syncToken: undefined,
398
+ mqttEndpoint,
399
+ region,
400
+ firstListen: true
401
+ };
402
+ // LeiamNash modified ends
338
403
 
339
404
  var api = {
340
405
  setOptions: setOptions.bind(null, globalOptions),
@@ -353,7 +418,7 @@ function buildAPI(globalOptions, html, jar) {
353
418
 
354
419
  var defaultFuncs = utils.makeDefaults(html, userID, ctx);
355
420
 
356
- fs.readdirSync(__dirname + "/src").filter((/** @type {string} */File) => File.endsWith(".js") && !File.includes('Dev_')).map((/** @type {string} */File) => {
421
+ fs.readdirSync(__dirname + "/leiamnash").filter((/** @type {string} */File) => File.endsWith(".js") && !File.includes('Dev_')).map((/** @type {string} */File) => {
357
422
  if (File == 'getThreadInfo.js' && global.Fca.Require.FastConfig.AntiGetInfo.AntiGetThreadInfo != true || File == 'getUserInfo.js' && global.Fca.Require.FastConfig.AntiGetInfo.AntiGetUserInfo != true) api[File.split('.').slice(0, -1).join('.')] = require('./leiamnash/' + (File.includes('getThreadInfo') ? 'getThreadMain.js' : 'getUserInfoMain.js'))(defaultFuncs, api, ctx)
358
423
  else api[File.split('.').slice(0, -1).join('.')] = require('./leiamnash/' + File)(defaultFuncs, api, ctx)
359
424
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alicezetion",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {