红色的方法我也不太清楚哈哈,欢迎交流完善。
am_device_notification_callback
定义:
typedef void(*am_device_notification_callback)(struct am_device_notification_callback_info *);
描述:
回调函数,当设备状态改变时由iTunesMobileDevice.dll回调
参数:
am_device_notification_callback_info 返回设备信息
am_restore_device_notification_callback
定义:
typedef void (*am_restore_device_notification_callback)(struct am_recovery_device *);
描述:
回调函数,当检测到restore模式设备时由iTunesMobileDevice.dll回调
参数:
am_recovery_device返回设备信息
AMDeviceNotificationSubscribe
定义:
typedef mach_error_t (*AMDeviceNotificationSubscribe)(am_device_notification_callback callback, unsigned int unused0, unsigned int unused1, unsigned int dn_unknown3, struct am_device_notification *notification);
描述:
订阅设备状态改变回调绑定函数
参数:
am_device_notification_callback callback指向回调函数指针
unsigned int unused0 未知 itunes调用时设为0
unsigned int unused1未知 itunes调用时设为0
unsigned int dn_unknown3未知
am_device_notification *notification 设备信息结构
返回值:
* MDERR_OK if successful ------0
* MDERR_SYSCALL if CFRunLoopAddSource() failed
* MDERR_OUT_OF_MEMORY if we ran out of memory
AMDeviceConnect
定义:
typedef mach_error_t (*AMDeviceConnect)(struct am_device *device);
描述:
连接设备
参数:
am_device *device回调函数返回的设备信息
返回值:
* MDERR_OK if successfully connected
* MDERR_SYSCALL if setsockopt() failed
* MDERR_QUERY_FAILED if the daemon query failed
* MDERR_INVALID_ARGUMENT if USBMuxConnectByPort returned 0xffffffff
AMDeviceIsPaired
定义:
typedef int (*AMDeviceIsPaired)(struct am_device *device);
描述:
检测路径是否存在,初始化阶段路径是"/"
参数:
am_device *device回调函数返回的设备信息
返回值:
* 0 if the path did not exist
* 1 if it did
AMDeviceValidatePairing
定义:
typedef mach_error_t (*AMDeviceValidatePairing)(struct am_device *device);
描述:
Itunes在测试(AMDeviceIsPaired)完后立即调用这个函数,建立配对文件并设置到lockdown的连接
参数:
am_device *device回调函数返回的设备信息
返回值:
* MDERR_OK if successful
* MDERR_INVALID_ARGUMENT if the supplied device is null
* MDERR_DICT_NOT_LOADED if the load_dict() call failed
AMDeviceStartSession
定义:
typedef mach_error_t (*AMDeviceStartSession)(struct am_device *device);
描述:
创建lockdown session,如果创建成功适当的调整设备结构。Itunes在AMDeviceValidatePairing后立即调用此函数
参数:
am_device *device回调函数返回的设备信息
返回值:
* MDERR_OK if successful
* MDERR_INVALID_ARGUMENT if the Lockdown conn has not been established
* MDERR_DICT_NOT_LOADED if the load_dict() call failed
AMDeviceStartService
定义:
typedef mach_error_t (*AMDeviceStartService)(struct am_device *device, void*
service_name, afc_connection **handle, unsigned int *unknown);
描述:
启动服务并返回指向这个服务的句柄,使用返回的句柄可以进行后续的各种操作。在使用服务之前你应该关闭session断开连接(并不是这样的),itunes调用此函数在调用完AMDeviceStartSession函数之后。
参数:
am_device *device回调函数返回的设备信息
void* service_name 要启动的服务名称,注意MAC OS CFString格式
afc_connection **handle 返回连接结构
unsigned int *unknown 未知 itunes设为0
返回值:
* MDERR_OK if successful
* MDERR_SYSCALL if the setsockopt() call failed
* MDERR_INVALID_ARGUMENT if the Lockdown conn has not been established
AMDeviceStopSession
定义:
typedef mach_error_t (*AMDeviceStopSession)(struct am_device *device);
描述:
关闭 session,在访问服务之前需要关闭session(好像不用)。
参数:
am_device *device回调函数返回的设备信息
返回值:
* MDERR_OK if successful
* MDERR_INVALID_ARGUMENT if the Lockdown conn has not been established
AFCConnectionOpen
定义:
typedef afc_error_t (*AFCConnectionOpen)(afc_connection *handle, unsigned int io_timeout,struct afc_connection **conn);
描述:
打开apple文件系统的连接,在这之前你必须通过AMDeviceStartService打开了适当的服务。
参数:
afc_connection *handle AMDeviceStartService函数返回的连接信息
unsigned int io_timeout 超时设置为0
afc_connection **conn 返回的连接信息,可以和afc_connection *handle使用相同的对象
返回值:
* MDERR_OK if successful
* MDERR_AFC_OUT_OF_MEMORY if malloc() failed
AFCDeviceInfoOpen
定义:
typedef afc_error_t (*AFCDeviceInfoOpen)(struct afc_connection *conn, struct afc_dictionary **info);
描述:
获得设备的信息。
参数:
afc_connection *handle AMDeviceStartService函数返回的连接信息
afc_dictionary **info 返回的设备信息
返回值:
* MDERR_OK if successful
* MDERR_AFC_OUT_OF_MEMORY if malloc() failed
返回实例:
Model iPhone1,2
FSTotalBytes 524288000
FSFreeBytes 55099392
FSBlockSize 4096
AFCDirectoryOpen
定义:
typedef afc_error_t (*AFCDirectoryOpen)(afc_connection *conn, char *path, /*afc_directory*/afc_directory **dir);
描述:
打开一个目录。注,没有越狱的系统默认的"/"目录是"/var/root/Media"这是itunes的sandbox行为。
参数:
afc_connection * conn AMDeviceStartService函数返回的连接信息
char *path 路径信息
afc_directory **dir 返回的路径句柄
返回值:
* MDERR_OK if successful
AFCDirectoryRead
定义:
typedef afc_error_t (*AFCDirectoryRead)(afc_connection *conn,afc_directory *dir,char **dirent);
描述:
读取路径下的下一个节点,当到达最后一个节点后将返回NULL。返回的前两个节点将是"."和".."。
参数:
afc_connection * conn AMDeviceStartService函数返回的连接信息
afc_directory *dir AFCDirectoryOpen返回的目录句柄
char **dirent 返回的节点名字
返回值:
* MDERR_OK if successful
AFCDirectoryClose
定义:
typedef afc_error_t (*AFCDirectoryClose)(afc_connection *conn, struct afc_directory *dir);
描述:
关闭路径。
参数:
afc_connection * conn AMDeviceStartService函数返回的连接信息
afc_directory *dir AFCDirectoryOpen返回的目录句柄
返回值:
* MDERR_OK if successful
AFCDirectoryCreate
定义:
typedef afc_error_t (*AFCDirectoryCreate)(afc_connection *conn, char *dirname);
描述:
创建路径。注,创建的目录父路径必须存在。
参数:
afc_connection * conn AMDeviceStartService函数返回的连接信息
char *dirname 完整的目录名字包括path
返回值:
* MDERR_OK if successful
AFCRemovePath
定义:
typedef afc_error_t (*AFCRemovePath)(afc_connection *conn, char *dirname);
描述:
删除路径。注,路径为空。
参数:
afc_connection * conn AMDeviceStartService函数返回的连接信息
char *dirname 完整的目录名字包括path
返回值:
* MDERR_OK if successful
AFCRenamePath
定义:
typedef afc_error_t (*AFCRenamePath)(afc_connection *conn, char *oldpath, char *newpath);
描述:
路径改名。
参数:
afc_connection * conn AMDeviceStartService函数返回的连接信息
char * oldpath 老得目录名
char *newpath 新的目录名
返回值:
* MDERR_OK if successful
AFCConnectionGetContext
定义:
typedef unsigned int (*AFCConnectionGetContext)(struct afc_connection *conn);
描述:
返回连接上下文。
参数:
afc_connection * conn AMDeviceStartService函数返回的连接信息
返回值:
上下文编号
AFCConnectionGetFSBlockSize
定义:
typedef unsigned int (*AFCConnectionGetFSBlockSize)(struct afc_connection *conn);
描述:
返回文件系统blocks大小。
参数:
afc_connection * conn AMDeviceStartService函数返回的连接信息
返回值:
blocks大小
AFCConnectionGetIOTimeout
定义:
typedef unsigned int (*AFCConnectionGetIOTimeout)(struct afc_connection *conn);
描述:
返回IO超时时间。Itunes里这里返回0
参数:
afc_connection * conn AMDeviceStartService函数返回的连接信息
返回值:
超时时间
AFCConnectionGetSocketBlockSize
定义:
typedef unsigned int (*AFCConnectionGetSocketBlockSize)(struct afc_connection *conn);
描述:
返回Socket块大小。
参数:
afc_connection * conn AMDeviceStartService函数返回的连接信息
返回值:
Socket块大小
AFCConnectionClose
定义:
typedef afc_error_t (*AFCConnectionClose)(struct afc_connection *conn);
描述:
关闭连接。
参数:
afc_connection * conn AMDeviceStartService函数返回的连接信息
返回值:
* MDERR_OK if successful
AMRestoreRegisterForDeviceNotifications
定义:
typedef unsigned int (*AMRestoreRegisterForDeviceNotifications)(am_restore_device_notification_callback dfu_connect_callback,am_restore_device_notification_callback recovery_connect_callback,am_restore_device_notification_callback dfu_disconnect_callback,am_restore_device_notification_callback recovery_disconnect_callback,unsigned int unknown0,void *user_info);
描述:
设置restore、recovery和dfu模式的回调函数。
参数:
am_restore_device_notification_callback dfu_connect_callback :dfu连接回调
am_restore_device_notification_callback recovery_connect_callback:recovery连接回调
am_restore_device_notification_callback dfu_disconnect_callback:dfu断开回调
am_restore_device_notification_callback recovery_disconnect_callback:recovery断开回调
unsigned int unknown0 未知 itunes设置为0
void *user_info 未知
返回值:
估计0是成功
AMRestoreEnableFileLogging
定义:
typedef unsigned int (*AMRestoreEnableFileLogging)(char *path);
描述:
设置restore时log。
参数:
char *path 全目录名称
返回值:
估计0是成功
AMRestoreCreateDefaultOptions
定义:
typedef void* (*AMRestoreCreateDefaultOptions)(void* allocator);
描述:
初始化设置字典到默认值。如下:
* NORImageType => 'production',
* AutoBootDelay => 0,
* KernelCacheType => 'Release',
* UpdateBaseband => true,
* DFUFileType => 'RELEASE',
* SystemImageType => 'User',
* CreateFilesystemPartitions => true,
* FlashNOR => true,
* RestoreBootArgs => 'rd=md0 nand-enable-reformat=1 -progress'
* BootImageType => 'User'
参数:
void* allocator:固定的kCFAllocatorDefault
返回值:
* the option dictionary if successful
* NULL if out of memory
AFCGetFileInfo
AFCFileInfoOpen
定义:
typedef afc_error_t (*AFCGetFileInfo)(struct afc_connection *conn,char *path, char **buffer, int *length);
typedef afc_error_t (*AFCFileInfoOpen)(struct afc_connection *conn, char *path, struct afc_dictionary **info);
描述:
获得文件信息
st_ifmt S_IFDIR/S_IFLNK/ S_IFREG/S_IFCHR/...
st_size 文件大小
st_block 文件实际所占用的磁盘大小 *block size
参数:
afc_connection * conn AMDeviceStartService函数返回的连接信息
char *path :目录名称
AFCGetFileInfo和AFCFileInfoOpen应为等价,afc_dictionary就是有这两部分组成
char **buffer:指向的缓冲区指针的指针
int *length:返回的缓冲区大小
返回值:
0成功
AFCFileRefOpen
定义:
typedef afc_error_t (*AFCFileRefOpen)(struct afc_connection *conn, char *path, unsigned long long int mode, afc_file_ref *ref);
描述:
打开文件
参数:
afc_connection * conn AMDeviceStartService函数返回的连接信息
char *path :目录名称
unsigned long long int mode 打开方式
/* mode 2 = read, mode 3 = write; unknown = 0 */
afc_file_ref *ref 文件句柄
返回值:
0成功
AFCFileRefRead
定义:
typedef afc_error_t (*AFCFileRefRead)(struct afc_connection *conn, afc_file_ref ref,
void *buf, unsigned int *len);
描述:
读文件
参数:
afc_connection * conn AMDeviceStartService函数返回的连接信息
afc_file_ref *ref 文件句柄
void *buf 读取文件缓冲区
unsigned int *len 缓冲区大小
返回值:
0成功
AFCFileRefWrite
定义:
typedef afc_error_t (*AFCFileRefWrite)(struct afc_connection *conn, afc_file_ref ref,
void *buf, unsigned int len);
描述:
写文件
参数:
afc_connection * conn AMDeviceStartService函数返回的连接信息
afc_file_ref *ref 文件句柄
void *buf待写入缓冲区
unsigned int len 写入大小
返回值:
0成功
AFCFileRefClose
定义:
typedef afc_error_t (*AFCFileRefClose)(struct afc_connection *conn, afc_file_ref ref);
描述:
关闭文件
参数:
afc_connection * conn AMDeviceStartService函数返回的连接信息
afc_file_ref *ref 文件句柄
返回值:
0成功
AFCKeyValueRead
定义:
typedef afc_error_t (*AFCKeyValueRead)(struct afc_dictionary *dict, char *key, char **val);
描述:
读取dictionary值
参数:
afc_dictionary *dict dictionary结构指针
char *key: 读取的Key值
char **val: 返回的数据
返回值:
0成功
AFCKeyValueClose
定义:
typedef afc_error_t (*AFCKeyValueClose)(struct afc_dictionary *dict);
描述:
释放dictionary
参数:
afc_dictionary *dict dictionary结构指针
返回值:
0成功
AMRestorePerformRecoveryModeRestore
定义:
typedef unsigned int (*AMRestorePerformRecoveryModeRestore)(struct am_recovery_device *
rdev, void* opts, void *callback, void *user_info);
AMRestorePerformRestoreModeRestore
定义:
typedef unsigned int (*AMRestorePerformRestoreModeRestore)(struct am_restore_device *
rdev, void* opts, void *callback, void *user_info);
AMRestoreModeDeviceCreate
定义:
typedef struct am_restore_device * (*AMRestoreModeDeviceCreate)(unsigned int unknown0,
unsigned int connection_id, unsigned int unknown1);
AMRestoreCreatePathsForBundle
定义:
typedef unsigned int (*AMRestoreCreatePathsForBundle)(void* restore_bundle_path,
void* kernel_cache_type, void* boot_image_type, unsigned int
unknown0, void* *firmware_dir_path, void* *
kernelcache_restore_path, unsigned int unknown1, void* *
ramdisk_path);
AMDeviceGetConnectionID
定义:
typedef unsigned int (*AMDeviceGetConnectionID)(struct am_device *device);
描述:
获得设备连接ID
参数:
struct am_device *device: 回调函数返回的设备信息
返回值:
设备连接ID
AMDeviceEnterRecovery
定义:
typedef mach_error_t (*AMDeviceEnterRecovery)(struct am_device *device);
描述:
设备进入recovery模式
参数:
struct am_device *device: 回调函数返回的设备信息
返回值:
0 成功
AMDeviceDisconnect
定义:
typedef mach_error_t (*AMDeviceDisconnect)(struct am_device *device);
描述:
设备进入recovery模式
参数:
struct am_device *device: 回调函数返回的设备信息
返回值:
0 成功
AMDeviceRetain
定义:
typedef mach_error_t (*AMDeviceRetain)(struct am_device *device);
描述:
设备引用保持
参数:
struct am_device *device: 回调函数返回的设备信息
返回值:
0 成功
AMDeviceRelease
定义:
typedef mach_error_t (*AMDeviceRelease)(struct am_device *device);
描述:
设备释放,引用计数达到0释放
参数:
struct am_device *device: 回调函数返回的设备信息
返回值:
0 成功
AMDeviceCopyValue
定义:
typedef void* (*AMDeviceCopyValue)(struct am_device *device, unsigned int, const void* *cfstring);
AMDeviceCopyDeviceIdentifier
定义:
typedef mach_error_t (*AMDeviceCopyDeviceIdentifier)(struct am_device *device);
描述:
复制设备唯一标识
参数:
struct am_device *device: 回调函数返回的设备信息
返回值:
0 成功
AMDShutdownNotificationProxy
定义:
typedef mach_error_t (*AMDShutdownNotificationProxy)(void *);
AMDeviceDeactivate
定义:
/*edits by geohot*/
typedef mach_error_t (*AMDeviceDeactivate)(struct am_device *device);
描述:
取消激活?
参数:
struct am_device *device: 回调函数返回的设备信息
返回值:
0 成功
AMDeviceActivate
定义:
typedef mach_error_t (*AMDeviceActivate)(struct am_device *device, void*);
描述:
激活?
参数:
struct am_device *device: 回调函数返回的设备信息
返回值:
0 成功
AMDeviceRemoveValue
定义:
typedef mach_error_t (*AMDeviceRemoveValue)(struct am_device *device, unsigned int, const void* *cfstring);
USBMuxListenerCreate
定义:
usbmux_error_t (*USBMuxListenerCreate)(struct usbmux_listener_1 *esi_fp8, struct
usbmux_listener_2 **eax_fp12);
USBMuxListenerHandleData
定义:
usbmux_error_t (*USBMuxListenerHandleData)(void *);
AMRUSBInterfaceReadPipe
定义:
typedef unsigned int (*t_AMRUSBInterfaceReadPipe)(unsigned int readwrite_pipe, unsigned int read_pipe, unsigned char *data, unsigned int *len);