yashsingh1/xdaforums huggingface dataset:
[Nexus 4 General] efrant:
I'm not in front of a PC now, so I'll try keep it brief/simple. Basically starting with JWR66N, the new security features of Android interfered with the old way that root was implemented (using the su binary). So, without getting into the details, what Chainfire has done is made use of the install-recovery.sh file (which is supposed to be the script for flashing the stock recovery, and is run on every boot) for the new method.

The problem that arises is when you try to apply an OTA update, there is a line in the updater-script file of the update that tries to change the permission of that file, but it can't, so the update fails if you have root.

There are two ways around this:

1) "unroot" before applying the OTA update,

or

2) remove a few lines in the updater-script file of the OTA update so that it doesn't try to change permissions on the install-recovery.sh file. The modified update file that I posted prevents the update from copying the install-recovery.sh and recovery-from-boot.p to your device (two files that most people delete anyway), and prevents the update from trying to change permissions on the files. So, with that modified zip, if you have root, it will still install (and you keep root); if you don't have root, it just installs the update as per normal but disables the automatic re-flash of the stock recovery on every boot.

The disadvantage to modifying the OTA update file is that it breaks the signature, so it won't flash with the stock recovery - you need CWM or TWRP.

Hope this makes sense.
[Nexus 4 General] Nayners:
Please help!

Hello all! I need some help. My N4 is stuck at the google screen. I just flashed system.img, boot.img, and recovery.img in fastboot. Now I can't even get it to recognize the phone. I'm running Windows 8 64 bit, and all of my drivers where working wonderfully before flashing. Please help!
[Nexus 4 General] efrant:
Did you wipe cache and dalvik cache before reboot? If not, boot back into recovery and it.
[Nexus 4 General] El Daddy:
Thanks! That helps a lot. I'm kind of out of the root game right now so I haven't followed what chainfire has been doing lately. I really appreciate your help, as always. I'll update the guide in the morning and link to your post for now.
[Nexus 4 General] Nayners:
I did. I have stock recovery. When I try to get into recovery from the bootloader, I get stuck at the google splash.
[Nexus 4 General] efrant:
You have something that is not stock, like non-stock soft keys maybe? In any case, flashing the stock recovery won't make it work. Just flash the JWR66Y boot and system images in fastboot and you're all set.
[Nexus 4 General] nghj:
does OTA update (activated from the notification) revert the recovery to stock?

TWRP was still there when the new 4.3 update installed. when i tried to flash superuser.zip, i could only find the stock recovery.
[Nexus 4 General] efrant:
Yes. All OTA update files do that.
[Nexus 4 General] RoliSoft:
CWM may have an option to counter that. I'm not really sure if that's what it is for. Since I upgraded to Android 4.3, after tapping "reboot system now" in CWM, it asks whether I want to "disable stock recovery flash" (or something like that.) I just keep saying no, because I'm not exactly sure what it wants to do.
[Nexus 4 General] efrant:
If you are using JWR66N or newer, and have and/or want to keep root, you should say no.
[Nexus 4 General] lowrider262:
screw it, i got sick of trying so i just unlocked & installed cwm and flashed the update. i planned on factory resetting anyway as i wanted a fresh start with 4.2.2. thanks for the help though:good::D
[Nexus 4 General] efrant:
Do you have the drivers installed??
[Nexus 4 General] casonswag:
Re: [INFO] Nexus OTA Help-Desk

Okay thnks its just that adb or fastboot recognize my device when i type adb devices and fastboot devices
[Nexus 4 General] diablos991:
if ADB fastboot ins't recognizing your device, you have an issue with either the drivers or USB Debugging isn't checked.

The link I gave you includes the drivers and the instructions to install said drivers if you need them.

Looks like you have to learn the rooting method the old fassioned way!
[Nexus 4 General] casonswag:
Re: [INFO] Nexus OTA Help-Desk

I have usb debugging on but i used a toolkit before shouldnt it have done the drivers and stuff already? Im just trying to learn the fastboot way
[Nexus 4 General] diablos991:
I initially used toolkit as well for a quicker solution. I was unable to get ADB to run properly from that folder.

That's why I picked up the one in the link provided. ADB worked fine from there on out. It recognized my phone right away from the drivers I already had installed. (Win 8 - 64bit)
[Nexus 4 General] ran495:
helppp something went horribly wrong!!! i have stock recovery, unlocked bootloader. i updated the adb and updated from adb... however, after it still says 4.2.1 and whats worse my adb is broken!!! what do i do?? helpp
[Nexus 4 General] ceroglu:
Re: [INFO] Nexus OTA Help-Desk

So someone correct if I am wrong. We don't need to flash radio? It is already included in the OTA package right?
[Nexus 4 General] diablos991:
Correct.

But if you want LTE functionality you will need to flash back to the .33 radio
[Nexus 4 General] chrone:
great thread! i did the hard way this morning, wish i found this thread before. haha

should be linked with oldblue910's OTA URL thread, imho. :)
[Nexus 4 General] casonswag:
Re: [INFO] Nexus OTA Help-Desk

Okay ill report back

---------- Post added at 12:27 AM ---------- Previous post was at 12:25 AM ----------

I know adb is working cause i type adb-windows and it shows all the commands also when i do fastboot-windows itll show the commends i just need it to recognize my device
[Nexus 4 General] MercuryTyTN:
No. I tried updating them from here and my computer wont update them. Under device manager there isn't any driver for Nexus 4.
[Nexus 4 General] diablos991:
Follow the instructions here to install the driver and get ADB working properly: (there is even a video guide)

http://nexus4root.com/nexus-4-root/how-to-root-nexus-4-windowsmac-osxlinuxubuntu/

---------- Post added at 10:32 PM ---------- Previous post was at 10:29 PM ----------

This sounds like a USB debugging problem or a problem with your usb port/cable.

Try another USB port.
[Nexus 4 General] TheHeeyyy:
Lesson of the day: when you are used to disabling "Hide extensions for known file types", it is usually a good idea to remember to disable it again when upgrading your OS. Otherwise, you can have instances where you name an OTA file update.zip while "Hide extensions from known file types" is still enabled, thus effectively naming it update.zip.zip. Hopefully my brief period of stupidity will allow others to avoid the frustration I had to endure the last three hours :o.
[Nexus 4 General] fischwrap:
sorry for the noobish question, but after reading the entire thread im still a bit confused.

i want to update my wife's phone (her n4 is rooted, unlocked, with faux kernel). i downloaded the OTA.zip from the OP, and it is in the platform-tools folder (with adb and fastboot).

do i need to extract its contents in order to fastboot flash the boot.img, system.img, and recovery.img? or do i just type the proper fastboot commands and it will flash them from inside the OTA.zip? i dont want to bork her 3 week old phone...

she doesnt want to lose her app data, and i want to make sure she doesnt have to restore everything after she updates. also, will this leave her phone fully stock, such that she will receive future OTA updates?

thanks for any tips!
[Nexus 4 General] diablos991:
You get the boot, system and recovery.img files from the stock android jop40d file. (not the ota update for 4.2.2)

extract those files to the same folder your ADB stuff is in and type the commands as stated earlier in this thread.

Her phone will be still be bootloader unlocked, but it will now contain the stock recovery and be un-rooted. She will have all her data and not have to restore anything if you manually push the .img files from jop40d.
[Nexus 4 General] tlslaj0417:
Hi i am coming from stock rom + franco kernel. i follow the guide on section C. But i cannot get the OTA update.

I didnt do this http://xdaforums.com/showpost.php?p=37482646&postcount=10338

is this necessary?
[Nexus 4 General] diablos991:
The necessary step is to fastboot flash the boot.img and system.img from the jop40d factory image.

Then it all goes smoothly. (I had the same franco + stock setup)
[Nexus 4 General] fischwrap:
thanks! but isnt the update jdq39? wouldnt i need the .img files from that? i couldnt seem to find them on developers.google...

or am i wrong, and i need to extract the .img files from jop40d, and THEN flash the update .zip from the OP? sorry, i feel like im banging my head against a wall :eek:
[Nexus 4 General] diablos991:
You need to get the files from jop40d (4.2.1) to make your phone appear stock. Then it will pass the verification needed to move to jop39d (4.2.2).

Basically, it is failing because it detects your phone isn't stock. We are circumventing that failure by rewriting the system, recovery, and boot.img.
[Nexus 4 General] joshhayden10:
I'm having problems flashing the new ota with cwm. I'm running stock rooted 4.3 jwr66v. The only thing I have flashed on here is the aosp browser. I removed the aosp browser but still no success, I'm getting the red triangle. I reinstalled aosp browser and still no luck. The error message I'm getting is saying

Assert failed: apply_patch_check ("system/app/browser provider proxy.apk", 0b66314f1bcf2a181a0c3d2d0c53c6b5714571f5", "e65c55fcbed3ea8922be94ad759173ffc678b43")

E: Error in /sdcard/0/download/cwm-otaupdate-occam-jwr66y-from-jwr66v.zip

(status 7) installation aborted.

Please help...
[Nexus 4 General] sordna:
As mentioned earlier, easiest way to overcome this is to "fastboot flash system system.img" from your bootloader, where "system.img" is from the JWR66V factory package, or your own backup (from before you flashed the browser)
[Nexus 4 General] mike_aldwin:
Sorry for the noob question but when upgrading to JWR66Y, is it okay to do so with custom kernel? Also, how do I revert to stock recovery?

Thanks
[Nexus 4 General] Blockberd:
You won't be able to OTA with the custom kernel. With a full stock system you can flash the OTA from CWM or TWRP.

You have to flash stock kernel to apply the OTA. If you get the status 7 error after that, you may have to unroot (check your SU app for such an option), flash OTA and then flash the SU app from recovery again.
[Nexus 4 General] ritchea:
Thank you. That was a bit easier than full ROM flash. After the stock recovery flash and still no ota install, I knew that stock rom had been altered with kernel flash and not totally undone with unmod zip. FWIW for others facing same, I used efrant's zip (because I forgot what akiv wrote) and it worked--no loss of root.
[Nexus 4 General] Rusty!:
You didn't just install the browser, you replaced some stock files at the same time.
[Nexus 4 General] ritchea:
Thanks. Flashing ziddey's does change the framework-res.apk but thought his undo zip would revert. Akiv sent me to a mod revert that fixed it. Successfully flashed your zip.
[Nexus 4 General] joshhayden10:
I noticed when I looked through my nexus 10's files that it has the browserproviderproxy.apk that it's requesting for on my nexus 4 when I flash the ota. so is it possible let to just get that apk file and then flash to ota?

---------- Post added at 01:51 PM ---------- Previous post was at 01:45 PM ----------

I had a hybrid radio flashed but I flashed back to stock. I also so had the wifi setting hack but I flashed back to stock for those settings. It is saying browserproviderproxy.apk is missing I believe.
[Nexus 4 General] El Daddy:
As mentioned a few times before, and in the OP. Just fastboot flash the system image and be done with it.

The checksum of /system files that are patched much match. If anything is altered it will fail.
[Nexus 4 General] richardyusan:
Anyone please upload browserproviderproxy.apk and its .odex

From jwr66v in /system/app/

I don't want to download 300mb factory images just for 2 files
[Nexus 4 General] Blockberd:
Try the attached file. It is taken from JWR66V factory image. HTH. :)

And just let me know if someone needs another specific file from that image. Will try to help ASAP and upload them.

Edit:

Corrected a typo. I stated earlier that it's from the N image. This is incorrect. It is actually from the V. I updated the text and changed the file name to reflect this properly.

Sorry!
[Nexus 4 General] richardyusan:
thanks it's work :laugh:

btw, [MENTION=2779285]joshhayden10[/MENTION] this will fix your problem
[Nexus 4 General] efrant:
Generally speaking this is true, but for this particular OTA update, you can get away without having a stock kernel, and there is nothing in the update that checks/patches the kernel.

If you are going to do that, then might as well just flash the JWR66Y system image -- no real point to flashing the JWR66V just to apply the JWR66Y update.
[Nexus 4 General] nikhil381:
I have BL and unrooted nexus 4 . I installed 4.3 using adb sideload method . is my phone still eligible official OTA from Google or I should install again by sidleloading
[Nexus 4 General] Blockberd:
All should be fine for the next OTA update.
[Nexus 4 General] shobuddy:
I'm on stock rooted JWR66V with TWRP recovery. In order to get to JWR66Y and keep root, all i have to do is flash the file above using TWRP?
[Nexus 4 General] Blockberd:
Yes.
[Nexus 4 General] shobuddy:
Wow, that was easy. Thanks efrant and blockberd!
[Nexus 4 General] Blockberd:
Nono... all credits go to efrant. He actually created this ZIP/did the required changes. But I am glad that I could assist some people over here.
[Nexus 4 General] efrant:
No credit needed for me. All I basically did was just delete a few lines in one of the files. Took all of 1.5 minutes :)
[Nexus 4 General] joshhayden10:
This resolved my issue, thanks.

---------- Post added at 10:29 PM ---------- Previous post was at 10:22 PM ----------

You're a lifesaver, this allowed me to install the ota.
[Nexus 4 General] ralph78:
I have a problem as well to flash the update using CWM. I'm stock rooted, no custom kernel. The only change I made was to flash. 83 radio. Now I came back to. 84 radio version and when I try to flash update I get this :

It seems that there is some problem with setting the permissions. What can I do now?

Sent from my N4
[Nexus 4 General] Blockberd:
Unroot in SuperSU, reboot into recovery, flash update, flash SuperSU again, done. :)
[Nexus 4 General] ralph78:
It did work, thank you :)
[Nexus 4 General] spaceman860:
[MENTION=962867]El Daddy[/MENTION] http://xdaforums.com/showthread.php?p=44921597

