BEIJING — For the last decade or so, China has defied the truism that only free and open societies can innovate. Even as the Communist Party has kept an iron grip on politics and discourse, the country’s technology industry has grown to rival Silicon Valley’s in sophistication and ambition.

President Xi Jinping’s tilt toward strongman rule could put all that to the test.

As Mr. Xi starts his second term, the Chinese government, which once viewed the internet primarily as a threat to its stranglehold on information, is harnessing big tech companies’ capital and knowledge to realize its broader goals for the country.

At a time when the Trump administration is moving to counter China’s tech prowess, Beijing’s heavier hand could pose its own threat to the country’s competitiveness, and to the innovation that has transformed Chinese firms into global heavyweights.

For China’s government, WeChat, the country’s most popular messaging and social media service, has become a key tool for policing what people say and do. Political activists have reported being followed based on WeChat conversations; chat records have turned up as evidence in court. The e-commerce titan Alibaba, meanwhile, is helping city authorities manage traffic.