update for 2020.2.x

Signed-off-by: pengzhile <pengzhile@gmail.com>
pull/6/MERGE
pengzhile 2020-10-13 17:15:29 +08:00
parent 65e19f94b7
commit 945d63e4ea
5 changed files with 34 additions and 5 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
.DS_Store
.idea/
.gradle/
build/

View File

@ -4,7 +4,7 @@ plugins {
}
group 'io.zhile.research.intellij'
version '1.0.4'
version '1.0.5'
repositories {
mavenCentral()
@ -19,12 +19,14 @@ intellij {
// localPath "${System.properties['user.home']}/Applications/IntelliJ IDEA.app"
// alternativeIdePath localPath
version "2020.1.2"
version "2020.2.3"
type "IU"
}
patchPluginXml {
changeNotes """
release v1.0.5
1. update for 2020.2.x
release v1.0.4
1. reset completely
release v1.0.3

View File

@ -1,5 +1,5 @@
#!/bin/bash
# reset jetbrains ide evals v1.0.4
# reset jetbrains ide evals v1.0.5
OS_NAME=$(uname -s)
JB_PRODUCTS="IntelliJIdea CLion PhpStorm GoLand PyCharm WebStorm Rider DataGrip RubyMine AppCode"

View File

@ -1,4 +1,4 @@
' reset jetbrains ide evals v1.0.4
' reset jetbrains ide evals v1.0.5
Set oShell = CreateObject("WScript.Shell")
Set oFS = CreateObject("Scripting.FileSystemObject")
sHomeFolder = oShell.ExpandEnvironmentStrings("%USERPROFILE%")
@ -53,9 +53,10 @@ 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"
oShell.RegDelete "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\jetbrains\"
oFs.DeleteFile sJBDataFolder + "\bl"
oFs.DeleteFile sJBDataFolder + "\crl"
oFs.DeleteFile sJBDataFolder + "\PermanentUserId"
oFs.DeleteFile sJBDataFolder + "\PermanentDeviceId"
MsgBox "done"
MsgBox "done"

View File

@ -20,6 +20,7 @@ import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Scanner;
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;
public class ResetAction extends AnAction {
@ -73,6 +74,13 @@ public class ResetAction extends AnAction {
prefs.remove(NEW_MACHINE_ID_KEY);
prefs.remove(DEVICE_ID_KEY);
try {
removeEvalNode(prefs);
} catch (BackingStoreException e) {
NotificationHelper.showError(project, "Remove evlsprt failed!");
return;
}
Preferences.userRoot().node(Constants.PLUGIN_NAME).put(Constants.PRODUCT_NAME + Constants.PRODUCT_HASH, Long.toString(System.currentTimeMillis()));
if (appInfo.isVendorJetBrains() && SystemInfo.isWindows) {
@ -118,4 +126,21 @@ public class ResetAction extends AnAction {
return new File(new File(configPath, "options"), "other.xml");
}
protected void removeEvalNode(Preferences prefs) throws BackingStoreException {
String[] keys = prefs.childrenNames();
if (keys.length == 0) {
return;
}
for (String key : keys) {
Preferences node = prefs.node(key);
if (key.startsWith("evlsprt")) {
node.removeNode();
continue;
}
removeEvalNode(node);
}
}
}