BLACKED OUT LTE N4
[Nexus 4 General] Blockberd:
It is not moving to the correct posting. I think you actually mean this one:

http://xdaforums.com/showpost.php?p=44921597&postcount=305

:)
[Nexus 4 General] spaceman860:
Mines brings to the same spot where the links are but whatever.

BLACKED OUT LTE N4
[Nexus 4 General] SnowBeer:
Can't use fastboot to flash CWM on JWR66Y

I'm fully stock, unlocked bootloader, stock recovery, rooted. I unrooted using supersu with "full unroot" in settings. I then just accepted the JWR66Y OTA in the notification bar, and it installed with no problems and rebooted fine.

I plugged my phone in, rebooted to the bootloader, and tried to flash CWM so I could apply the superSU 1.51 zip that I've used to root before on the last update to 4.3. Both adb and fastboot are now spotty (sometimes they can see the device, sometimes they can't). When I try to flash my customrecovery, I get this error:

TwentyIncher:Nexus 4 Ron$ fastboot -c "lge.kcal=0|0|0|x" boot customrecovery.img
downloading 'boot.img'...
ERROR: usb_write failed with status e00002ed
FAILED (data transfer failure (No such file or directory))
finished. total time: 0.069s

Thus, since I can't flash a custom recovery, I'm stuck without root. I think I'll try updating the SDK platform tools?

UPDATE: I downloaded the lastest version of platform tools from google, plugged my usb cable directly into the computer instead of using an adapter, and rebooted my phone and my computer. After doing all of these things, everything worked flawlessly. Unfortunately, I can't tell you which one of these things actually made a difference!
[Nexus 4 General] sfhub:
There is a 3rd way. Just install UPDATE-SuperSU-ota.zip that is attached to the following post (install using custom recovery like cwm or twrp):

http://xdaforums.com/showthread.php?p=44597339#post44597339

Do this prior to installing the OTA or install it and re-run the failed OTA. It will work the second time around.

Ignore the stuff about JSS15J, I put together the fix for Nexus 7 2013, but it should be generic to any Nexus running SuperSU.

For the future, if you always install UPDATE-SuperSU-ota.zip right AFTER you install UPDATE-SuperSU-v1.51.zip you will be set up for future OTAs without issues and root functionality will not affected for your everyday operations.

Of course installing the OTA will disable your root functionality, so after applying OTAs, go back and re-root.
[Nexus 4 General] sordna:
I actually checked the functionality of App Ops now, and it seems to work (there was some doubt as to whether the switches did something or not). So I turned off the location permission on news & weather and indeed it couldn't tell my location. I also tested the Phone/Dialer, blocking the reading of my contacts and call log ... it was pretty funny to see "call log empty" and "you have no contacts". So I can say that App Ops is available and actually works with JWR66Y for sure :)
[Nexus 4 General] shamin17:
OTA update failed

Hello,

I have a rooted stock Nexus 4 with TWRP custom recovery version 2.5.0 and SU version 1.51. No modifications to apps or deletions of apps.

I chose the second solution to apply 4.3 update JWR66Y by flashing the zip using TWRP but it failed. i could not find any error code and when trying to reboot there was a message that some root permissions were lost and if i wanted TWRP to fix it, i said no (didnt know the implications).

While the phone was restarting there was "android upgrade" message and i thought the update was being applied but when the phone restarted i still had root access and android version is still 4.3 JWR66V.

Note: the system update downloaded the OTA 4.3 update but am ignoring the message to restart and install the update.

What can i do to apply this update and still keep root access?

Thanks in advance for ur help

Thanks

Shamina
[Nexus 4 General] El Daddy:
Unroot with su before applying the update. Then, flash the su.zip in recovery post update to get root back.
[Nexus 4 General] shamin17:
I think i was using the wrong OTA update file, can u confirm that its this attached file in this post that i should use "CWM-OTAupdate-occam-JWR66Y-from-JWR66V.zip":

http://xdaforums.com/showpost.php?p=44886292&postcount=102&nocache=1&z=1240639435127377

when u say unroot with su, can i do this via the application SuperSU itself or do i need to run a command in fastboot mode?

will i lose any data (sms, call log, camera pictures, etc) when doing unroot ? sorry if this is a stupid question, am new to android phone, rooting and OTA updates
[Nexus 4 General] Blockberd:
First you need to check your build in the phone info. Then we can properly answer the first question.

You simply unroot in the supersu app. You should not lose any data. After unroot you apply the patch and root again in recovery.
[Nexus 4 General] shamin17:
Thanks for ur quick response.

