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.

  • Maybe your asking the wrong question... Why do the timestamps on these particular files make a difference, and why are you trying to change them?
    – acejavelin
    Commented Aug 17, 2018 at 19:35
  • Because the system-level inability to set file timestamps affects every app and every file operation on the system, with the result that copying files or moving files from one volume to another changes their last-modified timestamp, fouling up workflows which depend on those timestamps. I don't want to change them; I just want them to remain unchanged.
    – intuited
    Commented Aug 19, 2018 at 1:29
  • I guess I have uses Android for years and been on multiple ROM development teams, and this has never come up. What real world application would this effect?
    – acejavelin
    Commented Aug 19, 2018 at 1:32
  • Any operation that uses timestamps. File synchronisation, for example. There are a number of use cases mentioned in the comments on the issue pages I've linked to.
    – intuited
    Commented Aug 19, 2018 at 1:33


You must log in to answer this question.

Browse other questions tagged .