Skip to content

Commit

Permalink
Added option to remove UISupportedDevices from Info.plist
Browse files Browse the repository at this point in the history
  • Loading branch information
wutian committed Jul 29, 2019
1 parent 0862334 commit f87fca2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ IPAPatch provide a simple way to patch iOS Apps, without needing to jailbreak.

| Name | Description | Default |
| --- | --- | --- |
| RESTORE_SYMBOLS | When `YES`, IPAPatch will try to restore symbol table from Mach-O for debugging propose (with tools from https://github.com/tobefuturer/restore-symbol, also thanks to @henrayluo and @dannion) | YES |
| RESTORE_SYMBOLS | When `YES`, IPAPatch will try to restore symbol table from Mach-O for debugging propose (with tools from https://github.com/tobefuturer/restore-symbol, also thanks to @henrayluo and @dannion) | NO |
| CREATE_IPA_FILE | When `YES`, IPAPatch will generate a ipa file on each build. Genrated file is located at `SRCROOT/Product` | NO |
| IGNORE_UI_SUPPORTED_DEVICES | When `YES`, IPAPatch will delete `UISupportedDevices` from source app's `Info.plist` | NO |


7. **Code Your Patch**
Expand Down
4 changes: 3 additions & 1 deletion Tools/options.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
<plist version="1.0">
<dict>
<key>RESTORE_SYMBOLS</key>
<true/>
<false/>
<key>CREATE_IPA_FILE</key>
<false/>
<key>IGNORE_UI_SUPPORTED_DEVICES</key>
<false/>
</dict>
</plist>
6 changes: 5 additions & 1 deletion Tools/patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ DUMMY_DISPLAY_NAME=$(/usr/libexec/PlistBuddy -c "Print CFBundleDisplayName" "${
echo "DUMMY_DISPLAY_NAME: $DUMMY_DISPLAY_NAME"

RESTORE_SYMBOLS=$(/usr/libexec/PlistBuddy -c "Print RESTORE_SYMBOLS" "${OPTIONS_PATH}")
IGNORE_UI_SUPPORTED_DEVICES=$(/usr/libexec/PlistBuddy -c "Print IGNORE_UI_SUPPORTED_DEVICES" "${OPTIONS_PATH}")

echo "RESTORE_SYMBOLS: $RESTORE_SYMBOLS"
echo "CREATE_IPA_FILE: $CREATE_IPA_FILE"
echo "IGNORE_UI_SUPPORTED_DEVICES: $IGNORE_UI_SUPPORTED_DEVICES"

TARGET_BUNDLE_ID="$PRODUCT_BUNDLE_IDENTIFIER"
echo "TARGET_BUNDLE_ID: $TARGET_BUNDLE_ID"
Expand Down Expand Up @@ -236,7 +238,9 @@ TARGET_DISPLAY_NAME="$DUMMY_DISPLAY_NAME$TARGET_DISPLAY_NAME"
/usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier $PRODUCT_BUNDLE_IDENTIFIER" "$TARGET_APP_PATH/Info.plist"
/usr/libexec/PlistBuddy -c "Set :CFBundleDisplayName $TARGET_DISPLAY_NAME" "$TARGET_APP_PATH/Info.plist"
if [ "$IGNORE_UI_SUPPORTED_DEVICES" = true ]; then
/usr/libexec/PlistBuddy -c "Delete :UISupportedDevices" "$TARGET_APP_PATH/Info.plist"
fi
# ---------------------------------------------------
# 8. Code Sign All The Things
Expand Down

0 comments on commit f87fca2

Please sign in to comment.