]> git.cameronkatri.com Git - ldid.git/commitdiff
Add libplist (and libcnary) so to sign Info.plist.
authorJay Freeman (saurik) <saurik@saurik.com>
Fri, 21 Aug 2015 12:32:58 +0000 (05:32 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Fri, 21 Aug 2015 12:32:58 +0000 (05:32 -0700)
.gitignore
.gitmodules
deb.sh [new file with mode: 0755]
ios.sh
ldid.cpp
libplist [new submodule]
make.sh

index 4311c6952bcf5179a5001379a1ecf05dda08b405..faf313b01ad8f4ad9df5a7caafb73dd95d3e33e8 100644 (file)
@@ -1,6 +1,6 @@
+ios
+out
 ldid
-ldid.arm
-ldid.o
 ldid.deb
 debs
 _
index 691ae3a5cc1f3988ac06f161a9d5bd23ea0784f7..f360e2a658f79e6f23774fde13545b6a8b7aff22 100644 (file)
@@ -1,3 +1,6 @@
 [submodule "minimal"]
        path = minimal
        url = git://git.saurik.com/minimal.git
+[submodule "libplist"]
+       path = libplist
+       url = http://git.libimobiledevice.org/libplist.git
diff --git a/deb.sh b/deb.sh
new file mode 100755 (executable)
index 0000000..3fb31a5
--- /dev/null
+++ b/deb.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+rm -rf _
+mkdir -p _/usr/bin
+cp -a ios/ldid _/usr/bin/ldid
+mkdir -p _/DEBIAN
+./control.sh _ >_/DEBIAN/control
+mkdir -p debs
+ln -sf debs/ldid_$(./version.sh)_iphoneos-arm.deb ldid.deb
+dpkg-deb -b _ ldid.deb
+readlink ldid.deb
diff --git a/ios.sh b/ios.sh
index a9dae809e48d587abc5048e7959d36b973189672..f4c112c6ef3dd81d846c5f93dfe2bfe698f0f70b 100755 (executable)
--- a/ios.sh
+++ b/ios.sh
@@ -1,17 +1,2 @@
 #!/bin/bash
-
-set -e -x
-
-sudo xcode-select --switch /Applications/Xcode-4.6.3.app
-cycc -i2.0 -oldid.arm -- -c -std=c++11 ldid.cpp -I.
-cycc -i2.0 -oldid.arm -- ldid.arm -x c sha1.c lookup2.c -I .
-
-rm -rf _
-mkdir -p _/usr/bin
-cp -a ldid.arm _/usr/bin/ldid
-mkdir -p _/DEBIAN
-./control.sh _ >_/DEBIAN/control
-mkdir -p debs
-ln -sf debs/ldid_$(./version.sh)_iphoneos-arm.deb ldid.deb
-dpkg-deb -b _ ldid.deb
-readlink ldid.deb
+./make.sh true
index 7998edeb15f98e3c859e30f7226489cd64ac71ff..3b21b8a2df1eb475dd844a58a7df80fa3191703d 100644 (file)
--- a/ldid.cpp
+++ b/ldid.cpp
@@ -31,6 +31,8 @@ extern "C" {
 #include <string>
 #include <vector>
 
+#include <plist/plist.h>
+
 struct fat_header {
     uint32_t magic;
     uint32_t nfat_arch;
diff --git a/libplist b/libplist
new file mode 160000 (submodule)
index 0000000..9ca25d2
--- /dev/null
+++ b/libplist
@@ -0,0 +1 @@
+Subproject commit 9ca25d293fe7f8aca8d952fc7bb91464fe2d34ab
diff --git a/make.sh b/make.sh
index 4ab6acffe3bd5c29e54ee956148fbdbf767386b3..da019ac9b3c53615408423c17974bc25913c3087 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -1,7 +1,23 @@
 #!/bin/bash
 
 set -e
+shopt -s extglob
 
+if [[ $# == 0 ]]; then
+    ios=false
+else
+    ios=$1
+fi
+
+if "${ios}"; then
+
+out=ios
+sudo xcode-select --switch /Applications/Xcode-4.6.3.app
+flags=(cycc -- -miphoneos-version-min=2.0 -arch armv6)
+
+else
+
+out=out
 sudo xcode-select --switch /Applications/Xcode-5.1.1.app
 
 if which xcrun &>/dev/null; then
@@ -15,8 +31,32 @@ else
     flags=(g++)
 fi
 
+fi
+
+sdk=$(xcodebuild -sdk iphoneos -version Path)
+
 flags+=(-I.)
+flags+=(-I"${sdk}"/usr/include/libxml2)
+flags+=(-Ilibplist/include)
+flags+=(-Ilibplist/libcnary/include)
+
+mkdir -p "${out}"
+os=()
+
+for c in libplist/libcnary/!(cnary).c libplist/src/*.c; do
+    o=${c%.c}.o
+    o="${out}"/${o##*/}
+    os+=("${o}")
+    if [[ "${c}" -nt "${o}" ]]; then
+        "${flags[@]}" -c -o "${o}" -x c "${c}"
+    fi
+done
 
 set -x
-"${flags[@]}" -c -std=c++11 -o ldid.o ldid.cpp
-"${flags[@]}" -o ldid ldid.o -x c lookup2.c -x c sha1.c
+
+"${flags[@]}" -c -std=c++11 -o "${out}"/ldid.o ldid.cpp
+"${flags[@]}" -o "${out}"/ldid "${out}"/ldid.o "${os[@]}" -x c lookup2.c -x c sha1.c -lxml2
+
+if ! "${ios}"; then
+    ln -sf out/ldid .
+fi