diff --git a/README.md b/README.md index d0368d2..be362d7 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,4 @@ Fusee Launcher, in a browser! # Description -This is a port of [fusee-launcher](https://github.com/reswitched/fusee-launcher) to JavaScript using WebUSB. This has been mildly tested and appears to work on Linux, Android (unrooted), OSX and ChromeOS. Today, this only works on Chrome because only Chrome implements WebUSB. It also does NOT work on Windows because the WebUSB Windows implementation does not allow sending the required USB packet. - -# Try it out -Either use a web server to host the files (must be on https!) or you can try the [demo](https://atlas44.s3-us-west-2.amazonaws.com/web-fusee-launcher/index.html). +This is a fork of [web-fusee-launcher](https://github.com/atlas44/web-fusee-launcher), which is a port of [fusee-launcher](https://github.com/reswitched/fusee-launcher) to JavaScript using WebUSB. This has been mildly tested and appears to work on Linux, Android (unrooted), OSX and ChromeOS. Today, this only works on Chrome because only Chrome implements WebUSB. It also does NOT work on Windows because the WebUSB Windows implementation does not allow sending the required USB packet. diff --git a/gen_bin_js.py b/gen_bin_js.py new file mode 100644 index 0000000..6518738 --- /dev/null +++ b/gen_bin_js.py @@ -0,0 +1,34 @@ +import requests +import io + +API_URL = "https://api.github.com/repos/CTCaer/hekate/releases/latest" +SERIALIZED_FILENAME = "hekate.bin.js" + +## Script that downloads the latest bin from hekate and serializes it as a .bin.js file. + +def download_file_to_bytes_io(url) -> io.BytesIO: + r = requests.get(url) + filedata = io.BytesIO() + if r.status_code == 200: + filedata.write(r.content) + filedata.seek(0) + return filedata + +def extract_specific_file_from_zip(): + pass + +def fetch_hekate_zip() -> io.BytesIO: + r = requests.get(API_URL) + jdata = r.json() + return download_file_to_bytes_io([d for d in hekate_json["assets"] if d["name"].startswith("hekate_ctcaer")][0]["browser_download_url"]) + +def get_hekate_payload(hekate_zip: io.BytesIO) -> io.BytesIO: + pass + +def serialize_to_js(hekate_payload: io.BytesIO, filename: str): + pass + +if __name__ == "__main__": + api_response = fetch_hekate_zip() + payload = get_hekate_payload(api_response) + serialize_to_js(payload, SERIALIZED_FILENAME) \ No newline at end of file