Skip to content

Commit

Permalink
Option to name tweak MobileSubstrate.dylib ;)
Browse files Browse the repository at this point in the history
  • Loading branch information
eni9889 committed Jun 7, 2017
1 parent 11c1683 commit c308a7c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions PP_SIDELOADER_OPTIONS.plist
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
<false/>
<key>REMOVE_PLUGINS</key>
<false/>
<key>NAME_TWEAK_MS</key>
<false/>
</dict>
</plist>
18 changes: 16 additions & 2 deletions script/modify_app
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ echo "KEEP_ORIGINAL_APP_NAME: $KEEP_ORIGINAL_APP_NAME"
REMOVE_PLUGINS=$(/usr/libexec/PlistBuddy -c "Print REMOVE_PLUGINS" "$PP_CONFIG_PATH")
echo "REMOVE_PLUGINS: $REMOVE_PLUGINS"

NAME_TWEAK_MS=$(/usr/libexec/PlistBuddy -c "Print NAME_TWEAK_MS" "$PP_CONFIG_PATH")
echo "NAME_TWEAK_MS: $NAME_TWEAK_MS"

#define some common paths
TEMP_PATH="${SRCROOT}/temp"
WORKING_DIR="${SRCROOT}/working_dir"
Expand Down Expand Up @@ -87,8 +90,19 @@ if [ "$OVERWRITE_ORIGINAL_APP" != true ] ; then
/usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier $PRODUCT_BUNDLE_IDENTIFIER" "$BUILT_PRODUCTS_DIR/$TARGET_NAME.app/Info.plist"
fi

#add the dylib
"${SRCROOT}/script/insert_dylib" --all-yes --inplace --overwrite "@executable_path/pptweak.dylib" "$BUILT_PRODUCTS_DIR/$TARGET_NAME.app/$HOOKED_EXECUTABLE"
#add the dylibmv
if [ "$NAME_TWEAK_MS" != true ] ; then
RANDOM_TEXT=$(openssl rand -hex 12)
TWEAK_NAME="$RANDOM_TEXT.dylib"
else
TWEAK_NAME="MobileSubstrate.dylib"
fi
echo "TWEAK NAME: $TWEAK_NAME"

PP_MS_TWEAK_PATH="$BUILT_PRODUCTS_DIR/$TARGET_NAME.app/$TWEAK_NAME"
mv $PP_TWEAK_PATH $PP_MS_TWEAK_PATH

"${SRCROOT}/script/insert_dylib" --all-yes --inplace --overwrite "@executable_path/$TWEAK_NAME" "$BUILT_PRODUCTS_DIR/$TARGET_NAME.app/$HOOKED_EXECUTABLE"

#add the correct entitlements
TEMP_PLIST="$TEMP_PATH/temp.plist"
Expand Down

0 comments on commit c308a7c

Please sign in to comment.