diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 9ffcf9b8f9..fb6e5852ab 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,4 +1,6 @@ PODS: + - device_info_plus (0.0.1): + - Flutter - DKImagePickerController/Core (4.3.9): - DKImagePickerController/ImageDataManager - DKImagePickerController/Resource @@ -178,6 +180,7 @@ PODS: - FlutterMacOS DEPENDENCIES: + - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - file_picker (from `.symlinks/plugins/file_picker/ios`) - firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`) - firebase_core (from `.symlinks/plugins/firebase_core/ios`) @@ -214,6 +217,8 @@ SPEC REPOS: - SwiftyGif EXTERNAL SOURCES: + device_info_plus: + :path: ".symlinks/plugins/device_info_plus/ios" file_picker: :path: ".symlinks/plugins/file_picker/ios" firebase_analytics: @@ -248,6 +253,7 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/video_player_avfoundation/darwin" SPEC CHECKSUMS: + device_info_plus: 21fcca2080fbcd348be798aa36c3e5ed849eefbe DKImagePickerController: 946cec48c7873164274ecc4624d19e3da4c1ef3c DKPhotoGallery: b3834fecb755ee09a593d7c9e389d8b5d6deed60 file_picker: a0560bc09d61de87f12d246fc47d2119e6ef37be @@ -280,6 +286,6 @@ SPEC CHECKSUMS: url_launcher_ios: 694010445543906933d732453a59da0a173ae33d video_player_avfoundation: 2cef49524dd1f16c5300b9cd6efd9611ce03639b -PODFILE CHECKSUM: f2a1ebd07796ee082cb4d8e8fa742449f698c4f1 +PODFILE CHECKSUM: 59b529d1a68d075d396a4247263413419e35c335 COCOAPODS: 1.16.2 diff --git a/lib/bloc/analytics/analytics_api.dart b/lib/bloc/analytics/analytics_api.dart index 0d61b4d51a..5a68584dcf 100644 --- a/lib/bloc/analytics/analytics_api.dart +++ b/lib/bloc/analytics/analytics_api.dart @@ -4,6 +4,9 @@ import 'analytics_repo.dart'; /// Abstract interface for analytics providers abstract class AnalyticsApi { + /// Whether this analytics provider can be used on the current platform/config + bool isAvailable(); + /// Initialize the analytics provider Future initialize(AnalyticsSettings settings); diff --git a/lib/bloc/analytics/analytics_repo.dart b/lib/bloc/analytics/analytics_repo.dart index 04f3be58ae..0fe13a0d4d 100644 --- a/lib/bloc/analytics/analytics_repo.dart +++ b/lib/bloc/analytics/analytics_repo.dart @@ -119,15 +119,20 @@ class AnalyticsRepository implements AnalyticsRepo { ); } - // Add Firebase Analytics provider + // Add Firebase Analytics provider if available final firebaseProvider = FirebaseAnalyticsApi(); - _providers.add(firebaseProvider); + if (firebaseProvider.isAvailable()) { + _providers.add(firebaseProvider); + } else if (kDebugMode) { + log( + 'Firebase provider not registered: unavailable (missing/placeholder options or unsupported platform)', + path: 'analytics -> AnalyticsRepository -> _initializeProviders', + ); + } // Add Matomo Analytics provider when configuration is present - final bool hasMatomoConfig = - matomoUrl.isNotEmpty && matomoSiteId.isNotEmpty; - if (hasMatomoConfig) { - final matomoProvider = MatomoAnalyticsApi(); + final matomoProvider = MatomoAnalyticsApi(); + if (matomoProvider.isAvailable()) { _providers.add(matomoProvider); } else if (kDebugMode) { log( diff --git a/lib/bloc/analytics/firebase_analytics_api.dart b/lib/bloc/analytics/firebase_analytics_api.dart index 347663ec45..139aba48c9 100644 --- a/lib/bloc/analytics/firebase_analytics_api.dart +++ b/lib/bloc/analytics/firebase_analytics_api.dart @@ -41,6 +41,25 @@ class FirebaseAnalyticsApi implements AnalyticsApi { return _initializeWithRetry(settings); } + @override + bool isAvailable() { + try { + // Only proceed if Firebase options exist and are not placeholders + final FirebaseOptions options = DefaultFirebaseOptions.currentPlatform; + final serialized = options.toString(); + if (serialized.contains('THIS_IS_AUTOGENERATED')) { + return false; + } + // Additionally, ensure we are not on unsupported desktop Linux + if (!kIsWeb && defaultTargetPlatform == TargetPlatform.linux) { + return false; + } + return true; + } catch (_) { + return false; + } + } + /// Initialize with retry mechanism Future _initializeWithRetry(AnalyticsSettings settings) async { try { @@ -60,11 +79,11 @@ class FirebaseAnalyticsApi implements AnalyticsApi { // Load any previously saved events await _loadPersistedQueue(); - // Skip unsupported platforms (Linux not supported by Firebase Analytics) - if (!kIsWeb && defaultTargetPlatform == TargetPlatform.linux) { + // Skip when unavailable (invalid options, unsupported platform) + if (!isAvailable()) { if (kDebugMode) { log( - 'Firebase Analytics not supported on Linux; marking as initialized=false and enabled=false', + 'Firebase Analytics unavailable (missing/placeholder options or unsupported platform). Disabling.', path: 'analytics -> FirebaseAnalyticsApi -> _initialize', ); } diff --git a/lib/bloc/analytics/matomo_analytics_api.dart b/lib/bloc/analytics/matomo_analytics_api.dart index 7dedc35360..02abd4167a 100644 --- a/lib/bloc/analytics/matomo_analytics_api.dart +++ b/lib/bloc/analytics/matomo_analytics_api.dart @@ -208,6 +208,12 @@ class MatomoAnalyticsApi implements AnalyticsApi { @override bool get isEnabled => _isEnabled; + @override + bool isAvailable() { + // Available only when MATOMO_URL and MATOMO_SITE_ID are configured + return matomoUrl.isNotEmpty && matomoSiteId.isNotEmpty; + } + @override Future initialize(AnalyticsSettings settings) async { return _initializeWithRetry(settings); diff --git a/macos/Podfile b/macos/Podfile index fb9b4184a4..9b6b5d868f 100644 --- a/macos/Podfile +++ b/macos/Podfile @@ -1,5 +1,8 @@ require 'xcodeproj' +# Use the CocoaPods CDN source for faster and more reliable dependency resolution +source 'https://cdn.cocoapods.org/' + def deployment_target project_path = 'Runner.xcodeproj' project = Xcodeproj::Project.open(project_path) @@ -50,6 +53,25 @@ post_install do |installer| flutter_additional_macos_build_settings(target) target.build_configurations.each do |config| config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = deployment_target + # Ensure timestamped, hardened runtime code signing for all pods and Runner + existing = config.build_settings['OTHER_CODE_SIGN_FLAGS'] + flags = existing ? Array(existing) : [] + flags << '--timestamp=auto' + flags << '--options=runtime' + config.build_settings['OTHER_CODE_SIGN_FLAGS'] = flags.uniq + end + end + + # Use $(ARCHS_STANDARD) (arm64 + x86_64) to produce a universal macOS build. + # Debug builds: build only the active architecture to speed up local development. + # TODO: If we encounter arch/linker errors from pods missing x86_64 slices (often vendored/prebuilt), + # exclude x86_64 for affected configs or switch Release to arm64-only. + installer.pods_project.build_configurations.each do |config| + config.build_settings['ARCHS'] = '$(ARCHS_STANDARD)' + if config.name == 'Debug' + config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES' + else + config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO' end end end diff --git a/macos/Podfile.lock b/macos/Podfile.lock index 0345a714f6..9b54ce0c88 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -1,4 +1,6 @@ PODS: + - device_info_plus (0.0.1): + - FlutterMacOS - file_picker (0.0.1): - FlutterMacOS - Firebase/Analytics (11.15.0): @@ -136,6 +138,7 @@ PODS: - FlutterMacOS DEPENDENCIES: + - device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`) - file_picker (from `Flutter/ephemeral/.symlinks/plugins/file_picker/macos`) - firebase_analytics (from `Flutter/ephemeral/.symlinks/plugins/firebase_analytics/macos`) - firebase_core (from `Flutter/ephemeral/.symlinks/plugins/firebase_core/macos`) @@ -168,6 +171,8 @@ SPEC REPOS: - PromisesObjC EXTERNAL SOURCES: + device_info_plus: + :path: Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos file_picker: :path: Flutter/ephemeral/.symlinks/plugins/file_picker/macos firebase_analytics: @@ -204,6 +209,7 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/window_size/macos SPEC CHECKSUMS: + device_info_plus: 4fb280989f669696856f8b129e4a5e3cd6c48f76 file_picker: 7584aae6fa07a041af2b36a2655122d42f578c1a Firebase: d99ac19b909cd2c548339c2241ecd0d1599ab02e firebase_analytics: 3091f96bd17636f6da5092a4701ffacf67c6e455 @@ -218,7 +224,7 @@ SPEC CHECKSUMS: FlutterMacOS: d0db08ddef1a9af05a5ec4b724367152bb0500b1 GoogleAppMeasurement: 700dce7541804bec33db590a5c496b663fbe2539 GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1 - komodo_defi_framework: 725599127b357521f4567b16192bf07d7ad1d4b0 + komodo_defi_framework: 1eb76cee957ff7598498a87bb0d1c470da0f0980 local_auth_darwin: d2e8c53ef0c4f43c646462e3415432c4dab3ae19 mobile_scanner: 9157936403f5a0644ca3779a38ff8404c5434a93 nanopb: fad817b59e0457d11a5dfbde799381cd727c1275 @@ -232,6 +238,6 @@ SPEC CHECKSUMS: video_player_avfoundation: 2cef49524dd1f16c5300b9cd6efd9611ce03639b window_size: 4bd15034e6e3d0720fd77928a7c42e5492cfece9 -PODFILE CHECKSUM: d064900e78ded0efef7fcc0db57cbf4bc2487624 +PODFILE CHECKSUM: e956d7d2637294ec1826a83f192da39c811af440 COCOAPODS: 1.16.2 diff --git a/macos/Runner/GoogleService-Info.plist b/macos/Runner/GoogleService-Info.plist index bef7488865..4cd60b4363 100644 --- a/macos/Runner/GoogleService-Info.plist +++ b/macos/Runner/GoogleService-Info.plist @@ -1,19 +1,24 @@ + + + + GOOGLE_APP_ID + 1:000000000000:ios:0000000000000000 + GCM_SENDER_ID + 000000000000 + PROJECT_ID + dummy-project + BUNDLE_ID + com.example.dummy API_KEY - THIS_IS_AUTOGENERATED - GCM_SENDER_ID - THIS_IS_AUTOGENERATED + A_DUMMY_API_KEY_00000000000000000000000 PLIST_VERSION 1 - BUNDLE_ID - THIS_IS_AUTOGENERATED - PROJECT_ID - THIS_IS_AUTOGENERATED STORAGE_BUCKET - THIS_IS_AUTOGENERATED + dummy-project.firebasestorage.app IS_ADS_ENABLED IS_ANALYTICS_ENABLED @@ -24,7 +29,5 @@ IS_SIGNIN_ENABLED - GOOGLE_APP_ID - THIS_IS_AUTOGENERATED \ No newline at end of file diff --git a/sdk b/sdk index 679fd92a6c..ffa7663a1b 160000 --- a/sdk +++ b/sdk @@ -1 +1 @@ -Subproject commit 679fd92a6ce6d87b631dadbcaca1c8343e6580c2 +Subproject commit ffa7663a1b08554f579e525313bbba547a98f6bf