Genuine question here, why go through all the trouble of manually removing the networking code?
Wouldn't it be much easier to replace the import/include/whatever of the low level networking bindings with a stub library where all functions just immediately return with a networking error, as if the computer was off line?
That would make it all but trivial to keep up with upstream code changes, and keep the disconnected version up to date.