mirror of
https://github.com/lordfriky/web-cfw-loader.git
synced 2024-12-28 16:11:55 +00:00
Fixed error preventing uploaded payloads to be sent.
This commit is contained in:
parent
fe5486bf73
commit
2893d85d87
13
main.js
13
main.js
@ -133,6 +133,15 @@ document.getElementById("goButton").addEventListener("click", async () => {
|
|||||||
var debugCheckbox = document.getElementById("shouldDebug");
|
var debugCheckbox = document.getElementById("shouldDebug");
|
||||||
const payloadType = document.getElementById("payloadSelect").value;
|
const payloadType = document.getElementById("payloadSelect").value;
|
||||||
|
|
||||||
|
logOutput("Requesting access to device...");
|
||||||
|
try {
|
||||||
|
device = await navigator.usb.requestDevice({ filters: [{ vendorId: 0x0955 }] });
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
logOutput("Failed to get a device. Did you chose one?");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let payload;
|
let payload;
|
||||||
if (payloadType === "hekate v5") {
|
if (payloadType === "hekate v5") {
|
||||||
payload = hekate5;
|
payload = hekate5;
|
||||||
@ -157,6 +166,7 @@ document.getElementById("goButton").addEventListener("click", async () => {
|
|||||||
}
|
}
|
||||||
logOutput("Using uploaded payload \"" + file.name + "\"");
|
logOutput("Using uploaded payload \"" + file.name + "\"");
|
||||||
payload = new Uint8Array(await readFileAsArrayBuffer(file));
|
payload = new Uint8Array(await readFileAsArrayBuffer(file));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
logOutput("<span style='color:red'>You're trying to load a payload type that doesn't exist.</span>");
|
logOutput("<span style='color:red'>You're trying to load a payload type that doesn't exist.</span>");
|
||||||
return;
|
return;
|
||||||
@ -174,9 +184,6 @@ document.getElementById("goButton").addEventListener("click", async () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logOutput("Requesting access to device...");
|
|
||||||
device = await navigator.usb.requestDevice({ filters: [{ vendorId: 0x0955 }] });
|
|
||||||
|
|
||||||
logOutput(`<span style='color:blue'>Preparing to launch ${payloadType}...</span>`);
|
logOutput(`<span style='color:blue'>Preparing to launch ${payloadType}...</span>`);
|
||||||
launchPayload(payload);
|
launchPayload(payload);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user