I have been trying to get a java script to run on Zebra devices running Android 10. Debugging has been difficult because the logs will often show NOTHING. Or if it does show the logs show as a timestamp that is older then when the script was pushed. Can anyone see anything wrong with this script? I'm trying to run this after a file sync to only do a firmware update if certain firmware is already on the device and if the files are both there. I have been pushing this from the console for testing, and I remove the first line when pushing from the console.
-------------
#!/usr/bin/env js
var BuildNumber = new String(mobicontrol.os.buildnumber);
var FirmwareBase = new mobicontrol.io.File('/sdcard/HE_DELTA_UPDATE_01-23-18.00-OG_TO_01-30-04.U00-OG.zip');
var FirmwareLG = new mobicontrol.io.File('/sdcard/HE_DELTA_UPDATE_01-30-04.00-OG-U44-STD.zip');
if (BuildNumber != "01-30-04.00-OG-U44-STD") {
if (FirmwareBase.exists==true && FirmwareLG.exists==true) {
if (BuildNumber.includes("01-23-18")) {
mobicontrol.log.info("Installing Firmware Base");
installsystemupdate(FirmwareBase);
} else if (BuildNumber.includes("01-30-04")) {
mobicontrol.log.info("Installing Firmware LifeGuard");
installsystemupdate(FirmwareLG);
}
} else {
mobicontrol.log.error("Sync not finished, Firmware files do not both exist on the device yet");
}
} else {
mobicontrol.log.error("The device is already on the correct Firmware, no upgrade needed");
}