diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f3b846a16..f8c86617e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -50,9 +50,15 @@ jobs: echo "${{ secrets.KEY_JKS }}" > release.keystore.asc gpg -d --passphrase "${{ secrets.KEY_JKS_PASSPHRASE }}" --batch release.keystore.asc > $AVES_STORE_FILE rm release.keystore.asc - flutter build appbundle --flavor universal --bundle-sksl-path shaders_2.5.3.sksl.json - flutter build apk --flavor universal --bundle-sksl-path shaders_2.5.3.sksl.json - flutter build apk --flavor byAbi --split-per-abi --bundle-sksl-path shaders_2.5.3.sksl.json + mkdir outputs + (cd scripts/; ./apply_flavor_play.sh) + flutter build appbundle -t lib/main_play.dart --flavor play --bundle-sksl-path shaders_2.5.3.sksl.json + cp build/app/outputs/bundle/playRelease/*.aab outputs + flutter build apk -t lib/main_play.dart --flavor play --bundle-sksl-path shaders_2.5.3.sksl.json + cp build/app/outputs/apk/play/release/*.apk outputs + (cd scripts/; ./apply_flavor_izzy.sh) + flutter build apk -t lib/main_izzy.dart --flavor izzy --split-per-abi --bundle-sksl-path shaders_2.5.3.sksl.json + cp build/app/outputs/apk/izzy/release/*.apk outputs rm $AVES_STORE_FILE env: AVES_STORE_FILE: ${{ github.workspace }}/key.jks @@ -64,14 +70,14 @@ jobs: - name: Create a release with the APK and App Bundle. uses: ncipollo/release-action@v1 with: - artifacts: "build/app/outputs/bundle/universalRelease/*.aab,build/app/outputs/apk/universal/release/*.apk,build/app/outputs/apk/byAbi/release/*.apk" + artifacts: "outputs/*" token: ${{ secrets.GITHUB_TOKEN }} - name: Upload app bundle uses: actions/upload-artifact@v2 with: name: appbundle - path: build/app/outputs/bundle/universalRelease/app-universal-release.aab + path: outputs/app-play-release.aab release: name: Create beta release on Play Store. @@ -90,7 +96,7 @@ jobs: with: serviceAccountJsonPlainText: ${{ secrets.PLAYSTORE_ACCOUNT_KEY }} packageName: deckers.thibault.aves - releaseFiles: app-universal-release.aab + releaseFiles: app-play-release.aab track: beta status: completed whatsNewDirectory: whatsnew diff --git a/README.md b/README.md index 0603e79f4..e402b934d 100644 --- a/README.md +++ b/README.md @@ -50,13 +50,22 @@ At this stage this project does *not* accept PRs, except for translations. If you want to translate this app in your language and share the result, feel free to open a PR or send the translation by [email](mailto:gallery.aves@gmail.com). You can find some localization notes in [pubspec.yaml](https://github.com/deckerst/aves/blob/develop/pubspec.yaml). English, Korean and French (soon™) are already handled. ### Donations + Some users have expressed the wish to financially support the project. I haven't set up any sponsorship system, but you can send contributions [here](https://paypal.me/ThibaultDeckers). Thanks! ❤️ ## Project Setup +Before running or building the app, update the dependencies for the desired flavor: +``` +# (cd scripts/; ./apply_flavor_play.sh) +``` + To build the project, create a file named `/android/key.properties`. It should contain a reference to a keystore for app signing, and other necessary credentials. See [key_template.properties](https://github.com/deckerst/aves/blob/develop/android/key_template.properties) for the expected keys. -You can run the app with `flutter run --flavor universal`. +To run the app: +``` +# flutter run -t lib/main_play.dart --flavor play +``` [Version badge]: https://img.shields.io/github/v/release/deckerst/aves?include_prereleases&sort=semver [Build badge]: https://img.shields.io/github/workflow/status/deckerst/aves/Quality%20check diff --git a/android/app/build.gradle b/android/app/build.gradle index 8cf3179fb..e46719768 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -2,8 +2,6 @@ plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-kapt' - id 'com.google.gms.google-services' - id 'com.google.firebase.crashlytics' } def appId = "deckers.thibault.aves" @@ -77,18 +75,25 @@ android { } } - // the "splitting" dimension and its flavors are only for building purposes: - // NDK ABI filters are not compatible with split APK generation - // but we want to generate both a universal APK without x86 libs, and split APKs - flavorDimensions "splitting" + flavorDimensions "store" productFlavors { - universal { - dimension "splitting" + play { + // Google Play + dimension "store" + ext.useCrashlytics = true + // generate a universal APK without x86 native libs + ext.useNdkAbiFilters = true } - byAbi { - dimension "splitting" + izzy { + // IzzyOnDroid + // check offending libraries with `scanapk` + // cf https://android.izzysoft.de/articles/named/app-modules-2 + dimension "store" + ext.useCrashlytics = false + // generate APK by ABI, but NDK ABI filters are incompatible with split APK generation + ext.useNdkAbiFilters = false } } @@ -108,14 +113,16 @@ android { proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } - def runTasks = gradle.startParameter.taskNames.toString().toLowerCase() - if (runTasks.contains("universal")) { - release { - // specify architectures, to specifically exclude native libs for x86, - // which lead to: UnsatisfiedLinkError...couldn't find "libflutter.so" - // cf https://github.com/flutter/flutter/issues/37566#issuecomment-640879500 - ndk { - abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64' + android.productFlavors.each { flavor -> + def tasks = gradle.startParameter.taskNames.toString().toLowerCase() + if (tasks.contains(flavor.name) && flavor.ext.useNdkAbiFilters) { + release { + // specify architectures, to specifically exclude native libs for x86, + // which lead to: UnsatisfiedLinkError...couldn't find "libflutter.so" + // cf https://github.com/flutter/flutter/issues/37566#issuecomment-640879500 + ndk { + abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64' + } } } } @@ -132,7 +139,7 @@ repositories { } dependencies { - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1' implementation 'androidx.core:core-ktx:1.6.0' implementation 'androidx.exifinterface:exifinterface:1.3.3' implementation 'androidx.multidex:multidex:2.0.1' @@ -150,3 +157,12 @@ dependencies { compileOnly rootProject.findProject(':streams_channel') } + +android.productFlavors.each { flavor -> + def tasks = gradle.startParameter.taskRequests.toString().toLowerCase() + if (tasks.contains(flavor.name) && flavor.ext.useCrashlytics) { + println("Building flavor with Crashlytics [${flavor.name}] - applying plugin") + apply plugin: 'com.google.gms.google-services' + apply plugin: 'com.google.firebase.crashlytics' + } +} diff --git a/android/build.gradle b/android/build.gradle index f4a02033b..7d6fe6924 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,8 +6,9 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' + classpath 'com.android.tools.build:gradle:7.0.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + // GMS & Firebase Crashlytics are not actually used by all flavors classpath 'com.google.gms:google-services:4.3.10' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1' } diff --git a/assets/terms.md b/assets/terms.md index 101150057..0934b7ae8 100644 --- a/assets/terms.md +++ b/assets/terms.md @@ -9,7 +9,7 @@ This app is released “as-is”, without any warranty, responsibility or liabil # Privacy policy Aves does not collect any personal data in its standard use. We never have access to your photos and videos. This also means that we cannot get them back for you if you delete them without backing them up. -__We collect anonymous data to improve the app.__ We use Google Firebase for Crash Reporting, and the anonymous data are stored on their servers. Please note that those are anonymous data, there is absolutely nothing personal about those data. +In the “Play” edition of Aves, __anonymous data is collected to improve the app.__ We use Firebase Crashlytics, and the anonymous data are stored on their servers. Please note that those are anonymous data, there is absolutely nothing personal about those data. ## Links [Sources](https://github.com/deckerst/aves) diff --git a/lib/app_flavor.dart b/lib/app_flavor.dart new file mode 100644 index 000000000..4dfcd54d6 --- /dev/null +++ b/lib/app_flavor.dart @@ -0,0 +1,5 @@ +enum AppFlavor { play, izzy } + +extension ExtraAppFlavor on AppFlavor { + bool get canEnableErrorReporting => this == AppFlavor.play; +} diff --git a/lib/main.dart b/lib/main_common.dart similarity index 90% rename from lib/main.dart rename to lib/main_common.dart index 1bbc8c2f3..98d2790f0 100644 --- a/lib/main.dart +++ b/lib/main_common.dart @@ -1,10 +1,11 @@ import 'dart:isolate'; +import 'package:aves/app_flavor.dart'; import 'package:aves/services/common/services.dart'; import 'package:aves/widgets/aves_app.dart'; import 'package:flutter/material.dart'; -void main() { +void mainCommon(AppFlavor flavor) { // HttpClient.enableTimelineLogging = true; // enable network traffic logging // debugPrintGestureArenaDiagnostics = true; @@ -27,5 +28,5 @@ void main() { reportService.recordError(errorAndStacktrace.first, errorAndStacktrace.last); }).sendPort); - runApp(const AvesApp()); + runApp(AvesApp(flavor: flavor)); } diff --git a/lib/main_izzy.dart b/lib/main_izzy.dart new file mode 100644 index 000000000..4d3e27549 --- /dev/null +++ b/lib/main_izzy.dart @@ -0,0 +1,6 @@ +import 'package:aves/app_flavor.dart'; +import 'package:aves/main_common.dart'; + +void main() { + mainCommon(AppFlavor.izzy); +} diff --git a/lib/main_play.dart b/lib/main_play.dart new file mode 100644 index 000000000..503d95000 --- /dev/null +++ b/lib/main_play.dart @@ -0,0 +1,6 @@ +import 'package:aves/app_flavor.dart'; +import 'package:aves/main_common.dart'; + +void main() { + mainCommon(AppFlavor.play); +} diff --git a/lib/services/common/services.dart b/lib/services/common/services.dart index 9963efef7..795571bfb 100644 --- a/lib/services/common/services.dart +++ b/lib/services/common/services.dart @@ -7,9 +7,10 @@ import 'package:aves/services/media/media_file_service.dart'; import 'package:aves/services/media/media_store_service.dart'; import 'package:aves/services/metadata/metadata_edit_service.dart'; import 'package:aves/services/metadata/metadata_fetch_service.dart'; -import 'package:aves/services/report_service.dart'; import 'package:aves/services/storage_service.dart'; import 'package:aves/services/window_service.dart'; +import 'package:aves_report/aves_report.dart'; +import 'package:aves_report_platform/aves_report_platform.dart'; import 'package:get_it/get_it.dart'; import 'package:path/path.dart' as p; @@ -42,7 +43,7 @@ void initPlatformServices() { getIt.registerLazySingleton(() => PlatformMediaStoreService()); getIt.registerLazySingleton(() => PlatformMetadataEditService()); getIt.registerLazySingleton(() => PlatformMetadataFetchService()); - getIt.registerLazySingleton(() => CrashlyticsReportService()); + getIt.registerLazySingleton(() => PlatformReportService()); getIt.registerLazySingleton(() => PlatformStorageService()); getIt.registerLazySingleton(() => PlatformWindowService()); } diff --git a/lib/utils/constants.dart b/lib/utils/constants.dart index 4ef6ce2d9..1a7bc6d45 100644 --- a/lib/utils/constants.dart +++ b/lib/utils/constants.dart @@ -1,5 +1,6 @@ import 'dart:ui'; +import 'package:aves/app_flavor.dart'; import 'package:flutter/material.dart'; import 'package:flutter/painting.dart'; import 'package:latlong2/latlong.dart'; @@ -86,7 +87,7 @@ class Constants { ), ]; - static const List flutterPlugins = [ + static const List _flutterPluginsCommon = [ Dependency( name: 'Connectivity Plus', license: 'BSD 3-Clause', @@ -99,11 +100,6 @@ class Constants { licenseUrl: 'https://github.com/fluttercommunity/plus_plugins/blob/main/packages/device_info_plus/device_info_plus/LICENSE', sourceUrl: 'https://github.com/fluttercommunity/plus_plugins/tree/main/packages/device_info_plus', ), - Dependency( - name: 'FlutterFire (Core, Crashlytics)', - license: 'BSD 3-Clause', - sourceUrl: 'https://github.com/FirebaseExtended/flutterfire', - ), Dependency( name: 'fijkplayer (Aves fork)', license: 'MIT', @@ -160,6 +156,19 @@ class Constants { ), ]; + static const List _flutterPluginsPlayOnly = [ + Dependency( + name: 'FlutterFire (Core, Crashlytics)', + license: 'BSD 3-Clause', + sourceUrl: 'https://github.com/FirebaseExtended/flutterfire', + ), + ]; + + static List flutterPlugins(AppFlavor flavor) => [ + ..._flutterPluginsCommon, + if (flavor == AppFlavor.play) ..._flutterPluginsPlayOnly, + ]; + static const List flutterPackages = [ Dependency( name: 'Charts', diff --git a/lib/widgets/about/bug_report.dart b/lib/widgets/about/bug_report.dart index 094fd6de4..a448982bd 100644 --- a/lib/widgets/about/bug_report.dart +++ b/lib/widgets/about/bug_report.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'dart:io'; import 'dart:typed_data'; +import 'package:aves/app_flavor.dart'; import 'package:aves/flutter_version.dart'; import 'package:aves/ref/mime_types.dart'; import 'package:aves/services/common/services.dart'; @@ -33,7 +34,7 @@ class _BugReportState extends State with FeedbackMixin { @override void initState() { super.initState(); - _infoLoader = _getInfo(); + _infoLoader = _getInfo(context); } @override @@ -123,12 +124,13 @@ class _BugReportState extends State with FeedbackMixin { ); } - Future _getInfo() async { + Future _getInfo(BuildContext context) async { final packageInfo = await PackageInfo.fromPlatform(); final androidInfo = await DeviceInfoPlugin().androidInfo; final hasPlayServices = await availability.hasPlayServices; + final flavor = context.read().toString().split('.')[1]; return [ - 'Aves version: ${packageInfo.version} (Build ${packageInfo.buildNumber})', + 'Aves version: ${packageInfo.version}-$flavor (Build ${packageInfo.buildNumber})', 'Flutter version: ${version['frameworkVersion']} (Channel ${version['channel']})', 'Android version: ${androidInfo.version.release} (SDK ${androidInfo.version.sdkInt})', 'Device: ${androidInfo.manufacturer} ${androidInfo.model}', diff --git a/lib/widgets/about/licenses.dart b/lib/widgets/about/licenses.dart index 86c5b43aa..3de3ae949 100644 --- a/lib/widgets/about/licenses.dart +++ b/lib/widgets/about/licenses.dart @@ -1,3 +1,4 @@ +import 'package:aves/app_flavor.dart'; import 'package:aves/ref/brand_colors.dart'; import 'package:aves/utils/constants.dart'; import 'package:aves/widgets/common/basic/link_chip.dart'; @@ -6,6 +7,7 @@ import 'package:aves/widgets/common/identity/aves_expansion_tile.dart'; import 'package:aves/widgets/common/identity/buttons.dart'; import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class Licenses extends StatefulWidget { const Licenses({Key? key}) : super(key: key); @@ -22,7 +24,7 @@ class _LicensesState extends State { void initState() { super.initState(); _platform = List.from(Constants.androidDependencies); - _flutterPlugins = List.from(Constants.flutterPlugins); + _flutterPlugins = List.from(Constants.flutterPlugins(context.read())); _flutterPackages = List.from(Constants.flutterPackages); _dartPackages = List.from(Constants.dartPackages); _sortPackages(); diff --git a/lib/widgets/aves_app.dart b/lib/widgets/aves_app.dart index bd774b3c3..5b93ba4d4 100644 --- a/lib/widgets/aves_app.dart +++ b/lib/widgets/aves_app.dart @@ -1,5 +1,6 @@ import 'dart:ui'; +import 'package:aves/app_flavor.dart'; import 'package:aves/app_mode.dart'; import 'package:aves/model/settings/accessibility_animations.dart'; import 'package:aves/model/settings/screen_on.dart'; @@ -29,7 +30,12 @@ import 'package:provider/provider.dart'; import 'package:tuple/tuple.dart'; class AvesApp extends StatefulWidget { - const AvesApp({Key? key}) : super(key: key); + final AppFlavor flavor; + + const AvesApp({ + Key? key, + required this.flavor, + }) : super(key: key); @override _AvesAppState createState() => _AvesAppState(); @@ -68,59 +74,62 @@ class _AvesAppState extends State { Widget build(BuildContext context) { // place the settings provider above `MaterialApp` // so it can be used during navigation transitions - return ChangeNotifierProvider.value( - value: settings, - child: ListenableProvider>.value( - value: appModeNotifier, - child: Provider.value( - value: _mediaStoreSource, - child: DurationsProvider( - child: HighlightInfoProvider( - child: OverlaySupport( - child: FutureBuilder( - future: _appSetup, - builder: (context, snapshot) { - final initialized = !snapshot.hasError && snapshot.connectionState == ConnectionState.done; - final home = initialized - ? getFirstPage() - : Scaffold( - body: snapshot.hasError ? _buildError(snapshot.error!) : const SizedBox(), + return Provider.value( + value: widget.flavor, + child: ChangeNotifierProvider.value( + value: settings, + child: ListenableProvider>.value( + value: appModeNotifier, + child: Provider.value( + value: _mediaStoreSource, + child: DurationsProvider( + child: HighlightInfoProvider( + child: OverlaySupport( + child: FutureBuilder( + future: _appSetup, + builder: (context, snapshot) { + final initialized = !snapshot.hasError && snapshot.connectionState == ConnectionState.done; + final home = initialized + ? getFirstPage() + : Scaffold( + body: snapshot.hasError ? _buildError(snapshot.error!) : const SizedBox(), + ); + return Selector>( + selector: (context, s) => Tuple2(s.locale, s.initialized ? s.accessibilityAnimations.animate : true), + builder: (context, s, child) { + final settingsLocale = s.item1; + final areAnimationsEnabled = s.item2; + return MaterialApp( + navigatorKey: _navigatorKey, + home: home, + navigatorObservers: _navigatorObservers, + builder: (context, child) { + if (!areAnimationsEnabled) { + child = Theme( + data: Theme.of(context).copyWith( + // strip page transitions used by `MaterialPageRoute` + pageTransitionsTheme: DirectPageTransitionsTheme(), + ), + child: child!, + ); + } + return child!; + }, + onGenerateTitle: (context) => context.l10n.appName, + darkTheme: Themes.darkTheme, + themeMode: ThemeMode.dark, + locale: settingsLocale, + localizationsDelegates: const [ + ...AppLocalizations.localizationsDelegates, + ], + supportedLocales: AppLocalizations.supportedLocales, + // checkerboardRasterCacheImages: true, + // checkerboardOffscreenLayers: true, ); - return Selector>( - selector: (context, s) => Tuple2(s.locale, s.initialized ? s.accessibilityAnimations.animate : true), - builder: (context, s, child) { - final settingsLocale = s.item1; - final areAnimationsEnabled = s.item2; - return MaterialApp( - navigatorKey: _navigatorKey, - home: home, - navigatorObservers: _navigatorObservers, - builder: (context, child) { - if (!areAnimationsEnabled) { - child = Theme( - data: Theme.of(context).copyWith( - // strip page transitions used by `MaterialPageRoute` - pageTransitionsTheme: DirectPageTransitionsTheme(), - ), - child: child!, - ); - } - return child!; - }, - onGenerateTitle: (context) => context.l10n.appName, - darkTheme: Themes.darkTheme, - themeMode: ThemeMode.dark, - locale: settingsLocale, - localizationsDelegates: const [ - ...AppLocalizations.localizationsDelegates, - ], - supportedLocales: AppLocalizations.supportedLocales, - // checkerboardRasterCacheImages: true, - // checkerboardOffscreenLayers: true, - ); - }, - ); - }, + }, + ); + }, + ), ), ), ), diff --git a/lib/widgets/debug/app_debug_page.dart b/lib/widgets/debug/app_debug_page.dart index fdf0be831..742455f33 100644 --- a/lib/widgets/debug/app_debug_page.dart +++ b/lib/widgets/debug/app_debug_page.dart @@ -50,7 +50,7 @@ class _AppDebugPageState extends State { const DebugAndroidEnvironmentSection(), const DebugCacheSection(), const DebugAppDatabaseSection(), - const DebugFirebaseSection(), + const DebugErrorReportingSection(), const DebugSettingsSection(), const DebugStorageSection(), ], diff --git a/lib/widgets/debug/report.dart b/lib/widgets/debug/report.dart index 27227e4c2..b97df4b14 100644 --- a/lib/widgets/debug/report.dart +++ b/lib/widgets/debug/report.dart @@ -2,11 +2,10 @@ import 'package:aves/services/android_debug_service.dart'; import 'package:aves/services/common/services.dart'; import 'package:aves/widgets/common/identity/aves_expansion_tile.dart'; import 'package:aves/widgets/viewer/info/common.dart'; -import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/material.dart'; -class DebugFirebaseSection extends StatelessWidget { - const DebugFirebaseSection({Key? key}) : super(key: key); +class DebugErrorReportingSection extends StatelessWidget { + const DebugErrorReportingSection({Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -51,10 +50,7 @@ class DebugFirebaseSection extends StatelessWidget { Padding( padding: const EdgeInsets.only(left: 8, right: 8, bottom: 8), child: InfoRowGroup( - info: { - 'Firebase data collection enabled': '${Firebase.app().isAutomaticDataCollectionEnabled}', - 'Crashlytics collection enabled': '${reportService.isCollectionEnabled}', - }, + info: reportService.state, ), ) ], diff --git a/lib/widgets/settings/privacy/privacy.dart b/lib/widgets/settings/privacy/privacy.dart index 75a1a2523..114a38603 100644 --- a/lib/widgets/settings/privacy/privacy.dart +++ b/lib/widgets/settings/privacy/privacy.dart @@ -1,3 +1,4 @@ +import 'package:aves/app_flavor.dart'; import 'package:aves/model/settings/settings.dart'; import 'package:aves/theme/icons.dart'; import 'package:aves/utils/color_utils.dart'; @@ -20,8 +21,7 @@ class PrivacySection extends StatelessWidget { @override Widget build(BuildContext context) { - final currentIsErrorReportingEnabled = context.select((s) => s.isErrorReportingEnabled); - final currentSaveSearchHistory = context.select((s) => s.saveSearchHistory); + final canEnableErrorReporting = context.select((v) => v.canEnableErrorReporting); return AvesExpansionTile( leading: SettingsTileLeading( @@ -32,20 +32,27 @@ class PrivacySection extends StatelessWidget { expandedNotifier: expandedNotifier, showHighlight: false, children: [ - SwitchListTile( - value: currentIsErrorReportingEnabled, - onChanged: (v) => settings.isErrorReportingEnabled = v, - title: Text(context.l10n.settingsEnableErrorReporting), - ), - SwitchListTile( - value: currentSaveSearchHistory, - onChanged: (v) { - settings.saveSearchHistory = v; - if (!v) { - settings.searchHistory = []; - } - }, - title: Text(context.l10n.settingsSaveSearchHistory), + if (canEnableErrorReporting) + Selector( + selector: (context, s) => s.isErrorReportingEnabled, + builder: (context, current, child) => SwitchListTile( + value: current, + onChanged: (v) => settings.isErrorReportingEnabled = v, + title: Text(context.l10n.settingsEnableErrorReporting), + ), + ), + Selector( + selector: (context, s) => s.saveSearchHistory, + builder: (context, current, child) => SwitchListTile( + value: current, + onChanged: (v) { + settings.saveSearchHistory = v; + if (!v) { + settings.searchHistory = []; + } + }, + title: Text(context.l10n.settingsSaveSearchHistory), + ), ), const HiddenFilterTile(), const HiddenPathTile(), diff --git a/lib/widgets/welcome_page.dart b/lib/widgets/welcome_page.dart index 91a3c3361..1f99bbd13 100644 --- a/lib/widgets/welcome_page.dart +++ b/lib/widgets/welcome_page.dart @@ -1,3 +1,4 @@ +import 'package:aves/app_flavor.dart'; import 'package:aves/model/settings/settings.dart'; import 'package:aves/theme/durations.dart'; import 'package:aves/widgets/common/basic/labeled_checkbox.dart'; @@ -100,16 +101,18 @@ class _WelcomePageState extends State { } List _buildBottomControls(BuildContext context) { + final canEnableErrorReporting = context.select((v) => v.canEnableErrorReporting); final checkboxes = Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - LabeledCheckbox( - value: settings.isErrorReportingEnabled, - onChanged: (v) { - if (v != null) setState(() => settings.isErrorReportingEnabled = v); - }, - text: context.l10n.welcomeCrashReportToggle, - ), + if (canEnableErrorReporting) + LabeledCheckbox( + value: settings.isErrorReportingEnabled, + onChanged: (v) { + if (v != null) setState(() => settings.isErrorReportingEnabled = v); + }, + text: context.l10n.welcomeCrashReportToggle, + ), LabeledCheckbox( // key is expected by test driver key: const Key('agree-checkbox'), diff --git a/plugins/aves_report/.gitignore b/plugins/aves_report/.gitignore new file mode 100644 index 000000000..e9dc58d3d --- /dev/null +++ b/plugins/aves_report/.gitignore @@ -0,0 +1,7 @@ +.DS_Store +.dart_tool/ + +.packages +.pub/ + +build/ diff --git a/plugins/aves_report/.metadata b/plugins/aves_report/.metadata new file mode 100644 index 000000000..5bed5265e --- /dev/null +++ b/plugins/aves_report/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 18116933e77adc82f80866c928266a5b4f1ed645 + channel: stable + +project_type: plugin diff --git a/plugins/aves_report/analysis_options.yaml b/plugins/aves_report/analysis_options.yaml new file mode 100644 index 000000000..f04c6cf0f --- /dev/null +++ b/plugins/aves_report/analysis_options.yaml @@ -0,0 +1 @@ +include: ../../analysis_options.yaml diff --git a/plugins/aves_report/lib/aves_report.dart b/plugins/aves_report/lib/aves_report.dart new file mode 100644 index 000000000..5c0cf8999 --- /dev/null +++ b/plugins/aves_report/lib/aves_report.dart @@ -0,0 +1,21 @@ +library aves_report; + +import 'package:flutter/foundation.dart'; + +abstract class ReportService { + Future init(); + + Map get state; + + Future setCollectionEnabled(bool enabled); + + Future log(String message); + + Future setCustomKey(String key, Object value); + + Future setCustomKeys(Map map); + + Future recordError(dynamic exception, StackTrace? stack); + + Future recordFlutterError(FlutterErrorDetails flutterErrorDetails); +} diff --git a/plugins/aves_report/pubspec.lock b/plugins/aves_report/pubspec.lock new file mode 100644 index 000000000..0757de291 --- /dev/null +++ b/plugins/aves_report/pubspec.lock @@ -0,0 +1,65 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + lints: + dependency: transitive + description: + name: lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" +sdks: + dart: ">=2.12.0 <3.0.0" + flutter: ">=1.20.0" diff --git a/plugins/aves_report/pubspec.yaml b/plugins/aves_report/pubspec.yaml new file mode 100644 index 000000000..5ed692860 --- /dev/null +++ b/plugins/aves_report/pubspec.yaml @@ -0,0 +1,16 @@ +name: aves_report +version: 0.0.1 +publish_to: none + +environment: + sdk: ">=2.12.0 <3.0.0" + flutter: ">=1.20.0" + +dependencies: + flutter: + sdk: flutter + +dev_dependencies: + flutter_lints: + +flutter: diff --git a/plugins/aves_report_console/.gitignore b/plugins/aves_report_console/.gitignore new file mode 100644 index 000000000..a247422ef --- /dev/null +++ b/plugins/aves_report_console/.gitignore @@ -0,0 +1,75 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +build/ + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Flutter.podspec +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/ephemeral +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/Flutter/flutter_export_environment.sh +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 diff --git a/plugins/aves_report_console/.metadata b/plugins/aves_report_console/.metadata new file mode 100644 index 000000000..db56104b2 --- /dev/null +++ b/plugins/aves_report_console/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 18116933e77adc82f80866c928266a5b4f1ed645 + channel: stable + +project_type: package diff --git a/plugins/aves_report_console/analysis_options.yaml b/plugins/aves_report_console/analysis_options.yaml new file mode 100644 index 000000000..f04c6cf0f --- /dev/null +++ b/plugins/aves_report_console/analysis_options.yaml @@ -0,0 +1 @@ +include: ../../analysis_options.yaml diff --git a/plugins/aves_report_console/lib/aves_report_platform.dart b/plugins/aves_report_console/lib/aves_report_platform.dart new file mode 100644 index 000000000..3f1237d65 --- /dev/null +++ b/plugins/aves_report_console/lib/aves_report_platform.dart @@ -0,0 +1,30 @@ +library aves_report_platform; + +import 'package:aves_report/aves_report.dart'; +import 'package:flutter/foundation.dart'; + +class PlatformReportService extends ReportService { + @override + Future init() => SynchronousFuture(null); + + @override + Future log(String message) async => debugPrint('Report log with message=$message'); + + @override + Future recordError(exception, StackTrace? stack) async => debugPrint('Report error with exception=$exception, stack=$stack'); + + @override + Future recordFlutterError(FlutterErrorDetails flutterErrorDetails) async => debugPrint('Report Flutter error with details=$flutterErrorDetails'); + + @override + Future setCollectionEnabled(bool enabled) => SynchronousFuture(null); + + @override + Future setCustomKey(String key, Object value) async => debugPrint('Report set key $key=$value'); + + @override + Future setCustomKeys(Map map) async => debugPrint('Report set keys ${map.entries.map((kv) => '${kv.key}=${kv.value}').join(', ')}'); + + @override + Map get state => {'Reporter': 'Console'}; +} diff --git a/plugins/aves_report_console/pubspec.lock b/plugins/aves_report_console/pubspec.lock new file mode 100644 index 000000000..dcd186473 --- /dev/null +++ b/plugins/aves_report_console/pubspec.lock @@ -0,0 +1,140 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + aves_report: + dependency: "direct main" + description: + path: "../aves_report" + relative: true + source: path + version: "0.0.1" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0" + firebase_core: + dependency: transitive + description: + name: firebase_core + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.1" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + firebase_crashlytics: + dependency: transitive + description: + name: firebase_crashlytics + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.4" + firebase_crashlytics_platform_interface: + dependency: transitive + description: + name: firebase_crashlytics_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.4" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3" + lints: + dependency: transitive + description: + name: lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.0" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" +sdks: + dart: ">=2.12.0 <3.0.0" + flutter: ">=1.20.0" diff --git a/plugins/aves_report_console/pubspec.yaml b/plugins/aves_report_console/pubspec.yaml new file mode 100644 index 000000000..00e9bccb9 --- /dev/null +++ b/plugins/aves_report_console/pubspec.yaml @@ -0,0 +1,18 @@ +name: aves_report_platform +version: 0.0.1 +publish_to: none + +environment: + sdk: ">=2.12.0 <3.0.0" + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + aves_report: + path: ../aves_report + +dev_dependencies: + flutter_lints: + +flutter: diff --git a/plugins/aves_report_crashlytics/.gitignore b/plugins/aves_report_crashlytics/.gitignore new file mode 100644 index 000000000..a247422ef --- /dev/null +++ b/plugins/aves_report_crashlytics/.gitignore @@ -0,0 +1,75 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +build/ + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Flutter.podspec +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/ephemeral +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/Flutter/flutter_export_environment.sh +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 diff --git a/plugins/aves_report_crashlytics/.metadata b/plugins/aves_report_crashlytics/.metadata new file mode 100644 index 000000000..db56104b2 --- /dev/null +++ b/plugins/aves_report_crashlytics/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 18116933e77adc82f80866c928266a5b4f1ed645 + channel: stable + +project_type: package diff --git a/plugins/aves_report_crashlytics/analysis_options.yaml b/plugins/aves_report_crashlytics/analysis_options.yaml new file mode 100644 index 000000000..f04c6cf0f --- /dev/null +++ b/plugins/aves_report_crashlytics/analysis_options.yaml @@ -0,0 +1 @@ +include: ../../analysis_options.yaml diff --git a/lib/services/report_service.dart b/plugins/aves_report_crashlytics/lib/aves_report_platform.dart similarity index 77% rename from lib/services/report_service.dart rename to plugins/aves_report_crashlytics/lib/aves_report_platform.dart index ea024b743..b091a2f31 100644 --- a/lib/services/report_service.dart +++ b/plugins/aves_report_crashlytics/lib/aves_report_platform.dart @@ -1,3 +1,8 @@ +library aves_report_platform; + +import 'dart:async'; + +import 'package:aves_report/aves_report.dart'; import 'package:collection/collection.dart'; import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_crashlytics/firebase_crashlytics.dart'; @@ -5,32 +10,18 @@ import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'package:stack_trace/stack_trace.dart'; -abstract class ReportService { - Future init(); - - bool get isCollectionEnabled; - - Future setCollectionEnabled(bool enabled); - - Future log(String message); - - Future setCustomKey(String key, Object value); - - Future setCustomKeys(Map map); - - Future recordError(dynamic exception, StackTrace? stack); - - Future recordFlutterError(FlutterErrorDetails flutterErrorDetails); -} - -class CrashlyticsReportService extends ReportService { +class PlatformReportService extends ReportService { FirebaseCrashlytics get _instance => FirebaseCrashlytics.instance; @override Future init() => Firebase.initializeApp(); @override - bool get isCollectionEnabled => _instance.isCrashlyticsCollectionEnabled; + Map get state => { + 'Reporter': 'Crashlytics', + 'Firebase data collection enabled': '${Firebase.app().isAutomaticDataCollectionEnabled}', + 'Crashlytics collection enabled': '${_instance.isCrashlyticsCollectionEnabled}', + }; @override Future setCollectionEnabled(bool enabled) async { diff --git a/plugins/aves_report_crashlytics/pubspec.lock b/plugins/aves_report_crashlytics/pubspec.lock new file mode 100644 index 000000000..22d18caae --- /dev/null +++ b/plugins/aves_report_crashlytics/pubspec.lock @@ -0,0 +1,140 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + aves_report: + dependency: "direct main" + description: + path: "../aves_report" + relative: true + source: path + version: "0.0.1" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0" + firebase_core: + dependency: "direct main" + description: + name: firebase_core + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.1" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + firebase_crashlytics: + dependency: "direct main" + description: + name: firebase_crashlytics + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.4" + firebase_crashlytics_platform_interface: + dependency: transitive + description: + name: firebase_crashlytics_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.4" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3" + lints: + dependency: transitive + description: + name: lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.0" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" +sdks: + dart: ">=2.12.0 <3.0.0" + flutter: ">=1.20.0" diff --git a/plugins/aves_report_crashlytics/pubspec.yaml b/plugins/aves_report_crashlytics/pubspec.yaml new file mode 100644 index 000000000..c0ba30e16 --- /dev/null +++ b/plugins/aves_report_crashlytics/pubspec.yaml @@ -0,0 +1,20 @@ +name: aves_report_platform +version: 0.0.1 +publish_to: none + +environment: + sdk: ">=2.12.0 <3.0.0" + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + aves_report: + path: ../aves_report + firebase_core: + firebase_crashlytics: + +dev_dependencies: + flutter_lints: + +flutter: diff --git a/pubspec.lock b/pubspec.lock index 21a920749..aa76927ec 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,14 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "29.0.0" + version: "30.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "2.6.0" + version: "2.7.0" archive: dependency: transitive description: @@ -36,6 +36,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.8.1" + aves_report: + dependency: "direct main" + description: + path: "plugins/aves_report" + relative: true + source: path + version: "0.0.1" + aves_report_platform: + dependency: "direct main" + description: + path: "plugins/aves_report_crashlytics" + relative: true + source: path + version: "0.0.1" barcode: dependency: transitive description: @@ -288,12 +302,12 @@ packages: source: hosted version: "6.1.2" firebase_core: - dependency: "direct main" + dependency: transitive description: name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.8.0" firebase_core_platform_interface: dependency: transitive description: @@ -309,19 +323,19 @@ packages: source: hosted version: "1.1.0" firebase_crashlytics: - dependency: "direct main" + dependency: transitive description: name: firebase_crashlytics url: "https://pub.dartlang.org" source: hosted - version: "2.2.3" + version: "2.2.4" firebase_crashlytics_platform_interface: dependency: transitive description: name: firebase_crashlytics_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "3.1.3" + version: "3.1.4" flex_color_picker: dependency: "direct main" description: @@ -385,14 +399,14 @@ packages: name: flutter_markdown url: "https://pub.dartlang.org" source: hosted - version: "0.6.7" + version: "0.6.8" flutter_plugin_android_lifecycle: dependency: transitive description: name: flutter_plugin_android_lifecycle url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "2.0.4" flutter_staggered_animations: dependency: "direct main" description: @@ -435,7 +449,7 @@ packages: name: github url: "https://pub.dartlang.org" source: hosted - version: "8.2.1" + version: "8.2.3" glob: dependency: transitive description: @@ -596,7 +610,7 @@ packages: name: mime url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.1" motion_sensors: dependency: transitive description: @@ -736,7 +750,7 @@ packages: name: pdf url: "https://pub.dartlang.org" source: hosted - version: "3.6.0" + version: "3.6.1" pedantic: dependency: transitive description: @@ -1163,7 +1177,7 @@ packages: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.2.9" + version: "2.2.10" wkt_parser: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index b85ceada3..86aee014d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -7,11 +7,16 @@ publish_to: none environment: sdk: '>=2.14.0 <3.0.0' +# use `scripts/apply_flavor_{flavor}.sh` to set the right dependencies for the flavor dependencies: flutter: sdk: flutter flutter_localizations: sdk: flutter + aves_report: + path: plugins/aves_report + aves_report_platform: + path: plugins/aves_report_crashlytics # TODO TLAD as of 2021/10/18, latest version (v0.11.0) is incompatible with Flutter v2.5 charts_flutter: git: @@ -33,8 +38,6 @@ dependencies: git: url: git://github.com/deckerst/fijkplayer.git ref: aves - firebase_core: - firebase_crashlytics: flex_color_picker: fluster: flutter_highlight: @@ -116,7 +119,7 @@ flutter: # Test driver # run (any device): -# % flutter drive --flavor universal -t test_driver/driver_app.dart --profile +# % flutter drive --flavor play -t test_driver/driver_play.dart --profile # capture shaders in profile mode (real device only): -# % flutter drive --flavor universal -t test_driver/driver_app.dart --profile --cache-sksl --write-sksl-on-exit shaders.sksl.json +# % flutter drive --flavor play -t test_driver/driver_play.dart --profile --cache-sksl --write-sksl-on-exit shaders.sksl.json diff --git a/scripts/apply_flavor_izzy.sh b/scripts/apply_flavor_izzy.sh new file mode 100755 index 000000000..598f41175 --- /dev/null +++ b/scripts/apply_flavor_izzy.sh @@ -0,0 +1,8 @@ +#!/bin/bash +PUBSPEC_PATH="../pubspec.yaml" + +flutter clean + +sed -i 's/aves_report_crashlytics/aves_report_console/g' "$PUBSPEC_PATH" + +flutter pub get diff --git a/scripts/apply_flavor_play.sh b/scripts/apply_flavor_play.sh new file mode 100755 index 000000000..d613cc879 --- /dev/null +++ b/scripts/apply_flavor_play.sh @@ -0,0 +1,8 @@ +#!/bin/bash +PUBSPEC_PATH="../pubspec.yaml" + +flutter clean + +sed -i 's/aves_report_console/aves_report_crashlytics/g' "$PUBSPEC_PATH" + +flutter pub get diff --git a/test/fake/report_service.dart b/test/fake/report_service.dart index d05e61c8f..c4e8d1701 100644 --- a/test/fake/report_service.dart +++ b/test/fake/report_service.dart @@ -1,4 +1,4 @@ -import 'package:aves/services/report_service.dart'; +import 'package:aves_report/aves_report.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -7,7 +7,7 @@ class FakeReportService extends ReportService { Future init() => SynchronousFuture(null); @override - bool get isCollectionEnabled => false; + Map get state => {}; @override Future setCollectionEnabled(bool enabled) => SynchronousFuture(null); diff --git a/test/model/collection_source_test.dart b/test/model/collection_source_test.dart index 2c8d6c9a7..916df6701 100644 --- a/test/model/collection_source_test.dart +++ b/test/model/collection_source_test.dart @@ -17,10 +17,10 @@ import 'package:aves/services/device_service.dart'; import 'package:aves/services/media/media_file_service.dart'; import 'package:aves/services/media/media_store_service.dart'; import 'package:aves/services/metadata/metadata_fetch_service.dart'; -import 'package:aves/services/report_service.dart'; import 'package:aves/services/storage_service.dart'; import 'package:aves/services/window_service.dart'; import 'package:aves/utils/android_file_utils.dart'; +import 'package:aves_report/aves_report.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:latlong2/latlong.dart'; diff --git a/test_driver/driver_app.dart b/test_driver/driver_play.dart similarity index 96% rename from test_driver/driver_app.dart rename to test_driver/driver_play.dart index 735978f0c..3535df469 100644 --- a/test_driver/driver_app.dart +++ b/test_driver/driver_play.dart @@ -1,6 +1,6 @@ import 'dart:ui'; -import 'package:aves/main.dart' as app; +import 'package:aves/main_play.dart' as app; import 'package:aves/model/settings/enums.dart'; import 'package:aves/model/settings/settings.dart'; import 'package:aves/services/media/media_store_service.dart'; diff --git a/test_driver/driver_app_test.dart b/test_driver/driver_play_test.dart similarity index 100% rename from test_driver/driver_app_test.dart rename to test_driver/driver_play_test.dart