Microsoft regularly shares Windows source code with foreign governments for them to inspect.
From 2003 https://www.infoworld.com/article/2681548/china-gets-access-...
Microsoft regularly shares Windows source code with foreign governments for them to inspect.
From 2003 https://www.infoworld.com/article/2681548/china-gets-access-...
"Apple hasn’t provided any information on the matter and did not respond to requests for comment. But analysts said the most likely interpretation is that the company is giving Beijing access to its operating system source code in return for being able to continue to do business in China—arguably Apple’s most important market, but one that has been imperiled by regulatory obstacles"
https://qz.com/332059/apple-is-reportedly-giving-the-chinese...
Think Open Source Android vs. Google's Android, or Chromium vs. Chrome. It's not just dragging and dropping some UI libraries on top. There's a ton of glue, and sticking shims into non-obvious places that make a lot of the magic happen.
A nation state can easily do it if they want. The US govt (NSA) has even devloped a reverse engineering tool and open sourced it.