No, for the most part it IS illegal in China. That fact is used by government officials to extort bribes from vendors. When it suits their purposes, the government will pick out a pirate they don't like and literally shoot him in the head, giving themselves something to point at when accused by developed nations of soft on piracy and ensuring that rest of the pirates will keep the bribes coming.