How to read the value of a private field from a different class in Java?

前端 未结 14 1898
梦毁少年i
梦毁少年i 2020-11-21 11:28

I have a poorly designed class in a 3rd-party JAR and I need to access one of its private fields. For example, why should I need to choose priv

14条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-21 11:54

    Use the Soot Java Optimization framework to directly modify the bytecode. http://www.sable.mcgill.ca/soot/

    Soot is completely written in Java and works with new Java versions.

提交回复
热议问题