|
|
|
@ -558,8 +558,9 @@ public class MQTTService extends Service { |
|
|
|
public void systemUpdate(CloseMqttBean closeMqttBean){ |
|
|
|
String url = closeMqttBean.getData().getUpdate().getUrl(); |
|
|
|
String version = closeMqttBean.getData().getUpdate().getFirmwareIssueVersion(); |
|
|
|
LoggerUtil.e("固件升级版本:", version); |
|
|
|
if(!version.equals(SignWayUtil.getFirmwareVersion()) && !StringUtil.isEmpty(url)){ |
|
|
|
downloadImgFile(url,"update.img"); |
|
|
|
downloadImgFile(url,"update.zip"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -774,6 +775,7 @@ public class MQTTService extends Service { |
|
|
|
*/ |
|
|
|
private void downloadImgFile(String url,final String appName) { |
|
|
|
final String localPath = StringUtil.strSplice(Constant.CACHE_PATH, "update/", appName); |
|
|
|
FileUtil.deleteFile(localPath); |
|
|
|
FileUtil.downloadFile(url, localPath, () -> { |
|
|
|
LoggerUtil.e("updateImg", "固件下载完成"); |
|
|
|
SignWayUtil.updateSystem(localPath); |
|
|
|
|