@Override public boolean implies(ProtectionDomain domain, final Permission permission) { if (RobocodeProperties.isSecurityOff()) { return true; } final String source = domain.getCodeSource().getLocation().toString(); if (!untrustedCodeUrls.contains(source)) { return true; } return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { public Boolean run() { return impliesRobot(permission); } }); }
@Override public PermissionCollection getPermissions(final CodeSource codeSource) { if (RobocodeProperties.isSecurityOff()) { return allPermissions; } final String source = codeSource.getLocation().toString(); if (untrustedCodeUrls.contains(source)) { return new Permissions(); } return AccessController.doPrivileged(new PrivilegedAction<PermissionCollection>() { public PermissionCollection run() { return parentPolicy.getPermissions(codeSource); } }); }
public synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { if (RobocodeProperties.isSecurityOff() || name.startsWith("java.lang")) { return super.loadClass(name, resolve); } if (isEngineClass(name)) { return loadEngineClass(name, resolve); } return super.loadClass(name, resolve); }
@Override public void checkAccess(ThreadGroup g) { if (RobocodeProperties.isSecurityOff()) { return;
@Override public void checkAccess(Thread t) { if (RobocodeProperties.isSecurityOff()) { return;
+ "Robots have access to their IRobotPeer interfaces.\n" + "You should only run robots which you trust!"; if (RobocodeProperties.isSecurityOff()) { Logger.logWarning(nosecMessage);