Files changed (5)
+ * http://www.theiphonewiki.com/wiki/index.php?title=MobileDevice_Library#MobileDevice_Header_.28mobiledevice.h.29
+ * Unregisters notifications. Buggy (iTunes 8.2): if you subscribe, unsubscribe and subscribe again, arriving
+ notifications will contain cookie and subscription from 1st call to subscribe, not the 2nd one. iTunes
+/// Under the covers, it is implemented as a service called \p "com.apple.mobile.notification_proxy" which
+/// Under the covers, it is implemented as a service called \p "com.apple.springboardservices" which
+/// Under the covers, it is implemented as a service called \p "com.apple.mobile.installation_proxy" which
+/// Returns an array of all installed applications (see AMApplication) that match the input predicate.
+/// Return a dictionary (indexed by bundleid) of all installed applications (see AMApplication) matching the input type,
+/// Under the covers, it is implemented as a service called \p "com.apple.crashreportcopymobile" which
+/// Under the covers, it is implemented as a service called \p "com.apple.mobile.house_arrest" which
+/// AddAlbumArtistBlankColumn = "ALTER TABLE item ADD COLUMN album_artist_blank INTEGER NOT NULL DEFAULT 0;";
+/// AddAlbumArtistNameBlankColumn = "ALTER TABLE album_artist ADD COLUMN name_blank INTEGER NOT NULL DEFAULT 0;";
+/// AddAlbumArtistSectionOrderColumn = "ALTER TABLE item ADD COLUMN album_artist_section_order BLOB;";
+/// AddAlbumArtistSortNameSectionColumn = "ALTER TABLE album_artist ADD COLUMN sort_name_section INTEGER NOT NULL DEFAULT 0;";
+/// CreateItemArtistPidIndex = "CREATE INDEX IF NOT EXISTS item_idx_artist_pid ON item (artist_pid);";
+/// UpdateItemArtistNameBlankColumn = "UPDATE item_artist SET name_blank = 1 WHERE (name = '' OR name IS NULL);";
+/// UpdateItemInSongsCollectionBlankColumns = "UPDATE item SET title_blank = (title = '' OR title IS NULL), artist_blank = (artist = '' OR artist IS NULL), composer_blank = (composer = '' OR composer IS NULL), album_blank = (album = '' OR album IS NULL), album_artist_blank = (album_artist = '' OR album_artist IS NULL), in_songs_collection = ((media_kind&33) AND ((media_kind&2)=0 AND is_rental=0));";
+typedef void (*am_device_notification_callback)(struct am_device_notification_callback_info *,void* callback_data);
+mach_error_t AMDeviceLookupApplications(am_device device, CFStringRef apptype, CFDictionaryRef *result);
+mach_error_t AMDeviceStartService(am_device device,CFStringRef service_name,am_service *handle,uint32_t *unknown);
+afc_error_t AFCFileRefOpen(afc_connection conn, const char *path, uint64_t mode,afc_file_ref *ref);
+// Notification stuff - only call these on "com.apple.mobile.notification_proxy" (AMSVC_NOTIFICATION_PROXY)
+mach_error_t AMDPostNotification(am_service socket, CFStringRef notification, CFStringRef userinfo);
+First, we need AMDObserveNotification to subscribe notifications about “com.apple.itunes-client.syncCancelRequest”. Then we should start listening for notifications (second function) until we get “AMDNotificationFaceplant”.
+That’s it. When notification got, you should unlock and close lock file handle (don’t sure if you need to post “syncDidFinish” to proxy, seems it doesn’t matter) and terminate sync gracefully.
+P.S. The same notification is also got when you unplug your device, so you should always be ready for errors.
+ [self setLastError:[NSString stringWithFormat:@"Reply was truncated, expected %d more bytes",left]];
+// CFPropertyListRef reply = CFPropertyListCreateWithData(0,(CFDataRef)plistdata, kCFPropertyListImmutable, NULL, NULL);