0

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 Aug 17 '18 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 Aug 19 '18 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 Aug 19 '18 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 Aug 19 '18 at 1:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.