How to block ADB - Android Q&A, Help & Troubleshooting

Hi,
Im trying to block my adb in a way that I cant activated it in the Developer Settings.
I tried edit build.prop and default.prop with:
Code:
persist.sys.usb.config none
ro.debuggable=0
persist.service.adb.enable=0
but as soon as I go in the options and enable it, I can see the device once again with: adb devices
There is someway to remove the adb funcionality ?

Related

[Q] ADB ROOT FIX/solution? (can't unlock ADB)

hello Guys,
a noob here..who searched the whole internet for a solution, with no luck.
I have Flytouch 3 Superpad2 with root access (Z4root.apk permanent root).
Now I want to have an " adb root" access to FT3.
but everytime it gives me error "cannot root as root in production builds".
it has to do with this: I edited "default.prop" to this, but doesnt stick after reboot, and doesnt help at all before the reboot.
# ADDITIONAL_DEFAULT_PROPERTIES
#
ro.secure=0
ro.allow.mock.location=0
ro.debuggable=1
persist.service.adb.enable=1
is there someone who can show me hot to get ADB ROOT ACCESS on my FT3.
Thank you.
you need to pull your current boot.img from your phone, unpack it, extract the ramdisk, and find the default.prop file. This is a plaintext file, which you need to open in a text editor and then find the line that contains the value ro.secure. If the line says ro.secure=1 then you need to change it to ro.secure=0. After that you can re-pack the ramdisk and boot.img, then flash it to your phone. Once you reboot, you will be greeted with a # prompt whenever you perform adb shell without having to run su.

[Q] Disable Lock Screen thru ADB

I am running CM 7.1 Jordon Stable
So I disabled the slider unlock, but it stopped recognizing my gesture for some reason and I cannot figure out how to login to my phone. Not sure if I can change that setting somehow from ADP or do something from a terminal... Any ideas?
When I say gesture, I am not referring to the password based on the motion with the dots, I am saying the screen where the unlock / silent toggle was has been disabled and I cannot get passed there.
Here are the things I have tried already
----
Attempt 1:
$ ./adb -d shell
# cd data/data
# sqlite3 ./com.android.providers.settings/databases/settings.db
SQLite version 3.7.2
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> update system set value=1 where name='lockscreen_disabled';
sqlite> .exit
# reboot
Attempt 2:
adb shell
input keyevent 82
---
Neither of these worked. I think the solution should be in the updating the settings.db, but maybe its a different row/record that contains "ENABLE slider"?
Help would be appreciated!

Digitizer broken, screen ok. Help me set up ADB for input

Dropped my phone this morning (~80cm) & screen cracked; now I've got no response from touchscreen at all.
LG Optimus G
CWM 6.0.4.7
Cyanogenmod 11
all data backed up
I can access ADB shell when it's in recovery mode but once booted up it just connects as MTP device and ADB doesn't see it (nor does fastboot). I've tried an OTG cable with mouse, no luck there. I have a bluetooth mouse but no way to pair it!
Do I just have the wrong driver in windows? Device manager says "LGE Android MTP Device" because I had (at some point earlier) installed the LG usb drivers and recovery tool.
You don't have debugging on is my best guess, but if you're just trying to pull some files you can do this through recovery. Or is there another reason you want adb on while in os?
Sent from my Nexus 7 using XDA Premium 4 mobile app
demkantor said:
You don't have debugging on is my best guess, but if you're just trying to pull some files you can do this through recovery. Or is there another reason you want adb on while in os?
Sent from my Nexus 7 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Correct, I don't believe it was enabled in android os. I was hoping to use Screencast or ADB or something to control my phone until I get a chance to order a new screen
you can try this
boot to recovery
use adb to pull build.prop
Code:
adb pull /system/build.prop /location/on/pc
add these lines (or change accordingly if present)
Code:
persist.service.adb.enable=1
persist.service.debuggable=1
persist.sys.usb.config=mtp,adb
now push it back
Code:
adb push location/on/pc/build.prop /system/build.prop
and fix permissions in recovery or
Code:
adb shell
su
chmod 644 build.prop
or try just editing it in a shell like
Code:
adb shell
su
mount -o remount,rw /system
cd /
echo "persist.service.adb.enable=1" >> default.prop
echo "persist.service.debuggable=1" >> default.prop
echo "persist.sys.usb.config=mtp,adb" >> default.prop
echo "persist.service.adb.enable=1" >> /system/build.prop
echo "persist.service.debuggable=1" >> /system/build.prop
echo "persist.sys.usb.config=mtp,adb" >> /system/build.prop
then reboot
either method i would suggest doing a backup in recovery first, just in case, but should be fine
best of luck!
Thank you! I will try when I get home
demkantor said:
you can try this
boot to recovery
use adb to pull build.prop
Code:
adb pull /system/build.prop /location/on/pc
add these lines (or change accordingly if present)
Code:
persist.service.adb.enable=1
persist.service.debuggable=1
persist.sys.usb.config=mtp,adb
now push it back
Code:
adb push location/on/pc/build.prop /system/build.prop
and fix permissions in recovery or
Code:
adb shell
su
chmod 644 build.prop
or try just editing it in a shell like
Code:
adb shell
su
mount -o remount,rw /system
cd /
echo "persist.service.adb.enable=1" >> default.prop
echo "persist.service.debuggable=1" >> default.prop
echo "persist.sys.usb.config=mtp,adb" >> default.prop
echo "persist.service.adb.enable=1" >> /system/build.prop
echo "persist.service.debuggable=1" >> /system/build.prop
echo "persist.sys.usb.config=mtp,adb" >> /system/build.prop
then reboot
either method i would suggest doing a backup in recovery first, just in case, but should be fine
best of luck!
Click to expand...
Click to collapse
Here's what I got:
Code:
G:\android sdk\sdk\platform-tools>adb devices
List of devices attached
01a9a0f610c750f6 recovery
G:\android sdk\sdk\platform-tools>adb root
adbd is already running as root
G:\android sdk\sdk\platform-tools>adb pull /system/build.prop C:\testing\
remote object '/system/build.prop' does not exist
G:\android sdk\sdk\platform-tools>
so then I tried:
Code:
G:\android sdk\sdk\platform-tools>adb shell
~ # ls
ls
boot external_sd property_contexts storage
cache file_contexts recovery sys
charger fstab.geehrc res system
data init root tmp
datadata init.rc sbin ueventd.geehrc.rc
default.prop initlogo.rle888 sd-ext ueventd.rc
dev internal_sd sdcard
emmc mnt seapp_contexts
etc proc sepolicy
~ # cd system
/system # /system # ls -R -l
ls -R -l
.:
__bionic_open_tzdata: couldn't find any tzdata when looking for localtime!
__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!
drwxr-xr-x 2 root root 0 Jan 1 1970 bin
./bin:
Then I found default.prop in ./ (http://pastebin.com/RFyhMJe9) and added the first two lines you suggested (it already had usb.config=mtp,adb) but rebooted and no USB debugging. Booted back into recovery and the lines I added were gone.
You may need to mount /system r/w first as its protected its possible that it won't allow you to pull it otherwise... Can't recall
Default.prop I believe will often do this upon reboot as its part of the ramdisk. To fully edit this try looking at this
http://android-dls.com/wiki/index.p...t,_and_Re-Pack_Boot_Images#Alternative_Method
But really you just need to look for the build.prop
Just follow the part where I said edit in shell from above, this should work
Sent from my Nexus 7 using XDA Premium 4 mobile app
demkantor said:
You may need to mount /system r/w first as its protected its possible that it won't allow you to pull it otherwise... Can't recall
Default.prop I believe will often do this upon reboot as its part of the ramdisk. To fully edit this try looking at this
http://android-dls.com/wiki/index.p...t,_and_Re-Pack_Boot_Images#Alternative_Method
But really you just need to look for the build.prop
Just follow the part where I said edit in shell from above, this should work
Click to expand...
Click to collapse
I'll try that. Is there a find command I could use to find build.prop? I'm out of ways to look for build.prop, as I couldn't find it in /system or /sys.
It should be in /system , never seen it elsewhere. Maybe grab the build.prop from the ROM you are running (like direct from a download of the ROM, just unzip) edit this and push it in place, then fix permissions
Sent from my Nexus 7 using XDA Premium 4 mobile app
demkantor said:
You may need to mount /system
Click to expand...
Click to collapse
Bingo! looked in CWM recovery settings and found "Mount /system"
Once I did this, I could see all the files in /system, including build.prop. I updated build.prop and checked file persmissions (they were already correct, wierd). Rebooted, now ADB can see it:
Code:
>adb devices
List of devices attached
01a9a0f610c750f6 unauthorized
and when I try to run screencast (https://code.google.com/p/androidscreencast/) I get a bunch of java errors, including this:
Code:
java.io.IOException: device (01a9a0f610c750f6) request rejected: device unauthorized. Please check the confirmation dialog on your device.
If I try to send a keyevent, I get a similar message:
>adb shell input keyevent 3
Code:
error: device unauthorized. Please check the confirmation dialog on your device.
Realized this meant my PC wasn't authorized, so I followed these instructions: http://stackoverflow.com/questions/...ithout-previous-usb-pairing/15747430#15747430
and now I'm authorized!
Glad it worked out for you! Check out droid explorer and android commander, both should work well for you and have some more advanced options besides just screen cast
Sent from my Nexus 4 using XDA Premium 4 mobile app
Thanks again, demkantor! I'll give those a try, since screencast only displays on my PC, none of the controls seem to work, and running commands like below are pretty slow:
Code:
adb shell input swipe 390 1100 650 1100 [I] (unlock swipe)[/I]
adb shell input keyevent 3 [I](home button)[/I]
[CODE]
EDIT:
Tried those but they both seem depricated and old. I got AirDroid which isn't exactly remote control but allows reading/writing of texts among other things, and works whenever you get on wifi.
I am trying to do the same thing but I do not know how to append the line I got from my PC. As well on my LG e970 which has not been ever authorized I keep getting the error that there is no directory for /data/misc/adb/adb_keys and I have CWM too in which I have also mounted the data partition. Please help!

[Q] adbd root with ro.secure=0

Hi,
adb root prompt me that it is unable on product builds. But I gave a try this way after Googling. Though adb deamon is not in root mode I have rooted my device with the help of saferoot. (Thanks saferoot)
adb shell su (now with root)
I mount rootfs / in read write mode.
I notice default.prop file and open it using vi. Value of ro.secure=1 and ro.debuggable=0.
I change those value as follow: ro.secure=0 and ro.debuggable=1
exit from shell and execute adb kill-server and adb start-server
But still adb root tells that it is unable on product builds.
Can I get adbd run as root in this way? what has I missed.
Many thanks,
iua

How to find "getprop" parameter location

Looking to see if there's a terminal/adb command to find where exactly a "getprop" parameter's location resides?
Basically I need to find where the parameter
Code:
dolby.ds.virt.bluetooth off
resides so I can change the output to
Code:
dolby.ds.virt.bluetooth on
.
I looked in the build.prop, su.d, and other folders without any luck. I used the setprop command to enable it, rebooted and it didn't stick. I then added it to my /system/su.d setprop folder, and all other commands stuck BUT that particular one....? So it's getting turned back off somehow, from some other location I can't find?
Any help is appreciated!:good:
Bump? Tried a bunch of shell commands, best so far is "pm path #command# /sdcard/titties" ? No error, but outputs nothing....

Categories

Resources