insomnia1232
V2EX  ›  Android

Android 中怎么在不使用反射不重打包的情况下修改第三方库的实现?

  •  
  •   insomnia1232 · Jul 19, 2019 · 13690 views
    This topic created in 2674 days ago, the information mentioned may be changed or developed.

    假如依赖了一个第三方的 aar,想修改里面某个类的实现,不拆包重打包或者用反射的话怎么做呢?用 classloader 可以实现吗?

    4 replies  •  2019-07-20 20:21:46 +08:00
    shily
    shily
    Jul 20, 2019 via Android
    1
    看需求吧,插桩可以试试 Hibeaver
    wsxyeah
    wsxyeah
    Jul 20, 2019
    2
    Transform api?
    guyeu
    guyeu
    Jul 20, 2019
    3
    不可能。。。字节码代理也好,重加载类也好,本质上都是基于反射的。
    insomnia1232
    insomnia1232
    OP
    Jul 20, 2019
    4
    @guyeu 面试被问到这个问题 应该是和热修复相关的东西?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2061 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 11:52 · PVG 19:52 · LAX 03:52 · JFK 06:52
    ♥ Do have faith in what you're doing.