Just when Apple (NASDAQ:AAPL) was starting to make some progress in addressing its demand challenges in China, its second-most important market, the Trump administration's Huawei ban has created a whole new level of risks for the Mac maker. Economic nationalism is on the rise both in the U.S. and China amid an escalating trade war that will hurt both of the two largest economies in the world. The ban, which has far-reaching and complex implications, ties into the broader trade war.

Apple may get hit with collateral damage.

Anti-Apple sentiment in China is on the rise

BuzzFeed News had detailed the growing Apple boycott movement earlier this month, and matters are only getting worse. A South China Morning Post report this morning is offering more perspective on the anti-Apple sentiment. Chinese consumers are feeling that they should support domestic brands instead of buying products from foreign companies.

"There is a calling from my heart that I need to show support for Chinese brands, especially in the trade war climate," one consumer told the outlet. "It's kind of embarrassing to pull an iPhone out of your pocket nowadays when all the company executives use Huawei," another telecom worker said.

Huawei has already been growing rapidly in its home market, thanks to an expansive phone portfolio that addresses a wide range of price points and consumer preferences. Even the company's premium models are selling well, while Apple continues to see iPhone volumes decline. Huawei's global shipments soared 50% in the first quarter, a stark contrast to Apple's 30% drop worldwide, according to IDC. The market researcher previously estimated that iPhone volumes fell 20% in China in the fourth quarter.

IDC's Kiranjeet Kaur told the Morning Post that the Huawei ban is only going to amplify positive sentiment toward Huawei, which is increasingly becoming a source of national pride. Many Chinese consumers feel that Huawei is being unfairly targeted by the U.S. government, according to the report.

Apple iPhone
Workers prepare for the opening of an Apple store in Hangzhou, Zhejiang province, China January 23, 2015. Reuters/Chance Chan

Apple's profits could take a massive hit

The U.S. and China have been retaliating against each other in various ways throughout the trade war, and investors and analysts are now worrying that the Chinese government could target Apple in retribution. Goldman Sachs analyst Rod Hall put out a research note this morning (via CNBC) estimating that Apple's earnings could decline by a whopping 29% under the extreme scenario that its products were banned in China.

"Should China restrict iPhone production in any way we do not believe the company would be able to shift much iPhone volume outside of China on short notice," the analyst wrote. Hall cut his price target from $184 to $178 to account for the new risk factor. HSBC had separately cut its price target on Apple earlier this week due to ongoing trade tensions.

Of course, Apple contributes significantly to China's economy, as its supply chain and contract manufacturers have long been concentrated in the Middle Kingdom. An Apple ban would also hurt China's economy quite a bit. But then again, much of the trade war's damage is already self-inflicted, so I guess that would be par for the course.

Evan Niu, CFA owns shares of Apple. The Motley Fool owns shares of and recommends Apple. The Motley Fool has the following options: long January 2020 $150 calls on Apple and short January 2020 $155 calls on Apple. The Motley Fool has a disclosure policy.

This article originally appeared in The Motley Fool.