SAY the words “Apple” and “China” to Westerners, and many will think of sweatshops. Campaigners have accused Foxconn, which makes most of Apple’s gizmos in mainland China, of overworking and underpaying its staff. Apple has promised to insist on better working conditions.

Ask about Apple inside China, however, and you hear little but praise. It is one of the most admired brands in the Middle Kingdom. A survey last year by researchers at Stanford University found that iPad penetration was greater at an elite high school in Beijing than at one in Palo Alto, California. In the first quarter of this year Apple earned $7.9 billion in greater China, making it the firm’s second-biggest market (see chart). The latest iPad was launched on the mainland on July 20th.

Apple’s latest results, announced on July 24th, were excellent by normal standards: global revenues for the most recent quarter were $35 billion, with a gross margin of nearly 43%. Amazingly, this was worse than investors expected, so Apple’s shares slipped by 4.3%. Analysts blamed weak demand in Europe, as well as purchases deferred because of rumours of a new iPhone launch.

Sales in greater China fell to $5.7 billion, a plunge of 28% from the spectacular first quarter (when Apple launched the much-awaited iPhone 4S in the country). That was expected, however. More telling is that revenues rose by 48% year-on-year.

Sales of smartphones (of all brands) in China are soaring: they rose by 288% in April, year-on-year, and for the first time outpaced the sales of dumbphones. Sanford C. Bernstein, an investment bank, estimates that 270m people in China can already afford Apple’s products, and that each year another 57m will be able to. Many Chinese are desperate for its gadgets. This year a boy from Anhui, one of China’s poorest provinces, reportedly sold one of his kidneys to buy an iPhone and iPad.

Apple’s sales could also get a boost from another quarter. China Mobile, which counts two-thirds of China’s 1 billion mobile subscribers as customers, does not yet officially offer Apple products. “To go big in China, Apple must get a deal with China Mobile,” says C.K. Lu of Gartner, a market-research firm. Rumours suggest such a deal may be in the offing. In short, Apple’s products are selling fast and likely to sell even faster. Some predict that China will overtake America to become Apple’s largest market within a few years. Hang on a minute, though. The Chinese market is strewn with landmines, such as an unpredictable intellectual-property system. Apple’s recent tablet launch was held up for ages because of a lawsuit filed by Proview, a bankrupt Chinese firm that claimed to own the mainland rights to the iPad name. Of trolls and leopards

Partly because it bungled its handling of the case, Apple was forced to pay $60m to settle. This has emboldened other patent trolls, which claim to own the Chinese rights to the name Snow Leopard (an operating system for Apple’s computers) and part of the technology behind Siri (a voice-recognition system on its phones).

But can a real iPhone boil soup? Meanwhile, Chinese pirates are poking Apple with cutlasses. Cheap shanzhai (knockoff) handsets with fruity branding are rife. So are “GooApple” devices that look like iPhones but run on Google’s Android operating system. Nearly two dozen fake Apple stores were found in Kunming, the capital of Yunnan province, last year. Some fakes fool no one (see picture). Still, Apple could do more to prevent piracy. For example, it has failed to expand its retail network fast enough, leaving the field open for fakers. It vowed to have 25 shops in mainland China by this time, yet there are only six. Another problem for Apple is that smartphone sales in China are driven mostly by cheap handsets. Sanford C. Bernstein estimates that two-thirds of smartphones sold last year in the country cost less than $300; the latest iPhone costs $800. Baidu, Alibaba and other local internet firms have introduced cheap cloud-connected handsets. Price competition at the bottom end of the market is so fierce that ZTE, a local handset maker, is thought to be losing money. Apple could try to compete by offering a cheaper model with fewer features, something it has resisted in other markets. But that risks tarnishing its brand. Duncan Clark of BDA China, a consultancy, points out that Microsoft dumbed down its computers for the Chinese market in the 1990s—and flopped as a result. A yuaning gap

The secret of Apple’s wild profitability in other countries is not just its elegant devices but the apps, music and films that customers download onto them. Its phones and tablets lure consumers into its lucrative iTunes ecosystem. At first glance, China is a promising market: last year app downloads shot up by 300%, rising to 18% of the global total. And Chinese sales at iTunes have gone up since it started accepting payments in yuan.

However, Chinese consumers are not parting with many of those yuan. They expect apps to be free, or at least to be offered on the “freemium” model. App Annie, a technology consultancy, estimates that payments made per Apple game app average $1.90 in Japan and $0.67 in America, but just $0.07 in China. This makes it hard for Apple’s business model to work there.

Some say Apple should copy an idea from Henry Ford. The great American carmaker paid his employees enough to afford a Model T. Will the workers who assemble iPads one day be able to own one? With wages soaring in China, that may not be a pipe dream. Given that wages account for only 2% of the retail price, bumping them up would hardly cripple Apple’s margins. And removing the “sweatshop” stigma might help its global reputation.

Apple has arguably helped to modernise Chinese attitudes towards enterprise and design. Chinese shoppers are eager not only to own its products but also to learn about the man behind the company; sales of a biography of Steve Jobs have been huge. Apple may even have helped nudge the Chinese government towards stricter protection of intellectual property—though pirated copies of the Jobs biography were available within days of the original, and at a fraction of the price.