From 05fa8d0a048cc92048a03eb06dd8883f9c76a632 Mon Sep 17 00:00:00 2001 From: Hao Zhou Date: Tue, 9 Dec 2014 11:35:04 +0800 Subject: cython: Add get_path_for_bundle_identifier() method to InstallationProxyClient --- cython/installation_proxy.pxi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/cython/installation_proxy.pxi b/cython/installation_proxy.pxi index ff541df..d2d9b38 100644 --- a/cython/installation_proxy.pxi +++ b/cython/installation_proxy.pxi @@ -15,6 +15,7 @@ cdef extern from "libimobiledevice/installation_proxy.h": instproxy_error_t instproxy_client_new(idevice_t device, lockdownd_service_descriptor_t descriptor, instproxy_client_t *client) instproxy_error_t instproxy_client_free(instproxy_client_t client) + instproxy_error_t instproxy_client_get_path_for_bundle_identifier(instproxy_client_t client, const char* bundle_id, char** path) instproxy_error_t instproxy_browse(instproxy_client_t client, plist.plist_t client_options, plist.plist_t *result) instproxy_error_t instproxy_install(instproxy_client_t client, char *pkg_path, plist.plist_t client_options, instproxy_status_cb_t status_cb, void *user_data) @@ -59,6 +60,24 @@ cdef class InstallationProxyClient(PropertyListService): err = instproxy_client_free(self._c_client) self.handle_error(err) + cpdef get_path_for_bundle_identifier(self, bytes bundle_id): + cdef: + char* c_bundle_id = bundle_id + char* c_path = NULL + bytes result + + try: + self.handle_error(instproxy_client_get_path_for_bundle_identifier(self._c_client, c_bundle_id, &c_path)) + if c_path != NULL: + result = c_path + return result + else: + return None + except BaseError, e: + raise + finally: + free(c_path) + cpdef plist.Node browse(self, object client_options): cdef: plist.Node options -- cgit v1.1-32-gdbae