Android System crash using installSystemUpdate

TE
Travis Epperson
HD Supply - STOCK-CSC
I would like to trigger the update of firmware on a Zebra device with JavaScript.  I know it's possible in legacy script, but I have my reasons to use JavaScript.
 
MobiControl Version: 15.5.2.1003
Agent Version 15.3.0.1006
Zebra TC57X
Android OS 10.0
OEM Version 10-16-10.00-QG-U114-STD-HEL-04
File is present (if it's not a different error occurs)
 

Script:

var FirmwareLG = new mobicontrol.io.File("/sdcard/HE_DELTA_UPDATE_10-16-10.00-QG-U133-STD-HEL-04.zip");
mobicontrol.os.installSystemUpdate(FirmwareLG);

When the script is run it throws the error:

Custom log (Wrapped java.lang.RuntimeException: android.os.DeadSystemException (UserScript#2))

2 years ago
Android Scripting
ANSWERS
RS
Rafael Schäfer
2 years ago

Did you try to add the path without the variable to check if there's something going wrong?

Also check if it takes the path correctly (not if the file is there but correct path specification). Maybe it doesn't find the file and fails because of that.

TE
Travis Epperson
2 years ago

I have tried the path directly and it complains that it is the wrong type.  (String)

The function expects the file object or it won't work.
Error:
Custom log (Wrapped java.lang.IllegalArgumentException: method net.soti.mobicontrol.script.javascriptengine.hostobject.os.OsHostObject.installSystemUpdate argument 1 has type net.soti.mobicontrol.script.javascriptengine.hostobject.io.FileHostObject, got org.mozilla.javascript.NativeString (UserScript#1))

When I change the path to something invalid I get
Error:
Custom log (SystemUpdateError: The update file doesn't exist. (UserScript#2))

And I get a different error if the update isn't compatible (wrong LG etc).

RC
Raymond Chan Diamond Contributor
2 years ago

You said you KNOW the upgrade is possible with legacy script, but have you actually tried out and successfully upgraded using this file with any legacy script   If so, could you please show the script you used?

For device firmware upgrade, it is important to strictly follow the instructions given by the corresponding device OEM vendor to avoid bricking the device.   The mobiControl.os javascript class/methods have only be recently implemented, and it is not known if its implementation caters/support for all OEM brands.   I suggest you to officially open a support ticket with Soti support team at support@soti.net to confirm such support/compatibility first. 

Upgrading device firmware is EXTREMELY SERIOUS matter  and can incur hefty expenses to fix  if you brick the device accidentally with unauthorized procedure.  Thus, regarding firmware upgrade matters, do NOT listen to casual  or even irresponsible recommendation from unauthorized source or from someone with no hands-on experience on the same/very similar hardware-software.