simpler to avoid using adb like the current guide

This commit is contained in:
Daniel Micay 2021-01-16 17:28:20 -05:00
parent 3a6ea83559
commit 3f6de4a482
2 changed files with 2 additions and 23 deletions

View File

@ -1,19 +1,5 @@
// @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT // @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT
async function adbRebootBootloader() {
const webusb = await Adb.open("WebUSB");
if (!webusb.isAdb()) {
console.log("error: not in adb mode");
return;
}
console.log("connecting with adb");
const adb = await webusb.connectAdb("host::");
await adb.reboot("bootloader");
}
async function unlockBootloader() { async function unlockBootloader() {
const webusb = await Adb.open("WebUSB"); const webusb = await Adb.open("WebUSB");
@ -75,10 +61,6 @@ async function lockBootloader() {
if ("usb" in navigator) { if ("usb" in navigator) {
console.log("WebUSB available"); console.log("WebUSB available");
const adbRebootBootloaderButton = document.getElementById("adb-reboot-bootloader");
adbRebootBootloaderButton.disabled = false;
adbRebootBootloaderButton.onclick = adbRebootBootloader;
const unlockBootloaderButton = document.getElementById("unlock-bootloader"); const unlockBootloaderButton = document.getElementById("unlock-bootloader");
unlockBootloaderButton.disabled = false; unlockBootloaderButton.disabled = false;
unlockBootloaderButton.onclick = unlockBootloader; unlockBootloaderButton.onclick = unlockBootloader;

View File

@ -27,7 +27,7 @@
<link rel="manifest" href="/manifest.webmanifest"/> <link rel="manifest" href="/manifest.webmanifest"/>
<link rel="license" href="/LICENSE.txt"/> <link rel="license" href="/LICENSE.txt"/>
<script defer="defer" src="/js/webadb.js?0"></script> <script defer="defer" src="/js/webadb.js?0"></script>
<script defer="defer" src="/js/web-install.js?0"></script> <script defer="defer" src="/js/web-install.js?1"></script>
</head> </head>
<body> <body>
<header> <header>
@ -125,10 +125,7 @@
<h2><a href="#unlocking-the-bootloader">Unlocking the bootloader</a></h2> <h2><a href="#unlocking-the-bootloader">Unlocking the bootloader</a></h2>
<p>First, boot into the bootloader interface. You can do this by turning off the <p>First, boot into the bootloader interface. You can do this by turning off the
device and then turning it on by holding both the Volume Down and Power buttons. device and then turning it on by holding both the Volume Down and Power buttons.</p>
Alternatively, use ADB to reboot to the bootloader with the button below:</p>
<button id="adb-reboot-bootloader" disabled="disabled">Reboot to bootloader with ADB</button>
<p>Unlock the bootloader to allow flashing the OS and firmware:</p> <p>Unlock the bootloader to allow flashing the OS and firmware:</p>