From 7e876d68ec229b86490a638edcb6649987be1c73 Mon Sep 17 00:00:00 2001 From: Tomas Radvansky Date: Fri, 8 Oct 2021 11:45:36 +1300 Subject: [PATCH 01/10] System GUUID implementation for MacOS --- .../Classes/DeviceInfoPlusMacosPlugin.swift | 4 +++- .../macos/Classes/SystemUUID.swift | 16 ++++++++++++++++ .../lib/model/macos_device_info.dart | 6 ++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 packages/device_info_plus/device_info_plus_macos/macos/Classes/SystemUUID.swift diff --git a/packages/device_info_plus/device_info_plus_macos/macos/Classes/DeviceInfoPlusMacosPlugin.swift b/packages/device_info_plus/device_info_plus_macos/macos/Classes/DeviceInfoPlusMacosPlugin.swift index 9f2ed7443b..dff90e76af 100644 --- a/packages/device_info_plus/device_info_plus_macos/macos/Classes/DeviceInfoPlusMacosPlugin.swift +++ b/packages/device_info_plus/device_info_plus_macos/macos/Classes/DeviceInfoPlusMacosPlugin.swift @@ -27,6 +27,7 @@ public class DeviceInfoPlusMacosPlugin: NSObject, FlutterPlugin { let activeCPUs = Sysctl.activeCPUs let memorySize = Sysctl.memSize let cpuFrequency = Sysctl.cpuFreq + let guuid = SystemUUID.getSystemUUID() result([ "computerName": computerName, @@ -37,7 +38,8 @@ public class DeviceInfoPlusMacosPlugin: NSObject, FlutterPlugin { "osRelease": osRelease, "activeCPUs": activeCPUs, "memorySize": memorySize, - "cpuFrequency": cpuFrequency + "cpuFrequency": cpuFrequency, + "systemGUUID": guuid ]) } } diff --git a/packages/device_info_plus/device_info_plus_macos/macos/Classes/SystemUUID.swift b/packages/device_info_plus/device_info_plus_macos/macos/Classes/SystemUUID.swift new file mode 100644 index 0000000000..cc9e9ae2b1 --- /dev/null +++ b/packages/device_info_plus/device_info_plus_macos/macos/Classes/SystemUUID.swift @@ -0,0 +1,16 @@ +import Foundation + +public struct SystemUUID { + + public static func getSystemUUID() -> String? { + let dev = IOServiceMatching("IOPlatformExpertDevice") + let platformExpert: io_service_t = IOServiceGetMatchingService(kIOMasterPortDefault, dev) + let serialNumberAsCFString = IORegistryEntryCreateCFProperty(platformExpert, kIOPlatformUUIDKey as CFString, kCFAllocatorDefault, 0) + IOObjectRelease(platformExpert) + let ser: CFTypeRef? = serialNumberAsCFString?.takeUnretainedValue() + if let result = ser as? String { + return result + } + return nil + } +} \ No newline at end of file diff --git a/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart b/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart index 611e32f76a..f5c27ebfc0 100644 --- a/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart +++ b/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart @@ -15,6 +15,7 @@ class MacOsDeviceInfo { required this.activeCPUs, required this.memorySize, required this.cpuFrequency, + required this.systemGUUID, }); /// Name given to the local machine. @@ -48,6 +49,9 @@ class MacOsDeviceInfo { /// Device CPU Frequency final int cpuFrequency; + /// Device GUUID + final int systemGUUID; + /// Serializes [ MacOsDeviceInfo ] to map. Map toMap() { return { @@ -60,6 +64,7 @@ class MacOsDeviceInfo { 'cpuFrequency': cpuFrequency, 'computerName': computerName, 'kernelVersion': kernelVersion, + 'systemGUUID': systemGUUID, }; } @@ -75,6 +80,7 @@ class MacOsDeviceInfo { activeCPUs: map['activeCPUs'], memorySize: map['memorySize'], cpuFrequency: map['cpuFrequency'], + systemGUUID: map['systemGUUID'], ); } } From 78a5545effa8e7e65726d7669c209cd27828c6dc Mon Sep 17 00:00:00 2001 From: Tomas Radvansky Date: Fri, 8 Oct 2021 12:08:38 +1300 Subject: [PATCH 02/10] invalid type typo --- .../lib/model/macos_device_info.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart b/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart index f5c27ebfc0..3e901c91cd 100644 --- a/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart +++ b/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart @@ -50,7 +50,7 @@ class MacOsDeviceInfo { final int cpuFrequency; /// Device GUUID - final int systemGUUID; + final String systemGUUID; /// Serializes [ MacOsDeviceInfo ] to map. Map toMap() { From 88eb576141cb3bd3cb100b121131b3d2e08553fa Mon Sep 17 00:00:00 2001 From: Tomas Radvansky Date: Fri, 8 Oct 2021 14:14:45 +1300 Subject: [PATCH 03/10] Typos --- .../macos/Classes/DeviceInfoPlusMacosPlugin.swift | 4 ++-- .../lib/model/macos_device_info.dart | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/device_info_plus/device_info_plus_macos/macos/Classes/DeviceInfoPlusMacosPlugin.swift b/packages/device_info_plus/device_info_plus_macos/macos/Classes/DeviceInfoPlusMacosPlugin.swift index dff90e76af..05b5d54a0a 100644 --- a/packages/device_info_plus/device_info_plus_macos/macos/Classes/DeviceInfoPlusMacosPlugin.swift +++ b/packages/device_info_plus/device_info_plus_macos/macos/Classes/DeviceInfoPlusMacosPlugin.swift @@ -27,7 +27,7 @@ public class DeviceInfoPlusMacosPlugin: NSObject, FlutterPlugin { let activeCPUs = Sysctl.activeCPUs let memorySize = Sysctl.memSize let cpuFrequency = Sysctl.cpuFreq - let guuid = SystemUUID.getSystemUUID() + let guid = SystemUUID.getSystemUUID() result([ "computerName": computerName, @@ -39,7 +39,7 @@ public class DeviceInfoPlusMacosPlugin: NSObject, FlutterPlugin { "activeCPUs": activeCPUs, "memorySize": memorySize, "cpuFrequency": cpuFrequency, - "systemGUUID": guuid + "systemGUID": guid ]) } } diff --git a/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart b/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart index 3e901c91cd..b6406ddc87 100644 --- a/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart +++ b/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart @@ -15,7 +15,7 @@ class MacOsDeviceInfo { required this.activeCPUs, required this.memorySize, required this.cpuFrequency, - required this.systemGUUID, + required this.systemGUID, }); /// Name given to the local machine. @@ -50,7 +50,7 @@ class MacOsDeviceInfo { final int cpuFrequency; /// Device GUUID - final String systemGUUID; + final String systemGUID; /// Serializes [ MacOsDeviceInfo ] to map. Map toMap() { @@ -64,7 +64,7 @@ class MacOsDeviceInfo { 'cpuFrequency': cpuFrequency, 'computerName': computerName, 'kernelVersion': kernelVersion, - 'systemGUUID': systemGUUID, + 'systemGUID': systemGUID, }; } From 1ca8827fb7bd8742185af4bb1895ccc32a8f9d54 Mon Sep 17 00:00:00 2001 From: Tomas Radvansky Date: Fri, 8 Oct 2021 14:25:50 +1300 Subject: [PATCH 04/10] more fixes --- .../lib/model/macos_device_info.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart b/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart index b6406ddc87..45cc39c487 100644 --- a/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart +++ b/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart @@ -80,7 +80,7 @@ class MacOsDeviceInfo { activeCPUs: map['activeCPUs'], memorySize: map['memorySize'], cpuFrequency: map['cpuFrequency'], - systemGUUID: map['systemGUUID'], + systemGUID: map['systemGUID'], ); } } From bcccbd85c4b89181b9db2a22bced451b82d97364 Mon Sep 17 00:00:00 2001 From: Tomas Radvansky Date: Fri, 15 Oct 2021 10:13:20 +1300 Subject: [PATCH 05/10] update test --- .../macos/Flutter/Flutter-Debug.xcconfig | 1 + .../macos/Flutter/Flutter-Release.xcconfig | 1 + .../macos/Runner.xcodeproj/project.pbxproj | 77 +++++++++++++++---- .../contents.xcworkspacedata | 3 + .../test/model/macos_device_info_test.dart | 2 + 5 files changed, 70 insertions(+), 14 deletions(-) diff --git a/packages/device_info_plus/device_info_plus/example/macos/Flutter/Flutter-Debug.xcconfig b/packages/device_info_plus/device_info_plus/example/macos/Flutter/Flutter-Debug.xcconfig index c2efd0b608..4b81f9b2d2 100644 --- a/packages/device_info_plus/device_info_plus/example/macos/Flutter/Flutter-Debug.xcconfig +++ b/packages/device_info_plus/device_info_plus/example/macos/Flutter/Flutter-Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/packages/device_info_plus/device_info_plus/example/macos/Flutter/Flutter-Release.xcconfig b/packages/device_info_plus/device_info_plus/example/macos/Flutter/Flutter-Release.xcconfig index c2efd0b608..5caa9d1579 100644 --- a/packages/device_info_plus/device_info_plus/example/macos/Flutter/Flutter-Release.xcconfig +++ b/packages/device_info_plus/device_info_plus/example/macos/Flutter/Flutter-Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/packages/device_info_plus/device_info_plus/example/macos/Runner.xcodeproj/project.pbxproj b/packages/device_info_plus/device_info_plus/example/macos/Runner.xcodeproj/project.pbxproj index 5fb492c8ed..61e9be78cc 100644 --- a/packages/device_info_plus/device_info_plus/example/macos/Runner.xcodeproj/project.pbxproj +++ b/packages/device_info_plus/device_info_plus/example/macos/Runner.xcodeproj/project.pbxproj @@ -21,15 +21,12 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 15897DDF3F7CA885FC5E384A /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F81A5A451B3AC123462ECD1 /* Pods_Runner.framework */; }; 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; - 33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; }; - 33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - D73912F022F37F9E000D13A0 /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D73912EF22F37F9E000D13A0 /* App.framework */; }; - D73912F222F3801D000D13A0 /* App.framework in Bundle Framework */ = {isa = PBXBuildFile; fileRef = D73912EF22F37F9E000D13A0 /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -49,8 +46,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - D73912F222F3801D000D13A0 /* App.framework in Bundle Framework */, - 33D1A10522148B93006C7A3E /* FlutterMacOS.framework in Bundle Framework */, ); name = "Bundle Framework"; runOnlyForDeploymentPostprocessing = 0; @@ -60,7 +55,7 @@ /* Begin PBXFileReference section */ 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10ED2044A3C60003C045 /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -69,13 +64,15 @@ 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; - 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FlutterMacOS.framework; path = Flutter/ephemeral/FlutterMacOS.framework; sourceTree = SOURCE_ROOT; }; 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 6D07D951D7362AA377411A49 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 7F81A5A451B3AC123462ECD1 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; - D73912EF22F37F9E000D13A0 /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/ephemeral/App.framework; sourceTree = SOURCE_ROOT; }; + E7388E27867E17BA868D55EA /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + FF9B52311F2436AA220E8D61 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -83,14 +80,24 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D73912F022F37F9E000D13A0 /* App.framework in Frameworks */, - 33D1A10422148B71006C7A3E /* FlutterMacOS.framework in Frameworks */, + 15897DDF3F7CA885FC5E384A /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 2E8EB0F9823F3C15A5AB32B8 /* Pods */ = { + isa = PBXGroup; + children = ( + FF9B52311F2436AA220E8D61 /* Pods-Runner.debug.xcconfig */, + 6D07D951D7362AA377411A49 /* Pods-Runner.release.xcconfig */, + E7388E27867E17BA868D55EA /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; 33BA886A226E78AF003329D5 /* Configs */ = { isa = PBXGroup; children = ( @@ -109,6 +116,7 @@ 33CEB47122A05771004F2AC0 /* Flutter */, 33CC10EE2044A3C60003C045 /* Products */, D73912EC22F37F3D000D13A0 /* Frameworks */, + 2E8EB0F9823F3C15A5AB32B8 /* Pods */, ); sourceTree = ""; }; @@ -138,8 +146,6 @@ 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, - D73912EF22F37F9E000D13A0 /* App.framework */, - 33D1A10322148B71006C7A3E /* FlutterMacOS.framework */, ); path = Flutter; sourceTree = ""; @@ -160,6 +166,7 @@ D73912EC22F37F3D000D13A0 /* Frameworks */ = { isa = PBXGroup; children = ( + 7F81A5A451B3AC123462ECD1 /* Pods_Runner.framework */, ); name = Frameworks; sourceTree = ""; @@ -171,11 +178,13 @@ isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + 45684215EC399FD257470BC8 /* [CP] Check Pods Manifest.lock */, 33CC10E92044A3C60003C045 /* Sources */, 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, + F7992578AF063240CC187B34 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -260,7 +269,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename\n"; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; }; 33CC111E2044C6BF0003C045 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -282,6 +291,46 @@ shellPath = /bin/sh; shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; + 45684215EC399FD257470BC8 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + F7992578AF063240CC187B34 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/device_info_plus_macos/device_info_plus_macos.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info_plus_macos.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ diff --git a/packages/device_info_plus/device_info_plus/example/macos/Runner.xcworkspace/contents.xcworkspacedata b/packages/device_info_plus/device_info_plus/example/macos/Runner.xcworkspace/contents.xcworkspacedata index 1d526a16ed..21a3cc14c7 100644 --- a/packages/device_info_plus/device_info_plus/example/macos/Runner.xcworkspace/contents.xcworkspacedata +++ b/packages/device_info_plus/device_info_plus/example/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/packages/device_info_plus/device_info_plus_platform_interface/test/model/macos_device_info_test.dart b/packages/device_info_plus/device_info_plus_platform_interface/test/model/macos_device_info_test.dart index 06193fa513..0a55911114 100644 --- a/packages/device_info_plus/device_info_plus_platform_interface/test/model/macos_device_info_test.dart +++ b/packages/device_info_plus/device_info_plus_platform_interface/test/model/macos_device_info_test.dart @@ -14,6 +14,7 @@ void main() { 'osRelease': 'osRelease', 'computerName': 'computerName', 'kernelVersion': 'kernelVersion', + 'systemGUID': 'systemGUID', }; test('fromMap should return $MacOsDeviceInfo with correct values', () { @@ -26,6 +27,7 @@ void main() { expect(macosDeviceInfo.cpuFrequency, 2); expect(macosDeviceInfo.hostName, 'hostName'); expect(macosDeviceInfo.osRelease, 'osRelease'); + expect(macosDeviceInfo.systemGUID, 'systemGUID'); }); test('toMap should return map with correct key and map', () { From ac417217c5e1aca951683701add73fe4abe9d0e7 Mon Sep 17 00:00:00 2001 From: Tomas Radvansky Date: Fri, 15 Oct 2021 22:03:04 +1300 Subject: [PATCH 06/10] Added nullable guid --- .../lib/model/macos_device_info.dart | 4 +-- .../test/model/macos_device_info_test.dart | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart b/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart index 45cc39c487..e5e2e37322 100644 --- a/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart +++ b/packages/device_info_plus/device_info_plus_platform_interface/lib/model/macos_device_info.dart @@ -49,8 +49,8 @@ class MacOsDeviceInfo { /// Device CPU Frequency final int cpuFrequency; - /// Device GUUID - final String systemGUID; + /// Device GUID + final String? systemGUID; /// Serializes [ MacOsDeviceInfo ] to map. Map toMap() { diff --git a/packages/device_info_plus/device_info_plus_platform_interface/test/model/macos_device_info_test.dart b/packages/device_info_plus/device_info_plus_platform_interface/test/model/macos_device_info_test.dart index 0a55911114..2ce927d409 100644 --- a/packages/device_info_plus/device_info_plus_platform_interface/test/model/macos_device_info_test.dart +++ b/packages/device_info_plus/device_info_plus_platform_interface/test/model/macos_device_info_test.dart @@ -3,6 +3,40 @@ import 'package:flutter_test/flutter_test.dart'; void main() { group('$MacOsDeviceInfo', () { + group('fromMap | toMap', () { + const macosDeviceInfoMap = { + 'arch': 'arch', + 'model': 'model', + 'activeCPUs': 4, + 'memorySize': 16, + 'cpuFrequency': 2, + 'hostName': 'hostName', + 'osRelease': 'osRelease', + 'computerName': 'computerName', + 'kernelVersion': 'kernelVersion', + 'systemGUID': null, + }; + + test('fromMap should return $MacOsDeviceInfo with correct values', () { + final macosDeviceInfo = MacOsDeviceInfo.fromMap(macosDeviceInfoMap); + + expect(macosDeviceInfo.arch, 'arch'); + expect(macosDeviceInfo.model, 'model'); + expect(macosDeviceInfo.activeCPUs, 4); + expect(macosDeviceInfo.memorySize, 16); + expect(macosDeviceInfo.cpuFrequency, 2); + expect(macosDeviceInfo.hostName, 'hostName'); + expect(macosDeviceInfo.osRelease, 'osRelease'); + expect(macosDeviceInfo.systemGUID, isNull); + }); + + test('toMap should return map with correct key and map', () { + final macosDeviceInfo = MacOsDeviceInfo.fromMap(macosDeviceInfoMap); + + expect(macosDeviceInfo.toMap(), macosDeviceInfoMap); + }); + }); + group('fromMap | toMap', () { const macosDeviceInfoMap = { 'arch': 'arch', From 9e980dc6513cacdc8ce987b550235fb25b627de2 Mon Sep 17 00:00:00 2001 From: Miquel Beltran Date: Fri, 15 Oct 2021 13:08:38 +0200 Subject: [PATCH 07/10] v 2.2.0 on device_info_plus_platform_interface --- .../device_info_plus_platform_interface/CHANGELOG.md | 4 ++++ .../device_info_plus_platform_interface/pubspec.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/device_info_plus/device_info_plus_platform_interface/CHANGELOG.md b/packages/device_info_plus/device_info_plus_platform_interface/CHANGELOG.md index 714d84eb4d..ec6b9a79c1 100644 --- a/packages/device_info_plus/device_info_plus_platform_interface/CHANGELOG.md +++ b/packages/device_info_plus/device_info_plus_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.2.0 + +- add System GUID to MacOS + ## 2.1.0 - add toMap to models diff --git a/packages/device_info_plus/device_info_plus_platform_interface/pubspec.yaml b/packages/device_info_plus/device_info_plus_platform_interface/pubspec.yaml index d8a76a1799..6b73b063ca 100644 --- a/packages/device_info_plus/device_info_plus_platform_interface/pubspec.yaml +++ b/packages/device_info_plus/device_info_plus_platform_interface/pubspec.yaml @@ -1,6 +1,6 @@ name: device_info_plus_platform_interface description: A common platform interface for the device_info_plis plugin. -version: 2.1.0 +version: 2.2.0 homepage: https://plus.fluttercommunity.dev/ repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/ From 98b3cd692b24e396f0c186d55615bc88283afeff Mon Sep 17 00:00:00 2001 From: Miquel Beltran Date: Fri, 15 Oct 2021 13:10:05 +0200 Subject: [PATCH 08/10] v 2.2.0 on device_info_plus_macos --- packages/device_info_plus/device_info_plus_macos/CHANGELOG.md | 4 ++++ packages/device_info_plus/device_info_plus_macos/pubspec.yaml | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/device_info_plus/device_info_plus_macos/CHANGELOG.md b/packages/device_info_plus/device_info_plus_macos/CHANGELOG.md index 30a7bb4a46..a905a6e9a6 100644 --- a/packages/device_info_plus/device_info_plus_macos/CHANGELOG.md +++ b/packages/device_info_plus/device_info_plus_macos/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.2.0 + +- add System GUID to MacOS + ## 2.1.0 - add toMap to models diff --git a/packages/device_info_plus/device_info_plus_macos/pubspec.yaml b/packages/device_info_plus/device_info_plus_macos/pubspec.yaml index 250d141886..738f5bb602 100644 --- a/packages/device_info_plus/device_info_plus_macos/pubspec.yaml +++ b/packages/device_info_plus/device_info_plus_macos/pubspec.yaml @@ -2,14 +2,14 @@ name: device_info_plus_macos description: Macos implementation of the device_info_plus plugin homepage: https://plus.fluttercommunity.dev/ repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/ -version: 2.1.0 +version: 2.2.0 environment: sdk: ">=2.12.0 <3.0.0" flutter: ">=1.20.0" dependencies: - device_info_plus_platform_interface: ^2.1.0 + device_info_plus_platform_interface: ^2.2.0 flutter: sdk: flutter From d3d5f09617d87ce9dc29f6ab845408d66e5061ac Mon Sep 17 00:00:00 2001 From: Miquel Beltran Date: Fri, 15 Oct 2021 13:11:49 +0200 Subject: [PATCH 09/10] v 3.1.0 on device_info_plus --- packages/device_info_plus/device_info_plus/CHANGELOG.md | 4 ++++ packages/device_info_plus/device_info_plus/pubspec.yaml | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/device_info_plus/device_info_plus/CHANGELOG.md b/packages/device_info_plus/device_info_plus/CHANGELOG.md index 7989daf604..e3ad044fd0 100644 --- a/packages/device_info_plus/device_info_plus/CHANGELOG.md +++ b/packages/device_info_plus/device_info_plus/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.1.0 + +- add System GUID to MacOS + ## 3.0.1 - Upgrade Android compile SDK version diff --git a/packages/device_info_plus/device_info_plus/pubspec.yaml b/packages/device_info_plus/device_info_plus/pubspec.yaml index 1e7feaebd7..71340a69a5 100644 --- a/packages/device_info_plus/device_info_plus/pubspec.yaml +++ b/packages/device_info_plus/device_info_plus/pubspec.yaml @@ -1,7 +1,7 @@ name: device_info_plus description: Flutter plugin providing detailed information about the device (make, model, etc.), and Android or iOS version the app is running on. -version: 3.0.1 +version: 3.1.0 homepage: https://plus.fluttercommunity.dev/ repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/ @@ -25,9 +25,9 @@ flutter: dependencies: flutter: sdk: flutter - device_info_plus_platform_interface: ^2.1.0 + device_info_plus_platform_interface: ^2.2.0 device_info_plus_linux: ^2.1.0 - device_info_plus_macos: ^2.1.0 + device_info_plus_macos: ^2.2.0 device_info_plus_web: ^2.1.0 device_info_plus_windows: ^2.1.0 From 091d94208694a9cc53c9ff708f11024df0744290 Mon Sep 17 00:00:00 2001 From: Miquel Beltran Date: Fri, 15 Oct 2021 13:18:34 +0200 Subject: [PATCH 10/10] add systemGUID to example --- .../example/ios/Runner.xcodeproj/project.pbxproj | 13 ++++--------- .../project.xcworkspace/contents.xcworkspacedata | 2 +- .../device_info_plus/example/lib/main.dart | 1 + 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/packages/device_info_plus/device_info_plus/example/ios/Runner.xcodeproj/project.pbxproj b/packages/device_info_plus/device_info_plus/example/ios/Runner.xcodeproj/project.pbxproj index 01652b8f67..5682a4a95a 100644 --- a/packages/device_info_plus/device_info_plus/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/device_info_plus/device_info_plus/example/ios/Runner.xcodeproj/project.pbxproj @@ -217,17 +217,12 @@ buildActionMask = 2147483647; files = ( ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../Flutter/Flutter.framework", - "${BUILT_PRODUCTS_DIR}/device_info_plus/device_info_plus.framework", - "${BUILT_PRODUCTS_DIR}/integration_test/integration_test.framework", + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info_plus.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/integration_test.framework", + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; diff --git a/packages/device_info_plus/device_info_plus/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/device_info_plus/device_info_plus/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 1d526a16ed..919434a625 100644 --- a/packages/device_info_plus/device_info_plus/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/packages/device_info_plus/device_info_plus/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/packages/device_info_plus/device_info_plus/example/lib/main.dart b/packages/device_info_plus/device_info_plus/example/lib/main.dart index 5ef1c5e66d..ead8c320c2 100644 --- a/packages/device_info_plus/device_info_plus/example/lib/main.dart +++ b/packages/device_info_plus/device_info_plus/example/lib/main.dart @@ -168,6 +168,7 @@ class _MyAppState extends State { 'activeCPUs': data.activeCPUs, 'memorySize': data.memorySize, 'cpuFrequency': data.cpuFrequency, + 'systemGUID': data.systemGUID, }; }