But if the prosecutors can make a convincing argument that your intent was exactly that all along, then you may end up convicted anyway.
Intent matters. It might be hard to prove, but it matters.
It may not even be that hard; what other possible explanation is there for someone putting a PIN visible on their phone that wipes it while crossing a border?