Security Problems with Signed Applet
Hello All,
I need help with signed applets.
I have an applet pkged in a jar that uses other jars. I have signed the jar containing applet and all the other jars being used. However, when I try to run the applet in IE 6.0.xx, I get the following error
java.lang.ExceptionInInitializerError
at aaa.aaa.somemethod(xxx.java:192)
at aaa.aaa.aaa.access$000(xxx.java:27)
at aaa.aaa.aaa.$1.run(xxx.java:467)
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission user.home read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
... 3 moreMy application is using Java 1.4.2.xx.
Any help or pointers would be greatly appreciated.
Thanks.
Thanks harmmeijer and mjparme for your responses.
I made some changes to my application and it does not now require the system property information. But now I am getting another exception related to class loader.
I made the changes to the console as suggested by harmmeijer, and here is the stack trace. Also, I am not using any JavaScript explicitly.
Registered modality listener
Invoking JS method: document
Invoking JS method: URL
Referencing classloader: sun.plugin.ClassLoaderInfo@e0a386, refcount=1
Loading applet ...
Initializing applet ...
Starting applet ...
java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.ClassLoader.getSystemClassLoader(Unknown Source)
at xxx.xxx.a...<init>(a.java:39)
at xxx.xxx.b...<init>(b.java:42)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
java.security.AccessControlException: access denied (java.lang.RuntimePermission getClassLoader)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.ClassLoader.getSystemClassLoader(Unknown Source)
at xxx.xxx.a...ToolBus.<init>(a.java:39)
at xxx.xxx.b....<init>(b.java:42)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Modality pushed
Modality poppedmjparme as to your second point, the action is taking place in the same jar only. No other jar is involved at the stage where I am getting exception.
Thankyou again and will appreciate your help.
AC
Similar Messages
-
Security problem when signed applet dynamically load plugins
Hi!
I have one problem : "security problem when signed applet dynamically load plugins"
This is the scenario:
the main program [app.jar]
. contain applet and shared library (interface & implement of common class)
. it is signed and run normally on browser
. it can draw image loaded from other URL [ex] http://bp1.blogger.com/image.jpg
. the image loader is in the shared library
. dynamically load amazon.jar through URLClassLoader and reflection
the plugin [amazon.jar]
. search amazon product [ex] Harry Potter book
. draw image on applet
. use image loader from shared library, BUT CANNOT LOAD IMAGE
The question: "Why it cannot load image, because the image loader is in the shared library which has been signed and working?" I tried to sign the amazon.jar too, but it did not work.
Your reply would be very helpful. Thank you.
Sovannhello. i have create a signed applet for A.jar. A.jar include two package B and C. the main applet class is within B.
B need some classes in C to run the applet. but i got the error that class in package c are not found.
what shall i do? -
HI All,
I am writing a small applet to draw a line graph by setting the parameters from the html pages .It came up beutifully .There are two problems here .
1)When i try to print the applet it prints only black coloroued rectangle in place of applet(graph) .I read lot of articles only to find out that the applet need to be signed for printed .I tried all ways and means but could not succedd in printing an applet .
2)When i try to access the applet from other computer with out copying it says that applet can not be acceessed due to security failure .It throws exception.
I need your help on how to sign applets to access from other computer and also how to print applet content .
Can any one help me on this
Thanks in advance .i am not sure of that , but having experience with drawing images ,graphs and the like and with no experience in printing, i can share u my experience.
using setBackground(Color.white) of the applet/panel wouldnot work since i believe it is something that is got to do with the graphics class .U have to draw a full white rectangle as a background before u start drawing lines.
like
g.setColor(color.white);
g.drawfullrect(0,0,width,height); /// draw a white background
g.setColot(Color.black);
g.drawline(0,0);
etc.....
Have fun dude. -
Problems with signed Applet for File Download under JRE 1.4 (works with 1.3
Dear all,
i encountered a very strange behaviour with JRE 1.4x. A signed applet used for file download worked on all platforms (Windows NT, 2000 and XP wth/wthout SP...) until I installed JRE 1.4.x (1.4.1 or 1.4.2)
I get an EOFException when downloading binary files (for ASCII it works fine) when trying to readByte() from a DataInputStream. But not immideately, but after x bytes in the while-loop. Security is fine (I know there have been changes to that in jre 1.4, the applet itself can be started an runs with ASCII files for transfer)
Does anyone know, what has changed in jre1.4.
As I said, it works fine under jre 1.3.x
The relevant code is below: byte bt = dis.readByte(); causes the error
try{
// Get URL from Server
URL uFile = new URL(sFilename);
sThisURLFile = uFile.getFile();
Integer inte = new Integer(i);
//open input stream for the file on server
DataInputStream dis = new DataInputStream(new BufferedInputStream
(uFile.openConnection().getInputStream()));
//open output stream for the file on local drive
String sFilenameOnly = sThisURLFile.substring(sThisURLFile.lastIndexOf('/')+1);
int iDotPos = sFilenameOnly.lastIndexOf(".");
String sExt;
if (iDotPos > 0) {
sExt= sFilenameOnly.substring(iDotPos);
} else {
sExt = "";
File fileOut = new File(sDownloadDir + sThisURLFile.substring(sThisURLFile.lastIndexOf('/')+1) );
DataOutputStream dos = new DataOutputStream(new
BufferedOutputStream(new FileOutputStream(fileOut)));
//read one byte from input stream, and write that byte to output stream
long nByte = 0;
int iCnt = 0;
iFilesizeDone ++;
while (nByte < iFilesize){
String sErrPs = new String();
try{
sErrPs = "00";
byte bt = dis.readByte();
sErrPs = "01";
dos.writeByte(bt);
} catch (EOFException ee)
System.err.println("internal EOFException: " + ee.getMessage());
System.out.println("Error Filesize is " nByte " of " iFilesize "---" + sErrPs);
break;
nByte++;
iFilesizeDone ++;
iCnt ++;
if(iCnt >= 10240) {
ShowProgress(nByte, iFilesize, iFilesizeDone, iFilesizeTotal); // repaint does not work during init-procedure
iCnt = 0;
line = "Progress: Total: " + ((iFilesizeDone*100)/iFilesizeTotal) + " perc, " + iFilesizeTotal/1024 +" kbytes" ;
labLine.setText(line);
//dos.flush(); // improves Client performance (Agent-Call!)
dis.close();
dos.close();
}// End try
catch (EOFException ee)
System.err.println("EOFException: " + ee.getMessage()e);
catch (SecurityException se)
System.err.println("SecurityException: " + se.getMessage());
catch (IOException ioe)
System.err.println("IOException: " + ioe.getMessage());perhaps they've changed something with the file blocking.
btw, you should try to use something like this
DataInputStream dis = new DataInputStream(is);
byte[] buffer=new byte[8192];
int numBytesRead;
while ( dis.available()>0 ) {
numBytesRead = dis.read(buffer);
} -
Hello !
I have an applet program that displays the content of a batch file in the Applet window.
To sign the Applet I have converted the corresponding class file to a jar .
Then using keytool & jarsigner... I had signed it .
I tried to restrict the enuser form editing the contents of that batchfile's contents.
To restrict it I had Created a Policy file with only read permission allowed .
After following the above procedures , when i tried to run my applet, the applet is getting loaded sucessfully with that batch file's content .
And when i try to edit it , I'm able to edit the contents . I don't how this could be possible bcoz i have set the permission only to read it !
Any Ideas Please !
TIAin the policy file, you restrict the applet to only read files. but if you have already signed it and clicked Yes on the certification screen when loading the applet, the applet gets full permission.
the other thing is that you have a textarea field or something, you must set the textarea to readonly.
if you read in a file's content and display it in a textarea, the user can change the content of the textarea, but if your applet does not write the changes back to the file, the file won't be changed, although the user has changed the textarea content.
perhaps you might post some more info on the code you are using.... -
Default security context for signed applets using WinXP+IE8
What is the default security context for signed applets from the internet zone using Java 6 and WinXP+IE8 combination? My guess is that all file and socket access available for the user's Windows account is provided to the applet as well. Is this correct and if so, is there a way to limit these access privileges for signed applets from the internet zone?
This information is surprisingly difficult to find given how security concious people now are using the internet.AntonBoer wrote:
Thank you for your swift reply.
Unfortunately your answer reflects to my worst fears. Frankly I find this security model naiive. Anyone with euros can get their applet signed so that is no security control at all.The same naive security model applies to just about anything signed and downloaded; not just to Java Applets.
>
Working for a corporate IT how I am supposed to allow Java installations on any of our computers with internet access? That automatically means I am providing them as platforms to whoever wishes to run Java code on them (given that the user of course visits the web site). I would have expected Sun to put more effort into this but it appers nothig have changed in this regard for 10 years.I don't see this as a Sun problem; it is indicative of what I consider to be a general security weakness for all computer systems. For example, for Windows, Vista just added more user involvement in the trust process but it still allows programs to run pretty much unconstrained if the user agrees to them running.
For some time I have advocated a more fine grained approach. I would like to see ALL programs run in a sandbox that a user can specify what and what cannot be done by each individual program. Unfortunately, this would annoy the hell out of most users so it has little chance of every of ever being accepted. The average user just wants a run-and-forget-about-security model. -
I am having a problem with signed jar and deploy in html
get this error on the page
self signed
/dist/testfx.html
JavaFX application could not launch due to system configuration. See java.com/javafx for troubleshooting information.Unsigned jar works perfectly but has security and permission issues when using classes.
This was working in beta 45Can you post an example project that demonstrates the problem? There were changes to the ant tasks and netbeans support around B45 that could cause problems depending on which version of the SDK and NetBeans you have. Similarly, if you wrote ant scripts prior to B44 and then use them with a later build you could have problems. And of course, if you're producing the Jar file and deployment artifacts without using the provided ant tasks (for example, using the normal ant jar task) you'll have problems.
I've verified that this works as expected in the FX 2.0 GA release using ant from the command line, and with the NetBeans 7.1 beta release using the FX 2.0 GA release. -
Problem with signing in to folio builder, indesign.
I have created an app that I would like to publish, but I can not sign in via the folio builder. I have done this many times before, but today I only get the grey weel when I try to sign in. Im am stuck an can not publish my app. How can I get this to work?
Hi Christophe
Yes, I can log into the account on digitalpublishing.acrobat.com with out
any problems.
No, it does not work to delete the OOBE folder. I have tried that twice. I
am rather sad about this. Don't know what to do
2014-11-28 11:21 GMT+01:00 Christophe_Jossic <[email protected]>:
Problem with signing in to folio builder, indesign. created by
Christophe_Jossic <https://forums.adobe.com/people/Christophe_Jossic> in *Digital
Publishing Suite* - View the full discussion
<https://forums.adobe.com/message/6968931#6968931> -
Problem with sign in Skype.
Hey, just have a problem with signing into my Skype account.
When I try to sign in, its works for 10 seconds and after that signed out automatically (with message: You have been signed out). I tried to reinstall it and restart laptop, but nothing changed. Also changed password via skype official site...nothing(
What else can I do, to make it works?
Mac OS version 10.9.4 and skype version Version 6.19 (450).
Thanks in advance)This is the Resolution for this issue:
1. End all the Skype process from Task manager
2. Delete the Skype folder from %appdata% and %temp%
3. Go to Program Data> Run> type C:\programData
4. Delete the Skype folder from Program Data.
5. Re-launch skype and try again.
If one of my replies has adequately addressed your issue, please click on the “Accept as Solution” button. If you found a post useful then please "Give Kudos" at the bottom of my post, so that this information can benefit others. -
Hi my name Abukar I had an old apple ID and I had problem with signing it so I decided to make a new apple ID with a new email address, so how can I link with two apple IDs and how can I get back all my previous apps that I purchased before, I cloud stuff
It is not possible to do that.
Allan -
Security problem with Google Recaptcha plugin
Hi all,
Found a security problem with Google Recaptcha plugin. If I delete the tag containing the recaptch(on some page) with Firebug, I can authorize myself without validating with Recaptcha. If someone knows how to fix this problem, I'll be be very thankful.
Thanks in advance,
Regards IvanHi Ivan,
you can secure it by adding an "Item specified is NOT NULL" validation to your page.
Will update the documentation and try to add a permanent fix in a new version of the plug-in.
Thanks for letting us know!
Patrick
My Blog: http://www.inside-oracle-apex.com
APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf -
I seem to be having security problems with my iPhone4, it seems like someone has hacked into my hotmail, facebook and university accounts (which all have different passwords) and proceed to change my passwords on me. This has happened twice and I have not left my phone unattended at any time that I can recall nor have I accessed these accounts from another source (i.e. computer/laptop) since changing my passwords after the first hacking occurred. Please help.
Anyone else at your university complaining about the same thing? It is more likely someone is stealing passwords by sniffing traffic over the university wifi or with a man-in-the-middle attack or by other means external to your phone. Try a Google search on "steal password" (without quotes) or "steal SSL password" and you'll learn more than you wanted to know about how passwords get stolen.
Some related info:
http://en.wikipedia.org/wiki/Session_hijacking
http://en.wikipedia.org/wiki/Man-in-the-middle_attack -
Changes in security from 7 update 45 to 7 update 51 and problems with Java applet
Hello,
After the update (from 7 update 45) to version 7 update 51 we've gotten some problems with a Java Applet as it won't run.
When changing security settings to "medium" it works, but it would not run under the default "high" setting. This lead me to update the manifest file as follows:
Manifest-Version: 1.0
Trusted-Only: true
Application-Name: MyApplet
Permissions: all-permissions
Caller-Allowable-Codebase: www.MySite.com
In addition to this, I added the <param> tag in the HTML page.
<applet name="MyApplet" code="MyApplet" archive="MyApplet.jar">
<param name="permissions" value="all-permissions" />
</applet>
The applet is digitally signed with a certificated issued by Verisign.
It now runs on my system. But I noticed that it also runs if I switch the security setting back to "high", which doesn't make any sense to me.
I've tried another computer and to the same thing there. Would not run. I switched to "medium" and and the applet worked. Switched back to "high" and it still works.
I've tried this in both Google Chorme and Internet Explorer 11.
On a third computer it won't run at all, getting a different error message than on the other two, but still related to permissions/security.
The console log message is:
"liveconnect: Security Exception: JavaScript from http://MySite.comn/MyPage.html attempted to access a resource it has no rights to."
Any ideas what I'm missing or what I need to change to get this beast to run everywhere.I tried changing the Caller-Allowable-Codebase to not include "www." and it started giving the the same error message as for the third machine in the test.
So, I changed Caller-Allowable-Codebase to "*" which made it work on all machines.
I don't quite understand why it acts differently on different machines, if it's ok with www.MySite.com on one of the the machines, it should be OK on all no?
I don't see a problem with letting it be "*" but it would be nice to understand what's going on. -
Problem in Signed Applet while communicating with Javascript
Hi,
Im facing a problem with applet. Applet calls JavaScript methods and vice versa. Applet works fine with JRE 5 to JRE 6 up to build no 1.6.0._7 but it fails with build no 1.6.0_10.
The problem description is given below:
After embedding applet in my HTML page using <OBJECT> tag, Ive to check either any problem during applets execution, I want to get the error reason by calling my defined method getErrorReason() in applet that returns the error reason, I call the getErrorReason() against the applets object in JavaScript immediately after embed applet code in my HTML page, a JavaScript errors occurs and my applet fails to perform its execution.
JavaScript error: Object does not support this property.
The error points to the HTML page area where Im calling getErrorReason() against applet object.
The above JavaScript error occurs after the successful completion of Applets init(). Im facing this problem only in JRE 6 build 1.6.0_10-b33.
Please suggest me any solution.
Thanks in advance.
Regards,
Israr AhmedWe are using the HttpURLConnection. If I have to go down the stack to the Socket object, well I guess I have to re event the wheel so to speak.
I have tried both Connection: close and Connection: Keep-Alive. Not at the same time :) but in different intrim releases of test applet.
// Here is the current incarnation of how I am trying to connect.
URL url = new URL(sURL);
trace("attempting to connect to URL: " + sURL, DEBUG);
connection = (HttpURLConnection)url.openConnection();
connection.setDoOutput(true);
connection.setDoInput( true );
connection.setRequestMethod("POST");
connection.setUseCaches( false );
connection.setInstanceFollowRedirects( true );
connection.setAllowUserInteraction( false );
connection.setRequestProperty("Pragma", "no-cache");
connection.setRequestProperty("Expires", "-1");
connection.setRequestProperty("Connection", "Keep-Alive");
connection.connect();
// Now I write our form POST data and flush and close the output stream.
BufferedOutputStream bos = new BufferedOutputStream(connection.getOutputStream());
bos.write(sForm.getBytes());
bos.flush();
bos.close();
// Get the input and read
bis = new BufferedInputStream(connection.getInputStream());
trace( "reading input stream for action: " + sAction );
byte[] responseBuffer = new byte[4096];
int bytesRead = 0;
while( (bytesRead = bis.read( responseBuffer, 0, responseBuffer.length )) != -1 )
sbResponse.append( new String( responseBuffer, 0, bytesRead ));
totalBytesRead += bytesRead;
catch (Throwable e)
e.printStackTrace();
try
m_connections.remove( sAction );
connection.disconnect();
catch ( Throwable t ) {}
finally
if ( bis != null )
try
bis.close();
catch( Throwable t ) {}
With the above code in place what I am now seeing, as opposed to a premature EOF exception, is blocking behavior on the read. -
NT security problems with file I/O
I have 2 problems with file I/O. When I read from a file I use the getAbsolutePath() method that is part of the File class to find what directory the files are currenlty. The problem is that the returned path says that the file is on the desktop no matter what directory the file really is in. The second problem is that I am unable to save files anywhere but the desktop. I must run the class files from the desktop too to get it to work.
I am using NT 4.0 for development. I'm guessing that these problems might be NT security related. Could someone help me?
Code below:
import java.awt.*;
import java.applet.*;
import java.net.*;
import java.io.File;
import java.awt.event.*;
//import java.security.*;
//import sun.security.*;
//import java.awt.Window;
//import com.ms.security.*;
public class Edit extends Applet implements ActionListener, ItemListener
String Gselect;
reader readit;
int mhz, khz;
TextField textField1;
String freq = "000.000";
String data;
Choice freqC;
Button ActivateB, SaveB, /*CancelB, HelpB,*/ DeleteB;
Checkbox SetC;
int NotUsedReply[] = new int[200];
int HwListReply[] = new int[200];
public void init()
readit = new reader();
String myFile="satellite.st1";
// myFile = myFile.concat(Gselect);
File satellite = new File(myFile);
textField1 = new TextField();
textField1.setText( "(void) " );
add( textField1 );
SetC = new Checkbox("TRAP-RX");
add(SetC);
SetC.addItemListener(this);
freqC = new Choice();
freqC.setSize(20,50);
freqC.add("000.000");
add(freqC);
freqC.addItemListener(this);
ActivateB = new Button("Activate");
add(ActivateB);
ActivateB.addActionListener(this);
SaveB = new Button("Save");
add(SaveB);
SaveB.addActionListener(this);
DeleteB = new Button("Delete");
add(DeleteB);
DeleteB.addActionListener(this);
/*CancelB = new Button("Cancel");
add(CancelB);
CancelB.addActionListener(this);
HelpB = new Button("Help");
add(HelpB);
HelpB.addActionListener(this);*/
//textField1.setText( data );
for(int a = 1; a < 9; a++)
data = readit.getData(satellite.getAbsolutePath(), a);//("E:\\forte4j\\system\\Projects\\Zebra\\satellite.st1", a);
freqC.addItem(data);
textField1.setText(satellite.getAbsolutePath() );
public void paint(Graphics g)
//g.drawString("Radio Setup Files",20, 20);
//g.drawString(getParameter("wse"),20, 20);
public void actionPerformed(ActionEvent event)
if(event.getSource() == ActivateB)
activator();
if(event.getSource() == SaveB)
/*if(event.getSource() == CancelB)
stop();
if(event.getSource() == HelpB)
if(event.getSource() == DeleteB)
public void itemStateChanged(ItemEvent e)
if(e.getItemSelectable() == SetC)
textField1.setText("Check box 1 clicked!");
if(e.getItemSelectable() == freqC)
freq = ((Choice)e.getItemSelectable()).getSelectedItem();
public void activator()
makeMHZ();
makeKHZ();
if(mhz > 254)
int StartLink[]={0x0c,0x01,0x07,0x00,0x00,0x00,0x00,0x00,0x00}; //New Link Proc Start
int TrapConfig[]={0x25,0x80,0x00,0x00,0x00,0xb7,0x00,0x0c,0x0b, //TRAP Configuration
0x00,0x00,0x00,0xff,0xa0,0xff,0x0d,0xff,0xe8,
0xff,0x0d,0xff,0x00,0xff,0x15,0xff,0xb0,0xff,
0xff,0xff,0x94,0x0a,0x01,0x06,0x1a,0x00,0x0d,
0x2d,0x21};
TrapConfig[11]=(mhz-255);
TrapConfig[12]=(khz/5);
int SetUserOutput[]={0x41,0x42,0x49,0x54,0x52,0x41,0x50,0x20,0x34, //Sets User Output Format
0x35,0x34,0x35,0x30,0x30,0x2e,0x30,0x4e,0x30,
0x38,0x32,0x34,0x35,0x30,0x30,0x2e,0x30,0x57,
0x30,0x31,0x30,0x30,0x2e,0x30,0x30,0x4b,0x4d,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00};
sendget CmdFunc;
CmdFunc=new sendget();
try
//PolicyEngine.assertPermission(PermissionID.SYSTEM);
Socket h = new Socket("192.9.200.155",9000);
Socket s = new Socket("192.9.200.155",9001);
Socket t = new Socket("192.9.200.155",9002);
int j;
CmdFunc.SendCmd(h,0,0x01,null);
CmdFunc.GetCmd(h,HwListReply);
CmdFunc.SendCmd(s,9,0x1e,StartLink); //New Link Proc Start
CmdFunc.GetCmd(s,NotUsedReply);
CmdFunc.SendCmd(s,37,0x00,TrapConfig); //TRAP Configuration
CmdFunc.GetCmd(s,NotUsedReply);
CmdFunc.SendCmd(s,155,0x03,SetUserOutput);//Sets User Output Format
CmdFunc.GetCmd(s,NotUsedReply);
catch(Exception e){}
else
textField1.setText( "000.000 is the null choice. Try another." );
public void receiveText1( String select )
Gselect=select;
public void makeMHZ()
String y = freqC.getSelectedItem();
y = y.substring(0,3);
mhz = Integer.parseInt(y);
//textField1.setText( y );
public void makeKHZ()
String y = freqC.getSelectedItem();
y = y.substring(4,7);
khz = Integer.parseInt(y);
//textField1.setText( y );
import java.awt.*;
import java.applet.*;
import java.io.RandomAccessFile;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.LineNumberReader;
import java.awt.event.*;
import com.ms.security.*;
import netscape.security.*;
import netscape.util.*;
public class saver extends Applet implements ActionListener
String nameS = "Data.txt";
String dataS = "Default Data";
Button saveB;
public void init()
saveB = new Button("SaveFile");
add(saveB);
saveB.addActionListener(this);
public void actionPerformed(ActionEvent event)
if(event.getSource() == saveB)
RandomAccessFile RAF;
byte array0[] = dataS.getBytes();
try
if (Class.forName("com.ms.security.PolicyEngine") != null)
PolicyEngine.assertPermission(PermissionID.SYSTEM);
if(Class.forName("netscape.security.PrivilegeManager") != null)
netscape.security.PrivilegeManager.enablePrivilege("UniversalFileWrite");
catch (Throwable cnfe)
try
RAF = new RandomAccessFile(nameS, "rw");
// RAF.writeUTF(dataS);
RAF.write(dataS.getBytes());
RAF.close();
catch(Exception e)
public void receiveND(String name, String data)
if(name != null)
nameS = name;
dataS=data;
import java.io.RandomAccessFile;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.LineNumberReader;
//import java.security.*;
import com.ms.security.*;
import netscape.security.*;
import netscape.util.*;
public class reader
//Signature sig;
public String getData(String filename, int pass)
//String nameS = "Data.txt";
String dataS = "Default Data Sucks";
String comma = ",";
int get = pass, count=0, top=0, bottom=0;
char[] work;
try
if (Class.forName("com.ms.security.PolicyEngine") != null)
PolicyEngine.assertPermission(PermissionID.SYSTEM);
if(Class.forName("netscape.security.PrivilegeManager") != null)
netscape.security.PrivilegeManager.enablePrivilege("UniversalFileRead");
catch (Throwable cnfe)
try
//sig.sign();
//nameS = filename;
RandomAccessFile RAF = new RandomAccessFile(filename, "r");
// dataS = RAF.readUTF();
dataS = RAF.readLine();
RAF.close();
catch(Exception e)
return e.toString();
work = dataS.toCharArray();
for(int i = 0; i < dataS.length(); i++)
if( work[i] == ',' )
count++;
if(get == count)
bottom = i + 1;
if( (work[i] == ',') && (count > get) && (top == 0) )
top = i;
dataS = dataS.substring(bottom,top);
return dataS;
}import java.awt.*;
import java.applet.*;
import java.net.*;
import java.io.File;
import java.awt.event.*;
//import java.security.*;
//import sun.security.*;
//import java.awt.Window;
//import com.ms.security.*;
public class Edit extends Applet implements ActionListener, ItemListener
String Gselect;
reader readit;
int mhz, khz;
TextField textField1;
String freq = "000.000";
String data;
Choice freqC;
Button ActivateB, SaveB, /*CancelB, HelpB,*/ DeleteB;
Checkbox SetC;
int NotUsedReply[] = new int[200];
int HwListReply[] = new int[200];
public void init()
readit = new reader();
String myFile="satellite.st1";
// myFile = myFile.concat(Gselect);
File satellite = new File(myFile);
textField1 = new TextField();
textField1.setText( "(void) " );
add( textField1 );
SetC = new Checkbox("TRAP-RX");
add(SetC);
SetC.addItemListener(this);
freqC = new Choice();
freqC.setSize(20,50);
freqC.add("000.000");
add(freqC);
freqC.addItemListener(this);
ActivateB = new Button("Activate");
add(ActivateB);
ActivateB.addActionListener(this);
SaveB = new Button("Save");
add(SaveB);
SaveB.addActionListener(this);
DeleteB = new Button("Delete");
add(DeleteB);
DeleteB.addActionListener(this);
/*CancelB = new Button("Cancel");
add(CancelB);
CancelB.addActionListener(this);
HelpB = new Button("Help");
add(HelpB);
HelpB.addActionListener(this);*/
//textField1.setText( data );
for(int a = 1; a < 9; a++)
data = readit.getData(satellite.getAbsolutePath(), a);//("E:\\forte4j\\system\\Projects\\Zebra\\satellite.st1", a);
freqC.addItem(data);
textField1.setText(satellite.getAbsolutePath() );
public void paint(Graphics g)
//g.drawString("Radio Setup Files",20, 20);
//g.drawString(getParameter("wse"),20, 20);
public void actionPerformed(ActionEvent event)
if(event.getSource() == ActivateB)
activator();
if(event.getSource() == SaveB)
/*if(event.getSource() == CancelB)
stop();
if(event.getSource() == HelpB)
if(event.getSource() == DeleteB)
public void itemStateChanged(ItemEvent e)
if(e.getItemSelectable() == SetC)
textField1.setText("Check box 1 clicked!");
if(e.getItemSelectable() == freqC)
freq = ((Choice)e.getItemSelectable()).getSelectedItem();
public void activator()
makeMHZ();
makeKHZ();
if(mhz > 254)
int StartLink[]={0x0c,0x01,0x07,0x00,0x00,0x00,0x00,0x00,0x00}; //New Link Proc Start
int TrapConfig[]={0x25,0x80,0x00,0x00,0x00,0xb7,0x00,0x0c,0x0b, //TRAP Configuration
0x00,0x00,0x00,0xff,0xa0,0xff,0x0d,0xff,0xe8,
0xff,0x0d,0xff,0x00,0xff,0x15,0xff,0xb0,0xff,
0xff,0xff,0x94,0x0a,0x01,0x06,0x1a,0x00,0x0d,
0x2d,0x21};
TrapConfig[11]=(mhz-255);
TrapConfig[12]=(khz/5);
int SetUserOutput[]={0x41,0x42,0x49,0x54,0x52,0x41,0x50,0x20,0x34, //Sets User Output Format
0x35,0x34,0x35,0x30,0x30,0x2e,0x30,0x4e,0x30,
0x38,0x32,0x34,0x35,0x30,0x30,0x2e,0x30,0x57,
0x30,0x31,0x30,0x30,0x2e,0x30,0x30,0x4b,0x4d,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00};
sendget CmdFunc;
CmdFunc=new sendget();
try
//PolicyEngine.assertPermission(PermissionID.SYSTEM);
Socket h = new Socket("192.9.200.155",9000);
Socket s = new Socket("192.9.200.155",9001);
Socket t = new Socket("192.9.200.155",9002);
int j;
CmdFunc.SendCmd(h,0,0x01,null);
CmdFunc.GetCmd(h,HwListReply);
CmdFunc.SendCmd(s,9,0x1e,StartLink); //New Link Proc Start
CmdFunc.GetCmd(s,NotUsedReply);
CmdFunc.SendCmd(s,37,0x00,TrapConfig); //TRAP Configuration
CmdFunc.GetCmd(s,NotUsedReply);
CmdFunc.SendCmd(s,155,0x03,SetUserOutput);//Sets User Output Format
CmdFunc.GetCmd(s,NotUsedReply);
catch(Exception e){}
else
textField1.setText( "000.000 is the null choice. Try another." );
public void receiveText1( String select )
Gselect=select;
public void makeMHZ()
String y = freqC.getSelectedItem();
y = y.substring(0,3);
mhz = Integer.parseInt(y);
//textField1.setText( y );
public void makeKHZ()
String y = freqC.getSelectedItem();
y = y.substring(4,7);
khz = Integer.parseInt(y);
//textField1.setText( y );
import java.awt.*;
import java.applet.*;
import java.io.RandomAccessFile;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.LineNumberReader;
import java.awt.event.*;
import com.ms.security.*;
import netscape.security.*;
import netscape.util.*;
public class saver extends Applet implements ActionListener
String nameS = "Data.txt";
String dataS = "Default Data";
Button saveB;
public void init()
saveB = new Button("SaveFile");
add(saveB);
saveB.addActionListener(this);
public void actionPerformed(ActionEvent event)
if(event.getSource() == saveB)
RandomAccessFile RAF;
byte array0[] = dataS.getBytes();
try
if (Class.forName("com.ms.security.PolicyEngine") != null)
PolicyEngine.assertPermission(PermissionID.SYSTEM);
if(Class.forName("netscape.security.PrivilegeManager") != null)
netscape.security.PrivilegeManager.enablePrivilege("UniversalFileWrite");
catch (Throwable cnfe)
try
RAF = new RandomAccessFile(nameS, "rw");
// RAF.writeUTF(dataS);
RAF.write(dataS.getBytes());
RAF.close();
catch(Exception e)
public void receiveND(String name, String data)
if(name != null)
nameS = name;
dataS=data;
import java.io.RandomAccessFile;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.LineNumberReader;
//import java.security.*;
import com.ms.security.*;
import netscape.security.*;
import netscape.util.*;
public class reader
//Signature sig;
public String getData(String filename, int pass)
//String nameS = "Data.txt";
String dataS = "Default Data Sucks";
String comma = ",";
int get = pass, count=0, top=0, bottom=0;
char[] work;
try
if (Class.forName("com.ms.security.PolicyEngine") != null)
PolicyEngine.assertPermission(PermissionID.SYSTEM);
if(Class.forName("netscape.security.PrivilegeManager") != null)
netscape.security.PrivilegeManager.enablePrivilege("UniversalFileRead");
catch (Throwable cnfe)
try
//sig.sign();
//nameS = filename;
RandomAccessFile RAF = new RandomAccessFile(filename, "r");
// dataS = RAF.readUTF();
dataS = RAF.readLine();
RAF.close();
catch(Exception e)
return e.toString();
work = dataS.toCharArray();
for(int i = 0; i < dataS.length(); i++)
if( work == ',' )
count++;
if(get == count)
bottom = i + 1;
if( (work == ',') && (count > get) && (top == 0) )
top = i;
dataS = dataS.substring(bottom,top);
return dataS;
Maybe you are looking for
-
How to use post method in j2me
I used post method and when im about to receive the response from the servelt i get the output like str=<html><head><title>Apache Tomcat/4.1.24 - Error report</title><STYLE><!--H1{font-family : sans-serif,Arial,Tahoma;color : white;background-color :
-
Xperia Z - Error Ocurred During Tethering
I can't get tethering working, when I turn it on i get a message 'an error occurred during tethering' i can still connect my laptop to the phone's wifi hotspot but only get local access..I am on Ornage UKYes they support tetheringYes mobile data is s
-
Hi I have a input ready query in the web template when the width of the column increases based on the lenght of the input cell. Is there an option to freeze the size of the column to always have the same width. Thanks Rashmi.
-
JDI-CMS track with single system
We installed the JDI sp13 on our J2EE Engine 640 development system. We are goingto configure it (all the components DTR, CBS, CMS) in order to start a project developmentò. We will export the developments using .sca files, and we will move them on a
-
HT201302 Transfer FOLDERS of photos from ipad to macbook pro.
Hello, I have spent hours creating folders of photos on my ipad. Now I want to transfer these folders of photos from my ipad to my macbook pro. However, it seems that my macbook pro will only transfer the photos (as individual photos) from my ipad, B