diff options
| author | flawedworld <38294951+flawedworld@users.noreply.github.com> | 2021-03-01 19:55:57 +0000 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2021-03-01 15:25:42 -0500 |
| commit | 3e44e17ea83486699c9aa5aeb65a2a4904ba4ee9 (patch) | |
| tree | 87ba849b5f31302334c5443da65f075cc31b6488 /static/js | |
| parent | 780f47e61eab6e0928fe1e693581f9cf84b67871 (diff) | |
Add ability to remove non-stock key via WebUSB.
Diffstat (limited to 'static/js')
| -rw-r--r-- | static/js/web-install.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/static/js/web-install.js b/static/js/web-install.js index 9571b49f..9b88502e 100644 --- a/static/js/web-install.js +++ b/static/js/web-install.js @@ -207,6 +207,19 @@ async function flashRelease(setProgress) { return `Flashed ${latestZip} to device.`; } +async function eraseNonStockKey(setProgress) { + await ensureConnected(setProgress); + + setProgress("Erasing key..."); + try { + await device.runCommand("erase:avb_custom_key"); + } catch (error) { + console.log(error); + throw error; + } + return "Key erased."; +} + async function lockBootloader(setProgress) { await ensureConnected(setProgress); @@ -281,6 +294,7 @@ if ("usb" in navigator) { addButtonHook("download-release", downloadRelease); addButtonHook("flash-release", flashRelease); addButtonHook("lock-bootloader", lockBootloader); + addButtonHook("remove-custom-key", eraseNonStockKey); } else { console.log("WebUSB unavailable"); } |
