fca-arif-babu 12.0.0 → 13.0.0
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/Extra/Balancer.js +49 -0
- package/Extra/Bypass/956/index.js +234 -0
- package/Extra/Bypass/test/aaaa.json +169 -0
- package/Extra/Bypass/test/index.js +188 -0
- package/Extra/Database/index.js +469 -0
- package/Extra/ExtraAddons.js +82 -0
- package/Extra/ExtraFindUID.js +62 -0
- package/Extra/ExtraGetThread.js +365 -0
- package/Extra/ExtraScreenShot.js +430 -0
- package/Extra/ExtraUptimeRobot.js +38 -0
- package/Extra/Html/Classic/script.js +119 -0
- package/Extra/Html/Classic/style.css +8 -0
- package/Extra/Security/AES_256_GCM/index.js +1 -0
- package/Extra/Security/Base/Step_1.js +6 -0
- package/Extra/Security/Base/Step_2.js +22 -0
- package/Extra/Security/Base/Step_3.js +22 -0
- package/Extra/Security/Base/index.js +191 -0
- package/Extra/Security/Step_1.js +6 -0
- package/Extra/Security/Step_2.js +22 -0
- package/Extra/Security/Step_3.js +22 -0
- package/Extra/Security/index.js +5 -0
- package/Extra/Src/Change_Environment.js +24 -0
- package/Extra/Src/Check_Update.js +67 -0
- package/Extra/Src/History.js +115 -0
- package/Extra/Src/Instant_Update.js +65 -0
- package/Extra/Src/Last-Run.js +65 -0
- package/Extra/Src/Premium.js +81 -0
- package/Extra/Src/Release_Memory.js +160 -0
- package/Extra/Src/Websocket.js +213 -0
- package/Extra/Src/image/62518eafb0670b697788ce4f9a4f71d1.jpg +0 -0
- package/Extra/Src/test.js +28 -0
- package/Extra/Src/uuid.js +137 -0
- package/Func/AcceptAgreement.js +31 -0
- package/Func/ClearCache.js +64 -0
- package/Func/ReportV1.js +54 -0
- package/{LICENSE-MIT → LICENSE.txt} +6 -6
- package/Language/index.json +228 -0
- package/Main.js +1289 -0
- package/README.md +4 -0
- package/SECURITY.md +17 -0
- package/broadcast.js +44 -0
- package/index.js +414 -511
- package/logger.js +66 -0
- package/package.json +89 -372
- package/test/data/something.mov +1 -1
- package/test/env/.env +1 -0
- package/test/testv2.js +3 -0
- package/utils.js +2918 -1393
- package/.upm/store.json +0 -1
- package/ARIF-FCA.json +0 -4
- package/CHANGELOG.md +0 -2
package/index.js
CHANGED
@@ -1,545 +1,448 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
const utils = require(
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
break;
|
69
|
-
case 'emitReady':
|
70
|
-
globalOptions.emitReady = Boolean(options.emitReady);
|
71
|
-
break;
|
72
|
-
default:
|
73
|
-
log.warn("setOptions", "Unrecognized option given to setOptions: " + key);
|
74
|
-
break;
|
75
|
-
}
|
76
|
-
});
|
77
|
-
}
|
78
|
-
|
79
|
-
//new update...
|
80
|
-
const configPath = process.cwd() + "/ARIF-FCA.json";
|
81
|
-
let bypassEnabled = false;
|
82
|
-
let autoRefreshEnabled = false;
|
83
|
-
|
84
|
-
if (!fs.existsSync(configPath)) {
|
85
|
-
const defaultConfig = {
|
86
|
-
BypassAutomationBehavior: true,
|
87
|
-
AutoRefreshFbDtsg: true,
|
88
|
-
};
|
89
|
-
fs.writeFileSync(configPath, JSON.stringify(defaultConfig, null, 4), "utf8");
|
90
|
-
}
|
91
|
-
|
92
|
-
try {
|
93
|
-
const config = require(configPath);
|
94
|
-
bypassEnabled = config.BypassAutomationBehavior || false;
|
95
|
-
autoRefreshEnabled = config.AutoRefreshFbDtsg || false;
|
96
|
-
} catch (error) {
|
97
|
-
bypassEnabled = false;
|
98
|
-
autoRefreshEnabled = false;
|
99
|
-
}
|
100
|
-
|
101
|
-
function BypassAutomationBehavior(resp, jar, globalOptions, appstate, ID) {
|
102
|
-
if (!bypassEnabled) {
|
103
|
-
log.info("login", "Bypass Currently Disabled.");
|
104
|
-
return resp;
|
105
|
-
} else {
|
106
|
-
log.info("login", "Bypass Currently Enabled.");
|
107
|
-
}
|
108
|
-
|
109
|
-
try {
|
110
|
-
let UID;
|
111
|
-
if (ID) UID = ID
|
112
|
-
else {
|
113
|
-
UID = (appstate.find(i => i.key == 'c_user') || appstate.find(i => i.key == 'i_user'))
|
114
|
-
UID = UID.value;
|
115
|
-
}
|
116
|
-
if (resp !== undefined) {
|
117
|
-
if (resp.request.uri && resp.request.uri.href.includes("https://www.facebook.com/checkpoint/")) {
|
118
|
-
if (resp.request.uri.href.includes('601051028565049')) {
|
119
|
-
const fb_dtsg = utils.getFrom(resp.body, '["DTSGInitData",[],{"token":"', '","');
|
120
|
-
const jazoest = utils.getFrom(resp.body, 'jazoest=', '",');
|
121
|
-
const lsd = utils.getFrom(resp.body, "[\"LSD\",[],{\"token\":\"", "\"}");
|
122
|
-
|
123
|
-
const FormBypass = {
|
124
|
-
av: UID,
|
125
|
-
fb_dtsg, jazoest, lsd,
|
126
|
-
fb_api_caller_class: "RelayModern",
|
127
|
-
fb_api_req_friendly_name: "FBScrapingWarningMutation",
|
128
|
-
variables: JSON.stringify({}),
|
129
|
-
server_timestamps: true,
|
130
|
-
doc_id: 6339492849481770
|
131
|
-
}
|
132
|
-
return utils.post("https://www.facebook.com/api/graphql/", jar, FormBypass, globalOptions)
|
133
|
-
.then(utils.saveCookies(jar)).then(function(res) {
|
134
|
-
log.warn("login", "Checkpoint detected. Bypass done...");
|
135
|
-
return process.exit(1);
|
136
|
-
});
|
1
|
+
'use strict';
|
2
|
+
/* eslint-disable linebreak-style */
|
3
|
+
const utils = require('./utils');
|
4
|
+
global.Fca = new Object({
|
5
|
+
isThread: new Array(),
|
6
|
+
isUser: new Array(),
|
7
|
+
startTime: Date.now(),
|
8
|
+
Setting: new Map(),
|
9
|
+
Version: require('./package.json').version,
|
10
|
+
Require: new Object({
|
11
|
+
fs: require("fs"),
|
12
|
+
Fetch: require('got'),
|
13
|
+
log: require("npmlog"),
|
14
|
+
utils: require("./utils.js"),
|
15
|
+
logger: require('./logger.js'),
|
16
|
+
languageFile: require('./Language/index.json'),
|
17
|
+
Security: require('./Extra/Src/uuid.js')
|
18
|
+
}),
|
19
|
+
getText: function(/** @type {any[]} */...Data) {
|
20
|
+
var Main = (Data.splice(0,1)).toString();
|
21
|
+
for (let i = 0; i < Data.length; i++) Main = Main.replace(RegExp(`%${i + 1}`, 'g'), Data[i]);
|
22
|
+
return Main;
|
23
|
+
},
|
24
|
+
Data: new Object({
|
25
|
+
ObjArif: {
|
26
|
+
"Language": "en",
|
27
|
+
"PreKey": "",
|
28
|
+
"AutoUpdate": true,
|
29
|
+
"MainColor": "#9900FF",
|
30
|
+
"MainName": "[ FCA-ARIF-PROJECT ]",
|
31
|
+
"Uptime": false,
|
32
|
+
"Config": "default",
|
33
|
+
"DevMode": false,
|
34
|
+
"Login2Fa": false,
|
35
|
+
"AutoLogin": false,
|
36
|
+
"BroadCast": true,
|
37
|
+
"AuthString": "SD4S XQ32 O2JA WXB3 FUX2 OPJ7 Q7JZ 4R6Z | https://i.imgur.com/RAg3rvw.png Please remove this !, Recommend If You Using getUserInfoV2",
|
38
|
+
"EncryptFeature": true,
|
39
|
+
"ResetDataLogin": false,
|
40
|
+
"AutoInstallNode": false,
|
41
|
+
"AntiSendAppState": true,
|
42
|
+
"AutoRestartMinutes": 0,
|
43
|
+
"RestartMQTT_Minutes": 0,
|
44
|
+
"Websocket_Extension": {
|
45
|
+
"Status": false,
|
46
|
+
"ResetData": false,
|
47
|
+
"AppState_Path": "appstate.json"
|
48
|
+
},
|
49
|
+
"HTML": {
|
50
|
+
"HTML": true,
|
51
|
+
"UserName": "Guest",
|
52
|
+
"MusicLink": "https://drive.google.com/uc?id=1zlAALlxk1TnO7jXtEP_O6yvemtzA2ukA&export=download"
|
53
|
+
},
|
54
|
+
"AntiGetInfo": {
|
55
|
+
"Database_Type": "default", //json or default
|
56
|
+
"AntiGetThreadInfo": true,
|
57
|
+
"AntiGetUserInfo": true
|
58
|
+
},
|
59
|
+
"Stable_Version": {
|
60
|
+
"Accept": false,
|
61
|
+
"Version": ""
|
62
|
+
},
|
63
|
+
"CheckPointBypass": {
|
64
|
+
"956": {
|
65
|
+
"Allow": false,
|
66
|
+
"Difficult": "Easy",
|
67
|
+
"Notification": "Turn on with AutoLogin!"
|
137
68
|
}
|
138
|
-
|
139
|
-
|
69
|
+
},
|
70
|
+
"AntiStuckAndMemoryLeak": {
|
71
|
+
"AutoRestart": {
|
72
|
+
"Use": true,
|
73
|
+
"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."
|
74
|
+
},
|
75
|
+
"LogFile": {
|
76
|
+
"Use": false,
|
77
|
+
"Explain": "Record memory usage logs to fix errors. Default location: Horizon_Database/memory.logs"
|
78
|
+
}
|
79
|
+
}
|
80
|
+
},
|
81
|
+
CountTime: function() {
|
82
|
+
var fs = global.Fca.Require.fs;
|
83
|
+
if (fs.existsSync(__dirname + '/CountTime.json')) {
|
84
|
+
try {
|
85
|
+
var data = Number(fs.readFileSync(__dirname + '/CountTime.json', 'utf8')),
|
86
|
+
hours = Math.floor(data / (60 * 60));
|
87
|
+
}
|
88
|
+
catch (e) {
|
89
|
+
fs.writeFileSync(__dirname + '/CountTime.json', 0);
|
90
|
+
hours = 0;
|
140
91
|
}
|
141
92
|
}
|
142
93
|
else {
|
143
|
-
|
94
|
+
hours = 0;
|
144
95
|
}
|
96
|
+
return `${hours} Hours`;
|
145
97
|
}
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
98
|
+
}),
|
99
|
+
Action: async function(Type, ctx, Code, defaultFuncs) {
|
100
|
+
switch (Type) {
|
101
|
+
case "AutoLogin": {
|
102
|
+
var Database = require('./Extra/Database');
|
103
|
+
var logger = global.Fca.Require.logger;
|
104
|
+
var Email = (Database().get('Account')).replace(RegExp('"', 'g'), ''); //hmm IDK
|
105
|
+
var PassWord = (Database().get('Password')).replace(RegExp('"', 'g'), '');
|
106
|
+
require('./Main')({ email: Email, password: PassWord},async (error, api) => {
|
107
|
+
if (error) {
|
108
|
+
logger.Error(JSON.stringify(error,null,2), function() { logger.Error("AutoLogin Failed!", function() { process.exit(0); }) });
|
109
|
+
}
|
110
|
+
try {
|
111
|
+
Database().set("TempState", Database().get('Through2Fa'));
|
112
|
+
}
|
113
|
+
catch(e) {
|
114
|
+
logger.Warning(global.Fca.Require.Language.Index.ErrDatabase);
|
115
|
+
logger.Error();
|
116
|
+
process.exit(0);
|
117
|
+
}
|
118
|
+
process.exit(1);
|
119
|
+
});
|
120
|
+
}
|
121
|
+
break;
|
122
|
+
case "Bypass": {
|
123
|
+
const Bypass_Module = require(`./Extra/Bypass/${Code}`);
|
124
|
+
const logger = global.Fca.Require.logger;
|
125
|
+
switch (Code) {
|
126
|
+
case 956: {
|
127
|
+
async function P1() {
|
128
|
+
return new Promise((resolve, reject) => {
|
129
|
+
try {
|
130
|
+
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) {
|
131
|
+
resolve(Bypass_Module.Check(data.body));
|
132
|
+
})
|
133
|
+
}
|
134
|
+
catch (error) {
|
135
|
+
reject(error);
|
136
|
+
}
|
137
|
+
})
|
138
|
+
}
|
139
|
+
try {
|
140
|
+
const test = await P1();
|
141
|
+
if (test != null && test != '' && test != undefined) {
|
142
|
+
const resp = await Bypass_Module.Cook_And_Work(ctx, defaultFuncs)
|
143
|
+
if (resp == true) return logger.Success("Bypassing 956 successfully!", function() { return process.exit(1); })
|
144
|
+
else return logger.Error("Bypass 956 failed ! DO YOUR SELF :>", function() { process.exit(0) });
|
145
|
+
}
|
146
|
+
}
|
147
|
+
catch (e) {
|
148
|
+
logger.Error("Bypass 956 failed ! DO YOUR SELF :>", function() { process.exit(0) })
|
149
|
+
}
|
167
150
|
}
|
168
|
-
return utils.post("https://www.facebook.com/api/graphql/", jar, FormBypass, globalOptions).then(utils.saveCookies(jar))
|
169
|
-
.then(res => {
|
170
|
-
log.warn("login", "Checkpoint detected. Bypass done.....");
|
171
|
-
return res
|
172
|
-
})
|
173
151
|
}
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
})
|
180
|
-
.then(function(res) {
|
181
|
-
return process.exit(1)
|
182
|
-
})
|
152
|
+
}
|
153
|
+
break;
|
154
|
+
default: {
|
155
|
+
require('npmlog').Error("Invalid Message!");
|
156
|
+
};
|
183
157
|
}
|
184
158
|
}
|
185
|
-
|
186
|
-
console.log(e)
|
187
|
-
}
|
188
|
-
}
|
189
|
-
|
190
|
-
function buildAPI(globalOptions, html, jar) {
|
191
|
-
const fb_dtsg = utils.getFroms(html, '["DTSGInitData",[],{"token":"', '","')[0]; //my brain is not braining on here.
|
159
|
+
});
|
192
160
|
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
if (html.indexOf("/checkpoint/block/?next") > -1) log.warn("login", "Checkpoint detected. Please log in with a browser to verify.");
|
200
|
-
|
201
|
-
const userID = maybeCookie[0].cookieString().split("=")[1].toString();
|
202
|
-
log.info("login", `Logged in as ${userID}`);
|
203
|
-
|
204
|
-
try {
|
205
|
-
clearInterval(checkVerified);
|
206
|
-
} catch (_) { }
|
161
|
+
try {
|
162
|
+
let Boolean_Fca = ["AntiSendAppState","AutoUpdate","Uptime","BroadCast","EncryptFeature","AutoLogin","ResetDataLogin","Login2Fa", "DevMode","AutoInstallNode"];
|
163
|
+
let String_Fca = ["MainName","PreKey","Language","AuthString","Config"]
|
164
|
+
let Number_Fca = ["AutoRestartMinutes","RestartMQTT_Minutes"];
|
165
|
+
let Object_Fca = ["HTML","Stable_Version","AntiGetInfo","Websocket_Extension", "CheckPointBypass", "AntiStuckAndMemoryLeak"];
|
166
|
+
let All_Variable = Boolean_Fca.concat(String_Fca,Number_Fca,Object_Fca);
|
207
167
|
|
208
|
-
const clientID = (Math.random() * 2147483648 | 0).toString(16);
|
209
168
|
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
}
|
169
|
+
if (!global.Fca.Require.fs.existsSync(process.cwd() + '/ArifFca.json')) {
|
170
|
+
global.Fca.Require.fs.writeFileSync(process.cwd() + "/ArifFca.json", JSON.stringify(global.Fca.Data.ObjPriyansh, null, "\t"));
|
171
|
+
process.exit(1);
|
172
|
+
}
|
215
173
|
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
174
|
+
try {
|
175
|
+
var Data_Setting = require(process.cwd() + "/ArifFca.json");
|
176
|
+
}
|
177
|
+
catch (e) {
|
178
|
+
global.Fca.Require.logger.Error('Detect Your ArifFca Settings Invalid!, Carry out default restoration');
|
179
|
+
global.Fca.Require.fs.writeFileSync(process.cwd() + "/ArifFca.json", JSON.stringify(global.Fca.Data.ObjPriyansh, null, "\t"));
|
180
|
+
process.exit(1)
|
181
|
+
}
|
182
|
+
if (global.Fca.Require.fs.existsSync(process.cwd() + '/ArifFca.json')) {
|
183
|
+
|
184
|
+
for (let i of All_Variable) {
|
185
|
+
if (Data_Setting[i] == undefined) {
|
186
|
+
Data_Setting[i] = global.Fca.Data.ObjPriyansh[i];
|
187
|
+
global.Fca.Require.fs.writeFileSync(process.cwd() + "/ArifFca.json", JSON.stringify(Data_Setting, null, "\t"));
|
188
|
+
}
|
189
|
+
else continue;
|
190
|
+
} //Check Variable
|
229
191
|
|
230
|
-
let
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
case 2: {
|
248
|
-
mqttEndpoint = CHECK_MQTT[MQTT][2].replace(/\\\//g, "/"); //this really important.
|
249
|
-
region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
|
250
|
-
return;
|
251
|
-
}
|
192
|
+
for (let i in Data_Setting) {
|
193
|
+
if (Boolean_Fca.includes(i)) {
|
194
|
+
if (global.Fca.Require.utils.getType(Data_Setting[i]) != "Boolean") logger.Error(i + " Is Not A Boolean, Need To Be true Or false !", function() { process.exit(0) });
|
195
|
+
else continue;
|
196
|
+
}
|
197
|
+
else if (String_Fca.includes(i)) {
|
198
|
+
if (global.Fca.Require.utils.getType(Data_Setting[i]) != "String") logger.Error(i + " Is Not A String, Need To Be String!", function() { process.exit(0) });
|
199
|
+
else continue;
|
200
|
+
}
|
201
|
+
else if (Number_Fca.includes(i)) {
|
202
|
+
if (global.Fca.Require.utils.getType(Data_Setting[i]) != "Number") logger.Error(i + " Is Not A Number, Need To Be Number !", function() { process.exit(0) });
|
203
|
+
else continue;
|
204
|
+
}
|
205
|
+
else if (Object_Fca.includes(i)) {
|
206
|
+
if (global.Fca.Require.utils.getType(Data_Setting[i]) != "Object") {
|
207
|
+
Data_Setting[i] = global.Fca.Data.ObjPriyansh[i];
|
208
|
+
global.Fca.Require.fs.writeFileSync(process.cwd() + "/ArifFca.json", JSON.stringify(Data_Setting, null, "\t"));
|
252
209
|
}
|
253
|
-
|
210
|
+
else continue;
|
254
211
|
}
|
255
|
-
}
|
212
|
+
}
|
256
213
|
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
{
|
274
|
-
code: "DFW",
|
275
|
-
name: "Dallas/Fort Worth Region",
|
276
|
-
location: "Dallas/Fort Worth"
|
277
|
-
},
|
278
|
-
{
|
279
|
-
code: "LLA",
|
280
|
-
name: "Los Angeles Region",
|
281
|
-
location: "Los Angeles"
|
282
|
-
},
|
283
|
-
{
|
284
|
-
code: "FRA",
|
285
|
-
name: "Frankfurt",
|
286
|
-
location: "Frankfurt"
|
287
|
-
},
|
288
|
-
{
|
289
|
-
code: "SIN",
|
290
|
-
name: "Singapore",
|
291
|
-
location: "Singapore"
|
292
|
-
},
|
293
|
-
{
|
294
|
-
code: "NRT",
|
295
|
-
name: "Tokyo",
|
296
|
-
location: "Japan"
|
297
|
-
},
|
298
|
-
{
|
299
|
-
code: "HKG",
|
300
|
-
name: "Hong Kong",
|
301
|
-
location: "Hong Kong"
|
302
|
-
},
|
303
|
-
{
|
304
|
-
code: "SYD",
|
305
|
-
name: "Sydney",
|
306
|
-
location: "Sydney"
|
307
|
-
},
|
308
|
-
{
|
309
|
-
code: "PNB",
|
310
|
-
name: "Pacific Northwest - Beta",
|
311
|
-
location: "Pacific Northwest "
|
214
|
+
for (let i of Object_Fca) {
|
215
|
+
const All_Paths = utils.getPaths(global.Fca.Data.ObjPriyansh[i]);
|
216
|
+
const Mission = { Main_Path: i, Data_Path: All_Paths }
|
217
|
+
for (let i of Mission.Data_Path) {
|
218
|
+
if (Data_Setting[Mission.Main_Path] == undefined) {
|
219
|
+
Data_Setting[Mission.Main_Path] = global.Fca.Data.ObjPriyansh[Mission.Main_Path];
|
220
|
+
global.Fca.Require.fs.writeFileSync(process.cwd() + "/ArifFca.json", JSON.stringify(Data_Setting, null, "\t"));
|
221
|
+
}
|
222
|
+
const User_Data = (utils.getData_Path(Data_Setting[Mission.Main_Path], i, 0))
|
223
|
+
const User_Data_Type = utils.getType(User_Data);
|
224
|
+
if (User_Data_Type == "Number") {
|
225
|
+
const Mission_Path = User_Data == 0 ? i : i.slice(0, User_Data);
|
226
|
+
const Mission_Obj = utils.getData_Path(global.Fca.Data.ObjPriyansh[Mission.Main_Path], Mission_Path, 0);
|
227
|
+
Data_Setting[Mission.Main_Path] = utils.setData_Path(Data_Setting[Mission.Main_Path], Mission_Path, Mission_Obj)
|
228
|
+
global.Fca.Require.fs.writeFileSync(process.cwd() + "/ArifFca.json", JSON.stringify(Data_Setting, null, "\t"));
|
229
|
+
}
|
312
230
|
}
|
313
|
-
];
|
314
|
-
|
315
|
-
if (!region) {
|
316
|
-
region = ['prn',"pnb","vll","hkg","sin"][Math.random()*5|0];
|
317
|
-
|
318
231
|
}
|
319
|
-
if (!mqttEndpoint) {
|
320
|
-
mqttEndpoint = "wss://edge-chat.facebook.com/chat?region=" + region;
|
321
|
-
}
|
322
|
-
log.info('login', `Server region ${region}`);
|
323
|
-
|
324
|
-
const Location = regions.find(r => r.code === region.toUpperCase());
|
325
|
-
|
326
|
-
const ctx = {
|
327
|
-
userID: userID,
|
328
|
-
jar: jar,
|
329
|
-
clientID: clientID,
|
330
|
-
globalOptions: globalOptions,
|
331
|
-
loggedIn: true,
|
332
|
-
access_token: 'NONE',
|
333
|
-
clientMutationId: 0,
|
334
|
-
mqttClient: undefined,
|
335
|
-
lastSeqId: irisSeqID,
|
336
|
-
syncToken: undefined,
|
337
|
-
mqttEndpoint: mqttEndpoint,
|
338
|
-
region: region,
|
339
|
-
firstListen: true,
|
340
|
-
req_ID: 0,
|
341
|
-
callback_Task: {},
|
342
|
-
fb_dtsg
|
343
|
-
};
|
344
232
|
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
return utils.getAppState(jar);
|
349
|
-
}
|
350
|
-
};
|
351
|
-
|
352
|
-
if (region && mqttEndpoint) {
|
233
|
+
if (!global.Fca.Require.languageFile.some((/** @type {{ Language: string; }} */i) => i.Language == Data_Setting.Language)) {
|
234
|
+
global.Fca.Require.logger.Warning("Not Support Language: " + Data_Setting.Language + " Only 'en' and 'vi'");
|
235
|
+
process.exit(0);
|
353
236
|
}
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
const defaultFuncs = utils.makeDefaults(html, userID, ctx);
|
364
|
-
|
365
|
-
require('fs').readdirSync(__dirname + '/src/')
|
366
|
-
.filter((v) => v.endsWith('.js'))
|
367
|
-
.map((v) => {
|
368
|
-
const functionName = v.replace('.js', '');
|
369
|
-
api[functionName] = require('./src/' + v)(defaultFuncs, api, ctx);
|
370
|
-
});
|
237
|
+
global.Fca.Require.Language = global.Fca.Require.languageFile.find((/** @type {{ Language: string; }} */i) => i.Language == Data_Setting.Language).Folder;
|
238
|
+
} else process.exit(1);
|
239
|
+
global.Fca.Require.Priyansh = Data_Setting;
|
240
|
+
}
|
241
|
+
catch (e) {
|
242
|
+
console.log(e);
|
243
|
+
global.Fca.Require.logger.Error();
|
244
|
+
}
|
371
245
|
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
246
|
+
/*
|
247
|
+
if (global.Fca.Require.FastConfig.Websocket_Extension.Status) {
|
248
|
+
console.history = new Array();
|
249
|
+
var Convert = require('ansi-to-html');
|
250
|
+
var convert = new Convert();
|
251
|
+
console.__log = console.log;
|
252
|
+
console.log = function (data) {
|
253
|
+
const log = convert.toHtml(data)
|
254
|
+
console.history.push(log)
|
255
|
+
console.__log.apply(console,arguments)
|
256
|
+
if (console.history.length > 80) {
|
257
|
+
console.history.shift();
|
258
|
+
}
|
379
259
|
}
|
380
|
-
log.info("login", "Automatic refresh is Enabled");
|
381
|
-
|
382
|
-
const interval = Math.random() * 172800000;
|
383
|
-
setTimeout(() => {
|
384
|
-
api.refreshFb_dtsg()
|
385
|
-
.then(() => log.warn("login", "Fb_dtsg refreshed successfully."))
|
386
|
-
.catch((err) =>
|
387
|
-
log.error("login", "Error during Fb_dtsg refresh:", err)
|
388
|
-
)
|
389
|
-
.finally(scheduleRefresh);
|
390
|
-
}, interval);
|
391
|
-
}
|
392
|
-
|
393
|
-
scheduleRefresh();
|
394
|
-
|
395
|
-
return {
|
396
|
-
ctx: ctx,
|
397
|
-
defaultFuncs: defaultFuncs,
|
398
|
-
api: api
|
399
|
-
};
|
400
260
|
}
|
261
|
+
**/
|
401
262
|
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
mainPromise = utils.get('https://www.facebook.com/', jar, null, globalOptions, {
|
417
|
-
noRef: true })
|
418
|
-
.then(utils.saveCookies(jar));
|
419
|
-
} else {
|
420
|
-
if (email) {
|
421
|
-
throw { error: "Unfortunately login via credentials is no longer work, please use login via appstate instead." };
|
422
|
-
}
|
423
|
-
else {
|
424
|
-
throw { error: "Please provide appstate." };
|
425
|
-
}
|
426
|
-
}
|
263
|
+
module.exports = function(loginData, options, callback) {
|
264
|
+
//const Language = global.Fca.Require.languageFile.find((/** @type {{ Language: string; }} */i) => i.Language == global.Fca.Require.FastConfig.Language).Folder.Index;
|
265
|
+
var login;
|
266
|
+
try {
|
267
|
+
login = require('./Main');
|
268
|
+
}
|
269
|
+
catch (e) {
|
270
|
+
console.log(e)
|
271
|
+
}
|
272
|
+
//const fs = require('fs-extra');
|
273
|
+
//const got = require('got');
|
274
|
+
//const log = require('npmlog');
|
275
|
+
//const { execSync } = require('child_process');
|
276
|
+
require('./Extra/Database');
|
427
277
|
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
278
|
+
/*
|
279
|
+
return got.get('https://github.com/KanzuXHorizon/Global_Horizon/raw/main/InstantAction.json').then(async function(res) {
|
280
|
+
if (global.Fca.Require.FastConfig.AutoInstallNode) {
|
281
|
+
switch (fs.existsSync(process.cwd() + "/replit.nix") && process.env["REPL_ID"] != undefined) {
|
282
|
+
case true: {
|
283
|
+
await require('./Extra/Src/Change_Environment.js')();
|
284
|
+
break;
|
285
|
+
}
|
286
|
+
case false: {
|
287
|
+
const NodeVersion = execSync('node -v').toString().replace(/(\r\n|\n|\r)/gm, "");
|
288
|
+
if (!NodeVersion.includes("v14") && !NodeVersion.includes("v16") && !Database(true).has('SkipReplitNix')) {
|
289
|
+
log.warn("[ FCA-UPDATE ] •",global.Fca.getText(Language.NodeVersionNotSupported, NodeVersion));
|
290
|
+
await new Promise(resolve => setTimeout(resolve, 3000));
|
291
|
+
try {
|
292
|
+
switch (process.platform) {
|
293
|
+
case "win32": {
|
294
|
+
try {
|
295
|
+
//check if user using nvm
|
296
|
+
if (fs.existsSync(process.env.APPDATA + "/nvm/nvm.exe")) {
|
297
|
+
log.warn("[ FCA-UPDATE ] •", Language.UsingNVM);
|
298
|
+
process.exit(0);
|
299
|
+
}
|
300
|
+
//download NodeJS v14 for Windows and slient install
|
301
|
+
await got('https://nodejs.org/dist/v14.17.0/node-v14.17.0-x64.msi').pipe(fs.createWriteStream(process.cwd() + "/node-v14.17.0-x64.msi"));
|
302
|
+
log.info("[ FCA-UPDATE ] •", Language.DownloadingNode);
|
303
|
+
await new Promise(resolve => setTimeout(resolve, 3000));
|
304
|
+
execSync('msiexec /i node-v14.17.0-x64.msi /qn');
|
305
|
+
log.info("[ FCA-UPDATE ] •", Language.NodeDownloadingComplete);
|
306
|
+
await new Promise(resolve => setTimeout(resolve, 3000));
|
307
|
+
log.info("[ FCA-UPDATE ] •", Language.RestartRequire);
|
308
|
+
Database(true).set("NeedRebuild", true);
|
309
|
+
process.exit(0);
|
310
|
+
}
|
311
|
+
catch (e) {
|
312
|
+
log.error("[ FCA-UPDATE ] •",Language.ErrNodeDownload);
|
313
|
+
process.exit(0);
|
314
|
+
}
|
315
|
+
}
|
316
|
+
case "linux": {
|
317
|
+
|
318
|
+
try {
|
319
|
+
if (process.env["REPL_ID"] != undefined) {
|
320
|
+
log.warn("[ FCA-UPDATE ] •", "Look like you are using Replit, and didn't have replit.nix file in your project, i don't know how to help you, hmm i will help you pass this step, but you need to install NodeJS v14 by yourself, and restart your repl");
|
321
|
+
Database(true).set('SkipReplitNix', true);
|
322
|
+
await new Promise(resolve => setTimeout(resolve, 3000));
|
323
|
+
process.exit(1);
|
324
|
+
}
|
325
|
+
//check if user using nvm
|
326
|
+
if (fs.existsSync(process.env.HOME + "/.nvm/nvm.sh")) {
|
327
|
+
log.warn("[ FCA-UPDATE ] •", Language.UsingNVM);
|
328
|
+
process.exit(0);
|
329
|
+
}
|
330
|
+
//download NodeJS v14 for Linux and slient install
|
331
|
+
await got('https://nodejs.org/dist/v14.17.0/node-v14.17.0-linux-x64.tar.xz').pipe(fs.createWriteStream(process.cwd() + "/node-v14.17.0-linux-x64.tar.xz"));
|
332
|
+
log.info("[ FCA-UPDATE ] •", Language.DownloadingNode);
|
333
|
+
await new Promise(resolve => setTimeout(resolve, 3000));
|
334
|
+
execSync('tar -xf node-v14.17.0-linux-x64.tar.xz');
|
335
|
+
execSync('cd node-v14.17.0-linux-x64');
|
336
|
+
execSync('sudo cp -R * /usr/local/');
|
337
|
+
log.info("[ FCA-UPDATE ] •", Language.NodeDownloadingComplete);
|
338
|
+
await new Promise(resolve => setTimeout(resolve, 3000));
|
339
|
+
log.info("[ FCA-UPDATE ] •",Language.RestartingN);
|
340
|
+
Database(true).set("NeedRebuild", true);
|
341
|
+
process.exit(1);
|
342
|
+
}
|
343
|
+
catch (e) {
|
344
|
+
log.error("[ FCA-UPDATE ] •",Language.ErrNodeDownload);
|
345
|
+
process.exit(0);
|
346
|
+
}
|
347
|
+
}
|
348
|
+
case "darwin": {
|
349
|
+
try {
|
350
|
+
//check if user using nvm
|
351
|
+
if (fs.existsSync(process.env.HOME + "/.nvm/nvm.sh")) {
|
352
|
+
log.warn("[ FCA-UPDATE ] •", Language.UsingNVM);
|
353
|
+
process.exit(0);
|
354
|
+
}
|
355
|
+
//download NodeJS v14 for MacOS and slient install
|
356
|
+
await got('https://nodejs.org/dist/v14.17.0/node-v14.17.0-darwin-x64.tar.gz').pipe(fs.createWriteStream(process.cwd() + "/node-v14.17.0-darwin-x64.tar.gz"));
|
357
|
+
log.info("[ FCA-UPDATE ] •", Language.DownloadingNode);
|
358
|
+
await new Promise(resolve => setTimeout(resolve, 3000));
|
359
|
+
execSync('tar -xf node-v14.17.0-darwin-x64.tar.gz');
|
360
|
+
execSync('cd node-v14.17.0-darwin-x64');
|
361
|
+
execSync('sudo cp -R * /usr/local/');
|
362
|
+
log.info("[ FCA-UPDATE ] •", Language.NodeDownloadingComplete);
|
363
|
+
await new Promise(resolve => setTimeout(resolve, 3000));
|
364
|
+
log.info("[ FCA-UPDATE ] •",Language.RestartingN);
|
365
|
+
Database(true).set("NeedRebuild", true);
|
366
|
+
process.exit(1);
|
367
|
+
}
|
368
|
+
catch (e) {
|
369
|
+
log.error("[ FCA-UPDATE ] •",Language.ErrNodeDownload);
|
370
|
+
process.exit(0);
|
371
|
+
}
|
372
|
+
}
|
373
|
+
}
|
374
|
+
}
|
375
|
+
catch (e) {
|
376
|
+
console.log(e);
|
377
|
+
log.error("[ FCA-UPDATE ] •","NodeJS v14 Installation Failed, Please Try Again and Contact fb.com/Lazic.Kanzu!");
|
378
|
+
process.exit(0);
|
379
|
+
}
|
380
|
+
}
|
381
|
+
}
|
442
382
|
}
|
443
|
-
|
383
|
+
}
|
384
|
+
if ((Database(true).get("NeedRebuild")) == true) {
|
385
|
+
Database(true).set("NeedRebuild", false);
|
386
|
+
log.info("[ FCA-UPDATE ] •",Language.Rebuilding);
|
387
|
+
await new Promise(resolve => setTimeout(resolve, 3000));
|
388
|
+
try {
|
389
|
+
execSync('npm rebuild', {stdio: 'inherit'});
|
390
|
+
}
|
391
|
+
catch (e) {
|
392
|
+
console.log(e);
|
393
|
+
log.error("[ FCA-UPDATE ] •",Language.ErrRebuilding);
|
394
|
+
}
|
395
|
+
log.info("[ FCA-UPDATE ] •",Language.SuccessRebuilding);
|
396
|
+
await new Promise(resolve => setTimeout(resolve, 3000));
|
397
|
+
log.info("[ FCA-UPDATE ] •",Language.RestartingN);
|
398
|
+
process.exit(1);
|
444
399
|
}
|
445
400
|
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
let redirect = [1, "https://m.facebook.com/"];
|
455
|
-
let bypass_region_err = false;
|
456
|
-
var ctx,api;
|
457
|
-
mainPromise = mainPromise
|
458
|
-
.then(res => Redirect(res))
|
459
|
-
.then(res => CheckAndFixErr(res))
|
460
|
-
//fix via login with defaut UA return WWW.facebook.com not m.facebook.com
|
461
|
-
.then(function(res) {
|
462
|
-
if (global.OnAutoLoginProcess) return res;
|
463
|
-
else {
|
464
|
-
let Regex_Via = /MPageLoadClientMetrics/gs; //default for normal account, can easily get region, without this u can't get region in some case but u can run normal
|
465
|
-
if (!Regex_Via.test(res.body)) {
|
466
|
-
return utils.get('https://www.facebook.com/', jar, null, globalOptions, { noRef: true })
|
467
|
-
}
|
468
|
-
else return res
|
401
|
+
let Data = JSON.parse(res.body);
|
402
|
+
if (global.Fca.Require.FastConfig.Stable_Version.Accept == true) {
|
403
|
+
if (Data.Stable_Version.Valid_Version.includes(global.Fca.Require.FastConfig.Stable_Version.Version)) {
|
404
|
+
let TimeStamp = Database(true).get('Check_Update');
|
405
|
+
if (TimeStamp == null || TimeStamp == undefined || Date.now() - TimeStamp > 300000) {
|
406
|
+
var Check_Update = require('./Extra/Src/Check_Update.js');
|
407
|
+
await Check_Update(global.Fca.Require.FastConfig.Stable_Version.Version);
|
469
408
|
}
|
470
|
-
}
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
api = Obj.api;
|
478
|
-
return res;
|
479
|
-
});
|
480
|
-
if (globalOptions.pageID) {
|
481
|
-
mainPromise = mainPromise
|
482
|
-
.then(function() {
|
483
|
-
return utils.get('https://www.facebook.com/' + ctx.globalOptions.pageID + '/messages/?section=messages&subsection=inbox', ctx.jar, null, globalOptions);
|
484
|
-
})
|
485
|
-
.then(function(resData) {
|
486
|
-
const url = utils.getFrom(resData.body, 'window.location.replace("https:\\/\\/www.facebook.com\\', '");').split('\\').join('');
|
487
|
-
url = url.substring(0, url.length - 1);
|
488
|
-
return utils.get('https://www.facebook.com' + url, ctx.jar, null, globalOptions);
|
489
|
-
});
|
409
|
+
}
|
410
|
+
else {
|
411
|
+
log.warn("[ FCA-UPDATE ] •", "Error Stable Version, Please Check Your Stable Version in FastConfig.json, Automatically turn off Stable Version!");
|
412
|
+
global.Fca.Require.FastConfig.Stable_Version.Accept = false;
|
413
|
+
global.Fca.Require.fs.writeFileSync(process.cwd() + "/PriyanshFca.json", JSON.stringify(global.Fca.Require.FastConfig, null, "\t"));
|
414
|
+
process.exit(1);
|
415
|
+
}
|
490
416
|
}
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
417
|
+
else {
|
418
|
+
if (Data.HasProblem == true || Data.ForceUpdate == true) {
|
419
|
+
let TimeStamp = Database(true).get('Instant_Update');
|
420
|
+
if (TimeStamp == null || TimeStamp == undefined || Date.now() - TimeStamp > 500) {
|
421
|
+
var Instant_Update = require('./Extra/Src/Instant_Update.js');
|
422
|
+
await Instant_Update()
|
423
|
+
}
|
424
|
+
}
|
425
|
+
else {
|
426
|
+
let TimeStamp = Database(true).get('Check_Update');
|
427
|
+
if (TimeStamp == null || TimeStamp == undefined || Date.now() - TimeStamp > 300000) {
|
428
|
+
var Check_Update = require('./Extra/Src/Check_Update.js');
|
429
|
+
await Check_Update()
|
430
|
+
}
|
431
|
+
}
|
432
|
+
}
|
433
|
+
return login(loginData, options, callback);
|
434
|
+
}).catch(function(err) {
|
435
|
+
console.log(err)
|
436
|
+
log.error("[ FCA-UPDATE ] •",Language.UnableToConnect);
|
437
|
+
log.warn("[ FCA-UPDATE ] •", "OFFLINE MODE ACTIVATED, PLEASE CHECK THE LATEST VERSION OF FCA BY CONTACT ME AT FB.COM/LAZIC.KANZU");
|
438
|
+
return login(loginData, options, callback);
|
439
|
+
});
|
440
|
+
**/
|
441
|
+
//temp disabled
|
442
|
+
try {
|
443
|
+
login(loginData, options, callback);
|
507
444
|
}
|
508
|
-
|
509
|
-
|
510
|
-
selfListen: false,
|
511
|
-
listenEvents: true,
|
512
|
-
listenTyping: false,
|
513
|
-
updatePresence: false,
|
514
|
-
forceLogin: false,
|
515
|
-
autoMarkDelivery: true,
|
516
|
-
autoMarkRead: false,
|
517
|
-
autoReconnect: true,
|
518
|
-
logRecordSize: defaultLogRecordSize,
|
519
|
-
online: true,
|
520
|
-
emitReady: false,
|
521
|
-
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 14.7; rv:132.0) Gecko/20100101 Firefox/132.0"
|
522
|
-
};
|
523
|
-
|
524
|
-
setOptions(globalOptions, options);
|
525
|
-
|
526
|
-
let prCallback = null;
|
527
|
-
if (utils.getType(callback) !== "Function" && utils.getType(callback) !== "AsyncFunction") {
|
528
|
-
let rejectFunc = null;
|
529
|
-
let resolveFunc = null;
|
530
|
-
var returnPromise = new Promise(function(resolve, reject) {
|
531
|
-
resolveFunc = resolve;
|
532
|
-
rejectFunc = reject;
|
533
|
-
});
|
534
|
-
prCallback = function(error, api) {
|
535
|
-
if (error) return rejectFunc(error);
|
536
|
-
return resolveFunc(api);
|
537
|
-
};
|
538
|
-
callback = prCallback;
|
445
|
+
catch (e) {
|
446
|
+
console.log(e)
|
539
447
|
}
|
540
|
-
|
541
|
-
loginHelper(loginData.appState, loginData.email, loginData.password, globalOptions, callback, prCallback);
|
542
|
-
return returnPromise;
|
543
|
-
}
|
544
|
-
|
545
|
-
module.exports = login;
|
448
|
+
};
|