For Flet 0.25.0 (#20)
* path to serious_python * full path to serious_python * doNotStrip * change abi filters order * change order again * split_per_abi * make an error in template * Fix template * Test info_plist * info plist complete * Fix elif * Another fix * Another try * simplify if * simple test * no v * remove everything * remove other options * restore infoplist * equal not is * one line * add macos_entitlements * empty list * empty array * macos entitlements * No hard-coded entitlements * Android manifest * Fix manifest * Fix template again * Remove hard-coded permissions * Fix template * true and false * remove hard-coded permissions * Android deep linking Close #4025 * Template cleanup * Signing Android builds * Fix signing options * Set FLET_APP_DATA and FLET_APP_TEMP dirs for the app * Pyodide 0.26.2 * serious_python: 0.8.0
This commit is contained in:
parent
4d4420a369
commit
5b00ffb439
|
|
@ -15,5 +15,7 @@
|
||||||
"base_url": "/",
|
"base_url": "/",
|
||||||
"route_url_strategy": "path",
|
"route_url_strategy": "path",
|
||||||
"web_renderer": "canvaskit",
|
"web_renderer": "canvaskit",
|
||||||
"use_color_emoji": "false"
|
"use_color_emoji": "false",
|
||||||
|
"split_per_abi": false,
|
||||||
|
"options": null
|
||||||
}
|
}
|
||||||
|
|
@ -31,6 +31,10 @@ android {
|
||||||
jniLibs {
|
jniLibs {
|
||||||
useLegacyPackaging true
|
useLegacyPackaging true
|
||||||
}
|
}
|
||||||
|
doNotStrip "*/arm64-v8a/libpython*.so"
|
||||||
|
doNotStrip "*/armeabi-v7a/libpython*.so"
|
||||||
|
doNotStrip "*/x86/libpython*.so"
|
||||||
|
doNotStrip "*/x86_64/libpython*.so"
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
|
|
@ -53,14 +57,31 @@ android {
|
||||||
versionCode flutterVersionCode.toInteger()
|
versionCode flutterVersionCode.toInteger()
|
||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
|
|
||||||
|
// flet: split_per_abi {% if not cookiecutter.split_per_abi %}
|
||||||
ndk {
|
ndk {
|
||||||
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64'
|
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64'
|
||||||
}
|
}
|
||||||
|
// flet: end of split_per_abi {% endif %}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// flet: android_signing {% if cookiecutter.options.android_signing %}
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
keyAlias System.getenv('FLET_ANDROID_SIGNING_KEY_ALIAS')
|
||||||
|
keyPassword System.getenv('FLET_ANDROID_SIGNING_KEY_PASSWORD')
|
||||||
|
storeFile System.getenv('FLET_ANDROID_SIGNING_KEY_STORE') ? file(System.getenv('FLET_ANDROID_SIGNING_KEY_STORE')) : null
|
||||||
|
storePassword System.getenv('FLET_ANDROID_SIGNING_KEY_STORE_PASSWORD')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// flet: end of android_signing {% endif %}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
// flet: android_signing {% if cookiecutter.options.android_signing %}
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
// {% else %}
|
||||||
signingConfig signingConfigs.debug
|
signingConfig signingConfigs.debug
|
||||||
|
// flet: end of android_signing {% endif %}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,11 @@
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<!-- flet: permission {% for k, v in cookiecutter.options.android_permissions.items() %} {% if v == True %} -->
|
||||||
<!-- Media access permissions.
|
<uses-permission android:name="{{ k }}" />
|
||||||
Android 13 or higher.
|
<!-- flet: enf of permission {% endif %} {% endfor %} -->
|
||||||
https://developer.android.com/about/versions/13/behavior-changes-13#granular-media-permissions -->
|
|
||||||
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
|
<!-- flet: feature {% for k, v in cookiecutter.options.android_features.items() %} -->
|
||||||
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
|
<uses-feature android:name="{{ k }}" android:required="{% if v == True %}true{% else %}false{% endif %}" />
|
||||||
<!-- Storage access permissions. Android 12 or lower. -->
|
<!-- flet: end of feature {% endfor %} -->
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
|
||||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
|
||||||
<!-- Geolocator background/foreground service permissions -->
|
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
|
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
|
||||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
|
||||||
<!-- Google TV -->
|
|
||||||
<uses-feature android:name="android.software.leanback" android:required="false" />
|
|
||||||
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:label="{{ cookiecutter.product_name }}"
|
android:label="{{ cookiecutter.product_name }}"
|
||||||
|
|
@ -27,7 +14,7 @@
|
||||||
android:icon="@mipmap/ic_launcher">
|
android:icon="@mipmap/ic_launcher">
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="io.flutter.embedding.android.EnableImpeller"
|
android:name="io.flutter.embedding.android.EnableImpeller"
|
||||||
android:value="false"/>
|
android:value="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
|
|
@ -47,8 +34,18 @@
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
<category android:name="android.intent.category.LEANBACK_LAUNCHER"/> <!-- Google TV -->
|
<category android:name="android.intent.category.LEANBACK_LAUNCHER" /> <!-- Google TV -->
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
<!-- flet: deep linking {% if cookiecutter.options.deep_linking_url %} -->
|
||||||
|
<meta-data android:name="flutter_deeplinking_enabled" android:value="true" />
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
<data android:scheme="{{ cookiecutter.options.deep_linking_url.scheme }}"
|
||||||
|
android:host="{{ cookiecutter.options.deep_linking_url.netloc }}" />
|
||||||
|
</intent-filter>
|
||||||
|
<!-- flet: end of deep linking {% endif %} -->
|
||||||
</activity>
|
</activity>
|
||||||
<!-- Don't delete the meta-data below.
|
<!-- Don't delete the meta-data below.
|
||||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||||
|
|
|
||||||
|
|
@ -50,9 +50,31 @@
|
||||||
<key>NSAllowsArbitraryLoads</key>
|
<key>NSAllowsArbitraryLoads</key>
|
||||||
<true />
|
<true />
|
||||||
</dict>
|
</dict>
|
||||||
<key>NSMicrophoneUsageDescription</key>
|
<!-- flet: deep linking {% if cookiecutter.options.deep_linking_url %} -->
|
||||||
<string>This app needs access to Audio Recording.</string>
|
<key>FlutterDeepLinkingEnabled</key>
|
||||||
<key>NSLocationWhenInUseUsageDescription</key>
|
<true />
|
||||||
<string>This app needs access to location.</string>
|
<key>CFBundleURLTypes</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Editor</string>
|
||||||
|
<key>CFBundleURLName</key>
|
||||||
|
<string>{{ cookiecutter.options.deep_linking_url.netloc }}</string>
|
||||||
|
<key>CFBundleURLSchemes</key>
|
||||||
|
<array>
|
||||||
|
<string>{{ cookiecutter.options.deep_linking_url.scheme }}</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
<!-- flet: end of deep linking {% endif %} -->
|
||||||
|
<!-- flet: prop {% for k, v in cookiecutter.options.info_plist.items() %} -->
|
||||||
|
<key>{{ k }}</key>
|
||||||
|
<!-- flet: True {% if v == True %} -->
|
||||||
|
<true />
|
||||||
|
<!-- flet: False {% elif v == False %} -->
|
||||||
|
<false />
|
||||||
|
<!-- flet: string value {% else %} -->
|
||||||
|
<string>{{ v }}</string>
|
||||||
|
<!-- flet: end of prop {% endif %} {% endfor %} -->
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
@ -5,7 +5,9 @@ import 'package:flet/flet.dart';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:package_info_plus/package_info_plus.dart';
|
||||||
import 'package:path/path.dart' as path;
|
import 'package:path/path.dart' as path;
|
||||||
|
import 'package:path_provider/path_provider.dart' as path_provider;
|
||||||
import 'package:serious_python/serious_python.dart';
|
import 'package:serious_python/serious_python.dart';
|
||||||
import 'package:url_strategy/url_strategy.dart';
|
import 'package:url_strategy/url_strategy.dart';
|
||||||
|
|
||||||
|
|
@ -161,6 +163,26 @@ Future prepareApp() async {
|
||||||
|
|
||||||
assetsDir = path.join(appDir, "assets");
|
assetsDir = path.join(appDir, "assets");
|
||||||
|
|
||||||
|
// configure apps DATA and TEMP directories
|
||||||
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
|
||||||
|
var appTempPath = (await path_provider.getApplicationCacheDirectory()).path;
|
||||||
|
var appDataPath =
|
||||||
|
(await path_provider.getApplicationDocumentsDirectory()).path;
|
||||||
|
|
||||||
|
if (defaultTargetPlatform != TargetPlatform.iOS &&
|
||||||
|
defaultTargetPlatform != TargetPlatform.android) {
|
||||||
|
// append app name to the path and create dir
|
||||||
|
PackageInfo packageInfo = await PackageInfo.fromPlatform();
|
||||||
|
appDataPath = path.join(appDataPath, "flet", packageInfo.packageName);
|
||||||
|
if (!await Directory(appDataPath).exists()) {
|
||||||
|
await Directory(appDataPath).create(recursive: true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
environmentVariables["FLET_APP_DATA"] = appDataPath;
|
||||||
|
environmentVariables["FLET_APP_TEMP"] = appTempPath;
|
||||||
|
|
||||||
environmentVariables["FLET_PLATFORM"] =
|
environmentVariables["FLET_PLATFORM"] =
|
||||||
defaultTargetPlatform.name.toLowerCase();
|
defaultTargetPlatform.name.toLowerCase();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,13 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>com.apple.security.app-sandbox</key>
|
<!-- flet: entitlement {% for k, v in cookiecutter.options.macos_entitlements.items() %} -->
|
||||||
<false/>
|
<key>{{ k }}</key>
|
||||||
<key>com.apple.security.cs.allow-jit</key>
|
<!-- flet: True {% if v == True %} -->
|
||||||
<true/>
|
<true />
|
||||||
<key>com.apple.security.network.server</key>
|
<!-- flet: False {% elif v == False %} -->
|
||||||
<true/>
|
<false />
|
||||||
<key>com.apple.security.network.client</key>
|
<!-- flet: end of entitlement {% endif %} {% endfor %} -->
|
||||||
<true/>
|
</dict>
|
||||||
<key>com.apple.security.device.audio-input</key>
|
|
||||||
<true/>
|
|
||||||
<key>com.apple.security.personal-information.location</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
</plist>
|
||||||
|
|
@ -28,9 +28,14 @@
|
||||||
<string>MainMenu</string>
|
<string>MainMenu</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string>NSApplication</string>
|
<string>NSApplication</string>
|
||||||
<key>NSMicrophoneUsageDescription</key>
|
<!-- flet: prop {% for k, v in cookiecutter.options.info_plist.items() %} -->
|
||||||
<string>This app needs access to Audio Recording.</string>
|
<key>{{ k }}</key>
|
||||||
<key>NSLocationUsageDescription</key>
|
<!-- flet: True {% if v == True %} -->
|
||||||
<string>This app needs access to location.</string>
|
<true />
|
||||||
|
<!-- flet: False {% elif v == False %} -->
|
||||||
|
<false />
|
||||||
|
<!-- flet: string value {% else %} -->
|
||||||
|
<string>{{ v }}</string>
|
||||||
|
<!-- flet: end of prop {% endif %} {% endfor %} -->
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
@ -1,15 +1,13 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>com.apple.security.app-sandbox</key>
|
<!-- flet: entitlement {% for k, v in cookiecutter.options.macos_entitlements.items() %} -->
|
||||||
<false/>
|
<key>{{ k }}</key>
|
||||||
<key>com.apple.security.network.client</key>
|
<!-- flet: True {% if v == True %} -->
|
||||||
<true/>
|
<true />
|
||||||
<key>com.apple.security.device.audio-input</key>
|
<!-- flet: False {% elif v == False %} -->
|
||||||
<true/>
|
<false />
|
||||||
<key>com.apple.security.personal-information.location</key>
|
<!-- flet: end of entitlement {% endif %} {% endfor %} -->
|
||||||
<true/>
|
</dict>
|
||||||
</dict>
|
|
||||||
</plist>
|
</plist>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,16 +11,17 @@ dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
serious_python: 0.7.1
|
serious_python: 0.8.0
|
||||||
flet: 0.24.1
|
flet: 0.24.1
|
||||||
|
|
||||||
path: ^1.9.0
|
path: ^1.9.0
|
||||||
url_strategy: ^0.2.0
|
url_strategy: ^0.2.0
|
||||||
cupertino_icons: ^1.0.6
|
cupertino_icons: ^1.0.6
|
||||||
|
path_provider: ^2.1.4
|
||||||
|
package_info_plus: ^8.0.2
|
||||||
|
|
||||||
dependency_overrides:
|
dependency_overrides:
|
||||||
wakelock_plus: ^1.2.5
|
wakelock_plus: ^1.2.5
|
||||||
package_info_plus: ^8.0.0
|
|
||||||
web: ^1.0.0
|
web: ^1.0.0
|
||||||
|
|
||||||
# {% if 'flet_audio_recorder' in cookiecutter.flutter.dependencies %}
|
# {% if 'flet_audio_recorder' in cookiecutter.flutter.dependencies %}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
importScripts("https://cdn.jsdelivr.net/pyodide/v0.25.0/full/pyodide.js");
|
importScripts("https://cdn.jsdelivr.net/pyodide/v0.26.2/full/pyodide.js");
|
||||||
|
|
||||||
self.pythonModuleName = null;
|
self.pythonModuleName = null;
|
||||||
self.initialized = false;
|
self.initialized = false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue