Apple is doubly vulnerable after taking a hardline public stance on encryption.

Not only does the company risk a defeat before judges who will decide whether it can legally oppose FBI demands to help it hack a terrorist’s iPhone, but it’s also susceptible to a setback in the court of public opinion.

The company is being portrayed by the government as soft on crime during an election year when candidates are already on record as saying the technology industry doesn’t do enough to help combat terror. Now polling shows that the public is divided on whether CEO Tim Cook is doing the right thing.

While it’s too early to gauge the impact on the bottom line, the standoff increases the likelihood that the fabled Apple brand develops as much of a reputation for its views on policy issues as it has for its must-have products. That’s a contrast to the days before Cook took the helm, when the company was less likely to air political views.

About half of Americans say Apple should unlock the iPhone to assist the ongoing FBI investigation into the San Bernardino attacks, which killed 14 people, according to a survey by Pew Research Center. Some 38% said Apple shouldn’t do so.

“There have been more incidents of terrorist threats, which have made the general public more responsive to the government being able to open someone’s phone, particularly someone like this,” said Michel Pham, who teaches branding and marketing strategy at Columbia Business School in New York. “It’s a risky proposition for Apple.”

Opinion is broadly split between two camps. On the one hand are those who agree with Cook that helping the FBI hack the handset would be a dangerous precedent that could lead to a stampede of foreign regimes demanding that Apple also help them access the phones of, for instance, political dissidents. On the other side are those who think that the company is hindering federal efforts to establish the extent of the San Bernardino terror plot, and is thereby endangering national security.

“They’re going to alienate some people if they release it, and they’re going to alienate some others if they don’t,” said David Reibstein, a professor of marketing at the University of Pennsylvania’s Wharton School. “For some customers it’s going to hurt, no question.”

Donald Trump was among the first to criticize Apple’s refusal to honor the court order to unlock the phone. The Republican presidential candidate urged supporters at a rally on Friday in Pawleys Island, S.C., to boycott the company. He later tweeted that he’ll give up his personal iPhone in favor of a Samsung device until Apple caves to the FBI’s demands.

The conflict risks diverting attention from a key pillar of Apple’s success as a brand: its products. When Interbrand ranked Apple the world’s most valuable brand for the third consecutive year in 2015, it highlighted both the efforts “to make people feel more secure” and how Apple “speaks directly about the merits of its product and its benefits to the user.” The brand is worth $170 billion, Interbrand said.