Advertisement
mechanicker

Cercube patcher

Nov 9th, 2020 (edited)
903
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.72 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. # Extract Cercube.ipa and cercube.deb and attempt to update with latest cercube libraries from deb package
  3. # TODO: Figure out signing mismatch with rest of Cercube
  4.  
  5. set -e
  6. set -x
  7.  
  8. # Set 'ACTION=echo' for dry run
  9. # ACTION=echo
  10.  
  11. function patchit {
  12.     bin=$(basename $1)
  13.  
  14.     ${ACTION} install_name_tool -id @rpath/${bin} $1
  15.  
  16.     for p in $(otool -L $1|gsed 's#^[ \t]*##g'|grep framework|egrep "^/usr/lib"|sort|uniq|cut -d' ' -f1); do
  17.         t=$(basename ${p})
  18.         ${ACTION} install_name_tool -change ${p} @rpath/${t}.framework/${t} $1
  19.     done
  20. }
  21.  
  22. patchit Library/MobileSubstrate/DynamicLibraries/Cercube.dylib
  23.  
  24. for d in $(\ls -1 usr/lib); do
  25.     bin=$(echo ${d} | cut -d'.' -f1)
  26.     patchit usr/lib/${d}/${bin}
  27. done
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement