assetsManager.setVerifyCallback(function (filePath, asset) {
var md5 = calculateMD5(filePath);
if (md5 === asset.md5)
return true;
else
return false;
});
热更新的文件效验回调里面的calculateMD5 怎么在js里实现,
百度了下,有个nodejs里的 var crypto = require(‘crypto’); 可以实现
读取文件 jsb.fileUtils.getDataFromFile 后,可以用 crypto 获取MD5
creator模拟器上能运行,ios模拟器上也能运行,但是安卓黑屏
creator模拟器虽然能运行,但是有提示:Simulator: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create
at a (/Users/wangsheng/Desktop/tutorial-hot-update-master/library/bundle.project.js?009:7266:0)