magnusja / libaums

Open source library to access USB Mass Storage devices on Android without rooting your device
Apache License 2.0
1.28k stars 272 forks source link

I want to support exFAT. Do you have any suggestions? #308

Closed zFDT closed 3 years ago

zFDT commented 3 years ago

Problem

At present, the project cannot support NTFS and EXFAT, I want to support them, do you have any suggestions?

Expected behavior

I want to support exFAT.I think NTFS will be difficult to support in the short term

Actual behavior

I checked, the current project supports FAT32, but not NTFS and EXFAT. I tried to connect with FAT32, NTFS and EXFAT USB drives, and recorded it. I found that when I was reading NTFSU disk, there was a problem in the process of reading the stream. It may need to be changed to SCSI command set. I gave it up for the time being (The problem :java.io.IOException: Unsuccessful Csw status: 1) When reading the EXFAT U disk, there is a problem when getting the file. I think it is necessary to parse the corresponding partition table. (The problem :java.lang.NullPointerException: Attempt to invoke interface method '.getFile()' on a null object reference) Is my analysis correct? If correct, I intend to start my work

magnusja commented 3 years ago

There is a module in the repo java-fs which includes exFAT and NTFS (read-only). <- Highly experimental

If you want to implement new file systems you do not need to do anything regarding SCSI or partition tables, but you need to implement the FileSystem and corresponding UsbFile interfaces.

In terms of exFAT there is a spec by Microsoft now, which should make it easier to implement. For NTFS, it is proprietary but for instance the Linux kernel implements it so it is not impossible.