Is unlocking the bootloader on Nexus 7 2013 the same method on the old Nexus 7?

sfhub

Well-known member
Jan 15, 2011
2,384
741
0
Visit site
Is the newer 1.51 better with bug fixes?
edited: found the link, but not sure if I should wait for more errors to be fixed or get it now?
Changelog here:
[2013.07.29] SuperSU v1.51 - xda-developers

I'm using 1.51 w/o issues.

I don't quite get the first part " adb push UPDATE-SuperSU-v1.51.zip /sdcard/ " since I don't remember seeing this step when unlocking the bootloader (do you mean click install on TWRP, but that don't sound right as that step it listed at the latter step below), so I presume, boot in bootloader mode, then how do I push UPDATE-SuperSU-v1.51.zip /sdcard/ ? Or was that an typo?
Not a typo. adb push will copy the SuperSU update.zip install file onto the virtual sdcard on your tablet. Otherwise when you try to install SuperSU from TWRP recovery, it won't be able to find the file to install. Alternatively, instead of doing the adb push, you can turn on MTP mode in your tablet and drag and drop onto the Nexus 7 MTP folder. Somehow you need to get the SuperSU update.zip onto the tablet. I just suggested one way of doing it.

you mentioned to restore back to stock android I need to reflash it with a clean stock image since you said my way of backing up the stock image won't let me restore it like that with TWRP restore. So don't that kind of defeat the purpose. Scond thought, well it let me save an stock image that I can transfer to computer in case I need it but to restore it, I need to reflash it. Much more trouble some than to run a Custom Recovery right? Oh well.
Assuming you *flashed* TWRP onto your tablet's recovery partition (ie fastboot flash recovery twrp.img) You can take your TWRP backup (of your original tablet software) and restore it. That will give you stock everything, except for recovery, which TWRP doesn't have an option to restore (even though it has one to back up). To get full stock, you'd then have to use fastboot to flash the stock recovery image you backed up with TWRP in the first place. You can do this with
Code:
adb reboot bootloader
fastboot flash recovery stock-recovery.img

Now if instead, you left stock recovery on your tablet and just temporarily ran TWRP to make your backup and install root (ie fastboot boot twrp.img), then your stock recovery is still on the tablet, untouched. If you get an OTA (and assuming you haven't removed or modified any of the OS files) then the OTA will install correctly. If you want to make another backup or do the restore, then you need to connect to a PC and type
Code:
adb reboot bootloader
fastboot boot twrp.img

It really just depends on what you are doing more often. If you are making full nandroid backups all the time, put recovery on the tablet. If you just wanted TWRP to make that initial nandroid backup and install root and don't really have a need to run it all the time, then I'd suggest you don't flash it onto the tablet, just run it from the PC when you need it. This will allow you to get the OTAs when they come w/o needing to restore stock recovery.

Personally I only use TWRP to make the initial backup of my stock software. After that I probably only make full image backups once every 3-6 months. In the interim, I'm mostly backing up my data on a per app basis using Titanium.

When enabled custom recovery doing it the other way (with TRWP flashed), if I need to restore back to stock do I also too need to reflash it with a clean stock image? If yes too, then I don't feel too bad doing it the other way. =)
If you flash twrp.img onto the recovery partition, I would suggest you flash the stock recovery back onto the tablet before accepting any OTAs. You don't need to flash the whole stock ROM onto the tablet to have the OTA install successfully. You just need to make sure you don't modify or delete any of the original OS files (you can add files w/o issue for the OTA, like adding root files)

It probably works fine. I always do my installs by hand so I know what is going underneath the hoods. If it is a complex install prone to errors, I might run or write some tool, but Nexus is extremely easy to work with, so doing it by hand is perfectly reasonable and much more educational.
 

ne0ne

Well-known member
Jun 26, 2013
536
0
0
Visit site
I also agree you should always reboot the system after unlocking the bootloader. I would not suggest writing twrp to the recovery partition or flashing the supersu zip without first doing a full boot..

Even if you do flash twrp and want to do an ota, you can simply restore your stock non rooted Nandroid and then flash the stock Recovery. That's how I go about it.

AT&T HTC One MoDaCo.Switch Beta 8
Nexus 7 2013 Unlocked Root + TWRP
Chromecast
 

mikemike162012

Well-known member
Jul 9, 2013
137
0
0
Visit site
Not a typo. adb push will copy the SuperSU update.zip install file onto the virtual sdcard on your tablet. Otherwise when you try to install SuperSU from TWRP recovery, it won't be able to find the file to install. Alternatively, instead of doing the adb push, you can turn on MTP mode in your tablet and drag and drop onto the Nexus 7 MTP folder. Somehow you need to get the SuperSU update.zip onto the tablet. I just suggested one way of doing it.

Now I see what you mean by that with " adb push UPDATE-SuperSU-v1.51.zip /sdcard/ ". That seem to be the automatic method way to place the file onto the device, while in the guide it gave me the manual way in Step #2: Download the TWRP image to your PC (place in same folder you have your fastboot and adb files), Download the SuperSU.zip and place on the Nexus 7's internal memory.

And what is MTP mean and how do you enable MTP? Sorry, so many noob questions, but each time I ask for more info. I always learned something new from you.

It probably works fine. I always do my installs by hand so I know what is going underneath the hoods. If it is a complex install prone to errors, I might run or write some tool, but Nexus is extremely easy to work with, so doing it by hand is perfectly reasonable and much more educational.

Thanks for the info. and I agree, its better for me to do it first time manually to learn how to do it for the experience. Also NRT might not be good to me with spotty wifi anyway.
 

mikemike162012

Well-known member
Jul 9, 2013
137
0
0
Visit site
I also agree you should always reboot the system after unlocking the bootloader. I would not suggest writing twrp to the recovery partition or flashing the supersu zip without first doing a full boot..

Even if you do flash twrp and want to do an ota, you can simply restore your stock non rooted Nandroid and then flash the stock Recovery. That's how I go about it.

AT&T HTC One MoDaCo.Switch Beta 8
Nexus 7 2013 Unlocked Root + TWRP
Chromecast

Thanks for the caution warning, yeah I suppose I better let the device fully rebooted before doing the other step especially this my first time, want to avoid any problems.
 

sfhub

Well-known member
Jan 15, 2011
2,384
741
0
Visit site
And what is MTP mean and how do you enable MTP? Sorry, so many noob questions, but each time I ask for more info. I always learned something new from you.
In older versions of Android a segment of your internal flash storage was carved out and worked like a sdcard. When you connected the device to your pc, it would show up as a drive letter just like a USB flash drive. For interoperability with windows, it would normally be formatted fat32, which has 4GB file size limitations and doesn't support permissions. Also it forces the device manufacturer to decide between how much memory to allocate to the sdcard partition and how much to allocate to UserData. Also in USB mass storage mode, if the PC is accessing the sdcard, then Android cannot access it at the same time.

In newer versions of Android they no longer support USB mass storage mode. Instead of an sdcard partition formatted fat32, they use a folder under UserData (/data/media) as the sdcard. They simulate an sdcard using a program called fuse. However since this isn't formatted fat32 it doesn't make much sense to support mass storage mode when you plug into your PC as most PCs wouldn't be able to mount a ext4 subdirectory. So how to solve the problem of the user wanting to transfer files to their device?

They had to find some existing protocol that could be relatively easily supported and wouldn't require major changes on the OSs. Enter MTP and PTP. These were simple existing protocols created to support transfering files from media players and cameras to PCs. They weren't part of the original Windows XP distribution but later versions of windows included them built-in. Windows XP got support as part of user-mode driver framework and windows media player 11.

MTP is a multimedia transfer protocol. Under Android MTP mode, you have access to your entire (virtual) sdcard contents. PTP is a picture transfer protocol. Under Android PTP mode you have access to the camera folders only.

Think of MTP and PTP as more like ftp, but with a folder interface. They have no concept of filesystem types. They just deal with files and folders. Since you aren't "mounting" the drive on the PC, Android OS can continue accessing the folders even while you are using MTP mode to transfer files back and forth.

Most people will want to have MTP mode working as they want to transfer files to the top directory of the virtual sdcard. With PTP mode, you have to transfer files to the camera folder, then use a file manager on the tablet to move the files to the top directory of the virtual sdcard. Also with PTP you can't access the directories other than the camera directories, so to copy files, you'd have to use a file manager to move/copy the files into the camera folders.

In windows, instead of showing up as a driver letter (as in usb mass storage mode) MTP and PTP devices will show up as virtual folder named Nexus 7 along with the type of Portable Media or Imaging Device.

On Android, MTP mode is enabled by default. To switch to PTP mode, go to settings->storage and choose the menu (three horizontal lines). You'll see options for enabling media and camera mode.

On the PC side, MTP mode should be automatically supported as long as USB debugging is disabled (you need to enable USB debugging to support ADB)

If you enable USB debugging, the USB IDs change and there is a bug where MTP mode won't be recognized on the PC.

I created a windows driver inf file to fix this issue. It is available here:
[FIX] MTP and usb debugging on windows - xda-developers
 
Last edited:

mikemike162012

Well-known member
Jul 9, 2013
137
0
0
Visit site
Got it, thanks. I suppose the guide was talking about the MPT to dag n drop. Fast reply!!! =)

edited: thanks for the driver link! (still digesting). Btw, I'm using Windows 7 64bits.
 
Last edited:

sfhub

Well-known member
Jan 15, 2011
2,384
741
0
Visit site
edited: thanks for the driver link! (still digesting). Btw, I'm using Windows 7 64bits.
The driver inf should be good for all versions of windows. It only fixes the problem of MTP mode not being recognized with usb debugging enabled *on the stock ROM*

There is a different issue with some custom ROMs where even if you get the PC to recognize the MTP device, the custom ROM has some issue where it doesn't initialize the MTP support properly.
 

mikemike162012

Well-known member
Jul 9, 2013
137
0
0
Visit site
Okay, good to know. Much appreciated for your efforts in helping and explaining all along. Will post my result once my Nexus arrive this or next week the latest.
 

sfhub

Well-known member
Jan 15, 2011
2,384
741
0
Visit site
So I mentioned above that root, by itself, wouldn't affect your ability to get OTAs.

Due to the way SuperSU implements the "survive OTA" feature there is a caveat.

I actually went through the process of flashing JWR66N, rooting, then applying the JSS15J OTA.

What I found is that SuperSU actually does cause the OTA to fail somewhere near the end when it is setting permissions. All the files are patched successfully however there is a failure when the OTA tries to unpack the new recovery. This is due to SuperSU install marking a file immutable to support its "survive OTA" feature. If you undo this attribute change on the one file, the OTA works fine, all the way to the end.

If you do not undo the change, effectively you'll have all the files for the JSS15J ROM, except your build fingerprint will still say JWR66N and your recovery will be from JWR66N. You'll still be running JSS15J, the system will just tell you you are running JWR66N.

Apologize for the confusion. If there is interest I can provide instructions on how you can run SuperSU for root and still be able to have OTAs install successfully.
 

mikemike162012

Well-known member
Jul 9, 2013
137
0
0
Visit site
So I mentioned above that root, by itself, wouldn't affect your ability to get OTAs.

Due to the way SuperSU implements the "survive OTA" feature there is a caveat.

I actually went through the process of flashing JWR66N, rooting, then applying the JSS15J OTA.

What I found is that SuperSU actually does cause the OTA to fail somewhere near the end when it is setting permissions. All the files are patched successfully however there is a failure when the OTA tries to unpack the new recovery. This is due to SuperSU install marking a file immutable to support its "survive OTA" feature. If you undo this attribute change on the one file, the OTA works fine, all the way to the end.

If you do not undo the change, effectively you'll have all the files for the JSS15J ROM, except your build fingerprint will still say JWR66N and your recovery will be from JWR66N. You'll still be running JSS15J, the system will just tell you you are running JWR66N.

Apologize for the confusion. If there is interest I can provide instructions on how you can run SuperSU for root and still be able to have OTAs install successfully.

Hi, thanks for testing out the whole process for me. I'm not sure if I get you right since I'm confused since aren't JWR66N & JSS15J the same thing; android stock 4.3 OS?

And yes, if you have time, please provide me with the instruction that youd mentioned above about fixing Super and still be able to have OTAs install in the future. (the undo fix won't conflict with rooting & SuperSu on the deivce right? and do I do the fix after rooting it first since you already did yours prior? )

I don't think I will need to restore back to stock 4.3 if SuperSu is working correctly and that I can update OTA on my device. Just needed an stock backup just for cases like the updates are filled with bugs so I can downgrade back and wait for the bug fixes etc. Also my device won't deliver until Tuesday and I will need some time to make sure my deivce is not faulty before I try all the rooting process... to be sure.
 

sfhub

Well-known member
Jan 15, 2011
2,384
741
0
Visit site
Hi, thanks for testing out the whole process for me. I'm not sure if I get you right since I'm confused since aren't JWR66N & JSS15J the same thing; android stock 4.3 OS?
JWR66N is the Android 4.3 that the tablet shipped with.
JSS15J is a newer Android 4.3 that came as an OTA update (that patches JWR66N).

You'll get 2 OTA updates when you start your tablet. Your tablet shipped with JWR66N-devkeys. You'll get an immediate OTA right after you set up wifi to change JWR66N-devkeys to JWR66N-releasekeys. This is a very small OTA, maybe around 500kb. Then you'll need to enter your wifi info again and continue setting up the tablet. Sometime later your tablet will download a 2nd OTA which updates JWR66N-releasekeys->JSS15J. This OTA update is around 51MB so takes a little more time to download.

And yes, if you have time, please provide me with the instruction that youd mentioned above about fixing Super and still be able to have OTAs install in the future. (the undo fix won't conflict with rooting & SuperSu on the deivce right? and do I do the fix after rooting it first since you already did yours prior? )
I am attaching an UPDATE-SuperSU-ota.zip you can run in TWRP right AFTER you install UPDATE-SuperSU-v1.51.zip.

It won't conflict with rooting or SuperSU. Everything will work fine.

You'll of course need to reinstall UPDATE-SuperSU-v1.51.zip (and UPDATE-SuperSU-ota.zip) AFTER any future OTA updates because OTA updates always reset permissions on the su binaries.

I don't think I will need to restore back to stock 4.3 if SuperSu is working correctly and that I can update OTA on my device. Just needed an stock backup just for cases like the updates are filled with bugs so I can downgrade back and wait for the bug fixes etc. Also my device won't deliver until Tuesday and I will need some time to make sure my deivce is not faulty before I try all the rooting process... to be sure.
Yes, that is good planning. Just make sure you do your TWRP backup as the first step, prior to installing SuperSU, otherwise your backup will have root, so you wouldn't be able to use it to back out to the pre-root stage. You could always just uninstall SuperSU, but some people feel more comfortable having a backup prior to installing root so they know for sure everything is stock.
 

Attachments

  • UPDATE-SuperSU-ota.zip
    168.4 KB · Views: 4

mikemike162012

Well-known member
Jul 9, 2013
137
0
0
Visit site
I am attaching an UPDATE-SuperSU-ota.zip you can run in TWRP right AFTER you install UPDATE-SuperSU-v1.51.zip.

It won't conflict with rooting or SuperSU. Everything will work fine.

After rooting install SuperSu`and reboot.
So, to install the fix I put the UPDATE-SuperSU-ota.zip file into my device MPT (same location as I did for the SuperSu.zip file), I then type command:

" adb reboot bootloader "
" fastboot boot twrp.img "
" install UPDATE-SuperSU-ota.zip "

and reboot to finish the process, correct?

*** i just noticed I forgot to ask this regarding zip files, do I need to unzip them before I place them into the device?
 

sfhub

Well-known member
Jan 15, 2011
2,384
741
0
Visit site
After rooting install SuperSu`and reboot.
So, to install the fix I put the UPDATE-SuperSU-ota.zip file into my device MPT (same location as I did for the SuperSu.zip file), I then type command:

" adb reboot bootloader "
" fastboot boot twrp.img "
" install UPDATE-SuperSU-ota.zip "

and reboot to finish the process, correct?
Yes, that is correct. Although I would just do it this way (to save a reboot cycle)
" adb reboot bootloader "
" fastboot boot twrp.img "
" install UPDATE-SuperSU-v1.51.zip "
" install UPDATE-SuperSU-ota.zip "

*** i just noticed I forgot to ask this regarding zip files, do I need to unzip them before I place them into the device?
It depends on the context. Some zip files are meant to be unpacked some are not. Usually if the zip is installing something, you leave it as a zip file. Usually if the zip is just being used as an archive to store/compress some files, then you unpack it. For example, if someone gives you a stock recovery image, usually they will zip it to save space, but they won't provide an installer. In this case, you would unpack the zip file to get the .img file and use that .img file to flash using fastboot.

The easy way to tell is to open the zip file. If you see a META-INF directory, it is meant to be left as a zip file and installed using twrp (or other custom recovery). The OTAs are special signed installer zip files that are meant to run in stock recovery. Depending on platform and what updates they are doing, the OTA updates can sometimes run in custom recovery but sometimes may lead to bad things happening. That is because if the OTAs are updating bootloader, radio, and other low-level stuff, sometimes they have special hooks in the stock recovery to process those functions which aren't available in the custom recoveries. If all the OTA is doing is patching some files then it'll work in both stock and custom recoveries.

So to answer your question, in this case both UPDATE-SuperSU zip files are meant to be left as zip files.

The zip file you got twrp from is meant to be unpacked to give you twrp.img
 

Trending Posts

Forum statistics

Threads
942,379
Messages
6,913,751
Members
3,158,382
Latest member
gkapidis