Save the Cheerleader; Save the World.
"For the reasons discussed above, the FBI cannot itself modify the software on the San Bernardino shooter's iPhone without access to the source code and Apple's private electronic signature. The government did not seek to compel Apple to turn those over because it believed such a request would be less palatable to Apple. If Apple would prefer that course, however, that may provide an alternative that requires less labor by Apple programmers."
First, they have to prove in court they have a legal right to seize the code and then show there is no other way, and that they can prevent it from being leaked absolutely, or post bond that if it is leaked Apple is compensated. Well, they can use an existing jailbreak for the level of iOS on the target phone. Then they can analyze and patch the iOS image to disable the check for number of attempts. And away they go
Second, if Apple is compelled to hand over the crown jewels as it were, they should stipulate that the DOJ staff can only have access on Apple's campus on a computer secured against tampering and USB or other access, disable everything wireless but bluetooth (or use a USB mouse and keyboard with extra ports filled with epoxy, and disable all wireless) or withdrawal of any files except the Govt OS image. So a non-network connected computer preloaded by Apple, and in a shielded room with wireless keyboard and trackpad. Computer in a locked box. Apple should be allowed to monitor them, and scheduled access only. And Apple can of course get access to the changes they are making. The signing cert never leaves the computer in the high security zone. Even with those precautions Apple should immediately invalidate the signing cert and reissue a new one and new images for all the previously signed OS images. App images. etc. Anything signed by that cart should have an upgrade. Create new cert, Create new app and os images, Suggested Strongly that people accept the updates for security reasons. Then give the FBI access if required to do so.
"Don't tell me I'm burning the candle at both ends -- tell me where to get more wax!!"