0

I am running Android KitKat 4.4.2 on a Samsung Galaxy SIII Neo. As a security measure I would like to prevent my phone being automatically mounted whenever I attach a USB cable from my mobile device to a PC. This way if someone steals my device they will not be able to read or copy files stored on my mobile device. However I am not sure how to turn this feature on or off.

I have read this post but I actually have USB debugging enabled under Settings | General | Developer Options. But the answer found there does not seem to apply to my device.

3
  • If its Android 4.4.x, then USB connection option in Android should be having the option of Charge only unless Samsung removed it deliberately. Do you have such option?
    – Firelord
    Mar 31 '15 at 13:33
  • 1
    Typically using a secure lock screen will solve this. You have to first unlock the device before it will allow its storage to be accessed, so if someone stole your device they'd need to also know the unlock password/pattern. Leaving adb enabled would not be probably not be wise if you are concerned about this, though. Mar 31 '15 at 14:36
  • @FIRELORD, my device doesn't have the option you mention.
    – user100380
    Apr 1 '15 at 8:15
1

I think it was in Android 4.2 a feature was added that requires the phone to allow each PC it is connected, which is identified by a unique key. You can save this key in your phone rather than having to click on accept every time.

If you want to clear the keys that you have already accepted: Settings -> Developer Options -> Revoke USB debugging authorization

Now any device that is connected to your phone must be accepted by the phone again.

This should not really be a problem unless someone steals both your phone and your laptop. If you plug your phone into someone else's computer, the phone should require your phone unlock code and explicit acceptance to allow USB debugging.


EDIT: After playing some more with these settings, I think my above answer is not really related to the mounting issue.

I don't think there is a way to prevent auto-mounting. But if your phone is locked, it should not be readable. So lock your phone. You can test whether anything is readable on your phone by plugging it in the USB cable to a computer while the phone is locked.

3
  • Yes, I don't have a PC with me at the moment to test it but I have found the button and pressed it and revoked USB debugging authorization. Can you please confirm this works even when no password or pin is set for the phone? Also, why is mounting called debugging?
    – user100380
    Apr 1 '15 at 8:13
  • What good is disabling USB going to do if you don't have a lock that prevents someone with physical access from using everything on your phone? They can just enable debugging. I think mounting and debugging get rolled together for this feature when developer mode is on, but I'm not sure.
    – mattm
    Apr 1 '15 at 13:02
  • I didn't get that dialog before 4.3 (so it might have been introduced then). But apart from that: what does ADB have to do with "auto-mounting on Windows"? Wouldn't that rather require something to be applied to UMS/MTP/PTP? Or did I miss something, and that dialog applies to all of the 4? Lacking a Windows PC (luckily), I cannot check – and I always use ADB to manually mount to my Linux box via adbfs :)
    – Izzy
    Apr 29 '15 at 15:37
2

Try this from adb shell on your PC or from a root terminal on your device:

content update --uri content://settings/secure --bind name:s:mount_ums_autostart --bind value:i:0

Per the Android source code:

/**
 * Whether or not UMS auto-starts on UMS host detection. (0 = false, 1 = true)
 * @hide
 */
public static final String MOUNT_UMS_AUTOSTART = "mount_ums_autostart";
2
  • I don't recognize `content' as a standard Linux shell command. Is there a place where I can find its man page or a description of how it works?
    – user100380
    Apr 1 '15 at 8:06
  • 1
    @user100380 That's because it's an Android command. It basically handles SQLite queries. If you simply run it without arguments it will give you usage info. Apr 1 '15 at 13:56
1

Try cutting two sync wires inside the usb cable. Keep the red and black for charging only.

https://forum.allaboutcircuits.com/threads/i-can-not-find-micro-usb-with-all-connectors.131677/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.