d4rken-org / sdmaid

SD Maid is an Android app that helps you manage files and apps.
https://play.google.com/store/apps/details?id=eu.thedarken.sdm
1.52k stars 750 forks source link

False detection of usbotg storage #1277

Closed d4rken closed 7 years ago

d4rken commented 7 years ago

SD Maid detects an USBOTG storage device that isn't actually there. This can cause SD Maid to ask the user to grant extra storage permission which is then not possible.

Sample case:

1508750763343 I/Debug: F: VERSIONNAME:4.8.3; VERSIONCODE:40803
1508750763400 I/Debug: P: VERSIONNAME: -- ; VERSIONCODE: -- 
1508750763412 D/Debug: ro.build.id=LMY47I
1508750763412 D/Debug: ro.build.display.id=TB3-710I_S000035_170327_ROW
1508750763412 D/Debug: ro.build.version.incremental=Lenovo_TB3-710I_S000035
1508750763412 D/Debug: ro.build.version.sdk=22
1508750763412 D/Debug: ro.build.version.codename=REL
1508750763413 D/Debug: ro.build.version.all_codenames=REL
1508750763413 D/Debug: ro.build.version.release=5.1
1508750763413 D/Debug: ro.build.version.security_patch=2017-03-05
1508750763413 D/Debug: ro.build.version.base_os=
1508750763413 D/Debug: ro.build.date=Mon Mar 27 10:46:04 CST 2017
1508750763413 D/Debug: ro.build.date.utc=1490582764
1508750763414 D/Debug: ro.build.type=user
1508750763414 D/Debug: ro.build.user=queen
1508750763414 D/Debug: ro.build.host=scmbuild
1508750763414 D/Debug: ro.build.tags=release-keys
1508750763414 D/Debug: ro.build.flavor=full_hq8321_tb_b2b_l-user
1508750763415 D/Debug: ro.product.model=Lenovo TB3-710I
1508750763415 D/Debug: ro.product.brand=Lenovo
1508750763415 D/Debug: ro.product.name=LenovoTB3-710I
1508750763415 D/Debug: ro.product.device=TB3-710I
1508750763415 D/Debug: ro.product.board=LenovoTB3-710I
1508750763415 D/Debug: ro.product.cpu.abi=armeabi-v7a
1508750763416 D/Debug: ro.product.cpu.abi2=armeabi
1508750763416 D/Debug: ro.product.cpu.abilist=armeabi-v7a,armeabi
1508750763416 D/Debug: ro.product.cpu.abilist32=armeabi-v7a,armeabi
1508750763416 D/Debug: ro.product.cpu.abilist64=
1508750763416 D/Debug: ro.product.manufacturer=Lenovo
1508750763416 D/Debug: ro.build.product=hq8321_tb_b2b_l
1508750763417 D/Debug: ro.build.description=full_hq8321_tb_b2b_l-user 5.1 LMY47I 1490582672 release-keys
1508750763417 D/Debug: ro.build.fingerprint=Lenovo/LenovoTB3-710I/TB3-710I:5.1/LMY47I/TB3-710I_S000035_170327_ROW:user/release-keys
1508750763417 D/Debug: ro.build.characteristics=tablet
1508750763417 D/Debug: ro.product.sw.internal.version=TB3-710I_USR_S000035_1703271200_MP6V2_ROW
1508750763418 D/Debug: ro.product.ota.model=LenovoTB3-710I_R1

Env

1508750763552 V/Shell:Static:Executor: Output : _=/system/bin/printenv
1508750763552 V/Shell:Static:Executor: Output : ANDROID_DATA=/data
1508750763553 V/Shell:Static:Executor: Output : USBOTG_STORAGE=/storage/usbotg
1508750763553 V/Shell:Static:Executor: Output : SECONDARY_STORAGE=/storage/sdcard1
1508750763553 V/Shell:Static:Executor: Output : LOOP_MOUNTPOINT=/mnt/obb
1508750763553 V/Shell:Static:Executor: Output : ANDROID_SOCKET_zygote=10
1508750763554 V/Shell:Static:Executor: Output : ANDROID_ROOT=/system
1508750763554 V/Shell:Static:Executor: Output : ANDROID_BOOTLOGO=1
1508750763554 V/Shell:Static:Executor: Output : ANDROID_ASSETS=/system/app
1508750763554 V/Shell:Static:Executor: Output : LD_PRELOAD=libdirect-coredump.so
1508750763555 V/Shell:Static:Executor: Output : BOOTCLASSPATH=/system/framework/core-libart.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/apache-xml.jar:/system/framework/mediatek-common.jar:/system/framework/mediatek-framework.jar:/system/framework/mediatek-telephony-common.jar
1508750763555 V/Shell:Static:Executor: Output : EMULATED_STORAGE_TARGET=/storage/emulated
1508750763555 V/Shell:Static:Executor: Output : EXTERNAL_STORAGE=/storage/emulated/legacy
1508750763556 V/Shell:Static:Executor: Output : ANDROID_STORAGE=/storage
1508750763556 V/Shell:Static:Executor: Output : PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
1508750763556 V/Shell:Static:Executor: Output : SYSTEMSERVERCLASSPATH=/system/framework/services.jar:/system/framework/ethernet-service.jar:/system/framework/wifi-service.jar
1508750763556 V/Shell:Static:Executor: Output : ANDROID_PROPERTY_WORKSPACE=9,0
1508750763557 V/Shell:Static:Executor: Output : ASEC_MOUNTPOINT=/mnt/asec
1508750763557 V/Shell:Static:Executor: Output : EMULATED_STORAGE_SOURCE=/mnt/shell/emulated

