diff options
| author | Danny Lin <danny@kdrag0n.dev> | 2021-01-23 19:47:37 -0800 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2021-01-23 23:08:12 -0500 |
| commit | dff5a750d182aed60df2ea6c4fd452a0955cdd0f (patch) | |
| tree | 983427117e59575d0c8b15609369a4a57d98c2b6 /static/js | |
| parent | 94ec5e04406062c1796edd186ee2081cf5e06723 (diff) | |
Switch to new bundled fastboot.js
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.
Diffstat (limited to 'static/js')
| -rw-r--r-- | static/js/web-install.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/static/js/web-install.js b/static/js/web-install.js index aa80d2b1..aeef9e12 100644 --- a/static/js/web-install.js +++ b/static/js/web-install.js @@ -1,7 +1,6 @@ // @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT -import { FastbootDevice } from "./fastboot/fastboot.js"; -import * as Factory from "./fastboot/factory.js"; +import { FastbootDevice, FactoryImages } from "./fastboot/dist/fastboot.min.js?0"; const RELEASES_URL = "https://releases.grapheneos.org"; @@ -37,7 +36,7 @@ async function downloadRelease(setProgress) { // Download and cache the zip as a blob setProgress(`Downloading ${releaseId} release for ${product}...`); lastReleaseZip = `${product}-factory-${releaseId}.zip`; - await Factory.downloadZip(`${RELEASES_URL}/${lastReleaseZip}`); + await FactoryImages.downloadZip(`${RELEASES_URL}/${lastReleaseZip}`); return `Downloaded ${releaseId} release for ${product}.`; } @@ -45,7 +44,7 @@ async function flashRelease(setProgress) { await ensureConnected(setProgress); setProgress("Flashing release..."); - await Factory.flashZip(device, lastReleaseZip, (action, partition) => { + await FactoryImages.flashZip(device, lastReleaseZip, (action, partition) => { let userPartition = partition == "avb_custom_key" ? "verified boot key" : partition; if (action == "unpack") { setProgress(`Unpacking image: ${userPartition}`); @@ -84,11 +83,9 @@ function addButtonHook(id, callback) { }; } -// zip.js is loaded separately. -// eslint-disable-next-line no-undef -zip.configure({ +FactoryImages.configureZip({ workerScripts: { - inflate: ["/js/fastboot/libs/z-worker-pako.js", "pako_inflate.min.js"], + inflate: ["/js/fastboot/dist/libs/z-worker-pako.js", "pako_inflate.min.js"], }, }); |
