From d528b539031c4c266c8304582f393e762c0efd7b Mon Sep 17 00:00:00 2001 From: zff Date: Sat, 9 Apr 2022 19:55:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=B3=BB=E7=BB=9F=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=94=AF=E6=8C=8164=E4=BD=8D=E9=9B=86=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close: #I5113F Signed-off-by: zff Change-Id: I17f1c11067132d2bd9c906aa7f0a2e14c778ea70 --- src/appspawn_server.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/appspawn_server.cpp b/src/appspawn_server.cpp index f4b55b53..75b87007 100644 --- a/src/appspawn_server.cpp +++ b/src/appspawn_server.cpp @@ -251,8 +251,12 @@ void AppSpawnServer::LoadAceLib() HiLog::Info(LABEL, "Success to dlopen libnweb_render.so"); } +#else +#ifdef __aarch64__ + std::string acelibdir("/system/lib64/libace.z.so"); #else std::string acelibdir("/system/lib/libace.z.so"); +#endif void *AceAbilityLib = nullptr; HiLog::Info(LABEL, "MainThread::LoadAbilityLibrary. Start calling dlopen acelibdir."); AceAbilityLib = dlopen(acelibdir.c_str(), RTLD_NOW | RTLD_GLOBAL); @@ -267,11 +271,16 @@ void AppSpawnServer::LoadAceLib() static void InitDebugParams(const ClientSocket::AppProperty *appProperty) { - if (access("/system/lib/libhidebug.so", F_OK) != 0) { +#ifdef __aarch64__ + const char *debugSoPath = "/system/lib64/libhidebug.so"; +#else + const char *debugSoPath = "/system/lib/libhidebug.so"; +#endif + if (access(debugSoPath, F_OK) != 0) { HiLog::Error(LABEL, "access failed, errno = %{public}d", errno); return; } - void* handle = dlopen("/system/lib/libhidebug.so", RTLD_LAZY); + void* handle = dlopen(debugSoPath, RTLD_LAZY); if (handle == nullptr) { HiLog::Error(LABEL, "Failed to dlopen libhidebug.so, %{public}s", dlerror()); return; @@ -866,7 +875,11 @@ int32_t AppSpawnServer::DoSandboxRootFolderCreate(std::string sandboxPackagePath symlinkMap["/sys/kernel/debug"] = sandboxPackagePath + "/d"; symlinkMap["/system/etc"] = sandboxPackagePath + "/etc"; symlinkMap["/system/bin/init"] = sandboxPackagePath + "/init"; +#ifdef __aarch64__ + symlinkMap["/system/lib64"] = sandboxPackagePath + "/lib64"; +#else symlinkMap["/system/lib"] = sandboxPackagePath + "/lib"; +#endif for (iter = symlinkMap.begin(); iter != symlinkMap.end(); ++iter) { symlink(iter->first.c_str(), iter->second.c_str()); -- Gitee