How to launch a native server application (ELF) on a rooted Android at/after boot?

自古美人都是妖i 提交于 2020-01-24 21:14:25

问题


I have a rooted Android tablet. I've copied my native server application (Linux ARM ELF) to /data/tmp and it runs. There is only one thing missing: I want to launch the server when the tablet boots up. There are several circumstances, which makes the mission easier:

  • the device is already rooted, I can copy anything to it,
  • no installer required, the mission is completed, when the autostart is once set up,
  • my server program requires no settings, no files, no libs, no root right, nothing at all.

I don't wanna play with creating APK package, nor play with NDK. I am searching for the easiest way. It is OK, if there's different solution for different Android distros (I am insterested in current versions, 2.2 and 2.3).

Maybe I should use inittab? Anyway, I prefer "most official" solution, if we can talk "official" in case of a rooted device, let's say I'm looking for solution with "as less hack just as possible".

Update: I found this: http://www.androidenea.com/2009/08/init-process-and-initrc.html - I'll try it and close the question, if it's OK.


回答1:


The easiest way is an APK. I believe you can create a service that launches on boot and then execute your ELF from there. Your APK can also provide a "configuration" app which lets you install/uninstall the ELF so all files can be cleaned up if the user removes the application APK.



来源:https://stackoverflow.com/questions/8524666/how-to-launch-a-native-server-application-elf-on-a-rooted-android-at-after-boo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!