mirror of
https://github.com/tuxity/navicat-premium-reset-trial.git
synced 2026-03-13 21:53:21 +03:00
feat: import current gist
From here https://gist.github.com/tuxity/32b353f00b38fe41c64434b98fdee077
This commit is contained in:
49
reset-trial.sh
Normal file
49
reset-trial.sh
Normal file
@@ -0,0 +1,49 @@
|
||||
#!/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"|"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 "Reseting trial time..."
|
||||
|
||||
regex="([0-9A-Z]{32}) = "
|
||||
[[ $(defaults read $file) =~ $regex ]]
|
||||
|
||||
hash=${BASH_REMATCH[1]}
|
||||
|
||||
if [ ! -z $hash ]; then
|
||||
echo "deleting $hash array..."
|
||||
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
|
||||
echo "deleting $hash2 folder..."
|
||||
rm ~/Library/Application\ Support/PremiumSoft\ CyberTech/Navicat\ CC/Navicat\ Premium/.$hash2
|
||||
fi
|
||||
|
||||
echo "Done"
|
||||
Reference in New Issue
Block a user