从 1.21 开始,Dart VM 还支持应用程序快照,其中包括程序训练运行期间生成的所有解析类和编译代码。
$ dart --snapshot=hello.dart.snapshot --snapshot-kind=app-jit hello.dart arguments-for-training
Hello, world!
$ dart hello.dart.snapshot arguments-for-use
Hello, world!
Run Code Online (Sandbox Code Playgroud)
现在,我如何将这个 hello.dart.snapshot 文件反编译为 hello.dart?
在java语言编写的android Apk中,我们可以使用dex2jar工具反编译apk并从class.dex中获取jar文件,但是当使用flutter框架(用dart编写)开发应用程序时,如何反编译该应用程序并获取应用程序dart类?
此图像显示在 apk 资产文件中生成的快照文件。
