From ba7c8b3402b79460c01e9fc60fda50ae738b8a55 Mon Sep 17 00:00:00 2001 From: Shimenkov Mikhail Date: Thu, 26 Jun 2025 14:47:47 +0300 Subject: [PATCH] Change ani mangling Change-Id: Ia386d4c5e92c8139808f5fb0484dac83227f43b4 Signed-off-by: Shimenkov Mikhail --- interfaces/ets/ani/hilog/src/ani_util.cpp | 16 ++++++++-------- interfaces/ets/ani/hilog/src/hilog_ani.cpp | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/interfaces/ets/ani/hilog/src/ani_util.cpp b/interfaces/ets/ani/hilog/src/ani_util.cpp index d128818..2d86a83 100644 --- a/interfaces/ets/ani/hilog/src/ani_util.cpp +++ b/interfaces/ets/ani/hilog/src/ani_util.cpp @@ -26,14 +26,14 @@ namespace OHOS { namespace HiviewDFX { const HiLogLabel LABEL = { LOG_CORE, 0xD002D00, "HILOG_ANI_UTIL" }; -constexpr char CLASS_NAME_INT[] = "Lstd/core/Int;"; -constexpr char CLASS_NAME_BOOLEAN[] = "Lstd/core/Boolean;"; -constexpr char CLASS_NAME_DOUBLE[] = "Lstd/core/Double;"; -constexpr char CLASS_NAME_STRING[] = "Lstd/core/String;"; -constexpr char CLASS_NAME_BIGINT[] = "Lescompat/BigInt;"; -constexpr char CLASS_NAME_OBJECT[] = "Lstd/core/Object;"; +constexpr char CLASS_NAME_INT[] = "std.core.Int"; +constexpr char CLASS_NAME_BOOLEAN[] = "std.core.Boolean"; +constexpr char CLASS_NAME_DOUBLE[] = "std.core.Double"; +constexpr char CLASS_NAME_STRING[] = "std.core.String"; +constexpr char CLASS_NAME_BIGINT[] = "escompat.BigInt"; +constexpr char CLASS_NAME_OBJECT[] = "std.core.Object"; constexpr char FUNCTION_TOSTRING[] = "toString"; -constexpr char MANGlING_TOSTRING[] = ":Lstd/core/String;"; +constexpr char MANGLING_TOSTRING[] = ":C{std.core.String}"; const std::pair OBJECT_TYPE[] = { {CLASS_NAME_INT, AniArgsType::ANI_INT}, {CLASS_NAME_BOOLEAN, AniArgsType::ANI_BOOLEAN}, @@ -109,7 +109,7 @@ std::string AniUtil::AniStringToStdString(ani_env *env, ani_string aniStr) std::string AniUtil::AniArgToString(ani_env *env, ani_object arg) { ani_ref argStrRef {}; - if (ANI_OK != env->Object_CallMethodByName_Ref(arg, FUNCTION_TOSTRING, MANGlING_TOSTRING, &argStrRef)) { + if (ANI_OK != env->Object_CallMethodByName_Ref(arg, FUNCTION_TOSTRING, MANGLING_TOSTRING, &argStrRef)) { HiLog::Info(LABEL, "Call ets method toString() failed."); return ""; } diff --git a/interfaces/ets/ani/hilog/src/hilog_ani.cpp b/interfaces/ets/ani/hilog/src/hilog_ani.cpp index 156f2fa..6bb1662 100644 --- a/interfaces/ets/ani/hilog/src/hilog_ani.cpp +++ b/interfaces/ets/ani/hilog/src/hilog_ani.cpp @@ -19,7 +19,7 @@ #include "hilog_ani_base.h" using namespace OHOS::HiviewDFX; -static const std::string NAMESPACE_NAME_HILOG = "L@ohos/hilog/hilog;"; +static const std::string NAMESPACE_NAME_HILOG = "@ohos.hilog.hilog"; ANI_EXPORT ani_status ANI_Constructor(ani_vm *vm, uint32_t *result) { ani_env *env; -- Gitee