From de964d3e775b1563864912e8b34b67b5fbb8aabf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Thu, 27 Oct 2022 22:48:23 +0800 Subject: [PATCH] Disk: only prints useful mount points on Android fix #322 --- src/detection/disk/disk_linux.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/detection/disk/disk_linux.c b/src/detection/disk/disk_linux.c index 2ff4395a9..5a9e7713f 100644 --- a/src/detection/disk/disk_linux.c +++ b/src/detection/disk/disk_linux.c @@ -55,12 +55,21 @@ void ffDetectDisksImpl(FFDiskResult* disks) while(isspace(*currentPos)) ++currentPos; + #ifdef __ANDROID__ + if(ffStrbufEqualS(&disk->mountpoint, "/") || ffStrbufEqualS(&disk->mountpoint, "/storage/emulated")) + disk->type = FF_DISK_TYPE_REGULAR; + else if(ffStrbufStartsWithS(&disk->mountpoint, "/mnt/media_rw/")) + disk->type = FF_DISK_TYPE_EXTERNAL; + else + disk->type = FF_DISK_TYPE_HIDDEN; + #else if(strstr(currentPos, "nosuid") != NULL || strstr(currentPos, "nodev") != NULL) disk->type = FF_DISK_TYPE_EXTERNAL; else if(ffStrbufStartsWithS(&disk->mountpoint, "/boot") || ffStrbufStartsWithS(&disk->mountpoint, "/efi")) disk->type = FF_DISK_TYPE_HIDDEN; else disk->type = FF_DISK_TYPE_REGULAR; + #endif //Detects stats struct statvfs fs;