A man uses his phone as he walks past an Apple store in Hong Kong on Christmas Day. (ANTHONY WALLACE/AFP/Getty Images)

Each year, Apple releases a new version of the software running its iconic mobile devices, the iPhone and iPad. And each year, a small but dogged community of hackers sets out to break it — or, in the words of the hackers, “jailbreak” it.

The liberation imagery long seemed apt. Apple puts strict limits on how its devices can be used, requiring, for example, that all apps be bought through the company’s lucrative iTunes store. By comparison, the hackers styled themselves as plucky hobbyists seeking freedom from what they derided as Apple’s “walled garden” and into a promised land of virtually limitless new software.

That image has taken a beating in recent days as prominent hackers have battled allegations that they’ve been working not for ideals but for money. The supposed payoffs would have come from Chinese investors eager to cash in on the spread of Apple products in that country.

Although there’s no evidence money changed hands, the controversy has highlighted how Apple’s restrictions on its mobile devices have fueled the creation of alternative marketplaces, where the thrill of trying to outsmart one of the world’s richest companies mixes with at least the possibility of fat profits for those who succeed.

“Anything that can open up a whole new line of sales on [Apple devices] is certainly worth a lot to somebody,” said Brian Krebs, who covers Internet security issues on his blog, KrebsOnSecurity. “If you jailbreak it, it means there are millions of more apps to sell.”

Apps for mobile devices earned nearly $27 billion in 2013 and are projected to earn more than $76 billion in 2017, with Google’s Android operating system and Apple’s iOS platform the dominant players, according to Gartner, a research firm. Apple reported $9.3 billion in revenue last year from its iTunes store, which sells apps along with music, movies and electronic books.

Among the key growth markets is China, where lower-priced Android devices have a large lead and Apple is working to make inroads. It announced a deal in December to offer the iPhone through China Mobile, the world’s largest cellular carrier.

Apple’s tightly controlled ecosystem has long been part of its appeal. Company founder Steve Jobs, who died in October 2011, obsessed over every detail of the user experience, with the goal of having hardware, software and online services working together seamlessly.

The tradeoff came in control for consumers. While Google’s Android devices are made by many different manufacturers and can load apps from any store a user chooses, Apple makes it own products and rigorously oversees the apps available on iTunes, typically taking a 30 percent cut from every sale and barring developers who do not comply with the company’s many rules.

“Apple products are like beautiful crystal prisons,” said Peter Eckersley, director of technology projects at the Electronic Frontier Foundation, a civil liberties group. “Deviation from that is not allowed.”

Jailbreaking can allow users of Apple mobile devices substantial new powers — for example, to fake their locations to defeat location tracking and service blackouts. It can allow free “tethering” so users can direct data streams from their iPhones to other devices without paying for a separate connection. And it can allow the use of alternative browsers that have privacy settings not available on Apple’s Safari.

Advocates for the disabled, meanwhile, have sponsored a campaign to raise money in support of jailbreaking Apple’s latest mobile device operating system, iOS 7, because iTunes does not offer some apps they find helpful.

Jailbreaking devices removes key security features. One of the few successful iPhone attacks — a prank virus that changed the background screen to an image of British pop star Rick Astley — spread on jailbroken devices.

“Apple’s goal has always been to ensure that our customers have a great experience with their iPhone, and we know that jailbreaking can severely degrade the experience,” Apple spokeswoman Trudy Muller said in a statement. “As we’ve said before, the vast majority of customers do not jailbreak their iPhones as this can violate the warranty and can cause the iPhone to become unstable and not work reliably.”

Jailbreaks and other types of hacks once were widely available for free, but the security vulnerabilities they rely on have become valuable commodities, in part because of the demand from government intelligence services, such as the National Security Agency.

The recent controversy flared when, a few days before Christmas, a hacker group called the “evad3rs” released the first publicly available jailbreaking tools for iOS 7. The tools also loaded a Chinese app store, called Taig, for devices that were set to use the Chinese language.

That move triggered swift backlash, with critics accusing the hackers of selling out their users in a secret deal with Taig, whose app store included some pirated material. There also were fears — apparently unfounded — that the Taig program somehow provided private user data to the Chinese company.

“We are very upset that despite our agreement and review by their team, piracy was found in the store. It was not acceptable and they have been strenuously working to resolve the problem in good faith,” the evad3rs posted in a lengthy letter on their Web site. “We are sorry . . . Taig will be pulled from the jailbreak if it cannot be resolved.”

The evad3rs, who did not respond to requests for comment from The Post, soon pulled out of the deal with Taig. The hackers said in a second public letter: “There have been a lot of rumors listing various amounts we’ve been paid. We have received no monies from any group, including Taig.”

Also a few days before Christmas, somebody posted online what appeared to be a surreptitiously recorded conversation between another hacker, named Geohot, and a middleman attempting to buy a separate set of iOS 7 jailbreak tools for $350,000.

Although impossible to verify, the conversation appeared to take place before the evad3rs had released their jailbreak and was remarkably detailed, down to the tax consequences of the purported sale. The ultimate buyer, the unnamed middleman said on the recording, was a Chinese company.

Geohot, who did not respond to efforts to contact him, is George Hotz, a security researcher once sued by Sony for developing a hack into the PlayStation 3 gaming console. He acknowledged in a recent posting on his Web page that he had been in a race with the evad3rs to release an iOS 7 jailbreak but denied that he struck a deal to sell it.

“Full disclosure time, I was working on a public, free of charge, china not involved, old school jailbreak with a few others. evad3rs released first,” Hotz wrote.

He warned that both the jailbreaking tools released by the evad3rs and the ones he was developing relied on similar security weaknesses — often called “exploits” — that are now public. Companies typically close such loopholes once they are revealed.

In his note, Hotz said cryptically, “The exploits won’t be usable next time. No more jailbreaks ever?”

But, analysts say, the incentives for jailbreaks are unlikely to diminish — for hackers, for investors and for users eager to break free of Apple’s walled garden.

“The number one reason is that it gives you a feeling that you beat the system,” said Gartner analyst Whit Andrews. “Anytime any organization establishes stringent or rigid controls, it creates a social incentive to circumvent those controls.”

Ashkan Soltani, an independent security researcher and consultant, contributed to this report.