How to protect my jar file from being downloaded

How can i protect my jar file from being downloaded by users by accessing it through the web site.
Now everybody can just type the url www.mysite.com/applets/myApplet.jar
And download it to his computer.
I realize that anybody who really wants to download it he will get it anyway, but I want to make it harder.
thanks in advance

Your browser has to download the jar file if it's going to run the applet. That's applets work. The browser downloads the classes and then runs them locally.
I suppose if you wanted to make something to make it difficult for users to explicitly download the jar, you could set some kind of permission flag when the HTML is page is rendered, and then unset it some amount of time (10 seconds?) later, and then only let the user download the jar when the flag is set. But this would be fragile and irritating and unhelpful. It would probably break more than you'd like and not prevent download very much (it wouldn't take long to figure out what was happening), and besides nobody is ever going to try to steal your code.

Similar Messages

  • How to keep my jar file from being downloaded?

    hi,
    problem:
    i turned a java app into an applet, put it on yahoo's server and was able to view the applet in a browser. but the html source tells where the applet's jar file is and so a user can download it. to prevent this, i put the jar file into a password protected folder. but this requires the user to enter a password before the applet is displayed.
    question:
    how can i use the jar file without protecting it with a password and keep it from being viewed or downloaded?
    this is a learning experience, the jar file simply prints the current time.

    If you want a client to run anything at all, it needs to be public. If people can't download it, their browsers can't as well.
    All you can do is run your code through an obfuscator to somewhat protect it from being copied.

  • Protecting the jar files from being web access

    I have a jnlp file which is put under tomcat webapps folder, say (\webapps\TEST\launch.jnlp), with the jar and lib files put in the subfolder (\webapps\TEST\folder1\*.jar AND \webapps\TEST\folder1\lib\*.jar).
    My question is how can i prevent user from direct access to the jar files via typing http://www.someip.com/TEST/folder1/main.jar ? I tried the following methods but it seemed not working:
    1. Change the folder permisson in \webapps\TEST\*.*, but when user type the above hyperlink they can still get the jar file
    2. put the jar and related files under \WEB-INF\, but now this time running the launch.jnlp, it returns an error saying that it can't access/find the WEB-INF.
    Is there any method? Or should I say, when you published jnlp to web, the related jar files are forced to be accessed by everyone.

    Sounds easy to me: encrypt your xml, then instead of just storing your key as plain bytes do some reversable operations on it (xor masks, reversions, whatever you like), just do them in many different points (and classes) of your code, have some parts done by methods that actually check application is running under JWS with proper codebase, scramble it all, and suddently the whole stealing operation won't be worth the effort. Obviously you should have many private (and package protected) methods, seal packages and so on. Maybe, somehow, you can even use reflection to identify calling classes (not sure, never looked for anything similar).
    What else? write down some c++ code into your own dll/JNI library and make it do something too, so they'll even need to decompile the dll. If you know first execution is always online you can send another xor key and store it with persistence service or write it down to windows registry. You can keep making it harder as much as you like, even just with silly code like
    Math.ceil((new GregorianCalendar.getField(Calendar.YEAR)%2000)/1000)*((int)('c'-'a'))just to retrieve the number 2. If you distribute such code through many lines and methods, once you scramble it, most people will give up.
    Bye.

  • Protecting your jar file from been extracted

    Please i noticed that the java jar file of a software can easily be extracted to review the class files with winrar which allows just anyone to have access to your class file and decompile to get source codes, allowing pirating of the software. How can I lock the jar file to prevent extraction of my class files.

    1. why are you mocking others instead of answering the question ? some one wants to protect his jar file. the solution is simple.
    2. you can use google to search, here is result :
    http://stackoverflow.com/questions/1280702/protecting-java-jar-files-for-distribution
    http://stackoverflow.com/questions/9633455/how-to-protect-a-jar-file-from-being-decompiled
    http://www.thegeekstuff.com/2008/06/protect-your-java-code-from-reverse-engineering/
    http://answers.google.com/answers/threadview/id/431511.html
    http://stackoverflow.com/questions/1879061/how-to-protect-java-codes-against-decompiler
    http://viralpatel.net/blogs/2009/07/protect-java-code-decompilation-using-java-obfuscator.html
    http://www.coderanch.com/t/430716/java/java/Protect-class-file-not-decompile
    http://stackoverflow.com/questions/7324708/are-jar-file-insecure-what-can-done-apart-from-code-obfuscation
    http://stackoverflow.com/questions/3647255/how-do-i-copy-protect-my-java-application
    http://www.javaworld.com/javaworld/javatips/jw-javatip22.html
    http://stackoverflow.com/questions/12088/do-you-obfuscate-your-commercial-java-code
    3. it is true if you can use basic methods that EJP mentioned, there would be no need for obfuscators, nor native library use.
    but there are many situations that you can't do any of those methods.
    4. EJP claims that he probably is the one "who have had perhaps 40 times as long as you've had to think about it."
    here is the problem that made me use both obfuscation and native library :
    My company released a simple java library that scanned a document (directly from scanner or camera device).
    the documents were exam papers.
    Use some OCR techniques to convert image to text so some other application could calculate the score using it's api.
    For marketing purposes, the company needed to publish a 7-day trial version of this library.
    So, as you can see I'm eager to hear what you want to suggest.

  • How to call a jar file from oracle forms (6i)

    Hi,
    I'm working with oracle 6i. I want to know that how to call a .jar file from forms menu. when I use HOST('<path>\test.jar') it is working in 'Client Server' any way. but the problem is I use application server in order to run my form. so my form is in the server and I run the form via clients web browser. in that case above solution will not work. if any body knows how to overcome this problem please reply.
    thanks.
    duminda

    I created a bean area and set the class name as implementation class. within that java bean class I called to a bat file which consists of the execution command of the jar file ( because i don't know how to call .jar file from my bean class directly).
    then i tried to run it in application server. its still not running.
    can you tell me what i have to do within my bean class? or can you suggest any solution?
    thank you.

  • How to call a .jar file from a java bean?

    any body knows how to call a .jar file from a java bean?

    Crosspost!
    http://forum.java.sun.com/thread.jspa?messageID=4349619

  • How to make a jar file from a java file?

    how to make a jar file from a java file, is there any one tht can help me thank you;

    You can study this.
    http://java.sun.com/docs/books/tutorial/jar/basics/index.html

  • Protecting Java jar files from decompiling.

    Hello,
    I need to distrubute ny Java application, I know there are tools to reengineer the java class file. How to Protect my class files from exploitation.
    Any suggestions.
    Thanks
    Shreenivasa

    1. Write a no-decompile clause into the licence.
    2. Make your product so expensive that no licensee will want anybody else to get one for nothing.
    3. Make your product so inexpensive that it would be simpler to buy it than reverse-engineer it.
    4. Bring out new versions of your product so rapidly or with such amazing new features in each release that the reverse-engineers can't keep up with you.
    5. Make a proper evaluation of the forgone revenue against the cost of all this engineering, that doesn't assume you would have sold a copy to every potential pirate, or that you can actually deter every potential pirate.
    In short it is a business problem. Not a technical problem.

  • I downloaded a movie to my ipad, when synced with computer, the computer is now also downloading the movie. why? and how do i stop the movie from being downloaded again

    i downloaded a movie to my ipad, when synced with computer, the computer is now also downloading the movie. why? and how do i stop the movie from being downloaded again

    Do you not want a backup of the iTunes content on your computer in the event the iPad is lost, stolen, or simply fails?

  • How to Transfer a JAR file from PC to a Java enabbled mobile?

    The project (creation of the JAR file) is developed in our local PC and transfer the JAR file to a mobile using Bluetooth. How to transfer the JAR file to a remote mobile?

    The situation is like this.
    We are transfering the JAR file from the PC to the Mobile using Bluetooth.
    Our J2ME project is already install on Nokia's 6600 and given to the salesman's on the field. Now i have updated my software and i want to upgrade the same on their mobiles. For this i can't call all the 2000 salesman's who are all over the country (India) to my place to get the latest software installed and configure.
    If i have a GPRS like solution for transfering my file from my PC to the remote mobile. I would be better. If you know any this related to this kindly reply me.

  • JNLP and jar files are being download from server again.

    I have a swing application deployed with Java Web Start on a server.
    On my client I install the application using JWS JRE 1.6.
    The issue is that without any change in the jars or JNLP the jars are being downloaded from the server again and again
    This is not consistant - it happens only sometimes.
    One important thing to mention: The server is inside a load-balancer cluster (AKAMAI), so the IP address of the actual server may change between different accesses.
    in the log, I can see the error:
    "Cache entry not found"
    and then the jar is being downloaded again.
    sometimes only one or two jars were downloaded again, sometimes the whole package with the JNLP file were dowloaded again.
    Can you suggest what can be the reason for this behavior?
    Thank you,
    Ran

    That does seem slow, but there are many factors that could be involved. More information would be helpful:
    - Are the source and destination filesystems ZFS or UFS? (or some other FS)
    - What does iostat show you?
    - What does vmstat show you?
    - What type of HBAs connect you to the SAN? ('fcinfo hba-port')
    - Anything in /var/adm/messages?

  • How to protect the .class files from decompilers

    Hi all,
    I have developeed an application and I want it to be protected from the decompilers. The problem that I am facing now is that the .class files can be ripped by using the decompiling softwares.
    It will be great if any body cvan bail me out of this.
    Thanks
    kvmp

    Obfuscating your files is your best bet. This has been discussed to death, both here and on every other Java-related discussion site and newsgroup since about 1996; a Google search on "Java obfuscation" should help.
    You can also look here for an overview:
    http://mindprod.com/jglossobfuscator.html#OBFUSCATOR
    Grant

  • App or podcast downloaded to iphone is deleted from iphone and transferred to iTunes 11.  How can I keep the file from being deleted from the iPhone?

    I recently updated iTunes from version 10.x to 11.  In version 10, I could download a podcast or an app to my iPhone from the app store, then the app or podcast would co COPIED to iTunes during a sync.  Now with version 11, when I sync, the app or podcast is deleted from my iPhone and MOVED to iTunes.  How can I get back the old feature of making a copy?  This is a very dumb thing that happens in iTunes and I can not believe that I am the only one to complain abou this.  Please help me.  What do I need to change in iTunes to keep my copy on the iPhone.
    Thanks to all you geniouses out there!
    Doug

    Not 100% sure of your question.  If you are wanting to delete apps from itunes just right click then delete then empty recycle bin.

  • How to protect the class files inside jar file.

    Hi Group,
    pls help me.
    my need is i created a executable jar file with certain classes.
    and i'm supposed to send it to my client.
    but if the client needs he can extract the class files from the jar and with the
    help of some decompilers he can convert class file to .java source code and read the whole
    stuff.
    how can i protect my jar file from these.
    is there any security mechanism for that
    pls help me.
    Regards,
    Ranjith.M

    In order to protect my jar file I tried the jar signer technology but it only protects the jar from modification so I need to know how to protect jar file from decoding of the contents inside.

  • How Can I protect my swf files from decompiling / saving

    I have navigated through the internet for a long time now but
    could not find the solution to my problem which is "how to protect
    my swf file from decompiling/saving"?
    I know that it CAN BE DONE and here is an example of a file
    on the internet that cannot be saved or decompiled using any
    software that I have come across (ie:SOTHINK decompiler, saveflash)
    http://www.3dinternet.com/video.swf
    Any help? any hints ?
    Thanks
    Hagop

    Hagop,
    > I have navigated through the internet for a long time
    now but
    > could not find the solution to my problem which is "how
    to
    > protect my swf file from decompiling/saving"?
    There is no way to protect your SWF from decompiling. Any
    commercial
    software on the market can be decompiled -- including the
    Flash authoring
    tool and Photoshop, for example -- which is why softare
    generally ships with
    an end user license agreement (EULA) that expects you to
    agree not to
    decompile or reverse engineer your purchase.
    Most Flash content (other than RTMP requests for video, for
    example) are
    HTTP requests, which by nature means the content is
    downloaded to your hard
    drive, just like HTML documents, CSS files, JPGs, and GIFs.
    Your browser
    requests the files, downloads them to your hard drive, then
    displays them
    from your local copy.
    > I know that it CAN BE DONE and here is an example of a
    > file on the internet that cannot be saved or decompiled
    using
    > any software that I have come across
    What you've seen, then, is merely the result of software
    that uses
    unknown (to you or to your sofware) encryption/obfuscation
    algorithms. Keep
    trying, and you'll eventually nail it.
    At best, you can use obfuscators to temporarily deter a
    certain segment
    of the decompiling-inclined population.
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

Maybe you are looking for