In this specific situation there’s a pretty obvious power imbalance where the public do not wear masks and the authorities would be able to track them down and oppress them later (or just do what they currently do and grab them from the streets at the time). The threat of unmasking is one of the few things the people have to use against the authorities: when a policeman has his mask removed he will typically run away for fear of being identified. (The only other things they have are sheer numbers and the moral superiority of being basically peaceful against a violent government).
A similar argument about law enforcement safety was used by Apple to remove a map app in Hong Kong which showed people where large groups of police (and eg tear gas releases or which small coloured banners announcing illegal assemblies had been raised). The claim was that the app could be used to target individual policemen even though it only showed larger units and mainly helped people to get around the city without getting gassed by the police. Meanwhile the Chinese government were funding a site offering money for doxxing protestors but it wasn’t in the App Store so I guess it was ok.