Skip to content

Commit

Permalink
Merge pull request #134 from timoschlueter/feature/shuffle-ciphers
Browse files Browse the repository at this point in the history
Update LLU version and user agent, shuffle Ciphers
  • Loading branch information
timoschlueter committed May 14, 2024
2 parents f685250 + f5310f6 commit d6ae622
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,18 @@ import {Agent as HttpAgent} from "node:http";
import {Agent as HttpsAgent} from "node:https";
import * as crypto from "crypto";

// Generate new Cyphers for stealth mode in order to bypass SSL fingerprinting used by Cloudflare.
// The new Cyphers are then used in the HTTPS Agent for Axios.
const defaultCyphers: Array<string> = crypto.constants.defaultCipherList.split(":");
const stealthCyphers: Array<string> = defaultCyphers.slice(0, 3);
// Generate new Ciphers for stealth mode in order to bypass SSL fingerprinting used by Cloudflare.
// The new Ciphers are then used in the HTTPS Agent for Axios.
const defaultCiphers: Array<string> = crypto.constants.defaultCipherList.split(":");
const stealthCiphers: Array<string> = [
defaultCiphers[0],
defaultCiphers[2],
defaultCiphers[1],
...defaultCiphers.slice(3)
];

const stealthHttpsAgent: HttpsAgent = new HttpsAgent({
ciphers: stealthCyphers.join(":")
ciphers: stealthCiphers.join(":")
});

// Create a new CookieJar and HttpCookieAgent for Axios to handle cookies.
Expand Down Expand Up @@ -71,12 +77,12 @@ axios.interceptors.response.use(
}
);

const USER_AGENT = "Mozilla/5.0 (iPhone; CPU iPhone OS 16_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5 Mobile/15E148 Safari/604.1";
const USER_AGENT = "Mozilla/5.0 (iPhone; CPU OS 17_4.1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/17.4.1 Mobile/10A5355d Safari/8536.25";

/**
* LibreLink Up API Settings (Don't change this unless you know what you are doing)
*/
const LIBRE_LINK_UP_VERSION = "4.7.0";
const LIBRE_LINK_UP_VERSION = "4.10.0";
const LIBRE_LINK_UP_PRODUCT = "llu.ios";
const LIBRE_LINK_UP_URL = LLU_API_ENDPOINTS[config.linkUpRegion];

Expand Down Expand Up @@ -149,7 +155,7 @@ export async function login(): Promise<AuthTicket | null>
httpAgent: cookieAgent,
httpsAgent: stealthHttpsAgent
});

try
{
if (response.data.status !== 0)
Expand Down

0 comments on commit d6ae622

Please sign in to comment.