Skip to content

Instantly share code, notes, and snippets.

@m5lil
Last active May 6, 2024 09:44
Show Gist options
  • Star 28 You must be signed in to star a gist
  • Fork 12 You must be signed in to fork a gist
  • Save m5lil/32c2817e7597c881a772bd17b3c46a5e to your computer and use it in GitHub Desktop.
Save m5lil/32c2817e7597c881a772bd17b3c46a5e to your computer and use it in GitHub Desktop.
[reset jetbrains application trial] reset jetbrains ide evals v1.0.4 #others
#!/bin/bash
# reset jetbrains ide evals v1.0.4
OS_NAME=$(uname -s)
JB_PRODUCTS="IntelliJIdea CLion PhpStorm GoLand PyCharm WebStorm Rider DataGrip RubyMine AppCode"
if [ "$OS_NAME" == "Darwin" ]; then
echo 'macOS:'
for PRD in $JB_PRODUCTS; do
rm -rf ~/Library/Preferences/"${PRD}"*/eval
sed -i '' '/name="evlsprt.*"/d' ~/Library/Preferences/"${PRD}"*/options/other.xml >/dev/null 2>&1
rm -rf ~/Library/Application\ Support/JetBrains/"${PRD}"*/eval
sed -i '' '/name="evlsprt.*"/d' ~/Library/Application\ Support/JetBrains/"${PRD}"*/options/other.xml >/dev/null 2>&1
done
plutil -remove "/.JetBrains\.UserIdOnMachine" ~/Library/Preferences/com.apple.java.util.prefs.plist >/dev/null
plutil -remove "/.jetbrains/.user_id_on_machine" ~/Library/Preferences/com.apple.java.util.prefs.plist >/dev/null
plutil -remove "/.jetbrains/.device_id" ~/Library/Preferences/com.apple.java.util.prefs.plist >/dev/null
elif [ "$OS_NAME" == "Linux" ]; then
echo 'Linux:'
for PRD in $JB_PRODUCTS; do
rm -rf ~/."${PRD}"*/config/eval
sed -i '/name="evlsprt.*"/d' ~/."${PRD}"*/config/options/other.xml >/dev/null 2>&1
rm -rf ~/.config/JetBrains/"${PRD}"*/eval
sed -i '/name="evlsprt.*"/d' ~/.config/JetBrains/"${PRD}"*/options/other.xml >/dev/null 2>&1
done
sed -i '/key="JetBrains\.UserIdOnMachine"/d' ~/.java/.userPrefs/prefs.xml
sed -i '/key="device_id"/d' ~/.java/.userPrefs/jetbrains/prefs.xml
sed -i '/key="user_id_on_machine"/d' ~/.java/.userPrefs/jetbrains/prefs.xml
else
echo 'unsupport'
exit
fi
echo 'done.'
@Saurav-Paul
Copy link

Does it still work? How to use it ?

@dzmitrys-dev
Copy link

Add RustRover please

@abrahamfast
Copy link

Doesn't work PyCharm PyCharm 2023.3.3 (Professional Edition)

macOS 14.4 Beta (23E5205c)

@abrahamfast
Copy link

jetbrans IDE logout then work

@ClementGib
Copy link

Nice thanks

@DushaSmile
Copy link

Thanks

@NeftaliAcosta
Copy link

Thanks.

@dzmitrys-dev
Copy link

dzmitrys-dev commented Apr 25, 2024

#!/bin/bash
# reset jetbrains ide evals v1.0.4

OS_NAME=$(uname -s)
JB_PRODUCTS="IntelliJIdea CLion RustRover PhpStorm GoLand PyCharm WebStorm Rider DataGrip RubyMine AppCode"

if [ "$OS_NAME" == "Darwin" ]; then
  echo 'macOS:'

  for PRD in $JB_PRODUCTS; do
    rm -rf ~/Library/Preferences/"${PRD}"*/eval
    sed -i '' '/name="evlsprt.*"/d' ~/Library/Preferences/"${PRD}"*/options/other.xml >/dev/null 2>&1
    rm -rf ~/Library/Application\ Support/JetBrains/"${PRD}"*/eval
    sed -i '' '/name="evlsprt.*"/d' ~/Library/Application\ Support/JetBrains/"${PRD}"*/options/other.xml >/dev/null 2>&1
  done

  plutil -remove "/.JetBrains\.UserIdOnMachine" ~/Library/Preferences/com.apple.java.util.prefs.plist >/dev/null
  plutil -remove "/.jetbrains/.user_id_on_machine" ~/Library/Preferences/com.apple.java.util.prefs.plist >/dev/null
  plutil -remove "/.jetbrains/.device_id" ~/Library/Preferences/com.apple.java.util.prefs.plist >/dev/null
elif [ "$OS_NAME" == "Linux" ]; then
  echo 'Linux:'

  for PRD in $JB_PRODUCTS; do
    rm -rf ~/."${PRD}"*/config/eval
    sed -i '/name="evlsprt.*"/d' ~/."${PRD}"*/config/options/other.xml >/dev/null 2>&1
    rm -rf ~/.config/JetBrains/"${PRD}"*/eval
    sed -i '/name="evlsprt.*"/d' ~/.config/JetBrains/"${PRD}"*/options/other.xml >/dev/null 2>&1
  done

  sed -i '/key="JetBrains\.UserIdOnMachine"/d' ~/.java/.userPrefs/prefs.xml
  sed -i '/key="device_id"/d' ~/.java/.userPrefs/jetbrains/prefs.xml
  sed -i '/key="user_id_on_machine"/d' ~/.java/.userPrefs/jetbrains/prefs.xml
else
  echo 'unsupport'
  exit
fi

echo 'done.'

@dzmitrys-dev
Copy link

added RustRover

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment