Skip to content

Instantly share code, notes, and snippets.

@duowb
Created April 29, 2024 09:06
Show Gist options
  • Select an option

  • Save duowb/38ef33f628de74381773caef79442659 to your computer and use it in GitHub Desktop.

Select an option

Save duowb/38ef33f628de74381773caef79442659 to your computer and use it in GitHub Desktop.

Revisions

  1. @tuxity tuxity renamed this gist Nov 30, 2023. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @tuxity tuxity revised this gist Nov 30, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion navicat_reset_trial.sh
    Original file line number Diff line number Diff line change
    @@ -46,4 +46,4 @@ if [ ! -z $hash2 ]; then
    rm ~/Library/Application\ Support/PremiumSoft\ CyberTech/Navicat\ CC/Navicat\ Premium/.$hash2
    fi

    echo "Done"
    echo "Done"
  3. @tuxity tuxity revised this gist Nov 30, 2023. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions navicat_reset_trial.sh
    Original file line number Diff line number Diff line change
    @@ -24,14 +24,15 @@ case $version in
    ;;
    esac

    echo -n "Reseting trial time..."
    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

    @@ -41,7 +42,8 @@ regex="\.([0-9A-Z]{32})"
    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"
    echo "Done"
  4. @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"
  5. @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 -
  6. @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 -