-
-
Save nakamuraos/717eb99b5e145ed11cd754ad3714b302 to your computer and use it in GitHub Desktop.
Background Knowledge
Configuration structure
-
Navicat creates the directory
~/.config/navicat
to store configuration data:/home/user/.config/navicat ├── Premium │ ├── preferences.json │ ├── preferences.json.lock │ ├── Profiles │ │ ├── Clouds │ │ └── vgroup.json │ └── ui_preferences.json ├── Common │ ├── connections.json │ ├── connections.json.lock │ └── ui_connections.json ├── Settings │ └── ... └── MySQL └── Profiles └── ...
-
Navicat uses
dconf
in Linux to store user configuration data:- You can see the
com/premiumsoft/navicat-premium
section below:# nano ~/.config/dconf/user.conf ... [apps/light-locker] idle-hint=false late-locking=false lock-after-screensaver=uint32 5 lock-on-lid=false lock-on-suspend=true [com/premiumsoft/navicat-premium] 019C981BDC7F0FD22F2F2886AF209C85='84AA0BE73C5C83CF48CF06B475B05B9D' 0231EE5D1EF3A65D643D0D2DB15D3224='ABCD8AEC6CDC496375CC38A64AC1BE78' 023AECCA316B6E832F6D9664FC85369B='FE81DC33B14E9129F5BEA7F87BC6686B' 02771B3A8E4CA9456C24A43DF59C216F='625AE8702A2103E997B6394300A7FCE4' ... F9D5C7D0000DB83FB3100311BC54777C='034E5755BB39A9393272D9970B57074E' FC800E08E45E56E518CA9B2C7DE3FDBE='034E5755BB39A9393272D9970B57074E' FC800E08E45E56E518CA9B2C7DE3FDBE='034E5755BB39A9393272D9970B57074E' last-check-time=int64 1648194098 [org/blueman/general] window-properties=[558, 350, 555, 125] [org/blueman/network] nap-enable=false [org/blueman/plugins/powermanager] auto-power-on=@mb true ...
- Note: The above file was generated using the command:
To see how to use the
dconf dump / >~/.config/dconf/user.conf
dconf
command, rundconf -h
- You can see the
Solution
- This simple solution is to delete all keys in the
com/premiumsoft/navicat-premium
directory (referred to asdir
bydconf
, which is a virtual directory):# Check key list dconf list /com/premiumsoft/navicat-premium/ # The DIR must starting and ending with '/' dconf reset -f /com/premiumsoft/navicat-premium/ # Verify, empty is successful dconf list /com/premiumsoft/navicat-premium/
Summary
- The simple final bash script will look like this:
#!/bin/bash # Backup cp ~/.config/dconf/user ~/.config/dconf/user.bk cp ~/.config/navicat/Premium/preferences.json ~/.config/navicat/Premium/preferences.json.bk # Clear data in dconf dconf reset -f /com/premiumsoft/navicat-premium/ # Remove data fields in config file sed -i -E 's/,?"([A-Z0-9]+)":\{([^\}]+)},?//g' ~/.config/navicat/Premium/preferences.json
Maintainer
- NakamuraOS <https://github.com/nakamuraos>
This is part of my research. Please subscribe their plan if you can.
Works like a charm thanks !!
it works
It works. Thanks
Can anyone integrate this great work along with the following great contribution?:
Does this script will reset settings ? So if I save connection, will this script erase it?
Does this script will reset settings ? So if I save connection, will this script erase it?
No. It'll keep all current settings, your connections will remain in place.
I got this error: reset-trial-navicat.sh: 23: [[: not found
Did I do something wrong?
I got this error: reset-trial-navicat.sh: 23: [[: not found Did I do something wrong?
Run it as sudo
I got this error: reset-trial-navicat.sh: 23: [[: not found Did I do something wrong?
Run it as sudo
still the same error bruh :<
still the same error bruh :<
What distro do you use?
What distro do you use?
I am using Ubuntu 22.04
What distro do you use?
I am using Ubuntu 22.04
Can you show screenshot how do run command, and the result? It works good on ubuntu 22.04
@Cien267 use
sudo ./reset-trial-navicat.sh
I think this script uses bash commands in it. And sh can't normally execute
@dotmitsu
I try chmod +x and run "./" instead of "sh" and it works. Thank you very much <3
confirm it works on 17.0
Work faketime & this reset script together, 14 days trial always!
Navicat 17.0.8 on Ubuntu 20.04 Focal.
Beaware time stamp binary & faketime should match via touch
file.
🕷
really works. Thank you
Please close Navicat Premium before run this script.
You can also need re-run this script some times if it's not working.