A bug or unfortunate design choice in Android since forever ago prevents non-root users from setting file timestamps to times other than the present.
Apparently this issue has been fixed and the fix is rumoured to have found its way into 8.0 Oreo. However, I don't have that version of Android (yet). Anyway, it sounds like it only works for certain apps.
For a different issue, that of write access to the external SD card, there is a workaround that allows this permission to be granted to individual apps provided the phone has been rooted.
Is there a way to allow an app to modify file timestamps on a rooted phone, perhaps by adding a permission to the appropriate section of
packages.xml? Having to copy files over as root is quite cumbersome and insecure.