问题描述
-
AOSP 10
OpenVPN官方应用
OpenVPN official App
我正在尝试在AOSP中添加OpenVPN应用程序,但是它崩溃了.我已经通过在设备上安装进行了检查,当我从playstore/f-droid安装它或通过adb install下载apk时,它可以正常工作.当我在aosp源代码中添加此apk时,它会添加到内部AOSP(OS)中,但是当我在设备中刷新AOSP后启动应用程序时,它在库中崩溃了,然后我在AOSP中添加了它所需的库,但是现在抛出了其他错误.在两种情况下,AOSP(OS)都是相同的.我也尝试过其他VPN应用程序,但所有问题都相同.我在AOSP中添加了其他可以正常运行的应用程序,但这些VPN应用程序无法正常工作.
I am trying to add OpenVPN app in AOSP but it crashes. I have checked it by installing in device, it works fine when I install it from playstore/f-droid or downloaded apk through adb install. When I add this apk in aosp source code it gets added in build AOSP (OS) but when I launch app after flashing AOSP in device it crashes on libraries, Then I added its required libraries in AOSP, but now its throwing other errors. AOSP (OS) is same in both scenarios. I have also tried other VPN apps but same issue with all.I have added other apps in AOSP those works fine but these VPN apps not working.
以下是应用程序崩溃的adb日志
2020-10-16 10:12:49.736 0-0/? E/q6asm_callback: payload size of 8 is less than expected.
--------- beginning of main
2020-10-16 10:12:51.759 1291-5412/? E/ACDB-LOADER: Error: ACDB AudProc vol returned = -19
2020-10-16 10:12:51.780 0-0/? E/q6asm_callback: payload size of 8 is less than expected.
2020-10-16 10:12:51.785 1568-1743/? E/system_server: Invalid ID 0x00000000.
2020-10-16 10:12:51.788 6354-6354/? E/q6asm_callback: payload size of 8 is less than expected.
2020-10-16 10:12:51.795 0-0/? E/q6asm_callback: payload size of 8 is less than expected.
2020-10-16 10:12:51.885 6354-6354/? E/SoLoader: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: couldn't map "/data/user/0/net.openvpn.openvpn/lib-main/libc++_shared.so" segment 1: Permission denied
2020-10-16 10:12:51.885 6354-6354/? E/SoLoader: couldn't find DSO to load: libfb.so caused by: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: couldn't map "/data/user/0/net.openvpn.openvpn/lib-main/libc++_shared.so" segment 1: Permission denied
2020-10-16 10:12:51.885 6354-6354/? E/SoLoader: couldn't find DSO to load: libjscexecutor.so caused by: couldn't find DSO to load: libfb.so caused by: couldn't find DSO to load: libc++_shared.so caused by: dlopen failed: couldn't map "/data/user/0/net.openvpn.openvpn/lib-main/libc++_shared.so" segment 1: Permission denied
2020-10-16 10:12:51.888 6354-6380/? E/SoLoader: couldn't find DSO to load: libhermes.so
--------- beginning of crash
2020-10-16 10:12:51.888 6354-6380/? E/AndroidRuntime: FATAL EXCEPTION: create_react_context
Process: net.openvpn.openvpn, PID: 6354
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so
at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:738)
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:591)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:529)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:484)
at com.facebook.hermes.reactexecutor.HermesExecutor.<clinit>(HermesExecutor.java:20)
at com.facebook.hermes.reactexecutor.HermesExecutorFactory.create(HermesExecutorFactory.java:27)
at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:952)
at java.lang.Thread.run(Thread.java:922)
2020-10-16 10:12:54.986 0-0/? E/q6asm_callback: payload size of 8 is less than expected.
2020-10-16 10:12:55.351 1568-4304/? E/TaskPersister: File error accessing recents directory (directory doesn't exist?).
2020-10-16 10:13:52.588 4309-4309/? E/libnfc_nci: [ERROR:NativeNfcTag.cpp(866)] nativeNfcTag_doDisconnect: tag already deactivated
2020-10-16 10:13:52.571 0-0/? E/i2c-msm-v2 c1b6000.i2c: NACK: slave not responding, ensure its powered: msgs(n:1 cur:0 tx) bc(rx:0 tx:7) mode:FIFO slv_addr:0x28 MSTR_STS:0x0d1300c8 OPER:0x00000090
我的问题已通过@RickSanchez的建议解决,但我不得不在AOSP中添加两个库,以下是@RickSanchez的make文件中给出的
推荐答案
创建一个名为OpenVPN的文件夹,将名为OpenVPN.apk的APK放入其中,并在下面放入Android.mk:
Make a folder named OpenVPN , put APK named OpenVPN.apk inside and the Android.mk below:
LOCAL_PATH := $(call my-dir)
my_archs := arm x86 arm64
my_src_arch := $(call get-prebuilt-src-arch, $(my_archs))
include $(CLEAR_VARS)
LOCAL_MODULE := OpenVPN
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_TAGS := optional
LOCAL_BUILT_MODULE_STEM := package.apk
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_CERTIFICATE := PRESIGNED
LOCAL_SRC_FILES := OpenVPN.apk
LOCAL_PREBUILT_JNI_LIBS := \
@lib/arm64-v8a/libc++_shared.so \
@lib/arm64-v8a/libconceal.so \
@lib/arm64-v8a/libfb.so \
@lib/arm64-v8a/libfolly_futures.so \
@lib/arm64-v8a/libfolly_json.so \
@lib/arm64-v8a/libglog.so \
@lib/arm64-v8a/libglog_init.so \
@lib/arm64-v8a/libhermes-executor-debug.so \
@lib/arm64-v8a/libhermes-executor-release.so \
@lib/arm64-v8a/libhermes-inspector.so \
@lib/arm64-v8a/libhttpcli.so \
@lib/arm64-v8a/libimagepipeline.so \
@lib/arm64-v8a/libjsc.so \
@lib/arm64-v8a/libjscexecutor.so \
@lib/arm64-v8a/libjsijniprofiler.so \
@lib/arm64-v8a/libjsinspector.so \
@lib/arm64-v8a/libnative-filters.so \
@lib/arm64-v8a/libnative-imagetranscoder.so \
@lib/arm64-v8a/libovpncli.so \
@lib/arm64-v8a/libreactnativeblob.so \
@lib/arm64-v8a/libreactnativejni.so \
@lib/arm64-v8a/libyoga.so
LOCAL_MODULE_TARGET_ARCH := $(my_src_arch)
include $(BUILD_PREBUILT)
提示:我使用此工具自动生成了Android.mk: https://github.com/northbright/genandroidmk
Tip: I used this tool to generate the Android.mk automatically: https://github.com/northbright/genandroidmk
如果由于某些原因无法解决问题,则将APK中的库解压缩到本地文件夹中,并使用相对路径(在 LOCAL_PREBUILT_JNI_LIBS
中使用"@"符号,但仅 lib/arm64-v8a/libc ++ _ shared.so
)
If that doesn't work for some reason, then unzip the libs from the APK into a local folder, and refer to the libs using relative path ( in LOCAL_PREBUILT_JNI_LIBS
without the "@" sign, but only lib/arm64-v8a/libc++_shared.so
)
这篇关于在AOSP中添加预构建的Apk崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!