From 0b53b5ef28c2b1834aac93021a5bceb920e25814 Mon Sep 17 00:00:00 2001 From: Otto Eotvos Date: Fri, 30 May 2025 16:45:48 +0200 Subject: [PATCH] Update hardcoded names affected by name mangling Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/IBTJ09 Change-Id: I19d9c83e2f4b8f28c1e876d10c7b44713fe01b66 Signed-off-by: Otto Eotvos --- frameworks/ets/ani/include/sts_common.h | 4 ++-- frameworks/ets/ani/src/sts_subscribe.cpp | 2 +- frameworks/ets/ani/src/sts_template.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frameworks/ets/ani/include/sts_common.h b/frameworks/ets/ani/include/sts_common.h index 10a56d84a..a6ebc9053 100644 --- a/frameworks/ets/ani/include/sts_common.h +++ b/frameworks/ets/ani/include/sts_common.h @@ -82,7 +82,7 @@ static bool CallSetter(ani_env* env, ani_class cls, ani_object object, const cha if (env == nullptr || cls == nullptr || object == nullptr) { return false; } - std::string setterName(""); + std::string setterName("%%set-"); setterName.append(propertyName); ani_method setter; ani_status status = env->Class_FindMethod(cls, setterName.c_str(), nullptr, &setter); @@ -223,4 +223,4 @@ static bool EnumConvertNativeToAni(ani_env *env, const char *enumName, const T e } // namespace NotificationSts } // OHOS -#endif \ No newline at end of file +#endif diff --git a/frameworks/ets/ani/src/sts_subscribe.cpp b/frameworks/ets/ani/src/sts_subscribe.cpp index 11f2dd82c..b1abf5573 100644 --- a/frameworks/ets/ani/src/sts_subscribe.cpp +++ b/frameworks/ets/ani/src/sts_subscribe.cpp @@ -713,7 +713,7 @@ bool UnWarpNotificationKey(ani_env *env, const ani_object obj, NotificationKey & ani_boolean isUndefined = ANI_TRUE; ani_double idDouble = 0.0; if (!GetDoubleValueByClassName(env, obj, - "L@ohos/notificationSubscribe/notificationSubscribe/NotificationKeyInner;", "id", idDouble)) { + "L@ohos/notificationSubscribe/notificationSubscribe/NotificationKeyInner;", "%%get-id", idDouble)) { ANS_LOGD("GetDoubleValueByClassName id fail"); return false; } diff --git a/frameworks/ets/ani/src/sts_template.cpp b/frameworks/ets/ani/src/sts_template.cpp index 6c4f5fc4f..6c17b4acf 100644 --- a/frameworks/ets/ani/src/sts_template.cpp +++ b/frameworks/ets/ani/src/sts_template.cpp @@ -31,7 +31,7 @@ ani_status UnwrapNotificationTemplate(ani_env *env, ani_object aniObj, Notificat } ani_status status = ANI_ERROR; ani_ref nameRef; - if (ANI_OK != (status = env->Object_CallMethodByName_Ref(aniObj, "name", ":Lstd/core/String;", &nameRef))) { + if (ANI_OK != (status = env->Object_CallMethodByName_Ref(aniObj, "%%get-name", ":Lstd/core/String;", &nameRef))) { ANS_LOGE("Object_CallMethodByName_Ref faild. status %{public}d", status); return status; } -- Gitee