on a non rooted android phone
Ah. Yeah, maybe not the best choice of a device for setting up a new firmware file...
Anyways, on Linux, you can explicitly mount the filesystem as
fat12 via
mount -t msdos -o rw,uid=$(id -u),gid=$(id -g),fat=12,showexec,errors=remount-ro /dev/device directory/It will not generate long filenames, but may use them if they already exist; I've not verified this.
The more basic point is that when I am seeing FACTOR~1DAT in sector 13 (above screenshot from HXD) which presumably is an attempt to create an LFN, I am not seeing any other entry for that file. There should always be the 2nd entry, FACTORY0DAT, no?
No,
FACTOR~1.DAT is the
short FAT file name entry. It is always 11 bytes, padded with spaces, with implicit
. after the eighth character. If I understand correctly, you want
only the
FACTORY0DAT entry.
The LFN uses UCS-2, so the long filename entry for
factory0.dat should be
66 00 61 00 63 00 74 00 6f 00 72 00 79 00 30 00 2e 00 64 00 61 00 74 00 00 00as a single (not split) 13-character/UCS-2 slot.
I wonder if renaming the file to
FACTORY0.DAT in Android, after transferring it, makes any difference?
Also, if you have the time, could you check if using (incorrect) name
FACTORYO.DAT, i.e. use letter O instead of zero, makes a difference?
It is possible the logic for uppercase/lowercase-only name detection is wonky in the filesystem driver, so that all filenames with non-letter characters are treated as neither uppercase nor lowercase, b0rking the long filename selection logic. If so, I can see if I can find and fix the bug in the filesystem driver causing this. Otherwise, it is a bug in MLUSB application, specifically long filename support — but I do believe it simply uses the kernel
mount interface, instead of implementing a full filesystem driver.