How To Disable Some Functions Of USB Port - Galaxy S3 Neo Q&A, Help & Troubleshooting

I am wondering around the internet to learn any method to disable MTP/PTP/all usb stuff except charging.
So, why i want this?
Because i want my device to be secure.
I don't anyone to sneak around and try to go into bootloader or recovery/connection to a pc etc to set my device to make a fresh start/copying data and end my privacy up.
So is there a way to disable those functions?
And if it is possible then what? Will it be secured?
And the big question is that can i enable it through recovery (from adb or moving mobile files) as you know if one has a messed up rom then he/she should have those functions workable.
.
@LGaljo?
@nik60?
@MAXSIMUS96?
@adityaupreti?
@Ciro?
@Renix63?
@sev3n1985?

delete mtpApplication.apk in syste/priv-app and in dev options..deflag debug usb
anyway ...not tried because i don't use pin in LS--but in S6 when phone is locked with pin is not recognized with PC

So will it disable the mobile to connect to a pc through bootloader?

I found this on a web:
.
The most device-compatible way to disable everything is to run this command at startup or set this in your build.prop:
Code:
setprop persist.sys.usb.config none
which is equivalent to charge-only on all Android devices.
That also disables adb. If you use adb regularly, then:
Code:
setprop persist.sys.usb.config adb
will allow adb when developer options are turned on/checked. If you don't use ADB often, I would not recommend it, because setting adb causes my S5 to still recognize in device manager, even when it is locked.
To restore original functionality,
Code:
setprop persist.sys.usb.config mtp,ptp,adb
allows all USB protocols.

Related

[Q] Yet another adb authentication problem

