@ives_xxz/framework 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -89,22 +89,22 @@ export default class FWHotUpdateManager extends FWManager implements FW.HotUpdat
|
|
|
89
89
|
|
|
90
90
|
private checkEventHandle(event: any) {
|
|
91
91
|
const code = event.getEventCode();
|
|
92
|
-
FWLog.debug('getEventCode -> ', code);
|
|
92
|
+
FWLog.debug('checkEvent getEventCode -> ', code);
|
|
93
93
|
switch (code) {
|
|
94
94
|
case jsb.EventAssetsManager.ERROR_NO_LOCAL_MANIFEST:
|
|
95
|
-
FWLog.debug('getEventCode -> ', 'ERROR_NO_LOCAL_MANIFEST');
|
|
95
|
+
FWLog.debug('checkEvent getEventCode -> ', 'ERROR_NO_LOCAL_MANIFEST');
|
|
96
96
|
break;
|
|
97
97
|
case jsb.EventAssetsManager.ERROR_DOWNLOAD_MANIFEST:
|
|
98
|
-
FWLog.debug('getEventCode -> ', 'ERROR_DOWNLOAD_MANIFEST');
|
|
98
|
+
FWLog.debug('checkEvent getEventCode -> ', 'ERROR_DOWNLOAD_MANIFEST');
|
|
99
99
|
break;
|
|
100
100
|
case jsb.EventAssetsManager.ERROR_PARSE_MANIFEST:
|
|
101
|
-
FWLog.debug('getEventCode -> ', 'ERROR_PARSE_MANIFEST');
|
|
101
|
+
FWLog.debug('checkEvent getEventCode -> ', 'ERROR_PARSE_MANIFEST');
|
|
102
102
|
break;
|
|
103
103
|
case jsb.EventAssetsManager.ALREADY_UP_TO_DATE:
|
|
104
|
-
FWLog.debug('getEventCode -> ', 'ALREADY_UP_TO_DATE');
|
|
104
|
+
FWLog.debug('checkEvent getEventCode -> ', 'ALREADY_UP_TO_DATE');
|
|
105
105
|
break;
|
|
106
106
|
case jsb.EventAssetsManager.NEW_VERSION_FOUND:
|
|
107
|
-
FWLog.debug('getEventCode -> ', 'NEW_VERSION_FOUND');
|
|
107
|
+
FWLog.debug('checkEvent getEventCode -> ', 'NEW_VERSION_FOUND');
|
|
108
108
|
break;
|
|
109
109
|
default:
|
|
110
110
|
return;
|
|
@@ -113,16 +113,17 @@ export default class FWHotUpdateManager extends FWManager implements FW.HotUpdat
|
|
|
113
113
|
this.listener.checkHotUpdateHandle?.(code);
|
|
114
114
|
this.assetMgr.setEventCallback(null!);
|
|
115
115
|
this.isUpdate = false;
|
|
116
|
-
|
|
116
|
+
FWLog.debug('isFind New Version -> ', event.getEventCode() == jsb.EventAssetsManager.NEW_VERSION_FOUND);
|
|
117
117
|
if (event.getEventCode() == jsb.EventAssetsManager.NEW_VERSION_FOUND) {
|
|
118
118
|
this.hotUpdate();
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
private hotUpdate() {
|
|
123
|
+
FWLog.debug('start hotUpdate ->', this.assetMgr, this.isUpdate);
|
|
123
124
|
if (this.assetMgr && !this.isUpdate) {
|
|
124
125
|
this.assetMgr.setEventCallback(this.updateEventHandle.bind(this));
|
|
125
|
-
|
|
126
|
+
FWLog.debug('assetMgr state ->', this.assetMgr.getState() === jsb.AssetsManager.State.UNINITED);
|
|
126
127
|
if (this.assetMgr.getState() === jsb.AssetsManager.State.UNINITED) {
|
|
127
128
|
this.assetMgr.loadLocalManifest(this.localManifest.nativeUrl);
|
|
128
129
|
}
|
|
@@ -143,6 +144,7 @@ export default class FWHotUpdateManager extends FWManager implements FW.HotUpdat
|
|
|
143
144
|
let convertTotalBytes: string = '';
|
|
144
145
|
const code = event.getEventCode();
|
|
145
146
|
const msg = event.getMessage();
|
|
147
|
+
FWLog.debug('updateEvent getEventCode -> ', code);
|
|
146
148
|
switch (code) {
|
|
147
149
|
case jsb.EventAssetsManager.ERROR_NO_LOCAL_MANIFEST:
|
|
148
150
|
failed = true;
|
|
@@ -156,7 +158,9 @@ export default class FWHotUpdateManager extends FWManager implements FW.HotUpdat
|
|
|
156
158
|
convertDownloadedBytes = this.convertBytes(downloadedBytes);
|
|
157
159
|
convertTotalBytes = this.convertBytes(totalBytes);
|
|
158
160
|
percent = event.getPercent();
|
|
161
|
+
FWLog.debug('正在更新中 -> ', '下载文件数量:', downloadedFiles, ',下载文件总数量:', totalFiles, ',已下载大小:', convertDownloadedBytes, ',下载总大小:', convertTotalBytes);
|
|
159
162
|
}
|
|
163
|
+
|
|
160
164
|
break;
|
|
161
165
|
case jsb.EventAssetsManager.ERROR_DOWNLOAD_MANIFEST:
|
|
162
166
|
break;
|
|
@@ -192,12 +196,14 @@ export default class FWHotUpdateManager extends FWManager implements FW.HotUpdat
|
|
|
192
196
|
});
|
|
193
197
|
|
|
194
198
|
if (failed) {
|
|
199
|
+
FWLog.debug('下载失败');
|
|
195
200
|
this.assetMgr.setEventCallback(null!);
|
|
196
201
|
this.isUpdate = false;
|
|
197
202
|
this.retry();
|
|
198
203
|
}
|
|
199
204
|
|
|
200
205
|
if (needRestart) {
|
|
206
|
+
FWLog.debug('下载完成');
|
|
201
207
|
this.assetMgr.setEventCallback(null!);
|
|
202
208
|
var searchPaths = jsb.fileUtils.getSearchPaths();
|
|
203
209
|
var newPaths = this.assetMgr.getLocalManifest().getSearchPaths();
|