@@ -69,6 +69,12 @@ OPTIONS:\n\
69
69
This also requires a libflutter_engine.so that was\n\
70
70
built with --runtime-mode=release.\n\
71
71
\n\
72
+ --profile Run the app in profile mode. The AOT snapshot\n\
73
+ of the app (\"app.so\") must be located inside the\n\
74
+ asset bundle directory.\n\
75
+ This also requires a libflutter_engine.so that was\n\
76
+ built with --runtime-mode=profile.\n\
77
+ \n\
72
78
-o, --orientation <orientation> Start the app in this orientation. Valid\n\
73
79
for <orientation> are: portrait_up, landscape_left,\n\
74
80
portrait_down, landscape_right.\n\
@@ -1341,7 +1347,7 @@ static int init_display(void) {
1341
1347
1342
1348
if (horizontal_dpi != vertical_dpi ) {
1343
1349
// See https://github.com/flutter/flutter/issues/71865 for current status of this issue.
1344
- fprintf (stderr , "[flutter-pi] WARNING: display has non-square pixels. Non-square-pixels are not supported by flutter .\n" );
1350
+ fprintf (stderr , "[flutter-pi] WARNING: display has non-square pixels. Non-square-pixels are ;-) .\n" );
1345
1351
}
1346
1352
}
1347
1353
@@ -1680,7 +1686,18 @@ static int init_application(void) {
1680
1686
int ok ;
1681
1687
1682
1688
libflutter_engine_handle = NULL ;
1683
- if (flutterpi .flutter .runtime_mode == kRelease ) {
1689
+
1690
+ libflutter_engine_handle = dlopen (flutterpi .flutter .libflutter_engine_path , RTLD_LOCAL | RTLD_NOW );
1691
+
1692
+ if (libflutter_engine_handle == NULL )
1693
+ {
1694
+ LOG_FLUTTERPI_ERROR (
1695
+ "[flutter-pi] Warning: Could not load libflutter_engine.so inside the asset bundle : "
1696
+ "%s. Trying to open libflutter_engine.so.${runtimeMode} ...\n" ,
1697
+ dlerror ());
1698
+ }
1699
+
1700
+ if (flutterpi .flutter .runtime_mode == kRelease ) {
1684
1701
libflutter_engine_handle = dlopen ("libflutter_engine.so.release" , RTLD_LOCAL | RTLD_NOW );
1685
1702
if (libflutter_engine_handle == NULL ) {
1686
1703
LOG_FLUTTERPI_ERROR ("[flutter-pi] Warning: Could not load libflutter_engine.so.release: %s. Trying to open libflutter_engine.so...\n" , dlerror ());
@@ -2094,7 +2111,7 @@ static int init_user_input(void) {
2094
2111
2095
2112
2096
2113
static bool setup_paths (void ) {
2097
- char * kernel_blob_path , * icu_data_path , * app_elf_path ;
2114
+ char * kernel_blob_path , * icu_data_path , * app_elf_path , * libflutter_engine_path ;
2098
2115
#define PATH_EXISTS (path ) (access((path),R_OK)==0)
2099
2116
2100
2117
if (!PATH_EXISTS (flutterpi .flutter .asset_bundle_path )) {
@@ -2123,11 +2140,15 @@ static bool setup_paths(void) {
2123
2140
return false;
2124
2141
}
2125
2142
2126
- flutterpi .flutter .kernel_blob_path = kernel_blob_path ;
2143
+ asprintf (& libflutter_engine_path , "%s/libflutter_engine.so" , flutterpi .flutter .asset_bundle_path );
2144
+
2145
+
2146
+ flutterpi .flutter .kernel_blob_path = kernel_blob_path ;
2127
2147
flutterpi .flutter .icu_data_path = icu_data_path ;
2128
2148
flutterpi .flutter .app_elf_path = app_elf_path ;
2149
+ flutterpi .flutter .libflutter_engine_path = libflutter_engine_path ;
2129
2150
2130
- return true;
2151
+ return true;
2131
2152
2132
2153
#undef PATH_EXISTS
2133
2154
}
0 commit comments