wrapagentproperties is a JVMTI agent that lets one change the returned values of an agents GetSystemPropert{y,ies} calls.
m libwrapagentproperties
# or 'm libwrapagentpropertiesd' with debugging checks enabled
The libraries will be built for 32-bit, 64-bit, host and target. Below examples assume you want to use the 64-bit version.
art -Xplugin:$ANDROID_HOST_OUT/lib64/libopenjdkjvmti.so -agentpath:$ANDROID_HOST_OUT/lib64/libwrapagentproperties.so=/path/to/prop.file,/path/to/agent=agent-args -cp tmp/java/helloworld.dex -Xint helloworld
-Xplugin
and -agentpath
need to be used, otherwise libtitrace agent will fail during init.libartd.so
, make sure to use the debug version of jvmti.The property file is a text file containing the values of java properties you wish to override. The format is property=value on each line. Blank lines and lines beginning with "#" are ignored.
# abc.prop abc.def=123 def.hij=a big deal