From 46a5966ed35c88be93d23babf604389038bbc535 Mon Sep 17 00:00:00 2001 From: Angelo Trotta Date: Thu, 18 Jun 2026 18:15:57 +0200 Subject: [PATCH] Add support for macOS --- .DS_Store | Bin 0 -> 6148 bytes .gitignore | 1 + .vscode/settings.json | 4 +++ README.md | 58 ++++++++++++++++++++++-------------------- deno.json | 8 ++++++ unlock-mac.ts | 37 +++++++++++++++++++++++++++ 6 files changed, 81 insertions(+), 27 deletions(-) create mode 100644 .DS_Store create mode 100644 .gitignore create mode 100644 .vscode/settings.json create mode 100644 deno.json create mode 100644 unlock-mac.ts diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..f5516d8f235b3a77fc7795feeaa88941854860e8 GIT binary patch literal 6148 zcmeHKO>7%Q6n@Wfo87KTCncrfC-Q94dCZ#`S*E_VUu6K=R zZ5N^lb8Uem2m$I1K@Yt^pm0Ls0um<#2zo-|$_0rt;?0jEqQIpGgsOegyl>u{_h$Ef zyF0T309fq?QveJAENT+-TS)zb$Z^>=NX~dh2vN@A_eI-}5})jw8=^Bu#z4lv|BV6p z?dBnX5Co)u|9<^;6pFN5{t?EI*nyQ5+uBjw^VD49Qq+o*E1E#0^+w57gG0DVowa%*(KG8&?#8g5Tf=(nEsnFb z@XWJEjvhPSV5}?n9FM#-?C}{d<)Xp12`cYMGl^$Ayhmj%Hj}8^ifLr5=|#;h1@l8u zR1aU#(ala0MYD+r(=droFQxo)D#zqR>xPz|7fC0rsmYc?nqNn4m)AJimdWB2?+8NM z{`szLY;618<2&xz={~%B&%P&~KD5+KS}h)@Vj=Q;9xe8C?3sXWr`F-5gLy&MJu4k2 zk|2CBB+n({em?eE{JeA@_e6TK&0`*XKXLDU_dhV{6c#9eUtZ{kL3;7DCz?DC!uY~s zFBG94aW*=JCEHTb4?g4+*d`VjbJrteZf3`f`Dm$7U^%vG>EQBI!C@oJvuu^SzeFY) zWBN(QVR289a>7;VjN! z9p~{JHqb*Kn;2n?ZF~tkxQr|KDh}{9yn?Ue8~7%^jql*Q_#VEGAK-`h5njiSaTPzq zoA^0?fnVXb_ygX;U-doahHvqSwR=__{DWZaE$-Djag@Xt$Ty5%AAY-*nay%;cY-W0 zV<2PTj%7fu4=y!{6@vqfYUv=QjsS#tax0;}JWI$N*I>oqKqHNipiU*!sdBB>ew9vs z*Vq+<1C2Tz&>TL{Tp7&?1$8>0tHJ>*8Z(_SkTI~H0r~Gw!sPycn7-kEIsdDmOl1sY z4BVLvV1A}PQ>EI>-nyYmx!1bXUZ5sL#tk&86jEk8Rvoz&Pf$}rW3KEFRtyd_l7}Sw O5l}Q_Dr4Y3W#BI^!T<08 literal 0 HcmV?d00001 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7773828 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +dist/ \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..e1533c2 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "deno.enable": true, + "deno.lint": true +} diff --git a/README.md b/README.md index 8ae22d2..bbba01d 100644 --- a/README.md +++ b/README.md @@ -1,58 +1,62 @@ -# Brave Origin Windows Unlocker +# Brave Origin Unlocker -A TypeScript utility for unlocking Brave Origin features on Windows by modifying -the local application state. +A TypeScript utility for unlocking Brave Origin features on Windows and macOS by modifying the local application state. ## Overview -This tool modifies the Brave Origin browser's local state configuration to -unlock premium features. It works by updating the `Local State` JSON file used -by Brave to store user preferences and license validation status. +This tool modifies the Brave Origin browser's local state configuration to unlock premium features. It works by updating the `Local State` JSON file used by Brave to store user preferences and license validation status. ## Features - ✅ Unlocks Brave Origin features - ✅ Modifies purchase validation state - ✅ Updates SKU credentials -- ✅ Windows-compatible local data path handling +- ✅ Windows and macOS path compatibility +- ✅ Easy execution via Deno tasks ## Requirements - **Deno** - Modern JavaScript/TypeScript runtime -- **Windows OS** - Designed for Windows file paths +- **Windows OS or macOS** - Supported operating systems - **Brave Origin** - The browser being modified -- **File Write Permissions** - Access to `%LOCALAPPDATA%` directory +- **File Write Permissions** - Access to browser configurations ## Installation -1. Install [Deno](https://deno.land/) if you haven't already +1. Install [Deno](https://deno.land/) if you haven't already. 2. Clone this repository: ```bash git clone https://github.com/ObjectAscended/brave-origin-windows-unlocker.git cd brave-origin-windows-unlocker ``` +## How to Run 🚀 + +You can run the unlocker directly using the pre-configured Deno tasks: + +### For Windows 🪟 +```bash +deno task unlock-win +``` + +### For macOS 🍎 +```bash +deno task unlock-mac +``` + +--- + ## Pre-Bundled Deno Binaries 🎉 -In our latest releases, we offer **pre-bundled Deno binaries** that make running -the Windows unlocker easier than ever! 🚀 You can download them from our -[latest release page](https://github.com/ObjectAscended/brave-origin-windows-unlocker/releases/latest). -These binaries ensure a smooth setup and save you time, so you can focus on -enjoying your experience without unnecessary hassle! 🕒 +In our latest releases, we offer **pre-bundled Deno binaries** that make running the unlocker easier than ever! 🚀 You can download them from our [latest release page](https://github.com/ObjectAscended/brave-origin-windows-unlocker/releases/latest). These binaries ensure a smooth setup and save you time. -## Why Run the Windows Unlocker Instead of WSL? 🤔 +## Why Run the Unlocker Natively? 🤔 -Running the Windows unlocker natively is typically a better choice than running -a browser inside WSL. Here's why: +Running the unlocker natively is typically a better choice than running a browser inside virtual/emulated environments. Here's why: -1. **Performance**: The native Windows experience generally offers better - performance than emulated environments like WSL. ⚡ -2. **Simplicity**: You avoid complex setups and configurations, making it more - straightforward for users of all levels. 🛠️ -3. **Compatibility**: Some features and functionalities might only work - seamlessly in a Windows environment, ensuring you get the most out of your - tools. 🔗 -4. **User Experience**: Enjoy a more intuitive interface and fewer problems - managing dependencies. 😊 +1. **Performance**: The native experience generally offers better performance than emulated environments. ⚡ +2. **Simplicity**: You avoid complex setups and configurations, making it more straightforward for users of all levels. 🛠️ +3. **Compatibility**: Some features and functionalities might only work seamlessly in a native environment, ensuring you get the most out of your tools. 🔗 +4. **User Experience**: Enjoy a more intuitive interface and fewer problems managing dependencies. 😊 Enjoy using our tool! 🎈 diff --git a/deno.json b/deno.json new file mode 100644 index 0000000..ce23f61 --- /dev/null +++ b/deno.json @@ -0,0 +1,8 @@ +{ + "tasks": { + "unlock-win": "deno run --allow-env --allow-read --allow-write unlock.ts", + "unlock-mac": "deno run --allow-env --allow-read --allow-write unlock-mac.ts", + "compile-win": "deno compile --allow-env --allow-read --allow-write --output dist/unlock-win.exe unlock.ts", + "compile-mac": "deno compile --allow-env --allow-read --allow-write --output dist/unlock-mac unlock-mac.ts" + } +} \ No newline at end of file diff --git a/unlock-mac.ts b/unlock-mac.ts new file mode 100644 index 0000000..2aa6735 --- /dev/null +++ b/unlock-mac.ts @@ -0,0 +1,37 @@ +const homeDir = Deno.env.get("HOME"); +const versions = ["Brave-Origin", "Brave-Origin-Beta", "Brave-Origin-Nightly"]; +let foundAny = false; + +for (const version of versions) { + const localStatePath = `${homeDir}/Library/Application Support/BraveSoftware/${version}/Local State`; + + try { + const localState = JSON.parse(await Deno.readTextFile(localStatePath)); + + localState.brave = localState.brave || {}; + localState.brave.origin = { purchase_validated: true }; + + localState.skus = { + state: { + "67": JSON.stringify({ + credentials: { + items: { "6": "7" }, + }, + }), + }, + }; + + await Deno.writeTextFile(localStatePath, JSON.stringify(localState)); + console.log(version.replace(/-/g, " ") + " unlocked successfully!"); + foundAny = true; + } catch (error) { + if (error instanceof Deno.errors.NotFound) { + continue; + } + throw error; + } +} + +if (!foundAny) { + console.log("Brave Origin not found."); +} \ No newline at end of file