已损坏修复 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/bash
  2. printf '\e[8;45;65t'
  3. clear
  4. BLACK="\033[0;30m"
  5. DARK_GRAY="\033[1;30m"
  6. BLUE="\033[0;34m"
  7. LIGHT_BLUE="\033[1;34m"
  8. GREEN="\033[0;32m"
  9. LIGHT_GREEN="\033[1;32m"
  10. CYAN="\033[0;36m"
  11. LIGHT_CYAN="\033[1;36m"
  12. RED="\033[0;31m"
  13. LIGHT_RED="\033[1;31m"
  14. PURPLE="\033[0;35m"
  15. LIGHT_PURPLE="\033[1;35m"
  16. BROWN="\033[0;33m"
  17. YELLOW="\033[0;33m"
  18. LIGHT_GRAY="\033[0;37m"
  19. WHITE="\033[1;37m"
  20. NC="\033[0m"
  21. echo ""
  22. echo -e "${LIGHT_PURPLE}泓创智诚 - 档案脱机存档${NC}"
  23. echo ""
  24. parentPath=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
  25. cd "$parentPath"
  26. appPath=$( find "$parentPath" -name '*.app' -not -name '*Crack.app' -maxdepth 1)
  27. if [[ -z "$appPath" ]]
  28. then
  29. echo -e "😅 ${LIGHT_RED}安装包已经损坏,请重新下载!${NC}"
  30. echo -e "✌️ 本窗口可以关闭啦!"
  31. else
  32. appName=${appPath##*/}
  33. appBashName=${appName// /\ }
  34. appDIR="/Applications/${appBashName}"
  35. echo -e "『${RED}${appBashName%.*} ${NC}已损坏,无法打开/来自身份不明的开发者』等问题修复工具"
  36. echo ""
  37. #未安装APP时提醒安装,已安装绕过公证
  38. if [ ! -d "$appDIR" ];then
  39. echo -e "😅 ${LIGHT_RED}您还未安装 ${appBashName%.*}, 请先将软件拷贝到【${NC}${LIGHT_BLUE}应用程序${NC}${LIGHT_RED}】目录${NC}"
  40. else
  41. #绕过公证
  42. echo -e "👇 ${LIGHT_RED}请输入开机密码, 输入完成后按下回车键(输入过程中密码是看不见的)${NC}"
  43. sudo spctl --master-disable
  44. sudo xattr -rd com.apple.quarantine /Applications/"$appBashName"
  45. echo ""
  46. echo -e "😁 ${LIGHT_GREEN}修复成功!${NC}您现在可以正常运行 ${LIGHT_GREEN}${appBashName%.*} ${NC}了。"
  47. fi
  48. echo ""
  49. echo -e "✌️ 操作已成功完成, 本窗口可以关闭啦!"
  50. fi