- name: build
run: |
export LDID_VERSION=$(echo "$(git describe --tags --abbrev=0)")
- ${CC} ${CFLAGS} -c -o lookup2.o lookup2.c
- ${CXX} ${CFLAGS} -c -o ldid.o ldid.cpp -std=c++11 -DLDID_VERSION=\"${LDID_VERSION}\"
- ${CXX} ${CFLAGS} -std=c++11 ldid.o lookup2.o ${LIBPLIST_LIB} ${LIBCRYPTO_LIB} -o ldid
+ make -j$(nproc) \
+ VERSION="${LDID_VERSION}" \
+ LIBS="${LIBPLIST_LIB} ${LIBCRYPTO_LIB}"
${TRIPLE}-strip ldid
- uses: actions/upload-artifact@v1
- name: build
run: |
export LDID_VERSION=$(echo "$(git describe --tags --abbrev=0)")
- ${CC} ${CFLAGS} -flto=thin -Os -c -o lookup2.o lookup2.c
- ${CXX} ${CFLAGS} -flto=thin -Os -c -o ldid.o ldid.cpp -std=c++11 -DLDID_VERSION=\"${LDID_VERSION}\"
- ${CXX} ${LIBPLIST_LIB} ${LIBCRYPTO_LIB} -flto=thin -Os -std=c++11 ldid.o lookup2.o -o ldid
+ make -j$(sysctl -n hw.ncpu) \
+ CFLAGS="${CFLAGS} -flto=thin" \
+ VERSION="${LDID_VERSION}" \
+ LIBS="${LIBPLIST_LIB} ${LIBCRYPTO_LIB}"
strip ldid
- uses: actions/upload-artifact@v1
-ios
-out
ldid
-ldid.deb
-debs
*.o
-_
-sysroot32
-sysroot64
+++ /dev/null
-[submodule "libplist"]
- path = libplist
- url = https://github.com/libimobiledevice/libplist.git
--- /dev/null
+VERSION ?= 2.1.5
+
+CC ?= cc
+CXX ?= c++
+INSTALL ?= install
+LN ?= ln
+
+CFLAGS ?= -O2 -pipe
+CXXFLAGS ?= $(CFLAGS)
+LDFLAGS ?=
+
+PREFIX ?= /usr/local
+
+BINDIR ?= $(PREFIX)/bin
+MANDIR ?= $(PREFIX)/share/man
+
+SRC := $(wildcard *.c) $(wildcard *.cpp)
+LIBS ?= -lcrypto -lplist-2.0
+
+all: ldid
+
+%.c.o: %.c
+ $(CC) -c $(CFLAGS) -I. $< -o $@
+
+%.cpp.o: %.cpp
+ $(CXX) -c -std=c++11 $(CXXFLAGS) -I. -DLDID_VERSION=\"$(VERSION)\" $< -o $@
+
+ldid: $(SRC:%=%.o)
+ $(CXX) $^ $(LDFLAGS) $(LIBS) -o ldid
+
+install: all
+ $(INSTALL) -D -m755 ldid $(DESTDIR)$(BINDIR)/ldid
+ $(LN) -sf ldid $(DESTDIR)$(BINDIR)/ldid2
+ $(INSTALL) -D -m644 docs/ldid.1 $(DESTDIR)$(MANDIR)/man1/ldid.1
+ $(INSTALL) -D -m644 docs/ldid.1.zh_TW $(DESTDIR)$(MANDIR)/zh_TW/man1/ldid.1
+
+clean:
+ rm -rf ldid *.o
+
+.PHONY: all clean install
+++ /dev/null
-Package: ldid
-Priority: optional
-Section: Development
-Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
-Architecture: iphoneos-arm
-Version:
-Description: pseudo-codesign Mach-O files
-Name: Link Identity Editor
-Author: Jay Freeman (saurik) <saurik@saurik.com>
-Depiction: http://cydia.saurik.com/info/ldid/
-Depends: libplist (>= 2.0.0), openssl
-Tag: purpose::console, role::developer
+++ /dev/null
-#!/bin/bash
-dir=$1
-dir=${dir:=_}
-sed -e "s@^\(Version:.*\)@\1$(./version.sh)@" control
-echo "Installed-Size: $(du -s "${dir}" | cut -f 1)"
+++ /dev/null
-#!/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
+++ /dev/null
-#!/bin/bash
-./make.sh true
+++ /dev/null
-Subproject commit 9ca25d293fe7f8aca8d952fc7bb91464fe2d34ab
+++ /dev/null
-#!/bin/bash
-
-set -e
-shopt -s extglob
-
-if [[ $# == 0 ]]; then
- ios=false
-else
- ios=$1
- shift
-fi
-
-export DEVELOPER_DIR=/Applications/Xcode-5.1.1.app
-
-os=()
-
-if "${ios}"; then
-
-out=ios
-flags=(cycc -- -miphoneos-version-min=2.0 -arch armv6 -arch arm64)
-
-flags+=(-Xarch_armv6 -Isysroot32/usr/include)
-flags+=(-Xarch_arm64 -Isysroot64/usr/include)
-
-flags+=(-Xarch_armv6 -Lsysroot32/usr/lib)
-flags+=(-Xarch_arm64 -Lsysroot64/usr/lib)
-
-static=false
-flags+=(-framework CoreFoundation)
-
-flags+=(-lplist)
-flags+=(-lcrypto)
-
-else
-
-out=out
-
-if which xcrun &>/dev/null; then
- flags=(xcrun -sdk macosx g++)
- flags+=(-mmacosx-version-min=10.4)
-
- for arch in i386 x86_64; do
- flags+=(-arch "${arch}")
- done
-else
- flags=(g++)
-fi
-
-#flags+=(-L../../lib-osx/openssl)
-
-# XXX: cannot redistribute
-static=true
-flags+=(-Isysroot64/usr/include)
-flags+=(-lcrypto)
-#flags+=(-Wl,/usr/lib/libcrypto.42.dylib)
-
-fi
-
-sdk=$(xcodebuild -sdk iphoneos -version Path)
-
-flags+=(-I.)
-
-if ${static}; then
-
-flags+=(-I"${sdk}"/usr/include/libxml2)
-flags+=(-Ilibplist/include)
-flags+=(-Ilibplist/libcnary/include)
-
-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
-
-fi
-
-flags+=("$@")
-
-mkdir -p "${out}"
-set -x
-
-"${flags[@]}" -O3 -g0 -c -std=c++11 -o "${out}"/ldid.o ldid.cpp
-"${flags[@]}" -O3 -g0 -o "${out}"/ldid "${out}"/ldid.o "${os[@]}" -x c lookup2.c -lxml2 -framework Security
-
-if ! "${ios}"; then
- ln -sf out/ldid .
-fi
+++ /dev/null
-#!/bin/bash
-./configure CC='clang -mmacosx-version-min=10.4 -arch i386 -arch x86_64' CXX='clang++ -mmacosx-version-min=10.4 -arch i386 -arch x86_64' CPP='clang -E' CXXCPP='clang++ -E' libxml2_LIBS=-lxml2 libxml2_CFLAGS=-I/usr/include/libxml2 --enable-static --disable-shared
+++ /dev/null
-/*\r
- * sha1.h\r
- *\r
- * Description:\r
- * This is the header file for code which implements the Secure\r
- * Hashing Algorithm 1 as defined in FIPS PUB 180-1 published\r
- * April 17, 1995.\r
- *\r
- * Many of the variable names in this code, especially the\r
- * single character names, were used because those were the names\r
- * used in the publication.\r
- *\r
- * Please read the file sha1.c for more information.\r
- *\r
- */\r
-\r
-#ifndef _SHA1_H_\r
-#define _SHA1_H_\r
-\r
-#include <stdint.h>\r
-\r
-#ifndef _SHA_enum_\r
-#define _SHA_enum_\r
-enum\r
-{\r
- shaSuccess = 0,\r
- shaNull, /* Null pointer parameter */\r
- shaInputTooLong, /* input data too long */\r
- shaStateError /* called Input after Result */\r
-};\r
-#endif\r
-#define SHA1HashSize 20\r
-\r
-/*\r
- * This structure will hold context information for the SHA-1\r
- * hashing operation\r
- */\r
-typedef struct SHA1Context\r
-{\r
- uint32_t Intermediate_Hash[SHA1HashSize/4]; /* Message Digest */\r
-\r
- uint32_t Length_Low; /* Message length in bits */\r
- uint32_t Length_High; /* Message length in bits */\r
-\r
- /* Index into message block array */\r
- int_least16_t Message_Block_Index;\r
- uint8_t Message_Block[64]; /* 512-bit message blocks */\r
-\r
- int Computed; /* Is the digest computed? */\r
- int Corrupted; /* Is the message digest corrupted? */\r
-} SHA1Context;\r
-\r
-/*\r
- * Function Prototypes\r
- */\r
-\r
-int SHA1Reset( SHA1Context *);\r
-int SHA1Input( SHA1Context *,\r
- const uint8_t *,\r
- unsigned int);\r
-int SHA1Result( SHA1Context *,\r
- uint8_t Message_Digest[SHA1HashSize]);\r
-\r
-#endif\r
+++ /dev/null
-#!/bin/bash
-set -e
-
-rm -rf sysroot32 sysroot64
-mkdir -p sysroot32 sysroot64
-
-function merge() {
- wget --no-check-certificate "${apt}/$1"
- dpkg-deb -x "$1" .
-}
-
-pushd sysroot32
-apt=http://apt.saurik.com/debs
-merge openssl_0.9.8zg-13_iphoneos-arm.deb
-merge libplist_2.0.0-1_iphoneos-arm.deb
-popd
-
-pushd sysroot64
-apt=https://apt.bingner.com/debs/1443.00
-merge libssl1.0_1.0.2q-1_iphoneos-arm.deb
-merge libssl-dev_1.0.2q-1_iphoneos-arm.deb
-merge libplist_2.0.0-1_iphoneos-arm.deb
-popd
-
-for lib in libplist libcrypto; do
- for dylib in sysroot*/usr/lib/"${lib}".*.dylib; do
- echo install_name_tool -id /usr/lib/"${lib}".dylib "${dylib}"
- chmod 755 "${dylib}"
- install_name_tool -id /usr/lib/"${lib}".dylib "${dylib}"
- done
-done
+++ /dev/null
-#!/bin/bash
-echo "$(git describe --tags --dirty="+" --match="v*" | sed -e 's@-\([^-]*\)-\([^-]*\)$@+\1.\2@;s@^v@2:@')"