[GUIDE] HOW to downgrade HTC Legend 2.2 to 2.1 to enable root - Legend Android Development

Hey guys, it took me 3 whole days to find the right way to downgrade.
Note: This is to be done at your own risk; I am not responsible for any damage or harm caused by this process.
Note: Information in this guide is taken from the works of following Authors:
1. wag3slav3: (http://forum.xda-developers.com/showthread.php?t=725430)
2. Paul (http://android.modaco.com/content/ht...rom-froyo-ota/)
3. TheDeadCpu: (http://forum.xda-developers.com/showthread.php?t=746454)
Please Follow the Instructions Carefully; to ensure success!
Items Required:
1. HTC Legend
2. 1 MicroSD Card (Gold Card)
3. 1 Micro USB Cable
4. Full Charge Recommended
5. Windows OS (I used W7)
Other Stuff:
1. Android SDK
2. hack4legend-v5.zip
3. RUU 1.31 for Legend
Common Errors Faced in the Process:
1. c---rw---- INSTEAD OF crwxrwxrwx
2. ADB Server timed out
3. Various RUU Errors
4. Visionary Not Working/Opening
Troubleshoot:
When you attempt to root you may face ADB timed out errors, it can be very annoying – there are various reasons for this, for me it was HTC Sync that was conflicting with ADB, shutting it down allowed me to boot into the custom recovery (step2 in the root process).
If you run into various other RUU errors (such as: unable to load boot loader, which was fixed by following step 3 correctly.) while trying to downgrade, most likely you didn’t do it correctly. Try doing it again and it should work.
Visionary Not Working/Opening (Solution: Download from phone browser: http://content.modaco.net/dropzone/c...ryplus.r13.apk)
Recommended to Back up Data:
1. Contacts:
You can save you’re contacts from you’re legend by clicking contacts, menu, import/export and export to SD Card.
2. SMS:
Get the SMS Backup and Restore App form Market, Install and Save it on to the SD Card.
3. Backup Complete SD Card:
Copy all the contents of the SD Card and save it onto the PC.
We start now;
Step 1:
Install Android SDK
Extract hack4legend-v5.zip to C Drive
Step 2:
Have adb in your path, or move the files contained in hack4legend-v5.zip into your sdk/tools directory so your pushes will work properly.
FOR ALL OS's Make sure your phone has Applications->Development->USB Debugging turned on.
Do NOT have your phone in Disk Drive Mode, have it in Charge Only.
Open a terminal window in your /tools/ directory. Type this at the prompt.
Code:
crackin.sh
or in Windows
Code:
crackin.bat
Your phone will reboot 5 times.
You WILL see several error messages.
it looks like this c---rw----
c---rw---- 1 1001 2002 90, 0 Jul 19 16:19 /dev/mtd/mtd0
You’re done with this.
Step 3:
- Temproot with VISIONary r13 (install the downloaded file as per a normal APK)
- Once you are temprooted, connect via 'adb' and do 'su' (to get root) then '/data/local/flash_image misc /data/local/misc1-2.img'
Step 4:
RUN RUU to downgrade to 2.1 – it should be possible to do so now.
Hence, you will be downgraded to 2.1 and you can use the normal way to root your legend.
All I can say is that the CM7 Mod is so fast on the Legend, no lag whatsoever, it's beyond! (will post a video 4 you guys)
End.

Forgive me if i seem rude.Hasn't this been covered in many other threads before?

I searched the site but never found this same method, is a combination of 2 or more guides at one place, also touching on some of the common errors faced when downgrading.

after this command '/data/local/flash_image misc /data/local/misc1-2.img'
it says "flash_image not found"....

So? Find it and put it there via adb.

but this is what i try...
i have both files in c:/hack4/ and in c:/android-sdk-windows/tools/
i wright in command " /c/hack4/flash_image misc /c/hack4/misc1-2.img"
and i have the message "flash_image not found"
am i doing something wrong?
i have also tried "/c/android-sdk-windows/tools/flash_image misc /c/android-sdk-windows/tools/misc1-2.img" the same problem...

What hboot do you have? Look at the guide for YOUR hboot ive had different Hboots across 2 devices and needed to use the right guide for the right hboot

bonesy said:
What hboot do you have? Look at the guide for YOUR hboot ive had different Hboots across 2 devices and needed to use the right guide for the right hboot
Click to expand...
Click to collapse
i have 1.01

alfagama said:
i have 1.01
Click to expand...
Click to collapse
http://forum.xda-developers.com/showpost.php?p=10217134&postcount=1

bonesy said:
http://forum.xda-developers.com/showpost.php?p=10217134&postcount=1
Click to expand...
Click to collapse
i have tried this to... the same problem

Are you sure you executed these codes from Guide 2 ?
Code:
adb push flash_image /data/local/
adb push misc1-2.img /data/local/...switch back to 1st command prompt and change permission of flash_image_binary:
Code:
chmod 755 /data/local/flash_image
Click to expand...
Click to collapse
These is supposed to upload the images required on your phone and be exventually be executed on your phone to replace the image
ps: im no expert but i just flashed mine recently and i had to read the guides several times to understand the logic behind each guide to avoid mistakes some had with their phones...

alfagama said:
i have tried this to... the same problem
Click to expand...
Click to collapse
Then you cant be followign the guide right.Have you done temproot?

yes i tried with visionairy13 and 14 both time i had su= #
a noob question...'/data/local/flash_image misc /data/local/misc1-2.img' =" /c/hack4/flash_image misc /c/hack4/misc1-2.img" where i have the 2 files...

Blay0 answered correctly...i didnt

alfagama said:
a noob question...'/data/local/flash_image misc /data/local/misc1-2.img' =" /c/hack4/flash_image misc /c/hack4/misc1-2.img" where i have the 2 files...
Click to expand...
Click to collapse
Nooooooooo dammit! You have just pushed both those files to your phone!!!!!!!!! Go to your phone shell via adb, execute su to gain root privileges and then execute flash_image on your phone not on your PC!!!!! It doesn't really matter where on the phone do you have both as long as they are both in /data dir and don't prepend anything!!!

i am very confused now , can yoy help me step by step?
i run on my phone visionairy and then i click on temproot.
then i run on my pc cmd and i give the comand "adb shell" and then i type su and it says #...
after that should i give the next command on the pc again or on my phone, and with what should i replace the /data/local/ ...?

Pay attention dude!
Open two command prompts. Name them ONE and TWO. You gonna use ONE for copying files from your PC to your phone using adb push. You gonna use TWO for connecting from your PC to your phone using adb shell and execute all commands meant to be executed on your phone there. Now use ONE to copy (adb push) a program called flash_image to your phone's directory /data/local. After you do that use TWO to connect to your phone (adb shell), execute su to gain root privileges (you get # prompt) now in the same commnd prompt (that's TWO) change permissions of program flash_image you have just copied to your phone in ONE. Then also on TWO execute flash_image program with parameters from above.
If you don't understand what I'm saying you better sell that phone and instead use phone booth. In fact sell all your hi-tech stuff including your PC. It would be much safer for you and even for us.
Sent from my HTC Legend

alfagama said:
/c/hack4/flash_image misc
Click to expand...
Click to collapse
Faaaairly sure you're gonna want to write C: and not c/ dude, regardless of what other stuff you're doing wrong.

BlaY0 said:
Pay attention dude!
Open two command prompts. Name them ONE and TWO. You gonna use ONE for copying files from your PC to your phone using adb push. You gonna use TWO for connecting from your PC to your phone using adb shell and execute all commands meant to be executed on your phone there. Now use ONE to copy (adb push) a program called flash_image to your phone's directory /data/local. After you do that use TWO to connect to your phone (adb shell), execute su to gain root privileges (you get # prompt) now in the same commnd prompt (that's TWO) change permissions of program flash_image you have just copied to your phone in ONE. Then also on TWO execute flash_image program with parameters from above.
If you don't understand what I'm saying you better sell that phone and instead use phone booth. In fact sell all your hi-tech stuff including your PC. It would be much safer for you and even for us.
Sent from my HTC Legend
Click to expand...
Click to collapse
my friend i pretty sure that you know much than i do...
but for your information i am 48 and i am the last 20 years involved with computers and mobile phones.... over that 20 years i have learned at least to follow instructions (if they are clear), so once again thanks for your help.
my problem was that after unistalling sync 3.0 and installing sync 2.033 i have not uninstalled the drivers so i had problem.
after fixing that everything went smooth.

So after 20 years in computers, you actually found out that the problem was on your side and not in the instructions. Too bad. My mom is also been using computers for more than 20 years. She knows what is monitor and that she can move cursor around with the mouse.
BTW what has version of sync to do with your confusion? You are trying to say that "flash_image not found" error had something to do with sync version? Ohh, give me a break...
And as far as clear instructions are concerned... I guess they are pretty clear if 99 ppl find them OK and one (that's you) doesn't.
Don't want to be rude but maybe 20 years was too much and it is time to start something completely different.

Related

Having trouble with root

I've followed the instructions to a T on the wiki but I'm having a few problems. I had to downgrade to RC29 and then put "recovery.img" and the HardSPL "update.zip" on the root of the memory card. I even finished with the telnet commands (which didn't seem to do anything) and flashed JesusFreke's 1.5 crb43. Now when I try to use the Terminal Emulator for abd commands I get a permissions error. In addition, nothing shows up in my Superuser Permission application leading me to believe that I may not have rooted properly.
Any help would be greatly appreciated.
I forgot to mention that I cheated and I don't know if that was a problem. I started with crb43 and used the old exploit to downgrade to rc29 (format sd card, copy rc29 update.zip to root of card, enter bootloader mode and flash).
SharpieMarker said:
I've followed the instructions to a T on the wiki but I'm having a few problems. I had to downgrade to RC29 and then put "recovery.img" and the HardSPL "update.zip" on the root of the memory card. I even finished with the telnet commands (which didn't seem to do anything) and flashed JesusFreke's 1.5 crb43. Now when I try to use the Terminal Emulator for abd commands I get a permissions error. In addition, nothing shows up in my Superuser Permission application leading me to believe that I may not have rooted properly.
Any help would be greatly appreciated.
Click to expand...
Click to collapse
You should be using adb for terminal commands. If you type 'adb' in the terminal you will get nothing.
Go to terminal emulator and type 'su'
if it brings up the permission screen press 'allow'
if your command line changed from '$' to '#' then you have successfully rooted.
There shouldn't be anything in superuser permissions if you haven't given any apps permissions (every app is considered a different user)
Hope this helps, but this seems like a thread that would be better suited to the Q&A or Dream topics since this is the Development section not general questions...just thought I'd mention it.
Just AIM me: Breakthecycle2
Breakthecycle2 said:
Just AIM me: Breakthecycle2
Click to expand...
Click to collapse
I can't use AIM at work. I am better reached at [email protected]
I think that worked. su brought up permissions window and when I select allow I now have root. Brilliant. Thanks very much for the assistance.
EDIT:
Oops
Then what am I missing about this? I'm attempting to replace these files to increase my maximum volume and I'm unable to use any of the adb commands, even with root.
adb remount
- wait for the 'remount succeeded' message
adb push Desktop/AudioFilter.csv system/etc
adb push Desktop/AudioPara4.csv system/etc
adb push Desktop/AudioPara4_TMUS.csv system/etc - Optional
SharpieMarker said:
Then what am I missing about this? I'm attempting to replace these files to increase my maximum volume and I'm unable to use any of the adb commands, even with root.
adb remount
- wait for the 'remount succeeded' message
adb push Desktop/AudioFilter.csv system/etc
adb push Desktop/AudioPara4.csv system/etc
adb push Desktop/AudioPara4_TMUS.csv system/etc - Optional
Click to expand...
Click to collapse
adb is the Android Device Bridge that allows you to interface your G1/Magic with an x86 Windows system. It is included in the Android Developer Toolkit.
You need windows and to have your G1 connected to your computer. There are a few really good threads giving step by step walkthroughs on setting it up correctly, just use the search.
ADB for Dummies
ADB for Dummies
ADB can't be used from terminal emulator on the phone...you have to use it from your windows command prompt...read up on ADB first.

[GUIDE] How to downgrade from OTA RUU 2.2 to 2.1

Fixed the typo's in the code, thanks to Contempt4You for pointing it out for me.
Note, i had to remove the links due to the restrictions of being a new user, but the tools can be found fairly easily, you will need the revert.zip that contains flash_image and mtd0.img, the evo-root.zip from the how to root android 2.2 on the evo 4g on this forums and all you need is the rageagainstthecage-arm5.bin, and an original PB31IMG.zip from the RUU 2.1
I adapted this guide from these instructions
As always, I have no responsibility when you try this things go really foobar, and you have a nice paper weight.
I am going to copy and paste much of the instructions off of the page above, make the changes specific to the DInc, and will try to update the links for the stuff to download as I can. Everything that is needed is already hosted somewhere on the internet.
Make sure your phone is unplugged from your computer until I tell you to plug it in!
If you already have the Android SDK and HTC Sync set up on your computer, skip to Step 4 now
Step 1: Download the Android SDK here
Step 2: Extract the Android SDK zip. Move the contents of the extracted zip to C:\
Your Android tools folder path should now be C:\android-sdk-windows\tools
Step 3: Download HTC Sync 2.0.40
Run the installer. Move on once installed. If reboot is required, do so and then move on.
Windows 7 Users:
Go to your start menu, then control panel. When that is open, (if you are in category view mode) click on "Uninstall a program" and then choose HTC Sync to uninstall. If you are in Icon view mode choose "Programs and Features" and then click on HTC Sync to uninstall. This will load the proper drivers needed for unrevoked3.
Other Windows Version Users:
Go to your start menu, then control panel. When that is open, select Add/Remove Programs, and then choose HTC Sync to uninstall. This will load the proper drivers needed for unrevoked3.
next download
It contains a few files necessary to root the DInc.
Unzip the contents of the zip to your android sdk tools folder.
Also download the original 2.1 PB31IMG.zip file, or is a download link to the RUU 2.1.
Put this zip in your sdk tools folder as well, as a zip, not extracted.
After unzipping the contents of revert.zip to your android sdk tools folder and placing the PC31IMG.zip move on.
Step 4: Make sure USB Debugging is ON (checked) on your EVO. Go to Settings > Applications > Development > and make sure it is checked.
Step 5: Plug your phone into the computer via USB, Make sure that the connection type in the Notification Pull-Down Bar is "Charge Only", not "Disk Drive" or else this won't work.
If your computer asks you to restart after the new drivers were installed, do that now.
Step 6: Open up a command promt from your android-sdk/tools folder.
Windows 7 users:
Open up the android sdk folder and hold shift and right click on the tools folder. You will see an option that says "Open command window here" Choose that one and you will be set. the command prompt should read something like C:\android-sdk-windows\tools>
Other Windows Version Users:
Go to the start menu, go to All Programs, then Accessories, and click on command prompt. Once open type
Code:
cd C:\android-sdk-windows\tools
Once ready, type these commands in cmd prompt from your adb tools directory. After every line press enter.
Code:
adb push unrevoked-forever.zip /sdcard/
adb push flash_image /data/local/
adb push rageagainstthecage-arm5.bin /data/local/tmp/
adb push mtd0.img /sdcard/
adb push PB31IMG.zip /sdcard/
Note: the PB31IMG.zip will take longer than expected to transfer to the sdcard. It is a BIG file.
Now we chmod a few things. After every line press enter. It should repeat what you typed in and then return you to a blank line with an $ for everything in adb shell
Code:
adb shell
cd /data/local/tmp
chmod 0755 /data/local/tmp/rageagainstthecage-arm5.bin
cd /data/local
chmod 0755 /data/local/flash_image
Ok now for the root shell.
*
(still in adb shell)
Code:
cd /data/local/tmp
./rageagainstthecage-arm5.bin
You will now see some text on your cmd prompt screen explaining the exploit.
Wait for the adb shell to go away, and it will dump you into your windows command prompt again (no shell) should look something like this:
C:\android-sdk-windows\tools>
Once that dumps you out of the shell, type
Code:
adb shell
and you will see you now have a
Code:
#
instead of a
Code:
$
now type
Code:
cd /data/local
./flash_image misc /sdcard/mtd0.img
that will flash your misc partition with Toast's mtd-eng.img.
This should return you to a blank line with #.
If you get an "Out of memory error" with a huge list of weird lines, here's how to fix it.
Reboot your phone normally.
Open a command prompt and go backwards in this guide until you see the big red * and start from there.
Once it is flashed correctly, move on:
Type
Code:
reboot bootloader
Remember how you pushed that huge PB31IMG.zip to your sdcard earlier? This is where that comes in handy. Once you booted into hboot, Select "bootloader" with your volume up/down buttons and hit the power button. Let it sit for a little bit while it loads the PB31IMG.zip. This can take up to 5 minutes. When it finally asks if you want to apply this zip, choose YES. (Remember, this is the same as running an RUU, so it will delete all of your user data).
Once it is finished, select restart. You now are on the stock 2.1 build of Android.
From here you can root your phone and do unrevoked forever and what not for the people that updated to 2.2 without being s=off
Confirmed Works.
Thank You So much
I have been tyring to find a way to do this all day...works perfectly...took a little effort to find the files but overall great right up....
If someone who has enough post wants to post the links to the files, please do.
Sent from my ADR6300 using XDA App
well really all you have to do now is flash a original PB31IMG.zip in HBOOT if you have s-off which you should if you're hacking in the first place.
borgey420 said:
well really all you have to do now is flash a original PB31IMG.zip in HBOOT if you have s-off which you should if you're hacking in the first place.
Click to expand...
Click to collapse
Don't you think the whole point of his post was for people who didn't do S-OFF and did the latest leaked RUU and are stuck now because they fail to read.
Yeah, that is what this guide is about is for the people who were not s-off. At the time I did the ruu update I didn't feel comfortable doing s-off and then I learned about it, felt better, but then it was too late, I already updated to froyo. This is how I solved that problem so I could s-off my phone after the update.
Sent from my ADR6300 using XDA App
nice man so this is for people who didn't do s-off before doing the 2.2 RUU and can now go back to 2.1 so essentially they could now s-off to get root for 2.2? great work, bro!
** would this work for new phones, or say a refurb that came with 2.2 already, and unrevoked hasn't come out with a new root method yet, so you could use this method to get back to 2.1, s-off, then ota to 2.2 and attain root. even better.
excellent post assuming it works
lots of people will want this if they need to root now.
In theory it should work, I don't see why it wouldn't. I don't have one that came with 2.2 so I don't know for sure.
Sent from my ADR6300 using XDA App
Confirmed this is working. Some typos in the writeup but that's easily fixed once you catch it.
zeiroe said:
Confirmed this is working. Some typos in the writeup but that's easily fixed once you catch it.
Click to expand...
Click to collapse
I took a quick glance at this and stopped because right away I noticed errors and didn't wanna screw anything up. Glad to see it works, thanks.
here you go!
Android SDK
HTC Sync 2.0.40
revert.zip that contains flash_image and mtd0.img
the evo-root.zip contains rageagainstthecage-arm5.bin
original PB31IMG.zip from the RUU 2.1 or if you prefer rapishare, here you go
I believe he used this guide
sorry if this is a stupid question, but to confirm, does this process downgrade the radio too? The radio is what worries me the most, and presumably because the 2.15 radio was in the RUU, this process would downgrade it back to 1.x? Is it contained in the PCI...zip file? thanks all (used the RUU and now don't have any sound from internal speaker, trying to get back)
If you will send me a PM with what typos I made, I will fix them. I am currently in AIT with the guard and don't have much time. The code should be correct, I believe the typos is where I wrote it up, and then had to remove the links because of the forums restriction of posting links when you are new.
Yes, this does downgrade the radio too. You are making your phone exactly like it came originally.
Thank you so much for posting he links.
Sent from my ADR6300 using XDA App
I'm getting permission denied errors
Code:
C:\android-sdk-windows\tools>adb push mtd0.img /sdcard/
failed to copy 'mtd0.img' to '/sdcard//mtd0.img': Permission denied
what am I doing right?
edit: nevermind....figured it out....my SD card wasn't mounted on my phone
im doing this now. i hope i do everything right. i will post
Hey smwoodward, I hope you don't mind but I posted a reiteration of your guide on my blog. I see this being needed in the future for the new DInc's that will come with flavor of 2.2 out the box.
zeiroe said:
Hey smwoodward, I hope you don't mind but I posted a reiteration of your guide on my blog. I see this being needed in the future for the new DInc's that will come with flavor of 2.2 out the box.
Click to expand...
Click to collapse
No dude, 100% cool with me.
Sent from my ADR6300 using XDA App
what am I doing wrong?
I followed directions step by step and I get it all done correct, but when it comes to loading the image off of the SDcard onto the phone in HBoot, I get error message "no image or wrong image"
HELP PLEASE!!!

[Q] Please help me use adb to root JI6 on a mac!!

I have been trying to make this whole adb think work for about twenty hours strait and I still have not gotten very far. I own a mac and no pc and updated to froyo with my buddies pc. I have followed all the directions to a T over and over using terminal on the mac and I can get to the ADB commands and even to where I can see my phone by clicking devices but I must be missing something important. ANY HELP WOULD BE REALLY APPRECIATED I AM ABOUT TO PULL MY FREAKING HAIR OUT!!!
Ok, so if you can see your phone through adb, then you are definitely on the right track. Unfortunately, I'm not really familiar with OS X anymore so I'm not quite sure how to do it. Just sit tight for now until someone who does use a Mac, or has more of a clue then I do can help you out.
But seriously, don't pull your hair out. It won't stay on your head forever ya know...
Edit: oops, just saw this is JI6 (Froyo) not JF6, so I can't help you, but here is a general overview:
from terminal inside Android sdk main directory:
tools/adb devices -> list all devices connected that ADB can see
tools/adb shell -> gets a normal user shell on your phone
tools/adb reboot recovery -> reboots into recovery mode, suitable for update.zip root method
--------------------------------
Place the root update.zip on internal sdcard.
from terminal inside Android sdk directory:
tools/adb reboot recovery
Select the update software option, and you will be done.
laxwillsch said:
I have been trying to make this whole adb think work for about twenty hours strait and I still have not gotten very far. I own a mac and no pc and updated to froyo with my buddies pc. I have followed all the directions to a T over and over using terminal on the mac and I can get to the ADB commands and even to where I can see my phone by clicking devices but I must be missing something important. ANY HELP WOULD BE REALLY APPRECIATED I AM ABOUT TO PULL MY FREAKING HAIR OUT!!!
Click to expand...
Click to collapse
Start simple:
If you open a terminal on the mac, and go to your android SDK tools folder; what happens when you type ADB shell?
Or if you type any of the ADB push commands?
You need to give more detail around what you are seeing for us to help you.
Ok so if I am in terminal and i type in my /android-sdk-mac_x86/tools nothing happens and it just says /android-sdk-mac_x86/tools is a directory. But if I type the same but with /tools/abd it opens the abd command lines, like how to write code. Then when I try to "adb push rageagainstthecage-arm5.bin /data/local/tmp/rageagainstthecage-arm5.bin"
it says "-bash: adb: command not found"
however when I type laxwillsch$ /android-sdk-mac_x86/tools/adb shell
it does give me the drop down $
but when I then try to write the next line of code "chmod 0755 rageagainstthecage-arm5.bin"
it says "chmod: rageagainstthecage-arm5.bin: No such file or directory"
I am stumped I am beginning to think i need to buy a pc as I am very interested in android development and want to learn more, but it seems all the tutorials are run assuming you are on a PC
EDIT** I have downloaded the android SDK started pack, and the 2.2 root pack and they are all in my /android-sdk-mac_x86/tools folder that is directly on my Macintosh HD for simplicity
Do you know how to change directories (cd command)?
The problem is that you are trying to work in one directory, but all your tools are in another.
So change directories to the tools directory:
cd /android-sdk-mac_x86/tools/
now run your adb commands - you may have to type ./adb to tell your mac to look in the current directory for the adb command (that is what ./ means "start here")
Also, try to understand what is happening so you can more easily troubleshoot: chmod is a command to change permissions, and you are running it on the phone. If you can't push the file to the phone, then you can change it's permisssions. I guess you never got rageagainstthecage on the phone, so there is no way to chmod it.
If you can't do this on a mac, a PC is not easier. I use both, and like both, but you need to learn basic commands first - they apply to the mac terminal and the windows cmd prompt.
Getting root means moving in and out of the phone - adb shell - puts you in a terminal on the phone. So you really need to understand cd (change directory); pwd (present working directory - shows you where you are); cp (copy); and know your current path - what the ./ does.
I hope this helps, not trying to sound condescending - maybe practice a linux terminal tutorial would help
Thanks so much, I am at school right now and cant test out all that but you are really helping me understand all this! I will post tonight and let you know how it goes. again thank you
ok so i dont have my usb cable with me but I was playing around with the commands that you suggested and ureka! i finally got to a point where it says "h70-33-65-19:tools laxwillsch$" thats a first! and when i type pwd it shows "/android-sdk-mac_x86/tools" so that means I am working out of the right directory right? and from here I enable usb debugging connect my phone then just copy and paste the codes from the thread correct?
yes, it sounds like you are on the right track. But take it nice and slow when you follow the steps. It is very important that the commands are entered exactly as you see them.
Also, one step tells you to wait for something to run and kick you out of ADB - wait just like it says - takes about 45 seconds but feels like forever.
If you are in the tools directory - just by typing "adb" no quotes will give you whole page of adb commands - if you get a "command not found", then you need to add the ./ and make it ./adb
Hope this helps and again, read the commands step by step a couple times first so you understand what is happening.
In a nutsell, you push the rage file;
change its permissions, run it;
get kicked out of ADB and then open a new ADB shell;
you are now root;
remount the system partition to give you write access when it reboots;
reboot;
push over some files;
change permissions on files you pushed;
reboot;
Some things to know - SU is a command for gaining root access; when you use SU your prompt changes (in adb shell) from $ to #
If you are succesful you should see the SuperUser app listed in your apps.
Done and Done just rooted successfully couldnt have done it without you! thanks so much

[Q] Terminal Emulator....Help??? Anyone???

I have wiped and restored more times tonight than I can count....HELP!!!! I have a very lean rom. So lean it that it has no file explorer and I don't want to install gapps. All I want to do is install Titanium Backup (the .apk file is on the root of my SD card) with the terminal emulator and I'll be all set. I have had all different error messages, and I'm more confused now then when I started this adventure, 6+ hours ago. Any help would be great.
hockeyfamily737 said:
I have wiped and restored more times tonight than I can count....HELP!!!! I have a very lean rom. So lean it that it has no file explorer and I don't want to install gapps. All I want to do is install Titanium Backup (the .apk file is on the root of my SD card) with the terminal emulator and I'll be all set. I have had all different error messages, and I'm more confused now then when I started this adventure, 6+ hours ago. Any help would be great.
Click to expand...
Click to collapse
Just download a file manager, (es fileexplorer, or root explorer) and install it that way. or if you have adb and all the drivers you need for it.
Put the .apk in the tools folder in the SDK
and go to it in a command prompt and type adb install titaniumbackup.apk..
Or whatever you apk is named.
if you need help, dont quote this, just send me a pm for help =]
(Posting this again for others reference all this is pulled from my previous post which you can find in my signature - "Terminal/adb shell commands")
Adb commands are completely different than terminal commands.
First enter "su" to get substitute user (the # sign)
Then enter "mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system" to make the root r/w
to copy files use "cp" command
to move files use "mv" command
to remove files use "rm" command
to change file/dir permissions use "chmod"
to change directories use "cd" - "cd .." will bring you back one directory - "cd //" brings you back to root
to list files in the dir use "ls"
to read/mod/combine a file use "cat"
to edit a value use "echo"
to see running processes use "top"
to kill a process use "kill -9 PID#HERE"
ex) cp /sdcard/download/myapplication.apk /data/app/myapplication.apk
If you know any linux commands then you should know your way around terminal emulator. If you want i can give you more examples just let me know. Hope this helped
To answer your question OP, just follow my example. Except in your case it'd be something like this:
Code:
su
cp /sdcard/TitaniumBackup.apk /data/app/TitaniumBackup.apk
replace "titaniumbackup.apk" with the actual file name of your apk file.
Sent from my Android using Tapatalk
kyouko said:
(Posting this again for others reference all this is pulled from my previous post which you can find in my signature - "Terminal/adb shell commands")
Adb commands are completely different than terminal commands.
First enter "su" to get substitute user (the # sign)
Then enter "mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system" to make the root r/w
to copy files use "cp" command
to move files use "mv" command
to remove files use "rm" command
to change file/dir permissions use "chmod"
to change directories use "cd" - "cd .." will bring you back one directory - "cd //" brings you back to root
to list files in the dir use "ls"
to read/mod/combine a file use "cat"
to edit a value use "echo"
to see running processes use "top"
to kill a process use "kill -9 PID#HERE"
ex) cp /sdcard/download/myapplication.apk /data/app/myapplication.apk
If you know any linux commands then you should know your way around terminal emulator. If you want i can give you more examples just let me know. Hope this helped
To answer your question OP, just follow my example. Except in your case it'd be something like this:
Code:
su
cp /sdcard/TitaniumBackup.apk /data/app/TitaniumBackup.apk
replace "titaniumbackup.apk" with the actual file name of your apk file.
Sent from my Android using Tapatalk
Click to expand...
Click to collapse
i know theyre different,i was getting a point across, in which if he cant get it too work, try adb. Even though errors with TE usually means youre not entering something correct
davidevan said:
i know theyre different,i was getting a point across, in which if he cant get it too work, try adb. Even though errors with TE usually means youre not entering something correct
Click to expand...
Click to collapse
Yea they are. Besides, personally I'd do it the way you mentioned; either first using a filemanager (easiest imo) or via adb install
Only reason I replied was in case there was a specific reason he'd only want to use terminal emulator and not adb or a FileMan
Edit: Oh I see what I think you're referring to, the line:
Adb commands are completely different than terminal commands.
Click to expand...
Click to collapse
That was just directly copied from a post I made before something about wanting to "adb push" with TE, it had nothing to do with your response
Sent from my Android using Tapatalk
Thank you everyone. I need to use Terminal Emulator, because I'm not allowed to install the ADB drivers on my work computer, the ROM I want to use did not have a file manager packed in it and I don't want to install gapps to download one from the market. I simply want to install Titanium, so I can add a file manager and a couple of other select apps so as not to clutter up the system. As soon as I flash back to that rom, I'll try it the above mentioned way.
hockeyfamily737 said:
Thank you everyone. I need to use Terminal Emulator, because I'm not allowed to install the ADB drivers on my work computer, the ROM I want to use did not have a file manager packed in it and I don't want to install gapps to download one from the market. I simply want to install Titanium, so I can add a file manager and a couple of other select apps so as not to clutter up the system. As soon as I flash back to that rom, I'll try it the above mentioned way.
Click to expand...
Click to collapse
Ah thats sucks bro, it come in handy now and then, Listen to this guy up here since he knows more about TE than I. Also a simple google "terminal emulator" command and it might add on to your comprehension.
And judt to get this outta of the way, in TE if you do type su <enter> you get #? if you dont #,you get acces denied; denied meaning youre not rooted. Meaning it cant find an su in the bin or xbin, rendering TE pointless. So make sure youre root
hockeyfamily737 said:
Thank you everyone. I need to use Terminal Emulator, because I'm not allowed to install the ADB drivers on my work computer, the ROM I want to use did not have a file manager packed in it and I don't want to install gapps to download one from the market. I simply want to install Titanium, so I can add a file manager and a couple of other select apps so as not to clutter up the system. As soon as I flash back to that rom, I'll try it the above mentioned way.
Click to expand...
Click to collapse
btw click my thanks meter ;]
its the ony thing i have left lmao! :'(
davidevan said:
Ah thats sucks bro, it come in handy now and then, Listen to this guy up here since he knows more about TE than I. Also a simple google "terminal emulator" command and it might add on to your comprehension.
And judt to get this outta of the way, in TE if you do type su <enter> you get #? if you dont #,you get acces denied; denied meaning youre not rooted. Meaning it cant find an su in the bin or xbin, rendering TE pointless. So make sure youre root
Click to expand...
Click to collapse
and how is your computer not compatible with SDK. You dont have Windows, linux or Macc?
davidevan said:
and how is your computer not compatible with SDK. You dont have Windows, linux or Macc?
Click to expand...
Click to collapse
It's not an issue of compatibilty..... It's an issue of the IT people at work having our computers locked up so we can't install / uninstall anything from them. All I can do is transfer files from the pc to my sd. I don't have authorization to install the necessary drivers for my phone.
hockeyfamily737 said:
It's not an issue of compatibilty..... It's an issue of the IT people at work having our computers locked up so we can't install / uninstall anything from them. All I can do is transfer files from the pc to my sd. I don't have authorization to install the necessary drivers for my phone.
Click to expand...
Click to collapse
If you can transfer files from a computer to a device, then you should be able to take files from a USB drive and put them on the C drive of your computer.
waffle_ said:
If you can transfer files from a computer to a device, then you should be able to take files from a USB drive and put them on the C drive of your computer.
Click to expand...
Click to collapse
To clarify.... Yes I can access my sd card from my computer. Yes I can transfer files between my sd card and my hard drive. However, when I try to install the ADB drivers to access the rom in my phone I get a little message that I'm not authorized to add / remove hardware or software from the computer....to please contact my IT administrator. Maybe it's something I'm doing wrong, maybe it's not. If I can learn to use this emulator though, it doesn't really matter. I have ADB on my computer at home if I really need it, I'm just not inclined to turn the computer at home on very often. Thanks again to everyone for the help.
"
hockeyfamily737 said:
To clarify.... Yes I can access my sd card from my computer. Yes I can transfer files between my sd card and my hard drive. However, when I try to install the ADB drivers to access the rom in my phone I get a little message that I'm not authorized to add / remove hardware or software from the computer....to please contact my IT administrator. Maybe it's something I'm doing wrong, maybe it's not. If I can learn to use this emulator though, it doesn't really matter. I have ADB on my computer at home if I really need it, I'm just not inclined to turn the computer at home on very often. Thanks again to everyone for the help.
Click to expand...
Click to collapse
Search the dev thread for my guide on how to install adb. Might do the job for your work computer. Or just hit my avatar and find the thread that way. If you do try it let me know if it works.
#Root/Hack_Mod-Always®
laie1472 said:
"
Search the dev thread for my guide on how to install adb. Might do the job for your work computer. Or just hit my avatar and find the thread that way. If you do try it let me know if it works.
#Root/Hack_Mod-Always®
Click to expand...
Click to collapse
Sitll no good installing ADB at work, but I did get a good ADB workout at home this weekend rooting my son's Optimus......Wholy crap!!! Revert to old software, lose the lcd display, root with rage against the cage, push recovery to the phone, revert back to current version of software, lose root, and then re-root on current software with recovery already installed, what a process that was!!!! BTW.... Terminal Emulator commands worked perfect. Mistake I was making was trying to "push" from my SD card instead of "copy".

Help flashing stock rom to Pixel 4 XL with Pixelbook?

Hello folks!
Its been a while since i posted here - i havent been flashing roms for an age (kids etc got in the way!)
Anyway, i've picked up a Pixel 4 XL, and it was running a custom ROM, i'm trying to move back to stock and have been able to follow all the guides i've found up to using the 'fastboot flashall' in shell.
The command works and delivers the
Bootloader Version...:
Baseband Version.....:
Serial Number........:
values, but then errors out with the following error "fastboot: error: ANDROID_PRODUCT_OUT not set"
I'm stumped what that means and how to fix. I'm doing all of this on my Pixelbook, and have updated fastboot and adb as per the initial steps for flashing.
Can anyone shed any light on what i still need to do to get flashall to work as expected?
Thanks in advance if you are able to help out!
ptm
Welcome Back
Could you post the exact command you are using for fastboot flash please? It sounds like fastboot is not finding the files to flash. Usually, depending on the configuration of the fastboot install, it's easier to place the firmware in the same directory as the fastboot binary.
Thanks! It turns out i've missed this place!
So the firmware files are all on the chromebook and I've used 'shell' to navigate to where I've unzipped. Here's the command line with the command i'm using: "[email protected] ~/Downloads/ota_file $ fastboot flashall"
Before trying a full flash, i was trying to sideload the OTA as per instructions here https://developers.google.com/android/ota#instructions but moving the file from my pixelbook to the 4XL fails at 47% every time.
So i reverted to a full flash as per these instructions - https://developers.google.com/android/images and that is where i'm coming a cropper with the 'not set' error.
Thanks for your help!
ktmom said:
Welcome Back
Could you post the exact command you are using for fastboot flash please? It sounds like fastboot is not finding the files to flash. Usually, depending on the configuration of the fastboot install, it's easier to place the firmware in the same directory as the fastboot binary.
Click to expand...
Click to collapse
I thinnk you may be merging several approaches.
You are using the full factory image downloaded from the https://developers.google.com/android/images page, right? Then, once downloaded, you are unzipping the file and cd into the new directory (from the unzip). The command then should be
Code:
./flash-all.sh
As far as the OTA install is concerned, you are using the command
Code:
adb sideload "ota_file.zip"
, and at 47%, what happens that it appears to fail? My memory on my P3XL is at that point it takes awhile.
If you are using a C to C switch to an A to C cable and try it. You'll want to remove the wipe from the flash-all before you flash the full image and it's the flash all you should be using to flash.
Yeah i think you're right - so now just concentrating on the Full Flash method shown on the Google Developers page, and yes doing it exactly as you'd described.
Ok - using
Code:
./flash-all.sh
now returns the error
Code:
bash: ./flash-all.sh: Permission denied
I have tried to prefix './flash-all.sh' with 'Fastboot' but no dice here either. Is that required at all?
ktmom said:
I thinnk you may be merging several approaches.
You are using the full factory image downloaded from the https://developers.google.com/android/images page, right? Then, once downloaded, you are unzipping the file and cd into the new directory (from the unzip). The command then should be
Code:
./flash-all.sh
As far as the OTA install is concerned, you are using the command
Code:
adb sideload "ota_file.zip"
, and at 47%, what happens that it appears to fail? My memory on my P3XL is at that point it takes awhile.
Click to expand...
Click to collapse
ptm said:
Yeah i think you're right - so now just concentrating on the Full Flash method shown on the Google Developers page, and yes doing it exactly as you'd described.
Ok - using
Code:
./flash-all.sh
now returns the error
Code:
bash: ./flash-all.sh: Permission denied
I have tried to prefix './flash-all.sh' with 'Fastboot' but no dice here either. Is that required at all?
Click to expand...
Click to collapse
You need to give the "flash-all.sh" script execution rights (that is why the permission denied error). Use this code:
Code:
chmod +x ./flash-all.sh
You may need super user/root rights:
Code:
sudo chmod +x ./flash-all.sh
The "flash-all.sh" script is a stand-alone script that sequentially flashes the entire factory package. As was mentioned in another repsonse in this thread, in cases where you want to update, but not lose your installed user apps and data, you would edit the script and remove the "-w" augment. In this case, you are returning to stock and you should perform the wipe (-w).
The dot slash (./) that preceeds the flash-all.sh tells the bash interpreter (what runs commands you give) that the file is right here, in this directory.
The flash-all.sh is a standalone script (series of written instructions) and calls fastboot from within it.
Thanks for sticking with me on this ktmom!
OK, i've used both
Code:
chmod +x ./flash-all.sh
and
Code:
sudo chmod +x ./flash-all.sh
but still getting the permission denied error when i launch ./flash-all.sh
I'll do a screencast vid walking through the entire process i'm following, so that you can see what i'm up too and in case it gives any further clues for a solution.
Thanks again!
ktmom said:
You need to give the "flash-all.sh" script execution rights (that is why the permission denied error). Use this code:
Code:
chmod +x ./flash-all.sh
You may need super user/root rights:
Code:
sudo chmod +x ./flash-all.sh
The "flash-all.sh" script is a stand-alone script that sequentially flashes the entire factory package. As was mentioned in another repsonse in this thread, in cases where you want to update, but not lose your installed user apps and data, you would edit the script and remove the "-w" augment. In this case, you are returning to stock and you should perform the wipe (-w).
The dot slash (./) that preceeds the flash-all.sh tells the bash interpreter (what runs commands you give) that the file is right here, in this directory.
The flash-all.sh is a standalone script (series of written instructions) and calls fastboot from within it.
Click to expand...
Click to collapse
@ptm, No worries, I'll do my best to help. I'm typing this on a chromebook that I also use to fastboot to a P3XL.
Edit 1:
Just to make sure:
1) The bootloader is unlocked?
2) "fastboot devices" returns the serial number of your device?
3) you are running ./flash-all.sh command as root or as the default user? In other words, the same way that fastboot devices returns the serial number. Either sudo fastboot devices or just fastboot devices.
4) if you enter the linux command: ls -al flash-all.sh do you get something like:
-rwxr-xr-x. 1 chronos chronos 957 Jul 18 2019 flash-all.sh
In this example -rwxr-xr-x is depicting the file permissions where there are three groupings; owner group everyone else. The first rwx means read, write and execute permissions for the file owner. Others in the same group and everyone else has read and execute permissions. Execute (x) is required in order for a script to run. If your file does not have three x so that all three groups have permission to execute it, then we need to revisit that.
Edit 2:
Another thought that could be affecting you is ADB and Fastboot are old. in your crosh shell, type:
Code:
[email protected] ~ $ adb --version
Android Debug Bridge version 1.0.41
Version 29.0.5-5949299
[email protected] ~ $ fastboot --version
fastboot version 29.0.5-5949299
Installed as /usr/local/bin/fastboot
If either returns a version older than the output above, then the easy way to update these is to use the script on Nathan Chance's Githuib. This might look a little overwhelming but it's pretty easy. I suggest you read the page, but the operative information is in section 4. Run the setup script:
To install, run
Code:
curl -s https://raw.githubusercontent.com/nathanchance/chromeos-adb-fastboot/master/install.sh | bash
in your shell prompt.
This script very nicely updates your ADB/Fastboot to the newest version which will be required for your P4XL
Are you guys sure you aren't making it too hard? You don't have to give any commands to install the full image. Download the full image and put it into an empty folder, go ahead and extract it in that folder. Create another new folder, Copy everything into it so you still have the full image in the first folder. Now download the tools and put those into a folder and extract them in that folder. Take the entire contents of that folder and add it to the folder you copied the extracted image into. What you should have now is one folder that still has the full extracted image, one that has the full extracted tools, and one that has both. If you have not already done so the phone should have debugging enabled and oem should be on. Go ahead and put it into bootloader mode and plug it in, type cmd in the path bar of the folder with both tools and image and check devices which will tell you if the tools can see the phone. If you get your serial the tools can see the phone. If you're going to wipe you can go ahead and click the flash-all and it will start the process, you do not give any commands. If you don't want to wipe the edit the flash-all to remove the-w, save it, and click on it. Again, no command is given, you just click and the flash-all does the rest.
Edit... And dont forget, A to C, not the provided C to C.
krabman said:
Are you guys sure you aren't making it too hard? You don't have to give any commands to install the full image. Download the full image and put it into an empty folder, go ahead and extract it in that folder. Create another new folder, Copy everything into it so you still have the full image in the first folder. Now download the tools and put those into a folder and extract them in that folder. Take the entire contents of that folder and add it to the folder you copied the extracted image into. What you should have now is one folder that still has the full extracted image, one that has the full extracted tools, and one that has both. If you have not already done so the phone should have debugging enabled and oem should be on. Go ahead and put it into bootloader mode and plug it in, type cmd in the path bar of the folder with both tools and image and check devices which will tell you if the tools can see the phone. If you get your serial the tools can see the phone. If you're going to wipe you can go ahead and click the flash-all and it will start the process, you do not give any commands. If you don't want to wipe the edit the flash-all to remove the-w, save it, and click on it. Again, no command is given, you just click and the flash-all does the rest.
Edit... And dont forget, A to C, not the provided C to C.
Click to expand...
Click to collapse
What Tools do you need to do this?
Same page as the images, scroll up from them and in the description of the process they have a link to the platform tools.
@krabman, Since this is using a chromebook, not a PC, things are flakier than normal. I just replicated the problems experienced by @ptm and some of it is due to old ADB/Fastboot as described in my previous post. Some is because ChromeOS made a change in an update that mounts nearly all of the partitions noexec, which means scripts can not execute and give the reported, "no permissions" error. There is a workaround since /usr/local is mounted executable. It's also possible to remount a partition with exec permissions.
@ptm, as the easiest route, I suggest making sure the ABD is current using the script I linked yesterday, and then going back to the OTA sideload method. I tanked my phone for a few hours yesterday trying to make fastboot get through the entire system image. I finally resorted to my full ubuntu install on my chromebook.
airmaxx23 said:
What Tools do you need to do this?
Click to expand...
Click to collapse
A general Fastboot/ADB tutorial is available here. If you are not using a chromebook, this thread's discussion will just add confusion.
If you are using a chromebook, then you need to enter a crosh shell, make sure adb and fastboot are updated as described in an earlier post and read the rest of the information I posted about the associated problems.
My understanding is the sh should flash on chrome with the latest tools as I described and you use the bat for PC. If the device is down he would have nothing to lose trying, if not I'd be leery of trying it since a partial flash will definitely result in a softie. Of course the possibility that I don't fully understand it may explain my puzzlement.
ktmom said:
A general Fastboot/ADB tutorial is available here. If you are not using a chromebook, this thread's discussion will just add confusion.
If you are using a chromebook, then you need to enter a crosh shell, make sure adb and fastboot are updated as described in an earlier post and read the rest of the information I posted about the associated problems.
Click to expand...
Click to collapse
Thanks, I know how to use ADB on the PC but I have a ChromeBook that I'd like to use as well. I already have it in Developer Mode.
I got it working, I just to run the script to update ADB and Fastboot.
airmaxx23 said:
Thanks, I know how to use ADB on the PC but I have a ChromeBook that I'd like to use as well. I already have it in Developer Mode.
When I open a Crosh Window, type shell, then adb devices my Pixel 4 XL shows up but I get: no permissions; see [http://developer.android.com/tools/device.html]
Click to expand...
Click to collapse
My bet is your ADB/fastboot are to old. Go back to post 9 and read the lower portion under edit2. You should also read forward from that point as there are additional issues that ChromeOS introduced with the noexec mounting of partitions. It will mean that without a workaround, you can not execute the flash-all.sh.
ktmom said:
My bet is your ADB/fastboot are to old. Go back to post 9 and read the lower portion under edit2. You should also read forward from that point as there are additional issues that ChromeOS introduced with the noexec mounting of partitions. It will mean that without a workaround, you can not execute the flash-all.sh.
Click to expand...
Click to collapse
Hey there,
SO i decided to try the OTA sideload method on a friends PC - i got the following response through CMD prompt
Code:
C:\Users\LYALL\Downloads>adb sideload ota-file.zip
Total xfer: 1.00x 1
However the phone is reporting a failure verifying the file signature and giving
Code:
E: Error code: 21
What do you think is causing that? I saw that Google has a new browser based flash tool to allow for AOSP builds to flash - would using that work better for me do you think?
ptm
ptm said:
Hey there,
SO i decided to try the OTA sideload method on a friends PC - i got the following response through CMD prompt
Code:
C:\Users\LYALL\Downloads>adb sideload ota-file.zip
Total xfer: 1.00x 1
However the phone is reporting a failure verifying the file signature and giving
Code:
E: Error code: 21
What do you think is causing that? I saw that Google has a new browser based flash tool to allow for AOSP builds to flash - would using that work better for me do you think?
ptm
Click to expand...
Click to collapse
Make sure you have downloaded the correct OTA and for crosshatch coral. Use the sha256 checksum provided in the download page and ensure the file is not corrupted. I check the integrity of the file before using it especially if I've moved it since the last verification.
You are rebooting to recovery (not rescue mode) and using the OTA sideload action from *within* recovery, before using the adb command, right?
The Google update and repair tool is an option.
ktmom said:
Make sure you have downloaded the correct OTA and for crosshatch. Use the sha256 checksum provided in the download page and ensure the file is not corrupted. I check the integrity of the file before using it especially if I've moved it since the last verification.
You are rebooting to recovery (not rescue mode) and using the OTA sideload action from *within* recovery, before using the adb command, right?
The Google update and repair tool is an option.
Click to expand...
Click to collapse
I think Pixel 4 XL is Coral, not Crosshatch.
I have downloaded the OTA file thats third from the bottom on this page (https://developers.google.com/android/ota) which is the rom number - 10.0.0 (QQ1B.200105.004, Jan 2020).
Yes, followed the instructions and booted to recovery, selected 'update from adb' from within recovery and then checked
Code:
adb devices
to ensure it showed 'sideload'. I then ran the command
Code:
adb sideload ota_file.zip
The transfer seemed to work fine, but then i got the error above showing on the device.
I cant seem to use the Google update and repair tool, as I'm in the UK and it says its not supported.
I can get it working with a VPN but the carrier i'm on doesnt show, although i do have the option of selecting 'other' as the carrier - I'm happy to give that a go, but wanted to get your thoughts on it first. Will selecting carrier as 'other' work ok for a UK based phone?
ptm

Categories

Resources