Mounts

1508750784978 V/Shell:Interactive: Output : rootfs on / type rootfs (ro,seclabel)
1508750784978 V/Shell:Interactive: Output : tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,mode=755)
1508750784979 V/Shell:Interactive: Output : devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
1508750784979 V/Shell:Interactive: Output : none on /dev/cpuctl type cgroup (rw,relatime,cpu)
1508750784979 V/Shell:Interactive: Output : adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
1508750784980 V/Shell:Interactive: Output : proc on /proc type proc (rw,relatime)
1508750784980 V/Shell:Interactive: Output : sysfs on /sys type sysfs (rw,seclabel,relatime)
1508750784980 V/Shell:Interactive: Output : selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
1508750784981 V/Shell:Interactive: Output : none on /sys/fs/cgroup type tmpfs (rw,seclabel,relatime,mode=750,gid=1000)
1508750784981 V/Shell:Interactive: Output : debugfs on /sys/kernel/debug type debugfs (rw,seclabel,relatime)
1508750784981 V/Shell:Interactive: Output : none on /acct type cgroup (rw,relatime,cpuacct)
1508750784981 V/Shell:Interactive: Output : tmpfs on /mnt/asec type tmpfs (rw,seclabel,relatime,mode=755,gid=1000)
1508750784982 V/Shell:Interactive: Output : tmpfs on /mnt/obb type tmpfs (rw,seclabel,relatime,mode=755,gid=1000)
1508750784982 V/Shell:Interactive: Output : tmpfs on /mnt/media_rw type tmpfs (rw,seclabel,relatime,mode=755,uid=1000,gid=1000)
1508750784982 V/Shell:Interactive: Output : /dev/block/vold/179:129 on /mnt/media_rw/sdcard1 type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
1508750784983 V/Shell:Interactive: Output : tmpfs on /storage/usbotg type tmpfs (rw,seclabel,relatime,mode=755,uid=1000,gid=1000)
1508750784983 V/Shell:Interactive: Output : tmpfs on /storage/emulated type tmpfs (rw,seclabel,relatime,mode=755,uid=1023,gid=1023)
1508750784983 V/Shell:Interactive: Output : tmpfs on /storage/emulated type tmpfs (rw,seclabel,nosuid,nodev,relatime,mode=751,gid=1028)
1508750784984 V/Shell:Interactive: Output : /dev/block/platform/mtk-msdc.0/by-name/system on /system type ext4 (ro,seclabel,relatime,data=ordered)
1508750784984 V/Shell:Interactive: Output : /dev/block/platform/mtk-msdc.0/by-name/userdata on /data type ext4 (rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,resuid=10010,data=ordered)
1508750784985 V/Shell:Interactive: Output : /dev/block/platform/mtk-msdc.0/by-name/cache on /cache type ext4 (rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered)
1508750784985 V/Shell:Interactive: Output : /dev/block/platform/mtk-msdc.0/by-name/protect1 on /protect_f type ext4 (rw,seclabel,nosuid,nodev,noatime,nodelalloc,noauto_da_alloc,commit=1,data=ordered)
1508750784985 V/Shell:Interactive: Output : /dev/block/platform/mtk-msdc.0/by-name/protect2 on /protect_s type ext4 (rw,seclabel,nosuid,nodev,noatime,nodelalloc,noauto_da_alloc,commit=1,data=ordered)
1508750784985 V/Shell:Interactive: Output : /dev/block/platform/mtk-msdc.0/by-name/nvdata on /nvdata type ext4 (rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered)
1508750784986 V/Shell:Interactive: Output : /dev/block/loop0 on /mnt/cd-rom type iso9660 (ro,relatime)
1508750784986 V/Shell:Interactive: Output : /dev/fuse on /mnt/shell/emulated type fuse (rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other)
1508750784986 V/Shell:Interactive: Output : /dev/block/vold/179:129 on /mnt/secure/asec type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
1508750784986 V/Shell:Interactive: Output : /dev/fuse on /storage/sdcard1 type fuse (rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other)
1508750784987 V/Shell:Interactive: Output : /dev/fuse on /storage/emulated/0 type fuse (rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other)
1508750784987 V/Shell:Interactive: Output : /dev/fuse on /storage/emulated/legacy type fuse (rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other)
1508750784988 V/Shell:Interactive: Output : tmpfs on /mnt/shell/emulated type tmpfs (rw,seclabel,nosuid,nodev,relatime,mode=700)
d4rken commented 7 years ago

