Like all civil disobedience, it occupies an awkward middle ground. You don't necessarily want to make prosecutors' lives easier, but your protest is a lot more powerful if you make it clear to the world that you really did violate the law, because then anyone who supports you has to acknowledge that the law is unfair.
If a random person throws a sandwich at you, or touches your shoulder for example to say "mind the gap", it is indeed assault under the law. Whether it rises to the importance of requiring legal sanction is, however, up to the jury.
Merely touching people is not unlawful. Intent and context are critical and your example falls well below any sort of threshold for harassment or violence.