China's government has a well-founded reputation for its excessive censorship and surveillance of online behavior, but it seems the problem is even worse for some of its minority citizens. In the north-western border region of Xinjiang, home to much of the country's Muslim population, residents have been told to install an Android spying app or face detention.

Authorities used messaging service WeChat to inform residents of Urumqi, Xinjiang's capital, that they must install an app called Jingwang. The notice was written in both Mandarin and Uyghur - the language of ethnic group Uighur. It says the app will automatically detect "terrorist and illegal religious videos, images, e-books, and electronic documents."

The message included a QR code for downloading the surveillance app. There's also a warning that anyone who fails to install the spyware would be detained for ten days.

It's reported that Jingwang works by scanning the digital signatures of media files on a device and comparing them to a government database of illegal, "terrorist-related" material. If there's a match, users will be prompted to delete the offending items.

According to Jingwang's website, the app is also designed to "block pornographic websites, online scams, trojan horses, and phishing sites; to alert users of how much time they spend online; and to enable remote control of one's home network."

The part about controlling a user's home network is throwing up a lot of red flags. What's also worrying is that the app collects information such as Wi-Fi logins, IMEI numbers, and SIM card data. Moreover, it records copies of chat conversations from Weibo and WeChat. Radio Free Asia reports that 10 Kazakh women from Ili Kazakh Autonomous Prefecture were arrested over WeChat messages they sent soon after they installed the app.

Authorities in the area say they will be performing random spot checks to make sure Jingwang is installed on users' devices.

"The goal is ostensibly to identify and purge any 'terrorist videos,' but the action violates the privacy rights of Urumqi's 3 million residents and exposes them to punishment for a host of other possible offenses, including those related to peaceful religious or political expression," writes US-based human rights group Freedom House.