Hi, i've been using my nexus 4 for a long time but recently (probably since patch 4.4.2) I've had this problem where I don't get adb authentication prompt on my phone when using usb-debugging. I have Cyanogenmod latest stable version installed.
I'm using adb drivers that come with android sdk (also tried 4 others!), version of adb is recent (1.0.31) and I have verified that by typing adb version.
adb devices list my nexus 4 as unauthorized (reboot bootloader gives unauthorized too) cause the prompt doesn't appear as it should.
I've done some extensive searching and here are what I've tried (to summerize these, I've tried all solutions currently on the internet probably) - this list might be incomplete as I don't remember everything I did:
Uninstall all usb related drivers and reinstall the correct drivers again (multiple times, with reboots).
Disabling and reenabling usb-debugging. Unplug and plug phone in. restarting adb server... etc.
disabling MTP, even trying PTP and tethering (desperation).
trying to set usb secure to 0 (wasn't set to zero, any way for me to set it to zero?)
trying to manually copy keys from computer to android (very weird that this one didn't work, maybe I did something wrong?)
Edit: I think I figured out why setting secure to 0 didn't persist. Working on it, learning how to unpack bootimg.

no fastboot or adb access

I can't access my N7 with adb (when booted) or fastboot (while in the bootloader). It's connected via a USB cable. This is both with a Mac and WUGS. Commands like fastboot devices or adb devices return nothing as the device isn't seen. I can connect my N4 and use those commands without problem. I just tried doing the same with my 2013 N7 and it's not being seen, either. Strange. I don't think I've had this problem before on the Mac. I have on Windows, which I can sometimes resolve by installing and reinstalling drivers until something works.
I'd wanted to update the 2012 N7 to Lollipop.
Thoughts, anyone?
maigre said:
I can't access my N7 with adb (when booted) or fastboot (while in the bootloader). It's connected via a USB cable. This is both with a Mac and WUGS. Commands like fastboot devices or adb devices return nothing as the device isn't seen. I can connect my N4 and use those commands without problem. I just tried doing the same with my 2013 N7 and it's not being seen, either. Strange. I don't think I've had this problem before on the Mac. I have on Windows, which I can sometimes resolve by installing and reinstalling drivers until something works.
I'd wanted to update the 2012 N7 to Lollipop.
Thoughts, anyone?
Click to expand...
Click to collapse
Crazy as it sounds, try another USB cable. Reboot everything, plug in fresh, and try again. Failing that, use WUGS to reinstall all your USB drivers. Use the stock Google.
The cable was the culprit. I tried another and it worked. Thanks so much!
I'm having a similar problem that's driving me insane.
Nexus 7 wi-fi version
I've loaded every driver on the planet and in recovery mode it simply will not show up. And I'm not talking won't show up using ADB, I get absolutely nothing in device manager. So before anyone tells me to point to the device and manually change the driver, there is no device to try and point a driver to.
In "normal" mode, it shows up perfectly fine in Device Manager as Android ADB Composite Device. ADB will list it in devices with no problem. It will accept the "adv reboot recovery" command perfectly and reboot the tablet into stock recovery. The minute it does that, the device disappears from the Device Manager list and nothing takes it's place. I've tried to have it search for new hardware, I've tried the Google USB drivers kit, I've used Koush's Universal Driver install. I've used 3 different cables on 2 different USB ports.
This is a completely stock N7 running 4.4.4 plugged into a Windows 8.1 64 bit PC.
The last thing I'm wondering is do I have to unlock the bootloader at all? I don't want to because it'll wipe the tablet. If so I guess I'll just wait out the actual OTA rather than try to sideload it.
Any suggestions would be appreciated.
Yaz75 said:
Any suggestions would be appreciated.
Click to expand...
Click to collapse
Any suggestions at all?
Ummm... does the Stock Recovery actually run "adbd" by default? If it doesn't (or it doesn't start adbd until you execute the sideload menu item), then you wouldn't normally see anything on the other side of the cable with a stock Recovery. (I don't have my tablet with me to check)
Here's an extra "any suggestion at all":
Get rid of Windows and use Linux; there are no drivers to screw with in the latter case.
No, seriously. But probably not what you are thinking.
If you can get a "live CD" to boot** on your PC, you can (as root) run the "lsusb" command to see what devices are enumerated on the USB bus, port by port.
In conjuction with the decoder ring at the end of this post, you can determine from inspection of the USB VID/PID identifiers whether or not all the hardware is behaving, and whether or not the tablet is in the mode you think it is supposed to be in.
The reason this is valuable is that it allows you to take drivers completely off the table; if everything is as it should be, then you know that all the hardware and cabling are functioning correctly, the tablet is behaving correctly, your PC hardware is behaving correctly, and that 100% of the problem is Windows driver issues.
If you want to go the extra 1/4 mile, you can put a copy of (Linux) fastboot & adb plus your flashables on a USB key, and run adb or fastboot from the Live CD boot. It won't matter that the live CD doesn't have them preinstalled, they will be on your USB key. It will be easier on you if you can find statically-linked fastboot and adb binaries; if not you will have to copy one or two supporting shared libs (.so files) along with the binaries, and find out what LD_LIBRARY_PATH is all about.
suppose the USB key mounts at /media/usb1; then
$ sudo /bin/bash
# mkdir /tmp/tools
# cp /media/usb1/fastboot /media/usb1/adb /media/usb1/*.so /tmp/tools/
# chmod 755 /tmp/tools/*
# export LD_LIBRARY_PATH='/lib:/usr/lib:/tmp/tools:.'
# cd /tmp/tools
# ./fastboot devices
OR
# ./adb devices
Good luck; as you are using Windows you are going to need it. Hahaha LOL
**depending on whether your BIOS on your win 8.x PC can be toggled between UEFI and Legacy modes or not, this can be either trivial (Legacy boot mode) or complicated (UEFI) requiring a "Trusted Computing" crypto boot shim from MisterSoftie.
Ok this works for me
Use USBDeview (http://www.nirsoft.net/utils/usb_devices_view.html)
delete all the associated drivers like Google, Samsung, etc for ADB, etc
Restart Computer
Reconnect N7 without MTP and USB debugging
Wait for PC to recognise device and install driver
*If you see something like PC unable to recognise device, go into device and Update Driver and choose "Automatic....."
Disconnect and Reconnect with MTP and USB Debugging
Wait for PC to recognise device and install driver
Restart N7 in bootloader
Wait for PC to recognise device and install driver
Profit
* My PC OS is Win 8.1 Pro 64bit
make sure mtp is switched off, i couldnt get adb or fastboot on my nexus just now . switched off mtp and works fine

[Q] Enable USB Debugging tools through ADB in recovery mode

So, my digitizer is broke and I can't see anything or use the touch.
I am able to get into recovery mode with ADB and I tried some echo lines to manually activate debug mode, so that I can have my device authorized to use with ADB afterwards.
I'm trying to use Androidscreencast, but I need to make it work with ADB first and since I get device unauthorized it means that I don't have usb debugging enabled.
The final question : How can I activate debug mode without a screen?
You need to flash a kernel that has usb debugging enabled by default and has disabled that RSA security check.
So I think that what you want is nearly impossible.
I tried to pull and push default.prop and build.prop and I managed to do it, but when I reboot the phone it goes back to the older versions of the files...I don't know why the files don't remain, even though when I check with ls -l in adb shell it is the today's version.
In the end I managed to read my sms, by pulling out the database from the telephony folder and load it with some sql db reading software.

Set automatic lock delay on android to more than 30 min. with ADB

I want to do what "thedicemaster" explained here
I need to extend the automatic lock delay to more than 30 minutes. Does anyone have experience with this? I have installed ADB and installed an app called "Secure Settings" but I don't see the option to extend the delay.
Anyone an idea on how to do this?
I did it through Tasker and Plugin "SecureTask". To be found in category "Secure Settings"
You have to grant 4 permissions for the plugin, mentioned inside the app.
It's been years already but I have a way to get it to work without root without installing any apps. I hope it helps some one.
You will need adb and usb debugging on. Open cmd / terminal and execute these 2 commands:
Code:
adb shell settings put secure lock_after_timeout_rollback 86400000
adb shell settings put secure lock_screen_lock_after_timeout 86400000
86400000 = 24 hours in miliseconds. You can change to a number that you find suitable.
This secure settings will survive after reboot so you only need to do once.
Can you give this command to work on new Android devices (I have android 12 and it shows that there is no put command
alex.do said:
It's been years already but I have a way to get it to work without root without installing any apps. I hope it helps some one.
You will need adb and usb debugging on. Open cmd / terminal and execute these 2 commands:
Code:
adb shell settings put secure lock_after_timeout_rollback 86400000
adb shell settings put secure lock_screen_lock_after_timeout 86400000
86400000 = 24 hours in miliseconds. You can change to a number that you find suitable.
This secure settings will survive after reboot so you only need to do once.
Click to expand...
Click to collapse
alex.do said:
It's been years already but I have a way to get it to work without root without installing any apps. I hope it helps some one.
You will need adb and usb debugging on. Open cmd / terminal and execute these 2 commands:
Code:
adb shell settings put secure lock_after_timeout_rollback 86400000
adb shell settings put secure lock_screen_lock_after_timeout 86400000
86400000 = 24 hours in miliseconds. You can change to a number that you find suitable.
This secure settings will survive after reboot so you only need to do once.
Click to expand...
Click to collapse
Sorry for the more-than-one-year-late reply. I just saw this post now.
I have tried these commands on my Android 11 device. Both run with no error, but they do not alter the screen-turning-off timeout on the lockscreen. I ran them both with and without root mode.
I also tried lower timeout values, such as 30000 (30 seconds), and the commands still seem to have no effect.
But I have good news: I run "Gravity Box", and I discovered that it allows certain settings to be modified via its "Advance Tuning" facility. It allows the "System UI" setting called config_lockScreenDisplayTimeout to be modified, and that indeed controls this particular screen-turning-off timeout on the lock screen, at least on my A11-based device (not a Samsung device, so I don't know if it will work for you).
However, any change to this timeout value when the device is running is ignored until the next reboot.

Frustated with Google News Application

As the title says, I'm fed up with the Google News Application. But the thing is., It is installed as a system app and I don't want that- Disable is the only option that exists for me. I've been disabling it everyday. Even I've disabled Auto-Update for that but still it ENABLES by itself and even UPDATES BY ITSELF.
I've even seeked the help of customer care but they told me to visit SERVICE CENTRE and I even did the same. When I visited the service centre, they just Hard resetted my device and I told them that I've done it more than 6 times at home. They started arguing with me thereby accusing me with bad words...
My phone is still under warranty and I don't want to lose it by installing TWRP and rooting it...
Any kind SUGGESTIONS are HEARTLY WELCOME.
Use ADB.
Download ADB from Google to your PC. (Minimal ADB did not work for me, The one from developers.google.com is the one that works for me)
After ADB, Go to settings and about phone, Tap on build number 7 times. Now you will enable developer options.
Go to deverloper options and enable USB debugging. Now connect phone and open cmd from the folder where you installed adb(Just type cmd in the address bar of the folder). Now a black window will open on your PC.
Then type adb devices on your PC. Now there will be a prompt on your phone asking allow access to the PC.
Select yes and then go to your pc and type-
Code:
adb shell
Code:
pm uninstall -k --user0 com.google.android.apps.magazines
Then press enter.
Now Google News will be uninstalled.
(I tested this, And also used this various apps, They work fine. Your OTA will not break and the apps will not come back after an system update also)
Cheers
SnapDrag910 said:
Use ADB.
Download ADB from Google to your PC. (Minimal ADB did not work for me, The one from developers.google.com is the one that works for me)
After ADB, Go to settings and about phone, Tap on build number 7 times. Now you will enable developer options.
Go to deverloper options and enable USB debugging. Now connect phone and open cmd from the folder where you installed adb(Just type cmd in the address bar of the folder). Now a black window will open on your PC.
Then type adb devices on your PC. Now there will be a prompt on your phone asking allow access to the PC.
Select yes and then go to your pc and type-
Code:
adb shell
Code:
pm uninstall -k --user0 com.google.android.apps.magazines
Then press enter.
Now Google News will be uninstalled.
(I tested this, And also used this various apps, They work fine. Your OTA will not break and the apps will not come back after an system update also)
Cheers
Click to expand...
Click to collapse
Okay. Thank you. But it gets only HIDDEN not completely uninstalled. As of I know, I can't uninstall permanently without root access.
SnapDrag910 said:
Use ADB.
Download ADB from Google to your PC. (Minimal ADB did not work for me, The one from developers.google.com is the one that works for me)
After ADB, Go to settings and about phone, Tap on build number 7 times. Now you will enable developer options.
Go to deverloper options and enable USB debugging. Now connect phone and open cmd from the folder where you installed adb(Just type cmd in the address bar of the folder). Now a black window will open on your PC.
Then type adb devices on your PC. Now there will be a prompt on your phone asking allow access to the PC.
Select yes and then go to your pc and type-
Code:
adb shell
Code:
pm uninstall -k --user0 com.google.android.apps.magazines
Then press enter.
Now Google News will be uninstalled.
(I tested this, And also used this various apps, They work fine. Your OTA will not break and the apps will not come back after an system update also)
Cheers
Click to expand...
Click to collapse
Btw, should I install GOOGLE DRIVERS or NOKIA DRIVERS? I had tried installing Nokia drivers previously which didn't work properly..
PiXinCreate said:
Use ADB.
Download ADB from Google to your PC. (Minimal ADB did not work for me, The one from developers.google.com is the one that works for me)
After ADB, Go to settings and about phone, Tap on build number 7 times. Now you will enable developer options.
Go to deverloper options and enable USB debugging. Now connect phone and open cmd from the folder where you installed adb(Just type cmd in the address bar of the folder). Now a black window will open on your PC.
Then type adb devices on your PC. Now there will be a prompt on your phone asking allow access to the PC.
Select yes and then go to your pc and type-
Btw, should I install GOOGLE DRIVERS or NOKIA DRIVERS? I had tried installing Nokia drivers previously which didn't work properly..
Click to expand...
Click to collapse
Nokia's drivers are the only ones you need to install.
Yes, Using this ADB method will not uninstall this app from the system rather it disables the app for you. But this disabled app will not come back unless you want it too, Not even after OTA.
SnapDrag910 said:
Nokia's drivers are the only ones you need to install.
Yes, Using this ADB method will not uninstall this app from the system rather it disables the app for you. But this disabled app will not come back unless you want it too, Not even after OTA.
Click to expand...
Click to collapse
Honestly speaking, in New to using ADB... But knew sp flash tool and I had thought that both are similar but not.
Are Nokia drivers are same as Google drivers?
Can you share me the step by step procedure is you enough time now, sir?
I just downloaded latest usb driver from developer.android.com
Hey Guys let me tell you I do get automatic installation (via Google Play) for the Google News app (yes frustrating ) but what I did is uninstalled updates emptied it's data and forced stop / disabled it.
As of this comment I do get automatic installation request via Google Play but Google News doesn't updates. This worked for me.

Categories

Resources