[Q] Broken Screen, Need to Enable ADB - Nexus 7 Q&A, Help & Troubleshooting

Hello all!
I have a Nexus 7 with a broken screen and non-functional LCD (i.e., no backlight or any changes visible on the screen). It has CM10.1 (probably a January build) and CWM (I want to say 5.x, but I don't remember). I had a complex screen unlock password, so I stupidly rebooted into recovery and did a factory reset via ADB. However, this caused the debugging flag to be disabled, hence destroying my ability to control the device through ADB.
Questions:
1) Can someone walk me through the procedure to go from the device's "off" state to CWM?
2) Can someone tell me how to re-enable the debugging switch after mounting system?
Thanks!

I am not sure, but I think ADB in recovery mode is always enabled, so why do you want to enable ADB for the "normal" mode? You can do everything in recovery mode, too.

It works!
AndDiSa said:
I am not sure, but I think ADB in recovery mode is always enabled, so why do you want to enable ADB for the "normal" mode? You can do everything in recovery mode, too.
Click to expand...
Click to collapse
You can do a lot of things in recovery mode, except for setting up applications once they are installed. I wanted to set up a VNC server on that tablet so I can see the screen and click on whatever, and eventually use the device's sensors and antennas for other reasons. On top of that, I was having the stupid issue of not being able to go into recovery again (since you need to scroll through a menu before reaching the "Recovery" option on the Nexus 7).
Anyways, I got it to work now:
To go into "Recovery" mode and enable ADB inside the ROM (I had CM10.1 installed, but it shouldn't matter for most JB roms):
1) Turn the tablet off or check that it is off. Since my screen was broken, I ended up opening it and unplugging/replugging the battery
2) Vol Down + Power button, wait for ~5 seconds
3) Press Vol Down twice, and then press Power
4) On computer, go to "adb shell"
5) Enter the following commands:
Code:
mount /system
mount /data
echo persist.service.adb.enable=1 >> /system/build.prop
cp /data/data/com.android.providers.settings/databases/settings.db /data/data/com.android.providers.settings/databases/settings.db.old
9) Exit adb, enter command:
Code:
adb pull /data/data/com.android.providers.settings/databases/settings.db.old ./settings.db
10) Using any SQL database editor, modify settings.db to change "adb_enabled" to 1
11) Save, exit, and enter command:
Code:
adb push settings.db /data/data/com.android.providers.settings/databases/settings.db
Now, you can reboot the device (adb reboot). After a few seconds, you should be able to capture screenshots.
I wrote a little bash script to automate the process, so I can get a (somewhat) moving image (at best, I got 4 FPS )
Code:
while true; do
adb shell screencap -p | sed 's/\r$//' > screen2.png
if [ -s screen2.png ]
then
cp screen2.png screen.png
fi
done
Note that it is "buffered" -- if adb fails for any reason, the code will continue until adb is able to get another image.
At this point, you can start adb shell, and then use the following command to send taps, swipes, keyevents, or text:
Code:
input text <string>
input keyevent <key code number or name>
input tap <x> <y>
input swipe <x1> <y1> <x2> <y2>
Doing this, I was able to get all the way to installing a VNC server. I used Droid VNC Server:
https://play.google.com/store/apps/details?id=org.onaips.vnc&hl=en
Of course, you can choose whatever server you want. Just configure it correctly, and then you can stop the script and access the tablet remotely. Also, remember to disable the screen lock -- it's really annoying to have to swipe on the lockscreen using the command each time.
At this point, I've gone ahead and enabled ADB over WiFi, allowing me to access virtually everything for this device from any location.
Time to build something with my (severely handicapped) Nexus 7!

Thank you for this interesting post!
I wanted to suggest a similar process, but I first I wanted to understand better, what you wanted to reach. Yeah, ADB is a very powerful tool, I do not want to miss it.

Related

my galaxy s not open

