Skip to content

Clean house arrest service when app is uninstalled #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions IOSDeviceLib/IOSDeviceLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,16 @@ void cleanup_file_resources(const std::string& device_identifier, const std::str
return;
}

afc_connection* afc_connection_to_close = nullptr;
if (devices[device_identifier].apps_cache[application_identifier].afc_connection)
{
afc_connection_to_close = devices[device_identifier].apps_cache[application_identifier].afc_connection;
afc_connection* afc_connection_to_close = devices[device_identifier].apps_cache[application_identifier].afc_connection;
AFCConnectionClose(afc_connection_to_close);
devices[device_identifier].apps_cache.erase(application_identifier);
}

if (afc_connection_to_close)
if (devices[device_identifier].services.count(kHouseArrest))
{
AFCConnectionClose(afc_connection_to_close);
devices[device_identifier].apps_cache.erase(application_identifier);
devices[device_identifier].services.erase(kHouseArrest);
}
}

Expand Down Expand Up @@ -355,7 +355,7 @@ HANDLE start_service(std::string device_identifier, const char* service_name, st
{
if (should_log_error)
print_error("Device not found", device_identifier, method_id, kAMDNotFoundError);

start_service_mutex.unlock();
return NULL;
}
Expand All @@ -378,7 +378,7 @@ HANDLE start_service(std::string device_identifier, const char* service_name, st
message += service_name;
if (should_log_error)
print_error(message.c_str(), device_identifier, method_id, result);

start_service_mutex.unlock();
return NULL;
}
Expand Down Expand Up @@ -1073,7 +1073,7 @@ void post_notification(std::string device_identifier, PostNotificationInfo post_
"<string></string>"
"</dict>"
"</plist>";

SOCKET socket = (SOCKET)handle;
send_message(xml_command.str().c_str(), socket);
print(json({ { kResponse, socket }, { kId, method_id }, { kDeviceId, device_identifier } }));
Expand Down Expand Up @@ -1263,7 +1263,7 @@ void connect_to_port(std::string device_identifier, int port, std::string method
sockaddr_in server_address = server_socket_data->server_address;
unsigned short port = ntohs(server_address.sin_port);
socklen_t address_length = sizeof(server_address);

// Return the host address and the port to the client.
print(json({ { kHost, kLocalhostAddress }, { kPort, port }, { kId, method_id }, { kDeviceId, device_identifier } }));

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ios-device-lib",
"version": "0.4.1",
"version": "0.4.2",
"description": "",
"types": "./typings/ios-device-lib.d.ts",
"main": "index.js",
Expand Down