提交 5d3ee96a 作者: 毛细亚

更新代码

上级 14d2a111
const _0x4eb0ac = require('./file-util');
const _0x416a81 = _0x4eb0ac['path'];
const _0x270bb2 = _0x4eb0ac['fs'];
const _0xbd1773 = wx['getFileSystemManager']();
class _0xb82201 {
['onLoadStart'](_0x2fe78a, _0x5a680c) {
const {root, url} = _0x5a680c;
return new Promise((_0x37a05e, _0x31b964) => {
let _0x97305e = url['indexOf']('://') >= 0x0 ? url : root + url;
if (RES['getVirtualUrl']) {
_0x97305e = RES['getVirtualUrl'](_0x97305e);
}
if (!_0x416a81['isRemotePath'](_0x97305e)) {
try {
const _0x12861a = _0xbd1773['readFileSync'](_0x97305e);
_0x37a05e(_0x12861a);
} catch (_0x37fcb2) {
_0x37a05e(null);
}
return;
}
if (_0x443319(_0x97305e)) {
const _0x3c9ad0 = _0x416a81['getLocalFilePath'](_0x97305e);
if (_0x270bb2['existsSync'](_0x3c9ad0)) {
let _0x41b7df = _0xbd1773['readFileSync'](_0x416a81['getWxUserPath'](_0x3c9ad0));
_0x37a05e(_0x41b7df);
return;
}
_0x5445e6(_0x97305e)['then'](_0x251cea => {
const _0x1bca90 = _0x416a81['dirname'](_0x3c9ad0);
_0x270bb2['mkdirsSync'](_0x1bca90);
_0x270bb2['writeSync'](_0x3c9ad0, _0x251cea);
let _0x5ab905 = _0x100029();
if (_0x5ab905) {
_0x251cea = _0xbd1773['readFileSync'](_0x416a81['getWxUserPath'](_0x3c9ad0));
}
_0x37a05e(_0x251cea);
})['catch'](_0x4e039a => {
_0x31b964(_0x4e039a);
});
} else {
_0x5445e6(_0x97305e)['then'](_0x2a5706 => {
_0x37a05e(_0x2a5706);
})['catch'](_0x441eba => {
_0x31b964(_0x441eba);
});
}
});
}
['onRemoveStart'](_0x527dd0, _0x1cc32f) {
return Promise['resolve']();
}
}
let _0x44d054;
function _0x100029() {
if (!_0x44d054) {
_0x44d054 = wx['getSystemInfoSync']();
}
let _0x528ea8 = _0x44d054['SDKVersion'];
let _0xfbc2e1 = _0x44d054['system']['split']('\x20')['shift']();
return _0x528ea8 <= '2.2.3' && _0xfbc2e1 == 'iOS';
}
function _0x5445e6(_0x355dde) {
return new Promise((_0x4dd5f3, _0x1fbc75) => {
wx['request']({
'url': _0x355dde,
'method': 'get',
'responseType': 'arraybuffer',
'success': function _0xf44ab9(_0x290a4a) {
_0x4dd5f3(_0x290a4a['data']);
},
'fail': function _0x568328(_0x39618e) {
const _0x37d26f = new RES['ResourceManagerError'](0x3e9, _0x355dde);
console['error']('load\x20binary\x20error', _0x355dde);
_0x1fbc75(_0x37d26f);
}
});
});
}
function _0x443319(_0x5d53c5) {
if (_0x5d53c5['indexOf']('map' + js_gameVars['resVersion']) >= 0x0) {
return !![];
} else {
return ![];
}
}
const _0x868af4 = new _0xb82201();
RES['processor']['map']('bin', _0x868af4);
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论