Skip to content

Commit 9fbf6eb

Browse files
gabebearshazron
authored andcommitted
fix: Always send unsigned error codes in JSON (ios-control#406)
The error code being sent for "Device Lock" here was getting sent as -402652958 rather than 3892314338. Currently check_error() casts the return to `unsigned int` so also casting the call for image-mounting were correctly sending the expected unsigned value in the JSON; this makes the JSON value for image-mounting issues come through as an unsigned int which can be compared to the hex values that are expected(e.g. 0xe80000e2 = 3892314338, not -402652958 ).
1 parent 7265dc6 commit 9fbf6eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ios-deploy/ios-deploy.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ void mount_developer_image(AMDeviceRef device) {
553553
CFDictionaryRef options = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
554554
CFRelease(sig_data);
555555

556-
int result = AMDeviceMountImage(device, image_path, options, &mount_callback, 0);
556+
unsigned int result = (unsigned int)AMDeviceMountImage(device, image_path, options, &mount_callback, 0);
557557
if (result == 0) {
558558
NSLogOut(@"[ 95%%] Developer disk image mounted successfully");
559559
} else if (result == 0xe8000076 /* already mounted */) {

0 commit comments

Comments
 (0)