Skip to content

Instantly share code, notes, and snippets.

@danielnunez
Created November 19, 2023 18:35
Show Gist options
  • Save danielnunez/9c4248c5cdb435f7212f1423f723b964 to your computer and use it in GitHub Desktop.
Save danielnunez/9c4248c5cdb435f7212f1423f723b964 to your computer and use it in GitHub Desktop.

Revisions

  1. @tuxity tuxity revised this gist Dec 8, 2021. 3 changed files with 47 additions and 38 deletions.
    19 changes: 0 additions & 19 deletions navicat15_reset_trial.sh
    Original file line number Diff line number Diff line change
    @@ -1,19 +0,0 @@
    #!/bin/bash

    file=$(defaults read ~/Library/Preferences/com.prect.NavicatPremium15.plist)
    regex="([0-9A-Z]{32}) = {"

    [[ $file =~ $regex ]]

    defaults delete ~/Library/Preferences/com.prect.NavicatPremium15.plist ${BASH_REMATCH[1]}

    cd ~/Library/Application\ Support/PremiumSoft\ CyberTech/Navicat\ CC/Navicat\ Premium/

    str=$(ls -a | grep '^\.')
    regex="\.([0-9A-Z]{32})"

    [[ $str =~ $regex ]]

    rm .${BASH_REMATCH[1]}

    cd -
    19 changes: 0 additions & 19 deletions navicat16_reset_trial.sh
    Original file line number Diff line number Diff line change
    @@ -1,19 +0,0 @@
    #!/bin/bash

    file=$(defaults read ~/Library/Preferences/com.navicat.NavicatPremium.plist)
    regex="([0-9A-Z]{32}) = {"

    [[ $file =~ $regex ]]

    defaults delete ~/Library/Preferences/com.navicat.NavicatPremium.plist ${BASH_REMATCH[1]}

    cd ~/Library/Application\ Support/PremiumSoft\ CyberTech/Navicat\ CC/Navicat\ Premium/

    str=$(ls -a | grep '^\.')
    regex="\.([0-9A-Z]{32})"

    [[ $str =~ $regex ]]

    rm .${BASH_REMATCH[1]}

    cd -
    47 changes: 47 additions & 0 deletions navicat_reset_trial.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,47 @@
    #!/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
    "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"
  2. @tuxity tuxity revised this gist Dec 8, 2021. 1 changed file with 19 additions and 0 deletions.
    19 changes: 19 additions & 0 deletions navicat16_reset_trial.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    #!/bin/bash

    file=$(defaults read ~/Library/Preferences/com.navicat.NavicatPremium.plist)
    regex="([0-9A-Z]{32}) = {"

    [[ $file =~ $regex ]]

    defaults delete ~/Library/Preferences/com.navicat.NavicatPremium.plist ${BASH_REMATCH[1]}

    cd ~/Library/Application\ Support/PremiumSoft\ CyberTech/Navicat\ CC/Navicat\ Premium/

    str=$(ls -a | grep '^\.')
    regex="\.([0-9A-Z]{32})"

    [[ $str =~ $regex ]]

    rm .${BASH_REMATCH[1]}

    cd -
  3. @tuxity tuxity created this gist Mar 18, 2021.
    19 changes: 19 additions & 0 deletions navicat15_reset_trial.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    #!/bin/bash

    file=$(defaults read ~/Library/Preferences/com.prect.NavicatPremium15.plist)
    regex="([0-9A-Z]{32}) = {"

    [[ $file =~ $regex ]]

    defaults delete ~/Library/Preferences/com.prect.NavicatPremium15.plist ${BASH_REMATCH[1]}

    cd ~/Library/Application\ Support/PremiumSoft\ CyberTech/Navicat\ CC/Navicat\ Premium/

    str=$(ls -a | grep '^\.')
    regex="\.([0-9A-Z]{32})"

    [[ $str =~ $regex ]]

    rm .${BASH_REMATCH[1]}

    cd -