Skip to content

Commit

Permalink
lockdown: Add more error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
nikias committed Jul 10, 2015
1 parent 65def89 commit e1cac25
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
8 changes: 8 additions & 0 deletions cython/lockdown.pxi
Expand Up @@ -38,6 +38,10 @@ cdef extern from "libimobiledevice/lockdown.h":
LOCKDOWN_E_MISSING_ACTIVATION_RECORD
LOCKDOWN_E_SERVICE_PROHIBITED
LOCKDOWN_E_ESCROW_LOCKED
LOCKDOWN_E_PAIRING_PROHIBITED_OVER_THIS_CONNECTION
LOCKDOWN_E_FMIP_PROTECTED
LOCKDOWN_E_MC_PROTECTED
LOCKDOWN_E_MC_CHALLENGE_REQUIRED
LOCKDOWN_E_UNKNOWN_ERROR

lockdownd_error_t lockdownd_client_new(idevice_t device, lockdownd_client_t *client, char *label)
Expand Down Expand Up @@ -103,6 +107,10 @@ cdef class LockdownError(BaseError):
LOCKDOWN_E_MISSING_ACTIVATION_RECORD: "Missing activation record",
LOCKDOWN_E_SERVICE_PROHIBITED: "Service prohibited",
LOCKDOWN_E_ESCROW_LOCKED: "Escrow locked",
LOCKDOWN_E_PAIRING_PROHIBITED_OVER_THIS_CONNECTION: "Pairing prohibited over this connection",
LOCKDOWN_E_FMIP_PROTECTED: "Find My iPhone/iPod/iPad protected",
LOCKDOWN_E_MC_PROTECTED: "MC protected",
LOCKDOWN_E_MC_CHALLENGE_REQUIRED: "MC challenge required",
LOCKDOWN_E_UNKNOWN_ERROR: "Unknown error"
}
BaseError.__init__(self, *args, **kwargs)
Expand Down
4 changes: 4 additions & 0 deletions include/libimobiledevice/lockdown.h
Expand Up @@ -73,6 +73,10 @@ typedef enum {
LOCKDOWN_E_MISSING_ACTIVATION_RECORD = -33,
LOCKDOWN_E_SERVICE_PROHIBITED = -34,
LOCKDOWN_E_ESCROW_LOCKED = -35,
LOCKDOWN_E_PAIRING_PROHIBITED_OVER_THIS_CONNECTION = -36,
LOCKDOWN_E_FMIP_PROTECTED = -37,
LOCKDOWN_E_MC_PROTECTED = -38,
LOCKDOWN_E_MC_CHALLENGE_REQUIRED = -39,
LOCKDOWN_E_UNKNOWN_ERROR = -256
} lockdownd_error_t;

Expand Down
10 changes: 9 additions & 1 deletion src/lockdown.c
Expand Up @@ -3,7 +3,7 @@
* com.apple.mobile.lockdownd service implementation.
*
* Copyright (c) 2009-2015 Martin Szulecki All Rights Reserved.
* Copyright (c) 2014 Nikias Bassen. All Rights Reserved.
* Copyright (c) 2014-2015 Nikias Bassen All Rights Reserved.
* Copyright (c) 2010 Bryan Forbes All Rights Reserved.
* Copyright (c) 2008 Zach C. All Rights Reserved.
*
Expand Down Expand Up @@ -122,6 +122,14 @@ static lockdownd_error_t lockdownd_strtoerr(const char* name)
err = LOCKDOWN_E_SERVICE_PROHIBITED;
} else if (strcmp(name, "EscrowLocked") == 0) {
err = LOCKDOWN_E_ESCROW_LOCKED;
} else if (strcmp(name, "PairingProhibitedOverThisConnection") == 0) {
err = LOCKDOWN_E_PAIRING_PROHIBITED_OVER_THIS_CONNECTION;
} else if (strcmp(name, "FMiPProtected") == 0) {
err = LOCKDOWN_E_FMIP_PROTECTED;
} else if (strcmp(name, "MCProtected") == 0) {
err = LOCKDOWN_E_MC_PROTECTED;
} else if (strcmp(name, "MCChallengeRequired") == 0) {
err = LOCKDOWN_E_MC_CHALLENGE_REQUIRED;
}

return err;
Expand Down

0 comments on commit e1cac25

Please sign in to comment.