Skip to content

我适配了2.5.4,大大简化了注入逻辑 #136

Description

@lancexin

项目地址https://github.com/lancexin/aspect_frontend_server
现在暂时只支持execute模式

该方法和aspectd的区别

  1. aspectd不支持flutter 2.5.3,本项目是基于flutter 2.5.3测试
  2. aspectd的编译需要对dart sdk中的vm进行修改,本项目不需要
  3. aspectd使用前需要对flutter tools的代码进行修改,本项目只需要替换flutter sdk对应的frontend_server.dart.snapshot即可
  4. aspectd的实现原理过于复杂,本项目去掉了Call,Inject等用法保留了Execute用法的同时对注入逻辑进行了简化
  5. aspectd还需要aspect_impl等,本项目可以直接在主程序代码中添加注入代码,也可以用plugin的方式添加
  6. 本项目不需要引入任何第三方包,用pragma注解完成对应插桩
  7. 可以有限制支持hot reload,完全支持hot restart,免去了冷重启的烦恼
  8. 为了性能优化inject方法限制必须是static的

为什么用pragma注解,而不是自定义注解?

本项目是在aot优化后再对字节码进行修改,aot优化后只有白名单中的注解才能被识别到,pragma是在白名单中的注解.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions