Richard Yu, CEO of Huawei's consumer business, speaks as he presents the P30 series smartphone during a launch event in Paris. Marlene Awaad | Bloomberg | Getty Images

Huawei's smartphone shipments in China surged in the second quarter as the Chinese tech giant captured the highest market share of any vendor in the country in eight years, according to new data from research firm Canalys. Canalys said Huawei's smartphone shipments in China soared 31% year-on-year, even as the overall market slowed. Apple's shipments declined 14% in the second quarter, while shipments from Chinese competitors Oppo, Vivo and Xiaomi also tumbled. "Huawei's addition to the United States Entity List caused uncertainty overseas, but in China it has kept its foot on the accelerator," said Canalys analyst Mo Jia. "Its core strategy remains investing in aggressive offline expansion, and luring consumers from rival brands Oppo and Vivo, while unleashing a wave of marketing spend to support new channels and technologies."

Huawei now captures 38% of market share in China, according to Canalys. The research, published Tuesday, found Huawei's global mix has "shifted back toward China" as it faces growing scrutiny and trade barriers from the U.S. On Tuesday, Huawei reported a 23.2% year-over-year increase in revenue for the first six months of 2019 year despite facing political headwinds. In May, Trump administration put Huawei on a so-called entity list that required companies to receive special licenses to sell or transfer technology to Huawei.