[Ravenwood] Make FileInput/OutputStream behave like libcore
Introduce a new ClassVisitor JdkPatchVisitor in HSG to handle all bytecode patches required to workaround JRE v.s. ART libcore behavior differences. Along with the change is the introduction of a new feature "class remapping". Unlike jarjar or ClassRemapper in the ASM library, this class remapping only does the following: 1. Change the super class of all direct subclasses of the target class to the remapped class. 2. Change all NEW operand of the target class to the remapped class. 3. Redirect all INVOKESPECIAL <init> of the target class to the remapped class. By doing so, we basically force an additional layer of subclass to all usages of the target class we want to patch. This gives us the ability to change or add new behavior to classes in places where we cannot directly modify, e.g. the standard JRE classes like FIS/FOS. Bug: 397498134 Flag: EXEMPT host side change only Test: f/b/r/scripts/run-ravenwood-tests.sh Change-Id: I2c536e36c6954e30f0c5e1a1cbcdca0d7520c60b
Loading
Please register or sign in to comment