Disabling USB for Security - Nexus 4 General

I didn't see this posted anywhere else. So I thought I would share it.
This is for people that want to secure their USB port. By using the following scripts, you can have total control over your USB port. ADB and MTP/PTP will be disabled. Your USB port will only be used for charging until you run the enable script. This seems to be a much more secure way to disable ADB and MTP/PTP than fast charging mode which only worked sporadically for me. Plus, USB debugging will still be enabled on your device. So programs that require USB debugging won't be effected.
Disable USB:
http://www.mediafire.com/view/?updepkqf7slz4hm
Enable USB:
http://www.mediafire.com/view/?b8a561180v5kq8v
init.d script:
http://www.mediafire.com/download.php?bzohq9tw7jg2fy0
These scripts change the value of /sys/devices/virtual/android_usb/android0/enable from 1 to 0. I use these scripts with Tasker to disable and enable my USB port when I leave and come back home.
I also have a manual toggle in Tasker to enable USB when I need it. Here is that toggle in app form via App Factory: http://www.mediafire.com/download.php?72mkkcvw6mzbhgs
If you use the app instead of the scripts, you'll still need the init.d script to be fully protected at boot.
If you are connected to your computer when you enable USB, the effect should be immediate. If you are already connected to your computer when you disable USB, you need to disconnect and reconnect the cable for the settings to take hold. That means there is no chance that these scripts will interrupt any transfers that are taking place.
To prevent your security from being circumvented on boot, use the init.d script provided above. It will disable USB on boot even if the USB cable is connected (no need to disconnect and reconnect).

freddysam said:
I didn't see this posted anywhere else. So I thought I would share it.
This is for people that want to secure their USB port. By using the following scripts, you can have total control over your USB port. ADB and MTP/PTP will be disabled. Your USB port will only be used for charging until you run the enable script. This seems to be a much more secure way to disable ADB and MTP/PTP than fast charging mode which only worked sporadically for me. Plus, USB debugging will still be enabled on your device. So programs that require USB debugging won't be effected.
Disable USB:
http://www.mediafire.com/view/?updepkqf7slz4hm
Enable USB:
http://www.mediafire.com/view/?b8a561180v5kq8v
init.d script:
http://www.mediafire.com/download.php?bzohq9tw7jg2fy0
These scripts change the value of /sys/devices/virtual/android_usb/android0/enable from 1 to 0. I use these scripts with Tasker to disable and enable my USB port when I leave and come back home.
I also have a manual toggle in Tasker to enable USB when I need it. Here is that toggle in app form via App Factory: http://www.mediafire.com/download.php?72mkkcvw6mzbhgs
If you use the app instead of the scripts, you'll still need the init.d script to be fully protected at boot.
If you are connected to your computer when you enable USB, the effect should be immediate. If you are already connected to your computer when you disable USB, you need to disconnect and reconnect the cable for the settings to take hold. That means there is no chance that these scripts will interrupt any transfers that are taking place.
To prevent your security from being circumvented on boot, use the init.d script provided above. It will disable USB on boot even if the USB cable is connected (no need to disconnect and reconnect).
Click to expand...
Click to collapse
Hi, Will this work with my samsung note 3 rooted with tasker?
Thanks!

jdogg4000 said:
Hi, Will this work with my samsung note 3 rooted with tasker?
Thanks!
Click to expand...
Click to collapse
It depends on your kernel, but so long as this path exists on your phone:
/sys/devices/virtual/android_usb/android0/
It should work. If the path is slightly different, you'll have to edit the scripts to include the correct path.

Doing this doesnt act the same?
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
sent from my diabetic Nexus 4 (too much KitKats).

Related

Help please! Vario III not connecting after hard reset.

Hi there, I could really use some help.
I had to reset my T Mobile Vario III and now when I try and sync it up to my pc, it can't even connect.
I get a "found new hardware" wizard and if I run that, I get this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I can't see what the problem is as surely a hard reset takes it back to "just out of the box" condition? Therefore, I should be able to sync it up again as I did when I bought it......
......shouldn't I?
Any help most gratefully received.
BUMP
Anyone?
C'mon folks, I'm in pain here.
Just when I'd got it running nicely with some super progs and apps courtesy of my xda buddies, I did a hard reset for a particular reason and now I'm in PDA-limbo.
Everything else is working as per a regular hard reset, BTW.
So what's the prob? Do I need to download drivers or what?
The only thing I can think of is that the RNDIS driver on the PC has become corrupt or is missing.
All I can suggest is that you uninstall activesync from your PC, restart it and then re-install it if not with the very latest version which should be on the CD that came with your device. Restart your PC again and then and only then connect your VIII and see if the PC picks it up this time.
Good Luck and let us know your progress
C.
Thanks Stinkey, I'll try that when I get home (in the queue at the bank at the mo), hopefully it'll sort it out.
Either that or plug your sync cable into a different USB port, failing that (on yor PC whilst phone connected) go to Control panel, System, Hardware, Device manager and under Network adapters, uninstall the Windows Mobile-based device, then after that, unplug your phone then re-connect it. Try a PC restart if it does not connect after driver install.
Hope that works.
Thanks for the advice gents but sadly it's been to no avail.
Can anyone suggest a next approach?
BUMP.
Anybody able to help?
The fact that your PC is seeing your mobile as a different unit after a hard reset is a puzzle!
Are you using orig firmware or a cooked ROM?
Original.
Thinking about it, the problem didn't occur immediately after the reset.
I had it connected and synced up, then something happened - I can't remember what, either the pc timed out and went to standby or "the Mrs" had to log on to her side of the pc - and something got pi$$ed off along the line, hence these problems.
I'm thinking more that the pc is at fault somehow 'cos the Vario is working perfectly otherwise.
Then try a system restore to before the problem happened.
I have seen on other threads that one guy had a faulty usb cable and another had this problem when going thru a USB hub instead of direct to the PC.
Maybe the USB port you are using cannot supply enough current. The Kaiser starts to charge as soon as it connects and can drop out the USB port if it can't support it and this may start to happen at a later date if the USB port power supply circuit dies.

Phone charges fine but not seen by computer

