Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var mobileHeaders = {
- "X-Requested-With": "com.valvesoftware.android.steam.community",
- Referer: "https://steamcommunity.com/mobilelogin?oauth_client_id=DE45CD61&oauth_scope=read_profile%20write_profile%20read_client%20write_client",
- "User-Agent": "Mozilla/5.0 (Linux; U; Android 4.1.1; en-us; Google Nexus 4 - 4.1.1 - API 16 - 768x1280 Build/JRO03S) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",
- Accept: "text/javascript, text/html, application/xml, text/xml, */*"
- };
- this._setCookie(Request.cookie("mobileClientVersion=0 (2.1.3)"));
- this._setCookie(Request.cookie("mobileClient=android"));
- this.httpRequestPost("https://steamcommunity.com/login/getrsakey/", {
- form: {
- username: details.accountName
- },
- headers: mobileHeaders,
- json: true
- }, function(a, b, c) {
- if (a) {
- deleteMobileCookies();
- callback(a);
- return;
- }
- if (!c.publickey_mod || !c.publickey_exp) {
- deleteMobileCookies();
- callback(new Error("Invalid RSA key received"));
- return;
- }
- var d = new RSA();
- d.setPublic(c.publickey_mod, c.publickey_exp);
- self.httpRequestPost({
- uri: "https://steamcommunity.com/login/dologin/",
- json: true,
- form: {
- captcha_text: details.captcha || "",
- captchagid: self._captchaGid,
- emailauth: details.authCode || "",
- emailsteamid: "",
- password: hex2b64(d.encrypt(details.password)),
- remember_login: "true",
- rsatimestamp: c.timestamp,
- twofactorcode: details.twoFactorCode || "",
- username: details.accountName,
- oauth_client_id: "DE45CD61",
- oauth_scope: "read_profile write_profile read_client write_client",
- loginfriendlyname: "#login_emailauth_friendlyname_mobile",
- donotcache: Date.now()
- },
- headers: mobileHeaders
- }, function(a, b, c) {
- deleteMobileCookies();
- if (a) {
- callback(a);
- return;
- }
- var d;
- if (!c.success && c.emailauth_needed) {
- d = new Error("SteamGuard");
- d.emaildomain = c.emaildomain;
- callback(d);
- } else if (!c.success && c.requires_twofactor) callback(new Error("SteamGuardMobile")); else if (!c.success && c.captcha_needed && c.message.match(/Please verify your humanity/)) {
- d = new Error("CAPTCHA");
- d.captchaurl = "https://steamcommunity.com/login/rendercaptcha/?gid=" + c.captcha_gid;
- self._captchaGid = c.captcha_gid;
- callback(d);
- } else if (!c.success) callback(new Error(c.message || "Unknown error")); else if (!c.oauth) callback(new Error("Malformed response")); else {
- var e = generateSessionID();
- var f = JSON.parse(c.oauth);
- self._setCookie(Request.cookie("sessionid=" + e));
- self.steamID = new SteamID(f.steamid);
- self.oAuthToken = f.oauth_token;
- var g = self._jar.getCookieString("https://steamcommunity.com").split(";").map(function(a) {
- return a.trim();
- });
- var h = null;
- for (var i = 0; i < g.length; i++) {
- var j = g[i].split("=");
- if (j[0] == "steamMachineAuth" + self.steamID) {
- h = self.steamID.toString() + "||" + decodeURIComponent(j[1]);
- break;
- }
- }
- self.setCookies(g);
- callback(null, e, g, h, f.oauth_token);
- }
- }, "steamcommunity");
- }, "steamcommunity");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement