假设手机已获得 root 权限并且可以安装 arm 二进制文件。我可以使用 Android Studio 和 printf
输出制作控制台二进制文件吗?
是否有使用带有 Android Studio 的传统 C 程序 int main()
或创建 Android.mk
文件编写和编译此类二进制文件的分步指南
GitHub 上有一些项目是这样做的:
https://github.com/strazzere/android-unpacker/tree/master/native-unpacker
和
回答1
#include <stdio.h>
int main() {
printf("Hello, world\n");
return 0;
}
然后:
~/Library/Android/sdk/ndk/24.0.8215888/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang --target=aarch64-linux-android21 helloworld.c -o helloworld
adb push helloworld /data/local/tmp/helloworld
adb shell /data/local/tmp/helloworld