@aepyornis/fastboot.ts 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mise.toml +2 -0
- package/package.json +1 -1
- package/src/flasher.ts +15 -0
package/mise.toml
ADDED
package/package.json
CHANGED
package/src/flasher.ts
CHANGED
|
@@ -101,6 +101,21 @@ export class FastbootFlasher {
|
|
|
101
101
|
this.reader = new ZipReader(new BlobReader(blob))
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
+
// parses and runs flash-all.sh. it ignores all shell commands
|
|
105
|
+
// except fastboot or sleep
|
|
106
|
+
async runFlashAll() {
|
|
107
|
+
const entries: Entry[] = await this.reader.getEntries()
|
|
108
|
+
const flashAllSh = await getEntry(entries, "flash-all.sh").getData(new TextWriter())
|
|
109
|
+
|
|
110
|
+
const instructions = flashAllSh
|
|
111
|
+
.split("\n")
|
|
112
|
+
.map((x) => x.trim())
|
|
113
|
+
.filter(x => (x.slice(0,9) === "fastboot " || x.slice(0,5) === "sleep"))
|
|
114
|
+
.join("\n")
|
|
115
|
+
|
|
116
|
+
return this.run(instructions)
|
|
117
|
+
}
|
|
118
|
+
|
|
104
119
|
async run(instructions: text) {
|
|
105
120
|
const entries: Entry[] = await this.reader.getEntries() // io with factory.zip
|
|
106
121
|
const commands: Instruction[] = parseInstructions(instructions)
|