阅读背景:

如何分解整个Jar文件?

来源:互联网 

Does anyone know of a free decompiler that can decompile an entire Jar file instead of a single class? I have a problem with sub classes like name

Does anyone know of a free decompiler that can decompile an entire Jar file instead of a single class? I have a problem with sub classes like name$1.class name$2.class name.class

有没有人知道一个免费的反编译器,它可以反编译整个Jar文件而不是一个类?我对子类有个问题,比如命名为$1。类名2美元。类name.class

9 个解决方案

#1


276  

JavaDecompiler can do a good job with a jar: since 0.2.5, All files, in JAR files, are displayed.

JavaDecompiler可以很好地处理jar:因为0.2.5会显示jar文件中的所有文件。

See also the question "How do I “decompile” Java class files?".

请参见“如何“分解”Java类文件?”

The JD-Eclipse doesn't seem to have changed since late 2009 though (see Changes).
So its integration with latest Eclipse (3.8, 4.2+) might be problematic.

尽管如此,自2009年末以来,日蚀似乎并没有发生变化(见变化)。因此,它与最新的Eclipse(3.8, 4.2+)的集成可能存在问题。

JD-Core is actively maintained.

JD-Core积极维护。

Both are the result of the fantastic work of (SO user) Emmanuel Dupuy.

这两个都是伊曼纽尔·杜普伊(Emmanuel Dupuy)出色工作的结果。

#2


34  

First of all, it's worth remembering that all Java archive files (.jar/.war/etc...) are all basically just fancy.zip files, with a few added manifests and metadata.

首先,值得记住的是,所有的Java归档文件(.jar/.war/等)基本上都很花哨。压缩文件,添加了一些清单和元数据。

Second, to tackle this problem I personally use several tools which handle this problem on all levels:

其次,为了解决这个问题,我个人使用了几个工具,在各个层面上处理这个问题:

  • Jad + Jadclipse while working in IDE for decompiling .class files
  • Jad方法,用于反编译.class文件
  • WinRAR, my favorite compression tool natively supports Java archives (again, see first paragraph).
  • WinRAR是我最喜欢的压缩工具,它在本地支持Java存档(同样,请参见第一段)。
  • Beyond Compare, my favorite diff tool, when configured correctly can do on-the-fly comparisons between any archive file, including jars. Well worth a try.
  • 除了Compare,我最喜欢的diff工具,如果配置正确,可以在任何存档文件(包括jar)之间进行即时比较。值得一试的。

The advantage of all the aforementioned, is that I do not need to hold any other external tool which clutters my work environment. Everything I will ever need from one of those files can be handled inside my IDE or diffed with other files natively.

以上所提到的优点是,我不需要持有任何其他影响我工作环境的外部工具。我从这些文件中需要的所有东西都可以在我的IDE中处理,或者直接与其他文件分散。

#3


30  

If you happen to have both a bash shell and jad:

如果您碰巧有一个bash shell和jad:

JAR=(your jar file name)
unzip -d $JAR.tmp $JAR
pushd $JAR.tmp
for f in `find . -name '*.class'`; do
    jad -d $(dirname $f) -s java -lnc $f
done
popd

I might be a tiny, tiny bit off with that, but it should work more or less as advertised. You should end up with $JAR.tmp containing your decompiled files.

我可能对此有点反感,但它应该或多或少地像宣传的那样起作用。你应该以$JAR结束。包含反编译文件的tmp。

#4


23  

I have had reasonable success with a tool named (frustratingly) "JD: Java Decompiler".

我成功地使用了一个名为(令人沮丧地)的工具JD:Java编译器”。

I have found it better than most decompilers when dealing with classes compiled for Java 5 and higher. Unfortunately, it can still have some hiccups where JAD would normally succeed.

在处理为Java 5或更高版本编译的类时,我发现它比大多数反编译器要好。不幸的是,在JAD方法下,它仍然会有一些不顺利的地方。

#5


9  

Something like:

喜欢的东西:

jar -xf foo.jar && find . -iname "*.class" | xargs /opt/local/bin/jad -r

maybe?

也许?

#6


3  

Insert the following into decompile.jar.sh

将以下内容插入到反编译器中

# Usage: decompile.jar.sh some.jar [-d]

# clean target folders
function clean_target {
  rm -rf $unjar $src $jad_log
}

# clean all debug stuff
function clean_stuff {
  rm -rf $unjar $jad_log
}

# the main function
function work {
  jar=$1
  unjar=`basename $jar.unjar`
  src=`basename $jar.src`
  jad_log=jad.log

  clean_target

  unzip -q $jar -d $unjar
  jad -d $src -ff -r -lnc -o -s java $unjar/**/*.class > $jad_log 2>&1

  if [ ! $debug ]; then
    clean_stuff
  fi

  if [ -d $src ] 
    then
      echo "$jar has been decompiled to $src"
    else
      echo "Got some problems check output or run in debug mode"
  fi
}

function usage {
  echo "This script extract and decompile JAR file"
  echo "Usage: $0 some.jar [-d]"
  echo "    where: some.jar is the target to decompile"
  echo "    use -d for debug mode"
}

# check params
if [ -n "$1" ]
  then
    if [ "$2" == "-d" ]; then
      debug=true
      set -x
    fi
    work $1
  else
    usage
fi
  • chmod +x decomplie.jar.sh //executable
  • chmod + x decomplie.jar。sh / /可执行
  • ln -s ./decomplie.jar.s /usr/bin/dj
  • ln - s。/ decomplie.jar。年代/usr/bin/dj

Ready to use, just type dj your.jar and you will get your.jar.src folder with sources. Use -d option for debug mode.

准备好使用,只要输入你的dj。jar,你会得到你的。jar。src文件夹与来源。调试模式使用-d选项。

#7


2  

A jar file is just a zip file with jar extension. You should be able to unzip(winzip) a jar just like a zip file.

jar文件只是一个扩展名为jar的zip文件。您应该能够解压(winzip) jar,就像解压文件一样。

#8


1  

You extract it and then use jad against the dir.

您将它提取出来,然后在dir中使用jad方法。

#9


1  

Note: This solution only works for Mac and *nix users.

注意:此解决方案仅适用于Mac和*nix用户。

I also tried to find Jad with no luck. My quick solution was to download MacJad that contains jad. Once you downloaded it you can find jad in [where-you-downloaded-macjad]/MacJAD/Contents/Resources/jad.

我也想找贾德,但运气不佳。我的快速解决方案是下载包含jad的MacJad方法。下载之后,您可以在[where you-download - MacJAD]/MacJAD/目录/资源/jad中找到jad方法。


.class name.class name.classDoes anyone know of a free decompiler that can




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: