[GUIDE]Nexus 9 back to stock guide - Unbrick - Restore factory firmware - Nexus 9 General

The aim of this thread is to make an easy guide to flashing stock firmware. Owners of previous nexus devices already know all this stuff, this thread is aimed at making the process as simple as possible for new users. This will work regardless of what modifications you've done to your device. Remember to backup all your important data and do this with the knowledge that all flashing activity carries some risk.
Download
Factory image here
(for windows users) Minimal adb & fastboot
(for mac users) adb & fastboot for mac
Follow the instructions to install adb on your computer.
Prepare your tablet
Enable developer options in settings > about tablet and tapping build number 7 times
Open developer options and enable usb debugging. (If you haven't unlocked your bootloader yet, tick enable oem unlock)
Extract images
Place the downloaded factory image inside your adb folder and extract with 7zip.
A new folder will be there called something like volantis-lrx21. Open and extract "image-xxxxx-zip" to your adb folder. We are interested in these files:
bootloader-flounder-xxxxxx.img
boot.img
recovery.img
cache.img
system.img
vendor.img
Place these files directly into your adb folder.
# I recommend renaming the 'bootloader-flounder-xxxxxx.img' to just 'bootloader.img' to make it easier to type.
Now that everythings set up, we can start flashing
Plug in your device. Open the adb folder, hold shift and right click and select open command window here
(if your having driver issues try using Pdanet)
Run these commands one at a time
Code:
adb devices
adb reboot bootloader
if you haven't unlocked the bootloader yet run
Code:
fastboot oem unlock
and follow the instructions using the volume keys to scroll through the menu. This procedure will wipe all data.
Run the following commands one at a time
Code:
fastboot flash bootloader bootloader-flounder-xxxxxxx.img
[B] [I](replace 'bootloader-flounder-xxxxx.img' with full name of bootloader image[/I])[/B]
fastboot reboot-bootloader
fastboot -w
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash cache cache.img
fastboot flash system system.img
fastboot flash vendor vendor.img
(OPTIONAL) At this stage you can relock the bootloader if you want by running the command
Code:
fastboot oem lock
finally reboot the device by running
Code:
fastboot reboot
Thats it. Enjoy your tablet in factory condition

Great. Is it possible to make a batch file to run all the commands at once?

albsat said:
Great. Is it possible to make a batch file to run all the commands at once?
Click to expand...
Click to collapse
There is already a flash all batch script that comes with the firmware files but I've noticed that some people have problems with it so I decided not to include it. It should work fine most of the time.

i am long-time familiar with htc,but new to nexus. i was looking thru a couple downloaded factory image files and having noticed that "rebootRUU" is an oem command,and that "image-xxxxx-zip" contains an android info document,i am curious if anyone has tried flashing image-xxxxx-zip as a zip file,in ruu mode?

Cool, thanks for the information.

Thanks for creating this! Will come in handy. Saving this for later

This has been useful as the update from 5.0.1 to 5.0.2 kept failing on my rooted device. It was successful and educational.

scotty1223 said:
i am long-time familiar with htc,but new to nexus. i was looking thru a couple downloaded factory image files and having noticed that "rebootRUU" is an oem command,and that "image-xxxxx-zip" contains an android info document,i am curious if anyone has tried flashing image-xxxxx-zip as a zip file,in ruu mode?
Click to expand...
Click to collapse
I indeed tried this as a last chance hoping it would bypass bootloader lock protection. It didn't work since I think the factory image is not signed by HTC as RUU are . It also lead to a fastboot crash. Now sending my nexus 9 for RMA
Sent from my HTC One using XDA Free mobile app

remedya said:
This has been useful as the update from 5.0.1 to 5.0.2 kept failing on my rooted device. It was successful and educational.
Click to expand...
Click to collapse
Same here. The manual flash method worked very well. Here's hoping that Google doesn't muck 5.1

cant flash stock rom
I'm trying to downgrade my nexus 9 from DU rom 5.1.1 to stock for everything. I'm running the flash-all.sh on linux while my tablet is in bootloader mode. Tab makes and few checks and reboots automatically in bootloader mode. I reboot tablet and still has the DU rom. Any tips

nyasha1935 said:
I'm trying to downgrade my nexus 9 from DU rom 5.1.1 to stock for everything. I'm running the flash-all.sh on linux while my tablet is in bootloader mode. Tab makes and few checks and reboots automatically in bootloader mode. I reboot tablet and still has the DU rom. Any tips
Click to expand...
Click to collapse
The flash all script doesn't seem to work on linux. You shouldn't have a problem if you write the commands out manually.

nyasha1935 said:
I'm trying to downgrade my nexus 9 from DU rom 5.1.1 to stock for everything. I'm running the flash-all.sh on linux while my tablet is in bootloader mode. Tab makes and few checks and reboots automatically in bootloader mode. I reboot tablet and still has the DU rom. Any tips
Click to expand...
Click to collapse
Art Vanderlay said:
The flash all script doesn't seem to work on linux. You shouldn't have a problem if you write the commands out manually.
Click to expand...
Click to collapse
As indicated, the flash all script doesn't work very well on any system. Flash each .img separately via fastboot.

cam30era said:
As indicated, the flash all script doesn't work very well on any system. Flash each .img separately via fastboot.
Click to expand...
Click to collapse
Problem is that the tgz is too big for the device's buffer, so it craps out before it actually writes the images. Its been this way for a while over several different nexus devices. Kind of like nobody at google ever even bothered to test the process.

doitright said:
Problem is that the tgz is too big for the device's buffer, so it craps out before it actually writes the images. Its been this way for a while over several different nexus devices. Kind of like nobody at google ever even bothered to test the process.
Click to expand...
Click to collapse
I agree.

I also used Linux but I executed the commands individually rather than using the script. It worked.

remedya said:
I also used Linux but I executed the commands individually rather than using the script. It worked.
Click to expand...
Click to collapse
I cant flash system.img I get error
sending 'system' (1108544 KB)...
FAILED (remote: data length is too large)
finished. total time: 0.105s

nyasha1935 said:
I cant flash system.img I get error
sending 'system' (1108544 KB)...
FAILED (remote: data length is too large)
finished. total time: 0.105s
Click to expand...
Click to collapse
Update your Android SDK.

These instructions also worked with 5.1.1

im trying to install back to facctory i erased my system and recovery and data and now when i try to flash bootloader i get error cannot open bootloader someone please im stuck in bootloader mode

maxtcee said:
im trying to install back to facctory i erased my system and recovery and data and now when i try to flash bootloader i get error cannot open bootloader someone please im stuck in bootloader mode
Click to expand...
Click to collapse
Are you writing the full name and file path for the bootloader img?

Related

[GUIDE] Flashing a Factory Image with fastboot / return to stock

Notice: If you are going to flash the nakasi android 4.3 JWR66Y factory image, you will need to download the bootloader from JWR66V and replace the one from the factory image. The bootloader in JWR66Y will fail flashing with a signature mismatch error on the device and InvalidState on fastboot.
The objective of this thread is to provide detailed instructions on flashing a factory image using fastboot rather than a toolkit. As good as toolkits can be, I recommend using adb and fastboot directly. This will allow you to see what is happening every step of the way and is a good opportunity to learn about the process. The following instructions assume some basic Windows command prompt skills.
Read all the directions before you begin and perform the steps at your own risk.
Overview
This will restore your Nexus 7 to it’s factory state. All user data will be deleted, so now is a good place to stop and backup anything you don’t want to lose.
This guide is in three parts - basic knowledge and obtaining the required software, driver installation, and flashing the factory image. This and any following verbosity is not to be condescending, but rather not to assume anything.
Basic Knowledge
This guide assumes some basic Windows command prompt skills - changing directories, etc and is written primarily for Windows users. Make sure that you have file extensions enabled in Windows Explorer.
Software Requirements
Android SDK - adb, fastboot, usb drivers
Java SE Development Kit - required by Android SDK
A Nexus 7 factory image
7-Zip - used to extract factory images from a .tgz file
Download and install 7-Zip - http://www.7-zip.org/download.html
Download the Nexus 7 factory image - https://developers.google.com/android/nexus/images#nakasi and save it somewhere you can easily retrieve it.
Make sure to download the correct image for your device variant (Wi-Fi vs GSM/HSPA+; nakasi vs nakasig)
Download and install the Java SE JDK - http://www.oracle.com/technetwork/java/javase/downloads/index.html
Download and install the Android SDK - http://dl.google.com/android/installer_r21-windows.exe
NOTE: Notice the install location. This defaults to C:\Users\<user name>\AppData\Local\Android\android-sdk the platform tools (adb, fastboot) and usb drivers will be downloaded to this location. This will be referred to from here on as your sdk directory
Run the SDK Manager
Under Tools, check the box labeled "Android SDK Platform-tools" - this provides adb and fastboot
Under Extras, check the box labeled "Google USB Driver"
Press the "Install # packages..." button and follow the on-screen instructions.
The platform tools will be installed at <your sdk directory>\platform-tools and the usb drivers will be in <your sdk directory>\extras\google\usb_driver
Driver Installation
This seems to be the most confusing part for many people. Be patient and thoroughly read all the instructions.
Huge thanks to @tetakpatak for taking the time to put together a video showing this process! http://www.youtube.com/watch?v=bhA5CN4335U&feature=player_detailpage..
Enable usb debugging on your device (found under Settings > Developer Options)
NOTE: Since Android 4.2 the Developer Options are hidden by default.
To enable them, go to Settings > About Phone, and tap on build number around seven times. A small dialog will appear letting you know "You are now a developer!"
Install the abd driver - detailed instructions for installing or upgrading and existing driver on your version of Windows can be found at http://developer.android.com/tools/extras/oem-usb.html
Once the driver is installed open a command prompt and change directories to <your sdk directory>\platform-tools (see #2). From the command prompt run "adb devices". This will list any adb-capable devices that are connected to the computer by their serial number assuming your drivers are installed correctly. Recap:
Code:
> cd \Users\<user name>\AppData\Local\Android\android-sdk\platform-tools
> adb devices
# the following output should be returned
List of devices attached
<device serial number> device
Use adb to boot the device to the bootloader:
Code:
> adb reboot-bootloader
The device should now be in fastboot mode and Windows should be attempting to install the fastboot driver. NOTE: if you had drivers previously installed, you may need to upgrade them. This is the same procedure described at http://developer.android.com/tools/extras/oem-usb.html
You can verify that the driver has been installed by running the following command:
Code:
> fastboot devices
# the following output should be returned
<device serial number> fastboot
Do not proceed further if fastboot can not recognise your device. You are in driver hell and this must be resolved before continuing.
Extract the Factory Image
In order to extract the necessary files from the factory image archive, we will use 7-Zip because it can do this reliably. At this point you should have already installed 7-Zip and downloaded the factory image archive.
Use 7-Zip to open the factory image .tgz file. You should see a single .tar file. Open this file with 7-Zip as well.
Inside the .tar file is a directory that will resemble “nakasi-jwr66y”. Open that directory and extract the contents to <your sdk directory>\platform-tools.
The extracted files should be as follows: bootloader-grouper-4.23.img, image-nakasi-jwr66y.zip, flash-all.sh, flash-base.sh
Flashing the Factory Image
Put the device into fastboot mode by running the following adb command:
Code:
> adb reboot-bootloader
In order to do anything useful in fastboot, the bootloader must be unlocked. To do this, run the following fastboot command:
Code:
> fastboot oem unlock
Follow the directions on the device, using the volume and power buttons to select "Yes". NOTE: this will wipe all personal data.
In fastboot with your device's bootloader unlocked, run the commands listed in flash-all.sh in sequence, waiting for each command to finish.
Follow the commands for your device variant - Wi-Fi (nakasi) or GSM/HSPA+ (nakasig). For convenience I have them here:
NOTE: you will see some messages about the archive not containing boot.sig, recovery.sig and system.sig. That is normal, dont worry.
Wi-Fi devices (nakasi)
Code:
> fastboot erase boot
> fastboot erase cache
> fastboot erase recovery
> fastboot erase system
> fastboot erase userdata
> fastboot flash bootloader bootloader-grouper-4.23.img
> fastboot reboot-bootloader
> fastboot -w update image-nakasi-jwr66y.zip
GSM/HSPA+ devices (nakasig)
Code:
> fastboot erase boot
> fastboot erase cache
> fastboot erase recovery
> fastboot erase system
> fastboot erase userdata
> fastboot flash bootloader bootloader-tilapia-4.23.img
> fastboot reboot-bootloader
> fastboot flash radio radio-tilapia-1231_0.18.0_0409.img
> fastboot reboot-bootloader
> fastboot -w update image-nakasig-jwr66y.zip
After the final command completes, the device will reboot.
If you are sending the device in for warranty work, you may want to re-lock the bootloader
Code:
> fastboot oem lock
Finally, reboot the device
Code:
> fastboot reboot
Fantastic work!
Thank you for this tutorial! It allows us to learn how to do things via adb and learn how not to depend on a toolkit. I hope everyone that does not know how to flash things manually read this thread! Thank you for taking the time to help us learn!
comminus said:
Overview
This will restore your Nexus 7 to it’s factory state. All user data will be deleted, so now is a good place to stop and backup anything you don’t want to lose.
This guide is in three parts - basic knowledge and obtaining the required software, driver installation, and flashing the factory image. This and any following verbosity is not to be condescending, but rather not to assume anything.
Click to expand...
Click to collapse
Could I suggest adding a fourth section to you guide that you only alluded to. Backing up and restoring "anything you don’t want to lose." Detailed as your guide is, you've started with the assumption that a user knows how it back and reinstall the data they would likely want to save.
I don't even know how to do this so I'm stymied even before starting your guide.
Pariah3000 said:
Could I suggest adding a fourth section to you guide that you only alluded to. Backing up and restoring "anything you don’t want to lose." Detailed as your guide is, you've started with the assumption that a user knows how it back and reinstall the data they would likely want to save.
I don't even know how to do this so I'm stymied even before starting your guide.
Click to expand...
Click to collapse
You can always hook your phone up to your PC and copy your folders before this process. You can also make a nano back up and copy it to your computer and then drag it to the SD of your replacement phone and restore it after you get set up and rooted. Titanium back up is another good app to save your apps and data but you will still need to copy that folder to your pc before performing this and then re root your phone so you can restore from titanium back up. Best bet if you are happy with your set up is do a nano back up save that to your PC and now you have a back up to get back to where you were before.
Pariah3000 said:
Could I suggest adding a fourth section to you guide that you only alluded to. Backing up and restoring "anything you don’t want to lose." Detailed as your guide is, you've started with the assumption that a user knows how it back and reinstall the data they would likely want to save.
I don't even know how to do this so I'm stymied even before starting your guide.
Click to expand...
Click to collapse
The backup and restore of user data was intentionally left out because it is out-of-scope for this guide. You bring up a valid point about users needing direction for backing up and potentially restoring user data and files. I'd be more than happy to link to some existing guides that cover this topic in detail. I'll take a look around to see what I can find.
Sent from my Nexus 7 using Tapatalk 2
Thank you very much for this! Worked perfect and this gave me the confidence to do it manually and stay away from toolkits. Back to stock and locked bootloader ready to go back to the store.
sikagoon7 said:
I'm surprised this is just coming up. Thanks though!
Click to expand...
Click to collapse
I know I read your thread sorry about your loss. These tutorials help us learn how to do things manually and safe from making mistakes. Thanks again to the OP.
Excellent work comminus.... very well written!
Help help help!!! Lol
im running into problems..... fastboot wont work.... i have unlocked using fastboot no problem and can also use erase commands no problems.
however when it comes to " flash" or "update" commands, all i get is sending data and the size of what it is sending, but nothing happens. it just hangs there and nothing flashes up on my tablet either. the device hasnt hung as can still use vol keys to change options.
can anybody help me out with a solution here because im going insane!!
---------- Post added at 02:46 PM ---------- Previous post was at 02:31 PM ----------
im running into problems..... fastboot wont work.... i have unlocked using fastboot no problem and can also use erase commands no problems.
however when it comes to " flash" or "update" commands, all i get is sending data and the size of what it is sending, but nothing happens. it just hangs there and nothing flashes up on my tablet either. the device hasnt hung as can still use vol keys to change options.
can anybody help me out with a solution here because im going insane!!
Thanks for this guide I am following it for installing stock image. I'm getting until the last stage but when doing the fastboot -w update xxx.zip file I'm getting error messages saying 'image does not contain recovery.sig, image does not contain system.sig, image does not contain boot.sig' and then it fails to install.
Any idea what I'm doing wrong here?
Thanks
Edit: got it to work using a different windows machine - probably a driver issue somehwere it must have been
Glad to hear you got it working. Those sort of issues are almost always related to drivers.
Sent from my GT-I9100 using Tapatalk 2
Thanks for the excellent explanation. Got my N7 working again. (messed up the upgrade to 4.1.2)
Also got the error 'image does not contain recovery.sig, image does not contain system.sig, image does not contain boot.sig' but installation still worked.
Eeprom78 said:
Thanks for the excellent explanation. Got my N7 working again. (messed up the upgrade to 4.1.2)
Also got the error 'image does not contain recovery.sig, image does not contain system.sig, image does not contain boot.sig' but installation still worked.
Click to expand...
Click to collapse
I will update the instructions to mention that this is normal. Glad to hear you were able to get you N7 working again!
Great Sticky..
Thanks for the work on this.. my N7 was acting strange with one of the installed ROMs and
this guide helped me restore the device easily. :good::good::good::good::good::good:
This guide is great, I did a factory flash some weeks ago just to see how the procedure works and it is pretty easy if you know this stuff, but as a galaxy S3 owner I wonder why there's nothing equivalent to odin for the nexus 7? Afaik odin works for the gnexus. Odin makes reflashing stock images ridiculously easy.
Sent from my Nexus 7 using xda app-developers app
mertzi said:
This guide is great, I did a factory flash some weeks ago just to see how the procedure works and it is pretty easy if you know this stuff, but as a galaxy S3 owner I wonder why there's nothing equivalent to odin for the nexus 7? Afaik odin works for the gnexus. Odin makes reflashing stock images ridiculously easy.
Sent from my Nexus 7 using xda app-developers app
Click to expand...
Click to collapse
Thanks for the comments. Once someone has their computer set up to work with fastboot the process is just as simple as using Odin. The factory image archive contains batch and shell scripts which allow you to flash the images in one command - arguable just as easy as using Odin or Heimdall. But then, it's all personal preference anyway
do i have to do the erase commands before the flashing
I suppose its not technically required but I recommend you follow the steps as they've been laid out.
Sent from my GT-I9100 using Tapatalk 2
What if I can't go to fastboot because my nexus now only can be booted in cwr . Do you have any solutions regarding my matters?
Thanks,

Android 4.3 image errors

Hey guys, I'm currently trying to flash back to the new 4.3 factory image that I downloaded from Google, however, it all goes fine, I flashed the bootloader, flashed the radio and it all says it has been updated properly, then when I try and flash the system.img files and boot.img files they just say no such file or directory exists and stops, meaning the phone is unusable at the moment until I flash something.
Anyone know why this is happening?
BTW I'm using a mac.
Issue fixed, see below!
************************************************************************************************
Ok guys, the problem was solved in an odd way!
I got annoyed with the flashing errors, and flashed the old kernel and radio I was using with my Illusion rom which thankfully got me back to that even though I had lost all of my data (backed up though).
For anyone having this problem and wants to unroot to go back to 4.3 or is trying to flash the legit 4.3 rom from Google and then maybe unroot or just use the 4.3 rom direct from Google...
DOWNLOAD THE LEAKED 4.3 ROM AND FLASH USING STANDARD CWM METHOD.
DOWNLOAD THE .84/.83 KERNEL AND FLASH THIS AS WELL.
After this I got the legitimate OTA update which was only 3.4mb and it even fixed root so I am now back to complete stock, locked bootloader and no root!
Hope this helps
Click to expand...
Click to collapse
Easiest way of flashing the system image is to just use the flash-all script included in the TGZ - just extract it out and run it when the phone is connected in fastboot mode. Personally, I do the following:
1. Extract the entire TGZ (including the update.zip)
2. Move all the IMG files into one folder
3. Rename them to easy names, e.g. bootloader, radio, system, userdata, boot, recovery, etc.
4. Flash them all in turn, rebooting the bootloader each time
5. Once all done, erase/format the cache (fastboot erase cache and fastboot format cache)
6. Boot into recovery and clear cache again and then do a factory reset (this makes sure the unit see all the internal memory)
7. Reboot the phone
Should all work now
siravarice said:
Hey guys, I'm currently trying to flash back to the new 4.3 factory image that I downloaded from Google, however, it all goes fine, I flashed the bootloader, flashed the radio and it all says it has been updated properly, then when I try and flash the system.img files and boot.img files they just say no such file or directory exists and stops, meaning the phone is unusable at the moment until I flash something.
Anyone know why this is happening?
BTW I'm using a mac.
Click to expand...
Click to collapse
Maybe you have corrupted files? Retry the download from google and unpack all with 7zip.
I did that yesterday and all works fine.
4.3 (JWR66V)
https://dl.google.com/dl/android/aosp/occam-jwr66v-factory-08d2b697.tgz
7zip
http://www.7-zip.de/
[HOW-TO] How to flash a factory image / return to stock / unlock / root #
http://forum.xda-developers.com/showthread.php?t=2010312
EddyOS said:
Easiest way of flashing the system image is to just use the flash-all script included in the TGZ - just extract it out and run it when the phone is connected in fastboot mode
Click to expand...
Click to collapse
How would I do that on a mac? I tried typing:
./fastboot flash flash-all.bat
but do I need to use the .sh version?
info.brandenburg said:
Maybe you have corrupted files? Retry the download from google and unpack all with 7zip.
I did that yesterday and all works fine.
Click to expand...
Click to collapse
Did that, same thing happened. I tried flashing the entire .zip and then I tried separately and it still didn't work.
Ok so I know it is just the system.img file that doesn't work, as all the other files have just flashed fine! Going to re-download and see if that helps.
siravarice said:
How would I do that on a mac? I tried typing:
./fastboot flash flash-all.bat
but do I need to use the .sh version?
Click to expand...
Click to collapse
You just run the script, you don't flash it. It's a batch file which then does all the fastboot commands. You also use flash-all.sh as you don't have Windows
EddyOS said:
You just run the script, you don't flash it. It's a batch file which then does all the fastboot commands. You also use flash-all.sh as you don't have Windows
Click to expand...
Click to collapse
Still doesn't work.
I used: bash flash-al.sh
And it just said fastboot not found in certain lines for the command and did nothing. I thought it fixed itself when I swapped USB ports but when it got to the system.img it just gave me the same error again. It flashes everything else ok but not this file, it's the third time I have downloaded it and now I have no way to get it back to being useable as when I press start it just gives me a black screen
HELP PLEASE!
I would but I use Windows and it's all fine. Might be worth downloading the factory image again, checking the md5 and trying to flash the system image again
EddyOS said:
I would but I use Windows and it's all fine. Might be worth downloading the factory image again, checking the md5 and trying to flash the system image again
Click to expand...
Click to collapse
Im trying to install some Samsung Android Drivers on my old laptop but the thing is so slow it's basically impossible to work from now
I've redownloaded the files, I don't know how to check the MD5Sum though. Still nothing doing. I get this error:
checking product... OKAY
checking version-bootloader... OKAY
checking version-baseband... OKAY
sending 'boot' (6166 KB)... OKAY
writing 'boot'... OKAY
sending 'recovery' (6664 KB)... OKAY
writing 'recovery'... OKAY
sending 'system' (531281 KB)... ERROR: usb_write failed with status e00002be
FAILED (data transfer failure (No such file or directory))
edue3e4:4.2unrootnexus4 Simon$
It really doesn't want to write the system.img file, or maybe it doesn't want to write to system?
What happens if you extract the system.img file and flash it via fastboot manually?
fastboot flash system system.img
I always use this guide if I forget:
efrant said:
D. Type in the commands into the command prompt
1) Make sure your computer recognizes your device by typing: fastboot devices
2) Unlock your bootloader (if you have not already done so): fastboot oem unlock
3) You will see a prompt on your device. This will wipe your entire device (including the /sdcard folder). Accept. Note: you use the volume keys to change the option and the power button to accept. You cannot use the touch screen.
4) Reboot by typing: fastboot reboot-bootloader
5) Flash the bootloader: fastboot flash bootloader bootloader-mako-makoz10o.img (or whatever the name of the bootloader image that you downloaded).
6) Reboot: fastboot reboot-bootloader
7) Flash the radio: fastboot flash radio radio-mako-m9615a-cefwmazm-2.0.1700.48.img (or whatever the name is of the radio image that you downloaded).
8) Reboot: fastboot reboot-bootloader
9) Flash the system partition: fastboot flash system system.img
10) Flash the data partition: fastboot flash userdata userdata.img Note: this command will wipe your device (including /sdcard), EVEN if your bootloader is already unlocked. See note 2 below.
11) Flash the kernel/ramdisk: fastboot flash boot boot.img
12) Flash the recovery partition: fastboot flash recovery recovery.img
13) Erase the cache partition: either a) fastboot erase cache OR b) fastboot format cache <<== the second option seems to work better for most people. Thanks joostburg.
14) Reboot: fastboot reboot
15) Done! The first boot will likely take quite a bit longer than you are used to, as Android builds the Dalvik cache.
Now you have a fully stock image on your device. The only thing that is different from out-of-the-box condition is that your bootloader is unlocked. See the notes section at the end of this post for information on re-locking the bootloader.
Note that some users indicate that they can't get past the X on boot. If this happens to you, reboot into the bootloader and select recovery. Then, when you see the Android with the red exclamation mark, hold power and press volume up to take you to the menu. Wipe cache. If that still doesn't work, boot back into recovery and do a factory reset.
If you have a 16GB device, and it now shows up as 8GB, reboot into recovery (hold power and press volume up when you are at the screen with the android and the red exclamation mark), and wipe cache. If that still doesn't work, boot back into recovery and do a factory reset. Or do this
Click to expand...
Click to collapse
EddyOS said:
What happens if you extract the system.img file and flash it via fastboot manually?
fastboot flash system system.img
I always use this guide if I forget:
Click to expand...
Click to collapse
That's exactly what I have been doing, I prefer doing it manually as I don't like using Toolkits and finding a good one for mac is hard enough.
It just says that it cannot send it because the file or directory does not exist, yet if I unplug the phone it does go back into my old rom I was using before that, even though I flashed a new radio and recovery.img, boot.img, user data.img, everything except system.img as it doesn't work
Something clearly wrong with the partition but no idea what...
I know right, I've gone back to the ROM I had previously and downloaded the leaked 4.3 rom and flashed it through flashify. If it works I will simply lock the bootloader again and it should be good to go!
i did the same way through nexus tool kit 2.0 n p.s i guess the file was corrupted that y it failed in the mid. ill try it again
Hmmy 4444 said:
i did the same way through nexus tool kit 2.0 n p.s i guess the file was corrupted that y it failed in the mid. ill try it again
Click to expand...
Click to collapse
Let me know if you get anywhere with it!
it worked.. jst copy the image n dont rename it n go to google nexus 4 toolkit folder n there u would see a folder named *put googlr factory image here* paste it there n before starting ur bootloader must be unlocked.. so thats that.. after that that open the nexus 4 toolkit n then click on number 9 whch says download extract + flash google factore stock rom n then after that type 2 whch says flash google factory image... n thats it. it will automatically flash it.... gv me thanks too
Sent from my Nexus 4 using xda app-developers app
Hi there, same issue with me on a mac
Plus can you tell me how you went back to the previous rom, my phone is unusable right now and i do have a nandroid backup so.
Have either of your tried to flash the 4.2.2 factory image? Would be interested to see if it works
Sent from my Nexus 4 using xda premium
EddyOS said:
Have either of your tried to flash the 4.2.2 factory image? Would be interested to see if it works
Sent from my Nexus 4 using xda premium
Click to expand...
Click to collapse
I dont mind, can you direct me towards a post where they show how to, i m not sure of all this and dont want to mess around with wrong files.
UPDATE: I tried and that works just fine. Rebooted to 4.2.1

