从 jar 中提取 scala 源代码 [英] Extract scala source code from jar
问题描述
所以我有一个包含 scala 作为源代码的 jar 文件,而我丢失了原始代码.有没有办法将 jar 中的类文件转换为 Scala 函数和类,而不是编译器生成的 java 类?
So I have a jar file that contains scala as the source code and I have lost the original code. Is there a way to convert the class files in the jar to scala functions and classes instead of the java classes the compiler makes?
我试过在它上面使用反编译器,它只给了我零意义的 java 代码.
I have tried using a decompiler on it and it only gives me the java code that makes zero sense.
先谢谢你!
推荐答案
您需要一个特定于 Scala 的反编译器.没有理由不能写出来,但这将是一项巨大的努力,据我所知,没有人真正做到过.当然,它不会完全生成原始代码,就像其他语言的反编译器不会一样.
You'd need a Scala-specific decompiler. There is no reason one couldn't be written, but it would be a large effort and so far as I know nobody has actually done it. Of course, it wouldn't produce exactly the original code, just as decompilers for other languages don't.
这篇关于从 jar 中提取 scala 源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!