Skip to content

Commit

Permalink
Update LLU version and user agent, shuffle Ciphers
Browse files Browse the repository at this point in the history
  • Loading branch information
timoschlueter committed Apr 5, 2024
1 parent 6c53220 commit f5310f6
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,7 +77,7 @@ axios.interceptors.response.use(response =>
return error;
});

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 Credentials
Expand All @@ -82,7 +88,7 @@ const LINK_UP_PASSWORD = process.env.LINK_UP_PASSWORD;
/**
* 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 LINK_UP_REGION = process.env.LINK_UP_REGION || "EU";
const LIBRE_LINK_UP_URL = getLibreLinkUpUrl(LINK_UP_REGION);
Expand Down Expand Up @@ -165,7 +171,7 @@ export async function login(): Promise<AuthTicket | null>
httpAgent: cookieAgent,
httpsAgent: stealthHttpsAgent
});

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

0 comments on commit f5310f6

Please sign in to comment.