保存以下代码shell脚本,执行一下
#!/bin/bash
#是否存在文件目录
if [ ! -d /Applications/Beyond\ Compare.app/ ]; then
echo "您未安装Beyond Compare";
exit
fi
cd /Applications/Beyond\ Compare.app/Contents/MacOS/
echo "发现安装路径:"
pwd
#判断是否存在二进制文件
if grep -q "BCompare.real" BCompare
then
echo "已经破解过了"
exit
else
echo "准备修改执行文件"
fi
echo "备份旧的二进制文件BCompare->BCompare.real"
mv BCompare BCompare.real
echo "新建脚本文件BCompare"
echo "#!/bin/bash
rm \"/Users/\$(whoami)/Library/Application Support/Beyond Compare/registry.dat\"
\"\`dirname \"\$0\"\`\"/BCompare.real \$@" > BCompare
chmod a+x BCompare
echo "完成"