Browse Source

BI-6684 License读取类加密做准备

master
richie 7 years ago
parent
commit
ed461daa16
  1. 16
      designer_base/src/com/fr/design/actions/file/SwitchExistEnv.java
  2. 6
      designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogImpl.java
  3. 2
      designer_base/src/com/fr/design/roleAuthority/ReportAndFSManagePane.java
  4. 15
      designer_base/src/com/fr/env/RemoteEnv.java
  5. 17
      designer_chart/src/com/fr/design/chart/ChartTypePane.java

16
designer_base/src/com/fr/design/actions/file/SwitchExistEnv.java

@ -26,9 +26,11 @@ import com.fr.stable.LicUtils;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.EnvChangedListener; import com.fr.stable.EnvChangedListener;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.help.FineClassLoader;
import javax.swing.*; import javax.swing.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.lang.reflect.Method;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
@ -118,7 +120,7 @@ public class SwitchExistEnv extends MenuDef {
return; return;
} }
SignIn.signIn(selectedEnv); SignIn.signIn(selectedEnv);
LicUtils.resetBytes(); resetLicenseBytes();
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshToolArea(); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshToolArea();
fireDSChanged(); fireDSChanged();
} catch (Exception em) { } catch (Exception em) {
@ -127,5 +129,17 @@ public class SwitchExistEnv extends MenuDef {
TemplatePane.getInstance().editItems(); TemplatePane.getInstance().editItems();
} }
} }
private void resetLicenseBytes() {
FineClassLoader classLoader = new FineClassLoader();
try {
Class<?> clazz = classLoader.loadClass("com.fr.base.FRCoreContext");
Method retryMethod = clazz.getMethod("retryLicLock");
retryMethod.invoke(clazz);
} catch (Exception ignore) {
} }
}
}
} }

6
designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogImpl.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe.loghandler; package com.fr.design.mainframe.loghandler;
import com.fr.stable.fun.impl.AbstractLogProvider; import com.fr.stable.fun.impl.AbstractLogProvider;
import com.fr.stable.web.SessionProvider;
import com.fr.stable.xml.LogRecordTimeProvider; import com.fr.stable.xml.LogRecordTimeProvider;
import java.util.ArrayList; import java.util.ArrayList;
@ -43,4 +44,9 @@ public class DesignerLogImpl extends AbstractLogProvider{
public void record(LogRecordTimeProvider logRecordTime) { public void record(LogRecordTimeProvider logRecordTime) {
records.add(logRecordTime); records.add(logRecordTime);
} }
@Override
public void record(LogRecordTimeProvider logRecordTime, SessionProvider sessionProvider) {
}
} }

2
designer_base/src/com/fr/design/roleAuthority/ReportAndFSManagePane.java

File diff suppressed because one or more lines are too long

15
designer_base/src/com/fr/env/RemoteEnv.java vendored

@ -34,6 +34,7 @@ import com.fr.plugin.PluginLoader;
import com.fr.share.ShareConstants; import com.fr.share.ShareConstants;
import com.fr.stable.*; import com.fr.stable.*;
import com.fr.stable.file.XMLFileManagerProvider; import com.fr.stable.file.XMLFileManagerProvider;
import com.fr.stable.help.FineClassLoader;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLTools; import com.fr.stable.xml.XMLTools;
@ -46,6 +47,7 @@ import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamResult;
import java.awt.*; import java.awt.*;
import java.io.*; import java.io.*;
import java.lang.reflect.Method;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.NoRouteToHostException; import java.net.NoRouteToHostException;
import java.net.Socket; import java.net.Socket;
@ -1387,13 +1389,24 @@ public class RemoteEnv extends AbstractEnv {
return; return;
} }
SignIn.signIn(remoteEnv); SignIn.signIn(remoteEnv);
LicUtils.resetBytes(); resetLicenseBytes();
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshToolArea(); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshToolArea();
} catch (Exception em) { } catch (Exception em) {
FRContext.getLogger().error(em.getMessage(), em); FRContext.getLogger().error(em.getMessage(), em);
} }
} }
private void resetLicenseBytes() {
FineClassLoader classLoader = new FineClassLoader();
try {
Class<?> clazz = classLoader.loadClass("com.fr.base.FRCoreContext");
Method retryMethod = clazz.getMethod("retryLicLock");
retryMethod.invoke(clazz);
} catch (Exception ignore) {
}
}
/** /**
* 停止连接 * 停止连接
*/ */

17
designer_chart/src/com/fr/design/chart/ChartTypePane.java

@ -15,11 +15,13 @@ import com.fr.general.Inter;
import com.fr.general.RegistEditionException; import com.fr.general.RegistEditionException;
import com.fr.general.VT4FR; import com.fr.general.VT4FR;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.help.FineClassLoader;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionListener;
import java.awt.*; import java.awt.*;
import java.lang.reflect.Method;
public class ChartTypePane extends ChartCommonWizardPane { public class ChartTypePane extends ChartCommonWizardPane {
private static final long serialVersionUID = -1175602484968520546L; private static final long serialVersionUID = -1175602484968520546L;
@ -150,7 +152,7 @@ public class ChartTypePane extends ChartCommonWizardPane {
String plotID = typeName[mainTypeList.getSelectedIndex()].getPlotID(); String plotID = typeName[mainTypeList.getSelectedIndex()].getPlotID();
Chart chart = ChartTypeManager.getInstance().getChartTypes(plotID)[iconViewList.getSelectedIndex()]; Chart chart = ChartTypeManager.getInstance().getChartTypes(plotID)[iconViewList.getSelectedIndex()];
if(chart.getPlot() != null){ if(chart.getPlot() != null){
if(chart.getPlot() instanceof MapPlot && !(VT4FR.isLicAvailable(StableUtils.getBytes()) && VT4FR.CHART_MAP.support())){ if(chart.getPlot() instanceof MapPlot && !supportMap()){
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Chart-Map_Not_Supported")); JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Chart-Map_Not_Supported"));
throw new RegistEditionException(VT4FR.CHART_MAP); throw new RegistEditionException(VT4FR.CHART_MAP);
} }
@ -165,6 +167,19 @@ public class ChartTypePane extends ChartCommonWizardPane {
} }
} }
private boolean supportMap() {
FineClassLoader classLoader = new FineClassLoader();
byte[] bytes = null;
try {
Class<?> clazz = classLoader.loadClass("com.fr.base.FRCoreContext");
Method method = clazz.getMethod("getBytes");
bytes = (byte[]) method.invoke(clazz);
} catch (Exception ignore) {
}
return VT4FR.isLicAvailable(bytes) && VT4FR.CHART_MAP.support();
}
public void update(ChartCollection cc) { public void update(ChartCollection cc) {
if (cc == null) { if (cc == null) {
return; return;

Loading…
Cancel
Save