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

Commit 14c87e0c authored by frankpreel's avatar frankpreel
Browse files

Emeral vs Zirconia

parent e2e67314
Loading
Loading
Loading
Loading
+25 −26
Original line number Diff line number Diff line
@@ -296,11 +296,15 @@ export class Controller {
            }

            let this_model = this.deviceManager.adb.webusb.device;
            // K1ZFP Manage here model override see https://gitlab.e.foundation/e/os/backlog/-/issues/2475
            if (this.deviceManager.adb.webusb.model == "Teracube 2e") { // Official ROM
                if (this.deviceManager.adb.webusb.product == "Teracube_2e") { //emerald
            //    https://gitlab.e.foundation/e/os/backlog/-/issues/2604#note_609234
            const model = this.deviceManager.adb.webusb.model;
            if (model.includes("Teracube") && model.includes("2e")) {
                try {
                    const serial = await this.deviceManager.adb.getSerialNumber();
                     WDebug.log("serial numer:", serial);
                    if (serial.startsWith("2020")) {
                        this_model = "emerald";
                } else if (this.deviceManager.adb.webusb.product == "Teracube_2e_EEA") { // zirconia
                    } else if (serial.startsWith("2021")) {
                        this_model = "Teracube_2e";
                    } else {
                        const id = 
@@ -310,20 +314,15 @@ export class Controller {
                        "device "+this.deviceManager.adb.webusb.device;
                        throw new Error("Cannot find device resource", id);
                    }
            } 
            else if (this.deviceManager.adb.webusb.model == "Teracube_2e") { // under e/OS/
                if (this.deviceManager.adb.webusb.device == "emerald") { //emerald
                    this_model = "emerald";
                } else if (this.deviceManager.adb.webusb.device == "zirconia") {
                    this_model = "Teracube_2e";
                } else {
                } catch (e) {
                    const id = 
                        "model "+this.deviceManager.adb.webusb.model + " " + 
                        "product "+this.deviceManager.adb.webusb.product + " " +
                        "name "+this.deviceManager.adb.webusb.name + " " +
                        "device "+this.deviceManager.adb.webusb.device;
                    throw new Error("Cannot find device resource", id);
                        throw new Error("Error on getting devcice resource", id);
                }
                
            }

            resources = await (await fetch(`resources/${this_model}.json`)).json();
+4 −0
Original line number Diff line number Diff line
@@ -62,6 +62,10 @@ export class ADB extends Device {
        return this.webusb.getProp('ro.build.version.release');
    }

    async getSerialNumber() {
        return this.webusb.getProp("ro.boot.serialno");
    }

    async runCommand(cmd) {
        WDebug.log("ADB Run command>", cmd);
        return await this.webusb.exec(cmd);