magnusja / libaums

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

IOException: unsupported PeripheralQualifier or PeripheralDeviceType #402

Closed Vertroid closed 9 months ago

Vertroid commented 10 months ago

Problem

Hi, I'm facing a problem with my disk driver enclosure. When plugged in and initialized my device object, it threw an IOException as the title above. The message right before the exception is this:

D/ScsiBlockDevice: inquiry response: ScsiInquiryResponse [peripheralQualifier=0, peripheralDeviceType=13, removableMedia=false, spcVersion=6, responseDataFormat=2]

Then I checked what the device type was. I'm not 100% sure but I found that device type 0x0D indicated enclosure services device. I thought there was something to do with my device because it is truly a disk driver enclosure with SSD in it. So I'm asking do we support this kind of device? Or whether I can do something to make this work properly.

Expected behavior

The device initializes successfully.

Actual behavior

The device cannot be initialized

Stacktrace

D/PartitionTableFactory: FileSystemPartitionTableCreator returned null
D/GPT: EFI test string EFI PART
D/GPT: EFI test string matches!
D/PartitionTableFactory: Found partition table GPTCreator
W/.moonplayer_gvr: Got a deoptimization request on un-deoptimizable method boolean libcore.io.Linux.access(java.lang.String, int)
W/.moonplayer_gvr: Got a deoptimization request on un-deoptimizable method boolean libcore.io.Linux.access(java.lang.String, int)
W/System.err: log4j:WARN No appenders could be found for logger (me.jahnen.libaums.core.fs.ntfs.NTFSStructure).
W/System.err: log4j:WARN Please initialize the log4j system properly.
D/ScsiBlockDevice: inquiry response: ScsiInquiryResponse [peripheralQualifier=0, peripheralDeviceType=13, removableMedia=false, spcVersion=6, responseDataFormat=2]

Code where problem occurs

        UsbMassStorageDevice[] devices = UsbMassStorageDevice.getMassStorageDevices(this.mContext);
        for(UsbMassStorageDevice device : devices) {
            try {
                device.init();
            } catch(IllegalStateException | IOException  e) {
                continue;
            }
        }
magnusja commented 9 months ago

The log says that it found a gpt partition table. So I wonder why it would send an inquiry again.

Also this project does not have a ntfs implementation. So you probably run a modified lib. I would ask the author of that modified lib for help tbh.