Build number on my Nexus 4 is currently: JWR66V

Android version: 4.3

Custom recovery am using is TWRP 2.5.0

i just noticed that on SuperSU app that under full unroot option there's "cleanup for permanent unroot", by permanent does this mean that i wont be able to root my phone again?
[Nexus 4 General] Blockberd:
You just unroot in SuperSU, reboot into recovery, flash the update which says "...JWR66Y-from-JWR66V..." in the filename, directly after that you flash the SUperSU 1.51 ZIP again, reboot system, done.
[Nexus 4 General] shamin17:
it worked perfectly and build number is now updated to JWR66Y :victory:

thanks a lot for ur help
[Nexus 4 General] bebjan:
i rooted my nexus 4 but i would like to take it back it back to the way it was before so that i can receive OTA updates without flashing or doing anything , is that possible ? if so a guide to do so will be helpful
[Nexus 4 General] Blockberd:
Once you see the OTA update notification you simply unroot through SuperSU, apply the patch (it will reboot into recovery and flash). In recovery again you can flash the SuperSU 1.51 ZIP again to get root back.
[Nexus 4 General] bebjan:
will i lose my data and apps if i do this ?
[Nexus 4 General] Blockberd:
You should not.

You only lost data while rooting because you had to unlock the bootloader. Now that the bootloader is unlocked you should be able to savely root and unroot at every point of time.
[Nexus 4 General] bebjan:
ok so i went into supersu it says to update binary and when i press normal nothing happens without updating i cant access the settings you mentioned
[Nexus 4 General] Blockberd:
The you better update SuperSU first. You may want to download the latest SuperSU ZIP (1.51) and flash it from custom recovery. Then you should be able to fully unroot. You will need the latest SuperSU ZIP anyway.
[Nexus 4 General] bebjan:
will i have to remove the previous version, i sorry for so much questions i just want to be sure before doing anything else
[Nexus 4 General] Blockberd:
Nope. Just update it/flash the 1.51 zip. That should do it.
[Nexus 4 General] berliner_doch:
Need Help

Hi, I can not apply the OTA because it gives me an error. Something is wrong with core.odex. What can I do to fix this issue?

TWPR log in attach.
[Nexus 4 General] efrant:
Flash the JWR66Y system image in fastboot.
[Nexus 4 General] Droid2drummer:
FYI. I used your script. Lost root then flashed su root zip and all good! ;)
[Nexus 4 General] avi619:
My nexus 4 is rooted,stock with TWRP 2.6 recovery.

To install the OTA I unrooted it via SuperSu and installed the OTA without any problems.

Phone rebooted and the update was successful. Now, I tried to flash SuperSu again from TWRP but when I go into recovery mode, an android icon with an orange exclamatory mark appears and the phone restarts again.

How to get around this?

Thanks.
[Nexus 4 General] Blockberd:
Flash TWRP through fastboot again.
[Nexus 4 General] danorthstar:
Hi, can anyone help.. I'm currently running a custom ROM with CWM recovery but want to get back to stock. Only problem is my computer doesn't recognise my phone when plugged in so can't flash stock images via fastboot. Anyone know if there are flashable zips for radio, bootloader, stock recovery etc that I can flash through CWM? Thanks in advance!
[Nexus 4 General] Blockberd:
Simply take the jwr66y factory image and flash through cwm. Dont forget to unroot before doing that.

Note: it will reset everything. Your apps and settings will be gone.
[Nexus 4 General] avi619:
Thank you. Installed TWRP again through fastboot.

All my apps and settings are safe :angel:
[Nexus 4 General] jolaviska:
I currently have v4.2.2 JDQ39, root with TWRP 2.4.2 - Mine is scenario 2

TWRP failed flashing the file 4.3-JWR66V-from-4.2.2 JDQ39.

What can I do next?

Am I going to keep the custom recovery and root?
[Nexus 4 General] Blockberd:
Do you have JDQ39 or JDQ39E?

For JDQ39 you take this ZIP:

http://android.clients.google.com/p...1.signed-occam-JWR66V-from-JDQ39.ebc8bad2.zip

For JDQ39E take this:

http://android.clients.google.com/p....signed-occam-JWR66V-from-JDQ39E.7e768b10.zip

Also make sure you unroot in SuperSU app before applying the updates. Take one of the above ZIP (whichever you need), copy it to the phone, unroot in SuperSU (you may want to make sure that you have the SuperSU 1.51 ZIP on the phone, too), reboot into recovery, flash update ZIP from phone, directly after that flash SuperSU again, reboot, done.

What is the exact error message you get while applying the updates?