#!/bin/bash
-Cydia=$(dirname "$0")
-exec "${Cydia}"/Cydia_ 2>>/tmp/cydia.log
+C=/${0}
+C=${C%/*}
+declare -a flags
+[[ :${DYLD_INSERT_LIBRARIES}: == */MobileSubstrate.dylib: ]] && flags[${#flags[@]}]=--substrate
+exec "${C:-.}"/Cydia_ "${flags[@]}" -- "$@" 2>>/tmp/cydia.log