Apple Inc (AAPL - Get Report) shares traded at an all time high Friday after the tech giant removed a controversial app from its App store linked to the Hong Kong protests and traders bet that progress in U.S.-China trade talks could spur smartphone demand.

Apple said the HKMap.live app, which tracked the movements of police and protesters during Hong Kong's months-long clashes, will not longer be available on its App Store after CEO Tim Cook said it could be used to "maliciously target" Hong Kong police. The move follows sharp criticism from government officials in China, as well, who described the app as "poisonous" through an editorial in the state-controlled People's Daily newspaper earlier this week.

"The app in question allowed for the crowdsourced reporting and mapping of police checkpoints, protest hotspots, and other information," Cook wrote in a statement. "On its own, this information is benign."

"However, over the past several days we received credible information, from the Hong Kong Cybersecurity and Technology Crime Bureau, as well as from users in Hong Kong, that the app was being used maliciously to target individual officers for violence and to victimize individuals and property where no police are present," he added.

Apple shares were rising 2.7% to change hands at $236.36 each, a move that extends the stock's year-to-date gain to just over 50% and gives it a market value of $1.068 trillion, just below the current $1.073 trillion of Microsoft Corp. (MSFT - Get Report) .

Apple is also getting a boost from reports of a positive first day of talks between U.S. and Chinese trade officials in Washington Thursday, and hopes that a near-term agreement on smaller, easier-to-implement policy objectives could potentially freeze tariff increases set for later next week and again on December 15.

The December tariffs, in particular, would be significant for Apple as they would include a 15% levy on iPhones, tablets, laptops and range of consumer tech products made in China.

An August report from JP Morgan estimated that Apple cut iPhone component costs by between $30 and $50, which would help to partially mitigate tariff impacts. It's also sought to shift its manufacturing base out of China as aggressively as possible, among other potential offsets.

Apple and Microsoft are holdings in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells these stocks? Learn more now.