Add support for macOS

This commit is contained in:
Angelo Trotta
2026-06-18 18:15:57 +02:00
parent ba5de278ee
commit 46a5966ed3
6 changed files with 81 additions and 27 deletions
Vendored
BIN
View File
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
dist/
+4
View File
@@ -0,0 +1,4 @@
{
"deno.enable": true,
"deno.lint": true
}
+31 -27
View File
@@ -1,58 +1,62 @@
# Brave Origin Windows Unlocker # Brave Origin Unlocker
A TypeScript utility for unlocking Brave Origin features on Windows by modifying A TypeScript utility for unlocking Brave Origin features on Windows and macOS by modifying the local application state.
the local application state.
## Overview ## Overview
This tool modifies the Brave Origin browser's local state configuration to 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.
unlock premium features. It works by updating the `Local State` JSON file used
by Brave to store user preferences and license validation status.
## Features ## Features
- ✅ Unlocks Brave Origin features - ✅ Unlocks Brave Origin features
- ✅ Modifies purchase validation state - ✅ Modifies purchase validation state
- ✅ Updates SKU credentials - ✅ Updates SKU credentials
- ✅ Windows-compatible local data path handling - ✅ Windows and macOS path compatibility
- ✅ Easy execution via Deno tasks
## Requirements ## Requirements
- **Deno** - Modern JavaScript/TypeScript runtime - **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 - **Brave Origin** - The browser being modified
- **File Write Permissions** - Access to `%LOCALAPPDATA%` directory - **File Write Permissions** - Access to browser configurations
## Installation ## 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: 2. Clone this repository:
```bash ```bash
git clone https://github.com/ObjectAscended/brave-origin-windows-unlocker.git git clone https://github.com/ObjectAscended/brave-origin-windows-unlocker.git
cd brave-origin-windows-unlocker 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 🎉 ## Pre-Bundled Deno Binaries 🎉
In our latest releases, we offer **pre-bundled Deno binaries** that make running 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.
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! 🕒
## 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 Running the unlocker natively is typically a better choice than running a browser inside virtual/emulated environments. Here's why:
a browser inside WSL. Here's why:
1. **Performance**: The native Windows experience generally offers better 1. **Performance**: The native experience generally offers better performance than emulated environments. ⚡
performance than emulated environments like WSL. ⚡ 2. **Simplicity**: You avoid complex setups and configurations, making it more straightforward for users of all levels. 🛠️
2. **Simplicity**: You avoid complex setups and configurations, making it more 3. **Compatibility**: Some features and functionalities might only work seamlessly in a native environment, ensuring you get the most out of your tools. 🔗
straightforward for users of all levels. 🛠️ 4. **User Experience**: Enjoy a more intuitive interface and fewer problems managing dependencies. 😊
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. 😊
Enjoy using our tool! 🎈 Enjoy using our tool! 🎈
+8
View File
@@ -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"
}
}
+37
View File
@@ -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.");
}