Hello,
I install z4mod, and I patch kernal, and it's fine, after that I don't what I do , I do convert to filesystem, after that open till galaxy s come the shutdown.
I use froyo 2.2
please help me?
I can not open phone in download mode or recovery by using 3 buttons.
All I can say is that if you cannot access download mode you're in trouble. :/
so what can I do,
any idea
If you can't get into download mode you may have bricked your phone, the only way to fix it is to make a homemade jig or put your phone in the oven. I'm not sure what your preference may be...
EDIT: In future please do not post in this section just to get your thread more attention .
I use
Z4mod over in I9000 converts data to ext2
and it's not open download mode from begening when it normal mode,
any news,,,,
PaulForde said:
If you can't get into download mode you may have bricked your phone, the only way to fix it is to make a homemade jig or put your phone in the oven. I'm not sure what your preference may be...
EDIT: In future please do not post in this section just to get your thread more attention .
Click to expand...
Click to collapse
NEVER do that nonsense.
dnsp said:
NEVER do that nonsense.
Click to expand...
Click to collapse
yeah, not with the oven
but the trick with the hair blower works and also just recently has rescued another unfortunate soul (not me)
Isn't it possible to get into download mode by adb? I did it a few times, but i can find the tutorial only on a german forum called android-hilfe.de.
It worked for me a few times:
1: Install Kies (probably you did already)
2. install adb for windows ( don't know where to get it, sorry)
3. install odin 1.3
4. open command line and navigate to adb folder
5. start odin
6. place command line-window and odin window so, that you can see both.
7. write in command line: "adb reboot download" and press enter ( starts daemon)
8. remove battery
9. connect the phone to pc using usb cable
10. put the battery in the phone again
11. write in command line: "adb reboot download", DO NOT PRESS ENTER
12. wait until it shows the battery symbol on your phone, indicating that its loading. press power button
13. now look at odin. when the Com-Port becomes yellow, press the enter button in command line, where you wrote "adb reboot download" before.
Now you are in DL-Mode.
Hope it works and someone maybe can give you a better written tutorial with a link to adb. Like i said, it worked for me.
eeegamer said:
Isn't it possible to get into download mode by adb? I did it a few times, but i can find the tutorial only on a german forum called android-hilfe.de.
It worked for me a few times:
1: Install Kies (probably you did already)
2. install adb for windows ( don't know where to get it, sorry)
you mean adbRecovery
3. install odin 1.3
4. open command line and navigate to adb folder
you mean by command prompt, can give me simple,
5. start odin
6. place command line-window and odin window so, that you can see both.
7. write in command line: "adb reboot download" and press enter ( starts daemon)
8. remove battery
9. connect the phone to pc using usb cable
10. put the battery in the phone again
11. write in command line: "adb reboot download", DO NOT PRESS ENTER
12. wait until it shows the battery symbol on your phone, indicating that its loading. press power button
13. now look at odin. when the Com-Port becomes yellow, press the enter button in command line, where you wrote "adb reboot download" before.
Now you are in DL-Mode.
Hope it works and someone maybe can give you a better written tutorial with a link to adb. Like i said, it worked for me.
Click to expand...
Click to collapse
thanx bro,,
Plz plz don't do stuff to your phone if you don't have 3button working.
I beg you.
Apply the 3button patch to get it working then proceed.
thanx eeegamer
but give me
error: device not found
I do what you said
Daneshm90,
the 3 butons not work with me, before the I got this problem, it's from the factory,
almuhajir said:
Daneshm90,
the 3 butons not work with me, before the I got this problem, it's from the factory,
Click to expand...
Click to collapse
Yes but there are patches on this forum that fix that.
Research and the world is yours
Daneshm90 said:
Yes but there are patches on this forum that fix that.
Research and the world is yours
Click to expand...
Click to collapse
please help, my head was broken, from morning I research,
Well firstly your original post is very confusing.
Im assuming english isn't your first tongue, if not plz use something like google translate which might do a better job.
Is ur situation that you want to flash something and don't know how ? Or you flashed something and can't boot into the os and have neither download mode / recovery mode at ur dispense ?
I assume you are saying that now when you are switching on your phone you are not getting startup screen of I9000 and you are getting a small icon showing broken connection with phone and PC.
If this is the case, you can try doing following trick
1. switch off phone and remove battery
2. Plug your USB with phone and PC
3. Start ODIN V3
4. Now press vol down + menu (Centre button) and power on
5. Insert your battery
6. If Odin will show your phone connected you are safe
7. if not try it again (do it 10 times)
Once Odin will detect your phone...flash any stock ROM from forum.
If unfortunately this does not work, then use hot-blower option.
1. Switch off your phone take out battery
2. use hot blower (hair dryer or something else) on the part where battery is placed.
3. Heat till the time you can tolerate...dont worry nothing will happen to Galaxy
4. Now press vol down + menu (Centre button) and power on
5. Insert your battery
6. Your phone should show yellow screen of downloading
Above trick seems insane but believe me it saved me (Thank God)
Galaxy S can not be unbricked (at least easily by any RM) I have faced this situation many times and come over it.
Let me know how it goes.
Before all of these I install OneClickLagFix v2.2, but I got same problem, and I use adbRecovery and I solve the problem.
First I install z4root and i root my device, then I install z4mod and I patch device kernel, after that, I choose converts data to filesystem, then the device rebooted automatically, until show logo GALAXY S, then the screen come black and vibrate allways,
The problem also when I connect it to USB my computer does not get the device,
But in the problem I have it now the adbRecovery not do any thing
Oh you are safe then...
Press vol up + menu + power button
once it shows Samsung logo leave the power button but keep pressing menu + vol up. After 4 seconds leave these button also.
Your phone should go to recovery mode.. then flash any rom..
If this does not work then use below:
1. switch off phone and remove battery
2. Plug your USB with phone and PC
3. Start ODIN V3
4. Now press vol down + menu (Centre button) and power on
5. Insert your battery
6. If Odin will show your phone connected you are safe
7. if not try it again (do it 10 times)
Once Odin will detect your phone...flash any stock ROM from forum.
almuhajir said:
thanx eeegamer
but give me
error: device not found
I do what you said
Click to expand...
Click to collapse
C:\android-sdk-windows\tools>adb ls
Android Debug Bridge version 1.0.26
-d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number> - directs command to the USB device or emulator with
the given serial number. Overrides ANDROID_SERIAL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number is specified.
Using this ocmmand with no additional arguments
will disconnect from all connected TCP/IP devices.
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] <file> - push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
('-s' means install on SD card instead of internal storage)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specified device
adb remount - remounts the /system partition on the device read-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on the specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be updated.
- If it is "system" or "data", only the corresponding partition
is updated.
environmental variables:
ADB_TRACE - Print debug information. A comma separated list of the following values
1 or all, adb, sockets, packets, rwx, usb, sync, sysdeps, transport, jdwp
ANDROID_SERIAL - The serial number to connect to. -s takes priority over this if given.
ANDROID_LOG_TAGS - When used with the logcat option, only these debug tags are printed.
C:\android-sdk-windows\tools>
C:\android-sdk-windows\tools>adb devices
List of devices attached
1000efxxxx758 device
C:\android-sdk-windows\tools>

The Complete Noob-iots Guide To Rooting, Recovery, and Troubleshooting

The purpose of this tutorial is not to teach you everything. It's just to give the less-than-average user (noob) an idea of why certain steps are taken and how to prevent and or troubleshoot problems that most people have when rooting or flashing ROMs on their device. I am also assuming that if you do decide to root your device you have at least a basic working knowledge of a computer. If you don't know what a desktop is or how to find the "any" key, you have no business being anywhere near a computer much less an android device…continue no further. Read my tutorial…If you like it, let me know. If I missed anything or got something wrong, let me know…I'll try to fix it. If you're impartial to it, I couldn't care less. If you hate it, PM me…I have some important information for you about anger management.
ROOTING
While there are different rooting "methods" they all rely on the same basic concept. Get temporary root access to your system in order to use the adb (Android Debug Bridge) to transfer necessary files and change permissions to permanently root (take ownership of) the device.
Before programs like KindleFireUtility and KindleWater, rooting the Kindle Fire was done manually through a command line interface (command prompt). Although those programs still use the same methods, you never see it. But why use command prompt? What do those commands mean anyway? Anyone can point and click but if you don't know what is going on behind the scenes then you are big trouble when things go wrong…and they inevitably will. So, let's get started.
From here on out we will consider this the beginning of the tutorial. Read everything first before doing anything. Pay close attention to what's being said and follow instructions carefully. Now...
Before anything your device needs to be fully charged and have the Android SDK and the Kindle adb drivers installed onto your computer. I'm not going to go into how to install SDK or Kindle adb drivers here because there are millions of pages on the internet that will teach you, and quite frankly that's not the purpose of this tutorial. That being said, lets get down to business and talk about the older (manual) methods of rooting the Kindle Fire.
First, lets start with the device turned on. Now go to your Kindle Fire settings and scroll down and select "Devices". Make sure "Allow Installation of Applications" is set to ON. This allows you to install apps not downloaded from the Amazon App Store. Next we open the App Store and search for and install a file management utility (ES File Explorer is a good one to start with). This will be necessary to temporarily root your device. Exit the App Store.
Now plug your device into the computer. For the purposes of this exercise there are two USB modes you will need to know, USB debugging and USB file transfer. On stock devices when you plug into your computer you will see a black screen that says "You can now transfer files from your computer to Kindle". This we will call USB file transfer mode. You will use this to transfer a program to your device that will give you temporary root permissions. The old program for this was ZergRush, nowadays its BurritoRoot and tomorrow it will probably be something else. Whatever it is, find whichever one works for your device's software version and transfer it to your device using Explorer (Windows) or Finder (Mac). Since you don't have root access yet, everything you put on your device for now will go directly to the SDcard partition, far away from system folders (for all intents and purposes).
Press "disconnect" on your Kindle Fire. Now, and by default, your Kindle is in USB debugging mode. What that means is that when you are not in USB file transfer mode your device is constantly listening for debugging commands coming from the USB port. We will be using this to send adb commands to the device which are necessary for rooting and setting up recovery. Now open the file management app you installed from the App Store, navigate to the temporary root program you transferred from your computer and open it. Install and follow the instructions, if any. Next go to your computer and navigate to your Android SDK folder and look for a folder called "platform-tools" if you don't see it, open the tools folder and double-click the file named "Android". Select "platform-tools" and install.
To make things simple, lets to take the platform-tools folder and place it on your desktop (just be sure to put it back when this is all over).
At this point we need to get Superuser. This is what we will use to give your apps root access. Go to http://www.androidsu.com/superuser and download the one for Gingerbread. Extract the superuser.zip file, open the folder and navigate to the system folder inside. There, inside the "app" and "bin" folders you will see two files called "superuser.apk" and "SU". Place them in the platform-tools folder that is now on your desktop. And now the fun part, it's time to start rooting.
Open your command prompt (or terminal for mac users) and type and enter:
cd Desktop/platform-tools
Here, you are telling the computer to cd (change directory) to the platform-tools folder located inside the Desktop folder. This is going to be your workspace. Everything you do from here on will be done from this folder. If you don't get any errors then you are in good shape. Otherwise you messed up somewhere and probably skipped a step...go back and read from the beginning. Make sure your Kindle Fire is turned on and NOT in USB file transfer mode. If you are not sure what mode you're in, go back to the beginning. If this is your second time around, stop. You need to learn more about how to change directories using command line interface.
When you are in the platform-tools folder, type and enter this command:
adb devices
Mac and Linux users will put ./ before all adb and fastboot commands from here on out. It will look like: ./adb devices
Here you are using the adb program to print a list of connected devices. You should see a bunch of numbers that mean nothing to you at this skill level. Move on. If you don't see any numbers then you either don't have your drivers installed properly or you skipped a step; go back to the beginning.
If you do get a bunch of numbers your device is connected. Now type and enter:
adb root

...gives root permissions to the adb
adb remount
...mounts the system partition to a "read/write" state allowing you to make changes to system files and folders. Consequentially, if you enter adb remount a second time, you will change it back to "read only". Don't do that.
adb push su /system/xbin/su
...will push (transfer) the file named "SU" that is in your workspace (platform-tools folder) to the su folder inside the xbin folder of your device's system folder. The SU binary file is what other apps call to when they need superuser rights.
adb shell chown 0.0 /system/xbin/su
...this is where it gets a little funky. It opens a shell interface within the adb in order to chown (give ownership permissions) to user 0.0 for the su folder. A shell is a piece of software with a particular set of commands built in to act as sort of a go-between between the user, operating system and hardware kernel services. But who is user 0.0? [Edit:] User 0.0 is the root user. Thanks to b63 for that piece of knowledge
adb shell chmod 06755 /system/xbin/su
...opens a shell within the adb to chmod (change mode) of the su folder to 06755. What that basically means is you are changing the folder permissions to rwxr-xr-x or read/write/execute for the owner, and read/execute for the group and others.
adb install superuser.apk
...installs the program superuser.apk located in the platform-tools folder. Superuser.apk maintains a database of what apps you allow to access SU binary file.
That's how the rooting process works. Again if you get any errors, you did something wrong. Go back to the beginning and read it all over again. Attention is key.
Also, I suggest you skip the one-click methods for rooting and get used to using the command line interface so you understand how the process works in order to quickly troubleshoot problems should they arise. Oh and congratulations, you are rooted.
RECOVERY
Now lets install a custom recovery utility and a new boot-loader. For this you will be using the fastboot command. Before we go on, one thing you absolutely must get your head around is the difference between how fastboot interacts with your device versus how adb interacts with your device. fastboot deals with the boot portion of the device whereas adb only deals with the system portion. What that means is adb will only work when the device is completely booted. If for some reason your device doesn't boot properly then you should not be issuing adb commands. It's like trying to light a match in a vacuum. Fastboot works in the same way in that you must be in the fastboot bootmode in order to issue fastboot commands. Unless you have custom recovery installed or a factory programming cable there is only one way to get into fastboot mode. We'll talk about that later.
Installing recovery is a simple process but it is where people tend to have the most problems. Part of the reason is the misunderstanding of the different bootmodes. For now, you only need to be concerned with two of them; normal bootmode (4000) and fastboot bootmode (4002). The main reason people run into trouble is that once you are in a particular bootmode, it doesn't change until you tell it to (with the exception of temporary fastboot which we will get into later).
In normal bootmode your device will boot...normally (imagine that). With the fastboot bootmode the boot-loader will hang at the Kindle Fire splash screen (or yellow triangle if you have recovery installed) to wait for further commands. If this happens to you, chances are your only problem is you are in the wrong bootmode, which is easy to fix. Knowing that, installing a custom recovery should be a breeze.
First find whatever recovery you want to use (unzip it if you have to) and place the .img file into your platform-tools folder that you were using earlier. We're going to use adb to change the bootmode to fastboot in order to install custom recovery. Remember, anything that pertains to the boot-loader, (Kindle Fire logo/yellow triangle) will be done in the fastboot bootmode; that includes custom recovery installation. For more information on Kindle Fire bootmodes, boot-loaders, fastboot and just about everything else, see this post:
http://forum.xda-developers.com/showthread.php?t=1552547
From your command prompt type and enter:
adb shell
su
idme bootmode 4002
reboot
What that does is tells adb to open a shell and su (substitute user) for the root user, change the bootmode from normal (4000) to fastboot (4002) and reboot. The root user has the necessary permissions to change the bootmode from the adb. Your device will reboot then hang at the splash screen because it is in the fastboot bootmode.
Now install your custom recovery (we'll call it customrecovery.img for now)
fastboot -i 0x1949 boot customrecovery.img
again, for Mac and Linux you would type: ./fastboot -i 0x1949 boot customrecovery.img
That tells your computer to, using the fastboot program that is in your platform-tools folder, boot the device with the ID of 0x1949 (your Kindle) with the file named "customrecovery.img"
After installation, reboot, but you will still be in the fastboot bootmode. So type:
fastboot -i 0x1949 oem idme bootmode 4000

fastboot reboot
…tells the device to reset the partition where the recovery(?) is located, change the bootmode to normal (4000) and reboot.
TROUBLESHOOTING
Flashing custom ROMS are another source of frustrations as they add too many variables to the equation. Some ROMS can be very unstable and cause weird things to happen to your device. But just knowing how this stuff works will help you fix 90% of the problems that may come up. If you are having trouble with your device, troubleshoot the problem:
Does the device turn on?
No

Is it fully charged?
No--> Charge it

Is it fully charged?
Yes--> Hold the power button for 30 seconds and restart

Does the device turn on?
No--> Hold the power button for 3 minutes and restart
Does the device turn on?

No--> Google search "Motorola USB factory programming cable"

Does it boot normally?
No

Do you have custom recovery installed
No--> You need to get into fastboot mode to issue fastboot commands. Google search "Motorola USB factory programming cable"

Do you have custom recovery installed?
Yes--> During the first 5 seconds of seeing the boot splash screen (this is temporary fastboot mode that comes with custom recovery) issue fastboot command to change bootmode to 4000. Reboot

Does it boot normally?

No

Can you get into recovery?
No--> During the first 5 seconds of seeing the boot splash screen (temporary fastboot mode) issue fastboot command to install a new customrecovery.img. Reboot.

Can you get into recovery?

Yes--> Re-flash your ROM. Reboot.

Does it boot normally?

No--> Enter recovery, factory reset, wipe cache, wipe dalvik cache, re-flash your ROM. Reboot

Does it boot normally?
No--> Enter recovery, factory reset, wipe cache, wipe dalvik cache, flash a different ROM. Reboot

Does it boot normally?
No--> Post your problem on the XDA forum. Include all pertinent information such as what rom you are using, what the exact problem is, what you were doing before the problem occurred and all the steps you have taken to try and fix the problem.

Does it boot normally?
Yes--> Give yourself a pat on the back, because you rock!
Do you Rock?
No--> Start over from the beginning
nice
--sent from my glacier.

How to un-boot-loop (another way)

So after somehow getting my system to get into a reboot loop with the Welcome -- Just a Sec loading screen, I managed to get it to re-flash the stock ROM.
Basically, the goal is to do this:
http://forum.xda-developers.com/showthread.php?t=2582773
But I went about things a bit differently:
adb shell
su
vi /system/build.prop
:%s/310079820/310079819/g
:wq
exit
exit
adb shell am start -a android.settings.SETTINGS
<select Device -- System Updates -- Check now, and download/install update>
Essentially, to get the settings menu to appear you need to launch it via adb (adb shell am start...)
idk if this will work for anyone else, but it's two hours past my bedtime since I'm an idiot when it comes to getting GAPPS working, so 'night

self-contained sideloading, adb stupid tricks version. no PC required.

(as dhayman11 pointed out, "unknown sources" is in security settings, not developer options. but no luck anyway, like most of the settings app, it also crashes if you try to set it.)
instead, here is an extremely stupid idea that just came to me.
1. turn on adb wifi debugging
2. sideload your favorite terminal, e.g.
http://jackpal.github.com/Android-Terminal-Emulator/downloads/Term.apk
(ok I lied. you will need your desktop/laptop/phone/whatever, exactly 1 time. step 2 will be skipped forever after that 1 time.)
3. fire up said terminal from the settings->applications menu.
4. (LOL!)
$ adb devices
4a. if the above command shows no devices,
$ adb connect localhost
and proceed to step 5.
4b. if the command shows exactly 1 device, e.g. "emulator-5554", proceed to step 5.
4c. if the command shows more than 1 device (wtf?!) then you will need to specify a device of your choice ("-s somedevice") in every subsequent adb command, e.g.
$ adb -s emulator-5554 <whatever>
$ adb -s localhost:5555 <whatever>
etc.
5. e.g.
$ adb install /sdcard/Download/foobar.apk
$ adb shell
$ adb uninstall -k com.something.somethingelse
etc. etc.
6. profit? profit!
ok here is a slightly-less incoherent form of the senior-moment-reply I posted earlier
several days ago it occurred to me to alternatively use sshd for terminal access, because:
-a) I feel a little unsafe leaving adb wifi enabled all the time (ok it's only a small thing to turn it on and off, but still) - and for security reasons there is no way to enable/disable it programmatically e.g. from a script/shell/terminal/app (well theoretically this is not exactly true, but practically it is)
-2) some people (i.e. me) would like to do shell/terminal remotely sometimes, rather than on the AFTV (and other people don't have/want a keyboard)
ssh access makes a great alternative to Term.apk, but the problem is:
- Term.apk and/or (pick your favorite android ssh server) don't have permission to run e.g. "pm install foo.apk" - it will fail. (btw 'pm' is a great command, take a look sometime at all the options. it shares a lot of functions as the adb command itself. 'am' is another fun command...)
- so, the hilarious workaround of enabling adb wifi, "adb connect", and then finally "adb shell" or "adb install" etc., is still required. (b/c the adb user is in the 'shell' group, among others - giving it permission to run /system/bin/pm) - oh well.
for random reference:
Code:
127|[email protected]:/ $ id
uid=2000(shell) gid=2000(shell) groups=1004(input),1007(log),1009(mount),1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats)
[email protected]:/ $ exit
[email protected]:/ $ id
uid=10009(app_9) gid=10009(app_9) groups=1015(sdcard_rw),1028,3003(inet),50009(app_40009)
(also note it appears the adb shell user might possibly have 'mount' abilities, but since the /dev/block/sd* nodes permissions' are really locked up, who knows...)

Is there a way to stop H91810p schedule update?

As title says... Just found out about H91810p will make the phone unrootable which is something im planning later on. Sadly the update is scheduled for next restart.
Anything i can do to prevent that?
TempezT said:
As title says... Just found out about H91810p will make the phone unrootable which is something im planning later on. Sadly the update is scheduled for next restart.
Anything i can do to prevent that?
Click to expand...
Click to collapse
if you're rooted, go to /cache and rename update.zip to something else. then create a zero length file using the name update.zip. lastly set the permissions on that file to read only
Here since your on TMO, I compiled this for a buddy of mine through various sources (links provided) on the whole procedure start to finish. Might as well paste it for ya. Props to all original authors, etc...
I just did this on mine, same model, on firmware 10j. If your not on that or i step one will be to flash to the appropriate version. I didnt include that in my notes as myself and my buddy were both on 10j. But theres plenty of threads for that. if your on that, continue on:
Also if you are already flashed and rooted, jump to step #8 for the info regarding OTAs...
====================================================
Specifically for T-Mobile LG V20 H918
Firmware(s) 10I & 10J
====================================================
BOOTLOADER
SOURCES:
*** https://forum.xda-developers.com/v20/how-to/guide-unlock-bootloader-t3488878
*** https://forum.xda-developers.com/v20/development/h918-recowvery-unlock-v20-root-shell-t3490594/page2
*** https://forum.xda-developers.com/showpost.php?p=69897433&postcount=1060
*** https://forum.xda-developers.com/pi...e-pixel-xl-t3466185/post69239012#post69239012
====================================================
Warning: This will delete all your data. You'll also see a large warning every time you turn on the device (attached), this disappears in less than a second.
*Turn on developer mode:
Settings -> About device -> Software info -> Build number. (tap 7 times until it's enabled)
*Turn on OEM unlock and USB debugging:
Settings -> Developer options -> OEM unlock & USB Debugging. (turn it on)
Don't ever turn OEM unlock or Developer options off when using a custom ROM or recovery. This could lose to loss of all your data.
*Install LG drivers
WIN:
http://tool.lime.gdms.lge.com/dn/downloader.dev?fileKey=UW00120120425
MAC:
http://tool.lime.gdms.lge.com/dn/downloader.dev?fileKey=UW00320110909
You will also need adb and fastboot. You can download them in a portable small form factor here:
http://forum.xda-developers.com/android/software/host-tools-t3402497
You may need to get an additional .dll for adb to work, if so you can pull it from the pixel add compilation here:
https://xenserver.underpants-gnomes.biz/~romracer/fastboot_adb_pixel.zip
*In Terminal navigate to ADB root:
Type
Code:
adb devices
and authorize your computer on the phone
Type
Code:
adb reboot bootloader
Type
Code:
fastboot devices
and make sure your phone shows up
Type
Code:
fastboot oem unlock
Type
Code:
fastboot getvar all
Should say (bootloader) unlocked:yes
Type
Code:
fastboot reboot
====================================================
TWRP & ROOT:
SOURCES:
http://www.droidviews.com/install-twrp-root-t-mobile-lg-v20/
https://forum.xda-developers.com/v20/how-to/instruction-to-root-h918-10i-t3536472
https://forum.xda-developers.com/v20/development/h918-recowvery-unlock-v20-root-shell-t3490594
https://build.nethunter.com/android-tools/dirtycow/arm64/
https://github.com/jcadduono/android_external_dirtycow#running
https://build.nethunter.com/test-builds/twrp/lge/twrp-3.0.2-1-h918.img
https://download.chainfire.eu/supersu
====================================================
*Prerequisites:
Your LG driver must be up to date. You can have problems with USB 3.1 if so grab latest drivers.
ADB installed, put all 4 recowvery files into the folder:
https://build.nethunter.com/android-tools/dirtycow/arm64/
Download the TWRP “twrp-3.0.2-1-h918” image:
https://build.nethunter.com/test-builds/twrp/lge/twrp-3.0.2-1-h918.img
Rename TWRP file to twrp.img and put it into internal storage (sdcard)
Download SuperSU:
https://download.chainfire.eu/supersu
Copy SuperSU onto external memory card (or keep in root of adb, and you could push it back, after formating).
You must be on a 100% stock ROM. Rooted or not.
USB Debugging & OEM unlock allowed in Developer Settings
Bootloader unlocked
Make sure all security/locks are off. No pins, fingerprint, etc…
Steps:
1. Plug your phone to your host computer. Make sure it's in MTP mode.
2. Open your command prompt:
Code:
cd\
cd (right click your mouse and paste the ADB platform-tools address, if using portable pack, where you put the adb folder)
Code:
adb devices
This will show your connected phone
3. Enter the following prompt: (you can simply highlight, copy, right click on command prompt and choose paste):
Code:
adb push dirtycow /data/local/tmp
adb push recowvery-applypatch /data/local/tmp
adb push recowvery-app_process64 /data/local/tmp
adb push recowvery-run-as /data/local/tmp
adb shell
cd /data/local/tmp
chmod 0777 *
./dirtycow /system/bin/applypatch recowvery-applypatch
* On ADB shell mode, you should see $ on the front. Wait for few…
Code:
./dirtycow /system/bin/app_process64 recowvery-app_process64
* Your phone screen may look weird. Wait for another few minutes. Once finished exit.
Code:
exit
4. Type:
Code:
adb logcat -s recowvery
You should see a lot of lines comes across your screen.
Once you see the ASCII box with the message about giving jcadduomo a hug you can press CTRL+C to exit logcat.
Reboot to the stock recovery:
Code:
adb shell reboot recovery
Restart a session:
Code:
adb shell
You will see a $ sign. Now to check…
Code:
getenforce
It should show Permissive. Thanks Dirty COW!!!
5. Temp Root. Lets patch the boot image:
Code:
cd /data/local/tmp
./dirtycow /system/bin/run-as recowvery-run-as
run-as exec ./recowvery-applypatch boot
Lets run as root
Code:
run-as su
You should have a #, indicating you have root. Ahh my little nix…
6. Flash TWRP
Code:
dd if=/sdcard/twrp.img of=/dev/block/bootdevice/by-name/recovery
exit
reboot recovery
The phone should have flashed TWRP and rebooted into recovery.
7. TWRP:
In TWRP swipe to allow modifications. Or TWRP will be replaced next boot!
To disable any encryption perform the factory reset, and the Format Data options.
Install SuperSU from the external SD location.
If you didn’t do a full wipe and reset, you probably want to wipe cache and dalvik.
Reboot to system.
8. Stop them OTA updates!!!
====================================================
https://forum.xda-developers.com/showpost.php?p=72463487&postcount=4237
https://forum.xda-developers.com/showpost.php?p=70795926&postcount=5
====================================================
Open up your dialer interface and type in 277634#*#
This will bring up a hidden menu and then select Wi-Fi test and then select OTA then select disable.
After that you will have to kill the hidden menu and you shouldn't be seeing the annoying OTA icon in your status bar anymore.
In file manager (root browser):
Rename otacerts.zip in /system/etc/security to otacerts.bak.
The full update is found in the cache partition called update.zip.
Move (or delete) the update.zip file from /cache directory (I put it on the sd card).
** dimm0k's method there seems to achieve a similar result, cant hurt to add the step of creating a zero length file after deleting/moving update.zip. I hadnt seen it, thus never did that but I havent had any OTA activity in a few days on mine.
Also in titanium backup (buy it already if you haven’t lol), freeze:
FOTA Update 7.0
Update Center 5.30.12
(I also disabled the com.lge.updatecenter.xxx overlay and themes, cuz whatever... lol)
Reboot and swipe away the notification if its still there. Should have stopped by this point.
======================
There ya go, good luck!
Damn I dont have a computer in hand. Guess i have to wait until im back home in October. Cross fingers this thing don't restart cause that freaking patch is already scheduled.
MDMAchine said:
Here since your on TMO, I compiled this for a buddy of mine through various sources (links provided) on the whole procedure start to finish. Might as well paste it for ya. Props to all original authors, etc...
I just did this on mine, same model, on firmware 10j. If your not on that or i step one will be to flash to the appropriate version. I didnt include that in my notes as myself and my buddy were both on 10j. But theres plenty of threads for that. if your on that, continue on:
Also if you are already flashed and rooted, jump to step #8 for the info regarding OTAs...
====================================================
Specifically for T-Mobile LG V20 H918
Firmware(s) 10I & 10J
====================================================
BOOTLOADER
SOURCES:
*** https://forum.xda-developers.com/v20/how-to/guide-unlock-bootloader-t3488878
*** https://forum.xda-developers.com/v20/development/h918-recowvery-unlock-v20-root-shell-t3490594/page2
*** https://forum.xda-developers.com/showpost.php?p=69897433&postcount=1060
*** https://forum.xda-developers.com/pi...e-pixel-xl-t3466185/post69239012#post69239012
====================================================
Warning: This will delete all your data. You'll also see a large warning every time you turn on the device (attached), this disappears in less than a second.
*Turn on developer mode:
Settings -> About device -> Software info -> Build number. (tap 7 times until it's enabled)
*Turn on OEM unlock and USB debugging:
Settings -> Developer options -> OEM unlock & USB Debugging. (turn it on)
Don't ever turn OEM unlock or Developer options off when using a custom ROM or recovery. This could lose to loss of all your data.
*Install LG drivers
WIN:
http://tool.lime.gdms.lge.com/dn/downloader.dev?fileKey=UW00120120425
MAC:
http://tool.lime.gdms.lge.com/dn/downloader.dev?fileKey=UW00320110909
You will also need adb and fastboot. You can download them in a portable small form factor here:
http://forum.xda-developers.com/android/software/host-tools-t3402497
You may need to get an additional .dll for adb to work, if so you can pull it from the pixel add compilation here:
https://xenserver.underpants-gnomes.biz/~romracer/fastboot_adb_pixel.zip
*In Terminal navigate to ADB root:
Type
Code:
adb devices
and authorize your computer on the phone
Type
Code:
adb reboot bootloader
Type
Code:
fastboot devices
and make sure your phone shows up
Type
Code:
fastboot oem unlock
Type
Code:
fastboot getvar all
Should say (bootloader) unlocked:yes
Type
Code:
fastboot reboot
====================================================
TWRP & ROOT:
SOURCES:
http://www.droidviews.com/install-twrp-root-t-mobile-lg-v20/
https://forum.xda-developers.com/v20/how-to/instruction-to-root-h918-10i-t3536472
https://forum.xda-developers.com/v20/development/h918-recowvery-unlock-v20-root-shell-t3490594
https://build.nethunter.com/android-tools/dirtycow/arm64/
https://github.com/jcadduono/android_external_dirtycow#running
https://build.nethunter.com/test-builds/twrp/lge/twrp-3.0.2-1-h918.img
https://download.chainfire.eu/supersu
====================================================
*Prerequisites:
Your LG driver must be up to date. You can have problems with USB 3.1 if so grab latest drivers.
ADB installed, put all 4 recowvery files into the folder:
https://build.nethunter.com/android-tools/dirtycow/arm64/
Download the TWRP “twrp-3.0.2-1-h918” image:
https://build.nethunter.com/test-builds/twrp/lge/twrp-3.0.2-1-h918.img
Rename TWRP file to twrp.img and put it into internal storage (sdcard)
Download SuperSU:
https://download.chainfire.eu/supersu
Copy SuperSU onto external memory card (or keep in root of adb, and you could push it back, after formating).
You must be on a 100% stock ROM. Rooted or not.
USB Debugging & OEM unlock allowed in Developer Settings
Bootloader unlocked
Make sure all security/locks are off. No pins, fingerprint, etc…
Steps:
1. Plug your phone to your host computer. Make sure it's in MTP mode.
2. Open your command prompt:
Code:
cd\
cd (right click your mouse and paste the ADB platform-tools address, if using portable pack, where you put the adb folder)
Code:
adb devices
This will show your connected phone
3. Enter the following prompt: (you can simply highlight, copy, right click on command prompt and choose paste):
Code:
adb push dirtycow /data/local/tmp
adb push recowvery-applypatch /data/local/tmp
adb push recowvery-app_process64 /data/local/tmp
adb push recowvery-run-as /data/local/tmp
adb shell
cd /data/local/tmp
chmod 0777 *
./dirtycow /system/bin/applypatch recowvery-applypatch
* On ADB shell mode, you should see $ on the front. Wait for few…
Code:
./dirtycow /system/bin/app_process64 recowvery-app_process64
* Your phone screen may look weird. Wait for another few minutes. Once finished exit.
Code:
exit
4. Type:
Code:
adb logcat -s recowvery
You should see a lot of lines comes across your screen.
Once you see the ASCII box with the message about giving jcadduomo a hug you can press CTRL+C to exit logcat.
Reboot to the stock recovery:
Code:
adb shell reboot recovery
Restart a session:
Code:
adb shell
You will see a $ sign. Now to check…
Code:
getenforce
It should show Permissive. Thanks Dirty COW!!!
5. Temp Root. Lets patch the boot image:
Code:
cd /data/local/tmp
./dirtycow /system/bin/run-as recowvery-run-as
run-as exec ./recowvery-applypatch boot
Lets run as root
Code:
run-as su
You should have a #, indicating you have root. Ahh my little nix…
6. Flash TWRP
Code:
dd if=/sdcard/twrp.img of=/dev/block/bootdevice/by-name/recovery
exit
reboot recovery
The phone should have flashed TWRP and rebooted into recovery.
7. TWRP:
In TWRP swipe to allow modifications. Or TWRP will be replaced next boot!
To disable any encryption perform the factory reset, and the Format Data options.
Install SuperSU from the external SD location.
If you didn’t do a full wipe and reset, you probably want to wipe cache and dalvik.
Reboot to system.
8. Stop them OTA updates!!!
====================================================
https://forum.xda-developers.com/showpost.php?p=72463487&postcount=4237
https://forum.xda-developers.com/showpost.php?p=70795926&postcount=5
====================================================
Open up your dialer interface and type in 277634#*#
This will bring up a hidden menu and then select Wi-Fi test and then select OTA then select disable.
After that you will have to kill the hidden menu and you shouldn't be seeing the annoying OTA icon in your status bar anymore.
In file manager (root browser):
Rename otacerts.zip in /system/etc/security to otacerts.bak.
The full update is found in the cache partition called update.zip.
Move (or delete) the update.zip file from /cache directory (I put it on the sd card).
** dimm0k's method there seems to achieve a similar result, cant hurt to add the step of creating a zero length file after deleting/moving update.zip. I hadnt seen it, thus never did that but I havent had any OTA activity in a few days on mine.
Also in titanium backup (buy it already if you haven’t lol), freeze:
FOTA Update 7.0
Update Center 5.30.12
(I also disabled the com.lge.updatecenter.xxx overlay and themes, cuz whatever... lol)
Reboot and swipe away the notification if its still there. Should have stopped by this point.
======================
There ya go, good luck!
Click to expand...
Click to collapse
Okay someone in my base lend his laptop but its low end(sony viao core2 duo) dunno how well this work for flashing purposes, also I wanted to point before doing the process that my phone was unlocked permanently by tmobile unlock app and wanted to know if this can affect the unlocking or any other function of my v20.
Following those instructions to root will not gid rid of your carrier unlock.
You might be able to go to Settings>>Storage and delete Cached data.
Zacharee1 said:
You might be able to go to Settings>>Storage and delete Cached data.
Click to expand...
Click to collapse
Thank you! Now my other concern is that Im paying Jump! and root would void the warranty so I dont know if I should go ahead and do it regardless cause that silly update is already scheduled.
TempezT said:
Thank you! Now my other concern is that Im paying Jump! and root would void the warranty so I dont know if I should go ahead and do it regardless cause that silly update is already scheduled.
Click to expand...
Click to collapse
You can always restore to stock with the H918. Backup and root.
Zacharee1 said:
You can always restore to stock with the H918. Backup and root.
Click to expand...
Click to collapse
Thanks!
The issue Im having now is that I cant find how to root H91810k which is the current version my phone has besides the schedule update. Any info on that?
You have to find the KDZ for 10d and flash it with LGUP. Then you can use EasyRecowvery to root.
Flashing KDZs will wipe your data, so use LG Bridge to make a backup.
MDMAchine said:
Here since your on TMO, I compiled this for a buddy of mine through various sources (links provided) on the whole procedure start to finish. Might as well paste it for ya. Props to all original authors, etc...
I just did this on mine, same model, on firmware 10j. If your not on that or i step one will be to flash to the appropriate version. I didnt include that in my notes as myself and my buddy were both on 10j. But theres plenty of threads for that. if your on that, continue on.......
Click to expand...
Click to collapse
This is awesome! Thank you!!! You may want to make this its own post it's so helpful. Thanks again!!!!!!!!!
wewantutopia said:
This is awesome! Thank you!!! You may want to make this its own post it's so helpful. Thanks again!!!!!!!!!
Click to expand...
Click to collapse
No problem! Glad it helped, I will probably update the post a bit, and then I'll re-post it to its own thread in a few days. As I noticed this section is a bit disorganized...
MDMAchine said:
8. Stop them OTA updates!!!
====================================================
https://forum.xda-developers.com/showpost.php?p=72463487&postcount=4237
https://forum.xda-developers.com/showpost.php?p=70795926&postcount=5
====================================================
Open up your dialer interface and type in 277634#*#
This will bring up a hidden menu and then select Wi-Fi test and then select OTA then select disable.
After that you will have to kill the hidden menu and you shouldn't be seeing the annoying OTA icon in your status bar anymore.
In file manager (root browser):
Rename otacerts.zip in /system/etc/security to otacerts.bak.
The full update is found in the cache partition called update.zip.
Move (or delete) the update.zip file from /cache directory (I put it on the sd card).
** dimm0k's method there seems to achieve a similar result, cant hurt to add the step of creating a zero length file after deleting/moving update.zip. I hadnt seen it, thus never did that but I havent had any OTA activity in a few days on mine.
Click to expand...
Click to collapse
just wanted to add that SOMETIMES the update.zip is not in /cache. had this happen to me when I had the LGV10 and it just happened to me now. I had recently wiped my device to start from scratch and after initially setting up my device I got the update icon and indeed /cache/update.zip existed. a few reboots later for various reasons the update icon/notification disappeared, as did /cache/update.zip. I thought I was in the clear until last night when I got the update icon/notification again, but this time it was not in /cache. it somehow changed to /data/data/com.google.android.gms/app_download. so if you can't find it in /cache, look there!

Categories

Resources