Yes and no. They are being asked to create a special piece of software containing the unique ID of the particular device (MAC address, IMSI, or whatever). Granted once the software is created, changing the unique IDs for other phones of the same operating system becomes trivial, but it is not something that gets into the wild unless Apple is careless with its intellectual property (IP), the same IP that covers all of Apple's software and hardware implementations.
I think a simpler attack would probably be to just overwrite the code that does the checks with no-ops, and then you've got code that can be used by any script kiddie with access to it on any phone. Since it requires a positive check, and there's no obvious way to build in meaningful cryptographic security, it's pretty hard not to be susceptible to that sort of thing.
It seems to me that Apple can protect their IP,...
Apple isn't especially prone to data breaches, so I think you're right about the likelihood. But it's certainly more likely than if it didn't exist at all.
... but I have to wonder that once the legal precedent is set, how often governments will be coming to the court asking for a repeat of the San Bernardino effort.
That's one of the reasons I think this case is important. This case involves especially unsympathetic subjects, so it's a great test case for the FBI. But fundamentally, once the principle is established, why couldn't Apple, or Google, or Microsoft, or anyone else be compelled to write code for any old situation?
Here's another concern: If Apple can be made to actively help the US government, how does that impact their ability to sell their products to countries that might not trust the US government? China is Apple's second-largest market.
If Apple prevails in its resistance to the court(s), this forces governments to contemplate reverse engineering their devices and places Apple's IP in a much weaker position. It can also force the government to use its power of security review of all patents having encryption intellectual property by the NSA more stringently. All patent filings with such content are routinely reviewed by the NSA as part of export control (and for, ahem, its own purposes).
I think that presents less hazard to Apple's business. And the NSA likely already works pretty hard on this.
Some patent filings are rendered classified and never published because of this.
Now that
is chilling.
There's one legal theory that I subscribe to personally, so far largely untested, that software constitutes free speech, and that the government fundamentally doesn't have a right to prevent its dissemination on First Amendment grounds. It would be ineffectual regardless, as the US doesn't hold anything like a monopoly on crytography, and making it harder to export such software from the United States would likely move the development overseas, where most of the major tech firms are already well established.
It may take years to do so, but once a government is determined,
studying already published Apple patent applications and issued patents will lead to reverse engineered clones. Accordingly, Apple would be better off controlling what it owns and suffering the experience of courts compelling them to help when it serves what a court considers to be a greater good.
I think the most surprising thing about this case, at least for me, is that the FBI needs Apple's help at all. I suspect that this may have been chosen as a bit of a test case in the hopes of creating a precedent that can be used elsewhere.