2

Consider a situation if I have a code licensed with GPL3, but no source arrived with it.

The original source code is unavailable, either because the other part simply won't give it (violating GPL3 with it), or because it is lost, or disappeared.

In same cases (for example, in java .class-files), decompiling them to source and then continuiung the development from that point is a viable alternative, comparing to the re-implementation.

Can it be done legally?

What if I consider the .class-files as "unintentionally obfuscated source code", what I actually improve by decompiling it into a more useful form?

3
  • 1
    Are you asking about your ability to legally distribute the software without access to the original source code? As written, this question only asks about the legality of reverse engineering and modification, but the implications for public versus private continuing work certainly merit different answers.
    – apsillers
    Commented Dec 14, 2018 at 18:02
  • @apsillers Yes, of course decompilation, modification, compilation, and distribution (this time, with the recompiled source).
    – peterh
    Commented Dec 14, 2018 at 18:09
  • Why wouldn't you be allowed to decompile software? Some software license agreements require that you agree not to do so, but the GPL does not include such a restriction, and even if one was added, the GPL says that you are allowed to remove such a restriction.
    – Brandin
    Commented Dec 15, 2018 at 10:36

1 Answer 1

8

You are certainly free to reverse engineer and recompile the GPL-licensed binary you receive, whether or not you received source alongside it. You are likewise free to make modifications to such decompiled source code.

The more interesting question is whether you could distribute your modifications without the bona fide original source code. The GPL requires you to share the "preferred form of the work for making modifications to it." This is certainly the original source code, not a decompiled version of the binary. If you don't distribute the source form of your modifications (because you don't have the upstream source to modify), would you be legally liable for a license violation?

Section 12 of the GPLv3 certainly indicates this is the case:

If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all.

Thus, the very short answer is no, you may not distribute the GPL work with source missing. However, if the original author really did lose the source code, rendering further legal redistribution of their work impossible, it may be possible to receive separate permission from that author to distribute it anyway. In this case, the author is simply granting a non-GPL license to allow continued redistribution of the work.

Be aware, though, that if the upstream program contains other GPL-licensed work (from further upstream authors), the license on those component works would be violated when the author of the program chose to distribute it without source code. If you distribute it further, with or without modification, you are performing a similar license violation and expose yourself to legal action from those further upstream authors for distributing a derivative of their work without the source for their work.

For an instance of a case where you could be left without source and uncooperative author, see my answer on Use of AGPL software after developer deleted repository. In that case, the recipient holds an (A)GPL-licensed binary, but the author later refuses to distribute the source (or binary) a second time after originally making them available.

3
  • 1
    The GPL has a provision that says that, if the requirements can't be met, the program can't be redistributed. Impossibility is not a defense. This is in section 7 of GPLv2 and section 12 of GPLv3. Commented Dec 14, 2018 at 22:15
  • @DavidThornley Great point; I've removed that text and replaced it with a quote from Section 12.
    – apsillers
    Commented Dec 14, 2018 at 23:02
  • "preferred form of the work for making modifications to it." -> If there is no better alternative, I understand the decompiled source code may be the "preferred form".
    – Pere
    Commented May 13, 2022 at 11:11

Not the answer you're looking for? Browse other questions tagged or ask your own question.