Skip to content
Commits on Source (6)
......@@ -88,7 +88,11 @@ public class BDToolkit extends BDToolkitBase
throw new Error("Not implemented");
}
public java.awt.peer.FramePeer createFrame(Frame target) {
return new BDFramePeer(target, (BDRootWindow)target);
if (!(target instanceof BDRootWindow)) {
logger.error("createFrame(): not BDRootWindow");
throw new Error("Not implemented");
}
return new BDFramePeer((BDRootWindow)target);
}
public java.awt.peer.ButtonPeer createButton(Button target) {
......
......@@ -30,8 +30,8 @@ import org.videolan.Logger;
public class BDFramePeer extends BDComponentPeer implements FramePeer
{
public BDFramePeer(Frame frame, BDRootWindow rootWindow) {
super(frame.getToolkit(), frame);
public BDFramePeer(BDRootWindow rootWindow) {
super(rootWindow.getToolkit(), rootWindow);
this.rootWindow = rootWindow;
}
......
......@@ -177,8 +177,8 @@ public class FileInputStream extends InputStream
if (logger == null) {
logger = Logger.getLogger(FileInputStream.class.getName());
}
return logger;
}
return logger;
}
private static native void initIDs();
......
......@@ -26,28 +26,51 @@ import java.security.PermissionCollection;
import java.util.Enumeration;
import java.util.jar.Manifest;
import java.security.AccessController;
import java.security.PrivilegedAction;
public abstract class DVBClassLoader extends java.security.SecureClassLoader {
public static DVBClassLoader newInstance(URL[] urls) {
return new DVBClassLoaderImpl(urls);
public static DVBClassLoader newInstance(final URL[] urls) {
return (DVBClassLoader)AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
return new DVBClassLoaderImpl(urls);
}
});
}
public static DVBClassLoader newInstance(URL[] urls, ClassLoader parent) {
return new DVBClassLoaderImpl(urls, parent);
public static DVBClassLoader newInstance(final URL[] urls, final ClassLoader parent) {
return (DVBClassLoader)AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
return new DVBClassLoaderImpl(urls, parent);
}
});
}
public DVBClassLoader(URL[] urls) {
public DVBClassLoader(final URL[] urls) {
SecurityManager sm = System.getSecurityManager();
if (sm != null)
sm.checkCreateClassLoader();
loader = new DVBURLClassLoader(urls);
loader = (DVBURLClassLoader)AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
return new DVBURLClassLoader(urls);
}
});
}
public DVBClassLoader(URL[] urls, ClassLoader parent) {
public DVBClassLoader(final URL[] urls, final ClassLoader parent) {
super(parent);
SecurityManager sm = System.getSecurityManager();
if (sm != null)
sm.checkCreateClassLoader();
loader = new DVBURLClassLoader(urls, parent);
loader = (DVBURLClassLoader)AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
return new DVBURLClassLoader(urls, parent);
}
});
}
public Class findClass(String name) throws ClassNotFoundException {
......
......@@ -21,7 +21,7 @@ package org.dvb.lang;
import java.net.URL;
public class DVBClassLoaderImpl extends DVBClassLoader {
class DVBClassLoaderImpl extends DVBClassLoader {
public DVBClassLoaderImpl(URL[] urls) {
super(urls);
}
......
......@@ -31,12 +31,15 @@ import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Map;
import java.security.AccessController;
import java.security.PrivilegedAction;
import javax.tv.xlet.Xlet;
import org.videolan.bdjo.AppCache;
public class BDJClassLoader extends URLClassLoader {
public static BDJClassLoader newInstance(AppCache[] appCaches, String basePath, String classPathExt, String xletClass) {
public static BDJClassLoader newInstance(AppCache[] appCaches, String basePath, String classPathExt, final String xletClass) {
ArrayList classPath = new ArrayList();
URL url = translateClassPath(appCaches, basePath, null);
if (url != null)
......@@ -47,7 +50,14 @@ public class BDJClassLoader extends URLClassLoader {
if ((url != null) && (classPath.indexOf(url) < 0))
classPath.add(url);
}
return new BDJClassLoader((URL[])classPath.toArray(new URL[classPath.size()]) , xletClass);
final URL[] urls = (URL[])classPath.toArray(new URL[classPath.size()]);
return (BDJClassLoader)AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
return new BDJClassLoader(urls, xletClass);
}
});
}
private static URL translateClassPath(AppCache[] appCaches, String basePath, String classPath) {
......
......@@ -60,17 +60,22 @@ public class LoaderAdapter implements BDJLoaderAdapter {
if (title != 65535)
return in;
try {
for (i1 = 0; i1 < in.length; i1++) {
if (in[i1].getParams() != null &&
in[i1].getParams().length == 1 &&
in[i1].getControlCode() == AppEntry.AUTOSTART &&
match(in[i1].getInitialClass().getBytes(),0,0) == 0 &&
match(in[i1].getParams()[0].substring(0,9).getBytes(),1,0) == 0) {
match(in[i1].getInitialClass().getBytes("UTF-8"),0,0) == 0 &&
match(in[i1].getParams()[0].substring(0,9).getBytes("UTF-8"),1,0) == 0) {
break;
}
}
if (i1 == in.length)
return in;
} catch (java.io.UnsupportedEncodingException uee) {
logger.error("" + uee);
return in;
}
xlet = "." + StrUtil.split(in[i1].getParams()[0], ':')[1];
for (i2 = 0; i2 < in.length; i2++) {
......