×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    35

    can we get the source file from jar file..

    Hello,

    I have one doubt about the un zip operation of jar file.When we run the jad and jar file(using Nokia wireless toolkit or Sony Ericsson tool kit .. and give directly the path of jar and jad file from desktop or some other place .. ) it creates a project folder and inside of project we get src,bin,class,res folder .Inside of res folder we can get images which are used in that project.But we didn't get the source folder instead of that we get class file in class folder.What my doubt is how can we decompress the byte(class) file into java file..? and is this possible..? can we get the source file only from jar file..?
    Because my friend told that it is possible to get the source file from jar file..
    But I am not sure about that..Please clarify this issues.

  2. #2
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,430

    Re: can we get the source file from jar file..

    Yep! you could generate the .java file from a class file with the help of a Decompiler. What you have to do is extract the class files from the .Jar and open with a decompiler.

    Regards
    Gopal

  3. #3
    Nokia Developer Champion
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,545

    Re: can we get the source file from jar file..

    You can never get the original source code from the .jar file (from .class files), but there are bytecode decompilers that can get you something resembling the source code (more or less & usually much less).

    Especially, if the code was run through an obfuscator before it was compiled, then it will still be very hard to figure out (and will be even further away from original sources than with after a straight compilation/decompilation).

  4. #4
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,430

    Re: can we get the source file from jar file..

    Im.... really...you could generate the Java file from a class file. But never expect the original java code after decompilation.

    Regards
    Gopal

  5. #5
    Nokia Developer Champion
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,545

    Re: can we get the source file from jar file..

    That's what I think I said; there are bytecode decompilers that can get a .java file from a .class file, but the result - while being Java source code - won't be the original source code (and if an obfuscator was used on the original before it was compiled, it will be even further from the original).

  6. #6
    Registered User
    Join Date
    Dec 2005
    Posts
    3

    Talking Re: can we get the source file from jar file..

    But by this way you CAN get source code and after fixing errorrs recompile app again

    By decompilation, for example, i successfully porting BubbleSmile from Samsung (128*128) to Siemens (132*176) and some more games from Nokia, Siemens with screen resizing, sound adopting and etc.

  7. #7
    Nokia Developer Champion
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,545

    Re: can we get the source file from jar file..

    Sigh. I though that's what's been explained here a few times already, HidePerso. You can, indeed, convert/decompile .class files to .java source code, but it won't be the original source code.

Similar Threads

  1. Can't include png file into jar file when create MIDlet suite
    By hi_sailom in forum Mobile Java Tools & SDKs
    Replies: 7
    Last Post: 2008-08-01, 04:07
  2. Tips on using NDS 1.1
    By mitts in forum Symbian Tools & SDKs
    Replies: 7
    Last Post: 2006-01-18, 16:07
  3. Start Midlet from other JAR file
    By heuven in forum Mobile Java General
    Replies: 1
    Last Post: 2005-07-27, 13:26
  4. What happens to a JAR file?
    By mrmop in forum Mobile Java General
    Replies: 2
    Last Post: 2004-01-05, 17:30
  5. Regarding .mgb file
    By anilm_tata in forum Symbian Tools & SDKs
    Replies: 0
    Last Post: 2002-12-26, 06:50

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •