From 34fc459cda2c8212ceed2bdc23e0fb51831486f5 Mon Sep 17 00:00:00 2001
From: "Jay Freeman (saurik)" <saurik@saurik.com>
Date: Sun, 8 Nov 2009 10:29:35 +0000
Subject: [PATCH] Fixed control generation, Cycript.all namespace, and
 MobileSubstrate version dependency.

---
 Bridge.def    | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++
 Console.cpp   |  2 +-
 Darwin-arm.mk |  1 +
 makefile      |  4 ++--
 4 files changed, 69 insertions(+), 3 deletions(-)

diff --git a/Bridge.def b/Bridge.def
index 8030f8f..6f7ff49 100644
--- a/Bridge.def
+++ b/Bridge.def
@@ -1396,6 +1396,71 @@ C MKPinAnnotationColorPurple 2
 F MKCoordinateRegionMakeWithDistance {MKCoordinateRegion}{CLLocationCoordinate2D}{CLLocationDistance}{CLLocationDistance}
 # MKCoordinateSpanMake
 
+f MobileWiFi
+
+#F WiFiManagerClientAddNetwork
+#F WiFiManagerClientCopyDevices
+#F WiFiManagerClientCopyNetworks
+#F WiFiManagerClientCopyProperty
+#F WiFiManagerClientCreate
+#F WiFiManagerClientDisable
+#F WiFiManagerClientDisableNetwork
+#F WiFiManagerClientDispatchNotificationResponse
+#F WiFiManagerClientEnable
+#F WiFiManagerClientEnableNetwork
+#F WiFiManagerClientGetAssociationMode
+#F WiFiManagerClientGetDevice
+#F WiFiManagerClientGetType
+#F WiFiManagerClientGetTypeID
+#F WiFiManagerClientIsNetworkEnabled
+#F WiFiManagerClientRegisterNotificationCallback
+#F WiFiManagerClientRemoveNetwork
+#F WiFiManagerClientScheduleWithRunLoop
+#F WiFiManagerClientSetAssociationMode
+#F WiFiManagerClientSetPower
+#F WiFiManagerClientSetProperty
+#F WiFiManagerClientSetType
+#F WiFiManagerClientUnscheduleFromRunLoop
+#F WiFiManagerClientUpdateNetwork
+
+F WiFiNetworkComparePriority B@@
+#F WiFiNetworkCopyFilteredRecord
+F WiFiNetworkCopyPassword @@
+#F WiFiNetworkCopyPreparedEAPProfile
+#F WiFiNetworkCopyRecord
+#F WiFiNetworkCreate
+#F WiFiNetworkCreateCopy
+F WiFiNetworkGetAssociationDate @@
+#F WiFiNetworkGetAuthFlags
+#F WiFiNetworkGetDirectedState
+#F WiFiNetworkGetFloatProperty
+#F WiFiNetworkGetIntProperty
+#F WiFiNetworkGetProperty
+#F WiFiNetworkGetRateBounds
+F WiFiNetworkGetSSID @@
+F WiFiNetworkGetSSIDData @@
+F WiFiNetworkGetTypeID {CFTypeID}
+F WiFiNetworkIsEAP B@
+F WiFiNetworkIsEnabled B@
+F WiFiNetworkIsHidden B@
+F WiFiNetworkIsHiddenSSID B@
+F WiFiNetworkIsWEP B@
+F WiFiNetworkIsWPA B@
+#F WiFiNetworkMerge
+#F WiFiNetworkMergeForAssociation
+#F WiFiNetworkMergeProperties
+F WiFiNetworkRemovePassword v@
+F WiFiNetworkRequiresIdentity B@
+F WiFiNetworkRequiresOneTimePassword B@
+F WiFiNetworkRequiresPassword B@
+F WiFiNetworkRequiresUsername B@
+F WiFiNetworkSetAssociationDate v@@
+#F WiFiNetworkSetDirectedState
+#F WiFiNetworkSetFloatProperty
+#F WiFiNetworkSetIntProperty
+F WiFiNetworkSetPassword v@@
+#F WiFiNetworkSetProperty
+
 C RTLD_LAZY 0x1
 C RTLD_NOW 0x2
 C RTLD_LOCAL 0x4
diff --git a/Console.cpp b/Console.cpp
index 1ba72ea..fad7dda 100644
--- a/Console.cpp
+++ b/Console.cpp
@@ -601,7 +601,7 @@ int Main(int argc, char const * const argv[], char const * const envp[]) {
             if (client != -1) {
                 std::string code(start, end-start);
                 code = "with(Cycript.all){" + code + "}";
-                Run(client, start, end - start, stdout);
+                Run(client, code, stdout);
             } else {
                 std::ostringstream str;
                 CYOutput out(str);
diff --git a/Darwin-arm.mk b/Darwin-arm.mk
index bf62c96..b02b244 100644
--- a/Darwin-arm.mk
+++ b/Darwin-arm.mk
@@ -19,5 +19,6 @@ cyrver: Server.o
 	$(ldid) $@
 
 extra:
+	sed -i -e '/^Depends: / s/\<mobilesubstrate\>/mobilesubstrate (>= 0.9.3072)/g' package/DEBIAN/control
 	#mkdir -p package/System/Library/LaunchDaemons
 	#cp -pR com.saurik.Cyrver.plist package/System/Library/LaunchDaemons
diff --git a/makefile b/makefile
index 4240e51..486c448 100644
--- a/makefile
+++ b/makefile
@@ -104,7 +104,7 @@ libcycript.db: Bridge.def
 	    grep '^[CFV]' Bridge.def | sed -e 's/^C/0/;s/^F/1/;s/^V/2/' | sed -e 's/"/\\"/g;s/^\([^ ]*\) \([^ ]*\) \(.*\)$$/insert into "bridge" ("mode", "name", "value") values (\1, '"'"'\2'"'"', '"'"'\3'"'"');/'; \
 	    grep '^:' Bridge.def | sed -e 's/^: \([^ ]*\) \(.*\)/insert into "bridge" ("mode", "name", "value") values (-1, '"'"'\1'"'"', '"'"'\2'"'"');/'; \
 	    grep '^[EST]' Bridge.def | sed -e 's/^S/3/;s/^T/4/;s/^E/5/' | sed -e 's/^5\(.*\)$$/4\1 i/' | sed -e 's/^\([^ ]*\) \([^ ]*\) \(.*\)$$/insert into "bridge" ("mode", "name", "value") values (\1, '"'"'\2'"'"', '"'"'\3'"'"');/'; \
-	} | sqlite3 libcycript.db
+	} | tee libcycript.sql | sqlite3 libcycript.db
 
 %.y: %.y.in
 	./Filter.sh <$< >$@ $(filters)
@@ -148,4 +148,4 @@ test: $(deb)
 	dpkg -i $(deb)
 	cycript test.cy
 
-.PHONY: all clean extra package
+.PHONY: all clean extra package control
-- 
2.50.0

