Perhaps not. But Apple absolutely benefited from the overwhelmingly positive press coverage it received as a result of their decision to oppose the FBI. And when the FBI withdrew their request, Apple looked like the winner. So yes, I do believe they opposed the FBI in that instance to strengthen their brand.
http://www.cnn.com/2016/02/19/politics/donald-trump-apple-bo...
Remember this document? Apple was the last company to be subverted either willingly nor not. I'll bet it pissed Cook the hell of that Apple was even on this list. I believe they completely revamped their cloud architecture after that.
http://www.washingtonpost.com/wp-srv/special/politics/prism-...
People are always saying things like this, but we never really have any good data on what the alternative would have been. Just because you're in the black doesn't mean you haven't lost billions of dollars in additional profits.
Apple had the first mover advantage with the iPhone. There is a fair argument that they would still have the bulk of the market if they had been more open, instead of conceding the majority share to Android.
They absolutely would not have. HN-types might have, but many of them were also enraged about many of Apple's business practices over the years including their App Store policies, not being "open", etc. And it hasn't had any measurable impact on Apple's success as a business.
The public at large wouldn't have cared just like they don't care when Apple complies with lawful orders for information as they do now [1].
[1] https://www.apple.com/legal/privacy/law-enforcement-guidelin...