Guest User

Dell 1355 on Catalina Fix

a guest
Dec 24th, 2019
572
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2.  
  3. SOURCE='/Library/Image Capture/Devices/Dell C1765 MFP Scanner (ICA).app'
  4. DEST='/Library/Image Capture/Devices/Dell 1355cn MFP Scanner (ICA).app'
  5.  
  6. SOURCE_EXEC="$DEST/Contents/MacOS/Dell C1765 MFP Scanner (ICA)"
  7. DEST_EXEC="$DEST/Contents/MacOS/Dell 1355cn MFP Scanner (ICA)"
  8.  
  9. INFO="$DEST/Contents/Info.plist"
  10. DEVICEMATCHER="$DEST/Contents/Resources/DeviceMatchingInfo.plist"
  11. SCANNER_PROP="$DEST/Contents/Resources/ScannerProperties.plist"
  12.  
  13. if [ ! -d "$SOURCE" ]; then
  14.     echo "Install drivers for Dell C1765 MFP first! Run Dell C1765 Color MFP Installer.pkg"
  15.     exit 1
  16. fi
  17.  
  18. sudo cp -r "$SOURCE/." "$DEST" || \
  19.     { echo "Unable copy '$SOURCE' to '$DEST'"; exit 1; }
  20.  
  21. echo "Echo renaming executable..."
  22. sudo mv "$SOURCE_EXEC" "$DEST_EXEC" || \
  23.     { echo "Unable to rename executable '$SOURCE_EXEC' to '$DEST_EXEC'"; exit 1; }
  24.  
  25. echo "Patching plist files to match 1355 configuration..."
  26.  
  27. sudo plutil -replace usb.IOUSBDevice.0.idProduct -string "0x5406" "$DEVICEMATCHER" || \
  28.     { echo "Unable to find '$DEVICEMATCHER'"; exit 1; }
  29.  
  30. sudo plutil -replace usb.IOUSBDevice.0.idVendor -string "0x413c" "$DEVICEMATCHER"
  31. sudo plutil -replace "BonjourNetwork._printer\._tcp\..0.ICABonjourTXTRecordKey.product" -string "(Dell 1355cnw Color MFP)" "$DEVICEMATCHER"
  32. sudo plutil -replace "BonjourNetwork._printer\._tcp\..1.ICABonjourTXTRecordKey.product" -string "(Dell 1355cn Color MFP)" "$DEVICEMATCHER"
  33.  
  34. sudo plutil -replace CFBundleExecutable -string "Dell 1355cn MFP Scanner (ICA)" "$INFO" || \
  35.     { echo "Unable to find '$INFO'"; exit 1; }
  36. sudo plutil -replace CFBundleName -string "Dell 1355cn MFP Scanner (ICA)" "$INFO"
  37.  
  38. sudo plutil -replace "Scanner Name" -string "Dell 1355 MFP Scanner" "$SCANNER_PROP" || \
  39.     { echo "Unable to find '$SCANNER_PROP'"; exit 1; }
  40.  
  41. echo "Allow executing of '$DEST_EXEC' in System Preferences -> Security & Privacy -> General"
  42. open "$DEST_EXEC"
  43.  
  44. echo 'All done, reboot your system.'
  45. exit 0
RAW Paste Data