Getting progress with the fetch() API is complicated and requires us to
stream the data and create the blob ourselves, so use XMLHttpRequest
instead to get live progress updates.
On Android, Chromium does not support automatic reconnection. The user
must manually pair the device after every reboot in order for
fastboot.js to reconnect to it. Unfortunately, this requires the user of
the library to get involved because USB device connction requests are
only allowed as the result of explicit user action, so we need to add a
reconnect request callback for the user to handle.
Some of the API and paths have changed, so this needs to be updated
accordingly. The most prominent change is the removal of BlobStore and
downloading support from fastboot.js, because a fastboot library should
not be responsible for downloading files.
Improvements:
- Better documentation
- Less ambiguous bundle file extension
- Support for logical partitions (via fastbootd)
- More robust flashing
- More consistent code quality
- Requirement checks before flashing
- More flexible factory zip handling
- Support for wiping logical partitions and userdata
- Configurable debug mode
- More detailed flashing progress
- Conformant factory image flashing process
- Automatic reconnection upon connection loss
- Graceful handling of connection loss
- Automatic reuse of already-paired USB devices
- User-friendly progress/status text
This simplifies cache busting greatly without needing to do further
processing on any fastboot.js code before deploying. It also removes the
need for a non-module script with global scope.
This implements the WebUSB-based web installer using fastboot.js to
act as a fastboot client. A bare minimum UI with a plain-text
status/progress caption for each step is included, as well as a plain
button to trigger it and basic error handling.
WebADB has been removed now that we are only using fastboot.js.
Initial features:
- Unlocking and locking the bootloader
- Downloading the latest GrapheneOS release available for the device
- Flashing the factory images zip
- Reusing USB connections