summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman <saurik@saurik.com>2014-06-10 09:20:15 +0000
committerJay Freeman <saurik@saurik.com>2014-06-10 09:20:15 +0000
commit8651ed6acdb2b0ecac65775d25ff781b8b984c85 (patch)
treec45e5a60c7476dbab37a35c414e2c390c52af3bf
parent1b3668c6fe387c51062e85ec020271d72db02e6b (diff)
Forgotten update to use MGCopyAnswer for X-Unique-ID.
git-svn-id: http://svn.telesphoreo.org/trunk@786 514c082c-b64e-11dc-b46d-3d985efe055d
-rw-r--r--data/_apt7/cfnetwork.diff11
1 files changed, 9 insertions, 2 deletions
diff --git a/data/_apt7/cfnetwork.diff b/data/_apt7/cfnetwork.diff
index 7fe04f454..1a9e10f8d 100644
--- a/data/_apt7/cfnetwork.diff
+++ b/data/_apt7/cfnetwork.diff
@@ -9,7 +9,7 @@ diff -ru apt-0.7.25.3/methods/http.cc apt-0.7.25.3+iPhone/methods/http.cc
#include <sys/stat.h>
#include <sys/time.h>
#include <utime.h>
-@@ -41,11 +42,18 @@
+@@ -41,11 +42,19 @@
#include <string.h>
#include <iostream>
#include <map>
@@ -21,6 +21,7 @@ diff -ru apt-0.7.25.3/methods/http.cc apt-0.7.25.3+iPhone/methods/http.cc
#include <netdb.h>
+#include <arpa/inet.h>
+
++#include <dlfcn.h>
+#include <lockdown.h>
+#include <CoreFoundation/CoreFoundation.h>
+#include <CoreServices/CoreServices.h>
@@ -645,7 +646,7 @@ diff -ru apt-0.7.25.3/methods/http.cc apt-0.7.25.3+iPhone/methods/http.cc
FailCounter = 0;
}
-@@ -1330,6 +1530,35 @@
+@@ -1330,6 +1530,41 @@
signal(SIGPIPE, SIG_IGN);
HttpMethod Mth;
@@ -673,6 +674,12 @@ diff -ru apt-0.7.25.3/methods/http.cc apt-0.7.25.3+iPhone/methods/http.cc
+ CFRelease(plist);
+ }
+
++ if (UniqueID_ == NULL)
++ if (void *libMobileGestalt = dlopen("/usr/lib/libMobileGestalt.dylib", RTLD_GLOBAL | RTLD_LAZY))
++ if (CFStringRef (*$MGCopyAnswer)(CFStringRef) = (CFStringRef (*)(CFStringRef)) dlsym(libMobileGestalt, "MGCopyAnswer"))
++ UniqueID_ = $MGCopyAnswer(CFSTR("UniqueDeviceID"));
++
++ if (UniqueID_ == NULL)
+ if (void *lockdown = lockdown_connect()) {
+ UniqueID_ = lockdown_copy_value(lockdown, NULL, kLockdownUniqueDeviceIDKey);
+ lockdown_disconnect(lockdown);