初始化提交
This commit is contained in:
37
Mac/16X/com.chaofan.reset.navicat.premium.trial.period.plist
Normal file
37
Mac/16X/com.chaofan.reset.navicat.premium.trial.period.plist
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<!-- 此处定义的是定时任务的名称,之后可用于搜索或停止该任务,建议与文件名一致即可 -->
|
||||
<string>com.chaofan.reset.navicat.premium.trial.period</string>
|
||||
<!-- 以下两个<string>标签填写需要运行的脚本的绝对路径,请以实际为准 -->
|
||||
<key>Program</key>
|
||||
<string>/Users/chaofan/Public/MyShell/reset_navicat.sh</string>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>/Users/chaofan/Public/MyShell/reset_navicat.sh</string>
|
||||
</array>
|
||||
<!-- 在加载该文件时即启动任务,如果不需要可以删掉或改为false -->
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
||||
<!-- 在指定时间执行任务 -->
|
||||
<key>StartCalendarInterval</key>
|
||||
<dict>
|
||||
<!-- 下面表示每天9点10分执行任务 -->
|
||||
<key>Hour</key>
|
||||
<integer>9</integer>
|
||||
<key>Minute</key>
|
||||
<integer>10</integer>
|
||||
</dict>
|
||||
<!-- 间隔多少秒执行任务,下面注释内容表示间隔30秒执行一次任务,两种方式只能选一种 -->
|
||||
<!-- <key>StartInterval</key>
|
||||
<integer>30</integer> -->
|
||||
<!-- 运行日志,请以实际为准 -->
|
||||
<key>StandardOutPath</key>
|
||||
<string>/Users/chaofan/Public/MyShell/reset_navicat.log</string>
|
||||
<!-- 错误日志,请以实际为准 -->
|
||||
<key>StandardErrorPath</key>
|
||||
<string>/Users/chaofan/Public/MyShell/reset_navicat.log</string>
|
||||
</dict>
|
||||
</plist>
|
||||
4
Mac/16X/reset_navicat.sh
Executable file
4
Mac/16X/reset_navicat.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
defaults delete com.navicat.NavicatPremium 91F6C435D172C8163E0689D3DAD3F3E9
|
||||
defaults delete com.navicat.NavicatPremium B966DBD409B87EF577C9BBF3363E9614
|
||||
rm -rf ~/Library/Application\ Support/PremiumSoft\ CyberTech/Navicat\ CC/Navicat\ Premium/
|
||||
49
Mac/16X/reset_navicat_by_52pojie.sh
Executable file
49
Mac/16X/reset_navicat_by_52pojie.sh
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
|
||||
# https://www.52pojie.cn/forum.php?mod=viewthread&tid=1669993
|
||||
|
||||
set -e
|
||||
|
||||
file=$(defaults read /Applications/Navicat\ Premium.app/Contents/Info.plist)
|
||||
|
||||
regex="CFBundleShortVersionString = \"([^\.]+)"
|
||||
[[ $file =~ $regex ]]
|
||||
|
||||
version=${BASH_REMATCH[1]}
|
||||
|
||||
echo "Detected Navicat Premium version $version"
|
||||
|
||||
case $version in
|
||||
"16")
|
||||
file=~/Library/Preferences/com.navicat.NavicatPremium.plist
|
||||
;;
|
||||
"15")
|
||||
file=~/Library/Preferences/com.prect.NavicatPremium15.plist
|
||||
;;
|
||||
*)
|
||||
echo "Version '$version' not handled"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
echo -n "Reseting trial time..."
|
||||
|
||||
regex="([0-9A-Z]{32}) = "
|
||||
[[ $(defaults read $file) =~ $regex ]]
|
||||
|
||||
hash=${BASH_REMATCH[1]}
|
||||
|
||||
if [ ! -z $hash ]; then
|
||||
defaults delete $file $hash
|
||||
fi
|
||||
|
||||
regex="\.([0-9A-Z]{32})"
|
||||
[[ $(ls -a ~/Library/Application\ Support/PremiumSoft\ CyberTech/Navicat\ CC/Navicat\ Premium/ | grep '^\.') =~ $regex ]]
|
||||
|
||||
hash2=${BASH_REMATCH[1]}
|
||||
|
||||
if [ ! -z $hash2 ]; then
|
||||
rm ~/Library/Application\ Support/PremiumSoft\ CyberTech/Navicat\ CC/Navicat\ Premium/.$hash2
|
||||
fi
|
||||
|
||||
echo " Done"
|
||||
50
Mac/17X/long-trial.sh
Normal file
50
Mac/17X/long-trial.sh
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
file=$(defaults read /Applications/Navicat\ Premium.app/Contents/Info.plist)
|
||||
|
||||
regex="CFBundleShortVersionString = \"([^\.]+)"
|
||||
[[ $file =~ $regex ]]
|
||||
|
||||
version=${BASH_REMATCH[1]}
|
||||
|
||||
echo "Detected Navicat Premium version $version"
|
||||
|
||||
case $version in
|
||||
"17")
|
||||
file=~/Library/Preferences/com.navicat.NavicatPremium.plist
|
||||
;;
|
||||
"16")
|
||||
file=~/Library/Preferences/com.navicat.NavicatPremium.plist
|
||||
;;
|
||||
"15")
|
||||
file=~/Library/Preferences/com.prect.NavicatPremium15.plist
|
||||
;;
|
||||
*)
|
||||
echo "Version '$version' not handled"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
echo -n "Reseting trial time..."
|
||||
|
||||
regex="([0-9A-Z]{32}) = "
|
||||
[[ $(defaults read $file) =~ $regex ]]
|
||||
|
||||
hash=${BASH_REMATCH[1]}
|
||||
|
||||
if [ ! -z $hash ]; then
|
||||
defaults delete $file $hash
|
||||
fi
|
||||
|
||||
regex="\.([0-9A-Z]{32})"
|
||||
[[ $(ls -a ~/Library/Application\ Support/PremiumSoft\ CyberTech/Navicat\ CC/Navicat\ Premium/ | grep '^\.') =~ $regex ]]
|
||||
|
||||
hash2=${BASH_REMATCH[1]}
|
||||
|
||||
if [ ! -z $hash2 ]; then
|
||||
rm ~/Library/Application\ Support/PremiumSoft\ CyberTech/Navicat\ CC/Navicat\ Premium/.$hash2
|
||||
fi
|
||||
|
||||
echo " Done"
|
||||
Reference in New Issue
Block a user