Some extra infos:

d4rken commented 7 years ago

Without sdcard

1508759429965 V/Shell:Interactive: Output : rootfs on / type rootfs (ro,seclabel)
1508759429966 V/Shell:Interactive: Output : tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,mode=755)
1508759429967 V/Shell:Interactive: Output : devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
1508759429967 V/Shell:Interactive: Output : none on /dev/cpuctl type cgroup (rw,relatime,cpu)
1508759429968 V/Shell:Interactive: Output : adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
1508759429968 V/Shell:Interactive: Output : proc on /proc type proc (rw,relatime)
1508759429969 V/Shell:Interactive: Output : sysfs on /sys type sysfs (rw,seclabel,relatime)
1508759429969 V/Shell:Interactive: Output : selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
1508759429969 V/Shell:Interactive: Output : none on /sys/fs/cgroup type tmpfs (rw,seclabel,relatime,mode=750,gid=1000)
1508759429970 V/Shell:Interactive: Output : debugfs on /sys/kernel/debug type debugfs (rw,seclabel,relatime)
1508759429970 V/Shell:Interactive: Output : none on /acct type cgroup (rw,relatime,cpuacct)
1508759429970 V/Shell:Interactive: Output : tmpfs on /mnt/asec type tmpfs (rw,seclabel,relatime,mode=755,gid=1000)
1508759429971 V/Shell:Interactive: Output : tmpfs on /mnt/obb type tmpfs (rw,seclabel,relatime,mode=755,gid=1000)
1508759429971 V/Shell:Interactive: Output : tmpfs on /mnt/media_rw type tmpfs (rw,seclabel,relatime,mode=755,uid=1000,gid=1000)
1508759429972 V/Shell:Interactive: Output : tmpfs on /storage/usbotg type tmpfs (rw,seclabel,relatime,mode=755,uid=1000,gid=1000)
1508759429972 V/Shell:Interactive: Output : tmpfs on /storage/emulated type tmpfs (rw,seclabel,relatime,mode=755,uid=1023,gid=1023)
1508759429973 V/Shell:Interactive: Output : tmpfs on /storage/emulated type tmpfs (rw,seclabel,nosuid,nodev,relatime,mode=751,gid=1028)
1508759429973 V/Shell:Interactive: Output : /dev/block/platform/mtk-msdc.0/by-name/system on /system type ext4 (ro,seclabel,relatime,data=ordered)
1508759429974 V/Shell:Interactive: Output : /dev/block/platform/mtk-msdc.0/by-name/userdata on /data type ext4 (rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,resuid=10010,data=ordered)
1508759429974 V/Shell:Interactive: Output : /dev/block/platform/mtk-msdc.0/by-name/cache on /cache type ext4 (rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered)
1508759429975 V/Shell:Interactive: Output : /dev/block/platform/mtk-msdc.0/by-name/protect1 on /protect_f type ext4 (rw,seclabel,nosuid,nodev,noatime,nodelalloc,noauto_da_alloc,commit=1,data=ordered)
1508759429975 V/Shell:Interactive: Output : /dev/block/platform/mtk-msdc.0/by-name/protect2 on /protect_s type ext4 (rw,seclabel,nosuid,nodev,noatime,nodelalloc,noauto_da_alloc,commit=1,data=ordered)
1508759429976 V/Shell:Interactive: Output : /dev/block/platform/mtk-msdc.0/by-name/nvdata on /nvdata type ext4 (rw,seclabel,nosuid,nodev,noatime,discard,noauto_da_alloc,data=ordered)
1508759429976 V/Shell:Interactive: Output : /dev/block/loop0 on /mnt/cd-rom type iso9660 (ro,relatime)
1508759429976 V/Shell:Interactive: Output : /dev/fuse on /mnt/shell/emulated type fuse (rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other)
1508759429977 V/Shell:Interactive: Output : /dev/fuse on /storage/emulated/0 type fuse (rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other)
1508759429977 V/Shell:Interactive: Output : /dev/fuse on /storage/emulated/legacy type fuse (rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other)
1508759429978 V/Shell:Interactive: Output : tmpfs on /mnt/shell/emulated type tmpfs (rw,seclabel,nosuid,nodev,relatime,mode=700)
21101969sanjay commented 7 years ago

Not working properly with mi max 2