diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..29a1e94 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.build/ +.swiftpm/ +.DS_Store diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..925230b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,12 @@ +To contribute you must sign the waiver with your GPG key. + +```sh +cd waiver +gpg --no-version --armor --output ".asc" --sign WAIVER +``` + +Commit the signature in a seperately from your contributions. Contribution commits must be based on the signature commit. + +Every commit must be signed with the GPG key used to sign the waiver. + +To keep your email address private use the GitHub private email for your GPG key (`users.noreply.github.com`). diff --git a/MediaRemote.xcframework/Info.plist b/MediaRemote.xcframework/Info.plist new file mode 100644 index 0000000..036e3f1 --- /dev/null +++ b/MediaRemote.xcframework/Info.plist @@ -0,0 +1,111 @@ + + + + + AvailableLibraries + + + LibraryIdentifier + macos + LibraryPath + MediaRemote.framework + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + macos + + + LibraryIdentifier + ios + LibraryPath + MediaRemote.framework + SupportedArchitectures + + armv7 + arm64 + + SupportedPlatform + ios + + + LibraryIdentifier + ios-simulator + LibraryPath + MediaRemote.framework + SupportedArchitectures + + x86_64 + i386 + arm64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + LibraryIdentifier + tvos-simulator + LibraryPath + MediaRemote.framework + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + tvos + SupportedPlatformVariant + simulator + + + LibraryIdentifier + tvos + LibraryPath + MediaRemote.framework + SupportedArchitectures + + arm64 + + SupportedPlatform + tvos + + + LibraryIdentifier + watchos + LibraryPath + MediaRemote.framework + SupportedArchitectures + + arm64_32 + armv7k + + SupportedPlatform + watchos + + + LibraryIdentifier + watchos-simulator + LibraryPath + MediaRemote.framework + SupportedArchitectures + + arm64 + i386 + x86_64 + + SupportedPlatform + watchos + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/MediaRemote.xcframework/ios-simulator/MediaRemote.framework/MediaRemote.tbd b/MediaRemote.xcframework/ios-simulator/MediaRemote.framework/MediaRemote.tbd new file mode 100644 index 0000000..c9a4e2e --- /dev/null +++ b/MediaRemote.xcframework/ios-simulator/MediaRemote.framework/MediaRemote.tbd @@ -0,0 +1,9 @@ +--- !tapi-tbd +tbd-version: 4 +targets: [ i386-ios-simulator, x86_64-ios-simulator, arm64-ios-simulator ] +install-name: '/System/Library/PrivateFrameworks/MediaRemote.framework/MediaRemote' +exports: + - targets: [ i386-ios-simulator, x86_64-ios-simulator, arm64-ios-simulator ] + symbols: [ _MRMediaRemoteRegisterForNowPlayingNotifications, _MRMediaRemoteUnregisterForNowPlayingNotifications, _MRMediaRemoteGetNowPlayingClient, _MRMediaRemoteGetNowPlayingInfo, _MRMediaRemoteGetNowPlayingApplicationIsPlaying, _MRNowPlayingClientGetBundleIdentifier, _MRNowPlayingClientGetParentAppBundleIdentifier, _MRMediaRemoteSetElapsedTime, _MRMediaRemoteSendCommand, _kMRMediaRemoteNowPlayingInfoDidChangeNotification, _kMRMediaRemoteNowPlayingPlaybackQueueDidChangeNotification, _kMRMediaRemotePickableRoutesDidChangeNotification, _kMRMediaRemoteNowPlayingApplicationDidChangeNotification, _kMRMediaRemoteNowPlayingApplicationIsPlayingDidChangeNotification, _kMRMediaRemoteRouteStatusDidChangeNotification, _kMRNowPlayingPlaybackQueueChangedNotification, _kMRPlaybackQueueContentItemsChangedNotification, _kMRMediaRemoteNowPlayingInfoArtist, _kMRMediaRemoteNowPlayingInfoTitle, _kMRMediaRemoteNowPlayingInfoAlbum, _kMRMediaRemoteNowPlayingInfoArtworkData, _kMRMediaRemoteNowPlayingInfoPlaybackRate, _kMRMediaRemoteNowPlayingInfoDuration, _kMRMediaRemoteNowPlayingInfoElapsedTime, _kMRMediaRemoteNowPlayingInfoTimestamp, _kMRMediaRemoteNowPlayingInfoClientPropertiesData, _kMRMediaRemoteNowPlayingInfoArtworkIdentifier, _kMRMediaRemoteNowPlayingInfoShuffleMode, _kMRMediaRemoteNowPlayingInfoTrackNumber, _kMRMediaRemoteNowPlayingInfoTotalQueueCount, _kMRMediaRemoteNowPlayingInfoArtistiTunesStoreAdamIdentifier, _kMRMediaRemoteNowPlayingInfoArtworkMIMEType, _kMRMediaRemoteNowPlayingInfoMediaType, _kMRMediaRemoteNowPlayingInfoiTunesStoreSubscriptionAdamIdentifier, _kMRMediaRemoteNowPlayingInfoGenre, _kMRMediaRemoteNowPlayingInfoComposer, _kMRMediaRemoteNowPlayingInfoQueueIndex, _kMRMediaRemoteNowPlayingInfoiTunesStoreIdentifier, _kMRMediaRemoteNowPlayingInfoTotalTrackCount, _kMRMediaRemoteNowPlayingInfoContentItemIdentifier, _kMRMediaRemoteNowPlayingInfoIsMusicApp, _kMRMediaRemoteNowPlayingInfoAlbumiTunesStoreAdamIdentifier, _kMRMediaRemoteNowPlayingInfoUniqueIdentifier, _kMRActiveNowPlayingPlayerPathUserInfoKey, _kMRMediaRemoteNowPlayingApplicationIsPlayingUserInfoKey, _kMRMediaRemoteNowPlayingApplicationDisplayNameUserInfoKey, _kMRMediaRemoteNowPlayingApplicationPIDUserInfoKey, _kMRMediaRemoteOriginUserInfoKey, _kMRMediaRemotePlaybackStateUserInfoKey, _kMRMediaRemoteUpdatedContentItemsUserInfoKey, _kMRNowPlayingClientUserInfoKey, _kMRNowPlayingPlayerPathUserInfoKey, _kMRNowPlayingPlayerUserInfoKey, _kMROriginActiveNowPlayingPlayerPathUserInfoKey ] + objc-classes: [ _MRColorProtobuf, _MRNowPlayingClientProtobuf ] +... diff --git a/MediaRemote.xcframework/ios/MediaRemote.framework/MediaRemote.tbd b/MediaRemote.xcframework/ios/MediaRemote.framework/MediaRemote.tbd new file mode 100644 index 0000000..372c44a --- /dev/null +++ b/MediaRemote.xcframework/ios/MediaRemote.framework/MediaRemote.tbd @@ -0,0 +1,9 @@ +--- !tapi-tbd +tbd-version: 4 +targets: [ x86_64-macos, arm64-macos, armv7-ios ] +install-name: '/System/Library/PrivateFrameworks/MediaRemote.framework/MediaRemote' +exports: + - targets: [ x86_64-macos, arm64-macos, armv7-ios ] + symbols: [ _MRMediaRemoteRegisterForNowPlayingNotifications, _MRMediaRemoteUnregisterForNowPlayingNotifications, _MRMediaRemoteGetNowPlayingClient, _MRMediaRemoteGetNowPlayingInfo, _MRMediaRemoteGetNowPlayingApplicationIsPlaying, _MRNowPlayingClientGetBundleIdentifier, _MRNowPlayingClientGetParentAppBundleIdentifier, _MRMediaRemoteSetElapsedTime, _MRMediaRemoteSendCommand, _kMRMediaRemoteNowPlayingInfoDidChangeNotification, _kMRMediaRemoteNowPlayingPlaybackQueueDidChangeNotification, _kMRMediaRemotePickableRoutesDidChangeNotification, _kMRMediaRemoteNowPlayingApplicationDidChangeNotification, _kMRMediaRemoteNowPlayingApplicationIsPlayingDidChangeNotification, _kMRMediaRemoteRouteStatusDidChangeNotification, _kMRNowPlayingPlaybackQueueChangedNotification, _kMRPlaybackQueueContentItemsChangedNotification, _kMRMediaRemoteNowPlayingInfoArtist, _kMRMediaRemoteNowPlayingInfoTitle, _kMRMediaRemoteNowPlayingInfoAlbum, _kMRMediaRemoteNowPlayingInfoArtworkData, _kMRMediaRemoteNowPlayingInfoPlaybackRate, _kMRMediaRemoteNowPlayingInfoDuration, _kMRMediaRemoteNowPlayingInfoElapsedTime, _kMRMediaRemoteNowPlayingInfoTimestamp, _kMRMediaRemoteNowPlayingInfoClientPropertiesData, _kMRMediaRemoteNowPlayingInfoArtworkIdentifier, _kMRMediaRemoteNowPlayingInfoShuffleMode, _kMRMediaRemoteNowPlayingInfoTrackNumber, _kMRMediaRemoteNowPlayingInfoTotalQueueCount, _kMRMediaRemoteNowPlayingInfoArtistiTunesStoreAdamIdentifier, _kMRMediaRemoteNowPlayingInfoArtworkMIMEType, _kMRMediaRemoteNowPlayingInfoMediaType, _kMRMediaRemoteNowPlayingInfoiTunesStoreSubscriptionAdamIdentifier, _kMRMediaRemoteNowPlayingInfoGenre, _kMRMediaRemoteNowPlayingInfoComposer, _kMRMediaRemoteNowPlayingInfoQueueIndex, _kMRMediaRemoteNowPlayingInfoiTunesStoreIdentifier, _kMRMediaRemoteNowPlayingInfoTotalTrackCount, _kMRMediaRemoteNowPlayingInfoContentItemIdentifier, _kMRMediaRemoteNowPlayingInfoIsMusicApp, _kMRMediaRemoteNowPlayingInfoAlbumiTunesStoreAdamIdentifier, _kMRMediaRemoteNowPlayingInfoUniqueIdentifier, _kMRActiveNowPlayingPlayerPathUserInfoKey, _kMRMediaRemoteNowPlayingApplicationIsPlayingUserInfoKey, _kMRMediaRemoteNowPlayingApplicationDisplayNameUserInfoKey, _kMRMediaRemoteNowPlayingApplicationPIDUserInfoKey, _kMRMediaRemoteOriginUserInfoKey, _kMRMediaRemotePlaybackStateUserInfoKey, _kMRMediaRemoteUpdatedContentItemsUserInfoKey, _kMRNowPlayingClientUserInfoKey, _kMRNowPlayingPlayerPathUserInfoKey, _kMRNowPlayingPlayerUserInfoKey, _kMROriginActiveNowPlayingPlayerPathUserInfoKey ] + objc-classes: [ _MRColorProtobuf, _MRNowPlayingClientProtobuf ] +... diff --git a/MediaRemote.xcframework/macos/MediaRemote.framework/MediaRemote.tbd b/MediaRemote.xcframework/macos/MediaRemote.framework/MediaRemote.tbd new file mode 100644 index 0000000..11a957b --- /dev/null +++ b/MediaRemote.xcframework/macos/MediaRemote.framework/MediaRemote.tbd @@ -0,0 +1,9 @@ +--- !tapi-tbd +tbd-version: 4 +targets: [ x86_64-macos, arm64-macos ] +install-name: '/System/Library/PrivateFrameworks/MediaRemote.framework/MediaRemote' +exports: + - targets: [ x86_64-macos, arm64-macos ] + symbols: [ _MRMediaRemoteRegisterForNowPlayingNotifications, _MRMediaRemoteUnregisterForNowPlayingNotifications, _MRMediaRemoteGetNowPlayingClient, _MRMediaRemoteGetNowPlayingInfo, _MRMediaRemoteGetNowPlayingApplicationIsPlaying, _MRNowPlayingClientGetBundleIdentifier, _MRNowPlayingClientGetParentAppBundleIdentifier, _MRMediaRemoteSetElapsedTime, _MRMediaRemoteSendCommand, _kMRMediaRemoteNowPlayingInfoDidChangeNotification, _kMRMediaRemoteNowPlayingPlaybackQueueDidChangeNotification, _kMRMediaRemotePickableRoutesDidChangeNotification, _kMRMediaRemoteNowPlayingApplicationDidChangeNotification, _kMRMediaRemoteNowPlayingApplicationIsPlayingDidChangeNotification, _kMRMediaRemoteRouteStatusDidChangeNotification, _kMRNowPlayingPlaybackQueueChangedNotification, _kMRPlaybackQueueContentItemsChangedNotification, _kMRMediaRemoteNowPlayingInfoArtist, _kMRMediaRemoteNowPlayingInfoTitle, _kMRMediaRemoteNowPlayingInfoAlbum, _kMRMediaRemoteNowPlayingInfoArtworkData, _kMRMediaRemoteNowPlayingInfoPlaybackRate, _kMRMediaRemoteNowPlayingInfoDuration, _kMRMediaRemoteNowPlayingInfoElapsedTime, _kMRMediaRemoteNowPlayingInfoTimestamp, _kMRMediaRemoteNowPlayingInfoClientPropertiesData, _kMRMediaRemoteNowPlayingInfoArtworkIdentifier, _kMRMediaRemoteNowPlayingInfoShuffleMode, _kMRMediaRemoteNowPlayingInfoTrackNumber, _kMRMediaRemoteNowPlayingInfoTotalQueueCount, _kMRMediaRemoteNowPlayingInfoArtistiTunesStoreAdamIdentifier, _kMRMediaRemoteNowPlayingInfoArtworkMIMEType, _kMRMediaRemoteNowPlayingInfoMediaType, _kMRMediaRemoteNowPlayingInfoiTunesStoreSubscriptionAdamIdentifier, _kMRMediaRemoteNowPlayingInfoGenre, _kMRMediaRemoteNowPlayingInfoComposer, _kMRMediaRemoteNowPlayingInfoQueueIndex, _kMRMediaRemoteNowPlayingInfoiTunesStoreIdentifier, _kMRMediaRemoteNowPlayingInfoTotalTrackCount, _kMRMediaRemoteNowPlayingInfoContentItemIdentifier, _kMRMediaRemoteNowPlayingInfoIsMusicApp, _kMRMediaRemoteNowPlayingInfoAlbumiTunesStoreAdamIdentifier, _kMRMediaRemoteNowPlayingInfoUniqueIdentifier, _kMRActiveNowPlayingPlayerPathUserInfoKey, _kMRMediaRemoteNowPlayingApplicationIsPlayingUserInfoKey, _kMRMediaRemoteNowPlayingApplicationDisplayNameUserInfoKey, _kMRMediaRemoteNowPlayingApplicationPIDUserInfoKey, _kMRMediaRemoteOriginUserInfoKey, _kMRMediaRemotePlaybackStateUserInfoKey, _kMRMediaRemoteUpdatedContentItemsUserInfoKey, _kMRNowPlayingClientUserInfoKey, _kMRNowPlayingPlayerPathUserInfoKey, _kMRNowPlayingPlayerUserInfoKey, _kMROriginActiveNowPlayingPlayerPathUserInfoKey ] + objc-classes: [ _MRColorProtobuf, _MRNowPlayingClientProtobuf ] +... diff --git a/MediaRemote.xcframework/tvos-simulator/MediaRemote.framework/MediaRemote.tbd b/MediaRemote.xcframework/tvos-simulator/MediaRemote.framework/MediaRemote.tbd new file mode 100644 index 0000000..553502d --- /dev/null +++ b/MediaRemote.xcframework/tvos-simulator/MediaRemote.framework/MediaRemote.tbd @@ -0,0 +1,9 @@ +--- !tapi-tbd +tbd-version: 4 +targets: [ x86_64-tvos-simulator, arm64-tvos-simulator ] +install-name: '/System/Library/PrivateFrameworks/MediaRemote.framework/MediaRemote' +exports: + - targets: [ x86_64-tvos-simulator, arm64-tvos-simulator ] + symbols: [ _MRMediaRemoteRegisterForNowPlayingNotifications, _MRMediaRemoteUnregisterForNowPlayingNotifications, _MRMediaRemoteGetNowPlayingClient, _MRMediaRemoteGetNowPlayingInfo, _MRMediaRemoteGetNowPlayingApplicationIsPlaying, _MRNowPlayingClientGetBundleIdentifier, _MRNowPlayingClientGetParentAppBundleIdentifier, _MRMediaRemoteSetElapsedTime, _MRMediaRemoteSendCommand, _kMRMediaRemoteNowPlayingInfoDidChangeNotification, _kMRMediaRemoteNowPlayingPlaybackQueueDidChangeNotification, _kMRMediaRemotePickableRoutesDidChangeNotification, _kMRMediaRemoteNowPlayingApplicationDidChangeNotification, _kMRMediaRemoteNowPlayingApplicationIsPlayingDidChangeNotification, _kMRMediaRemoteRouteStatusDidChangeNotification, _kMRNowPlayingPlaybackQueueChangedNotification, _kMRPlaybackQueueContentItemsChangedNotification, _kMRMediaRemoteNowPlayingInfoArtist, _kMRMediaRemoteNowPlayingInfoTitle, _kMRMediaRemoteNowPlayingInfoAlbum, _kMRMediaRemoteNowPlayingInfoArtworkData, _kMRMediaRemoteNowPlayingInfoPlaybackRate, _kMRMediaRemoteNowPlayingInfoDuration, _kMRMediaRemoteNowPlayingInfoElapsedTime, _kMRMediaRemoteNowPlayingInfoTimestamp, _kMRMediaRemoteNowPlayingInfoClientPropertiesData, _kMRMediaRemoteNowPlayingInfoArtworkIdentifier, _kMRMediaRemoteNowPlayingInfoShuffleMode, _kMRMediaRemoteNowPlayingInfoTrackNumber, _kMRMediaRemoteNowPlayingInfoTotalQueueCount, _kMRMediaRemoteNowPlayingInfoArtistiTunesStoreAdamIdentifier, _kMRMediaRemoteNowPlayingInfoArtworkMIMEType, _kMRMediaRemoteNowPlayingInfoMediaType, _kMRMediaRemoteNowPlayingInfoiTunesStoreSubscriptionAdamIdentifier, _kMRMediaRemoteNowPlayingInfoGenre, _kMRMediaRemoteNowPlayingInfoComposer, _kMRMediaRemoteNowPlayingInfoQueueIndex, _kMRMediaRemoteNowPlayingInfoiTunesStoreIdentifier, _kMRMediaRemoteNowPlayingInfoTotalTrackCount, _kMRMediaRemoteNowPlayingInfoContentItemIdentifier, _kMRMediaRemoteNowPlayingInfoIsMusicApp, _kMRMediaRemoteNowPlayingInfoAlbumiTunesStoreAdamIdentifier, _kMRMediaRemoteNowPlayingInfoUniqueIdentifier, _kMRActiveNowPlayingPlayerPathUserInfoKey, _kMRMediaRemoteNowPlayingApplicationIsPlayingUserInfoKey, _kMRMediaRemoteNowPlayingApplicationDisplayNameUserInfoKey, _kMRMediaRemoteNowPlayingApplicationPIDUserInfoKey, _kMRMediaRemoteOriginUserInfoKey, _kMRMediaRemotePlaybackStateUserInfoKey, _kMRMediaRemoteUpdatedContentItemsUserInfoKey, _kMRNowPlayingClientUserInfoKey, _kMRNowPlayingPlayerPathUserInfoKey, _kMRNowPlayingPlayerUserInfoKey, _kMROriginActiveNowPlayingPlayerPathUserInfoKey ] + objc-classes: [ _MRColorProtobuf, _MRNowPlayingClientProtobuf ] +... diff --git a/MediaRemote.xcframework/tvos/MediaRemote.framework/MediaRemote.tbd b/MediaRemote.xcframework/tvos/MediaRemote.framework/MediaRemote.tbd new file mode 100644 index 0000000..a579312 --- /dev/null +++ b/MediaRemote.xcframework/tvos/MediaRemote.framework/MediaRemote.tbd @@ -0,0 +1,9 @@ +--- !tapi-tbd +tbd-version: 4 +targets: [ arm64-tvos ] +install-name: '/System/Library/PrivateFrameworks/MediaRemote.framework/MediaRemote' +exports: + - targets: [ arm64-tvos ] + symbols: [ _MRMediaRemoteRegisterForNowPlayingNotifications, _MRMediaRemoteUnregisterForNowPlayingNotifications, _MRMediaRemoteGetNowPlayingClient, _MRMediaRemoteGetNowPlayingInfo, _MRMediaRemoteGetNowPlayingApplicationIsPlaying, _MRNowPlayingClientGetBundleIdentifier, _MRNowPlayingClientGetParentAppBundleIdentifier, _MRMediaRemoteSetElapsedTime, _MRMediaRemoteSendCommand, _kMRMediaRemoteNowPlayingInfoDidChangeNotification, _kMRMediaRemoteNowPlayingPlaybackQueueDidChangeNotification, _kMRMediaRemotePickableRoutesDidChangeNotification, _kMRMediaRemoteNowPlayingApplicationDidChangeNotification, _kMRMediaRemoteNowPlayingApplicationIsPlayingDidChangeNotification, _kMRMediaRemoteRouteStatusDidChangeNotification, _kMRNowPlayingPlaybackQueueChangedNotification, _kMRPlaybackQueueContentItemsChangedNotification, _kMRMediaRemoteNowPlayingInfoArtist, _kMRMediaRemoteNowPlayingInfoTitle, _kMRMediaRemoteNowPlayingInfoAlbum, _kMRMediaRemoteNowPlayingInfoArtworkData, _kMRMediaRemoteNowPlayingInfoPlaybackRate, _kMRMediaRemoteNowPlayingInfoDuration, _kMRMediaRemoteNowPlayingInfoElapsedTime, _kMRMediaRemoteNowPlayingInfoTimestamp, _kMRMediaRemoteNowPlayingInfoClientPropertiesData, _kMRMediaRemoteNowPlayingInfoArtworkIdentifier, _kMRMediaRemoteNowPlayingInfoShuffleMode, _kMRMediaRemoteNowPlayingInfoTrackNumber, _kMRMediaRemoteNowPlayingInfoTotalQueueCount, _kMRMediaRemoteNowPlayingInfoArtistiTunesStoreAdamIdentifier, _kMRMediaRemoteNowPlayingInfoArtworkMIMEType, _kMRMediaRemoteNowPlayingInfoMediaType, _kMRMediaRemoteNowPlayingInfoiTunesStoreSubscriptionAdamIdentifier, _kMRMediaRemoteNowPlayingInfoGenre, _kMRMediaRemoteNowPlayingInfoComposer, _kMRMediaRemoteNowPlayingInfoQueueIndex, _kMRMediaRemoteNowPlayingInfoiTunesStoreIdentifier, _kMRMediaRemoteNowPlayingInfoTotalTrackCount, _kMRMediaRemoteNowPlayingInfoContentItemIdentifier, _kMRMediaRemoteNowPlayingInfoIsMusicApp, _kMRMediaRemoteNowPlayingInfoAlbumiTunesStoreAdamIdentifier, _kMRMediaRemoteNowPlayingInfoUniqueIdentifier, _kMRActiveNowPlayingPlayerPathUserInfoKey, _kMRMediaRemoteNowPlayingApplicationIsPlayingUserInfoKey, _kMRMediaRemoteNowPlayingApplicationDisplayNameUserInfoKey, _kMRMediaRemoteNowPlayingApplicationPIDUserInfoKey, _kMRMediaRemoteOriginUserInfoKey, _kMRMediaRemotePlaybackStateUserInfoKey, _kMRMediaRemoteUpdatedContentItemsUserInfoKey, _kMRNowPlayingClientUserInfoKey, _kMRNowPlayingPlayerPathUserInfoKey, _kMRNowPlayingPlayerUserInfoKey, _kMROriginActiveNowPlayingPlayerPathUserInfoKey ] + objc-classes: [ _MRColorProtobuf, _MRNowPlayingClientProtobuf ] +... diff --git a/MediaRemote.xcframework/watchos-simulator/MediaRemote.framework/MediaRemote.tbd b/MediaRemote.xcframework/watchos-simulator/MediaRemote.framework/MediaRemote.tbd new file mode 100644 index 0000000..954a3da --- /dev/null +++ b/MediaRemote.xcframework/watchos-simulator/MediaRemote.framework/MediaRemote.tbd @@ -0,0 +1,9 @@ +--- !tapi-tbd +tbd-version: 4 +targets: [ i386-watchos-simulator, x86_64-watchos-simulator, arm64-watchos-simulator ] +install-name: '/System/Library/PrivateFrameworks/MediaRemote.framework/MediaRemote' +exports: + - targets: [ i386-watchos-simulator, x86_64-watchos-simulator, arm64-watchos-simulatorr ] + symbols: [ _MRMediaRemoteRegisterForNowPlayingNotifications, _MRMediaRemoteUnregisterForNowPlayingNotifications, _MRMediaRemoteGetNowPlayingClient, _MRMediaRemoteGetNowPlayingInfo, _MRMediaRemoteGetNowPlayingApplicationIsPlaying, _MRNowPlayingClientGetBundleIdentifier, _MRNowPlayingClientGetParentAppBundleIdentifier, _MRMediaRemoteSetElapsedTime, _MRMediaRemoteSendCommand, _kMRMediaRemoteNowPlayingInfoDidChangeNotification, _kMRMediaRemoteNowPlayingPlaybackQueueDidChangeNotification, _kMRMediaRemotePickableRoutesDidChangeNotification, _kMRMediaRemoteNowPlayingApplicationDidChangeNotification, _kMRMediaRemoteNowPlayingApplicationIsPlayingDidChangeNotification, _kMRMediaRemoteRouteStatusDidChangeNotification, _kMRNowPlayingPlaybackQueueChangedNotification, _kMRPlaybackQueueContentItemsChangedNotification, _kMRMediaRemoteNowPlayingInfoArtist, _kMRMediaRemoteNowPlayingInfoTitle, _kMRMediaRemoteNowPlayingInfoAlbum, _kMRMediaRemoteNowPlayingInfoArtworkData, _kMRMediaRemoteNowPlayingInfoPlaybackRate, _kMRMediaRemoteNowPlayingInfoDuration, _kMRMediaRemoteNowPlayingInfoElapsedTime, _kMRMediaRemoteNowPlayingInfoTimestamp, _kMRMediaRemoteNowPlayingInfoClientPropertiesData, _kMRMediaRemoteNowPlayingInfoArtworkIdentifier, _kMRMediaRemoteNowPlayingInfoShuffleMode, _kMRMediaRemoteNowPlayingInfoTrackNumber, _kMRMediaRemoteNowPlayingInfoTotalQueueCount, _kMRMediaRemoteNowPlayingInfoArtistiTunesStoreAdamIdentifier, _kMRMediaRemoteNowPlayingInfoArtworkMIMEType, _kMRMediaRemoteNowPlayingInfoMediaType, _kMRMediaRemoteNowPlayingInfoiTunesStoreSubscriptionAdamIdentifier, _kMRMediaRemoteNowPlayingInfoGenre, _kMRMediaRemoteNowPlayingInfoComposer, _kMRMediaRemoteNowPlayingInfoQueueIndex, _kMRMediaRemoteNowPlayingInfoiTunesStoreIdentifier, _kMRMediaRemoteNowPlayingInfoTotalTrackCount, _kMRMediaRemoteNowPlayingInfoContentItemIdentifier, _kMRMediaRemoteNowPlayingInfoIsMusicApp, _kMRMediaRemoteNowPlayingInfoAlbumiTunesStoreAdamIdentifier, _kMRMediaRemoteNowPlayingInfoUniqueIdentifier, _kMRActiveNowPlayingPlayerPathUserInfoKey, _kMRMediaRemoteNowPlayingApplicationIsPlayingUserInfoKey, _kMRMediaRemoteNowPlayingApplicationDisplayNameUserInfoKey, _kMRMediaRemoteNowPlayingApplicationPIDUserInfoKey, _kMRMediaRemoteOriginUserInfoKey, _kMRMediaRemotePlaybackStateUserInfoKey, _kMRMediaRemoteUpdatedContentItemsUserInfoKey, _kMRNowPlayingClientUserInfoKey, _kMRNowPlayingPlayerPathUserInfoKey, _kMRNowPlayingPlayerUserInfoKey, _kMROriginActiveNowPlayingPlayerPathUserInfoKey ] + objc-classes: [ _MRColorProtobuf, _MRNowPlayingClientProtobuf ] +... diff --git a/MediaRemote.xcframework/watchos/MediaRemote.framework/MediaRemote.tbd b/MediaRemote.xcframework/watchos/MediaRemote.framework/MediaRemote.tbd new file mode 100644 index 0000000..eb0a4e1 --- /dev/null +++ b/MediaRemote.xcframework/watchos/MediaRemote.framework/MediaRemote.tbd @@ -0,0 +1,9 @@ +--- !tapi-tbd +tbd-version: 4 +targets: [ armv7k-watchos, arm64_32-watchos ] +install-name: '/System/Library/PrivateFrameworks/MediaRemote.framework/MediaRemote' +exports: + - targets: [ armv7k-watchos, arm64_32-watchos ] + symbols: [ _MRMediaRemoteRegisterForNowPlayingNotifications, _MRMediaRemoteUnregisterForNowPlayingNotifications, _MRMediaRemoteGetNowPlayingClient, _MRMediaRemoteGetNowPlayingInfo, _MRMediaRemoteGetNowPlayingApplicationIsPlaying, _MRNowPlayingClientGetBundleIdentifier, _MRNowPlayingClientGetParentAppBundleIdentifier, _MRMediaRemoteSetElapsedTime, _MRMediaRemoteSendCommand, _kMRMediaRemoteNowPlayingInfoDidChangeNotification, _kMRMediaRemoteNowPlayingPlaybackQueueDidChangeNotification, _kMRMediaRemotePickableRoutesDidChangeNotification, _kMRMediaRemoteNowPlayingApplicationDidChangeNotification, _kMRMediaRemoteNowPlayingApplicationIsPlayingDidChangeNotification, _kMRMediaRemoteRouteStatusDidChangeNotification, _kMRNowPlayingPlaybackQueueChangedNotification, _kMRPlaybackQueueContentItemsChangedNotification, _kMRMediaRemoteNowPlayingInfoArtist, _kMRMediaRemoteNowPlayingInfoTitle, _kMRMediaRemoteNowPlayingInfoAlbum, _kMRMediaRemoteNowPlayingInfoArtworkData, _kMRMediaRemoteNowPlayingInfoPlaybackRate, _kMRMediaRemoteNowPlayingInfoDuration, _kMRMediaRemoteNowPlayingInfoElapsedTime, _kMRMediaRemoteNowPlayingInfoTimestamp, _kMRMediaRemoteNowPlayingInfoClientPropertiesData, _kMRMediaRemoteNowPlayingInfoArtworkIdentifier, _kMRMediaRemoteNowPlayingInfoShuffleMode, _kMRMediaRemoteNowPlayingInfoTrackNumber, _kMRMediaRemoteNowPlayingInfoTotalQueueCount, _kMRMediaRemoteNowPlayingInfoArtistiTunesStoreAdamIdentifier, _kMRMediaRemoteNowPlayingInfoArtworkMIMEType, _kMRMediaRemoteNowPlayingInfoMediaType, _kMRMediaRemoteNowPlayingInfoiTunesStoreSubscriptionAdamIdentifier, _kMRMediaRemoteNowPlayingInfoGenre, _kMRMediaRemoteNowPlayingInfoComposer, _kMRMediaRemoteNowPlayingInfoQueueIndex, _kMRMediaRemoteNowPlayingInfoiTunesStoreIdentifier, _kMRMediaRemoteNowPlayingInfoTotalTrackCount, _kMRMediaRemoteNowPlayingInfoContentItemIdentifier, _kMRMediaRemoteNowPlayingInfoIsMusicApp, _kMRMediaRemoteNowPlayingInfoAlbumiTunesStoreAdamIdentifier, _kMRMediaRemoteNowPlayingInfoUniqueIdentifier, _kMRActiveNowPlayingPlayerPathUserInfoKey, _kMRMediaRemoteNowPlayingApplicationIsPlayingUserInfoKey, _kMRMediaRemoteNowPlayingApplicationDisplayNameUserInfoKey, _kMRMediaRemoteNowPlayingApplicationPIDUserInfoKey, _kMRMediaRemoteOriginUserInfoKey, _kMRMediaRemotePlaybackStateUserInfoKey, _kMRMediaRemoteUpdatedContentItemsUserInfoKey, _kMRNowPlayingClientUserInfoKey, _kMRNowPlayingPlayerPathUserInfoKey, _kMRNowPlayingPlayerUserInfoKey, _kMROriginActiveNowPlayingPlayerPathUserInfoKey ] + objc-classes: [ _MRColorProtobuf, _MRNowPlayingClientProtobuf ] +... diff --git a/Package.resolved b/Package.resolved new file mode 100644 index 0000000..6d8f7a7 --- /dev/null +++ b/Package.resolved @@ -0,0 +1,16 @@ +{ + "object": { + "pins": [ + { + "package": "PrivateProtocolBuffer", + "repositoryURL": "https://github.com/PrivateFrameworks/ProtocolBuffer", + "state": { + "branch": null, + "revision": "20b692d09393389120bea65098ddf66129352bb7", + "version": "0.1.0" + } + } + ] + }, + "version": 1 +} diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..29918c8 --- /dev/null +++ b/Package.swift @@ -0,0 +1,61 @@ +// swift-tools-version:5.5 + +import PackageDescription + +let package = Package( + name: "PrivateMediaRemote", + platforms: [ + .iOS(.v8), + .macOS(.v10_12), + .macCatalyst(.v13), + .tvOS(.v9), + .watchOS(.v2), + ], + products: [ + .library( + name: "PrivateMediaRemote", + targets: ["PrivateMediaRemote"] + ), + .library( + name: "MediaRemote", + targets: ["MediaRemote"] + ), + ], + dependencies: [ + .package(url: "https://github.com/PrivateFrameworks/ProtocolBuffer", .upToNextMinor(from: "0.1.0")), + ], + targets: [ + .target( + name: "PrivateMediaRemote", + dependencies: [ + .product(name: "PrivateProtocolBuffer", package: "ProtocolBuffer"), + ], + path: "Sources", + publicHeadersPath: "." + ), + .binaryTarget( + name: "MediaRemote", + path: "MediaRemote.xcframework" + ), + .testTarget( + name: "TestsWithLinking", + dependencies: [ + "PrivateMediaRemote", + "MediaRemote", + .product(name: "ProtocolBuffer", package: "ProtocolBuffer"), + ], + path: "Tests/Linked", + cSettings: [ + .define("LINKED_TESTS"), + ] + ), + .testTarget( + name: "TestsWithoutLinking", + dependencies: ["PrivateMediaRemote"], + path: "Tests/Unlinked", + cSettings: [ + .define("UNLINKED_TESTS"), + ] + ), + ] +) diff --git a/README.md b/README.md new file mode 100644 index 0000000..d1ffb5e --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# MediaRemote + +## Installation + +### Using Swift Package Manager + +Add the following to your `dependencies` in `Package.swift`: +```swift +.package(url: "https://github.com/PrivateFrameworks/MediaRemote", .upToNextMinor(from: "0.1.0")), +``` + +And then add `PrivateMediaRemote` as a dependency to your target: +```swift + .target( + name: "Home", + dependencies: [ + // ... + .product(name: "PrivateMediaRemote", package: "MediaRemote"), + ] + ), +``` + +To link `/System/Library/PrivateFrameworks/MediaRemote.framework` add `MediaRemote` to your target dependencies: +```swift + .target( + name: "Home", + dependencies: [ + // ... + .product(name: "PrivateMediaRemote", package: "MediaRemote"), + .product(name: "MediaRemote", package: "MediaRemote"), + ] + ), +``` diff --git a/Sources/PrivateMediaRemote.m b/Sources/PrivateMediaRemote.m new file mode 100644 index 0000000..1a0b3eb --- /dev/null +++ b/Sources/PrivateMediaRemote.m @@ -0,0 +1,21 @@ +#import + +@implementation PrivateMediaRemote + ++ (NSURL *)bundleURL { + return [NSURL fileURLWithPath:@"/System/Library/PrivateFrameworks/MediaRemote.framework"]; +} + ++ (NSBundle *)bundle { + return [NSBundle bundleWithURL:self.bundleURL]; +} + ++ (BOOL)load { + return [self.bundle load]; +} + ++ (BOOL)unload { + return [self.bundle unload]; +} + +@end diff --git a/Sources/PrivateMediaRemote/Constants.h b/Sources/PrivateMediaRemote/Constants.h new file mode 100644 index 0000000..130bd26 --- /dev/null +++ b/Sources/PrivateMediaRemote/Constants.h @@ -0,0 +1,52 @@ +#ifndef PrivateMediaRemote_Constants_h +#define PrivateMediaRemote_Constants_h + +extern NSString *kMRMediaRemoteNowPlayingInfoDidChangeNotification; +extern NSString *kMRMediaRemoteNowPlayingPlaybackQueueDidChangeNotification; +extern NSString *kMRMediaRemotePickableRoutesDidChangeNotification; +extern NSString *kMRMediaRemoteNowPlayingApplicationDidChangeNotification; +extern NSString *kMRMediaRemoteNowPlayingApplicationIsPlayingDidChangeNotification; +extern NSString *kMRMediaRemoteRouteStatusDidChangeNotification; +extern NSString *kMRNowPlayingPlaybackQueueChangedNotification; +extern NSString *kMRPlaybackQueueContentItemsChangedNotification; + +extern NSString *kMRMediaRemoteNowPlayingInfoArtist; +extern NSString *kMRMediaRemoteNowPlayingInfoTitle; +extern NSString *kMRMediaRemoteNowPlayingInfoAlbum; +extern NSString *kMRMediaRemoteNowPlayingInfoArtworkData; +extern NSString *kMRMediaRemoteNowPlayingInfoPlaybackRate; +extern NSString *kMRMediaRemoteNowPlayingInfoDuration; +extern NSString *kMRMediaRemoteNowPlayingInfoElapsedTime; +extern NSString *kMRMediaRemoteNowPlayingInfoTimestamp; +extern NSString *kMRMediaRemoteNowPlayingInfoClientPropertiesData; +extern NSString *kMRMediaRemoteNowPlayingInfoArtworkIdentifier; +extern NSString *kMRMediaRemoteNowPlayingInfoShuffleMode; +extern NSString *kMRMediaRemoteNowPlayingInfoTrackNumber; +extern NSString *kMRMediaRemoteNowPlayingInfoTotalQueueCount; +extern NSString *kMRMediaRemoteNowPlayingInfoArtistiTunesStoreAdamIdentifier; +extern NSString *kMRMediaRemoteNowPlayingInfoArtworkMIMEType; +extern NSString *kMRMediaRemoteNowPlayingInfoMediaType; +extern NSString *kMRMediaRemoteNowPlayingInfoiTunesStoreSubscriptionAdamIdentifier; +extern NSString *kMRMediaRemoteNowPlayingInfoGenre; +extern NSString *kMRMediaRemoteNowPlayingInfoComposer; +extern NSString *kMRMediaRemoteNowPlayingInfoQueueIndex; +extern NSString *kMRMediaRemoteNowPlayingInfoiTunesStoreIdentifier; +extern NSString *kMRMediaRemoteNowPlayingInfoTotalTrackCount; +extern NSString *kMRMediaRemoteNowPlayingInfoContentItemIdentifier; +extern NSString *kMRMediaRemoteNowPlayingInfoIsMusicApp; +extern NSString *kMRMediaRemoteNowPlayingInfoAlbumiTunesStoreAdamIdentifier; +extern NSString *kMRMediaRemoteNowPlayingInfoUniqueIdentifier; + +extern NSString *kMRActiveNowPlayingPlayerPathUserInfoKey; +extern NSString *kMRMediaRemoteNowPlayingApplicationIsPlayingUserInfoKey; +extern NSString *kMRMediaRemoteNowPlayingApplicationDisplayNameUserInfoKey; +extern NSString *kMRMediaRemoteNowPlayingApplicationPIDUserInfoKey; +extern NSString *kMRMediaRemoteOriginUserInfoKey; +extern NSString *kMRMediaRemotePlaybackStateUserInfoKey; +extern NSString *kMRMediaRemoteUpdatedContentItemsUserInfoKey; +extern NSString *kMRNowPlayingClientUserInfoKey; +extern NSString *kMRNowPlayingPlayerPathUserInfoKey; +extern NSString *kMRNowPlayingPlayerUserInfoKey; +extern NSString *kMROriginActiveNowPlayingPlayerPathUserInfoKey; + +#endif /* PrivateMediaRemote_Constants_h */ diff --git a/Sources/PrivateMediaRemote/Enums.h b/Sources/PrivateMediaRemote/Enums.h new file mode 100644 index 0000000..fc3fa01 --- /dev/null +++ b/Sources/PrivateMediaRemote/Enums.h @@ -0,0 +1,50 @@ +#ifndef PrivateMediaRemote_Enums_h +#define PrivateMediaRemote_Enums_h + +typedef enum { + /* + * Use nil for userInfo. + */ + MRMediaRemoteCommandPlay, + MRMediaRemoteCommandPause, + MRMediaRemoteCommandTogglePlayPause, + MRMediaRemoteCommandStop, + MRMediaRemoteCommandNextTrack, + MRMediaRemoteCommandPreviousTrack, + MRMediaRemoteCommandAdvanceShuffleMode, + MRMediaRemoteCommandAdvanceRepeatMode, + MRMediaRemoteCommandBeginFastForward, + MRMediaRemoteCommandEndFastForward, + MRMediaRemoteCommandBeginRewind, + MRMediaRemoteCommandEndRewind, + MRMediaRemoteCommandRewind15Seconds, + MRMediaRemoteCommandFastForward15Seconds, + MRMediaRemoteCommandRewind30Seconds, + MRMediaRemoteCommandFastForward30Seconds, + MRMediaRemoteCommandToggleRecord, + MRMediaRemoteCommandSkipForward, + MRMediaRemoteCommandSkipBackward, + MRMediaRemoteCommandChangePlaybackRate, + + /* + * Use a NSDictionary for userInfo, which contains three keys: + * kMRMediaRemoteOptionTrackID + * kMRMediaRemoteOptionStationID + * kMRMediaRemoteOptionStationHash + */ + MRMediaRemoteCommandRateTrack, + MRMediaRemoteCommandLikeTrack, + MRMediaRemoteCommandDislikeTrack, + MRMediaRemoteCommandBookmarkTrack, + + /* + * Use nil for userInfo. + */ + MRMediaRemoteCommandSeekToPlaybackPosition, + MRMediaRemoteCommandChangeRepeatMode, + MRMediaRemoteCommandChangeShuffleMode, + MRMediaRemoteCommandEnableLanguageOption, + MRMediaRemoteCommandDisableLanguageOption +} MRMediaRemoteCommand; + +#endif /* PrivateMediaRemote_Enums_h */ diff --git a/Sources/PrivateMediaRemote/Functions.h b/Sources/PrivateMediaRemote/Functions.h new file mode 100644 index 0000000..c09dfdd --- /dev/null +++ b/Sources/PrivateMediaRemote/Functions.h @@ -0,0 +1,19 @@ +#ifndef PrivateMediaRemote_Functions_h +#define PrivateMediaRemote_Functions_h + +#import "_MRNowPlayingClientProtobuf.h" + +void MRMediaRemoteRegisterForNowPlayingNotifications(dispatch_queue_t queue); +void MRMediaRemoteUnregisterForNowPlayingNotifications(void); +typedef void (^MRMediaRemoteGetNowPlayingClientCallback)(_MRNowPlayingClientProtobuf *client); +void MRMediaRemoteGetNowPlayingClient(dispatch_queue_t queue, MRMediaRemoteGetNowPlayingClientCallback block); +typedef void (^MRMediaRemoteGetNowPlayingInfoCallback)(NSDictionary *info); +void MRMediaRemoteGetNowPlayingInfo(dispatch_queue_t queue, MRMediaRemoteGetNowPlayingInfoCallback block); +typedef void (^MRMediaRemoteGetNowPlayingApplicationIsPlayingCallback)(BOOL isPlaying); +void MRMediaRemoteGetNowPlayingApplicationIsPlaying(dispatch_queue_t queue, MRMediaRemoteGetNowPlayingApplicationIsPlayingCallback block); +NSString *MRNowPlayingClientGetBundleIdentifier(id clientObj) __attribute__((warn_unused_result)); +NSString *MRNowPlayingClientGetParentAppBundleIdentifier(id clientObj) __attribute__((warn_unused_result)); +void MRMediaRemoteSetElapsedTime(double time); +Boolean MRMediaRemoteSendCommand(MRMediaRemoteCommand command, NSDictionary *userInfo); + +#endif /* PrivateMediaRemote_Functions_h */ diff --git a/Sources/PrivateMediaRemote/PrivateMediaRemote.h b/Sources/PrivateMediaRemote/PrivateMediaRemote.h new file mode 100644 index 0000000..c6264eb --- /dev/null +++ b/Sources/PrivateMediaRemote/PrivateMediaRemote.h @@ -0,0 +1,25 @@ +#ifndef PrivateMediaRemote_PrivateMediaRemote_h +#define PrivateMediaRemote_PrivateMediaRemote_h + +#import + +#import "_MRColorProtobuf.h" +#import "_MRNowPlayingClientProtobuf.h" +#import "Constants.h" +#import "Enums.h" +#import "Functions.h" + +FOUNDATION_EXPORT double MediaRemoteVersionNumber; + +FOUNDATION_EXPORT const unsigned char MediaRemoteVersionString[]; + +@interface PrivateMediaRemote : NSObject + ++ (NSURL *)bundleURL; ++ (NSBundle *)bundle; ++ (BOOL)load; ++ (BOOL)unload; + +@end + +#endif /* PrivateMediaRemote_PrivateMediaRemote_h */ diff --git a/Sources/PrivateMediaRemote/_MRColorProtobuf.h b/Sources/PrivateMediaRemote/_MRColorProtobuf.h new file mode 100644 index 0000000..0b4e12e --- /dev/null +++ b/Sources/PrivateMediaRemote/_MRColorProtobuf.h @@ -0,0 +1,36 @@ +#ifndef PrivateMediaRemote__MRColorProtobuf_h +#define PrivateMediaRemote__MRColorProtobuf_h + +#import + +@interface _MRColorProtobuf : PBCodable { + float _alpha; + float _blue; + float _green; + float _red; + struct { + unsigned state: 1; + unsigned status: 1; + unsigned isRetrying: 1; + unsigned isUsingSystemPairing: 1; + } _has; +} + +@property (assign, nonatomic) BOOL hasRed; +@property (assign, nonatomic) float red; +@property (assign, nonatomic) BOOL hasGreen; +@property (assign, nonatomic) float green; +@property (assign, nonatomic) BOOL hasBlue; +@property (assign, nonatomic) float blue; +@property (assign, nonatomic) BOOL hasAlpha; +@property (assign, nonatomic) float alpha; + +- (BOOL)isEqual:(id)arg1; +- (unsigned long long)hash; +- (id)description; +- (void)mergeFrom:(id)arg1; +- (void)copyTo:(id)arg1; + +@end + +#endif /* PrivateMediaRemote__MRColorProtobuf_h */ diff --git a/Sources/PrivateMediaRemote/_MRNowPlayingClientProtobuf.h b/Sources/PrivateMediaRemote/_MRNowPlayingClientProtobuf.h new file mode 100644 index 0000000..8b4c926 --- /dev/null +++ b/Sources/PrivateMediaRemote/_MRNowPlayingClientProtobuf.h @@ -0,0 +1,53 @@ +#ifndef PrivateMediaRemote__MRNowPlayingClientProtobuf_h +#define PrivateMediaRemote__MRNowPlayingClientProtobuf_h + +#include + +#include "_MRColorProtobuf.h" + +@interface _MRNowPlayingClientProtobuf : PBCodable { + NSString *_bundleIdentifier; + NSString *_displayName; + int _nowPlayingVisibility; + NSString *_parentApplicationBundleIdentifier; + int _processIdentifier; + int _processUserIdentifier; + _MRColorProtobuf *_tintColor; + struct { + unsigned int nowPlayingVisibility: 1; + unsigned int processIdentifier: 1; + unsigned int processUserIdentifier: 1; + unsigned int isEmptyDeprecated: 1; + } _has; +} + +@property (assign, nonatomic) BOOL hasProcessIdentifier; +@property (assign, nonatomic) int processIdentifier; +@property (nonatomic, readonly) BOOL hasBundleIdentifier; +@property (nonatomic, retain) NSString *bundleIdentifier; +@property (nonatomic, readonly) BOOL hasParentApplicationBundleIdentifier; +@property (nonatomic, readonly, retain) NSString *parentApplicationBundleIdentifier; +@property (assign, nonatomic) BOOL hasProcessUserIdentifier; +@property (assign, nonatomic) int processUserIdentifier; +@property (assign, nonatomic) BOOL hasNowPlayingVisibility; +@property (assign, nonatomic) int nowPlayingVisibility; +@property (nonatomic, readonly) BOOL hasTintColor; +@property (nonatomic, retain) _MRColorProtobuf *tintColor; +@property (nonatomic, readonly) BOOL hasDisplayName; +@property (nonatomic, readonly, retain) NSString *displayName; + +- (void)copyTo:(id)arg1; +- (void)mergeFrom:(id)arg1; +- (BOOL)hasBundleIdentifier; +- (void)dealloc; +- (BOOL)isEqual:(id)arg1; +- (unsigned long long)hash; +- (id)description; +- (id)copyWithZone:(NSZone *)arg1; +- (id)nowPlayingVisibilityAsString:(int)arg1; +- (int)StringAsNowPlayingVisibility:(id)arg1; +- (BOOL)hasTintColor; + +@end + +#endif /* PrivateMediaRemote__MRNowPlayingClientProtobuf_h */ diff --git a/Tests/Common.h b/Tests/Common.h new file mode 100644 index 0000000..8514bb1 --- /dev/null +++ b/Tests/Common.h @@ -0,0 +1,20 @@ +#ifndef Common_h +#define Common_h + +@import XCTest; +@import ObjectiveC; +@import PrivateMediaRemote; + +#include "SetUp.h" +#include "GetClass.h" +#include "Identifier.h" +#include "Interface.h" +#include "TearDown.h" +#include "TestClasses.h" +#include "TestConstants.h" +#include "TestFunctions.h" +#include "TestSelectors.h" +#include "TestMethods.h" +#include "TestConforming.h" + +#endif /* Common_h */ diff --git a/Tests/GetClass.h b/Tests/GetClass.h new file mode 100644 index 0000000..3f24b21 --- /dev/null +++ b/Tests/GetClass.h @@ -0,0 +1,12 @@ +#ifndef GetClass_h +#define GetClass_h + +#ifdef LINKED_TESTS +#define GetClass(CLASS) CLASS.class +#elif defined(UNLINKED_TESTS) +#define GetClass(CLASS) objc_getClass(#CLASS) +#endif + +#define GetUnlinkableClass(CLASS) objc_getClass(#CLASS) + +#endif /* GetClass_h */ diff --git a/Tests/Identifier.h b/Tests/Identifier.h new file mode 100644 index 0000000..792ea24 --- /dev/null +++ b/Tests/Identifier.h @@ -0,0 +1,10 @@ +#ifndef Identifier_h +#define Identifier_h + +#ifdef LINKED_TESTS +#define Identifier(IDENTIFIER) LINKED_##IDENTIFIER +#elif defined(UNLINKED_TESTS) +#define Identifier(IDENTIFIER) UNLINKED_##IDENTIFIER +#endif + +#endif /* Identifier_h */ diff --git a/Tests/Interface.h b/Tests/Interface.h new file mode 100644 index 0000000..2c611fe --- /dev/null +++ b/Tests/Interface.h @@ -0,0 +1,11 @@ +#ifndef Interface_h +#define Interface_h + +@interface Identifier(Tests) : XCTestCase + +@property (weak) NSBundle *bundle; +@property CFBundleRef cfBundle; + +@end + +#endif /* Interface_h */ diff --git a/Tests/Linked/Tests.m b/Tests/Linked/Tests.m new file mode 100644 index 0000000..4ff0db8 --- /dev/null +++ b/Tests/Linked/Tests.m @@ -0,0 +1,37 @@ +#import "../Common.h" + +@implementation Identifier(Tests) + +- (void)setUp { + SetUp +} + +- (void)tearDown { + TearDown +} + +- (void)testClasses { + TestClasses +} + +- (void)testSelectors { + TestSelectors +} + +- (void)testConforming { + TestConforming +} + +- (void)testMethods { + TestMethods +} + +- (void)testConstants { + TestConstants +} + +- (void)testFunctions { + TestFunctions +} + +@end diff --git a/Tests/SetUp.h b/Tests/SetUp.h new file mode 100644 index 0000000..c30d0d1 --- /dev/null +++ b/Tests/SetUp.h @@ -0,0 +1,10 @@ +#ifndef SetUp_h +#define SetUp_h + +#define SetUp \ +self.bundle = PrivateMediaRemote.bundle; \ +self.cfBundle = CFBundleCreate(NULL, (__bridge CFURLRef)PrivateMediaRemote.bundleURL); \ +XCTAssertTrue([self.bundle load]); \ + + +#endif /* SetUp_h */ diff --git a/Tests/TearDown.h b/Tests/TearDown.h new file mode 100644 index 0000000..bd9c870 --- /dev/null +++ b/Tests/TearDown.h @@ -0,0 +1,8 @@ +#ifndef TearDown_h +#define TearDown_h + +#define TearDown \ +self.bundle = nil; \ +self.cfBundle = nil; \ + +#endif /* TearDown_h */ diff --git a/Tests/TestClasses.h b/Tests/TestClasses.h new file mode 100644 index 0000000..18b486e --- /dev/null +++ b/Tests/TestClasses.h @@ -0,0 +1,19 @@ +#ifndef TestClasses_h +#define TestClasses_h + +BOOL Identifier(isClassDefined)(Class classInstance, NSString *classString) { + return [NSStringFromClass(((NSObject *)[classInstance new]).class) isEqualToString:classString]; +} + +#define IsClassDefined(CLASS) Identifier(isClassDefined)(GetClass(CLASS), @#CLASS) +#define IsUnlinkableClassDefined(CLASS) Identifier(isClassDefined)(GetUnlinkableClass(CLASS), @#CLASS) + +#define TestClass(CLASS) XCTAssertTrue(IsClassDefined(CLASS)) +#define TestUnlinkableClass(CLASS) XCTAssertTrue(IsUnlinkableClassDefined(CLASS)) + +#define TestClasses \ +TestClass(_MRColorProtobuf); \ +TestClass(_MRNowPlayingClientProtobuf); \ + + +#endif /* TestClasses_h */ diff --git a/Tests/TestConforming.h b/Tests/TestConforming.h new file mode 100644 index 0000000..ca9ddc6 --- /dev/null +++ b/Tests/TestConforming.h @@ -0,0 +1,17 @@ +#ifndef TestConforming_h +#define TestConforming_h + +BOOL Identifier(classConformsToProtocol)(Class classInstance, NSString *protocol) { + return [classInstance conformsToProtocol:NSProtocolFromString(protocol)]; +} + +#define ClassConformsToProtocol(CLASS, PROTOCOL) Identifier(classConformsToProtocol)(GetClass(CLASS), @#PROTOCOL) + +#define TestClassConformsToProtocol(CLASS, PROTOCOL) XCTAssertTrue(ClassConformsToProtocol(CLASS, PROTOCOL)) + +#define TestConforming \ +TestClassConformsToProtocol(_MRColorProtobuf, NSCopying); \ +TestClassConformsToProtocol(_MRNowPlayingClientProtobuf, NSCopying); \ + + +#endif /* TestConforming_h */ diff --git a/Tests/TestConstants.h b/Tests/TestConstants.h new file mode 100644 index 0000000..b0d6100 --- /dev/null +++ b/Tests/TestConstants.h @@ -0,0 +1,68 @@ +#ifndef TestConstants_h +#define TestConstants_h + +#ifdef LINKED_TESTS +#define IsVariableNameEqualToValue(STRING) [@#STRING isEqualToString:STRING] +#elif defined(UNLINKED_TESTS) +BOOL Identifier(isVariableNameEqualToValue)(CFBundleRef cfBundle, CFStringRef cfString, NSString *string) { + CFStringRef *ref = (CFStringRef *)CFBundleGetDataPointerForName(cfBundle, cfString); + if (ref == nil) return NO; + + return [string isEqualToString:((__bridge NSString *)*ref)]; +} +#define IsVariableNameEqualToValue(STRING) Identifier(isVariableNameEqualToValue)(self.cfBundle, CFSTR(#STRING), @#STRING) +#endif + +#define TestConstant(STRING) XCTAssertTrue(IsVariableNameEqualToValue(STRING)) + +#define TestConstants \ +TestConstant(kMRMediaRemoteNowPlayingInfoDidChangeNotification); \ +TestConstant(kMRMediaRemoteNowPlayingPlaybackQueueDidChangeNotification); \ +TestConstant(kMRMediaRemotePickableRoutesDidChangeNotification); \ +TestConstant(kMRMediaRemoteNowPlayingApplicationDidChangeNotification); \ +TestConstant(kMRMediaRemoteNowPlayingApplicationIsPlayingDidChangeNotification); \ +TestConstant(kMRMediaRemoteRouteStatusDidChangeNotification); \ +TestConstant(kMRNowPlayingPlaybackQueueChangedNotification); \ +TestConstant(kMRPlaybackQueueContentItemsChangedNotification); \ +\ +TestConstant(kMRMediaRemoteNowPlayingInfoArtist); \ +TestConstant(kMRMediaRemoteNowPlayingInfoTitle); \ +TestConstant(kMRMediaRemoteNowPlayingInfoAlbum); \ +TestConstant(kMRMediaRemoteNowPlayingInfoArtworkData); \ +TestConstant(kMRMediaRemoteNowPlayingInfoPlaybackRate); \ +TestConstant(kMRMediaRemoteNowPlayingInfoDuration); \ +TestConstant(kMRMediaRemoteNowPlayingInfoElapsedTime); \ +TestConstant(kMRMediaRemoteNowPlayingInfoTimestamp); \ +TestConstant(kMRMediaRemoteNowPlayingInfoClientPropertiesData); \ +TestConstant(kMRMediaRemoteNowPlayingInfoArtworkIdentifier); \ +TestConstant(kMRMediaRemoteNowPlayingInfoShuffleMode); \ +TestConstant(kMRMediaRemoteNowPlayingInfoTrackNumber); \ +TestConstant(kMRMediaRemoteNowPlayingInfoTotalQueueCount); \ +TestConstant(kMRMediaRemoteNowPlayingInfoArtistiTunesStoreAdamIdentifier); \ +TestConstant(kMRMediaRemoteNowPlayingInfoArtworkMIMEType); \ +TestConstant(kMRMediaRemoteNowPlayingInfoMediaType); \ +TestConstant(kMRMediaRemoteNowPlayingInfoiTunesStoreSubscriptionAdamIdentifier); \ +TestConstant(kMRMediaRemoteNowPlayingInfoGenre); \ +TestConstant(kMRMediaRemoteNowPlayingInfoComposer); \ +TestConstant(kMRMediaRemoteNowPlayingInfoQueueIndex); \ +TestConstant(kMRMediaRemoteNowPlayingInfoiTunesStoreIdentifier); \ +TestConstant(kMRMediaRemoteNowPlayingInfoTotalTrackCount); \ +TestConstant(kMRMediaRemoteNowPlayingInfoContentItemIdentifier); \ +TestConstant(kMRMediaRemoteNowPlayingInfoIsMusicApp); \ +TestConstant(kMRMediaRemoteNowPlayingInfoAlbumiTunesStoreAdamIdentifier); \ +TestConstant(kMRMediaRemoteNowPlayingInfoUniqueIdentifier); \ +\ +TestConstant(kMRActiveNowPlayingPlayerPathUserInfoKey); \ +TestConstant(kMRMediaRemoteNowPlayingApplicationIsPlayingUserInfoKey); \ +TestConstant(kMRMediaRemoteNowPlayingApplicationDisplayNameUserInfoKey); \ +TestConstant(kMRMediaRemoteNowPlayingApplicationPIDUserInfoKey); \ +TestConstant(kMRMediaRemoteOriginUserInfoKey); \ +TestConstant(kMRMediaRemotePlaybackStateUserInfoKey); \ +TestConstant(kMRMediaRemoteUpdatedContentItemsUserInfoKey); \ +TestConstant(kMRNowPlayingClientUserInfoKey); \ +TestConstant(kMRNowPlayingPlayerPathUserInfoKey); \ +TestConstant(kMRNowPlayingPlayerUserInfoKey); \ +TestConstant(kMROriginActiveNowPlayingPlayerPathUserInfoKey); \ + + +#endif /* TestConstants_h */ diff --git a/Tests/TestFunctions.h b/Tests/TestFunctions.h new file mode 100644 index 0000000..9f35064 --- /dev/null +++ b/Tests/TestFunctions.h @@ -0,0 +1,19 @@ +#ifndef TestFunctions_h +#define TestFunctions_h + +#define GetFunctionPointer(FUNCTION) CFBundleGetFunctionPointerForName(self.cfBundle, CFSTR(#FUNCTION)) + +#define TestFunction(FUNCTION) XCTAssertTrue(GetFunctionPointer(FUNCTION) != nil) + +#define TestFunctions \ +TestFunction(MRMediaRemoteRegisterForNowPlayingNotifications); \ +TestFunction(MRMediaRemoteUnregisterForNowPlayingNotifications); \ +TestFunction(MRMediaRemoteGetNowPlayingClient); \ +TestFunction(MRMediaRemoteGetNowPlayingInfo); \ +TestFunction(MRMediaRemoteGetNowPlayingApplicationIsPlaying); \ +TestFunction(MRNowPlayingClientGetBundleIdentifier); \ +TestFunction(MRNowPlayingClientGetParentAppBundleIdentifier); \ +TestFunction(MRMediaRemoteSetElapsedTime); \ +TestFunction(MRMediaRemoteSendCommand); \ + +#endif /* TestFunctions_h */ diff --git a/Tests/TestMethods.h b/Tests/TestMethods.h new file mode 100644 index 0000000..7ee6dd6 --- /dev/null +++ b/Tests/TestMethods.h @@ -0,0 +1,7 @@ +#ifndef TestMethods_h +#define TestMethods_h + +#define TestMethods \ + + +#endif /* TestMethods_h */ diff --git a/Tests/TestSelectors.h b/Tests/TestSelectors.h new file mode 100644 index 0000000..139b96a --- /dev/null +++ b/Tests/TestSelectors.h @@ -0,0 +1,25 @@ +#ifndef TestSelectors_h +#define TestSelectors_h + +BOOL Identifier(classRespondsToSelector)(Class classInstance, NSString *selector) { + return [classInstance respondsToSelector:NSSelectorFromString(selector)]; +} + +#define ClassRespondsToSelector(CLASS, SELECTOR) Identifier(classRespondsToSelector)(GetClass(CLASS), @#SELECTOR) + +#define TestClassSelector(CLASS, SELECTOR) XCTAssertTrue(ClassRespondsToSelector(CLASS, SELECTOR)) + +BOOL Identifier(instanceRespondsToSelector)(Class classInstance, NSString *selector) { + return [((NSObject *)[classInstance new]) respondsToSelector:NSSelectorFromString(selector)]; +} + +#define InstanceRespondsToSelector(CLASS, SELECTOR) Identifier(instanceRespondsToSelector)(GetClass(CLASS), @#SELECTOR) + +#define TestInstanceSelector(CLASS, SELECTOR) XCTAssertTrue(InstanceRespondsToSelector(CLASS, SELECTOR)) + +#define TestSelectors \ +TestInstanceSelector(_MRNowPlayingClientProtobuf, hash); \ +TestInstanceSelector(_MRNowPlayingClientProtobuf, hash); \ + + +#endif /* TestSelectors_h */ diff --git a/Tests/Unlinked/Tests.m b/Tests/Unlinked/Tests.m new file mode 100644 index 0000000..4ff0db8 --- /dev/null +++ b/Tests/Unlinked/Tests.m @@ -0,0 +1,37 @@ +#import "../Common.h" + +@implementation Identifier(Tests) + +- (void)setUp { + SetUp +} + +- (void)tearDown { + TearDown +} + +- (void)testClasses { + TestClasses +} + +- (void)testSelectors { + TestSelectors +} + +- (void)testConforming { + TestConforming +} + +- (void)testMethods { + TestMethods +} + +- (void)testConstants { + TestConstants +} + +- (void)testFunctions { + TestFunctions +} + +@end