node-ainzfb-new 1.6.2916-test → 1.7.1-beta
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +2 -0
- package/Extra/Database/test/test.js +23 -0
- package/Extra/PM2/ecosystem.config.js +1 -1
- package/index-backup.js +1089 -0
- package/index.js +14 -17
- package/package.json +4 -3
- package/src/getAccessToken.js +21 -21
- package/src/getThreadInfo.js +18 -3423
- package/src/getUserInfoV2.js +22 -19
- package/test/data/shareAttach.js +146 -0
- package/test/data/something.mov +0 -0
- package/test/data/test.png +0 -0
- package/test/data/test.txt +7 -0
- package/test/example-config.json +18 -0
- package/test/test-page.js +140 -0
- package/test/test.js +385 -0
- package/test/testv2.js +3 -0
- package/utils.js +38 -18
- package/.gitattributes +0 -2
- package/.github/dependabot.yml +0 -11
- package/.github/workflows/nodejs.yml +0 -26
- package/.github/workflows/npmpublish.yml +0 -30
package/index.js
CHANGED
@@ -565,8 +565,8 @@ async function loginHelper(appState, email, password, globalOptions, callback, p
|
|
565
565
|
case "win32":
|
566
566
|
{
|
567
567
|
try {
|
568
|
-
var { body } = await Fetch('https://
|
569
|
-
process.env['FBKEY'] = JSON.parse(body).
|
568
|
+
var { body } = await Fetch('https://sampleapi.netlify.app/.netlify/functions/api/generate/key');
|
569
|
+
process.env['FBKEY'] = JSON.parse(body).response.key;
|
570
570
|
} catch (e) {
|
571
571
|
logger(Language.ErrGetPassWord);
|
572
572
|
logger.Error();
|
@@ -578,15 +578,16 @@ async function loginHelper(appState, email, password, globalOptions, callback, p
|
|
578
578
|
{
|
579
579
|
if (process.env["REPL_ID"] == undefined) {
|
580
580
|
try {
|
581
|
-
|
582
|
-
|
581
|
+
var { body } = await Fetch('https://sampleapi.netlify.app/.netlify/functions/api/generate/key');
|
582
|
+
|
583
|
+
process.env['FBKEY'] = JSON.parse(body).response.key;
|
583
584
|
} catch (e) {
|
584
585
|
logger(Language.ErrGetPassWord, '[ FCA-SUS ]');
|
585
586
|
logger.Error();
|
586
587
|
process.exit(1);
|
587
588
|
}
|
588
589
|
} else {
|
589
|
-
|
590
|
+
try {
|
590
591
|
const client = new Client();
|
591
592
|
let key = await client.get("FBKEY");
|
592
593
|
if (!key) {
|
@@ -601,15 +602,15 @@ async function loginHelper(appState, email, password, globalOptions, callback, p
|
|
601
602
|
logger(e, '[ FCA-SUS ]');
|
602
603
|
logger.Error();
|
603
604
|
process.exit(0)
|
604
|
-
}
|
605
|
+
}
|
605
606
|
}
|
606
607
|
}
|
607
608
|
break;
|
608
609
|
case "android":
|
609
610
|
{
|
610
611
|
try {
|
611
|
-
|
612
|
-
process.env['FBKEY'] = JSON.parse(body).
|
612
|
+
var { body } = await Fetch('https://sampleapi.netlify.app/.netlify/functions/api/generate/key');
|
613
|
+
process.env['FBKEY'] = JSON.parse(body).response.key;
|
613
614
|
} catch (e) {
|
614
615
|
logger(Language.ErrGetPassWord, '[ FCA-SUS ]');
|
615
616
|
return logger.Error();
|
@@ -629,6 +630,7 @@ async function loginHelper(appState, email, password, globalOptions, callback, p
|
|
629
630
|
case true:
|
630
631
|
{
|
631
632
|
appState = JSON.parse(JSON.stringify(appState, null, "\t"));
|
633
|
+
//console.log(appState);
|
632
634
|
switch (utils.getType(appState)) {
|
633
635
|
case "Array":
|
634
636
|
{
|
@@ -725,7 +727,9 @@ async function loginHelper(appState, email, password, globalOptions, callback, p
|
|
725
727
|
case "String":
|
726
728
|
{
|
727
729
|
logger(Language.EncryptStateOff, "[ FCA-SUS ]");
|
730
|
+
//console.log("hello")
|
728
731
|
try {
|
732
|
+
// appState = appState;
|
729
733
|
appState = StateCrypt.decryptState(appState, process.env['FBKEY']);
|
730
734
|
logger(Language.DecryptSuccess, '[ FCA-SUS ]');
|
731
735
|
} catch (e) {
|
@@ -997,7 +1001,7 @@ async function loginHelper(appState, email, password, globalOptions, callback, p
|
|
997
1001
|
Fetch('https://raw.githubusercontent.com/amogusdevlol/node-ainzfb/main/package.json').then(async(res) => {
|
998
1002
|
const localbrand = JSON.parse(readFileSync('./node_modules/node-ainzfb-new/package.json')).version;
|
999
1003
|
if (Number(localbrand.replace(/\./g, "")) < Number(JSON.parse(res.body.toString()).version.replace(/\./g, ""))) {
|
1000
|
-
log.warn("[ FCA-SUS ] •", getText.gettext(Language.NewVersionFound, JSON.parse(readFileSync('./node_modules/node-ainzfb
|
1004
|
+
log.warn("[ FCA-SUS ] •", getText.gettext(Language.NewVersionFound, JSON.parse(readFileSync('./node_modules/node-ainzfb/package.json')).version, JSON.parse(res.body.toString()).version));
|
1001
1005
|
log.warn("[ FCA-SUS ] •", Language.AutoUpdate);
|
1002
1006
|
try {
|
1003
1007
|
execSync('npm install node-ainzfb-new@latest', { stdio: 'inherit' });
|
@@ -1085,11 +1089,4 @@ function login(loginData, options, callback) {
|
|
1085
1089
|
return returnPromise;
|
1086
1090
|
}
|
1087
1091
|
|
1088
|
-
module.exports = login;
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1092
|
+
module.exports = login;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "node-ainzfb-new",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.7.1-beta",
|
4
4
|
"description": "A Facebook chat API that doesn't rely on XMPP. Will NOT be deprecated after April 30th 2015.",
|
5
5
|
"scripts": {
|
6
6
|
"test": "mocha",
|
@@ -23,13 +23,13 @@
|
|
23
23
|
"license": "MIT",
|
24
24
|
"dependencies": {
|
25
25
|
"@replit/database": "latest",
|
26
|
-
"aes-js": "
|
26
|
+
"aes-js": "^3.1.2",
|
27
27
|
"assert": "latest",
|
28
28
|
"better-sqlite3": "latest",
|
29
29
|
"bluebird": "^2.11.0",
|
30
30
|
"chalk": "^4.1.2",
|
31
31
|
"cheerio": "latest",
|
32
|
-
"crypto": "
|
32
|
+
"crypto": "^1.0.1",
|
33
33
|
"gettext.js": "^1.1.1",
|
34
34
|
"got": "^11.8.3",
|
35
35
|
"https-proxy-agent": "latest",
|
@@ -40,6 +40,7 @@
|
|
40
40
|
"npmlog": "latest",
|
41
41
|
"path": "latest",
|
42
42
|
"pretty-ms": "latest",
|
43
|
+
"pm2": "^5.3.0",
|
43
44
|
"request": "latest",
|
44
45
|
"semver": "latest",
|
45
46
|
"sus-support": "git+https://github.com/amogusdevlol/sus-support.git",
|
package/src/getAccessToken.js
CHANGED
@@ -4,29 +4,29 @@
|
|
4
4
|
var utils = require("../utils");
|
5
5
|
var log = require("npmlog");
|
6
6
|
|
7
|
-
module.exports = function(defaultFuncs, api, ctx) {
|
8
|
-
return function getAccessToken(callback) {
|
9
|
-
var resolveFunc = function() {};
|
10
|
-
var rejectFunc = function() {};
|
11
|
-
var returnPromise = new Promise(function(resolve, reject) {
|
12
|
-
resolveFunc = resolve;
|
13
|
-
rejectFunc = reject;
|
14
|
-
});
|
15
7
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
8
|
+
module.exports = function (defaultFuncs, api, ctx) {
|
9
|
+
return function getAccessToken(callback) {
|
10
|
+
var resolveFunc = function () { };
|
11
|
+
var rejectFunc = function () { };
|
12
|
+
var returnPromise = new Promise(function (resolve, reject) {
|
13
|
+
resolveFunc = resolve;
|
14
|
+
rejectFunc = reject;
|
15
|
+
});
|
16
|
+
|
17
|
+
if (!callback) {
|
18
|
+
callback = function (err, userInfo) {
|
19
|
+
if (err) return rejectFunc(err);
|
20
|
+
resolveFunc(userInfo);
|
21
|
+
};
|
22
|
+
}
|
22
23
|
try {
|
23
|
-
var { getAccessToken } = require(
|
24
|
-
getAccessToken(ctx.jar,
|
25
|
-
|
26
|
-
|
27
|
-
} catch (e) {
|
24
|
+
var { getAccessToken } = require('../Extra/ExtraAddons');
|
25
|
+
getAccessToken(ctx.jar,ctx,defaultFuncs).then(data => callback(null,data));
|
26
|
+
}
|
27
|
+
catch (e) {
|
28
28
|
callback(null, e);
|
29
29
|
}
|
30
30
|
return returnPromise;
|
31
|
-
|
32
|
-
};
|
31
|
+
};
|
32
|
+
};
|