[LayaNative2]ios原生包热更时下载https文件失败
如题,原生包下载热更文件时失败,但是在浏览器中是能访问的,用curl也能下载成功,怀疑是证书的问题,但是不知道底层是用什么方法实现https下载,使用cacert.pem证书验证。
ios原生包运行日志:
2024-06-18 11:22:03.785139+0800 shanliang[20588:1602729] Download [ ]:https://cdn.sksghero.com/en/te ... .1228
2024-06-18 11:22:03.814577+0800 shanliang[20588:1602469] >>>JCConchRender::clearAllData =64669056
2024-06-18 11:22:03.820398+0800 shanliang[20588:1602469] call:+[JYouManager initWithProductCode:]
<Warning>: You haven't set a value for FacebookAdvertiserIDCollectionEnabled. Set the flag to TRUE if you want to collect Advertiser ID for better advertising and analytics results.
<Warning>: The value for FacebookAdvertiserIDCollectionEnabled is currently set to FALSE so you're sending app events without collecting Advertiser ID. This can affect the quality of your advertising and analytics results.
2024-06-18 11:22:03.851468+0800 shanliang[20588:1602469] call:-[JYouManager appActiveTrackingAuthorization]
2024-06-18 11:22:03.855948+0800 shanliang[20588:1602469] -[JYouManager appActiveTrackingAuthorization]_block_invoke:idfa=D955012B-08A3-446E-A802-5D45FE9ABDA2
2024-06-18 11:22:03.888047+0800 shanliang[20588:1602469] call-[SensesNetManager initsdk:]:v2/system/init
2024-06-18 11:22:03.908543+0800 shanliang[20588:1602768] [AppsFlyerSDK] [com.apple.main-thread] AppsFlyer SDK version 6.14.4.185 started build (185)
2024-06-18 11:22:03.920955+0800 shanliang[20588:1602771] [AppsFlyerSDK] [com.apple.main-thread] Keychain items migration status: 0
2024-06-18 11:22:03.922700+0800 shanliang[20588:1602716] data=I2bXiqN09mpp9p13B9CLcEWIFIj2Q4aEqNaxH8hGy9YW8p83qWcqwJr3ai6J56f3GSISeZejYNMCjEJsG1VVK/pTXZ2LWrluE680FqMxxO2wQX%2BMuvDgij8tCSKByYZr9rXJ/%2BrMB/hPxtNeux5x6oMMc9i9uU5C8m1Kq7mDBb4hiU4nltVfAhftSYAADl5GmMZ4liHy48rZHJFxyJXw%2B8U3zDCMSY6y6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/5DjsbLRMCes%2Bs21kFmia9TolPUNj2ixD69idBdJCXw5KL636zPxuAVck30/ILja8ViKUEATO/iMQexCT%2BFdo1KQtgkCEAkMFkCqp5wZBjG8FrC9tU8ooF6qq7MiHffen8eUE3eIYbSfMXBah7dE3v53E0ejk2BBTk5Q5cT/9zfA==&sign=12713374924c9b0829b82ba2fd0737ca
2024-06-18 11:22:04.010151+0800 shanliang[20588:1602716] 1 time post:https://api.yixiaoplay.com/v2/system/init
`appsFlyerDevKey` missing or empty.
2024-06-18 11:22:04.063560+0800 shanliang[20588:1602770] SKAdNetwork: Error while updating conversion value: Error Domain=SKANErrorDomain Code=10 "(null)"
2024-06-18 11:22:04.067127+0800 shanliang[20588:1602770] [Attribution] updatePostbackConversionValue returned error: The operation couldn’t be completed. (SKANErrorDomain error 10.).
2024-06-18 11:22:04.068522+0800 shanliang[20588:1602770] SKAdNetwork: Error while updating conversion value: Error Domain=SKANErrorDomain Code=10 "(null)"
2024-06-18 11:22:04.196974+0800 shanliang[20588:1602768] - <AppMeasurement>[I-ACS025019] User property not set. Call +[FIRApp configure]: allow_personalized_ads
2024-06-18 11:22:04.669020+0800 shanliang[20588:1602469] FBSDKLog: starting with Graph API v2.4, GET requests for /683474983752002/model_asset should contain an explicit "fields" parameter
2024-06-18 11:22:04.670500+0800 shanliang[20588:1602775] FBSDKLog: starting with Graph API v2.4, GET requests for /683474983752002/ios_skadnetwork_conversion_config should contain an explicit "fields" parameter
2024-06-18 11:22:04.689393+0800 shanliang[20588:1602768] [Client] Updating selectors after delegate addition failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service with pid 90 named com.apple.commcenter.coretelephony.xpc was invalidated from this process." UserInfo={NSDebugDescription=The connection to service with pid 90 named com.apple.commcenter.coretelephony.xpc was invalidated from this process.}
2024-06-18 11:22:04.774906+0800 shanliang[20588:1602729] Download end:403
2024-06-18 11:22:04.775465+0800 shanliang[20588:1602729] Downloaded https://cdn.sksghero.com/en/te ... 8.0.9 s=0 l=0
2024-06-18 11:22:04.782979+0800 shanliang[20588:1602469] onerror UnknownError
2024-06-18 11:22:04.783239+0800 shanliang[20588:1602469] assetsid old: new:null
2024-06-18 11:22:04.800150+0800 shanliang[20588:1602469] xhr.GET url=https://cdn.sksghero.com/en/test/v1/index.js
2024-06-18 11:22:04.803047+0800 shanliang[20588:1602469] found the file in the package:a79d20b7
原生实现下载的代码是这部分:
-------------async.js-----------
...
function downloadSync(url, bin, onprog) {
return new Promise(function (resolve, reject) {
var f = new conch_File(url);
var fr = new conch_FileReader();
fr.setIgnoreError(true);
fr.onload = () => {
console.log('download end');
resolve(fr.result);
};
fr.onerror = (e) => { console.log('onerror ' + e);
//if (reject)
// reject(e);
resolve(null);
};
fr.onprogress = onprog;
if (bin)
fr.readAsArrayBuffer(f);
else
fr.readAsText(f);
});
}
...
conch_File 在runtimeInit.js定义
window = this;
window.conch_File=File;
window.conch_FileReader = FileReader;
...
ios原生包运行日志:
2024-06-18 11:22:03.785139+0800 shanliang[20588:1602729] Download [ ]:https://cdn.sksghero.com/en/te ... .1228
2024-06-18 11:22:03.814577+0800 shanliang[20588:1602469] >>>JCConchRender::clearAllData =64669056
2024-06-18 11:22:03.820398+0800 shanliang[20588:1602469] call:+[JYouManager initWithProductCode:]
<Warning>: You haven't set a value for FacebookAdvertiserIDCollectionEnabled. Set the flag to TRUE if you want to collect Advertiser ID for better advertising and analytics results.
<Warning>: The value for FacebookAdvertiserIDCollectionEnabled is currently set to FALSE so you're sending app events without collecting Advertiser ID. This can affect the quality of your advertising and analytics results.
2024-06-18 11:22:03.851468+0800 shanliang[20588:1602469] call:-[JYouManager appActiveTrackingAuthorization]
2024-06-18 11:22:03.855948+0800 shanliang[20588:1602469] -[JYouManager appActiveTrackingAuthorization]_block_invoke:idfa=D955012B-08A3-446E-A802-5D45FE9ABDA2
2024-06-18 11:22:03.888047+0800 shanliang[20588:1602469] call-[SensesNetManager initsdk:]:v2/system/init
2024-06-18 11:22:03.908543+0800 shanliang[20588:1602768] [AppsFlyerSDK] [com.apple.main-thread] AppsFlyer SDK version 6.14.4.185 started build (185)
2024-06-18 11:22:03.920955+0800 shanliang[20588:1602771] [AppsFlyerSDK] [com.apple.main-thread] Keychain items migration status: 0
2024-06-18 11:22:03.922700+0800 shanliang[20588:1602716] data=I2bXiqN09mpp9p13B9CLcEWIFIj2Q4aEqNaxH8hGy9YW8p83qWcqwJr3ai6J56f3GSISeZejYNMCjEJsG1VVK/pTXZ2LWrluE680FqMxxO2wQX%2BMuvDgij8tCSKByYZr9rXJ/%2BrMB/hPxtNeux5x6oMMc9i9uU5C8m1Kq7mDBb4hiU4nltVfAhftSYAADl5GmMZ4liHy48rZHJFxyJXw%2B8U3zDCMSY6y6X1S/nwZG7nsdmgtYVWfp07SJMdB7IJJsXh5WWedNkkloKbrjrJf85OLBfBYB7LKXKa/DgAXSiHygv%2BUlmKdrW9Kd14hqwQkhZKsHPhBE2b4VBnmRNSiSy6OxGt7IU/G1OrTaBopto%2BEFlToh7TGz9ieZbgXjbcuQXAsirz4f%2BRYZFmvkGo4b6iX0ywi6TQ38013lJHor74wbP6nMMGb/1tcHAR/TkED04GGLXGIUzRXNLKa5hiayxqEf/8cb8tJdF5HifxWZIxoL%2B0KrvpEWeDodiUBrht55d4vFR7knsiI6qQtcZ2UMZheoTFfOixEI3QPI6tjKnUG1U4hUTeA8IGG9rFZyN3SR2ZEgjrtcNacfdsf66zJGcyADPW2GZqaguOKlGzP5jyBIoQB9PaHhKZFT67cda%2Bnr1qJdMx%2BGECBFvnQzneWsSYL4JntymGkWoFqMd2End4uWEChRxeYnjTuVUTW9gL20o2Ruf7amW55bmp0dbt6cGcZkqUWVdwrCB7GgFvYjguKWuaFhfQDvLdaHcKRueRuJU08Izeb1YsaEUQ3qLFyD85/4yna4zD7A%2BUQsyfgOiXkAXtICOaXhBKe38DAYmt8kPMrDuQTKVBs4qNP7J6NMfr5tTc2ap2hdIRRkkstYBwu4dAAsGgoDz9C9WY1PD9WLn0jawKEKG7w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snJpYRAntveyeNQHnsTfwb6nsYaULFT6g%2BIcDl7QF97jY9hl/twCoqEuh9nOU/J463kNwUdKAFgh2vOZEsFiygzlnDRmUeMAh/VTmZrXlBcnwfa8HU1Or/8QWg0ikqHNVua8cYb1%2BqLMdRtezNft3y/SgFbCx6V6ylepAzq9QQy3ScH153WMjRfkcKx4pw8McPnBNuXXwUCcSzL96o8EcBYSuwV3u6q5CQhjhUyFv3Vj1AuT/Ix7tA6IJSilVvxv52q/NDtrXUAjDMuMVQO6xZNFPn2V3SsVVs5Npd1oPsQ/%2BXtK0082yFaQknkverVtatYV3PpHP59LvW7v%2BbHl3sQUDhn0WxQzv4RWfmqXSHl2aCzeKRduoE0YBqQ0ji7v/5DjsbLRMCes%2Bs21kFmia9TolPUNj2ixD69idBdJCXw5KL636zPxuAVck30/ILja8ViKUEATO/iMQexCT%2BFdo1KQtgkCEAkMFkCqp5wZBjG8FrC9tU8ooF6qq7MiHffen8eUE3eIYbSfMXBah7dE3v53E0ejk2BBTk5Q5cT/9zfA==&sign=12713374924c9b0829b82ba2fd0737ca
2024-06-18 11:22:04.010151+0800 shanliang[20588:1602716] 1 time post:https://api.yixiaoplay.com/v2/system/init
`appsFlyerDevKey` missing or empty.
2024-06-18 11:22:04.063560+0800 shanliang[20588:1602770] SKAdNetwork: Error while updating conversion value: Error Domain=SKANErrorDomain Code=10 "(null)"
2024-06-18 11:22:04.067127+0800 shanliang[20588:1602770] [Attribution] updatePostbackConversionValue returned error: The operation couldn’t be completed. (SKANErrorDomain error 10.).
2024-06-18 11:22:04.068522+0800 shanliang[20588:1602770] SKAdNetwork: Error while updating conversion value: Error Domain=SKANErrorDomain Code=10 "(null)"
2024-06-18 11:22:04.196974+0800 shanliang[20588:1602768] - <AppMeasurement>[I-ACS025019] User property not set. Call +[FIRApp configure]: allow_personalized_ads
2024-06-18 11:22:04.669020+0800 shanliang[20588:1602469] FBSDKLog: starting with Graph API v2.4, GET requests for /683474983752002/model_asset should contain an explicit "fields" parameter
2024-06-18 11:22:04.670500+0800 shanliang[20588:1602775] FBSDKLog: starting with Graph API v2.4, GET requests for /683474983752002/ios_skadnetwork_conversion_config should contain an explicit "fields" parameter
2024-06-18 11:22:04.689393+0800 shanliang[20588:1602768] [Client] Updating selectors after delegate addition failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service with pid 90 named com.apple.commcenter.coretelephony.xpc was invalidated from this process." UserInfo={NSDebugDescription=The connection to service with pid 90 named com.apple.commcenter.coretelephony.xpc was invalidated from this process.}
2024-06-18 11:22:04.774906+0800 shanliang[20588:1602729] Download end:403
2024-06-18 11:22:04.775465+0800 shanliang[20588:1602729] Downloaded https://cdn.sksghero.com/en/te ... 8.0.9 s=0 l=0
2024-06-18 11:22:04.782979+0800 shanliang[20588:1602469] onerror UnknownError
2024-06-18 11:22:04.783239+0800 shanliang[20588:1602469] assetsid old: new:null
2024-06-18 11:22:04.800150+0800 shanliang[20588:1602469] xhr.GET url=https://cdn.sksghero.com/en/test/v1/index.js
2024-06-18 11:22:04.803047+0800 shanliang[20588:1602469] found the file in the package:a79d20b7
原生实现下载的代码是这部分:
-------------async.js-----------
...
function downloadSync(url, bin, onprog) {
return new Promise(function (resolve, reject) {
var f = new conch_File(url);
var fr = new conch_FileReader();
fr.setIgnoreError(true);
fr.onload = () => {
console.log('download end');
resolve(fr.result);
};
fr.onerror = (e) => { console.log('onerror ' + e);
//if (reject)
// reject(e);
resolve(null);
};
fr.onprogress = onprog;
if (bin)
fr.readAsArrayBuffer(f);
else
fr.readAsText(f);
});
}
...
conch_File 在runtimeInit.js定义
window = this;
window.conch_File=File;
window.conch_FileReader = FileReader;
...
没有找到相关结果
已邀请:
要回复问题请先登录
0 个回复