From 16676cf39c4019a6ac33e31046012ac4244682bd Mon Sep 17 00:00:00 2001 From: s30030188 Date: Thu, 12 Jun 2025 17:19:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=BB=98=E8=AE=A4runtimelink?= =?UTF-8?q?er?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: s30030188 --- frameworks/native/runtime/sts_runtime.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/frameworks/native/runtime/sts_runtime.cpp b/frameworks/native/runtime/sts_runtime.cpp index f3181a029ec..c51ccd0bce5 100644 --- a/frameworks/native/runtime/sts_runtime.cpp +++ b/frameworks/native/runtime/sts_runtime.cpp @@ -660,6 +660,12 @@ std::unique_ptr STSRuntime::LoadStsModule(const std::string& TAG_LOGE(AAFwkTag::STSRUNTIME, "Class_FindMethod loadClass failed"); return std::make_unique(); } + ani_class contextCls {}; + if (aniEnv->FindClass("std.interop.InteropContext", &contextCls) == ANI_OK) { + TAG_LOGD(AAFwkTag::STSRUNTIME, "setDefaultInteropLinker"); + aniEnv->Class_CallStaticMethodByName_Void(contextCls, "setDefaultInteropLinker", "C{std.core.RuntimeLinker}:", + object); + } std::string entryPath = EntryPathManager::GetInstance().GetEntryPath(srcEntrance); ani_string entryClassStr; aniEnv->String_NewUTF8(entryPath.c_str(), entryPath.length(), &entryClassStr); -- Gitee