Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aca3ef43 authored by Jackeagle's avatar Jackeagle
Browse files

mimir: Skip clearHalt to fix Volla Tablet bootloader unlock



Proactive clearHalt on USB open() breaks the Volla Tablet (MediaTek)
bootloader — flashing unlock never receives a response. Add a
skip_clear_halt config flag in device JSON that disables clearHalt
during transport open for devices where it causes issues. Set it
for mimir (Volla Tablet).

Signed-off-by: default avatarJackeagle <jackeagle102@gmail.com>
parent a28f8c7f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
{
  "android": 14,
  "skip_clear_halt": true,
  "steps": [
    {
      "command": ["reboot bootloader", "delay 15"]
+3 −1
Original line number Diff line number Diff line
@@ -463,7 +463,9 @@ export class Controller {
      );
      this.view.updateTotalStep(this.steps.length);
    }
    this.deviceManager.setResources(this.resources.folder, this.steps);
    this.deviceManager.setResources(this.resources.folder, this.steps, {
      skipClearHalt: this.resources.skip_clear_halt,
    });
  }

  setLocalZip(file) {
+4 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ export class DeviceManager {
    this.wasConnected = true;
  }

  setResources(folder, steps) {
  setResources(folder, steps, options) {
    this.folder = folder;
    this.files = steps
      .map((s) => {
@@ -64,6 +64,9 @@ export class DeviceManager {
        });
      })
      .flat();
    if (options?.skipClearHalt) {
      this.bootloader.skipClearHalt = true;
    }
  }

  async getUnlocked(variable) {
+4 −1
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ export class Bootloader extends Device {
  constructor() {
    super(null);
    this.fastboot = null;
    this.skipClearHalt = false;
  }

  async init() {
@@ -83,7 +84,9 @@ export class Bootloader extends Device {
            }
          }
        }
        await this.fastboot.connect();
        await this.fastboot.connect({
          skipClearHalt: this.skipClearHalt,
        });

        const elapsed = Date.now() - connectStart;
        WDebug.log(
+2 −2
Original line number Diff line number Diff line
@@ -59,10 +59,10 @@ export class FastbootDevice {
  /**
   * Open the USB connection and verify the device speaks fastboot.
   */
  async connect(): Promise<void> {
  async connect(options?: { skipClearHalt?: boolean }): Promise<void> {
    if (this._connected) return;

    await this._transport.open();
    await this._transport.open(options);

    // Verify fastboot protocol with a handshake
    try {
Loading