You've already forked brave-origin-unlocker
mirror of
https://github.com/ObjectAscended/brave-origin-unlocker.git
synced 2026-06-21 12:42:34 +00:00
Add support for both Beta and Nightly
Skips missing versions to avoid crashes and alerts the user if neither is installed.
This commit is contained in:
@@ -1,22 +1,34 @@
|
|||||||
const localAppData = Deno.env.get("LOCALAPPDATA");
|
const localAppData = Deno.env.get("LOCALAPPDATA");
|
||||||
|
|
||||||
const localStatePath =
|
const versions = ["Brave-Origin-Beta", "Brave-Origin-Nightly"];
|
||||||
`${localAppData}\\BraveSoftware\\Brave-Origin-Beta\\User Data\\Local State`;
|
let foundAny = false;
|
||||||
|
|
||||||
const localState = JSON.parse(await Deno.readTextFile(localStatePath));
|
for (const version of versions) {
|
||||||
|
const localStatePath = localAppData + "\\BraveSoftware\\" + version + "\\User Data\\Local State";
|
||||||
|
|
||||||
localState.brave.origin = { purchase_validated: true };
|
try {
|
||||||
|
const localState = JSON.parse(await Deno.readTextFile(localStatePath));
|
||||||
|
|
||||||
localState.skus = {
|
localState.brave.origin = { purchase_validated: true };
|
||||||
state: {
|
|
||||||
"67": JSON.stringify({
|
localState.skus = {
|
||||||
credentials: {
|
state: {
|
||||||
items: { "6": "7" },
|
"67": JSON.stringify({
|
||||||
|
credentials: {
|
||||||
|
items: { "6": "7" },
|
||||||
|
},
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
}),
|
};
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
await Deno.writeTextFile(localStatePath, JSON.stringify(localState));
|
await Deno.writeTextFile(localStatePath, JSON.stringify(localState));
|
||||||
|
|
||||||
console.log("Brave Origin Beta unlocked successfully!");
|
console.log(version.replace(/-/g, " ") + " unlocked successfully!");
|
||||||
|
foundAny = true;
|
||||||
|
} catch {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!foundAny) {
|
||||||
|
console.log("Brave Origin not found.");
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user