Hi Kasun et al, I have implemented this operation and tested on a rooted device with the system app in place.
OTA Server ========= A file server which serves build.prop and the particular upgrade pack was used as the OTA server. These files need to be added under a sub-directory in the name of the device. Ex:- Device name: c1ktt Files: http://10.10.10.227:8000/c1ktt/build.prop and http://10.10.10.227:8000/c1ktt/c1ktt.ota.zip build.prop ======== Attached is a sample build.prop. Key field to be changed is as follows. ro.build.version.release=x.x.x (This version has to be greater than the previous version of the firmware for an upgrade to happen) Server side configurations ==================== Following constants need to be changed accordingly in org/wso2/emm/system/service/utils/Constants.java. These configs which are related to the OTA server, will be moved out to an external config file. public static final String DEFAULT_OTA_SERVER_ADDRESS = "10.10.10.227"; public static final String DEFAULT_OTA_SERVER_PROTOCOL = "http"; public static final int DEFAULT_OTA_SERVER_PORT = 8000; Logs from system app ================= 03-29 18:46:40.114 23424-17321/org.wso2.emm.system.service D/EMMSystemService: Entered onHandleIntent of the Command Runner Service. 03-29 18:46:40.114 23424-17321/org.wso2.emm.system.service D/EMMSystemService: EMM agent has sent a command. 03-29 18:46:40.114 23424-17321/org.wso2.emm.system.service D/EMMSystemService: The operation code is: UPGRADE_FIRMWARE 03-29 18:46:40.114 23424-17321/org.wso2.emm.system.service I/EMMSystemService: Will now executing the command ...UPGRADE_FIRMWARE 03-29 18:46:40.114 23424-17321/org.wso2.emm.system.service D/EMMSystemService: Do task triggered. Code = UPGRADE_FIRMWARE 03-29 18:46:40.114 23424-17321/org.wso2.emm.system.service I/EMMSystemService: An upgrade has been requested 03-29 18:46:40.119 23424-17321/org.wso2.emm.system.service D/Toast: checkMirrorLinkEnabled returns : false 03-29 18:46:40.119 23424-17321/org.wso2.emm.system.service D/Toast: showing allowed 03-29 18:46:40.119 23424-17321/org.wso2.emm.system.service D/OTA_SC: Loading configuration from file /data/system/ota.conf for product c1ktt 03-29 18:46:40.119 23424-17321/org.wso2.emm.system.service E/OTA_SC: Build property file does not meet required specification.java.io.FileNotFoundException: /data/system/ota.conf: open failed: ENOENT (No such file or directory) 03-29 18:46:40.119 23424-17321/org.wso2.emm.system.service I/OTA_SC: Loading default configuration for product c1ktt. 03-29 18:46:40.119 23424-17321/org.wso2.emm.system.service D/OTA_SC: create a new server config: package url http://10.10.10.227:8000/c1ktt/c1ktt.ota.zip:8000 03-29 18:46:40.119 23424-17321/org.wso2.emm.system.service D/OTA_SC: build.prop URL:http://10.10.10.227:8000/c1ktt/build.prop 03-29 18:46:40.214 23424-17321/org.wso2.emm.system.service D/OTA_SM: Start download: http://10.10.10.227:8000/c1ktt/build.prop to buffer 03-29 18:46:40.214 23424-17321/org.wso2.emm.system.service D/OTA_SM: wrote 1024 into byte output stream 03-29 18:46:40.214 23424-17321/org.wso2.emm.system.service D/OTA_SM: wrote 1024 into byte output stream 03-29 18:46:40.214 23424-17321/org.wso2.emm.system.service D/OTA_SM: wrote 1024 into byte output stream 03-29 18:46:40.219 23424-17321/org.wso2.emm.system.service D/OTA_SM: wrote 166 into byte output stream 03-29 18:46:40.219 23424-17321/org.wso2.emm.system.service D/OTA_SM: Download finished: 3238 bytes downloaded 03-29 18:46:40.219 23424-17321/org.wso2.emm.system.service D/OTA_BPP: tmpDir:/data/data/org.wso2.emm.system.service/files Thanks, On Wed, Feb 10, 2016 at 7:22 PM, Kasun Dananjaya Delgolla <[email protected]> wrote: > Hi, > > I have implemented the android layer implementation of the above > functionality. How it works is, when the admin sends the upgrade command > from the UI/REST API, android agent app talks to the system service > (implemented as a separate component, since these features require system > level/root access). Then, the system service will invoke the firmware > upgrade following the below steps. > > 1. System app will first downloads the OTA upgrade package's configuration > file "ota.conf" from the OTA server (server URL and ports have to be > configured in the system app) > 2. Then it parses the config file downloaded to read the necessary configs > (ex: upgrade package version, size etc) > 3. System app compares the upgrade package version with the device > existing firmware version. > 4. If the firmware version is greater than the available version, it > downloads the upgrade package from the server. > 5. System app triggers the OTA upgrade. > > Thanks > > On Wed, Feb 10, 2016 at 6:41 PM, Gayan Yalpathwala <[email protected]> > wrote: > >> Hi, >> >> I am adding the above function to the REST API layer and to the jaggery >> UI of EMM. With the introduction of this, a privileged user can remotely >> force a firmware upgrade on the device. This facility will only be >> available to COPE devices with the system app installed. >> >> Thanks, >> >> -- >> *Gayan Kaushalya Yalpathwala* >> Software Engineer >> WSO2 Inc.; http://wso2.com >> lean.enterprise.middleware >> >> LK: +94 71 868 2704 >> UK: +44 747 844 3609 >> >> <http://asia14.wso2con.com/> >> > > > > -- > Kasun Dananjaya Delgolla > > Software Engineer > WSO2 Inc.; http://wso2.com > lean.enterprise.middleware > Tel: +94 11 214 5345 > Fax: +94 11 2145300 > Mob: + 94 771 771 015 > Blog: http://kddcodingparadise.blogspot.com > Linkedin: *http://lk.linkedin.com/in/kasundananjaya > <http://lk.linkedin.com/in/kasundananjaya>* > -- *Gayan Kaushalya Yalpathwala* Software Engineer WSO2 Inc.; http://wso2.com lean.enterprise.middleware LK: +94 71 868 2704 UK: +44 747 844 3609 <http://asia14.wso2con.com/>
build.prop
Description: Binary data
_______________________________________________ Architecture mailing list [email protected] https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
