Forum Stats

  • 3,828,056 Users
  • 2,260,853 Discussions
  • 7,897,440 Comments

Discussions

Hiding my jars of applet

Narayan
Narayan Member Posts: 310
edited Feb 6, 2011 8:48AM in Java Programming
Hello Can anybody tell me how can I hide my jar,lib jars or How could I load my applet without giving fully qualified jar destination.Whenever I make applet every user could easily access and download my jar but as I saw of big vendors like Opera, they usually hides their applet's jar files Could any body tell me how can it be done! Alternative ways will be appreciated

Thanks.
Narayan
Tagged:

Answers

  • 793415
    793415 Member Posts: 7,279 Bronze Badge
    If a JRE can get your Jars, so can an end user.

    If you don't want people to have your Jars, don't upload them to the net.
    ..I saw of big vendors like Opera, they usually hides their applet's jar files..
    Really? Give us an URL for a web page with an applet that has these supposedly 'hidden' Jars.
  • Narayan
    Narayan Member Posts: 310
    Andrew Thompson wrote:
    If a JRE can get your Jars, so can an end user.

    If you don't want people to have your Jars, don't upload them to the net.
    ..I saw of big vendors like Opera, they usually hides their applet's jar files..
    Really? Give us an URL for a web page with an applet that has these supposedly 'hidden' Jars.
    Hello Andrew,

    Oh ya i've got it's jar files . The url was http://www.opera.com/mobile/demo/ actually the jar files are located on other side and called via javascript.But still i feel dange because I've listened that java decompiler can easily open our jar files and codes too is that true??

    Thanks.
  • Kayaman
    Kayaman Member Posts: 3,844 Silver Trophy
    Narayan wrote:
    But still i feel dange because I've listened that java decompiler can easily open our jar files and codes too is that true??
    You can decompile the class files in the jars yes.

    Do you think it's a real danger that someone will do that to your applets? Is there confidential data inside those applets? Do you think your applets are so amazing that someone will want to steal your code for them?
  • Narayan
    Narayan Member Posts: 310
    Ya I know but actually the problem was I could connect to my server database with my db user and pass all on hard coded Java. and whenever I see the jar by decompiling ,it gives me the right user and pass of my database. Can I get rid of this issue?

    Thanks
  • Kayaman
    Kayaman Member Posts: 3,844 Silver Trophy
    Narayan wrote:
    Ya I know but actually the problem was I could connect to my server database with my db user and pass all on hard coded Java. and whenever I see the jar by decompiling ,it gives me the right user and pass of my database. Can I get rid of this issue?
    That's why applets never connect directly to a database. If an applet needs to use a database, the standard way is to have an applet send requests to a servlet, which handles the actual data fetching. This way the server exposes a small public API, which
    should be designed so it doesn't provide too obvious security issues (like allowing the client to delete a user just based on the user ID).
  • Narayan
    Narayan Member Posts: 310
    Ok now I've known so good stuffs. Thanks for reply. And do I need to do same thing on Java Desktop Application too.?? I mean software-> database connection only via Servlet(server programming) !
  • Kayaman
    Kayaman Member Posts: 3,844 Silver Trophy
    Narayan wrote:
    Ok now I've known so good stuffs. Thanks for reply. And do I need to do same thing on Java Desktop Application too.?? I mean software-> database connection only via Servlet(server programming) !
    If the server is on a different computer and accessible to public, then yes, you might need to.
This discussion has been closed.