#!/usr/bin/env bash
# Extract Cercube.ipa and cercube.deb and attempt to update with latest cercube libraries from deb package
# TODO: Figure out signing mismatch with rest of Cercube
set -e
set -x
# Set 'ACTION=echo' for dry run
# ACTION=echo
function patchit {
bin=$(basename $1)
${ACTION} install_name_tool -id @rpath/${bin} $1
for p in $(otool -L $1|gsed 's#^[ \t]*##g'|grep framework|egrep "^/usr/lib"|sort|uniq|cut -d' ' -f1); do
t=$(basename ${p})
${ACTION} install_name_tool -change ${p} @rpath/${t}.framework/${t} $1
done
}
patchit Library/MobileSubstrate/DynamicLibraries/Cercube.dylib
for d in $(\ls -1 usr/lib); do
bin=$(echo ${d} | cut -d'.' -f1)
patchit usr/lib/${d}/${bin}
done
Comments