Status Update
Comments
je...@google.com <je...@google.com> #2
je...@google.com <je...@google.com> #3
@hardwick.jim if this test doesn't pass for you, could you paste its output here? As well as your device's full version information. Thanks.
public final class FileTest extends TestCase {
public void testSetLastModified() {
File file = new File("/mnt/sdcard/foo");
assertTrue(file.setLastModified(0));
assertEquals(0, file.lastModified());
}
}
ha...@gmail.com <ha...@gmail.com> #4
ha...@gmail.com <ha...@gmail.com> #5
Device is a Motorola Xoom 3G from Verizon, Android 3.1, HMJ37, rooted. I'm not sure what other device info you need, so let me know if you need more.
I can also post the source and results of my tests on stock HMJ37 Xooms - both 3G and WiFi only - but it will take a couple days to get my hands on those devices again since I only own the rooted Xoom.
je...@google.com <je...@google.com> #6
As a workaround, this ugly hack will set the last modified date to now:
RandomAccessFile raf = new RandomAccessFile(file, "rw");
long length = raf.length();
raf.setLength(length + 1);
raf.setLength(length);
raf.close();
ha...@gmail.com <ha...@gmail.com> #7
public void testSetLastModified() throws IOException {
long time = 1316137362000L;
File file = new File("/mnt/sdcard/foo");
file.createNewFile();
file.setLastModified(time);
assertEquals(time, file.lastModified());
}
gy...@gmail.com <gy...@gmail.com> #8
gy...@gmail.com <gy...@gmail.com> #9
ha...@gmail.com <ha...@gmail.com> #10
ha...@gmail.com <ha...@gmail.com> #11
ja...@gmail.com <ja...@gmail.com> #12
ha...@gmail.com <ha...@gmail.com> #13
Unfortunately Jesse, your workaround doesn't help me. I need to set times other than current.
kr...@kreatio.pl <kr...@kreatio.pl> #14
ls...@gmail.com <ls...@gmail.com> #15
rj...@gmail.com <rj...@gmail.com> #16
This seems to be an issue with the fuse filesystem.
Test code attached.
rj...@gmail.com <rj...@gmail.com> #17
rj...@gmail.com <rj...@gmail.com> #18
es...@gmail.com <es...@gmail.com> #19
asus transformer prime
ICS
both utime/utimes (C++) and File.setLastModified (C++ JNI)
fails on modifying time of any kind of file on SD card.
bv...@gmail.com <bv...@gmail.com> #20
bv...@gmail.com <bv...@gmail.com> #21
Fuse seems to be ok, but the mount is missing allow_utime. So seems like a permission error. Google can you atleast confirm if it's a feature or bug?
ma...@gmail.com <ma...@gmail.com> #22
pu...@gmail.com <pu...@gmail.com> #23
Workaround mentionned in
to...@gmail.com <to...@gmail.com> #24
there is a solution?
ma...@gmail.com <ma...@gmail.com> #25
Here are the specs on both devices:
Galaxy Note:
Model number: GT-N8013
Android version: 4.0.4 (stock ROM)
Kernel version: 3.0.15-1015435-user se.infra@SEP-120 #1 SMP PREEMPT Mon Aug 13 22:17:27 KST 2012
Build number: IMM76D.N8013UEALH2
Samsung Galaxy SII:
Model number: SAMSUNG-SGH-I727
Android version: 4.0.4 (custom ROM)
Kernel version: 3.0.8-perf-I727UCLE2-CL526987 se.infra@SEP-98 #1 SMP PREEMPT Tue May 8 22:27:38 KST 2012
Build number: SkY ICS 4.2E-7
jb...@gmail.com <jb...@gmail.com> #26
ch...@gmail.com <ch...@gmail.com> #27
in platform/system/core/sdcard/sdcard.c:
> /* all files owned by root.sdcard */
> attr->uid = 0;
> attr->gid = AID_SDCARD_RW;
From utimensat()'s syscall man page:
Old FAT allows offers an override of the iattr->valid flag via a mount option to allow changing timestamps to anyone, FUSE+Android's sdcard-FUSE don't do this at the moment (so the 'inode_change_ok() call fails) and the attempt gets rejected with -EPERM. Here's FAT's ./fs/fat/file.c:
an...@googlemail.com <an...@googlemail.com> #29
pu...@gmail.com <pu...@gmail.com> #30
co...@gmail.com <co...@gmail.com> #31
pa...@gmail.com <pa...@gmail.com> #32
er...@gmail.com <er...@gmail.com> #33
[Deleted User] <[Deleted User]> #34
lu...@till.cz <lu...@till.cz> #35
I coul'd not find any sync&backup tool/app which does not need preserving timestamp.
js...@android.com <js...@android.com>
do...@gmail.com <do...@gmail.com> #37
do...@gmail.com <do...@gmail.com> #38
jo...@gmail.com <jo...@gmail.com> #39
ju...@gmail.com <ju...@gmail.com> #40
rh...@gmail.com <rh...@gmail.com> #41
Google you are making us use MTP instead of Mass Storage because according to you "it was better". Now the files timestamp are messed up.
After transfering all my photos from my Nexus S to my Nexus 4, all the pictures have the same timestamp!! What the hell? The photos order are messed up! PLEASE fix this!!!
rh...@gmail.com <rh...@gmail.com> #42
That includes the following Nexus devices:
Nexus 7 (2012), Nexus 7 (2013), Galaxy Nexus, Nexus 4 and Nexus 5.
FIX IT AS SOON AS POSSIBLE PLEASE!!!
pa...@gmail.com <pa...@gmail.com> #43
Forget it guys, google will never fix nerd issues. I bed they not even look at the bug tracker.
We all should be lucky that android still keeps the filename. I see it coming, in the future android will change the filename like this foto.jpg > a1f687f1a851efc2.jpg ;D
But seriously, it is crucial for almost all file sync utilities, and as you may have notices, it's cloud age!
+1 for FIX IT AS SOON AS POSSIBLE PLEASE!!!
do...@gmail.com <do...@gmail.com> #44
kb...@gmail.com <kb...@gmail.com> #45
Whatever the reason that Google and other OS developers choose to ignore this flaw, they might consider that it is a sufficient reason to change platforms and unmitigated by the scores of other useless features.
If I can't rely on a file's date, why have one?
si...@gmail.com <si...@gmail.com> #46
Here kernel/fs/fuse/ is patched to add the "allow_utime_grp" option, which relaxes the restriction on setting the timestamp; this option is then used by the sdcard daemon in their proprietary ROMs.
HTC used a different option — "allow_utime=0020" (probably copied from vfat); the implementation can be seen here (again as a code dump from the manufacturer, just imported into git, so you can see only the final code and not a separate patch):
But these incompatible hacks done by some vendors are not a real solution for the problem.
qa...@newdreamer.org <qa...@newdreamer.org> #47
do...@gmail.com <do...@gmail.com> #48
All identical except for storage:
Tablet A 16 GB storage = $300
Tablet B 32 GB storage = $379
Tablet C 64 GB storage = $439
But the fact that it now affects the internal storage is creepy. For spying on users, not allowing timestamp modifications is a no-brainer, right? NSA thing?
jr...@gmail.com <jr...@gmail.com> #49
wi...@gmail.com <wi...@gmail.com> #50
Remember, "technology is only wonderful when it works" !
en...@google.com <en...@google.com> #51
ha...@gmail.com <ha...@gmail.com> #52
en...@google.com <en...@google.com> #53
ek...@gmail.com <ek...@gmail.com> #54
go...@mspacek.mm.st <go...@mspacek.mm.st> #55
What an incredibly unnecessary waste of limited attentional resources.
rh...@gmail.com <rh...@gmail.com> #56
ty...@gmail.com <ty...@gmail.com> #57
ha...@gmail.com <ha...@gmail.com> #58
It will be some sort of business/security for normal mortal beyond all understanding decision.
The Android really becomes better and better...
ha...@gmail.com <ha...@gmail.com> #59
ke...@live.de <ke...@live.de> #60
ha...@gmail.com <ha...@gmail.com> #61
mi...@gmail.com <mi...@gmail.com> #62
Are you serious, google?
ti...@gmail.com <ti...@gmail.com> #63
ti...@gmail.com <ti...@gmail.com> #64
This had the same cause. That one can not rely on times on /sdcard was only because Android did not correctly support SetLastModified. All other OS do it correctly, and many backup solutions rely on it.
ia...@gmail.com <ia...@gmail.com> #65
I am literally and truthfully willing to cover a $1,000 bounty to FIX this bug so I can continue to stick with android and use it as my primary business device. This issue is totally destroying any functional usage of any new android phones.
ho...@gmail.com <ho...@gmail.com> #66
ma...@gmail.com <ma...@gmail.com> #67
So I can't rely on this timestamp ...
br...@gmail.com <br...@gmail.com> #68
Trying to sync files from Android to my computer with Folder Sync cannot compare the date modified to determine which file is newer.
mk...@google.com <mk...@google.com>
[Deleted User] <[Deleted User]> #69
ja...@gmail.com <ja...@gmail.com> #70
ha...@gmail.com <ha...@gmail.com> #72
ja...@gmail.com <ja...@gmail.com> #73
ma...@gmail.com <ma...@gmail.com> #74
ja...@gmail.com <ja...@gmail.com> #75
ho...@gmail.com <ho...@gmail.com> #76
ma...@gmail.com <ma...@gmail.com> #77
jo...@mistrock.com <jo...@mistrock.com> #78
da...@gmail.com <da...@gmail.com> #79
ro...@googlemail.com <ro...@googlemail.com> #80
All I'm trying to do is copy files from the internal memory to an sd card (within the phone). DateTimes get replaced for all the files. This is using both LGs 'File Manager' and also 'ES File Explorer'
jo...@gmail.com <jo...@gmail.com> #81
ch...@gmail.com <ch...@gmail.com> #82
wu...@gmail.com <wu...@gmail.com> #83
ma...@gmail.com <ma...@gmail.com> #84
Google, please get busy, and do something!!!!!!! (I get so tired of lazy companies!!!)
hr...@halium.com <hr...@halium.com> #85
I don't actually believe anyone responsible for this issue is monitoring this bug - or willing to take ownership and fix it - and would love to be proven otherwise!
Keith
ti...@gmail.com <ti...@gmail.com> #86
gi...@gcalzo.net <gi...@gcalzo.net> #87
I want to kill MTP...
aa...@gmail.com <aa...@gmail.com> #88
as...@aprescott.com <as...@aprescott.com> #89
aa...@gmail.com <aa...@gmail.com> #90
st...@gmail.com <st...@gmail.com> #91
ma...@gmail.com <ma...@gmail.com> #92
ho...@gmail.com <ho...@gmail.com> #93
ho...@gmail.com <ho...@gmail.com> #94
ha...@gmail.com <ha...@gmail.com> #95
Is this bug very very difficult so that nobody can fix it?
my...@gmail.com <my...@gmail.com> #96
ch...@gmail.com <ch...@gmail.com> #97
Is it a upstream file system bug that cannot be fixed? Or is there any thicks to avoid this?
ju...@gmail.com <ju...@gmail.com> #98
ju...@gmail.com <ju...@gmail.com> #99
I used on a Nexus 4 with Android 5 and Nexus 5 with Android 6, both rooted.
xd...@gmail.com <xd...@gmail.com> #100
an...@gmail.com <an...@gmail.com> #101
se...@gmail.com <se...@gmail.com> #102
Very sad. Can_'t restore my pictures on the phone.
Gallery is messed up
cl...@gmail.com <cl...@gmail.com> #103
gi...@gmail.com <gi...@gmail.com> #104
Also tried with google photos but i can't download them so it's useless...
tz...@gmail.com <tz...@gmail.com> #105
gi...@gcalzo.net <gi...@gcalzo.net> #106
sa...@gmail.com <sa...@gmail.com> #107
co...@gmail.com <co...@gmail.com> #108
ja...@gmail.com <ja...@gmail.com> #109
If not, why not fix it ?
so...@gmail.com <so...@gmail.com> #110
he...@gmail.com <he...@gmail.com> #111
ma...@gmail.com <ma...@gmail.com> #112
bd...@google.com <bd...@google.com>
an...@zoomtown.com <an...@zoomtown.com> #113
A similar problem (I believe it has the same root cause) is also in
[Deleted User] <[Deleted User]> #114
su...@gmail.com <su...@gmail.com> #115
It is mystery to me why Google can´t fix this.
ro...@gmail.com <ro...@gmail.com> #116
Maybe if it's out there they may pay attention to it.
So annoying. Android is so unorganized, coming from an iPhone I'm going right back
op...@gmail.com <op...@gmail.com> #117
I program one download file APP and find the problem when I try modify downloaded file timestamp. I find touch command do not work by Runtime.getRuntime().exec(). In getFilesDir() the setLastModified worked. Then try mv command. I find mv command do not work by Runtime.getRuntime().exec() when from getFilesDir() to Environment.DIRECTORY_DOWNLOADS. So I think this maybe permission problem. My Redmi Note 3 give me android.permission.WRITE_EXTERNAL_STORAGE is USB write and read right. I try download file to getExternalCacheDir(). And the setLastModified worked. Then I mv the file to Environment.DIRECTORY_DOWNLOADS. The timestamp keeped!!!
Can others try and check whether it worked? Or ONLY my phone worked.
Thanks.
My code like:
String download = ...getApplicationContext().getExternalCacheDir().getAbsolutePath() + File.separator + download_file_name;
File file = new File(download);
file.setLastModified(lastModified);
StringBuilder cmdline = new StringBuilder("mv ");
cmdline.append(download);
cmdline.append(" ");
download = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath() + File.separator + download_file_name;
cmdline.append(download);
Process process = Runtime.getRuntime().exec(cmdline.toString());
process.waitFor();
at...@gmail.com <at...@gmail.com> #118
Even untaring an archive on the device with the correct timestamps inside doesn't preserve them.
Nice one Google. It' be nice if the owner of this bug would actually comment on it and make people aware of the official position rather than just ignoring everyone. Is this ever going to be fixed? Why is it always such a battle to get an answer from Google?
ha...@gmail.com <ha...@gmail.com> #119
I've long since pulled the app from the Play Store that I was working on when I found the bug since I can't properly support it without setLastModified(), but I still personally use the app and distribute it to a few friends. It would be nice to get this fixed - maybe I could re-release it.
dr...@google.com <dr...@google.com> #120
ma...@gmail.com <ma...@gmail.com> #121
(Pixel XL owne)
jh...@buttercookie.de <jh...@buttercookie.de> #122
dr...@google.com <dr...@google.com> #123
an...@gmail.com <an...@gmail.com> #124
Is there any chance that the correction arrives on the Nexus 5? According to Google's promises security updates shall be delivered until 18 months after end of selling the device, and this would be about March 2017.
Otherwise I will not be able to test it.
wi...@gmail.com <wi...@gmail.com> #125
co...@gmail.com <co...@gmail.com> #126
Thanks for considering the issue, it's been already more than 5 years!
pr...@gmail.com <pr...@gmail.com> #127
1. On computer:
$ tar -cf pics.tar my_pictures_backup/*
2. Get pics.tar onto phone using MTP. I placed it at /sdcard/DCIM/Camera
3. On phone:
$ su
# cd /sdcard/DCIM/Camera
# tar xvf pics.tar
# rm pics.tar
4. Update media database using something like Media Re:Scan.
This works assuming you have enough space to temporarily store two copies of your entire collection of pictures/videos, and you have root.
mc...@gmail.com <mc...@gmail.com> #128
Can there be a setLastModifiedCompat method?
ji...@gmail.com <ji...@gmail.com> #129
al...@gmail.com <al...@gmail.com> #130
Android6 + root + Xposed + XInternalSD
copy file by ES Explorer in Root mode to /storage/A9F7-11F1/
timestamp = current time
copy file by ES Explorer in Root mode to /mnt/media_rw/A9F7-11F1/
timestamp same as timestamp source file
ha...@gmail.com <ha...@gmail.com> #131
an...@gmail.com <an...@gmail.com> #132
em...@gmail.com <em...@gmail.com> #133
az...@gmail.com <az...@gmail.com> #134
an...@gmail.com <an...@gmail.com> #135
sh...@gmail.com <sh...@gmail.com> #136
any idea when the fix will be available ?
Thanks!
ma...@gmail.com <ma...@gmail.com> #137
ji...@gmail.com <ji...@gmail.com> #138
ga...@gmail.com <ga...@gmail.com> #139
Can you share more information on this please?
ma...@gmail.com <ma...@gmail.com> #140
ma...@gmail.com <ma...@gmail.com> #141
You have to create a file first on the phone you can test if you can modify the date. I did with "adb shell"
- adb shell
- angler:/ $ cd sdcard
- angler:/sdcard $ echo "Testfile" > testfile.txt
ru...@gmail.com <ru...@gmail.com> #142
No way to change timestamp if phone is not rooted.
al...@gmail.com <al...@gmail.com> #143
al...@gmail.com <al...@gmail.com> #144
al...@gmail.com <al...@gmail.com> #145
co...@gmail.com <co...@gmail.com> #147
There's the issue also with Google Drive that doesn't preserve timestamps when you perform a backup or restore or pictures for example, or if you use FolderSync alternatively.
vi...@gmail.com <vi...@gmail.com> #148
al...@gmail.com <al...@gmail.com> #149
Problem is NOT solved.
ma...@gmail.com <ma...@gmail.com> #150
I am using Cheetah sync since many many years with HTC android and I'd really appreciate if Google could fix the timestamp update so that the app could work again on the new phone. Thanks. Maurizio
ro...@tnp.net.uk <ro...@tnp.net.uk> #151
hk...@flashlight.de <hk...@flashlight.de> #152
an...@gmail.com <an...@gmail.com> #153
al...@gmail.com <al...@gmail.com> #154
rd...@gmail.com <rd...@gmail.com> #155
be...@googlemail.com <be...@googlemail.com> #156
he...@gmail.com <he...@gmail.com> #157
sk...@gmail.com <sk...@gmail.com> #158
sk...@gmail.com <sk...@gmail.com> #159
ma...@gmail.com <ma...@gmail.com> #160
da...@gmail.com <da...@gmail.com> #161
Creating a new issue might be more useful then commenting here. I agree with the star suggestion by the way.
pr...@gmail.com <pr...@gmail.com> #162
By the way, I even had problems with Google Photos. I was saving my camera pictures into the internal storage (what a stupid default setting some ill person could have thought of!), and when I decided to change to another device I was offered to the option (from the app) to move the pictures to the external storage. I instantly messed all my pictures after accepting the usefull option. That day I didn't know about the issue being from AOSP. Then i gave ONE STAR to the app in the Google Play Store. This means at least two things: 1) not even Google Apps work properly under android enviroment; and 2) Google Photos probably work better under iOS than under Android.
dr...@google.com <dr...@google.com> #163
ho...@gmail.com <ho...@gmail.com> #164
ha...@gmail.com <ha...@gmail.com> #165
mi...@protonmail.ch <mi...@protonmail.ch> #166
I think folks here were more aiming at even other fs working as expected.
en...@google.com <en...@google.com>
ab...@gmail.com <ab...@gmail.com> #167
to...@gmail.com <to...@gmail.com> #168
jb...@gmail.com <jb...@gmail.com> #169
ti...@gmail.com <ti...@gmail.com> #170
gb...@gmail.com <gb...@gmail.com> #171
li...@gmail.com <li...@gmail.com> #172
li...@gmail.com <li...@gmail.com> #173
da...@gmail.com <da...@gmail.com> #174
km...@yahoo.co.uk <km...@yahoo.co.uk> #175
wi...@gmail.com <wi...@gmail.com> #176
13...@gmail.com <13...@gmail.com> #177
When extracting a ZIP file, the original modified dates of the files in the ZIP are overwritten with the date of extraction.
mi...@gmail.com <mi...@gmail.com> #178
ma...@gmail.com <ma...@gmail.com> #179
On Sun, Jun 23, 2019, 12:34 <buganizer-system@google.com> wrote:
ja...@gmail.com <ja...@gmail.com> #180
ni...@gmail.com <ni...@gmail.com> #181
Android 8.0 - not fixed
Android 8.1 - not fixed
Android 9.0 - fixed
Android 9.1 - fixed
ab...@gmail.com <ab...@gmail.com> #182
Can it be fixed?
kl...@gmail.com <kl...@gmail.com> #183
With the information from here
in platform/system/core/sdcard/sdcard.c:
/* all files owned by root.sdcard */ attr->uid = 0; attr->gid = AID_SDCARD_RW;
From utimensat()'s syscall man page:
- the caller's effective user ID must match the owner of the file; or
- the caller must have appropriate privileges.
To make any change other than setting both timestamps to the current time (i.e., times is not NULL, and both tv_nsec fields are not UTIME_NOW and both tv_nsec fields are not UTIME_OMIT), either condition 2 or 3 above must apply.
Old FAT offers an override of the iattr->valid flag via a mount option to allow changing timestamps to anyone, FUSE+Android's sdcard-FUSE don't do this at the moment (so the 'inode_change_ok() call fails) and the attempt gets rejected with -EPERM. Here's FAT's ./fs/fat/file.c:
/* Check for setting the inode time. */ ia_valid = attr->ia_valid; if (ia_valid & TIMES_SET_FLAGS) { if (fat_allow_set_time(sbi, inode)) attr->ia_valid &= ~TIMES_SET_FLAGS; }
error = inode_change_ok(inode, attr);"
Maybe is there someone who can tell how some vendors seemingly managed to solve it in their Android variants prior to 9.0, or if there is a way to change the storage's UID / GID, or give a binary more permissions through ADB without unlocking the bootloader and rooting?
kl...@gmail.com <kl...@gmail.com> #184
jo...@gmail.com <jo...@gmail.com> #185
im also frustrated in this bug
This is the list of affected device
Note: some of these devices is old but im hoping that a fix will apply on newer devices have android pie (9)/Go Edition Versions and above
1) MyPhone Rio 2 (Lollipop 5.0)
2) Oppo Neo 5 (Lollipop 5.1)
3) Vivo V5 Lite (Marshmallow 6.0)
4) Oppo A3s (Oreo 8.1.0)
I know that there's an workaround but it needs root, im having a new phone soon, it has android pie but i dont wanna risk bricking it because of rooting it
PLEASE FIX IT AND SEND THE FIX TO OEMs ASAP
kl...@gmail.com <kl...@gmail.com> #186
th...@gmail.com <th...@gmail.com> #187
This bug must be fixed already. How f-ing hard can it be to gt BASIC filesystem functions working? These things have worked on every device ever, since basically forever. How the actual F did this get broken, and who needs a rocket up their bottom to get this working again. Jeez.
ri...@gmail.com <ri...@gmail.com> #188
I guess Goggle Government Agencies don't want you controlling file modification time like every other Operating System on earth because they plan on using it as evidence in some kangaroo court. It is the only possible reason for nefariously crippling free open source Linux.
al...@thatgamecompany.com <al...@thatgamecompany.com> #190
mp...@gmail.com <mp...@gmail.com>
jo...@gmail.com <jo...@gmail.com> #191
This guy is commenting and impressionating me. I'll be happy to give my personal info
jo...@gmail.com <jo...@gmail.com> #192
I'm the one with the phone and don't have a computer.
jo...@gmail.com <jo...@gmail.com> #193
I do not have an SD card. I took it out since I got hacked. I use a portable modem. I've also been threatened by these people with extortion
jo...@gmail.com <jo...@gmail.com> #194
Thanks for all your patience. I'm doing this from my phone as to avoid the risk of exposing my computer. I live on South Texas and teach at Utrgv.
st...@gmail.com <st...@gmail.com> #195
b3...@gmail.com <b3...@gmail.com> #196
ar...@gmail.com <ar...@gmail.com> #197
Goo6
Description
"Both 3G and Wifi Xooms running unrooted, stock HMJ37 still show this bug.
"When running the code above on /mnt/sdcard/crap, all setLastModified() calls return false. All lastModified() calls return the timestamp when the file was created."
We should investigate, adding a warning to the setLastModified() docs if necessary.