software licensing open-source-software
Is it legal to decompile Apple Open Source components?
<p>I want to write a blogpost / record a screencast about macOS opensource components. I was going to decompile those opensource components and I am not sure if it would be legal. MacOS software license explicitly forbids any OS decompilation, but also mentions that Open Source Component licenses override that limitation. MacOS components like xnu or dyld are licensed under Apple Public Software License, which is open-source license without any restriction for decompilation. Is it legal to decompile macOS executables, whose source code is already available at opensource.apple.com?</p>
<p><a href="https://www.apple.com/legal/sla/docs/macOSBigSur.pdf" rel="nofollow noreferrer">Software License Agreement For macOS Big Sur</a> states that:</p>
<blockquote>
<p>N. No Reverse Engineering. You may not (…) decompile, reverse engineer, disassemble (…) the Apple Software (…) (except as and only to the extent any foregoing restriction is prohibited by applicable law or by licensing terms governing use of Open-Sourced Components that may be included with the Apple Software).</p>
</blockquote>
<p><a href="https://opensource.apple.com/source/xnu/xnu-7195.121.3/APPLE_LICENSE.auto.html" rel="nofollow noreferrer">Apple Public Software License</a> in turn states that:</p>
<blockquote>
<p>1.7 &quot;Original Code&quot; means (…) (b) the object code compiled from such Source Code and originally made available by Apple under this License.</p>
</blockquote>
<p>and then:</p>
<blockquote>
<p>2.1 (…) You may use, reproduce, display, perform, internally distribute within Your organization, and Externally Deploy verbatim, unmodified copies of the Original Code, for commercial or non-commercial purposes</p>
</blockquote>

<p>A license tells you what you are allowed to do, under what conditions. You are allowed to disassemble the code if copyright law allows it (only in rare situations) or the license allows it.</p>
<p>You need to check the exact text of the license. Most likely you don't have the right to disassemble code that has been compiled by Apple, but there would likely be some way for you to get the source code, and with the source code the right to compile your own application, and because it is your own application, the right to disassemble the code as part of your own application.</p>
<p>Now if there is a legal way for you to disassemble the code by compiling it yourself, and there is no practical difference except wasting some of your time between this and disassembling the code as part of Apple's application, Apple might not care.</p>
