diff --git a/IOSDeviceLib/CommonFunctions.h b/IOSDeviceLib/CommonFunctions.h index 5d2ac40..1c94393 100644 --- a/IOSDeviceLib/CommonFunctions.h +++ b/IOSDeviceLib/CommonFunctions.h @@ -7,7 +7,7 @@ #include "Declarations.h" inline bool has_complete_status(std::map& dict); -HANDLE start_service(std::string device_identifier, const char* service_name, std::string method_id, bool should_log_error = true); +HANDLE start_service(std::string device_identifier, const char* service_name, std::string method_id, bool should_log_error = true, bool skip_cache = false); bool mount_image(std::string& device_identifier, std::string& image_path, std::string& method_id); std::string get_device_property_value(std::string& device_identifier, const char* property_name); int start_session(std::string& device_identifier); diff --git a/IOSDeviceLib/IOSDeviceLib.cpp b/IOSDeviceLib/IOSDeviceLib.cpp index 9dd0ae0..ad71460 100644 --- a/IOSDeviceLib/IOSDeviceLib.cpp +++ b/IOSDeviceLib/IOSDeviceLib.cpp @@ -350,7 +350,7 @@ void start_run_loop() } std::mutex start_service_mutex; -HANDLE start_service(std::string device_identifier, const char* service_name, std::string method_id, bool should_log_error) +HANDLE start_service(std::string device_identifier, const char* service_name, std::string method_id, bool should_log_error, bool skip_cache) { start_service_mutex.lock(); if (!devices.count(device_identifier)) @@ -385,7 +385,9 @@ HANDLE start_service(std::string device_identifier, const char* service_name, st return NULL; } - devices[device_identifier].services[service_name] = socket; + if (!skip_cache) { + devices[device_identifier].services[service_name] = socket; + } start_service_mutex.unlock(); return socket; @@ -1058,7 +1060,7 @@ void device_log(std::string device_identifier, std::string method_id) void post_notification(std::string device_identifier, PostNotificationInfo post_notification_info, std::string method_id) { - HANDLE handle = start_service(device_identifier, kNotificationProxy, method_id); + HANDLE handle = start_service(device_identifier, kNotificationProxy, method_id, true, true); if (!handle) { return; diff --git a/package.json b/package.json index e75e7d0..ad28152 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ios-device-lib", - "version": "0.4.9", + "version": "0.4.10", "description": "", "types": "./typings/ios-device-lib.d.ts", "main": "index.js",