Socket
Socket
Sign inDemoInstall

fca-umaru-v2

Package Overview
Dependencies
196
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 40.1.26 to 40.1.27

src/refreshFb_dtsg.js

2

Main.js

@@ -1,1 +0,1 @@

global;const e=global.Fca.Require.languageFile.find((e=>e.Language==global.Fca.Require.FastConfig.Language)).Folder.Index;var t=global.Fca.Require.utils,o=logger,n=(global,global.Fca.getText),a=global.Fca.Require.log,r=(require("express")(),require("path"),require("cheerio")),i=(require("fs-extra"),require("readline")),s=(require("chalk"),require("figlet"),require("os"),require("deasync"));a.maxRecordSize=100;var c=null;const l=["online","selfListen","listenEvents","updatePresence","forceLogin","autoMarkDelivery","autoMarkRead","listenTyping","autoReconnect","emitReady"];function u(e,o){Object.keys(o).map((function(n){switch(l.includes(n)){case!0:e[n]=Boolean(o[n]);break;case!1:switch(n){case"pauseLog":o.pauseLog?a.pause():a.resume();break;case"logLevel":a.level=o.logLevel,e.logLevel=o.logLevel;break;case"logRecordSize":a.maxRecordSize=o.logRecordSize,e.logRecordSize=o.logRecordSize;break;case"pageID":e.pageID=o.pageID.toString();break;case"userAgent":e.userAgent=o.userAgent||"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36";break;case"proxy":"string"!=typeof o.proxy?(delete e.proxy,t.setProxy()):(e.proxy=o.proxy,t.setProxy(e.proxy));break;default:a.warn("setOptions","Unrecognized option given to setOptions: "+n)}}}))}function p(l,g,h,d,f,m){var v,w,k,b,F,y,S,C,A=null,T=t.getJar();try{if(l){o.log("Umaru",e.OnProcess);try{l=JSON.parse(l)}catch(e){}try{global.Fca.Data.AppState=l,l.map((function(e){T.setCookie(e.key+"="+e.value+"; expires="+e.expires+"; domain="+e.domain+"; path="+e.path+";","http://"+e.domain)})),A=t.get("https://www.facebook.com/",T,null,d,{noRef:!0}).then(t.saveCookies(T))}catch(t){o.log("Warning",e.ErrBackup),process.exit(0)}}else A=t.get("https://www.facebook.com/",null,null,d,{noRef:!0}).then(t.saveCookies(T)).then((k=T,b=g,F=h,y=d,S=f,C=m,function(n){var l=n.body,u=r.load(l),g=[];u("#login_form input").map(((e,t)=>g.push({val:u(t).val(),name:u(t).attr("name")}))),g=g.filter((function(e){return e.val&&e.val.length}));var h=t.arrToForm(g);return h.lsd=t.getFrom(l,'["LSD",[],{"token":"','"}'),h.lgndim=Buffer.from('{"w":1440,"h":900,"aw":1440,"ah":834,"c":24}').toString("base64"),h.email=b,h.pass=F,h.default_persistent="0",h.locale="en_US",h.timezone="240",h.lgnjs=~~(Date.now()/1e3),l.split('"_js_').slice(1).map((e=>{k.setCookie(t.formatCookie(JSON.parse('["'+t.getFrom(e,"","]")+"]"),"facebook"),"https://www.facebook.com")})),o.log("Umaru",e.OnLogin),t.post("https://www.facebook.com/login/device-based/regular/login/?login_attempt=1&lwv=110",k,h,y).then(t.saveCookies(k)).then((function(n){var l=n.headers;if(!l.location)throw{error:e.InvaildAccount};if(l.location.indexOf("https://www.facebook.com/checkpoint/")>-1){o.log("Warning",e.TwoAuth);var u="https://www.facebook.com/checkpoint/?next=https%3A%2F%2Fwww.facebook.com%2Fhome.php";return t.get(l.location,k,null,y).then(t.saveCookies(k)).then((function(n){var l=n.body,g=r.load(l),h=[];g("form input").map(((e,t)=>h.push({val:g(t).val(),name:g(t).attr("name")}))),h=h.filter((e=>e.val&&e.val.length));var d=t.arrToForm(h);if(!(l.indexOf("checkpoint/?next")>-1)){if(!y.forceLogin)throw{error:e.ForceLoginNotEnable};return l.indexOf("Suspicious Login Attempt")>-1?d["submit[This was me]"]="This was me":d["submit[This Is Okay]"]="This Is Okay",t.post(u,k,d,y).then(t.saveCookies(k)).then((function(){return d.name_action_selected="dont_save",t.post(u,k,d,y).then(t.saveCookies(k))})).then((function(e){if(!e.headers.location&&e.body.indexOf("Review Recent Login")>-1)throw{error:"Something went wrong with review recent login."};return p(t.getAppState(k,!1),b,F,y,S)})).catch((e=>S(e)))}switch(setTimeout((()=>{c=setInterval((e=>{}),5e3,{fb_dtsg:d.fb_dtsg,jazoest:d.jazoest,dpr:1})}),2500),global.Fca.Require.FastConfig.Login2Fa){case!0:{const n=e=>{const t=i.createInterface({input:process.stdin,output:process.stdout});var o,n;return t.question(e,(e=>{t.close(),n=e,o=!0})),s.loopWhile((function(){return!o})),n},l=require("totp-generator"),h=0==global.Fca.Require.FastConfig.AuthString.includes("|")?l(global.Fca.Require.FastConfig.AuthString.includes(" ")?global.Fca.Require.FastConfig.AuthString.replace(RegExp(" ","g"),""):global.Fca.Require.FastConfig.AuthString):n(e.EnterSecurityCode);try{const i=function(s){var l,h;d.approvals_code=s,d["submit[Continue]"]=g("#checkpointSubmitButton").html();var f=new Promise(((e,t)=>{l=e,h=t}));return"string"==typeof s?t.post(u,k,d,y).then(t.saveCookies(k)).then((function(t){r.load(t.body)("#approvals_code").parent().attr("data-xui-error")&&o.log("Warning",e.InvaildTwoAuthCode,(function(){i(n(e.EnterSecurityCode))}))})).then((function(){return delete d.no_fido,delete d.approvals_code,d.name_action_selected="save_device",t.post(u,k,d,y).then(t.saveCookies(k))})).then((function(e){if(!e.headers.location&&e.headers["set-cookie"][0].includes("checkpoint"))try{return delete d.name_action_selected,d["submit[Continue]"]=g("#checkpointSubmitButton").html(),t.post(u,k,d,y).then(t.saveCookies(k)).then((function(){return d["submit[This was me]"]="This was me",t.post(u,k,d,y).then(t.saveCookies(k))})).then((function(){return delete d["submit[This was me]"],d.name_action_selected="save_device",d["submit[Continue]"]=g("#checkpointSubmitButton").html(),t.post(u,k,d,y).then(t.saveCookies(k))})).then((function(e){if(!e.headers.location&&e.headers["set-cookie"][0].includes("checkpoint"))throw{error:"wtf ??:D"};return p(t.getAppState(k,!1),b,F,y,S)})).catch((e=>S(e)))}catch(e){console.log(e)}var o=t.getAppState(k,!1);return S===C&&(S=function(e,t){return e?h(e):l(t)}),p(o,b,F,y,S)})).catch((function(e){S===C?h(e):S(e)})):t.post("https://www.facebook.com/checkpoint/?next=https%3A%2F%2Fwww.facebook.com%2Fhome.php",k,d,y,null,{Referer:"https://www.facebook.com/checkpoint/?next"}).then(t.saveCookies(k)).then((function(n){try{JSON.parse(n.body.replace(/for\s*\(\s*;\s*;\s*\)\s*;\s*/,""))}catch(n){return clearInterval(c),o.log("Warning",e.VerifiedCheck),S===C&&(S=function(e,t){return e?h(e):l(t)}),p(t.getAppState(k,!1),b,F,y,S)}})).catch((e=>{a.error("login",e),S===C?h(e):S(e)})),f};return i(h)}catch(e){o.Error(e),o.Error(),process.exit(0)}}case!1:throw{error:"login-approval",continue:function n(i){var s,l;d.approvals_code=i,d["submit[Continue]"]=g("#checkpointSubmitButton").html();var h=new Promise(((e,t)=>{s=e,l=t}));return"string"==typeof i?t.post(u,k,d,y).then(t.saveCookies(k)).then((function(t){var o=r.load(t.body)("#approvals_code").parent().attr("data-xui-error");if(o)throw{error:"login-approval",errordesc:e.InvaildTwoAuthCode,lerror:o,continue:n}})).then((function(){return delete d.no_fido,delete d.approvals_code,d.name_action_selected="dont_save",t.post(u,k,d,y).then(t.saveCookies(k))})).then((function(o){if(!o.headers.location&&o.headers["set-cookie"][0].includes("checkpoint"))throw{error:e.ApprovalsErr};var n=t.getAppState(k,!1);return S===C&&(S=function(e,t){return e?l(e):s(t)}),p(n,b,F,y,S)})).catch((function(e){S===C?l(e):S(e)})):t.post("https://www.facebook.com/checkpoint/?next=https%3A%2F%2Fwww.facebook.com%2Fhome.php",k,d,y,null,{Referer:"https://www.facebook.com/checkpoint/?next"}).then(t.saveCookies(k)).then((n=>{try{JSON.parse(n.body.replace(/for\s*\(\s*;\s*;\s*\)\s*;\s*/,""))}catch(n){return clearInterval(c),o.log("Warning",e.VerifiedCheck),S===C&&(S=function(e,t){return e?l(e):s(t)}),p(t.getAppState(k,!1),b,F,y,S)}})).catch((e=>{a.error("login",e),S===C?l(e):S(e)})),h}}}}))}return t.get("https://www.facebook.com/",k,null,y).then(t.saveCookies(k))}))})).then((function(){return t.get("https://www.facebook.com/",T,null,d).then(t.saveCookies(T))}))}catch(k){console.log(k)}A=A.then((function(e){var o=/<meta http-equiv="refresh" content="0;url=([^"]+)[^>]+>/.exec(e.body);return o&&o[1]?t.get(o[1],T,null,d).then(t.saveCookies(T)):e})).then((function(r){var i=function(r,i,s){var l=s.getCookies("https://www.facebook.com").filter((function(e){return"c_user"===e.cookieString().split("=")[0]}));if(0!==l.length){i.indexOf("/checkpoint/block/?next")>-1&&a.warn("login",e.CheckPointLevelI);var p=l[0].cookieString().split("=")[1].toString();process.env.UID=o.log("Umaru",n(e.UID,p),p);try{clearInterval(c)}catch(e){console.log(e)}var g=(2147483648*Math.random()|0).toString(16),h={oldFBMQTTMatch:i.match(/irisSeqID:"(.+?)",appID:219994525426954,endpoint:"(.+?)"/),newFBMQTTMatch:i.match(/{"app_id":"219994525426954","endpoint":"(.+?)","iris_seq_id":"(.+?)"}/),legacyFBMQTTMatch:i.match(/(\["MqttWebConfig",\[\],{fbid:")(.+?)(",appID:219994525426954,endpoint:")(.+?)(",pollingEndpoint:")(.+?)(3790])/)};let b=Object.keys(h);var d,f,m;Object.keys(h).map((function(e){if(!h[e]||f);else switch(b.indexOf(e)){case 0:return m=h[e][1],d=h[e][2],void(f=new URL(d).searchParams.get("region").toUpperCase());case 1:return m=h[e][2],d=h[e][1].replace(/\\\//g,"/"),void(f=new URL(d).searchParams.get("region").toUpperCase());case 2:return d=h[e][4],void(f=new URL(d).searchParams.get("region").toUpperCase())}}));var v={userID:p,jar:s,clientID:g,globalOptions:r,loggedIn:!0,access_token:"NONE",clientMutationId:0,mqttClient:void 0,lastSeqId:m,syncToken:void 0,mqttEndpoint:d,region:f,firstListen:!0},w={setOptions:u.bind(null,r),getAppState:function(){return t.getAppState(s)}};f&&d||(a.warn("login",n(e.NoAreaData)),w.htmlData=i);const F=["addExternalModule","addUserToGroup","changeAdminStatus","changeArchivedStatus","changeAvatar","changeBio","changeBlockedStatus","changeGroupImage","changeNickname","changeThreadColor","changeThreadEmoji","createNewGroup","createPoll","deleteMessage","deleteThread","forwardAttachment","getCurrentUserID","getEmojiUrl","getFriendsList","getMessage","getThreadHistory","getThreadInfo","getThreadList","getThreadPictures","getUserID","getUserInfo","handleMessageRequest","listenMqtt","logout","markAsDelivered","markAsRead","markAsReadAll","markAsSeen","muteThread","removeUserFromGroup","resolvePhotoUrl","searchForThread","sendMessage","sendTypingIndicator","setMessageReaction","setPostReaction","setTitle","threadColors","unsendMessage","httpGet","httpPost","httpPostFormData"];var k=t.makeDefaults(i,p,v);return F.map((function(e){w[e]=require("./src/"+e)(k,w,v)})),w.listen=w.listenMqtt,{ctx:v,defaultFuncs:k,api:w}}return global.Fca.Require.FastConfig.AutoLogin?logger.log("Warning",global.Fca.Require.Language.Index.AutoLogin,(function(){global.Fca.Action("AutoLogin")})):global.Fca.Require.FastConfig.AutoLogin?void 0:logger.log(global.Fca.Require.Language.Index.ErrAppState)}(d,r.body,T);return v=(i)?i.ctx:"",w=(i)?i.api:"",process.env.api=(i)?i.api:"",r})),d.pageID&&(A=A.then((function(){return t.get("https://www.facebook.com/"+v.globalOptions.pageID+"/messages/?section=messages&subsection=inbox",v.jar,null,d)})).then((function(e){var o=t.getFrom(e.body,'window.location.replace("https:\\/\\/www.facebook.com\\','");').split("\\").join("");return o=o.substring(0,o.length-1),t.get("https://www.facebook.com"+o,v.jar,null,d)}))),A.then((async()=>{o.log("Umaru",n(e.LocalVersion,global.Fca.Version)),o.log("Umaru",e.WishMessage[Math.floor(Math.random()*e.WishMessage.length)]),f(null,w)})).catch((function(e){a.error("login",e.error||e),f(e)}))}module.exports=function(e,o,n){"Function"!==t.getType(o)&&"AsyncFunction"!==t.getType(o)||(n=o,o={});var a={selfListen:!1,listenEvents:!0,listenTyping:!1,updatePresence:!1,forceLogin:!1,autoMarkDelivery:!1,autoMarkRead:!1,autoReconnect:!0,logRecordSize:100,online:!1,emitReady:!1,userAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8"},r=null;if("Function"!==t.getType(n)&&"AsyncFunction"!==t.getType(n)){var i=null,s=null,c=new Promise((function(e,t){s=e,i=t}));n=r=function(e,t){return e?i(e):s(t)}}if(e.email&&e.password)u(a,{logLevel:"silent",forceLogin:!0,userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.114 Safari/537.36"}),p(e.appState,e.email,e.password,a,n,r);else if(e.appState)return u(a,o),p(e.appState,e.email,e.password,a,n,r);return c};
global;const e=global.Fca.Require.languageFile.find((e=>e.Language==global.Fca.Require.FastConfig.Language)).Folder.Index;var t=global.Fca.Require.utils,o=logger,n=(global,global.Fca.getText),a=global.Fca.Require.log,r=(require("express")(),require("path"),require("cheerio")),i=(require("fs-extra"),require("readline")),s=(require("chalk"),require("figlet"),require("os"),require("deasync"));a.maxRecordSize=100;var c=null;const l=["online","selfListen","listenEvents","updatePresence","forceLogin","autoMarkDelivery","autoMarkRead","listenTyping","autoReconnect","emitReady"];function u(e,o){Object.keys(o).map((function(n){switch(l.includes(n)){case!0:e[n]=Boolean(o[n]);break;case!1:switch(n){case"pauseLog":o.pauseLog?a.pause():a.resume();break;case"logLevel":a.level=o.logLevel,e.logLevel=o.logLevel;break;case"logRecordSize":a.maxRecordSize=o.logRecordSize,e.logRecordSize=o.logRecordSize;break;case"pageID":e.pageID=o.pageID.toString();break;case"userAgent":e.userAgent=o.userAgent||"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36";break;case"proxy":"string"!=typeof o.proxy?(delete e.proxy,t.setProxy()):(e.proxy=o.proxy,t.setProxy(e.proxy));break;default:a.warn("setOptions","Unrecognized option given to setOptions: "+n)}}}))}function p(l,g,h,d,f,m){var v,w,k,b,F,y,S,C,A=null,T=t.getJar();try{if(l){o.log("Umaru",e.OnProcess);try{l=JSON.parse(l)}catch(e){}try{global.Fca.Data.AppState=l,l.map((function(e){T.setCookie(e.key+"="+e.value+"; expires="+e.expires+"; domain="+e.domain+"; path="+e.path+";","http://"+e.domain)})),A=t.get("https://www.facebook.com/",T,null,d,{noRef:!0}).then(t.saveCookies(T))}catch(t){o.log("Warning",e.ErrBackup),process.exit(0)}}else A=t.get("https://www.facebook.com/",null,null,d,{noRef:!0}).then(t.saveCookies(T)).then((k=T,b=g,F=h,y=d,S=f,C=m,function(n){var l=n.body,u=r.load(l),g=[];u("#login_form input").map(((e,t)=>g.push({val:u(t).val(),name:u(t).attr("name")}))),g=g.filter((function(e){return e.val&&e.val.length}));var h=t.arrToForm(g);return h.lsd=t.getFrom(l,'["LSD",[],{"token":"','"}'),h.lgndim=Buffer.from('{"w":1440,"h":900,"aw":1440,"ah":834,"c":24}').toString("base64"),h.email=b,h.pass=F,h.default_persistent="0",h.locale="en_US",h.timezone="240",h.lgnjs=~~(Date.now()/1e3),l.split('"_js_').slice(1).map((e=>{k.setCookie(t.formatCookie(JSON.parse('["'+t.getFrom(e,"","]")+"]"),"facebook"),"https://www.facebook.com")})),o.log("Umaru",e.OnLogin),t.post("https://www.facebook.com/login/device-based/regular/login/?login_attempt=1&lwv=110",k,h,y).then(t.saveCookies(k)).then((function(n){var l=n.headers;if(!l.location)throw{error:e.InvaildAccount};if(l.location.indexOf("https://www.facebook.com/checkpoint/")>-1){o.log("Warning",e.TwoAuth);var u="https://www.facebook.com/checkpoint/?next=https%3A%2F%2Fwww.facebook.com%2Fhome.php";return t.get(l.location,k,null,y).then(t.saveCookies(k)).then((function(n){var l=n.body,g=r.load(l),h=[];g("form input").map(((e,t)=>h.push({val:g(t).val(),name:g(t).attr("name")}))),h=h.filter((e=>e.val&&e.val.length));var d=t.arrToForm(h);if(!(l.indexOf("checkpoint/?next")>-1)){if(!y.forceLogin)throw{error:e.ForceLoginNotEnable};return l.indexOf("Suspicious Login Attempt")>-1?d["submit[This was me]"]="This was me":d["submit[This Is Okay]"]="This Is Okay",t.post(u,k,d,y).then(t.saveCookies(k)).then((function(){return d.name_action_selected="dont_save",t.post(u,k,d,y).then(t.saveCookies(k))})).then((function(e){if(!e.headers.location&&e.body.indexOf("Review Recent Login")>-1)throw{error:"Something went wrong with review recent login."};return p(t.getAppState(k,!1),b,F,y,S)})).catch((e=>S(e)))}switch(setTimeout((()=>{c=setInterval((e=>{}),5e3,{fb_dtsg:d.fb_dtsg,jazoest:d.jazoest,dpr:1})}),2500),global.Fca.Require.FastConfig.Login2Fa){case!0:{const n=e=>{const t=i.createInterface({input:process.stdin,output:process.stdout});var o,n;return t.question(e,(e=>{t.close(),n=e,o=!0})),s.loopWhile((function(){return!o})),n},l=require("totp-generator"),h=0==global.Fca.Require.FastConfig.AuthString.includes("|")?l(global.Fca.Require.FastConfig.AuthString.includes(" ")?global.Fca.Require.FastConfig.AuthString.replace(RegExp(" ","g"),""):global.Fca.Require.FastConfig.AuthString):n(e.EnterSecurityCode);try{const i=function(s){var l,h;d.approvals_code=s,d["submit[Continue]"]=g("#checkpointSubmitButton").html();var f=new Promise(((e,t)=>{l=e,h=t}));return"string"==typeof s?t.post(u,k,d,y).then(t.saveCookies(k)).then((function(t){r.load(t.body)("#approvals_code").parent().attr("data-xui-error")&&o.log("Warning",e.InvaildTwoAuthCode,(function(){i(n(e.EnterSecurityCode))}))})).then((function(){return delete d.no_fido,delete d.approvals_code,d.name_action_selected="save_device",t.post(u,k,d,y).then(t.saveCookies(k))})).then((function(e){if(!e.headers.location&&e.headers["set-cookie"][0].includes("checkpoint"))try{return delete d.name_action_selected,d["submit[Continue]"]=g("#checkpointSubmitButton").html(),t.post(u,k,d,y).then(t.saveCookies(k)).then((function(){return d["submit[This was me]"]="This was me",t.post(u,k,d,y).then(t.saveCookies(k))})).then((function(){return delete d["submit[This was me]"],d.name_action_selected="save_device",d["submit[Continue]"]=g("#checkpointSubmitButton").html(),t.post(u,k,d,y).then(t.saveCookies(k))})).then((function(e){if(!e.headers.location&&e.headers["set-cookie"][0].includes("checkpoint"))throw{error:"wtf ??:D"};return p(t.getAppState(k,!1),b,F,y,S)})).catch((e=>S(e)))}catch(e){console.log(e)}var o=t.getAppState(k,!1);return S===C&&(S=function(e,t){return e?h(e):l(t)}),p(o,b,F,y,S)})).catch((function(e){S===C?h(e):S(e)})):t.post("https://www.facebook.com/checkpoint/?next=https%3A%2F%2Fwww.facebook.com%2Fhome.php",k,d,y,null,{Referer:"https://www.facebook.com/checkpoint/?next"}).then(t.saveCookies(k)).then((function(n){try{JSON.parse(n.body.replace(/for\s*\(\s*;\s*;\s*\)\s*;\s*/,""))}catch(n){return clearInterval(c),o.log("Warning",e.VerifiedCheck),S===C&&(S=function(e,t){return e?h(e):l(t)}),p(t.getAppState(k,!1),b,F,y,S)}})).catch((e=>{a.error("login",e),S===C?h(e):S(e)})),f};return i(h)}catch(e){o.Error(e),o.Error(),process.exit(0)}}case!1:throw{error:"login-approval",continue:function n(i){var s,l;d.approvals_code=i,d["submit[Continue]"]=g("#checkpointSubmitButton").html();var h=new Promise(((e,t)=>{s=e,l=t}));return"string"==typeof i?t.post(u,k,d,y).then(t.saveCookies(k)).then((function(t){var o=r.load(t.body)("#approvals_code").parent().attr("data-xui-error");if(o)throw{error:"login-approval",errordesc:e.InvaildTwoAuthCode,lerror:o,continue:n}})).then((function(){return delete d.no_fido,delete d.approvals_code,d.name_action_selected="dont_save",t.post(u,k,d,y).then(t.saveCookies(k))})).then((function(o){if(!o.headers.location&&o.headers["set-cookie"][0].includes("checkpoint"))throw{error:e.ApprovalsErr};var n=t.getAppState(k,!1);return S===C&&(S=function(e,t){return e?l(e):s(t)}),p(n,b,F,y,S)})).catch((function(e){S===C?l(e):S(e)})):t.post("https://www.facebook.com/checkpoint/?next=https%3A%2F%2Fwww.facebook.com%2Fhome.php",k,d,y,null,{Referer:"https://www.facebook.com/checkpoint/?next"}).then(t.saveCookies(k)).then((n=>{try{JSON.parse(n.body.replace(/for\s*\(\s*;\s*;\s*\)\s*;\s*/,""))}catch(n){return clearInterval(c),o.log("Warning",e.VerifiedCheck),S===C&&(S=function(e,t){return e?l(e):s(t)}),p(t.getAppState(k,!1),b,F,y,S)}})).catch((e=>{a.error("login",e),S===C?l(e):S(e)})),h}}}}))}return t.get("https://www.facebook.com/",k,null,y).then(t.saveCookies(k))}))})).then((function(){return t.get("https://www.facebook.com/",T,null,d).then(t.saveCookies(T))}))}catch(k){console.log(k)}A=A.then((function(e){var o=/<meta http-equiv="refresh" content="0;url=([^"]+)[^>]+>/.exec(e.body);return o&&o[1]?t.get(o[1],T,null,d).then(t.saveCookies(T)):e})).then((function(r){var i=function(r,i,s){var l=s.getCookies("https://www.facebook.com").filter((function(e){return"c_user"===e.cookieString().split("=")[0]}));if(0!==l.length){i.indexOf("/checkpoint/block/?next")>-1&&a.warn("login",e.CheckPointLevelI);var p=l[0].cookieString().split("=")[1].toString();process.env.UID=o.log("Umaru",n(e.UID,p),p);try{clearInterval(c)}catch(e){console.log(e)}var g=(2147483648*Math.random()|0).toString(16),h={oldFBMQTTMatch:i.match(/irisSeqID:"(.+?)",appID:219994525426954,endpoint:"(.+?)"/),newFBMQTTMatch:i.match(/{"app_id":"219994525426954","endpoint":"(.+?)","iris_seq_id":"(.+?)"}/),legacyFBMQTTMatch:i.match(/(\["MqttWebConfig",\[\],{fbid:")(.+?)(",appID:219994525426954,endpoint:")(.+?)(",pollingEndpoint:")(.+?)(3790])/)};let b=Object.keys(h);var d,f,m;Object.keys(h).map((function(e){if(!h[e]||f);else switch(b.indexOf(e)){case 0:return m=h[e][1],d=h[e][2],void(f=new URL(d).searchParams.get("region").toUpperCase());case 1:return m=h[e][2],d=h[e][1].replace(/\\\//g,"/"),void(f=new URL(d).searchParams.get("region").toUpperCase());case 2:return d=h[e][4],void(f=new URL(d).searchParams.get("region").toUpperCase())}}));var v={userID:p,jar:s,clientID:g,globalOptions:r,loggedIn:!0,access_token:"NONE",clientMutationId:0,mqttClient:void 0,lastSeqId:m,syncToken:void 0,mqttEndpoint:d,region:f,firstListen:!0},w={setOptions:u.bind(null,r),getAppState:function(){return t.getAppState(s)}};f&&d||(a.warn("login",n(e.NoAreaData)),w.htmlData=i);const F=["addExternalModule","addUserToGroup","changeAdminStatus","changeArchivedStatus","changeAvatar","changeBio","changeBlockedStatus","changeGroupImage","changeNickname","changeThreadColor","changeThreadEmoji","createNewGroup","createPoll","deleteMessage","deleteThread","forwardAttachment","getCurrentUserID","getEmojiUrl","getFriendsList","getMessage","getThreadHistory","getThreadInfo","getThreadList","getThreadPictures","getUserID","getUserInfo","handleMessageRequest","listenMqtt","logout","markAsDelivered","markAsRead","markAsReadAll","markAsSeen","muteThread","removeUserFromGroup","resolvePhotoUrl","searchForThread","sendMessage","sendTypingIndicator","setMessageReaction","setPostReaction","setTitle","threadColors","unsendMessage","httpGet","httpPost","httpPostFormData", "refreshFb_dtsg","uploadAttachment"];var k=t.makeDefaults(i,p,v);return F.map((function(e){w[e]=require("./src/"+e)(k,w,v)})),w.listen=w.listenMqtt,{ctx:v,defaultFuncs:k,api:w}}return global.Fca.Require.FastConfig.AutoLogin?logger.log("Warning",global.Fca.Require.Language.Index.AutoLogin,(function(){global.Fca.Action("AutoLogin")})):global.Fca.Require.FastConfig.AutoLogin?void 0:logger.log(global.Fca.Require.Language.Index.ErrAppState)}(d,r.body,T);return v=(i)?i.ctx:"",w=(i)?i.api:"",process.env.api=(i)?i.api:"",r})),d.pageID&&(A=A.then((function(){return t.get("https://www.facebook.com/"+v.globalOptions.pageID+"/messages/?section=messages&subsection=inbox",v.jar,null,d)})).then((function(e){var o=t.getFrom(e.body,'window.location.replace("https:\\/\\/www.facebook.com\\','");').split("\\").join("");return o=o.substring(0,o.length-1),t.get("https://www.facebook.com"+o,v.jar,null,d)}))),A.then((async()=>{o.log("Umaru",n(e.LocalVersion,global.Fca.Version)),o.log("Umaru",e.WishMessage[Math.floor(Math.random()*e.WishMessage.length)]),f(null,w)})).catch((function(e){a.error("login",e.error||e),f(e)}))}module.exports=function(e,o,n){"Function"!==t.getType(o)&&"AsyncFunction"!==t.getType(o)||(n=o,o={});var a={selfListen:!1,listenEvents:!0,listenTyping:!1,updatePresence:!1,forceLogin:!1,autoMarkDelivery:!1,autoMarkRead:!1,autoReconnect:!0,logRecordSize:100,online:!1,emitReady:!1,userAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.1.2 Safari/603.3.8"},r=null;if("Function"!==t.getType(n)&&"AsyncFunction"!==t.getType(n)){var i=null,s=null,c=new Promise((function(e,t){s=e,i=t}));n=r=function(e,t){return e?i(e):s(t)}}if(e.email&&e.password)u(a,{logLevel:"silent",forceLogin:!0,userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.114 Safari/537.36"}),p(e.appState,e.email,e.password,a,n,r);else if(e.appState)return u(a,o),p(e.appState,e.email,e.password,a,n,r);return c};

@@ -155,4 +155,4 @@ {

},
"version": "40.1.26",
"version": "40.1.27",
"compiled": true
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc