fix third party plugins switch

Signed-off-by: pengzhile <pengzhile@gmail.com>
This commit is contained in:
pengzhile
2020-11-12 12:08:25 +08:00
parent 31a76de0b0
commit 0d93cde64d
2 changed files with 13 additions and 1 deletions
@@ -3,6 +3,7 @@ package io.zhile.research.intellij.ier.helper;
import com.intellij.openapi.updateSettings.impl.UpdateSettings;
import org.jetbrains.annotations.NotNull;
import java.lang.reflect.Method;
import java.util.List;
public class CustomRepository {
@@ -15,5 +16,14 @@ public class CustomRepository {
}
hosts.add(host);
Method method = Reflection.getMethod(UpdateSettings.class, "setThirdPartyPluginsAllowed", boolean.class);
if (method != null) {
try {
method.invoke(UpdateSettings.getInstance(), true);
} catch (Exception e) {
NotificationHelper.showError(null, "Enable third party plugins failed!");
}
}
}
}