I have a Verizon MOTO X 2014 32GB working almost fine, only that it doesn't get recognised when plugged into a computer. No sound, nothing except that it somehow still charges either plugged into a charger or a computer via USB but never gets recognised like MTP or PTP or whatever, just charging only. I've searched everywhere to see if anyone else has seen this issue before and if there's a fix for it before posting this here. Any suggestions would be welcome.
Thanks.
ezeuba said:
I have a Verizon MOTO X 2014 32GB working almost fine, only that it doesn't get recognised when plugged into a computer. No sound, nothing except that it somehow still charges either plugged into a charger or a computer via USB but never gets recognised like MTP or PTP or whatever, just charging only. I've searched everywhere to see if anyone else has seen this issue before and if there's a fix for it before posting this here. Any suggestions would be welcome.
Thanks.
Click to expand...
Click to collapse
Did you try tapping the 'Charging only' displayed in a notification when you connect USB cable to PC(if you're running MM). If its not the case then maybe try replacing your Data Cable, as it may also be the culprit
hamzaalijoiyah said:
Did you try tapping the 'Charging only' displayed in a notification when you connect USB cable to PC(if you're running MM). If its not the case then maybe try replacing your Data Cable, as it may also be the culprit
Click to expand...
Click to collapse
Running Lollipop 5.1 and I've tried everything that can be done from any setting on the phone. I have also tried several USB cables with no luck yet. Thanks.
Have you tried changing it to MTP under developer options?
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Under developer options,
Please where exactly is this setting located in Developer Options? I can't find anything related to it in mine. Thanks.
Just realized you were running v5.1
Try this:
To enable USB file transfer go to “Settings” > “Storage” > Tap on the three vertical dots in the top-right corner of your screen > “USB computer connection” > Tick the box next to “Media device (MTP)

Disable Allow Access to Phone Data

Is there a way to disable this or permanently allow access? I have no idea why but after my last factory reset it didn't pop up so I know it's possible.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Anyone?
Is it actually connected to a PC when these "normal" pop ups occur?
If not, I suspect a dirty USB Type-C port.
Any luck? I also want these prompts to remain hidden. I dont need to be notifed about this every time I connect my device to my vehicle to charge.
For me when I do "Cancel Autorisation for Debug USB" in Developper Settings, there is an additional Pop up that appear, saying to Remeber the answer for this PC, and always an option to tick to remeber for this PC, and some serial number related to my PC appear.
Of course I select all those, and always for this PC, it is supposed to remember my answer, but it doesnt! everytime I need to connect to my PC need to allow that ****!!
On my S7e I need to allows & remember answer for this PC aand it works like a charm, it never pop up again and connection between Phone and PC is working as should.
I read around that Root should be present for some kind of Auto Allow, but could not find any modules or anything...
If someone know how to accomplish that with Root, thx in advance.
saoudien07 said:
For me when I do "Cancel Autorisation for Debug USB" in Developper Settings, there is an additional Pop up that appear, saying to Remeber the answer for this PC, and always an option to tick to remeber for this PC, and some serial number related to my PC appear.
Of course I select all those, and always for this PC, it is supposed to remember my answer, but it doesnt! everytime I need to connect to my PC need to allow that ****!!
On my S7e I need to allows & remember answer for this PC aand it works like a charm, it never pop up again and connection between Phone and PC is working as should.
I read around that Root should be present for some kind of Auto Allow, but could not find any modules or anything...
If someone know how to accomplish that with Root, thx in advance.
Click to expand...
Click to collapse
Can you try disabling com.sec.usbsettings with ADB? I believe that app is what controls the pop up, but it might break other things. Honestly this was a huge f up by samsung. What were they thinking? Why would we want a pop up message every time we plug our phone into our vehicle to charge it or to use android auto?
tworla said:
Can you try disabling com.sec.usbsettings with ADB? I believe that app is what controls the pop up, but it might break other things. Honestly this was a huge f up by samsung. What were they thinking? Why would we want a pop up message every time we plug our phone into our vehicle to charge it or to use android auto?
Click to expand...
Click to collapse
unfortunaly I tried looking for "com.sec.usbsettings" to disable it with ADB, but not avalable on my phone.
I had hope with Firefds Kits Module & Xposed, but dont seems to be working, that was the kind of solution I was looking for. Sure should some kind of trick like that around.
I have this issue too. Honestly the only solution seems to be to not plug your device into any kind of computer to charge. If the issue is happening when you plug your device into your vehicle to use android auto, then you would have to use wireless android auto and set your USB behavior to disable file transfer which will prevent it from attempting to connect to the head unit computer which causes the stupid message. Kind of a dumb design oversight to have to prompt the user with no way to turn it off but what did you expect? These are the same people who came up with all this other forced system bloatware like device care.

Huawei p20 pro problem

anybody here experience with their p20 pro cant be detected in PC, MAC, Laptop. but it charges when inserted the usb, i tried to allow the hisuite....
what am i missing
try different USB port or different cable. Make sure you follow the on-screen instructions carefully. It instruct u to allow HDB permission on phone. If u don't do that, the phone won't be detected by HiSuite.
P20 Pro connection problem
thank you for your reply.
i use my old phone(P9) with the type C cable- it works fine
here are the facts:
- first i use its default cable(doesnt work but it charges)
- second i use my previous cable from p9(doesnt work but it charges)
- third i bought a type C cable(doesnt work but it charges)
- i Reset the phone - no success
- no screen instruction were display when plugged into computer
- i tried it in PC, Mac, Laptop (on all its usb port)
- i allowed HBD
- i even enabled USB debugging
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
cant find any support on the net.
marke1415 said:
thank you for your reply.
i use my old phone(P9) with the type C cable- it works fine
here are the facts:
- first i use its default cable(doesnt work but it charges)
- second i use my previous cable from p9(doesnt work but it charges)
- third i bought a type C cable(doesnt work but it charges)
- i Reset the phone - no success
- no screen instruction were display when plugged into computer
- i tried it in PC, Mac, Laptop (on all its usb port)
- i allowed HBD
- i even enabled USB debugging
cant find any support on the net.
Click to expand...
Click to collapse
Stupid question . but did you set it to "transfer files" as standard
if not try that ..
in setting , developer options , select USB Configuration , i chose MTP
anybody here expirienced this bug? or is it a bug or i am missing something
marke1415 said:
anybody here expirienced this bug? or is it a bug or i am missing something
Click to expand...
Click to collapse
Go to Settings/System/Developer Options.
Enable "Always prompt when connecting to USB".
Connect with USB cable, in popup choose "Transfer files"
Start Hisuite.
Should be okay now.
kupa said:
Go to Settings/System/Developer Options.
Enable "Always prompt when connecting to USB".
Connect with USB cable, in popup choose "Transfer files"
Start Hisuite.
Should be okay now.
Click to expand...
Click to collapse
Go to Settings/System/Developer Options. --> OK
Enable "Always prompt when connecting to USB". --> OK
Connect with USB cable, in popup choose "Transfer files" --> NO POPUP
Start Hisuite. --> DEVICE NOT CONNECTED
maybe my unit is defective
marke1415 said:
Go to Settings/System/Developer Options. --> OK
Enable "Always prompt when connecting to USB". --> OK
Connect with USB cable, in popup choose "Transfer files" --> NO POPUP
Start Hisuite. --> DEVICE NOT CONNECTED
maybe my unit is defective
Click to expand...
Click to collapse
Well, that’s kind of strange, you should get the popup when you ask for it.
Do you get any notification when you connect via USB?
If you do, you can tap and choose “Transfer files”.
If you don’t, go to Settings/Apps & Notifications/Notifications Management/Settings/USB connection.
Enable here (see picture), as a start.
Do you get a notification now, when connecting with USB?
If you do, tap and choose “Transfer files”.
If you're on beta, you can't connect to pc. Also you can't do usb tethering
@kupa
Do you get any notification when you connect via USB? -->NO
If you don’t, go to Settings/Apps & Notifications/Notifications Management/Settings/USB connection. --> I ALREADY DID
Do you get a notification now, when connecting with USB? -->STILL NO POP UP NOTIFICATION
i heard i ding sound on my phone whenever i plugin the usb, but its only charging.
@Afiuq
If you're on beta, you can't connect to pc. Also you can't do usb tethering
- you mean my unit is a beta copy?
- how will i know?
- is it upgrade able?
@marke1415
I am having the same issue trying to connect to a MBP - I can try connecting to a PC tomorrow. My phone *does* bring up the usb prompt whenever I plug in the cable however.
Hey, so I have the exact same issue, where the phone doesn't appear on the computer, I get no popups from the phone even though all the settings are correct and the phone doesn't even appear in the device manager of the computer. I have tried installing some drivers (Not specific ones because i can't select the device in device manager).
This is also a fresh phone, due to some other stupid stuff I factory reset my phone, I'm also on a Chinese version CLT-AL00
Had same issue found a fix
I had the exact same issue. There was no popup to ask what I wanted to do and all it would do is charge. Tried developer options etc etc and everything everyone's been suggesting here.
My uncle finally found something that worked straight away. Download 'USB settings' on the play store. Worked straight away no issues. Must be a software thing then I guess. Worked for us anyway so hopefully will work for you ??
Happened to me once, make sure the driver installed on the computer is the correct one, install Hisuite which comes with drivers.
Check your device manager (windows) also hidden devices, uninstalling a problematic device could be the culprit, try the below first.
With your device just start over.
Go to dev options.
Revoke usb debugging
Disable usb debugging
Turn on always prompt switch
If it's on already, turn it off and connect to computer, if it prompts then great.
If not. Disconnect and turn the prompt switch on.
Reconnect.
If it still doesn't then disconnect, turn off the prompt and enable USB debugging, turn on the prompt and reconnect.
If it doesn't work after that, try another computer, clean the port (toothbrush should do it)
Try another cable.
Install the hisuite app if you don't already have it, reconnect.
If it still doesn't then I'm at a loss.
initially encounter the same problem connecting P20 Pro to pc,
Finally get it to work by connecting P20 Pro to my laptop USB 3.1 port via huawei high speed usb cable, it wont work on USB 2.0 port or on normal speed cable.
Hmm.
Dial *#*#2846579#*#*
Go to background settings
Then USB Settings
See if HiSuite option is selected

Dropped phone - trying to recover the data

Hi all,
Dropped my phone and the phone stopped responding. I tried replacing the screen but this made no difference.
Since the phone was just not turning on at all (no sort of response), I tried to replace the charging port after (after the drop, the sim card tray was damaged so thought the issue might be around here).
After I replaced the charging port, I managed to get the notfication light flashing (with a power source) and now it is solid.
When I connect it to my PC, I hear the notification sound when a device has been connected but unable to view any files or see it show in my PC.
I feel like I'm close to getting the phone working but not quite there yet. I am mainly interested in just recovering the data.
Any help would be much appreciated.
In this case, you need a screen, either on the phone itself, or an external one, and a mouse to navigate the options, if you manage to get the screen to work, enable USB debugging, run adb devices, if your phone shows up as a device (reference screenshot:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
), you can run adb pull /sdcard/ to copy all the files from it to your PC, but if it shows up as unauthorized (reference screenshot:
), you need to allow usb debugging on the phone, then run adb pull /sdcard/ to copy the data.
And remember for the sake of god NEVER use MTP if you're copying more than one small file at a time, as it is known to corrupt large files, or large quantities of files, if you do not want corruption use adb pull
Miki200_ said:
In this case, you need a screen, either on the phone itself, or an external one, and a mouse to navigate the options
Click to expand...
Click to collapse
Thank you for your reply - do you have any recommendations here? Specifically for xiaomi 9t pro? I read somewhere an MHL cable would not work
Dropped my phone and it stopped working. Replaced screen, still doesn't work. Replace charging port and notification light started blinking and turned solid though I don't see it anymore.
But the phone connects to the PC - I just can't access the phone. Using ADB I get a serial number followed by unrecgonised.
What can I use for this phone to get some sort of display, and something to control? Based in UK so any UK links would be appreciated.
plshelpmepls said:
Thank you for your reply - do you have any recommendations here? Specifically for xiaomi 9t pro? I read somewhere an MHL cable would not work
Click to expand...
Click to collapse
The cable you got with the phone should work for this.
plshelpmepls said:
Dropped my phone and it stopped working. Replaced screen, still doesn't work. Replace charging port and notification light started blinking and turned solid though I don't see it anymore.
But the phone connects to the PC - I just can't access the phone. Using ADB I get a serial number followed by unrecgonised.
What can I use for this phone to get some sort of display, and something to control? Based in UK so any UK links would be appreciated.
Click to expand...
Click to collapse
Well, unrecognized means ADB does not even know what type of device is that, that's not good.
Any dock for a macbook using USB-C should work, as for proper stuff:
https://www.amazon.co.uk/UGREEN-Multiport-Adapter-Ethernet-Compatible-Grey
https://www.amazon.co.uk/UGREEN-Aluminium-Delivery-Charging-Compatible-Space-Grey
These two should also work with it.
Miki200_ said:
Well, unrecognized means ADB does not even know what type of device is that, that's not good.
Any dock for a macbook using USB-C should work, as for proper stuff:
https://www.amazon.co.uk/UGREEN-Multiport-Adapter-Ethernet-Compatible-Grey
https://www.amazon.co.uk/UGREEN-Aluminium-Delivery-Charging-Compatible-Space-Grey
These two should also work with it.
Click to expand...
Click to collapse
Sorry, not sure why I said unrecognised - I get unauthorised like you mentioned before. Will try these options, thank you.
Miki200_ said:
Well, unrecognized means ADB does not even know what type of device is that, that's not good.
Any dock for a macbook using USB-C should work, as for proper stuff:
https://www.amazon.co.uk/UGREEN-Multiport-Adapter-Ethernet-Compatible-Grey
https://www.amazon.co.uk/UGREEN-Aluminium-Delivery-Charging-Compatible-Space-Grey
These two should also work with it.
Click to expand...
Click to collapse
Are you sure these work? I have another working 9T pro and cannot get any display. I'm using https://www.amazon.co.uk/gp/product/B07PPGWQ15/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
plshelpmepls said:
Are you sure these work? I have another working 9T pro and cannot get any display. I'm using https://www.amazon.co.uk/gp/product/B07PPGWQ15/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
Click to expand...
Click to collapse
Well, there is no way to be sure if these will work, it's just a guess based on what standards the phone supports
plshelpmepls said:
Sorry, not sure why I said unrecognised - I get unauthorised like you mentioned before. Will try these options, thank you.
Click to expand...
Click to collapse
Ok, so, you somehow need to authorize the PC for USB Debugging

Categories

Resources