android - Android 5.1.1 - 构建运行方式二进制
问题描述
我正在尝试从 android lollipop 源构建一个 run-as 二进制文件。我在这里下载了 run-as 包:https ://android.googlesource.com/platform/system/core/+archive/android-cts-5.1_r28/run-as.tar.gz
好吧,这里是 Android.mk 代码:
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := run-as.c package.c
LOCAL_SHARED_LIBRARIES := libselinux
LOCAL_MODULE := run-as
LOCAL_CFLAGS := -Werror
include $(BUILD_EXECUTABLE)
当我尝试构建时,我收到此错误:
Android NDK: Module run-as depends on undefined modules: selinux
*** Android NDK: Aborting (set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies)
所以我将此行添加到我的 android.mk 文件中
APP_ALLOW_MISSING_DEPS=true
然后,我从这里(android_filesystem_config.h) 和从这里(android.h) 下载头文件,以包含 run-as.c 所需的正确头文件
但是当我再次尝试构建时,我遇到了这个错误:
./run-as.c:158: error: undefined reference to 'selinux_android_setcontext'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
我想我在构建过程中错过了一些东西......我们将不胜感激。
谢谢
解决方案
推荐阅读
- r - 如何旋转数据框以在 R 中获取计数和总和
- javascript - 坚持将 Node/Mongo 代码从回调函数重构为 Promises
- python - 如何从 Python 中的函数返回数据帧?
- python - “读取 xlsx 文件” [Errno 22] 无效参数
- docker - 没有 Dnscache Docker 无法启动
- javascript - 使用 React + Redux 以记事本形式克隆的状态管理模型
- javascript - 不断收到 Angular JS 错误,不知道为什么
- json - 带有 JSON 和嵌入式对象的 powershell
- python - 列联表怎么做
- javascript - 如何使用 JavaScript 中的 readline() 从终端中的用户输入填充数组?(没有网络)