Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行 demo 无 aop 效果 #1

Open
OrangesChen opened this issue Dec 15, 2021 · 4 comments
Open

运行 demo 无 aop 效果 #1

OrangesChen opened this issue Dec 15, 2021 · 4 comments

Comments

@OrangesChen
Copy link

Flutter 2.5.3 • channel unknown • unknown source Framework • revision 18116933e7 (9 weeks ago) • 2021-10-15 10:46:35 -0700 Engine • revision d3ea636dc5 Tools • Dart 2.14.4

按照最简单的直接替换 frontend_server.dart.snapshot 文件,运行项目,点击按钮,hook 方法并没有执行

@lancexin
Copy link
Owner

可能是替换的位置不对,这个和你用的flutter的环境有关系.可以试试下面的几个地方替换:

  1. flutter_macos_stable/bin/cache/artifacts/engine/darwin-x64/frontend_server.dart.snapshot
  2. flutter_macos_stable/bin/cache/dart-sdk/bin/snapshots/frontend_server.dart.snapshot

是否能够注入成功一切以我的demo是否能够注入成功为标准,需要注意的点:

  1. 在main.dart里面有引入 inject.dart,如果没引入不会起效果
  2. 在inject.dart文件里面的所有方法都是static的,不然不起效果

@LDouble
Copy link

LDouble commented Jan 5, 2022

自己编译的时候好像提示找不到FlutterProgramTransformer,
请问这个是clone了flutter engine那个third party里面的vm么

@lancexin
Copy link
Owner

lancexin commented Jan 11, 2022

@LDouble 可以注释掉再编译试一试, 可以参考一下这篇文章:https://juejin.cn/post/7034720269360955405

@WillieWu
Copy link

WillieWu commented Apr 26, 2022

flutter_macos_stable/bin/cache/dart-sdk/bin/snapshots/frontend_server.dart.snapshot

fvm 安装的flutter目录下,没有找到这个文件目录呢。flutter_macos_stable/bin/cache/dart-sdk/bin/snapshots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants