<div dir="ltr">I am adding some instrumentation on the Android framework in android.widget classes using Soot. I built an instrumented framework.jar using soot but I just can not figure out how to run it onto the phone. <div><br></div><div><i>My setup:-- </i></div><div><br></div><div>I am using a Google Nexus 6P device. I have downloaded and built android source code and was able to flash it on to the device.<div><br></div><div><i>Things I have tried--</i><div><br></div><div>0. I converted framework.jar into classes.dex and classes2.dex by running dx. </div><div><br></div><div>1. I realise that the framework is packaged inside the boot.oat file. I pulled boot.oat from /system/framework/arm64/ on the device and ran oat2dex and then dex2oat to repackage boot.oat and put boot.oat back to /system/framework/arm64/ but it breaks the boot where zygote is unable to start the system_process due to some checksum related failure.</div><div><br></div><div>2. I replaced classes.dex and classes2.dex into the Android source tree at &quot;out/target/product/angler/<wbr>obj/JAVA_LIBRARIES/framework_<wbr>intermediates&quot;, but when I try to build Android, the build process does not like these dex files and deletes them. </div></div></div><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><p style="margin-top: 1em; margin-bottom: 1em;">*** Overlay change detected, clean shared intermediate files...</p></blockquote><div><p style="margin-top: 1em; margin-bottom: 1em;">To summarise my problem: <br></p></div><div><b>Given a framework.jar, a fully built Android source tree functioning on Nexus 6P device, how do I just change Android&#39;s framework.jar on the device?</b></div><div><br></div><div>Any help would be greatly appreciated.</div><div><br></div><div>Best,<br>Jia</div></div>