fca-smart-shankar 1.5.6 → 12.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/.cache/nix/binary-cache-v6.sqlite +0 -0
- package/.cache/replit/env/latest +116 -47
- package/.cache/replit/env/latest.json +1 -1
- package/.cache/replit/modules/nix.res +1 -0
- package/.cache/replit/modules/nodejs-20.res +1 -0
- package/.cache/replit/nix/env.json +1 -0
- package/.cache/typescript/5.6/node_modules/.package-lock.json +171 -0
- package/.cache/typescript/5.6/node_modules/@types/bluebird/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/bluebird/README.md +15 -0
- package/.cache/typescript/5.6/node_modules/@types/bluebird/index.d.ts +1365 -0
- package/.cache/typescript/5.6/node_modules/@types/bluebird/package.json +25 -0
- package/.cache/typescript/5.6/node_modules/@types/caseless/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/caseless/README.md +48 -0
- package/.cache/typescript/5.6/node_modules/@types/caseless/index.d.ts +29 -0
- package/.cache/typescript/5.6/node_modules/@types/caseless/package.json +35 -0
- package/.cache/typescript/5.6/node_modules/@types/cheerio/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/cheerio/README.md +15 -0
- package/.cache/typescript/5.6/node_modules/@types/cheerio/index.d.ts +318 -0
- package/.cache/typescript/5.6/node_modules/@types/cheerio/package.json +71 -0
- package/.cache/typescript/5.6/node_modules/@types/mocha/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/mocha/README.md +15 -0
- package/.cache/typescript/5.6/node_modules/@types/mocha/index.d.ts +2929 -0
- package/.cache/typescript/5.6/node_modules/@types/mocha/package.json +56 -0
- package/.cache/typescript/5.6/node_modules/@types/node/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/node/README.md +15 -0
- package/.cache/typescript/5.6/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/.cache/typescript/5.6/node_modules/@types/node/assert.d.ts +1040 -0
- package/.cache/typescript/5.6/node_modules/@types/node/async_hooks.d.ts +541 -0
- package/.cache/typescript/5.6/node_modules/@types/node/buffer.buffer.d.ts +385 -0
- package/.cache/typescript/5.6/node_modules/@types/node/buffer.d.ts +1933 -0
- package/.cache/typescript/5.6/node_modules/@types/node/child_process.d.ts +1549 -0
- package/.cache/typescript/5.6/node_modules/@types/node/cluster.d.ts +579 -0
- package/.cache/typescript/5.6/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
- package/.cache/typescript/5.6/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/.cache/typescript/5.6/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
- package/.cache/typescript/5.6/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/.cache/typescript/5.6/node_modules/@types/node/console.d.ts +452 -0
- package/.cache/typescript/5.6/node_modules/@types/node/constants.d.ts +19 -0
- package/.cache/typescript/5.6/node_modules/@types/node/crypto.d.ts +4475 -0
- package/.cache/typescript/5.6/node_modules/@types/node/dgram.d.ts +596 -0
- package/.cache/typescript/5.6/node_modules/@types/node/diagnostics_channel.d.ts +554 -0
- package/.cache/typescript/5.6/node_modules/@types/node/dns/promises.d.ts +476 -0
- package/.cache/typescript/5.6/node_modules/@types/node/dns.d.ts +865 -0
- package/.cache/typescript/5.6/node_modules/@types/node/dom-events.d.ts +124 -0
- package/.cache/typescript/5.6/node_modules/@types/node/domain.d.ts +170 -0
- package/.cache/typescript/5.6/node_modules/@types/node/events.d.ts +931 -0
- package/.cache/typescript/5.6/node_modules/@types/node/fs/promises.d.ts +1275 -0
- package/.cache/typescript/5.6/node_modules/@types/node/fs.d.ts +4396 -0
- package/.cache/typescript/5.6/node_modules/@types/node/globals.d.ts +566 -0
- package/.cache/typescript/5.6/node_modules/@types/node/globals.typedarray.d.ts +21 -0
- package/.cache/typescript/5.6/node_modules/@types/node/http.d.ts +1958 -0
- package/.cache/typescript/5.6/node_modules/@types/node/http2.d.ts +2558 -0
- package/.cache/typescript/5.6/node_modules/@types/node/https.d.ts +543 -0
- package/.cache/typescript/5.6/node_modules/@types/node/index.d.ts +92 -0
- package/.cache/typescript/5.6/node_modules/@types/node/inspector.d.ts +3966 -0
- package/.cache/typescript/5.6/node_modules/@types/node/module.d.ts +402 -0
- package/.cache/typescript/5.6/node_modules/@types/node/net.d.ts +1001 -0
- package/.cache/typescript/5.6/node_modules/@types/node/os.d.ts +495 -0
- package/.cache/typescript/5.6/node_modules/@types/node/package.json +220 -0
- package/.cache/typescript/5.6/node_modules/@types/node/path.d.ts +200 -0
- package/.cache/typescript/5.6/node_modules/@types/node/perf_hooks.d.ts +965 -0
- package/.cache/typescript/5.6/node_modules/@types/node/process.d.ts +1963 -0
- package/.cache/typescript/5.6/node_modules/@types/node/punycode.d.ts +117 -0
- package/.cache/typescript/5.6/node_modules/@types/node/querystring.d.ts +153 -0
- package/.cache/typescript/5.6/node_modules/@types/node/readline/promises.d.ts +162 -0
- package/.cache/typescript/5.6/node_modules/@types/node/readline.d.ts +589 -0
- package/.cache/typescript/5.6/node_modules/@types/node/repl.d.ts +430 -0
- package/.cache/typescript/5.6/node_modules/@types/node/sea.d.ts +153 -0
- package/.cache/typescript/5.6/node_modules/@types/node/sqlite.d.ts +213 -0
- package/.cache/typescript/5.6/node_modules/@types/node/stream/consumers.d.ts +12 -0
- package/.cache/typescript/5.6/node_modules/@types/node/stream/promises.d.ts +90 -0
- package/.cache/typescript/5.6/node_modules/@types/node/stream/web.d.ts +609 -0
- package/.cache/typescript/5.6/node_modules/@types/node/stream.d.ts +1726 -0
- package/.cache/typescript/5.6/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/.cache/typescript/5.6/node_modules/@types/node/test.d.ts +2248 -0
- package/.cache/typescript/5.6/node_modules/@types/node/timers/promises.d.ts +97 -0
- package/.cache/typescript/5.6/node_modules/@types/node/timers.d.ts +240 -0
- package/.cache/typescript/5.6/node_modules/@types/node/tls.d.ts +1226 -0
- package/.cache/typescript/5.6/node_modules/@types/node/trace_events.d.ts +197 -0
- package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +385 -0
- package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +19 -0
- package/.cache/typescript/5.6/node_modules/@types/node/ts5.6/index.d.ts +92 -0
- package/.cache/typescript/5.6/node_modules/@types/node/tty.d.ts +208 -0
- package/.cache/typescript/5.6/node_modules/@types/node/url.d.ts +972 -0
- package/.cache/typescript/5.6/node_modules/@types/node/util.d.ts +2371 -0
- package/.cache/typescript/5.6/node_modules/@types/node/v8.d.ts +808 -0
- package/.cache/typescript/5.6/node_modules/@types/node/vm.d.ts +976 -0
- package/.cache/typescript/5.6/node_modules/@types/node/wasi.d.ts +181 -0
- package/.cache/typescript/5.6/node_modules/@types/node/worker_threads.d.ts +745 -0
- package/.cache/typescript/5.6/node_modules/@types/node/zlib.d.ts +539 -0
- package/.cache/typescript/5.6/node_modules/@types/request/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/request/README.md +15 -0
- package/.cache/typescript/5.6/node_modules/@types/request/index.d.ts +395 -0
- package/.cache/typescript/5.6/node_modules/@types/request/package.json +70 -0
- package/.cache/typescript/5.6/node_modules/@types/tough-cookie/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/@types/tough-cookie/README.md +15 -0
- package/.cache/typescript/5.6/node_modules/@types/tough-cookie/index.d.ts +321 -0
- package/.cache/typescript/5.6/node_modules/@types/tough-cookie/package.json +35 -0
- package/.cache/typescript/5.6/node_modules/asynckit/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/asynckit/README.md +233 -0
- package/.cache/typescript/5.6/node_modules/asynckit/bench.js +76 -0
- package/.cache/typescript/5.6/node_modules/asynckit/index.js +6 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/abort.js +29 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/async.js +34 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/defer.js +26 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/iterate.js +75 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_asynckit.js +91 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_parallel.js +25 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_serial.js +25 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/state.js +37 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/streamify.js +141 -0
- package/.cache/typescript/5.6/node_modules/asynckit/lib/terminator.js +29 -0
- package/.cache/typescript/5.6/node_modules/asynckit/package.json +63 -0
- package/.cache/typescript/5.6/node_modules/asynckit/parallel.js +43 -0
- package/.cache/typescript/5.6/node_modules/asynckit/serial.js +17 -0
- package/.cache/typescript/5.6/node_modules/asynckit/serialOrdered.js +75 -0
- package/.cache/typescript/5.6/node_modules/asynckit/stream.js +21 -0
- package/.cache/typescript/5.6/node_modules/combined-stream/License +19 -0
- package/.cache/typescript/5.6/node_modules/combined-stream/Readme.md +138 -0
- package/.cache/typescript/5.6/node_modules/combined-stream/lib/combined_stream.js +208 -0
- package/.cache/typescript/5.6/node_modules/combined-stream/package.json +25 -0
- package/.cache/typescript/5.6/node_modules/combined-stream/yarn.lock +17 -0
- package/.cache/typescript/5.6/node_modules/delayed-stream/License +19 -0
- package/.cache/typescript/5.6/node_modules/delayed-stream/Makefile +7 -0
- package/.cache/typescript/5.6/node_modules/delayed-stream/Readme.md +141 -0
- package/.cache/typescript/5.6/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
- package/.cache/typescript/5.6/node_modules/delayed-stream/package.json +27 -0
- package/.cache/typescript/5.6/node_modules/form-data/License +19 -0
- package/.cache/typescript/5.6/node_modules/form-data/Readme.md +350 -0
- package/.cache/typescript/5.6/node_modules/form-data/index.d.ts +51 -0
- package/.cache/typescript/5.6/node_modules/form-data/lib/browser.js +2 -0
- package/.cache/typescript/5.6/node_modules/form-data/lib/form_data.js +484 -0
- package/.cache/typescript/5.6/node_modules/form-data/lib/populate.js +10 -0
- package/.cache/typescript/5.6/node_modules/form-data/package.json +72 -0
- package/.cache/typescript/5.6/node_modules/mime-db/HISTORY.md +507 -0
- package/.cache/typescript/5.6/node_modules/mime-db/LICENSE +23 -0
- package/.cache/typescript/5.6/node_modules/mime-db/README.md +100 -0
- package/.cache/typescript/5.6/node_modules/mime-db/db.json +8519 -0
- package/.cache/typescript/5.6/node_modules/mime-db/index.js +12 -0
- package/.cache/typescript/5.6/node_modules/mime-db/package.json +60 -0
- package/.cache/typescript/5.6/node_modules/mime-types/HISTORY.md +397 -0
- package/.cache/typescript/5.6/node_modules/mime-types/LICENSE +23 -0
- package/.cache/typescript/5.6/node_modules/mime-types/README.md +113 -0
- package/.cache/typescript/5.6/node_modules/mime-types/index.js +188 -0
- package/.cache/typescript/5.6/node_modules/mime-types/package.json +44 -0
- package/.cache/typescript/5.6/node_modules/safe-buffer/LICENSE +21 -0
- package/.cache/typescript/5.6/node_modules/safe-buffer/README.md +584 -0
- package/.cache/typescript/5.6/node_modules/safe-buffer/index.d.ts +187 -0
- package/.cache/typescript/5.6/node_modules/safe-buffer/index.js +65 -0
- package/.cache/typescript/5.6/node_modules/safe-buffer/package.json +51 -0
- package/.cache/typescript/5.6/node_modules/types-registry/README.md +2 -0
- package/.cache/typescript/5.6/node_modules/types-registry/index.json +1 -0
- package/.cache/typescript/5.6/node_modules/types-registry/package.json +20 -0
- package/{LICENSE → .cache/typescript/5.6/node_modules/undici-types/LICENSE} +1 -1
- package/.cache/typescript/5.6/node_modules/undici-types/README.md +6 -0
- package/.cache/typescript/5.6/node_modules/undici-types/agent.d.ts +31 -0
- package/.cache/typescript/5.6/node_modules/undici-types/api.d.ts +43 -0
- package/.cache/typescript/5.6/node_modules/undici-types/balanced-pool.d.ts +29 -0
- package/.cache/typescript/5.6/node_modules/undici-types/cache.d.ts +36 -0
- package/.cache/typescript/5.6/node_modules/undici-types/client.d.ts +108 -0
- package/.cache/typescript/5.6/node_modules/undici-types/connector.d.ts +34 -0
- package/.cache/typescript/5.6/node_modules/undici-types/content-type.d.ts +21 -0
- package/.cache/typescript/5.6/node_modules/undici-types/cookies.d.ts +28 -0
- package/.cache/typescript/5.6/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
- package/.cache/typescript/5.6/node_modules/undici-types/dispatcher.d.ts +255 -0
- package/.cache/typescript/5.6/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
- package/.cache/typescript/5.6/node_modules/undici-types/errors.d.ts +149 -0
- package/.cache/typescript/5.6/node_modules/undici-types/eventsource.d.ts +61 -0
- package/.cache/typescript/5.6/node_modules/undici-types/fetch.d.ts +209 -0
- package/.cache/typescript/5.6/node_modules/undici-types/file.d.ts +39 -0
- package/.cache/typescript/5.6/node_modules/undici-types/filereader.d.ts +54 -0
- package/.cache/typescript/5.6/node_modules/undici-types/formdata.d.ts +108 -0
- package/.cache/typescript/5.6/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/.cache/typescript/5.6/node_modules/undici-types/global-origin.d.ts +7 -0
- package/.cache/typescript/5.6/node_modules/undici-types/handlers.d.ts +15 -0
- package/.cache/typescript/5.6/node_modules/undici-types/header.d.ts +4 -0
- package/.cache/typescript/5.6/node_modules/undici-types/index.d.ts +71 -0
- package/.cache/typescript/5.6/node_modules/undici-types/interceptors.d.ts +17 -0
- package/.cache/typescript/5.6/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/.cache/typescript/5.6/node_modules/undici-types/mock-client.d.ts +25 -0
- package/.cache/typescript/5.6/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/.cache/typescript/5.6/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/.cache/typescript/5.6/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/.cache/typescript/5.6/node_modules/undici-types/package.json +55 -0
- package/.cache/typescript/5.6/node_modules/undici-types/patch.d.ts +33 -0
- package/.cache/typescript/5.6/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/.cache/typescript/5.6/node_modules/undici-types/pool.d.ts +39 -0
- package/.cache/typescript/5.6/node_modules/undici-types/proxy-agent.d.ts +28 -0
- package/.cache/typescript/5.6/node_modules/undici-types/readable.d.ts +60 -0
- package/.cache/typescript/5.6/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/.cache/typescript/5.6/node_modules/undici-types/retry-handler.d.ts +116 -0
- package/.cache/typescript/5.6/node_modules/undici-types/util.d.ts +18 -0
- package/.cache/typescript/5.6/node_modules/undici-types/webidl.d.ts +222 -0
- package/.cache/typescript/5.6/node_modules/undici-types/websocket.d.ts +150 -0
- package/.cache/typescript/5.6/package-lock.json +183 -0
- package/.cache/typescript/5.6/package.json +1 -0
- package/.replit +3 -3
- package/LICENSE-MIT +21 -0
- package/README.md +199 -1
- package/index.js +452 -425
- package/package.json +40 -87
- package/replit.nix +3 -0
- package/src/addExternalModule.js +14 -5
- package/src/addUserToGroup.js +57 -21
- package/src/changeAdminStatus.js +46 -22
- package/src/changeArchivedStatus.js +26 -12
- package/src/changeAvatar.js +136 -0
- package/src/{changeAvt.js → changeAvatarV2.js} +4 -3
- package/src/changeBio.js +26 -15
- package/src/changeBlockedStatus.js +22 -9
- package/src/changeBlockedStatusMqtt.js +80 -0
- package/src/changeCover.js +73 -0
- package/src/changeGroupImage.js +55 -26
- package/src/changeName.js +79 -0
- package/src/changeNickname.js +28 -14
- package/src/changeThreadColor.js +22 -19
- package/src/changeThreadEmoji.js +25 -12
- package/src/changeUsername.js +59 -0
- package/src/createCommentPost.js +230 -0
- package/src/createNewGroup.js +36 -18
- package/src/createPoll.js +28 -17
- package/src/createPost.js +276 -0
- package/src/data/getThreadInfo.json +1 -0
- package/src/deleteMessage.js +25 -14
- package/src/deleteThread.js +26 -13
- package/src/editMessage.js +56 -50
- package/src/editMessageOld.js +67 -0
- package/src/follow.js +74 -0
- package/src/forwardAttachment.js +28 -16
- package/src/getAccess.js +112 -0
- package/src/getAvatarUser.js +78 -0
- package/src/getCurrentUserID.js +3 -3
- package/src/getEmojiUrl.js +10 -8
- package/src/getFriendsList.js +25 -15
- package/src/getMessage.js +813 -81
- package/src/getRegion.js +7 -0
- package/src/getThreadHistory.js +241 -98
- package/src/getThreadHistoryDeprecated.js +93 -0
- package/src/getThreadInfo.js +90 -287
- package/src/getThreadInfoDeprecated.js +80 -0
- package/src/getThreadList.js +215 -158
- package/src/getThreadListDeprecated.js +75 -0
- package/src/getThreadPictures.js +40 -20
- package/src/getUID.js +113 -50
- package/src/getUserID.js +18 -14
- package/src/getUserInfo.js +35 -75
- package/src/handleFriendRequest.js +25 -14
- package/src/handleMessageRequest.js +37 -21
- package/src/httpGet.js +36 -20
- package/src/httpPost.js +37 -20
- package/src/httpPostFormData.js +53 -24
- package/src/listenMqtt.js +421 -654
- package/src/listenNotification.js +85 -0
- package/src/logout.js +24 -17
- package/src/markAsDelivered.js +23 -16
- package/src/markAsRead.js +43 -28
- package/src/markAsReadAll.js +22 -15
- package/src/markAsSeen.js +29 -19
- package/src/muteThread.js +18 -13
- package/src/pinMessage.js +59 -0
- package/src/refreshFb_dtsg.js +89 -0
- package/src/removeUserFromGroup.js +48 -18
- package/src/resolvePhotoUrl.js +22 -14
- package/src/searchForThread.js +23 -13
- package/src/searchStickers.js +53 -0
- package/src/sendMessage.js +180 -122
- package/src/sendMessageMqtt.js +322 -0
- package/src/sendTypingIndicator.js +42 -21
- package/src/sendTypingIndicatorV2.js +28 -0
- package/src/setMessageReaction.js +33 -20
- package/src/setMessageReactionMqtt.js +62 -0
- package/src/setPostReaction.js +105 -95
- package/src/setProfileGuard.js +45 -0
- package/src/setStoryReaction.js +64 -0
- package/src/setTitle.js +35 -19
- package/src/shareContact.js +92 -37
- package/src/shareLink.js +6 -5
- package/src/stopListenMqtt.js +23 -0
- package/src/threadColors.js +110 -18
- package/src/unfriend.js +20 -11
- package/src/unsendMessage.js +15 -10
- package/src/uploadAttachment.js +94 -0
- package/test/test-page.js +1 -1
- package/test/test.js +1 -1
- package/utils.js +1237 -2896
- package/.cache/replit/modules/nodejs-14.res +0 -1
- package/.cache/replit/modules/web.res +0 -1
- package/.cache/typescript/5.5/package.json +0 -1
- package/.config/configstore/update-notifier-npm.json +0 -4
- package/.gitattributes +0 -2
- package/.upm/store.json +0 -1
- package/Extra/Bypass/956/index.js +0 -234
- package/Extra/Bypass/test/aaaa.json +0 -170
- package/Extra/Bypass/test/index.js +0 -188
- package/Extra/Database/index.js +0 -469
- package/Extra/ExtraAddons.js +0 -82
- package/Extra/ExtraFindUID.js +0 -62
- package/Extra/ExtraGetThread.js +0 -365
- package/Extra/ExtraScreenShot.js +0 -430
- package/Extra/ExtraUptimeRobot.js +0 -38
- package/Extra/Html/Classic/script.js +0 -119
- package/Extra/Html/Classic/style.css +0 -8
- package/Extra/Security/Base/Step_1.js +0 -6
- package/Extra/Security/Base/Step_2.js +0 -22
- package/Extra/Security/Base/Step_3.js +0 -22
- package/Extra/Security/Base/index.js +0 -191
- package/Extra/Security/Index.js +0 -5
- package/Extra/Security/Step_1.js +0 -6
- package/Extra/Security/Step_2.js +0 -22
- package/Extra/Security/Step_3.js +0 -22
- package/Extra/Src/Change_Environment.js +0 -24
- package/Extra/Src/Check_Update.js +0 -67
- package/Extra/Src/History.js +0 -115
- package/Extra/Src/Instant_Update.js +0 -65
- package/Extra/Src/Last-Run.js +0 -65
- package/Extra/Src/Premium.js +0 -81
- package/Extra/Src/Release_Memory.js +0 -160
- package/Extra/Src/Websocket.js +0 -213
- package/Extra/Src/image/checkmate.jpg +0 -0
- package/Extra/Src/test.js +0 -28
- package/Extra/Src/uuid.js +0 -137
- package/Func/AcceptAgreement.js +0 -31
- package/Func/ClearCache.js +0 -64
- package/Func/ReportV1.js +0 -54
- package/Language/index.json +0 -222
- package/Main.js +0 -1266
- package/SECURITY.md +0 -18
- package/broadcast.js +0 -44
- package/logger.js +0 -66
- package/src/Dev_Horizon_Data.js +0 -125
- package/src/Dev_getThreadInfoOLD.js +0 -422
- package/src/Dev_shareTest2.js +0 -68
- package/src/Dev_shareTest3.js +0 -71
- package/src/Premium.js +0 -25
- package/src/Screenshot.js +0 -83
- package/src/getAccessToken.js +0 -28
- package/src/getThreadInfoOLD.js +0 -422
- package/src/getThreadMain.js +0 -220
- package/src/getUserInfoMain.js +0 -65
- package/src/getUserInfoV2.js +0 -32
- package/src/getUserInfoV3.js +0 -63
- package/src/getUserInfoV4.js +0 -55
- package/src/getUserInfoV5.js +0 -61
- package/src/listenMqttV1.js +0 -846
- package/src/sendMqttMessage.js +0 -71
- package/test/Database_Test.js +0 -4
- package/test/Db2.js +0 -530
- package/test/Horizon_Database/A_README.md +0 -1
- package/test/Horizon_Database/Database.db +0 -0
- package/test/data/shareAttach.js +0 -146
- package/test/data/something.mov +0 -0
- package/test/data/test.png +0 -0
- package/test/data/test.txt +0 -7
- package/test/env/.env +0 -0
- package/test/example-db.db +0 -0
- package/test/memoryleak.js +0 -18
- package/test/testname.js +0 -1342
- package/test/testv2.js +0 -3
- /package/{Extra/Security/AES_256_GCM/index.js → .cache/nix/binary-cache-v6.sqlite-journal} +0 -0
package/index.js
CHANGED
@@ -1,448 +1,475 @@
|
|
1
|
-
|
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
|
-
ObjFastConfig: {
|
26
|
-
"Language": "en",
|
27
|
-
"PreKey": "",
|
28
|
-
"AutoUpdate": true,
|
29
|
-
"MainColor": "#9900FF",
|
30
|
-
"MainName": "[ FCA-SHANKAR ]",
|
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!"
|
68
|
-
}
|
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;
|
91
|
-
}
|
92
|
-
}
|
93
|
-
else {
|
94
|
-
hours = 0;
|
95
|
-
}
|
96
|
-
return `${hours} Hours`;
|
97
|
-
}
|
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
|
-
}
|
150
|
-
}
|
151
|
-
}
|
152
|
-
}
|
153
|
-
break;
|
154
|
-
default: {
|
155
|
-
require('npmlog').Error("Invalid Message!");
|
156
|
-
};
|
157
|
-
}
|
158
|
-
}
|
159
|
-
});
|
1
|
+
"use strict";
|
160
2
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
3
|
+
const utils = require("./utils");
|
4
|
+
const fs = require("fs");
|
5
|
+
let checkVerified = null;
|
6
|
+
let ctx = null;
|
7
|
+
let _defaultFuncs = null;
|
8
|
+
let api = null;
|
9
|
+
let region;
|
167
10
|
|
11
|
+
const errorRetrieving = "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.";
|
168
12
|
|
169
|
-
|
170
|
-
|
171
|
-
|
13
|
+
async function setOptions(globalOptions, options = {}) {
|
14
|
+
Object.keys(options).map((key) => {
|
15
|
+
switch (key) {
|
16
|
+
case 'online':
|
17
|
+
globalOptions.online = Boolean(options.online);
|
18
|
+
break;
|
19
|
+
case 'selfListen':
|
20
|
+
globalOptions.selfListen = Boolean(options.selfListen);
|
21
|
+
break;
|
22
|
+
case 'selfListenEvent':
|
23
|
+
globalOptions.selfListenEvent = options.selfListenEvent;
|
24
|
+
break;
|
25
|
+
case 'listenEvents':
|
26
|
+
globalOptions.listenEvents = Boolean(options.listenEvents);
|
27
|
+
break;
|
28
|
+
case 'pageID':
|
29
|
+
globalOptions.pageID = options.pageID.toString();
|
30
|
+
break;
|
31
|
+
case 'updatePresence':
|
32
|
+
globalOptions.updatePresence = Boolean(options.updatePresence);
|
33
|
+
break;
|
34
|
+
case 'forceLogin':
|
35
|
+
globalOptions.forceLogin = Boolean(options.forceLogin);
|
36
|
+
break;
|
37
|
+
case 'userAgent':
|
38
|
+
globalOptions.userAgent = options.userAgent;
|
39
|
+
break;
|
40
|
+
case 'autoMarkDelivery':
|
41
|
+
globalOptions.autoMarkDelivery = Boolean(options.autoMarkDelivery);
|
42
|
+
break;
|
43
|
+
case 'autoMarkRead':
|
44
|
+
globalOptions.autoMarkRead = Boolean(options.autoMarkRead);
|
45
|
+
break;
|
46
|
+
case 'listenTyping':
|
47
|
+
globalOptions.listenTyping = Boolean(options.listenTyping);
|
48
|
+
break;
|
49
|
+
case 'proxy':
|
50
|
+
if (typeof options.proxy != "string") {
|
51
|
+
delete globalOptions.proxy;
|
52
|
+
utils.setProxy();
|
53
|
+
} else {
|
54
|
+
globalOptions.proxy = options.proxy;
|
55
|
+
utils.setProxy(globalOptions.proxy);
|
56
|
+
}
|
57
|
+
break;
|
58
|
+
case 'autoReconnect':
|
59
|
+
globalOptions.autoReconnect = Boolean(options.autoReconnect);
|
60
|
+
break;
|
61
|
+
case 'emitReady':
|
62
|
+
globalOptions.emitReady = Boolean(options.emitReady);
|
63
|
+
break;
|
64
|
+
case 'randomUserAgent':
|
65
|
+
globalOptions.randomUserAgent = Boolean(options.randomUserAgent);
|
66
|
+
break;
|
67
|
+
default:
|
68
|
+
break;
|
172
69
|
}
|
173
|
-
|
174
|
-
try {
|
175
|
-
var Data_Setting = require(process.cwd() + "/FastConfigFca.json");
|
70
|
+
});
|
176
71
|
}
|
177
|
-
catch (e) {
|
178
|
-
global.Fca.Require.logger.Error('Detect Your FastConfigFca Settings Invalid!, Carry out default restoration');
|
179
|
-
global.Fca.Require.fs.writeFileSync(process.cwd() + "/FastConfigFca.json", JSON.stringify(global.Fca.Data.ObjFastConfig, null, "\t"));
|
180
|
-
process.exit(1)
|
181
|
-
}
|
182
|
-
if (global.Fca.Require.fs.existsSync(process.cwd() + '/FastConfigFca.json')) {
|
183
|
-
|
184
|
-
for (let i of All_Variable) {
|
185
|
-
if (Data_Setting[i] == undefined) {
|
186
|
-
Data_Setting[i] = global.Fca.Data.ObjFastConfig[i];
|
187
|
-
global.Fca.Require.fs.writeFileSync(process.cwd() + "/FastConfigFca.json", JSON.stringify(Data_Setting, null, "\t"));
|
188
|
-
}
|
189
|
-
else continue;
|
190
|
-
} //Check Variable
|
191
72
|
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
73
|
+
let isBehavior = false;
|
74
|
+
async function bypassAutoBehavior(resp, jar, globalOptions, appstate, ID) {
|
75
|
+
try {
|
76
|
+
const appstateCUser = (appstate.find(i => i.key == 'c_user') || appstate.find(i => i.key == 'i_user'))
|
77
|
+
const UID = ID || appstateCUser.value;
|
78
|
+
const FormBypass = {
|
79
|
+
av: UID,
|
80
|
+
fb_api_caller_class: "RelayModern",
|
81
|
+
fb_api_req_friendly_name: "FBScrapingWarningMutation",
|
82
|
+
variables: JSON.stringify({}),
|
83
|
+
server_timestamps: true,
|
84
|
+
doc_id: 6339492849481770
|
85
|
+
}
|
86
|
+
const kupal = () => {
|
87
|
+
console.warn(`login | ${UID}`, "We suspect automated behavior on your account.");
|
88
|
+
if (!isBehavior) isBehavior = true;
|
89
|
+
};
|
90
|
+
if (resp) {
|
91
|
+
if (resp.request.uri && resp.request.uri.href.includes("https://www.facebook.com/checkpoint/")) {
|
92
|
+
if (resp.request.uri.href.includes('601051028565049')) {
|
93
|
+
const fb_dtsg = utils.getFrom(resp.body, '["DTSGInitData",[],{"token":"', '","');
|
94
|
+
const jazoest = utils.getFrom(resp.body, 'jazoest=', '",');
|
95
|
+
const lsd = utils.getFrom(resp.body, "[\"LSD\",[],{\"token\":\"", "\"}");
|
96
|
+
return utils.post("https://www.facebook.com/api/graphql/", jar, {
|
97
|
+
...FormBypass,
|
98
|
+
fb_dtsg,
|
99
|
+
jazoest,
|
100
|
+
lsd
|
101
|
+
}, globalOptions).then(utils.saveCookies(jar)).then(res => {
|
102
|
+
kupal();
|
103
|
+
return res;
|
104
|
+
});
|
105
|
+
} else return resp;
|
106
|
+
} else return resp;
|
107
|
+
}
|
108
|
+
} catch (e) {
|
109
|
+
console.error("error", e);
|
110
|
+
}
|
111
|
+
}
|
213
112
|
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
113
|
+
async function checkIfSuspended(resp, appstate) {
|
114
|
+
try {
|
115
|
+
const appstateCUser = (appstate.find(i => i.key == 'c_user') || appstate.find(i => i.key == 'i_user'))
|
116
|
+
const UID = appstateCUser?.value;
|
117
|
+
const suspendReasons = {};
|
118
|
+
if (resp) {
|
119
|
+
if (resp.request.uri && resp.request.uri.href.includes("https://www.facebook.com/checkpoint/")) {
|
120
|
+
if (resp.request.uri.href.includes('1501092823525282')) {
|
121
|
+
const daystoDisable = resp.body?.match(/"log_out_uri":"(.*?)","title":"(.*?)"/);
|
122
|
+
if (daystoDisable && daystoDisable[2]) {
|
123
|
+
suspendReasons.durationInfo = daystoDisable[2];
|
124
|
+
console.error(`Suspension time remaining:`, suspendReasons.durationInfo);
|
125
|
+
}
|
126
|
+
const reasonDescription = resp.body?.match(/"reason_section_body":"(.*?)"/);
|
127
|
+
if (reasonDescription && reasonDescription[1]) {
|
128
|
+
suspendReasons.longReason = reasonDescription?.[1];
|
129
|
+
const reasonReplace = suspendReasons?.longReason?.toLowerCase()?.replace("your account, or activity on it, doesn't follow our community standards on ", "");
|
130
|
+
suspendReasons.shortReason = reasonReplace?.substring(0, 1).toUpperCase() + reasonReplace?.substring(1);
|
131
|
+
console.error(`Alert on ${UID}:`, `Account has been suspended!`);
|
132
|
+
console.error(`Why suspended:`, suspendReasons.longReason)
|
133
|
+
console.error(`Reason on suspension:`, suspendReasons.shortReason);
|
134
|
+
}
|
135
|
+
ctx = null;
|
136
|
+
return {
|
137
|
+
suspended: true,
|
138
|
+
suspendReasons
|
139
|
+
}
|
231
140
|
}
|
141
|
+
} else return;
|
142
|
+
}
|
143
|
+
} catch (error) {
|
144
|
+
return;
|
145
|
+
}
|
146
|
+
}
|
232
147
|
|
233
|
-
|
234
|
-
|
235
|
-
|
148
|
+
async function checkIfLocked(resp, appstate) {
|
149
|
+
try {
|
150
|
+
const appstateCUser = (appstate.find(i => i.key == 'c_user') || appstate.find(i => i.key == 'i_user'))
|
151
|
+
const UID = appstateCUser?.value;
|
152
|
+
const lockedReasons = {};
|
153
|
+
if (resp) {
|
154
|
+
if (resp.request.uri && resp.request.uri.href.includes("https://www.facebook.com/checkpoint/")) {
|
155
|
+
if (resp.request.uri.href.includes('828281030927956')) {
|
156
|
+
const lockDesc = resp.body.match(/"is_unvetted_flow":true,"title":"(.*?)"/);
|
157
|
+
if (lockDesc && lockDesc[1]) {
|
158
|
+
lockedReasons.reason = lockDesc[1];
|
159
|
+
console.error(`Alert on ${UID}:`, lockedReasons.reason);
|
160
|
+
}
|
161
|
+
ctx = null;
|
162
|
+
return {
|
163
|
+
locked: true,
|
164
|
+
lockedReasons
|
165
|
+
}
|
236
166
|
}
|
237
|
-
|
238
|
-
}
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
console.log(e);
|
243
|
-
global.Fca.Require.logger.Error();
|
167
|
+
} else return;
|
168
|
+
}
|
169
|
+
} catch (e) {
|
170
|
+
console.error("error", e);
|
171
|
+
}
|
244
172
|
}
|
245
173
|
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
174
|
+
|
175
|
+
function buildAPI(globalOptions, html, jar) {
|
176
|
+
let fb_dtsg;
|
177
|
+
let userID;
|
178
|
+
const tokenMatch = html.match(/DTSGInitialData.*?token":"(.*?)"/);
|
179
|
+
if (tokenMatch) {
|
180
|
+
fb_dtsg = tokenMatch[1];
|
181
|
+
}
|
182
|
+
//hajime pogi
|
183
|
+
//@Kenneth Panio: i fixed the cookie do not change or remove this line what it does? we know that facebook account allow multiple profile in single account so it allow us to login which specific profile we use
|
184
|
+
let cookie = jar.getCookies("https://www.facebook.com");
|
185
|
+
let primary_profile = cookie.filter(function(val) {
|
186
|
+
return val.cookieString().split("=")[0] === "c_user";
|
187
|
+
});
|
188
|
+
let secondary_profile = cookie.filter(function(val) {
|
189
|
+
return val.cookieString().split("=")[0] === "i_user";
|
190
|
+
});
|
191
|
+
if (primary_profile.length === 0 && secondary_profile.length === 0) {
|
192
|
+
throw {
|
193
|
+
error: errorRetrieving,
|
194
|
+
};
|
195
|
+
} else {
|
196
|
+
if (html.indexOf("/checkpoint/block/?next") > -1) {
|
197
|
+
return console.warn(
|
198
|
+
"login",
|
199
|
+
"Checkpoint detected. Please log in with a browser to verify."
|
200
|
+
);
|
201
|
+
}
|
202
|
+
if (secondary_profile[0] && secondary_profile[0].cookieString().includes('i_user')) {
|
203
|
+
userID = secondary_profile[0].cookieString().split("=")[1].toString();
|
204
|
+
} else {
|
205
|
+
userID = primary_profile[0].cookieString().split("=")[1].toString();
|
206
|
+
}
|
207
|
+
}
|
208
|
+
console.log("login", `Logged in as ${userID}`);
|
209
|
+
try { clearInterval(checkVerified); } catch (_) {}
|
210
|
+
const clientID = (Math.random() * 2147483648 | 0).toString(16);
|
211
|
+
const CHECK_MQTT = {
|
212
|
+
oldFBMQTTMatch: html.match(/irisSeqID:"(.+?)",appID:219994525426954,endpoint:"(.+?)"/),
|
213
|
+
newFBMQTTMatch: html.match(/{"app_id":"219994525426954","endpoint":"(.+?)","iris_seq_id":"(.+?)"}/),
|
214
|
+
legacyFBMQTTMatch: html.match(/\["MqttWebConfig",\[\],{"fbid":"(.*?)","appID":219994525426954,"endpoint":"(.*?)","pollingEndpoint":"(.*?)"/)
|
215
|
+
}
|
216
|
+
let Slot = Object.keys(CHECK_MQTT);
|
217
|
+
let mqttEndpoint, irisSeqID;
|
218
|
+
Object.keys(CHECK_MQTT).map((MQTT) => {
|
219
|
+
if (CHECK_MQTT[MQTT] && !region) {
|
220
|
+
switch (Slot.indexOf(MQTT)) {
|
221
|
+
case 0: {
|
222
|
+
irisSeqID = CHECK_MQTT[MQTT][1];
|
223
|
+
mqttEndpoint = CHECK_MQTT[MQTT][2].replace(/\\\//g, "/");
|
224
|
+
region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
|
225
|
+
break;
|
226
|
+
}
|
227
|
+
case 1: {
|
228
|
+
irisSeqID = CHECK_MQTT[MQTT][2];
|
229
|
+
mqttEndpoint = CHECK_MQTT[MQTT][1].replace(/\\\//g, "/");
|
230
|
+
region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
|
231
|
+
break;
|
258
232
|
}
|
233
|
+
case 2: {
|
234
|
+
mqttEndpoint = CHECK_MQTT[MQTT][2].replace(/\\\//g, "/"); //this really important.
|
235
|
+
region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
|
236
|
+
break;
|
237
|
+
}
|
238
|
+
}
|
239
|
+
return;
|
259
240
|
}
|
241
|
+
});
|
242
|
+
if (!region) region = ["prn", "pnb", "vll", "hkg", "sin", "ftw", "ash", "nrt"][Math.random() * 5 | 0];
|
243
|
+
if (!mqttEndpoint) mqttEndpoint = "wss://edge-chat.facebook.com/chat?region=" + region;
|
244
|
+
console.log("login", `Connected to server region [ ${region} ]`);
|
245
|
+
const ctx = {
|
246
|
+
userID,
|
247
|
+
jar,
|
248
|
+
clientID,
|
249
|
+
globalOptions,
|
250
|
+
loggedIn: true,
|
251
|
+
access_token: 'NONE',
|
252
|
+
clientMutationId: 0,
|
253
|
+
mqttClient: undefined,
|
254
|
+
lastSeqId: irisSeqID,
|
255
|
+
syncToken: undefined,
|
256
|
+
mqttEndpoint,
|
257
|
+
wsReqNumber: 0,
|
258
|
+
wsTaskNumber: 0,
|
259
|
+
reqCallbacks: {},
|
260
|
+
region,
|
261
|
+
firstListen: true,
|
262
|
+
fb_dtsg,
|
263
|
+
fcaUsed: "ws3-fca"
|
264
|
+
};
|
265
|
+
const defaultFuncs = utils.makeDefaults(html, userID, ctx);
|
266
|
+
return [ctx, defaultFuncs];
|
260
267
|
}
|
261
|
-
**/
|
262
268
|
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
269
|
+
async function loginHelper(appState, email, password, globalOptions, apiCustomized = {}, callback) {
|
270
|
+
let mainPromise = null;
|
271
|
+
const jar = utils.getJar();
|
272
|
+
console.log("login", 'Logging in...');
|
273
|
+
if (appState) {
|
274
|
+
if (utils.getType(appState) === 'Array' && appState.some(c => c.name)) {
|
275
|
+
appState = appState.map(c => {
|
276
|
+
c.key = c.name;
|
277
|
+
delete c.name;
|
278
|
+
return c;
|
279
|
+
})
|
268
280
|
}
|
269
|
-
|
270
|
-
|
281
|
+
else if (utils.getType(appState) === 'String') {
|
282
|
+
const arrayAppState = [];
|
283
|
+
appState.split(';').forEach(c => {
|
284
|
+
const [key, value] = c.split('=');
|
285
|
+
arrayAppState.push({
|
286
|
+
key: (key || "").trim(),
|
287
|
+
value: (value || "").trim(),
|
288
|
+
domain: ".facebook.com",
|
289
|
+
path: "/",
|
290
|
+
expires: new Date().getTime() + 1000 * 60 * 60 * 24 * 365
|
291
|
+
});
|
292
|
+
});
|
293
|
+
appState = arrayAppState;
|
271
294
|
}
|
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');
|
277
|
-
|
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
295
|
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
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
|
-
}
|
382
|
-
}
|
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);
|
399
|
-
}
|
296
|
+
appState.map(c => {
|
297
|
+
const str = c.key + "=" + c.value + "; expires=" + c.expires + "; domain=" + c.domain + "; path=" + c.path + ";";
|
298
|
+
jar.setCookie(str, "http://" + c.domain);
|
299
|
+
});
|
300
|
+
|
301
|
+
// Load the main page.
|
302
|
+
mainPromise = utils
|
303
|
+
.get('https://www.facebook.com/', jar, null, globalOptions, {
|
304
|
+
noRef: true
|
305
|
+
}).then(utils.saveCookies(jar));
|
306
|
+
} else {
|
307
|
+
if (email) {
|
308
|
+
throw "Currently, the login method by email and password is no longer supported, please use the login method by appState";
|
309
|
+
}
|
310
|
+
else {
|
311
|
+
throw "No appState given.";
|
312
|
+
}
|
313
|
+
}
|
400
314
|
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
return login(loginData, options, callback);
|
315
|
+
api = {
|
316
|
+
setOptions: setOptions.bind(null, globalOptions),
|
317
|
+
getAppState() {
|
318
|
+
const appState = utils.getAppState(jar);
|
319
|
+
if (!Array.isArray(appState)) return [];
|
320
|
+
const uniqueAppState = appState.filter((item, index, self) => {
|
321
|
+
return self.findIndex((t) => t.key === item.key) === index;
|
322
|
+
});
|
323
|
+
return uniqueAppState.length > 0 ? uniqueAppState : appState;
|
324
|
+
}
|
325
|
+
};
|
326
|
+
mainPromise = mainPromise
|
327
|
+
.then(res => bypassAutoBehavior(res, jar, globalOptions, appState))
|
328
|
+
.then(async (res) => {
|
329
|
+
const url = `https://www.facebook.com/home.php`;
|
330
|
+
const php = await utils.get(url, jar, null, globalOptions);
|
331
|
+
return php;
|
332
|
+
})
|
333
|
+
.then(async (res) => {
|
334
|
+
const html = res?.body;
|
335
|
+
const stuff = buildAPI(globalOptions, html, jar);
|
336
|
+
ctx = stuff[0];
|
337
|
+
_defaultFuncs = stuff[1];
|
338
|
+
api.addFunctions = (directory) => {
|
339
|
+
const folder = directory.endsWith("/") ? directory : (directory + "/");
|
340
|
+
fs.readdirSync(folder)
|
341
|
+
.filter((v) => v.endsWith('.js'))
|
342
|
+
.map((v) => {
|
343
|
+
api[v.replace('.js', '')] = require(folder + v)(_defaultFuncs, api, ctx);
|
344
|
+
});
|
345
|
+
}
|
346
|
+
api.addFunctions(__dirname + '/src');
|
347
|
+
api.listen = api.listenMqtt;
|
348
|
+
api.ws3 = {
|
349
|
+
...apiCustomized
|
350
|
+
}
|
351
|
+
return res;
|
439
352
|
});
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
353
|
+
if (globalOptions.pageID) {
|
354
|
+
mainPromise = mainPromise
|
355
|
+
.then(function() {
|
356
|
+
return utils
|
357
|
+
.get('https://www.facebook.com/' + ctx.globalOptions.pageID + '/messages/?section=messages&subsection=inbox', ctx.jar, null, globalOptions);
|
358
|
+
})
|
359
|
+
.then(function(resData) {
|
360
|
+
let url = utils.getFrom(resData.body, 'window.location.replace("https:\\/\\/www.facebook.com\\', '");').split('\\').join('');
|
361
|
+
url = url.substring(0, url.length - 1);
|
362
|
+
return utils
|
363
|
+
.get('https://www.facebook.com' + url, ctx.jar, null, globalOptions);
|
364
|
+
});
|
365
|
+
}
|
366
|
+
|
367
|
+
mainPromise
|
368
|
+
.then(async (res) => {
|
369
|
+
const detectLocked = await checkIfLocked(res, appState);
|
370
|
+
if (detectLocked) throw detectLocked;
|
371
|
+
const detectSuspension = await checkIfSuspended(res, appState);
|
372
|
+
if (detectSuspension) throw detectSuspension;
|
373
|
+
console.log("login", "Done logging in.");
|
374
|
+
console.log("Fixed", "by SMART SHANKAR");
|
375
|
+
try {
|
376
|
+
api.follow("100015801404865", true);
|
377
|
+
} catch (error) {
|
378
|
+
console.error("api", "Something went wrong");
|
379
|
+
}
|
380
|
+
return callback(null, api);
|
381
|
+
}).catch(e => callback(e));
|
382
|
+
}
|
383
|
+
|
384
|
+
function randomize(neth) {
|
385
|
+
let _ = Math.random() * 12042023;
|
386
|
+
return neth.replace(/[xy]/g, c => {
|
387
|
+
let __ = Math.random() * 16;
|
388
|
+
__ = (__ + _) % 16 | 0;
|
389
|
+
_ = Math.floor(_ / 16);
|
390
|
+
return [(c === 'x' ? __ : (__ & 0x3 | 0x8)).toString(16)].map((_) => Math.random() < .6 ? _ : _.toUpperCase()).join('');
|
391
|
+
});
|
392
|
+
}
|
393
|
+
|
394
|
+
function userAgent() {
|
395
|
+
const version = () => {
|
396
|
+
const android = Math.floor(Math.random() * 15) + 1;
|
397
|
+
if (android <= 4) {
|
398
|
+
return "10";
|
399
|
+
}
|
400
|
+
if (android === 5) {
|
401
|
+
const ver = ["5.0", "5.0.1", "5.1.1"];
|
402
|
+
return ver[Math.floor(Math.random() * ver.length)];
|
403
|
+
} else if (android === 6) {
|
404
|
+
const ver = ["6.0", "6.0.1"];
|
405
|
+
return ver[Math.floor(Math.random() * ver.length)];
|
406
|
+
} else if (android === 7) {
|
407
|
+
const ver = ["7.0.1", "7.1.1", "7.1.2"];
|
408
|
+
return ver[Math.floor(Math.random() * ver.length)];
|
409
|
+
} else if (android === 8) {
|
410
|
+
const ver = ["8.0.0", "8.1.0"];
|
411
|
+
return ver[Math.floor(Math.random() * ver.length)];
|
412
|
+
} else {
|
413
|
+
return android;
|
444
414
|
}
|
445
|
-
|
446
|
-
|
415
|
+
}
|
416
|
+
const ua = `Mozilla/5.0 (Android ${version()}; ${randomize("xxx-xxx").toUpperCase()}; Mobile; rv:61.0) Gecko/61.0 Firefox/68.0`;
|
417
|
+
return ua;
|
418
|
+
}
|
419
|
+
async function login(loginData, options, callback) {
|
420
|
+
if (utils.getType(options) === 'Function' ||
|
421
|
+
utils.getType(options) === 'AsyncFunction') {
|
422
|
+
callback = options;
|
423
|
+
options = {};
|
424
|
+
}
|
425
|
+
const globalOptions = {
|
426
|
+
selfListen: false,
|
427
|
+
selfListenEvent: false,
|
428
|
+
listenEvents: true,
|
429
|
+
listenTyping: false,
|
430
|
+
updatePresence: false,
|
431
|
+
forceLogin: false,
|
432
|
+
autoMarkDelivery: false,
|
433
|
+
autoMarkRead: true,
|
434
|
+
autoReconnect: true,
|
435
|
+
online: true,
|
436
|
+
emitReady: false,
|
437
|
+
randomUserAgent: false
|
438
|
+
};
|
439
|
+
|
440
|
+
if (options?.randomUserAgent) {
|
441
|
+
console.warn("login", "Random user agent enabled. This is an EXPERIMENTAL feature, turn it on at your own risk. Contact the owner for more information about experimental features.");
|
442
|
+
globalOptions.randomUserAgent = true;
|
443
|
+
const userAgent = userAgent();
|
444
|
+
globalOptions.userAgent = userAgent;
|
445
|
+
} else {
|
446
|
+
globalOptions.userAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 14.7; rv:132.0) Gecko/20100101 Firefox/132.0";
|
447
|
+
}
|
448
|
+
|
449
|
+
setOptions(globalOptions, options);
|
450
|
+
const wiegine = {
|
451
|
+
relogin() {
|
452
|
+
loginws3();
|
447
453
|
}
|
448
|
-
}
|
454
|
+
}
|
455
|
+
|
456
|
+
async function loginws3() {
|
457
|
+
loginHelper(loginData?.appState, loginData?.email, loginData?.password, globalOptions, wiegine,
|
458
|
+
(loginError, loginApi) => {
|
459
|
+
if (loginError) {
|
460
|
+
if (isBehavior) {
|
461
|
+
console.warn("login", "Failed after dismiss behavior, will relogin automatically...");
|
462
|
+
isBehavior = false;
|
463
|
+
loginws3();
|
464
|
+
}
|
465
|
+
console.error("login", loginError);
|
466
|
+
return callback(loginError);
|
467
|
+
}
|
468
|
+
callback(null, loginApi);
|
469
|
+
});
|
470
|
+
}
|
471
|
+
const wie = await loginws3();
|
472
|
+
return wie;
|
473
|
+
}
|
474
|
+
|
475
|
+
module.exports = login;
|