diff --git a/README.md b/README.md index 31c8ef5..432eb41 100644 --- a/README.md +++ b/README.md @@ -3,4 +3,10 @@ 1. Download and install plugin from [Release Page](https://github.com/pengzhile/ide-eval-resetter/releases). 2. Click `Help` or `Get Help` -> `Reset IDE Eval` menu. 3. Restart your IDE. -4. Now you have another 30 days eval time :) \ No newline at end of file +4. Now you have another 30 days eval time :) + +------------------------------------------ + +### Alternative + +* Or run script in the `reset_eval` folder directly. \ No newline at end of file diff --git a/reset_eval/reset_jetbrains_eval_mac_linux.sh b/reset_eval/reset_jetbrains_eval_mac_linux.sh new file mode 100755 index 0000000..f2f105f --- /dev/null +++ b/reset_eval/reset_jetbrains_eval_mac_linux.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# reset jetbrains ide evals + +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 + rm -rf ~/Library/Application\ Support/JetBrains/${PRD}*/eval + 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 + rm -rf ~/.config/JetBrains/${PRD}*/eval + 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.' diff --git a/reset_eval/reset_jetbrains_eval_windows.vbs b/reset_eval/reset_jetbrains_eval_windows.vbs new file mode 100644 index 0000000..ec4bcd5 --- /dev/null +++ b/reset_eval/reset_jetbrains_eval_windows.vbs @@ -0,0 +1,43 @@ +Set oShell = CreateObject("WScript.Shell") +Set oFS = CreateObject("Scripting.FileSystemObject") +sHomeFolder = oShell.ExpandEnvironmentStrings("%USERPROFILE%") +sJBDataFolder = oShell.ExpandEnvironmentStrings("%APPDATA%") + "\JetBrains" + +Set re = New RegExp +re.Global = True +re.IgnoreCase = True +re.Pattern = "\.?(IntelliJIdea|GoLand|CLion|PyCharm|DataGrip|RubyMine|AppCode|PhpStorm|WebStorm|Rider).*" + +Sub removeEval(ByVal file, ByVal sEvalPath) + bMatch = re.Test(file.Name) + If Not bMatch Then + Exit Sub + End If + + If oFS.FolderExists(sEvalPath) Then + oFS.DeleteFolder sEvalPath, True + End If +End Sub + +If oFS.FolderExists(sHomeFolder) Then + For Each oFile In oFS.GetFolder(sHomeFolder).SubFolders + removeEval oFile, sHomeFolder + "\" + oFile.Name + "\config\eval" + Next +End If + +If oFS.FolderExists(sJBDataFolder) Then + For Each oFile In oFS.GetFolder(sJBDataFolder).SubFolders + removeEval oFile, sJBDataFolder + "\" + oFile.Name + "\eval" + Next +End If + +On Error Resume Next +oShell.RegDelete "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\/Jet/Brains./User/Id/On/Machine" +oShell.RegDelete "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\jetbrains\device_id" +oShell.RegDelete "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\jetbrains\user_id_on_machine" +oFs.DeleteFile sJBDataFolder + "\bl" +oFs.DeleteFile sJBDataFolder + "\crl" +oFs.DeleteFile sJBDataFolder + "\PermanentUserId" +oFs.DeleteFile sJBDataFolder + "\PermanentDeviceId" + +MsgBox "done" \ No newline at end of file