[GUIDE] How to Unlock the Bootloader, Flash a Factory Image, and Return to Stock

This guide will help you unlock your bootloader, flash a factory image, and return you to a stock device. It is wriiten assuming you have a windows PC (MAC users, see post 2). This can be helpful if you need to RMA your device or if you are getting erratic behavior or messed something up.
Tools and Files You’ll Need
If you don’t have adb and fastboot installed on your PC go here for a quick install of the necessary files, thanks to @Snoop05, http://forum.xda-developers.com/showthread.php?t=2588979
For MAC users go here. http://forum.xda-developers.com/showthread.php?p=32305619
For Linux users, http://forum.xda-developers.com/showthread.php?p=10746225
For the factory image go here, https://developers.google.com/android/nexus/images You’ll download a .tgz file. Use winrar or 7-zip to extract the file to its own directory and remember where that directory is. Inside is another zip file, extract that too. You’ll need those image files if you use the long method to install the factory image. It’s also good to know where they are as they come in handy as you get more familiar with fastboot and what you can do with it.
How To Unlock the Bootloader
If you don’t have developer options enabled on your device go to settings, about device and tap on the build number 7 times.
In settings, developer options enable oem unlock
Now you get to use fastboot! Boot you device into the bootloader, vol up + power with your device shut off. Once booted into the bootloader connect it to your PC with the usb cable and open a command window on your PC. Once connected type the following command in the cmd window:
fastboot devices (Your device serial number should show up and this will ensure fastboot is working properly)
​Then type:
​fastboot oem unlock (This will unlock the bootloader and you’re now good to go)​
NOTE, UNLOCKING THE BOOTLOADER DOES WIPE YOUR DEVICE SO BACKUP OFF YOUR DEVICE FIRST
How To Flash the Factory Image, SHORT METHOD
Open a command window on your PC in the same directory as you extracted the factory image. In that directory shift, right click in an open area and use “Open a command window here”
Boot your device into the bootloader and connect it to your PC. Then simply double click on the flash-all batch file. Note that there are batch files in there that will work for Windows as well as Linux machines
Let the batch file run and when it’s done you’ll be back to stock.
NOTE THAT FLASHING BY THIS METHOD DOES WIPE YOUR DEVICE SO MAKE SURE YOU BACKUP OFF YOUR DEVICE FIRST.
How To Flash the Factory Image, LONG METHOD
In this method each factory image is flashed separately. This should be used if you have problems with the short method and as you get more familiar with fastboot you’ll be able to flash only the images that you need for your specific requirement. For instance, you might want to only flash the stock recovery if you’re trying to take an ota and you’ve installed a custom recovery. The order that you flash the images is not important.
In the folder you extracted the factory image it’s easiest if you re-name the bootloader image file to simply bootloader and radio. Then open a Windows command window in that folder and use the fastboot commands:
fastboot flash bootloader bootloader.img
fastboot reboot-bootloader
fastboot –w (NOTE, this command does wipe your device. It’s possible to flash the factory image without this command but if you’re going from different revision numbers of android it’s highly recommend to wipe the device)
Now open a Windows command window in the same folder that you extracted the zip file in, the one where you find recovery, system, etc. Then run the fastboot commands:
fastboot flash boot boot.img
fastboot flash cache cache.img
fastboot flash recovery recovery.img
fastboot flash system system.img [Note, flashing system takes a long time, so let it do it's thing]
fastboot flash vendor vendor.img
Congratulations, you’ve now flashed a factory image and learned how to use fastboot!
For MAC users, proceed each fastboot command with a ./ e.g. ./fastboot flash boot boot.img
This should be made a 'sticky'...
An excellent well written tutorial... succinct, clear and to the point.
Far better to use fastboot instead of a toolkit... Everything is more transparent, and you actually gain a better understanding of your device as a result.
Rgrds,
Ged.
GedBlake said:
This should be made a 'sticky'...
An excellent well written tutorial... succinct, clear and to the point.
Far better to use fastboot instead of a toolkit... Everything is more transparent, and you actually gain a better understanding of your device as a result.
Rgrds,
Ged.
Click to expand...
Click to collapse
Thanks @GedBlake. I would have responded sooner but I had to get home and check my tablet. Actually both work, vol up + power and vol down + power.
Sent from my Nexus 9 using XDA Free mobile app
But.... Toolkit so easy?
(agreed... Toolkits not the best choice)
Thread stuck. Great guide @jd1639!
If we get enough guides, tutorials, how to's and other great info threads.... I would suggest a "sticky roll up" thread, so too many stickies aren't created.
Food for thought.
Edit : That ^^^^ was a hint to other members to get your guides, tutorials, info threads, FAQ... Etc... Going..... This is a Nexus section after all. :silly:
Darth said:
But.... Toolkit so easy? ?
(agreed... Toolkits not the best choice)
Thread stuck. Great guide @jd1639! ?
If we get enough guides, tutorials, how to's and other great info threads.... I would suggest a "sticky roll up" thread, so too many stickies aren't created.
Food for thought. ?
Click to expand...
Click to collapse
I'll keep an eye it and do a roll up when the need arises
Sent from my Nexus 9 using XDA Free mobile app
cant flash system.img
I Xubuntu 14.04 I can't seem to flash the system.img I get the following error
sending 'system' (1108544 KB)...
FAILED (remote: data length is too large)
finished. total time: 0.032s
nyasha1935 said:
I Xubuntu 14.04 I can't seem to flash the system.img I get the following error
sending 'system' (1108544 KB)...
FAILED (remote: data length is too large)
finished. total time: 0.032s
Click to expand...
Click to collapse
It's possible that you need to update your Android SDK to the latest. There was a recent change (within last 6 months) to fastboot to allow flashing these large .img files.
cam30era said:
It's possible that you need to update your Android SDK to the latest. There was a recent change (within last 6 months) to fastboot to allow flashing these large .img files.
Click to expand...
Click to collapse
Ok thanks gonna try on windows, im a noob on linux
nyasha1935 said:
Ok thanks gonna try on windows, im a noob on linux
Click to expand...
Click to collapse
You'll be sorry.....
cam30era said:
You'll be sorry.....
Click to expand...
Click to collapse
Ok back to linux, how do I update android SDK
nyasha1935 said:
Ok back to linux, how do I update android SDK
Click to expand...
Click to collapse
http://rootzwiki.com/topic/20770-gu...-adb-and-fastboot-in-linux-ubuntu-and-mint12/
Is it possible to flash a factory image using a custom recovery like TWRP?
Sent from my Nexus 9 using Tapatalk
iamroddo said:
Is it possible to flash a factory image using a custom recovery like TWRP?
Click to expand...
Click to collapse
Is it possible to extract the .img from the volantis-lmy47x-factory-3efdc8d4.tgz from https://developers.google.com/android/nexus/images and flash them individually with TWRP (with the exception of recovery.img, which I guess would over-write TWRP)? Can it this be done directly from 5.0.1 or would I need to first upgrade to 5.02?
Hi, I'm Italian so i'm sorry if my english is bad xD what happens if i flash a different kernel? Will i lose my warranty?
If yes, if i flash the factory image, will i have my warranty again?
And, again, sorry for my bad english
Leoncino said:
Hi, I'm Italian so i'm sorry if my english is bad xD what happens if i flash a different kernel? Will i lose my warranty?
If yes, if i flash the factory image, will i have my warranty again?
And, again, sorry for my bad english
Click to expand...
Click to collapse
No need top apologize. You're English if fine.
There's a lot of discussion and lack of agreement about what affects the warranty on the Nexus 9. HTC says that even unlocking the bootloader "may void the warranty".
My advice would be to do what you want to it, but make sure you understand what you are doing. Ask a lot of questions before you do something you're unsure of.
Unlock your bootloader (if you haven't already). Do not relock bootloader if something goes wrong (this does not solve anything). With an unlocked bootloader, you can recover from almost any problem.
And you can flash the Google factory images anytime you want to return to stock.
I'm sorry there's not a clear answer to your question.
cam30era said:
No need top apologize. You're English if fine.
Click to expand...
Click to collapse
Thanks
So it's like Samsung knox, we don't know what happens to our device.
An other little question? Is the same if i root my device? Need to unlock bootloader?
Leoncino said:
Thanks
So it's like Samsung knox, we don't know what happens to our device.
An other little question? Is the same if i root my device? Need to unlock bootloader?
Click to expand...
Click to collapse
Bootloader has to be unlocked to root, install custom recovery (TWRP). And note that when you unlock bootloader, it will wipe the contents of your SDcard. If you have anything important there, back it up on your PC.
cam30era said:
Bootloader has to be unlocked to root, install custom recovery (TWRP). And note that when you unlock bootloader, it will wipe the contents of your SDcard. If you have anything important there, back it up on your PC.
Click to expand...
Click to collapse
And what happens if i lock again my bootloader, will i restore the warranty?
Leoncino said:
And what happens if i lock again my bootloader, will i restore the warranty?
Click to expand...
Click to collapse
That's a good question, without a clear answer (unfortunately).

Using System Image to Update your Nexus 6 (no data loss)

Tired of waiting for the OTA? Can't use it because you're rooted? Don't want to wipe your entire phone? No problem! Here's how you can upgrade with Google's Nexus factory images without wiping your apps or sdcard.
NOTE: You must have your bootloader unlocked. If you've never unlocked your bootloader, I don't think there's any way to do this without wiping your data.
STEP 1: Install fastboot
Fastboot is Google's utility for flashing factory images. You can also use it to flash custom recoveries like TWRP and CWM. The standard way to get is is through Google's Android SDK, but that's a bit heavy-duty, so you can also download just the most important tools (fastboot and adb) separately, packaged by users. Here are some links:
Official Google Android SDK (cross-platform): http://developer.android.com/sdk/index.html#Other[1]
Unofficial for Windows: http://developer.android.com/sdk/index.html#Other[2]
Unofficial Mac/Linux: http://code.google.com/p/adb-fastboot-install/[3]
Windows users might also need to install drivers: http://developer.android.com/sdk/win-usb.html[4] (can any Windows users confirm whether it's necessary?)
STEP 2: Prepare factory image
Download the latest Nexus 6 factory image at https://developers.google.com/android/nexus/images#shamu[5]
Unzip it and open the resulting folder
Unzip the "image-shamu-*.zip" file in there
You should now be looking at something like this: http://i.imgur.com/mzrfwrP.png [6]
STEP 3: Flash! (Ah-ahhhhh! [7] )
Connect your phone to your computer via USB, and enter the bootloader. You can enter the bootloader by holding down the power and volume-down buttons to boot. Once you see the bootloader, you can release the buttons.
Open a terminal/command prompt. The syntax might be slightly different on Windows than on Mac or Linux, but basically the same. Anything you see in <> you need to replace, e.g. with the actual path to your factory image folder. The rest you should be able to copy and paste. (Tip: you can easily enter a folder path into your terminal/command prompt by simply dragging the folder onto your terminal window. This works on Mac, Windows, and the vast majority of Linux GUIs.) Enter these commands:
cd </path/to/shamu-lmy47d>
fastboot flash bootloader bootloader-shamu-moto-apq8084-71.08.img
Reboot the bootloader.
fastboot flash radio radio-shamu-d4.0-9625-02.95.img
cd <image-shamu-lmy47d>
fastboot flash boot boot.img
fastboot flash cache cache.img
fastboot flash system system.img
If you DO NOT use a custom recovery (like TWRP or CWM), then also: fastboot flash recovery recovery.img
Don't worry if you see messages like "target reported max download size of 1073741824 bytes". Just wait and let it finish.
Reboot your phone and enjoy. It's normal for the first boot to take a while. Going from Kitkat to Lollipop took about 20 minutes. Going from 5.0 to 5.0.1 took 5-10, I think. YMMV.
A WORD OF WARNING: If you're moving between ROMs, you generally should do a complete reset, including wiping data. Many users have reported problems going from KitKat to Lollipop without wiping data and recommend a factory reset anyway. If you're okay with wiping everything, you can simply use Google's included flash-all scripts, or flash the userdata.img file yourself. Personally, I'm not going to bother wiping adta for an incremental update like 5.0.1->5.1. As always, be sure to back up your data!
Shamelessly stolen from: http://www.reddit.com/r/Nexus5/comments/2phqy7/howto_upgrade_android_using_nexus_factory_images/
Shouldn't you also fastboot reboot bootloader after radio flash?
This is the scenic route.
I tried to update using wugz, without unlocking the bootloader. failed. Oh well, I'll wait to receive ota
Unless this method doesnt require unlocking?
If you have an OTA zip file, this is different than using a System Img?
I do not think you need to lose data or unlock your bootloader?
Found a link for the OTA zip file.
If I remember right you can copy the zip to you phone with a USB cable.
Go into the bootloader, Volume Down and Power.
Select the zip.
I did not think you needed a terminal and all the commands if you had the OTA zip on your phones SD card.
Am I wrong does something like this not work?
or
I can just wait.....
This worked great.
I was unbranded with VZ sim, unlocked, rooted with TWRP recovery. Didn't want to lose all that nor my apps or data. This method upgrades to 5.1 without any loss.
When I was done with the flashing, I rebooted to TWRP recovery (not system) in order to wipe dalvik and cache (just to be certain). I wiped and then rebooted to system. TWRP noticed I didn't have SuperSU installed so it installed it for me. Meaning, once I got my system rebooted, I still had root too.
All in all, this process worked great for me. Thanks.
I run the first two commands
fastboot flash bootloader bootloader-shamu-moto-apq8084-71.08.img
fastboot reboot-bootloader
they worked, then i moved to the radio
fastboot flash radio radio-shamu-d4.0-9625-02.95.img
but it failed.
Any idea?
---------- Post added 14th March 2015 at 12:17 AM ---------- Previous post was 13th March 2015 at 11:53 PM ----------
Nikos2k said:
I run the first two commands
fastboot flash bootloader bootloader-shamu-moto-apq8084-71.08.img
fastboot reboot-bootloader
they worked, then i moved to the radio
fastboot flash radio radio-shamu-d4.0-9625-02.95.img
but it failed.
Any idea?
Click to expand...
Click to collapse
This is the message after the radio flash command:
fastboot flash radio radio-shamu-d4.0-9625-02.95.img
target reported max download size of 536870912 bytes
sending 'radio' (85422 KB)...
OKAY [ 2.697s]
writing 'radio'...
(bootloader) flashing modem ...
(bootloader) flashing modem ...**☺
FAILED (unknown status code)
finished. total time: 3.721s​
Why the failed message?
I'm decrypted. Will this re encrypt my Nexus or do I have to flash a non enforce img?
Thank you, this really helped.
Since my bootloader was locked i had to unlock it as well.
Had a bit of a scare with the whole erasing screen staying on for too long.
Went back and redid the process, and went downstairs for 5 minutes, came back and phone was booted.
Anyway, thank you again
Will this work on an encrypted phone?
mikeadamz said:
Tired of waiting for the OTA? Can't use it because you're rooted? Don't want to wipe your entire phone? No problem! Here's how you can upgrade with Google's Nexus factory images without wiping your apps or sdcard.
<<snip>>
Click to expand...
Click to collapse
I don't suggest that anyone read and follow someone else's instructions when doing something like this. Not because the instructions are wrong or anything, but because blindly following instructions doesn't involve *understanding* anything.
So rather than reading and following instructions, read and UNDERSTAND the process of installing factory images as delivered with the factory images (flash-all.sh). If you UNDERSTAND the process and what everything does, then (a) you *already know* what needs to be adjusted to do what you want, and (b) if something starts going wrong in the middle of it, you will understand why, and what to do to correct it.
mikeadamz said:
cd </path/to/shamu-lmy47d>
fastboot flash bootloader bootloader-shamu-moto-apq8084-71.08.img
Click to expand...
Click to collapse
First, thanks for the write up, I do greatly appreciate it. Second, thanks for the tip on dragging file locations into the command prompt. Very helpful.
Now my question. When I did this I tried using exactly the steps above and had no luck whatsoever. I'd cd to the location of the img files as noted and it would say fastboot is unrecognized as an internal or external command. I moved the file into the fastboot location and got the same issue. I finally ran the fastboot from the adb folder location and just referenced the full file path for each img file (using the drag and drop method) and everything went swimmingly. My question is just about using fastboot. Should it have worked when I used cd to go to the img file location? Is there something I need to do to make it work as you described?
Thanks!
Nick
Nick D said:
First, thanks for the write up, I do greatly appreciate it. Second, thanks for the tip on dragging file locations into the command prompt. Very helpful.
Now my question. When I did this I tried using exactly the steps above and had no luck whatsoever. I'd cd to the location of the img files as noted and it would say fastboot is unrecognized as an internal or external command. I moved the file into the fastboot location and got the same issue. I finally ran the fastboot from the adb folder location and just referenced the full file path for each img file (using the drag and drop method) and everything went swimmingly. My question is just about using fastboot. Should it have worked when I used cd to go to the img file location? Is there something I need to do to make it work as you described?
Thanks!
Nick
Click to expand...
Click to collapse
Install this:
http://forum.xda-developers.com/showthread.php?t=2588979
Now ADB and fastboot are installed system wide. Put your files anywhere, I use the desktop. Hold shift and right click on wherever your files are and select "open command prompt here" and flash away. Simplified, no more dragging and dropping.
Will try with the new update (5.1.1 (LMY48M)) to ensure it works. Thanks!
[/COLOR]
handyarrow said:
Will this work on an encrypted phone?
Click to expand...
Click to collapse
Have been flashing this zip in twrp after the fastboot stage without an issue for the last few updates - http://forum.xda-developers.com/nexus-6/development/mod-disable-force-encryption-rom-kernel-t3000788
Flashed LMY48M with fastboot method and it works great.
My phone is encrypted.

Root & TWRP!

Note: I am no expert at this. I used this to get TWRP and root, but it there is no guarentee it won't brick your phone. Only do this if you know what your doing. Before you start you must have an unlocked bootloader, which will delete all your data. Here's the instructions (If you need help, feel free to post a comment):
Download Magisk's installer zip on your phone from https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445 (Google Pay only works with Magisk v19.0+)
Download arter97's kernel .img to your PC. This kernel currently is the only reliable way to get TWRP. https://forum.xda-developers.com/razer-phone-2/development/arter97-kernel-razer-phone-2-t3914996
Reboot your phone into bootloader mode (Turn off then back on while holding vol down).
Make sure your phone is recognized by Windows before proceeding. Follow this guide to setup the proper drivers and fastboot.
Flash arter97's kernel by running
Code:
fastboot flash boot arter97-kernel-*.img
If you run into any issues, then you will probably need to specify the slot to flash. Reboot back into your system.
Turn on Android Debugging and run
Code:
adb shell getprop ro.boot.slot_suffix
and make note if the output is _a or _b
Reboot back into bootloader
If _a use
Code:
fastboot flash boot_a arter97-kernel-*.img
if _b use
Code:
fastboot flash boot_b arter97-kernel-*.img
Reboot to recovery (either through bootloader mode or hold vol up while rebooting).
Install the Magisk .zip from TWRP.
Be amazed by the possibilities.
Old instructions (Should always work to get root):
Download the factory image from here: https://developer.razer.com/razer-phone-dev-tools/
Extract and copy the boot.img file to your device
Download and install Magisk Manager. If you have an SD card make sure it's installed on your internal storage, not the SD card.
Tap install, select Patch Boot Image File, and select the boot.img (If using the default file manager click the overflow menu and show internal storage)
Copy the patched_boot.img back over to your PC
Flash the patched_boot.img to your device via fastboot (Turn off then back on while holding vol down) and run
Code:
fastboot flash boot patched_boot.img
.
If you run into any issues, then you will need to specify the slot to flash.
Turn on Android Debugging and run
Code:
adb shell getprop ro.boot.slot_suffix
and make note if the output is _a or _b
Reboot back into bootloader
If _a use
Code:
fastboot flash boot_a patched_boot.img
if _b use
Code:
fastboot flash boot_b patched_boot.img
Reboot, and open up magisk manager to confirm everything is working. After an OTA update you may have to re-apply due to it using a different slot.
Note: the phone wasn't properly recognized by my computer when in bootloader mode so I had to install the Google adb drivers and manually set the driver used to Google Bootloader Interface (or something like that)
I found you needed to specify boot_a or boot_b specifically as the bootloader tended to mess up the suffix(it tried "bootb_b"????). So I had to first run "fastboot getvar all" to check the current slot.
I also found the commands are executed much more reliably if you enter the command first and press enter so fastboot goes into the "waiting for device" state and then boot into the bootloader and afterwards plug in the cable so fastboot executes the command as soon as it connects.
figured itd be as easy as that. this will be my first up to date device in years, att sending it to me in the mail. should get it by the 6th . but glad to see theres root! hopefully lineage to follow <3
Twiggy000b said:
figured itd be as easy as that. this will be my first up to date device in years, att sending it to me in the mail. should get it by the 6th . but glad to see theres root! hopefully lineage to follow <3
Click to expand...
Click to collapse
I know the feeling, my last device was the Nexus 5
my last "decent" device was the essential phone. then i went to the xperia xa2 ultra, then the iphone 6 then.... zte quest. -.-
CurtisMJ said:
I found you needed to specify boot_a or boot_b specifically as the bootloader tended to mess up the suffix(it tried "bootb_b"????). So I had to first run "fastboot getvar all" to check the current slot.
I also found the commands are executed much more reliably if you enter the command first and press enter so fastboot goes into the "waiting for device" state and then boot into the bootloader and afterwards plug in the cable so fastboot executes the command as soon as it connects.
Click to expand...
Click to collapse
Lol, bootb_b:laugh:. For me at least it worked fine without specifying the slot, though I may change the instructions to specify the slot
CalebQ42 said:
With the release of the factory images we can achieve root via Magisk boot image patching. Note: I am no expert at this. I used this to achieve root, but it there is no guarentee it won't brick your phone. Only do this if you know what your doing. Before you start you must have an unlocked bootloader. Here's the instructions (If you need help, feel free to post a comment):
Download the factory image from here: https://developer.razer.com/razer-phone-dev-tools/
Extract and copy the boot.img file to your device
Download and install Magisk Manager. If you have an SD card make sure it's installed on your internal storage, not the SD card.
Tap install, select Patch Boot Image File, and select the boot.img (If using the default file manager click the overflow menu and show internal storage)
Copy the patched_boot.img back over to your PC
Flash the patched_boot.img to your device via fastboot (Turn off then back on while holding vol down and run `fastboot flash boot patched_boot.img`.
Reboot, and open up magisk manager to confirm everything is working.
Note: the phone wasn't properly recognized by my computer so I had to install the Google adb drivers and manually set the driver to Google Bootloader interface (or something like that)
I also tried to install some Android Pie GSIs, but none of them worked.
Click to expand...
Click to collapse
Does this destroy all data? Do I need to unlock bootloader? Does it matter where I place the boot.img on my device?
CalebQ42 said:
Lol, bootb_b:laugh:. For me at least it worked fine without specifying the slot, though I may change the instructions to specify the slot
Click to expand...
Click to collapse
Interesting. The bootloader isn't exactly what I'd call a masterpiece of coding (weird cause I still maintain the ROM is excellent) so it might have just been a momentary glitch.
---------- Post added at 10:54 PM ---------- Previous post was at 10:53 PM ----------
ctakah27 said:
Does this destroy all data? Do I need to unlock bootloader? Does it matter where I place the boot.img on my device?
Click to expand...
Click to collapse
Yes, yes and not really (you get a file chooser so you just need to locate it)
I updated the post a bit with instructions on how to flash to a specific slot.
Tonight I'm going to try compiling TWRP for the first time ever (unless someone beats me to in). Wish me luck!
CalebQ42 said:
I updated the post a bit with instructions on how to flash to a specific slot.
Tonight I'm going to try compiling TWRP for the first time ever (unless someone beats me to in). Wish me luck!
Click to expand...
Click to collapse
Good luck it's a easier process compare to years ago. I would do it but I have no need for root or custom recovery. If you fail on the TWRP I will do it in time for people.
Is this working on the AT&T version of this phone? Or would you need to flash the global firmware in order for this to work? Looking to upgrade to this phone and I want to be sure I can get root. The rest looks to be coming fairly quickly.
CalebQ42 said:
I updated the post a bit with instructions on how to flash to a specific slot.
Tonight I'm going to try compiling TWRP for the first time ever (unless someone beats me to in). Wish me luck!
Click to expand...
Click to collapse
jonchance_84 said:
Is this working on the AT&T version of this phone? Or would you need to flash the global firmware in order for this to work? Looking to upgrade to this phone and I want to be sure I can get root. The rest looks to be coming fairly quickly.
Click to expand...
Click to collapse
They have the image for AT&T
EAIaIQobChMIwYzbk7j_3gIVRZRpCh0RMwdoEAEYASAAEgLPifD_BwE
Warrior1988 said:
They have the image for AT&T
EAIaIQobChMIwYzbk7j_3gIVRZRpCh0RMwdoEAEYASAAEgLPifD_BwE
Click to expand...
Click to collapse
I see the separate firmware. I'm only asking because of past shadyness from AT&T trying to tell manufacturers what to do. Years ago on my Xperia x10, if on AT&T firmware, you needed to flash the global generic firmware to get around their crap.
CalebQ42 said:
With the release of the factory images we can achieve root via Magisk boot image patching. Note: I am no expert at this. I used this to achieve root, but it there is no guarentee it won't brick your phone. Only do this if you know what your doing. Before you start you must have an unlocked bootloader, which will delete all your data. Here's the instructions (If you need help, feel free to post a comment):
Download the factory image from here: https://developer.razer.com/razer-phone-dev-tools/
Extract and copy the boot.img file to your device
Download and install Magisk Manager. If you have an SD card make sure it's installed on your internal storage, not the SD card.
Tap install, select Patch Boot Image File, and select the boot.img (If using the default file manager click the overflow menu and show internal storage)
Copy the patched_boot.img back over to your PC
Flash the patched_boot.img to your device via fastboot (Turn off then back on while holding vol down) and run
Code:
fastboot flash boot patched_boot.img
.
If you run into any issues, then you will need to specify the slot to flash.
Turn on Android Debugging and run
Code:
adb shell getprop ro.boot.slot_suffix
and make note if the output is _a or _b
Reboot back into bootloader
If _a use
Code:
fastboot flash boot_a patched_boot.img
if _b use
Code:
fastboot flash boot_b patched_boot.img
Reboot, and open up magisk manager to confirm everything is working. After an OTA update you may have to re-apply due to it using a different slot.
Note: the phone wasn't properly recognized by my computer so I had to install the Google adb drivers and manually set the driver to Google Bootloader interface (or something like that)
I also tried to install some Android Pie GSIs, but none of them worked.
Click to expand...
Click to collapse
Would this procedure be the same as far as mac/win?
I understand all of that, I am simply asking if someone has tried this with the AT&T variant yet. I want to know before I go order this phone.
I love a rooted phone, but as far as I know, if you unlock the bootloader, Netflix will no longer work in HD mode. To me, this is a deal-breaker. If anyone knows about a work-around, I'd love to know.
Razer phone 2 root
so im kinda new to rooting this type of phone and to the android boot scheme in general. i have a razer phone 2 and have attempted (febaly) to root it using this meathod. after installing the google adb drivers i was unable to see the device from my pc when it was in fastboot and unable to send commands, after installing the drivers again with windows update it ran even though no device was detected with this message
">fastboot flash boot patched_boot.img
Sending 'boot_b' (19268 KB) OKAY [ 0.523s]
Writing 'boot_b' OKAY [ 0.179s]
Finished. Total time: 0.718s"
it then blackscreened, i then tried a factory reset from recovery, and it is now in a bootloop... any advice?
update: no longer in boot loop but now is full blackscreen after a glitchy install screen
andy1011 said:
so im kinda new to rooting this type of phone and to the android boot scheme in general. i have a razer phone 2 and have attempted (febaly) to root it using this meathod. after installing the google adb drivers i was unable to see the device from my pc when it was in fastboot and unable to send commands, after installing the drivers again with windows update it ran even though no device was detected with this message
">fastboot flash boot patched_boot.img
Sending 'boot_b' (19268 KB) OKAY [ 0.523s]
Writing 'boot_b' OKAY [ 0.179s]
Finished. Total time: 0.718s"
it then blackscreened, i then tried a factory reset from recovery, and it is now in a bootloop... any advice?
update: no longer in boot loop but now is full blackscreen after a glitchy install screen
Click to expand...
Click to collapse
Since it's already wiped the easiest way to fix it is to probably flash the full factory image. Did you happen to update to the MR2 update prior to following this guide? Doing this on MR2 will soft brick. Not entirely sure in what way, but I assume it would be similar to what you experienced. If you were still on MR0 you can actually just fastboot flash the original kernel image to fix it. I just finished rooting MR2 so I'll post that next
CurtisMJ said:
Since it's already wiped the easiest way to fix it is to probably flash the full factory image. Did you happen to update to the MR2 update prior to following this guide? Doing this on MR2 will soft brick. Not entirely sure in what way, but I assume it would be similar to what you experienced. If you were still on MR0 you can actually just fastboot flash the original kernel image to fix it. I just finished rooting MR2 so I'll post that next
Click to expand...
Click to collapse
this is what im trying to do. however i have no way of flashing to the device as adb is unable to see the device.
andy1011 said:
this is what im trying to do. however i have no way of flashing to the device as adb is unable to see the device.
Click to expand...
Click to collapse
Adb and fastboot are separate things. You should only need download mode and fastboot. What are you trying to use ADB for? If in doubt, the guide on Razer's website should be quite sufficient
EDIT: You can get to download mode by holding Vol Down and Power Button while the device is off. You can force reboot by holding down power for approx 15s as well

Categories

Resources