After suffering through stock selloffs this summer, China’s internet giants are working hard to regain favor with authorities and global investors as the companies try to chart paths back to normalcy.

Shares of two large Chinese online retailers, Pinduoduo Inc. and JD.com Inc., jumped more than 20% in the past two days—recouping a chunk of their heavy losses since July—after the companies reported healthy sales increases in the second quarter and highlighted their contributions to Chinese society. Their performance took some of the focus away from Beijing’s widening regulatory crackdown, which has turned many investors off the once-hot internet sector.

Pinduoduo, a fast-growing e-commerce player known for selling vegetables, groceries and household essentials, reported on Tuesday net income of $373.9 million for the three months ended June. It was the Shanghai-based company’s first net profit since its listing on the Nasdaq Stock Market about three years ago and came on the back of an 89% jump in quarterly revenue to $13.6 billion.

The nearly six-year-old company said it would commit its second-quarter earnings and future profit totaling up to the equivalent of $1.5 billion to supporting farmers and rural communities by helping them modernize using agricultural technology. Chen Lei, its chairman and chief executive, said he would oversee the project, which needs majority shareholder approval.

Days earlier, Tencent Holdings Ltd. said it would invest the equivalent of $7.7 billion to promote “common prosperity” in China. The videogaming and social-media giant previously had earmarked a similar sum to fund research in areas such as science and carbon neutrality that are strategically important to Beijing. Common prosperity has become a popular catchphrase in China, used to describe President Xi Jinping’s desire for people in the country to get rich together, instead of having wealth concentrated among the corporate world’s upper echelons.