Skip to content

Commit

Permalink
fix(android): should catch UnsatisfiedLinkError for runScriptFromUri
Browse files Browse the repository at this point in the history
  • Loading branch information
siguangli2018 authored and zoomchan-cxj committed Mar 10, 2021
1 parent 94fc7ff commit 28d0a02
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,23 +206,28 @@ public boolean runScriptFromAssets(String fileName, AssetManager assetManager, b
@Override
public boolean runScriptFromUri(String uri, AssetManager assetManager, boolean canUseCodeCache, String codeCacheTag, NativeCallback callback)
{
if (!mInit)
{
if (!mInit) {
return false;
}

if (!TextUtils.isEmpty(codeCacheTag) && !TextUtils.isEmpty(mCodeCacheRootDir))
{
LogUtils.e("HippyEngineMonitor", "runScriptFromAssets ======core====== " + codeCacheTag + ", canUseCodeCache == " + canUseCodeCache);
LogUtils.d("HippyEngineMonitor", "runScriptFromAssets ======core====== " + codeCacheTag + ", canUseCodeCache == " + canUseCodeCache);
String codeCacheDir = mCodeCacheRootDir + codeCacheTag + File.separator;
File file = new File(codeCacheDir);
LogUtils.d("HippyEngineMonitor", "codeCacheDir file size : " + (file.listFiles() != null ? file.listFiles().length : 0));
return runScriptFromUri(uri, assetManager, canUseCodeCache, codeCacheDir, mV8RuntimeId, callback);
}
else
{
LogUtils.e("HippyEngineMonitor", "runScriptFromAssets codeCacheTag is null");
return runScriptFromUri(uri, assetManager, false, "" + codeCacheTag + File.separator, mV8RuntimeId, callback);
boolean ret = false;
LogUtils.d("HippyEngineMonitor", "runScriptFromAssets codeCacheTag is null");
try {
ret = runScriptFromUri(uri, assetManager, false, "" + codeCacheTag + File.separator, mV8RuntimeId, callback);
} catch (Throwable e) {
LogUtils.e("HippyBridgeImpl", "runScriptFromUri:" + e.getMessage());
}
return ret;
}
}

Expand Down

0 comments on commit 28d0a02

Please sign in to comment.