Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm looking for a good Java obfuscator.
I've done initial research into the following Java obfuscators: proguard, yguard, retroguard, dasho, allatori, jshrink, smokescreen, jobfuscate, marvin, jbco, jode, javaguard, jarg, joga, cafebabe, donquixote, mwobfu, bbmug, zelix klassmaster, sandmark, jcloak, thicket, blufuscator, and java code protector.
I tried proguard and it has a really nice GUI, seems really stable, and seems to be the most popular, but it seemed to not like some enumeration on a referenced jar file (not within the code I was trying to obfuscate) which was weird. Yguard seems to require some interaction with ant, which I didn't know too much about.
What is a good java obfuscator? It doesn't need to be free, it just needs to work well and be easy to use.
I use ProGuard heavily for all my release builds and I have found it is excellent. I can't recommend it enough!
I have encountered obscure bugs caused by it's optimizations on several occasions and I now disable optimizations across the board - haven't had a problem caused by ProGuard since. Though, to be fair, these were all quite some versions ago - YMMV.
I used to use the GUI only to get a config started, and then I resort to editing the text config myself, which is really very simple to do. These days I do the config by hand.
I have quite complex projects all of which involve dynamic loading and reflection. I also heavily use reflection for a callback implementation. ProGuard has coped with these very well.
EDIT: We also use DashO Pro for one of our products - I looked into it for packaging the products I am responsible for and concluded that it's configuration was too convoluted and complex; also integrating it into the build script seemed like a bit of a pain. But again, to be fair, this was circa 2001... so it might be better in current versions.
A good collection of links to free and commercial tools is given in this arcticle
"Protect Your Java Code - Through Obfuscators And Beyond"
The author also discusses the strong and weak points of bytecode obfuscation
What is the issue with ProGuard ? (which is recommended both by this question and this one).
There is a section of troubleshooting about enumerator, but they seem to be taken into account just fine.
However, Obfuscation breaks some attempts at reflection, even though modern obfuscators can detect and to some extend adjust usages of reflection in the code they're obfuscating.
I used Zelix Klassmaster in a commercial application for several years and found it to be excellent. I threw quite a few resources at the obfuscated code, and was not able to "break" it. It's pricey, but good.
I only stopped using it when my version got old enough that the upgrade cost was significant. My needs had changed and I didn't really need to obfuscate the classes anymore. However, if the need arises again, I'd pay for it and use it in a flash.
Cheers,
-Richard
We are using Zelix Klassmaster for couple years and I can recommend it.
I use and suggest Zelix - 100% - very solid and robust protection
Related
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
And by the right guide, I mean one which doesn't necessarily focus entirely on how to program in Java, but puts forth a bit of effort on everything else. In other words, something which has enough information on the things which IDEs like Eclipse do for you, and how to manage those things without using an IDE.
Some examples of what I'm looking for:
How to import Java files without packaging them first.
How to specify directories for file/package imports, and where that specification needs
to be placed.
How to use Gedit to effectively program in Java with nothing but a few plugins and command line for compilation.
Great compiler error avoidance practices.
Seriously, I've looked enough now to come to the conclusion that Google really can't just hack what I need, and my best bet is an actual resource filled with lots of information.
If anyone has any ideas or thoughts on where I should look, or even an answer to any of these questions specifically, I would greatly appreciate the input.
IMHO you can't effectively program in Java without IDE (especially working on bigger project). You should learn about using/setting CLASSPATH, also check documentation for basic JDK commands (javac, java, jar, javadoc etc.).
Eclipse IDE has support for other important project tools e.g. Ant and Maven (for example with M2Eclipse plugin), so you can learn them too if you want.
Check this question for more lightweight IDE than Eclipse.
Java programming is quite a broad area. You may wish to do web-programming or Swing and there are lots of frameworks and framework combinations to work with.
If you want to be productive there is no way you can survive, especially for large projects, without using one IDE, or maybe even two. You will need a simple JUnit integration, as well as a debugger and automatic code generation for POJO methods, and autocompletion and refactoring capability and you name it.
I think that the best IDE for Swing development is Netbeans7. Matisse is implemented best, stable and fast. You can drag and drop anything you like anywhere and the generated code is always clear and well organized.
Eclipse has a great GWT-Designer. It is also great for Struts2 programming etc. Both work great with Maven and Ant and Hibernate.
If you need three months for a project you can do with an IDE in two weeks, there is no point in not using an IDE. On the other hand there are also masochists between us...
I recommend programming with an editor and the shell only for beginners, until they get the grasp of things and understand layouts, jars etc. Using a graphical tool to get started is wrong, since the students learn to drag and drop components mechanically and relying upon lack to get things straight. Only as soon as one knows how things work, is IDE a one way street. You never look back again. There is amazing free software today.
Eclipse has a very thorough Java dev guide, which should tell you pretty much everything it will do for you. http://archive.eclipse.org/eclipse/downloads/drops/R-3.1-200506271435/org.eclipse.jdt.doc.user.3.1.pdf.zip I think the guide does a decent job as far as helping you help yourself as well, so I think it could still be a worthy source for what you are seeeking.
In other words, something which has enough information on the things which IDEs like Eclipse do for you, and how to manage those things without using an IDE.
So you acknowledge IDEs are great. Why aren't you using one? In particular, IDEs come with step by step documentation on how to accomplish these simple tasks. I suspect the reason there is little IDE agnostic documentation on these things is that most people actually use IDEs.
Great compiler error avoidance practices.
I for one wouldn't want to code without the Quick Fix feature of eclipse ...
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I am in a project where previous programmers have been copy-pasting codes all over the place. These codes are actually identical (or very similar) and they could have been refactored into one.
I have spent countless hours refactoring these codes manually but I think there must be a better way. Some are very trivial static methods that could have been moved into an ancestor class (but instead was copy pasted all over by previous junior programmers).
Is there a code analysis tool that can detect this and provide reports/recommendations? I prefer free/open source tool if possible.
I use the following tools:
PMD/CPD (BSD-style License).
Checkstyle (LGPL License) - support was removed, see details.
Both tools have code duplication detection support. But both of them lack the ability to advise you how to refactor your code.
JetBrains IntelliJ IDEA Ultimate has good static code analysis with code duplication support, but it is not free.
Most of the tools listed on the Wikipedia article on Duplicate Code Tools will detect duplicates in many different languages, including Java.
SonarQube can detect duplicated codes but does not give recommendation on eliminating them. It is free and - although with the default setup it can only detect lexically identical clones
Either Simian or PMD's CPD. The former supports a wider set of languages but is non free for commercial projects.
http://checkstyle.sourceforge.net/ has support for finding duplicates
See our SD Java CloneDR, a tool for detecting exact and near-miss duplicate code in large Java systems.
The CloneDR will find code clones in spite of whitespace changes, line breaks, comment insertions deletions, modification of constants or identifiers, and in a number of cases, even replacement of one statement by another or a block of statements.
It shows where each set of clones is found, each individual clone, an abstraction of the clones having their shared commonality and parameterization of the abstraction to show how each clone instance can be derived from the abstraction.
It finds 10-20% clones in most Java systems.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I really need an easy to use build tool which supports multiple languages with strong Java support. I have tried Scons but found the Java support lacking. Is there anything else out there? I'm not excited about learning yet another build tool. Also, I really don't want a build tool which is difficult to use without an IDE since I use emacs and will be writing the build scripts by hand.
Edit:
When I said general purpose I meant a build tool that works with many languages. I'd like to save myself the time spent learning a new build system for every languages I use.
http://ant.apache.org/
Here is how to do C++ projects with Ant: http://www.codemesh.com/products/junction/doc/ant_cpp.html
Or http://ant-contrib.sourceforge.net/cpptasks/index.html
Ant, Maven, and Gradle all are designed for building Java applications.
EDIT: Let me expound....
Ant is a really good option. As the first very good open source java build system, it has grown to be a popular and widespread option. Most anything you will do in a typical java system has been done through Ant. You can find sample after sample and great tutorials on learning this. Now, just because it can handle everything doesn't mean it's quick and painless. There's a lot of 'boilerplate' build.xml that you almost certainly will be writing. Also, there is no dependency management.
Enter Maven -- Dependency management is handled very well here. Merely specify the name of the jar(s) that your project depends on and it will ensure that you have the appropriate version. Also, the help and tutorials available are very good and you can be up and building in 5 minutes.
Gradle -- this is a newer build system, built to take out most of the pain points and boilerplate code. This is a great option if you are interested in using/learning Groovy!
I would recommend ant. I used it for a java project and it worked great. But we had help from a person experienced in writing the build scripts so I don't know how easy it is.
I recommend Hudson as a general build management solution. You configure jobs and we point it at our revision control system to watch for checkins. It has strong java support, but can run any job as the build process, including chaining of jobs together.
Ant.
Most java online tutorial use Ant as build tool. You can find how it works by reading java tutorial.
You don't have to learn every single command in ANT, just learn a few which are useful :)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
This is along similar lines as these recent questions:
Best Java Obfuscation Application For Size Reduction
Creating non-reverse-engineerable Java programs
However, one ends up recommending yGuard and the other ProGuard but neither mention both. I wonder if we could get a comparison of each one and hear peoples experiences from both sides of the fence. Looking at this comparison chart on the ProGuard website its clearly angled towards ProGuard. But what about real-world experience of each - which one produces smaller output? which one is harder to decompile from? what Java versions are supported by each?
Personally I'm particularly interested from a J2ME point of view but please don't limit the discussion to that.
Results for my project.
Obfuscation - both fine.
Optimisation - ProGuard produced 20% faster code (for the measured app bottleneck).
Compactness - ProGuard about 5% smaller.
Configuration / Ant - YGuard is much easier to configure.
So, I'd advise ProGuard - but configuration and ant integration could definitely be improved.
Proguard is a better product; especially if you take the time to go through the settings for J2ME.
Specifically for J2ME there is a far better (commercial) product called mBooster
I've been getting around 25% improvement in size on my application after its been through Proguard. This is mainly to do with the better Zip compression on the Jar file and comprehensive support for class merging and preverification.
My opinion is - ProGuard is better. Output is smaller a bit. Optimizing is better and much faster.
Decompiling is simple in both cases. Well, i mean, if u know Java well and really know business-logic of what you're decompiling, there is no problem to get it back to sources from obfuscated classes.
So, my opinion is ProGuard is better.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Are there any good tools out there for automatically converting non-Java source code into Java source?
I'm not expecting something perfect, just to get the worst of the grunt work out of the way.
I guess there is a sliding scale of difficulty. C# should be relatively easy (so long as you ignore all the libraries). (well written) C++ not so bad. C requires making a little OO. (Statically type) functional languages may be easy to grok. Dynamic OO languages may require non-local analysis.
One thing you can try is find a Java bytecode compiler for the language you're talking about (there are JVM compilers for all kinds of languages) and then decompile the bytecode back into Java using a decompiler like Jad.
This is fraught with peril. The regenerated code will suck and will probably be unreadable.
Source-to-source migrations fall under the umbrella of Program Transformation. Program-Transformation.org tracks a bunch of tools that are useful for language recognition, analysis, and transformation. Here are few that are capable of source-to-source migrations:
ASF+SDF Meta-Environment - As noted, there is no new development on this tool. Instead, the developers are focusing on Rascal.
Rascal Meta Programming Language
Stratego /XT
TXL
DMSĀ® Software Reengineering Toolkit (commercial)
If you spend any time with one of the open source tools, you'll notice that even though they include source-to-source migration as a feature, it's hard to find working examples. I imagine this is because there's no such thing as a one-size-fits-all migration. Each project/team makes unique use of a language and can vary by libraries used, type complexity, idioms, style, etc. It makes sense to define some transformations per migration. This means a project must reach some critical mass before automatic migration is worth the effort.
A few related documents:
An introduction to Rascal - includes a migration between the toy language Pico and Assembly starting at page 94.
Cracking the 500 Language Problem
An Experiment in Automatic Conversion of Legacy Java Programs to C# (gated) - uses TXL
Google: ANTLR
The language conversion is fairly simple, but you will find the libraries are different.
This is likely to be most of your work.
If you just want to use some legacy C/Pascal code, you could also use JNI to call it from Java.
If you want to run it in a Java applet or similar constrained environment, and it does not have to be very efficient, you can use NestedVM (which is a MIPS to Java bytecode converter) in conjunction with a gcc cross-compiler that compiles to MIPS). But don't expect to get readably Java code from that.
Any of those tools might help only if your non java code is not huge enough.
If its huge non java code and if you want to seriously translate it to java, then few things need to be thought of, its not just hundreds of lines of code, there is a design beneath it, there are few decisions taken by people beneath the code due to which certain problems might have been solved and few things have been working there. and investing time on any good translator won't be worth as it won't exist, it's not just syntax translation from one language to another.
If its not so huge code, its better to re write in java, as it has so many APIs packages out of box, it might not be big deal, hiring few interns for this also might help.
ADA to Java can be done with a find-and-replace!