|
|
@ -16,14 +16,11 @@ import com.fr.plugin.manage.PluginManager; |
|
|
|
import com.fr.plugin.manage.bbs.BBSPluginLogin; |
|
|
|
import com.fr.plugin.manage.bbs.BBSPluginLogin; |
|
|
|
import com.fr.plugin.manage.control.PluginTaskCallback; |
|
|
|
import com.fr.plugin.manage.control.PluginTaskCallback; |
|
|
|
import com.fr.plugin.view.PluginView; |
|
|
|
import com.fr.plugin.view.PluginView; |
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import netscape.javascript.JSObject; |
|
|
|
|
|
|
|
import org.json.JSONArray; |
|
|
|
import org.json.JSONArray; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.*; |
|
|
|
import java.io.File; |
|
|
|
import java.io.File; |
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -79,7 +76,7 @@ public class PluginOperateUtils { |
|
|
|
PluginMarker pluginMarker = PluginUtils.createPluginMarker(pluginInfo); |
|
|
|
PluginMarker pluginMarker = PluginUtils.createPluginMarker(pluginInfo); |
|
|
|
PluginContext plugin = PluginManager.getContext(pluginMarker); |
|
|
|
PluginContext plugin = PluginManager.getContext(pluginMarker); |
|
|
|
boolean active = plugin.isActive(); |
|
|
|
boolean active = plugin.isActive(); |
|
|
|
PluginTaskCallback modifyStatusCallback = new ModifyStatusCallback(active); |
|
|
|
PluginTaskCallback modifyStatusCallback = new ModifyStatusCallback(active, jsCallback); |
|
|
|
if (active) { |
|
|
|
if (active) { |
|
|
|
PluginManager.getController().forbid(pluginMarker, modifyStatusCallback); |
|
|
|
PluginManager.getController().forbid(pluginMarker, modifyStatusCallback); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -89,7 +86,7 @@ public class PluginOperateUtils { |
|
|
|
|
|
|
|
|
|
|
|
public static void uninstallPlugin(final String pluginInfo, final boolean isForce, JSCallback jsCallback) { |
|
|
|
public static void uninstallPlugin(final String pluginInfo, final boolean isForce, JSCallback jsCallback) { |
|
|
|
PluginMarker pluginMarker = PluginUtils.createPluginMarker(pluginInfo); |
|
|
|
PluginMarker pluginMarker = PluginUtils.createPluginMarker(pluginInfo); |
|
|
|
PluginManager.getController().uninstall(pluginMarker, isForce, new UnistallPluginCallback()); |
|
|
|
PluginManager.getController().uninstall(pluginMarker, isForce, new UninstallPluginCallback(jsCallback)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void readUpdateOnline(JSCallback jsCallback) { |
|
|
|
public static void readUpdateOnline(JSCallback jsCallback) { |
|
|
@ -120,6 +117,9 @@ public class PluginOperateUtils { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void getPluginFromStore(String category, String seller, String fee, JSCallback jsCallback) { |
|
|
|
public static void getPluginFromStore(String category, String seller, String fee, JSCallback jsCallback) { |
|
|
|
|
|
|
|
new Thread(new Runnable() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void run() { |
|
|
|
String plistUrl = SiteCenter.getInstance().acquireUrlByKind("plugin.plist"); |
|
|
|
String plistUrl = SiteCenter.getInstance().acquireUrlByKind("plugin.plist"); |
|
|
|
if (StringUtils.isNotBlank(plistUrl)) { |
|
|
|
if (StringUtils.isNotBlank(plistUrl)) { |
|
|
|
StringBuilder url = new StringBuilder(); |
|
|
|
StringBuilder url = new StringBuilder(); |
|
|
@ -145,6 +145,9 @@ public class PluginOperateUtils { |
|
|
|
jsCallback.execute(result); |
|
|
|
jsCallback.execute(result); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}).start(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void getPluginCategories(JSCallback jsCallback) { |
|
|
|
public static void getPluginCategories(JSCallback jsCallback) { |
|
|
|
String result; |
|
|
|
String result; |
|
|
|