From 46a5966ed35c88be93d23babf604389038bbc535 Mon Sep 17 00:00:00 2001 From: Angelo Trotta Date: Thu, 18 Jun 2026 18:15:57 +0200 Subject: [PATCH 1/4] 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 From 386611bc3a55a85fa8c3dacddd064e05a129dbea Mon Sep 17 00:00:00 2001 From: Angelo Trotta Date: Thu, 18 Jun 2026 18:26:07 +0200 Subject: [PATCH 2/4] Cleanup .vscode folder --- .gitignore | 4 +++- .vscode/settings.json | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 7773828..f0866fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -dist/ \ No newline at end of file +dist/ +.vscode/ +.DS_Store \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index e1533c2..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "deno.enable": true, - "deno.lint": true -} From 27a4a172cb1871fcd5615e5cdce6b0aae218f88c Mon Sep 17 00:00:00 2001 From: Angelo Trotta Date: Fri, 19 Jun 2026 09:29:51 +0200 Subject: [PATCH 3/4] refactor macos support into single file --- README.md | 31 ++++++++++++++++++++++++------- deno.json | 8 ++++---- unlock-mac.ts | 37 ------------------------------------- unlock.ts | 29 ++++++++++++++++++++++++++--- 4 files changed, 54 insertions(+), 51 deletions(-) delete mode 100644 unlock-mac.ts diff --git a/README.md b/README.md index bbba01d..1152b3f 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,8 @@ This tool modifies the Brave Origin browser's local state configuration to unloc - ✅ Unlocks Brave Origin features - ✅ Modifies purchase validation state - ✅ Updates SKU credentials -- ✅ Windows and macOS path compatibility -- ✅ Easy execution via Deno tasks +- ✅ Windows and macOS auto-detection & compatibility +- ✅ Easy execution and cross-compilation via Deno tasks ## Requirements @@ -32,18 +32,35 @@ This tool modifies the Brave Origin browser's local state configuration to unloc ## How to Run 🚀 -You can run the unlocker directly using the pre-configured Deno tasks: +The script automatically detects whether you are running on Windows or macOS. You can run the unlocker directly with: -### For Windows 🪟 ```bash -deno task unlock-win +deno task unlock ``` -### For macOS 🍎 +--- + +## How to Compile / Cross-Compile 📦 + +You can build standalone binaries for different operating systems and architectures using the pre-configured compilation tasks: + +### Compile for Windows (x64) ```bash -deno task unlock-mac +deno task compile-win ``` +### Compile for macOS Apple Silicon (ARM64) +```bash +deno task compile-mac-arm +``` + +### Compile for macOS Intel (x64) +```bash +deno task compile-mac-x64 +``` + +These tasks will output the built binaries into the `dist/` directory. + --- ## Pre-Bundled Deno Binaries 🎉 diff --git a/deno.json b/deno.json index ce23f61..d72c1db 100644 --- a/deno.json +++ b/deno.json @@ -1,8 +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" + "unlock": "deno run --allow-env --allow-read --allow-write unlock.ts", + "compile-win": "deno compile --allow-env --allow-read --allow-write --target x86_64-pc-windows-msvc --output dist/unlock-win.exe unlock.ts", + "compile-mac-arm": "deno compile --allow-env --allow-read --allow-write --target aarch64-apple-darwin --output dist/unlock-mac-arm unlock.ts", + "compile-mac-x64": "deno compile --allow-env --allow-read --allow-write --target x86_64-apple-darwin --output dist/unlock-mac-x64 unlock.ts" } } \ No newline at end of file diff --git a/unlock-mac.ts b/unlock-mac.ts deleted file mode 100644 index 2aa6735..0000000 --- a/unlock-mac.ts +++ /dev/null @@ -1,37 +0,0 @@ -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 diff --git a/unlock.ts b/unlock.ts index 494e2cd..043acfa 100644 --- a/unlock.ts +++ b/unlock.ts @@ -1,15 +1,38 @@ -const localAppData = Deno.env.get("LOCALAPPDATA"); +const os = Deno.build.os; + +let localStatePathPattern: (version: string) => string; + +if (os === "windows") { + const localAppData = Deno.env.get("LOCALAPPDATA"); + if (!localAppData) { + console.error("Error: LOCALAPPDATA environment variable not found."); + Deno.exit(1); + } + localStatePathPattern = (version) => + `${localAppData}\\BraveSoftware\\${version}\\User Data\\Local State`; +} else if (os === "darwin") { + const homeDir = Deno.env.get("HOME"); + if (!homeDir) { + console.error("Error: HOME environment variable not found."); + Deno.exit(1); + } + localStatePathPattern = (version) => + `${homeDir}/Library/Application Support/BraveSoftware/${version}/Local State`; +} else { + console.error(`Error: Unsupported operating system: ${os}`); + Deno.exit(1); +} const versions = ["Brave-Origin", "Brave-Origin-Beta", "Brave-Origin-Nightly"]; let foundAny = false; for (const version of versions) { - const localStatePath = - `${localAppData}\\BraveSoftware\\${version}\\User Data\\Local State`; + const localStatePath = localStatePathPattern(version); try { const localState = JSON.parse(await Deno.readTextFile(localStatePath)); + localState.brave = localState.brave || {}; localState.brave.origin = { purchase_validated: true }; localState.skus = { From 4ffaca5fcc3d223821108cbc9879bac473d9b2f8 Mon Sep 17 00:00:00 2001 From: Angelo Trotta <111277410+ShyVortex@users.noreply.github.com> Date: Fri, 19 Jun 2026 09:34:04 +0200 Subject: [PATCH 4/4] Cleanup .DS_Store --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index f5516d8f235b3a77fc7795feeaa88941854860e8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 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