// the find
tiann/Leoric
PoC of fighting against force-stop kill process on Android
A proof-of-concept that fights Android's force-stop mechanism by spawning a daemon process using native code (JNI/NDK) that can resurrect the app even when the system kills it. Named after the Dota hero Skeleton King whose ultimate is Reincarnation. It's aimed at Android developers who need to understand how aggressive keep-alive techniques work, or OEMs who want to patch against them.
The core trick is genuinely clever — it exploits a race condition in the force-stop kill sequence, spawning a new process before the system finishes killing the old cgroup. The accompanying blog posts by the author explain the mechanism at a kernel/framework level, which is rare for this kind of hack. Clean library/app separation makes the technique easy to study in isolation. The README is honest that Android 14 patched this, saving you the debugging session.
This is explicitly a PoC frozen in 2023 with the author's own note that it's dead on Android 14+, which is now most of the active install base. There are no tests beyond the auto-generated Android template stubs. The README is in Chinese with no English translation, which limits who can actually use it for learning. There's zero documentation on what LeoricConfigs does or how to tune it, so anyone trying to adapt the library is reading JNI source with no guidance.