Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't work on HTC Nexus 9 #1

Open
ghost opened this issue Jun 21, 2015 · 5 comments
Open

Don't work on HTC Nexus 9 #1

ghost opened this issue Jun 21, 2015 · 5 comments

Comments

@ghost
Copy link

ghost commented Jun 21, 2015

When I start the application with a stick plugged in, it does not even start.
The "Mountie" application always crashes when I try to open it.
I own a HTC Nexus 9 with root installed.
Do you need any further information?

PS:
I want to use this app because I don't want to use a proprietary app. :-)

@rutsky
Copy link
Contributor

rutsky commented Jul 28, 2015

Doesn't work on Nexus 5 either. App shows welcome string, but does nothing.

Here is what alogcat shows just after booting phone:

W/PackageManager(  785): Not granting permission android.permission.MOUNT_UNMOUNT_FILESYSTEMS to package org.brandroid.openmanager (protectionLevel=18 flags=0x18be44)
W/PackageManager(  785): Unknown permission android.permission.ACCESS_SUPERUSER in package com.morlunk.mountie
W/PackageManager(  785): Not granting permission android.permission.MOUNT_UNMOUNT_FILESYSTEMS to package com.cyanogenmod.filemanager.ics (protectionLevel=18 flags=0x18be44)
I/SystemServer(  785): Mount Service
D/MountService(  785): got storage path: null description: Internal storage primary: false removable: false emulated: true mtpReserve: 100 allowMassStorage: false maxFileSize: 0
D/MountService(  785): addVolumeLocked() StorageVolume:
D/MountService(  785):     mStorageId=65537 mPath=/storage/emulated/0 mDescriptionId=17040805 
D/MountService(  785):     mPrimary=true mRemovable=false mEmulated=true mMtpReserveSpace=100 
D/MountService(  785):     mAllowMassStorage=false mMaxFileSize=0 mOwner=UserHandle{0} mUuid=null 
D/MountService(  785):     mUserLabel=null mState=null 
W/PackageManager(  785): Not granting permission android.permission.MOUNT_UNMOUNT_FILESYSTEMS to package org.brandroid.openmanager (protectionLevel=18 flags=0x18be44)
W/PackageManager(  785): Unknown permission android.permission.ACCESS_SUPERUSER in package com.morlunk.mountie
W/PackageManager(  785): Not granting permission android.permission.MOUNT_UNMOUNT_FILESYSTEMS to package com.cyanogenmod.filemanager.ics (protectionLevel=18 flags=0x18be44)
W/MountService(  785): Duplicate state transition (mounted -> mounted) for /storage/emulated/0
W/PackageManager(  929): Failure retrieving resources for com.morlunk.mountie: Resource ID #0x0
I/k9      ( 2175): Registered: unmount receiver
I/ActivityManager(  785): Start proc 2522:com.morlunk.mountie/u0a158 for broadcast com.morlunk.mountie/.MountieBootReceiver
W/XPrivacy( 2522): Hooking package=com.morlunk.mountie
W/morlunk.mountie( 2522): type=1400 audit(0.0:9): avc: denied { read } for name="block" dev="tmpfs" ino=5796 scontext=u:r:untrusted_app:s0 tcontext=u:object_r:block_device:s0 tclass=dir
E/Mountie ( 2522): Failed to call blkid!

@rutsky
Copy link
Contributor

rutsky commented Jul 29, 2015

I'm using rooted Nexus 5 with Android 5.1.1 with SuperSU v2.46, and during (not yet finished) debug I found that in my configuration:

  1. Mountie fails to mount ext4 filesystem, because it tries to mount it with rw,nosuid,nodev,fmask=0000,dmask=0000,utf8 options, and ext4 doesn't allow fmask, dmask and utf8 options.
  2. Looks like Mountie doesn't detect when device is attached over OTG in runtime. I see attempts to mount only at Mountie startup.
  3. New versions of SuperSU uses mount namespace separation, so even if Mountie manages to mount device, it will not be visible for other application. Mount namespace separation can be disabled in SuperSU settings.

@rutsky
Copy link
Contributor

rutsky commented Jul 29, 2015

  1. Even if partition will be mounted with disabled SuperSU namespace separation, I can't read or write files on mounted device --- it fails with permission denied error, looks like some SELinux issue (since regular filesystem permissions should allow reading/writing as I see).

@rutsky
Copy link
Contributor

rutsky commented Aug 22, 2015

I managed to get Mountie work on my phone and used it on vacation to copy over 600 GB of photos/videos from SD-cards to external HDD using USB hub and OTG.
There was problems with Android performance/memory usage while copying, but Mountie worked like a charm, thanks @acomminos !

I opened PRs with fixes that I've done:

  1. Fix issue with mounting ext4 filesystem in PR Use "fmask", "dmask" and "utf8" mount options only on vfat and ntfs filesystems #2.
  2. Workaround not working FileObserver of /dev/ by adding button to manually scan for new devices in PR add button to manually call mBlockDeviceObserver.detectDevices(); #4.
  3. Opened issue Document requirement to disable mount namespace separation with recent versions of SuperSU  #5 about documenting required SuperSU configuration to override mount namespace separation.

Mentioned in previous comment issue with permissions was my mistake --- looks like I had incorrect permissions on root directory of newly created ext4 filesystem on HDD.

I had issues with building Mountie on recent versions of Android Studio. I workarounded them using StackOverflow answers in rutsky@63fb131 , but not sure that these modification are correct, since I'm not familiar with Android development.

In case Mountie development is stopped I published APK file with version with my patches that worked on my phone: https://github.com/rutsky/Mountie/releases/tag/v1.0rutsky1.
If you, @mwuttke97, still interested in Mountie, you can try my version.

@acomminos
Copy link
Owner

Thanks @rutsky! I haven't had much time to work on this project recently, so your contributions are much appreciated. I'll look into the necessary steps to ignore mount namespace separation with SuperSU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants