为什么arcore样本可以从位于不同apk安装位置的arcore apk加载.so

时间:2019-05-14 07:10:54

标签: android shared-libraries arcore

我在像素2中安装了最新的arcore apk(1.9)和名为hello_ar_c的acore示例。运行hello_ar_c时,有两个过程相关。一个是com.google.ar.core,另一个是com.google.ar.core.examples.c.helloar。但我发现com.google.ar.core的CPU负载为零。这意味着com.google.ar.core不运行算法。为了证明这一点。我检查了/pid/(hello_ar_c-pid)/maps。我发现从hello_ar_c安装位置加载了com.google.ar.core负载。下面是地图:

/* maps arcore .so */
/data/app/com.google.ar.core-jMwMf9SbRqZtMRT5iapBZA==/lib/arm64/libarcore_c.so
/data/app/com.google.ar.core-jMwMf9SbRqZtMRT5iapBZA==/lib/arm64/libarcore_c.so
/data/app/com.google.ar.core-jMwMf9SbRqZtMRT5iapBZA==/lib/arm64/libarcore_c.so

...
/* build from hello_ar_c sample */
/data/app/com.google.ar.core.examples.c.helloar-E-pvo9ztHnNkxQ68ouzC7w==/lib/arm64/libhello_ar_native.so
/data/app/com.google.ar.core.examples.c.helloar-E-pvo9ztHnNkxQ68ouzC7w==/lib/arm64/libhello_ar_native.so

为什么arcore可以做到这一点。我认为它没有这样做的权限。

我找到一些日志

05-14 16:48:21.567 32692 32692 I third_party/arcore/ar/core/android/sdk/session_create.cc: Dynamite load ok.
05-14 16:48:21.567 32692 32692 I third_party/arcore/java/com/google/vr/dynamite/client/native/dynamite_client.cc: Attempting to load native library arcore_c from package com.google.ar.core
05-14 16:48:21.579 32692 32692 I third_party/arcore/java/com/google/vr/dynamite/client/native/dynamite_client.cc: Dynamite::LoadNativeRemoteLibrary handle=6591254520239908165

Dynamite::LoadNativeRemoteLibrary用于从com.google.ar.core包中加载库。

0 个答案:

没有答案