@aepyornis/fastboot.ts 0.0.11 → 0.0.13
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/package.json +1 -1
- package/src/client.ts +5 -10
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -11,7 +11,7 @@ const FastbootUSBDeviceFilter = {
|
|
|
11
11
|
protocolCode: 0x03,
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const MotorolaProducts = ["
|
|
14
|
+
const MotorolaProducts = ["fogo", "fogos", "bangkk", "rhode", "hawao", "devon"]
|
|
15
15
|
|
|
16
16
|
interface Logger {
|
|
17
17
|
log(message: string): void
|
|
@@ -60,14 +60,14 @@ export class FastbootClient {
|
|
|
60
60
|
async reboot() {
|
|
61
61
|
this.logger.log("rebooting")
|
|
62
62
|
await this.fd.exec("reboot")
|
|
63
|
-
await new Promise((resolve) => setTimeout(resolve,
|
|
63
|
+
await new Promise((resolve) => setTimeout(resolve, 1000))
|
|
64
64
|
await this.fd.waitForReconnect()
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
async rebootBootloader() {
|
|
68
68
|
this.logger.log("rebooting into bootloader")
|
|
69
69
|
await this.fd.exec("reboot-bootloader")
|
|
70
|
-
await new Promise((resolve) => setTimeout(resolve,
|
|
70
|
+
await new Promise((resolve) => setTimeout(resolve, 1000))
|
|
71
71
|
await this.fd.waitForReconnect()
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -75,12 +75,7 @@ export class FastbootClient {
|
|
|
75
75
|
const serialNumber = this.fd.serialNumber
|
|
76
76
|
this.logger.log("rebooting into fastboot")
|
|
77
77
|
await this.fd.exec("reboot-fastboot")
|
|
78
|
-
await new Promise((resolve) => setTimeout(resolve,
|
|
79
|
-
// Devices may not automatically reconnect after entering fastbootd, so
|
|
80
|
-
// after 30 seconds if the device has not been connected we prompt again.
|
|
81
|
-
setTimeout(async () => {
|
|
82
|
-
await FastbootClient.findOrRequestDevice(serialNumber)
|
|
83
|
-
}, 30000)
|
|
78
|
+
await new Promise((resolve) => setTimeout(resolve, 1000))
|
|
84
79
|
await this.fd.waitForReconnect()
|
|
85
80
|
}
|
|
86
81
|
|
|
@@ -164,7 +159,7 @@ export class FastbootClient {
|
|
|
164
159
|
}
|
|
165
160
|
this.logger.log(`ACTION NEEDED: flashing ${command}`)
|
|
166
161
|
await this.fd.exec(`flashing ${command}`)
|
|
167
|
-
await new Promise((resolve) => setTimeout(resolve,
|
|
162
|
+
await new Promise((resolve) => setTimeout(resolve, 1000))
|
|
168
163
|
await this.fd.waitForReconnect()
|
|
169
164
|
}
|
|
170
165
|
|