public static bool unregisterPlugin(PluginBase plugin) { if (plugin == null) { return(false); } if (PluginBase.isValidPlugin(plugin)) { Log.i("ExtentCenter", "unregister plugin... " + plugin.mName); if (plugin.isInstalledPlugin()) { plugin.onUninstalled(InstallMode.DefaultInstall); plugin.mMetaInfo.isInstalled = false; } plugin.onUnRegisterResult(RetConst.MM_OK, 0); plugin.mMetaInfo.isRegistered = false; PluginMetaStorage.updateMetaInfo(plugin); } return(true); }
public static bool uninstallPlugin(PluginBase plugin, InstallMode mode = 0) { if (!PluginBase.isValidPlugin(plugin)) { return(false); } if (!PluginBase.isInstalledPlugin(plugin)) { return(false); } Log.i("ExtentCenter", string.Concat(new object[] { "uninstall plugin... ", plugin.mName, ", uninstall mode =", mode })); plugin.onUninstalled(mode); plugin.mMetaInfo.isInstalled = false; PluginMetaStorage.updateMetaInfo(plugin); if ((mode == InstallMode.UserInstall) && (plugin.mProtocolPluginFlag != ((EPluginFlag)0))) { Account acc = AccountMgr.getCurAccount(); acc.nPluginFlag = (uint)(((EPluginFlag)acc.nPluginFlag) | plugin.mProtocolPluginFlag); AccountMgr.updateAccount(); // OpLogMgr.opModUserInfo(0x800, acc); ServiceCenter.sceneNewSync.doScene(7, syncScene.MM_NEWSYNC_SCENE_OTHER); } return(true); }