|
#!/bin/bash |
|
set -euo pipefail |
|
|
|
# Author: NakamuraOS <https://github.com/nakamuraos> |
|
# Latest update: 03/19/2025 |
|
# Tested with Navicat 15.x, 16.x, and 17.x on Debian and Ubuntu. |
|
|
|
BGRED="\e[1;97;41m" |
|
ENDCOLOR="\e[0m" |
|
|
|
echo -e "${BGRED} ${ENDCOLOR}" |
|
echo -e "${BGRED} ┌──────────────────────────────────────┐ ${ENDCOLOR}" |
|
echo -e "${BGRED} │ !!! WARNING !!! │ ${ENDCOLOR}" |
|
echo -e "${BGRED} ├──────────────────────────────────────┤ ${ENDCOLOR}" |
|
echo -e "${BGRED} │ ALL DATA can be destroyed. │ ${ENDCOLOR}" |
|
echo -e "${BGRED} │ Always BACKUP before continuing. │ ${ENDCOLOR}" |
|
echo -e "${BGRED} └──────────────────────────────────────┘ ${ENDCOLOR}" |
|
echo -e "${BGRED} ${ENDCOLOR}" |
|
|
|
echo -e "Report issues:\n> https://gist.github.com/nakamuraos/717eb99b5e145ed11cd754ad3714b302\n" |
|
echo -e "Reset trial \e[1mNavicat Premium\e[0m:" |
|
|
|
if [[ ! "${1:-}" =~ ^--?[Yy]([eE][sS])?$ ]]; then |
|
read -p "Are you sure? (y/N) " -r |
|
echo |
|
if [[ ! $REPLY =~ ^[Yy]([eE][sS])?$ ]]; then |
|
echo "Aborted." |
|
exit 0 |
|
fi |
|
fi |
|
|
|
echo "Starting reset..." |
|
DATE=$(date '+%Y%m%d_%H%M%S') |
|
|
|
# Backup |
|
echo "=> Creating a backup..." |
|
mkdir -p ~/.config/dconf/user-backup ~/.config/navicat/Premium/preferences-backup |
|
cp ~/.config/dconf/user ~/.config/dconf/user-backup/user.$DATE |
|
echo "The user dconf backup was created at $HOME/.config/dconf/user-backup/user.$DATE" |
|
cp ~/.config/navicat/Premium/preferences.json ~/.config/navicat/Premium/preferences-backup/preferences.json.$DATE |
|
echo "The Navicat preferences backup was created at $HOME/.config/navicat/Premium/preferences-backup/preferences.json.$DATE" |
|
|
|
if ! command -v dconf &>/dev/null; then |
|
echo "=> dconf is not installed. Installing..." |
|
|
|
if command -v apt-get &>/dev/null; then |
|
sudo apt-get update |
|
sudo apt-get install -y dconf-cli |
|
elif command -v dnf &>/dev/null; then |
|
sudo dnf install -y dconf |
|
elif command -v yum &>/dev/null; then |
|
sudo yum install -y dconf |
|
elif command -v pacman &>/dev/null; then |
|
sudo pacman -Sy --noconfirm dconf |
|
else |
|
echo "Package manager not supported. Please install dconf manually." |
|
exit 1 |
|
fi |
|
fi |
|
|
|
# Clear data in dconf |
|
echo "=> Resetting..." |
|
dconf reset -f /com/premiumsoft/navicat-premium/ |
|
echo "The user dconf data was reset" |
|
|
|
# Remove data fields in config file |
|
sed -i -E 's/,?"([A-F0-9]+)":\{([^\}]+)},?//g' ~/.config/navicat/Premium/preferences.json |
|
echo "The Navicat preferences was reset" |
|
|
|
# Done |
|
echo "Done." |
|
|
|
exit 0 |
help, doesnt work for me, ubuntu 22.04.. stil unregister,
yoshisdw@yoshisdw:
$ ps aux | grep navicat$yoshisdw 16149 1.1 0.0 6184 4092 ? Ssl 09:01 0:02 /home/yoshisdw/Downloads/navicat17-premium-en-x86_64.AppImage
yoshisdw 16232 0.0 0.0 9224 2560 pts/0 S+ 09:04 0:00 grep --color=auto navicat
yoshisdw@yoshisdw:
but its done
yoshisdw@yoshisdw:~/Downloads$ ./reset-trial-navicat.sh
┌──────────────────────────────────────┐
│ !!! WARNING !!! │
├──────────────────────────────────────┤
│ ALL DATA can be destroyed. │
│ Always BACKUP before continuing. │
└──────────────────────────────────────┘
Report issues:
Reset trial Navicat Premium:
Are you sure? (y/N) y
Starting reset...
=> Creating a backup...
The user dconf backup was created at /home/yoshisdw/.config/dconf/user-backup/user.20251115_090208
The Navicat preferences backup was created at /home/yoshisdw/.config/navicat/Premium/preferences-backup/preferences.json.20251115_090208
=> Resetting...
The user dconf data was reset
The Navicat preferences was reset
Done.
yoshisdw@yoshisdw:~/Downloads$