function isVersionAppSignedForUdid($udid, $version)
{
    $plistValue = __DIR__ . '/' . UPLOAD_PATH . $version->getToken() . '/app_bundle/Payload/' . $version->getApplication()->getBundleName() . '.app/embedded.mobileprovision';
    $plistValue = retreivePlistFromAsn($plistValue);
    if (empty($plistValue)) {
        die("unable to read plist from configuration profile challenge.");
    }
    $plist = new CFPropertyList();
    $plist->parse($plistValue, CFPropertyList::FORMAT_AUTO);
    $plistData = $plist->toArray();
    $provisionedDevices = $plistData['ProvisionedDevices'];
    $found = false;
    foreach ($provisionedDevices as $device) {
        if (strtoupper($device) == strtoupper($udid)) {
            return true;
        }
    }
    return false;
}
Пример #2
0
		$ciphertext_file,
		PKCS7_BINARY | PKCS7_TEXT | PKCS7_NOVERIFY | PKCS7_NOCHAIN,
		$certificates_file,
		array(),
		null,
		$deciphertext_file
);
unlink($ciphertext_file);
unlink($certificates_file);
$plist = file_get_contents($deciphertext_file);
unlink($deciphertext_file);
while (($e = openssl_error_string()) !== false) {
	$lf->write('openssl error='.$e.PHP_EOL);
}
*/
$plistValue = retreivePlistFromAsn($ciphertext_file);
/*
 * TEST: $plistValue = '<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>CHALLENGE</key><string>signed-auth-token</string><key>IMEI</key><string>00 000000 000000 0</string><key>PRODUCT</key><string>iPhone3,1</string><key>UDID</key><string>d2f22d586c333041d191c81e5bb80948732d6a68</string><key>VERSION</key><string>9A5248d</string></dict></plist>';
 */
if (empty($plistValue)) {
    error_log('RTA::Unable to read plist from configuration profile challenge', 0);
    die;
}
$plist = new CFPropertyList();
$plist->parse($plistValue, CFPropertyList::FORMAT_AUTO);
$plistData = $plist->toArray();
$entityManager = initDoctrine();
date_default_timezone_set('Europe/Paris');
$invitation = $entityManager->getRepository('Entities\\Invitation')->findOneBy(array('token' => $_GET['key']));
if ($invitation == NULL) {
    error_log('RTA::This invitation is not valid!', 0);