From f7c0ce5d57fd25d1894712b2a9c317d5025eebdb Mon Sep 17 00:00:00 2001 From: mid-kid Date: Sat, 26 Oct 2024 01:39:27 +0200 Subject: [PATCH] Add script to generate prism launcher accounts.json --- prism/genaccounts.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 prism/genaccounts.py diff --git a/prism/genaccounts.py b/prism/genaccounts.py new file mode 100755 index 0000000..6ca6219 --- /dev/null +++ b/prism/genaccounts.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 +# Generates accounts.json suitable for this service + +import binascii +import hashlib +import json + +user = "mid-kid" + +uuid = binascii.hexlify(bytes(eval("x"+{6:"&0xf|0x30",8:"&0x3f|0x80"}.get(i,""))for i,x in enumerate(hashlib.md5(("OfflinePlayer:%s"%user).encode()).digest()))).decode() +token = "penispenis123" + +accounts = { + "formatVersion": 3, + "accounts": [ + { + "type": "MSA", + "entitlement": { + "canPlayMinecraft": True, + "ownsMinecraft": True + } + }, + { + "active": True, + "type": "Offline", + "profile": { + "id": uuid, + "name": user, + "capes": [], + "skin": {"id": "", "url": "", "variant": ""} + }, + "ygg": { + "token": token + } + } + ] +} + +print(json.dumps(accounts, separators=(",", ":")))