Adding Pre-built Apk in AOSP crashes

后端 未结 1 1473
灰色年华
灰色年华 2020-12-22 05:21
  • AOSP 10

  • OpenVPN official App

I am trying to add OpenVPN app in AOSP but it crashes. I have ch

相关标签:
1条回答
  • 2020-12-22 05:53

    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)
    

    Tip: I used this tool to generate the Android.mk automatically: https://github.com/northbright/genandroidmk

    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 )

    0 讨论(0)
提交回复
热议问题