Spyera, a similar product, has also been doing well in China. Chinese users account for 18 percent of its customers, up from 6 percent just two years ago, according to the company's owner, Mihat Oger. In contrast, the U.S. accounts for 38 percent of its customers.
"Our sales increased 17 percent from 2009 to 2010 and increased 32 percent from 2010 to 2011," Oger said, adding that much of the growth has been driven by increased smartphone sales.
Flexispy and Spyera said they have taken steps to keep their products legal, such as designing them so they can't be installed remotely. Flexispy warns customers that using its product without the consent of the person being targeted could be illegal, and it highlights what it says are legitimate uses of its product.
"Our marketing is focused on the legitimate uncovering of a cheating partner or the protection of a child's activities on a mobile," Harris said. "However, it is a fact of life that virtually everything can be used illegally. ... The responsibility is with the user, not the product."
Security vendor F-Secure has labelled Flexispy as malware in the past. Still, while such programs have the potential for misuse, in most cases that have been investigated Flexispy was being used to spy on a spouse rather than something like industrial espionage, said Mikko Hypponen, the chief researcher at F-Secure.
Tyler Shields, a researcher with security firm Veracode, noted that because the data from phones is sent back to a server operated by Flexispy, its usefulness for criminal enterprise is limited. "If I were a malicious hacker, I wouldn't want all the stolen data to be sent to a Flexispy server. For a criminal, it's not as much of a useful tool."
In China, Flexispy and its variants are better known as "XWodi", which translates as "X-Undercover." Online searches reveal a long list of sites claiming to sell Flexispy and similar products. Most of these sites, however, are scams, and selling fake spyware products, said Li Tiejun, an anti-virus engineer with Chinese security vendor Kingsoft.
"Some are real," he said.
The danger of Flexispy being secretly installed on a user's phone, however, is minimal compared with more malicious spyware reaching handsets in China, he said.
Each month, Kingsoft is finding more sophisticated spyware coming out of the country, Li said. In August it discovered a program that comes buried inside an apparently innocuous Android application, and which recorded phone calls and text messages without the user's knowledge. It's unclear why the program was developed. The creators might have been using it to collect data for marketing, which they could then sell to interested parties, Li said.
Several vendors of China's XWodi were contacted for this story, but all declined to be interviewed. Flexispy and Spyera would not reveal their exact sales figures. But aside from catching cheating spouses, the companies say their spyware products are generally used to monitor employees or track the activities of young children, teenagers, and elderly people unable to care for themselves.
Raihan maintained that he never intended his product to be used for illegal purposes. "There's enough business in the legitimate market. There's no need for it to be used in other situations," he said. Raihan later sold his Flexispy business to another company.
Whatever its merits, he is proof that the software can achieve its goal. After helping to build Flexispy, he gave his girlfriend at the time a mobile phone with the software installed on it. "Yes, she was cheating," he said. "I've used it ever since. It really opened my eyes."