• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Modifying Existing App w/o src

 
Greenhorn
Posts: 24
Eclipse IDE Python C++
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My colleagues at work use an app written in Java. They'd like it modified in various ways - to show yellow lines here, some extra image processing there, respond to some mouse events that are currently ignored, etc. All we have are .jar files, no source. I asked the software provider, but they said nothing about source.

Is it a reasonable idea take on this project, or should i join the next cattle drive out of town? How would i go about modifying this app? Is it possible to modify a .jar, or is that something extreme no sane person would consider? A bytecode disassembler? Figure out the interface to a class and write my own replacement .jar files?

I'm many years experienced at programming in C++, assembly, raw binary blinking LEDs, expert at number crunching, graphics programming and all, and don't mind digging around at a low level. But i'm no expert at Java yet, need a cheat sheet to write HelloWorld ;-)

BTW, i love this site! Great design, well organized, a pleasure to visit.
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you can get source from the vendor, that is definitely the way to go. It is also the best way to avoid complications, such as law suits. Or discontinuation of any support.

If you can't, you can get a decompiler to generate source code from byte codes, but... obfuscation is a possibility too. The vendor could have used an obfuscator on the bytecode to make it decompile to a mess -- assuming that it even works.

Henry
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It also may be possible to make the changes without modifying the source at all, but rather just replacing one or more of their classes with your own and/or adding classes.

For example, you can subclass existing classes and add behavior, or you can add event listeners onto existing GUI components. You can even use "bytecode engineering" to add behavior or modify existing behavior on the fly, either directly, or indirectly through the use of Aspect-Oriented Programming (AOP).

Doing any of these will take a certain amount of reverse engineering, and you may need to use a combination of techniques. But the decompile-modify-recompile angle is only one possibility, and not even necessarily the best one.

Now, you've posted this in the "Beginner's" forum, and say you're not a Java expert; unfortunately, I'm talking about some stuff that, while not necessarily advanced, required a good grasp of the lay of Java-land. Of course, we're always here to help.
 
Daren Wilson
Greenhorn
Posts: 24
Eclipse IDE Python C++
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The software in question is freely available. It's used by scientists working with the Spitzer space telescope. It just needs a couple enhancements...

The idea of replacing a few chosen classes with my own might be the way to go. I might need to see a good example of how to do that in general. Reverse engineering is one of my better skills, and i've not dug into the workings of java very far yet, so this will be fun.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic