Add chain-agents agent
This agent is able to chain-load other agents listed in a given file.
This is useful for testing and using persistent JVMTI agents, which
might need to have specific arguments passed to them.
Test: Install debuggable apk (here com.antonioleiva.bandhookkotlin)
walleye:/ $ run-as com.antonioleiva.bandhookkotlin sh
walleye:/data/data/com.antonioleiva.bandhookkotlin $ mkdir code_cache/startup_agents
walleye:/data/data/com.antonioleiva.bandhookkotlin $ cp /data/local/tmp/libtifasts32.so code_cache
walleye:/data/data/com.antonioleiva.bandhookkotlin $ cp /data/local/tmp/libtifasts64.so code_cache
walleye:/data/data/com.antonioleiva.bandhookkotlin $ cp /data/local/tmp/libchainagentss32.so code_cache/startup_agents/
walleye:/data/data/com.antonioleiva.bandhookkotlin $ cp /data/local/tmp/libchainagentss64.so code_cache/startup_agents/
walleye:/data/data/com.antonioleiva.bandhookkotlin $ echo $PWD/code_cache/libtifasts32.so=log,ClassLoad > chain_agents.txt
walleye:/data/data/com.antonioleiva.bandhookkotlin $ echo $PWD/code_cache/libtifasts64.so=log,ClassLoad >> chain_agents.txt
Start bandhookkotlin
Examine logcat
Bug: 135627501
Change-Id: Icd97e8cce6c540b8d1ee5e5efd7b2587707786d3
3 files changed