[TOOL/UTILITY] Script to fix bootlooping Nexus 5X / Nexus 6P for Android O and lower

Search This thread

Fabaki

Member
Oct 7, 2016
40
6
Script to fix the Nexus 5X / Nexus 6P Bootloop problem

Credits
99% credit goes to @squabbi for teaching how to patch files yourself and @XCnathan32 for discovering the fix itself.
1% for me for making the script :).

DISCLAIMER
THIS PROCESS WIPES ALL YOUR DATA (unless your bootloader is already unlocked) AND PROBABLY YOUR WARRANTY TOO! USE WITH CAUTION! I AM NOT RESPONSIBLE IF YOU BRICK YOUR PHONE!
THIS PROCESS WILL MAKE YOUR PHONE SLOWER (6P 2 times slower, 5X 1.5 times slower)! PLEASE USE ONLY AS A LAST RESORT!
PLEASE CONTACT YOUR WARRANTY TO TRY AND GET A REPLACEMENT BEFORE PROCEEDING!

What does the fix do?
The problem with those phones are the cores of the Cortex A57, and they need to be disabled.

What should you do?
Before proceeding, make sure you have OEM Unlocking enabled on your device, or the flashing won't work!
1. Download the zip below
2. Extract the zip
3. Extract the boot.img from the image you've downloaded (the script explains how to do it if you don't know how) to the folder you've downloaded
4. Open "Script.bat"

You should also download a factory image from this link (unless you live in Japan, don't download the Softbank versions, and unless you live in Australia, don't download the Telstra versions):
6P - https://developers.google.com/android/images#angler
5X - https://developers.google.com/android/images#bullhead

The script itself was not tested, but the method did work on my 5X so it should work.

If you have any requests, you can comment them here, and maybe I'll add them. One day.

I do plan on adding TWRP, Elemental X and Magisk patching one day, and if there will be many requests that day will come earlier.

Links to original posts and videos
 
Last edited:

Fabaki

Member
Oct 7, 2016
40
6
I get error of adbwinapi...What can I do? (N5X)

Hey! I've changed the post and the script a bit, so please follow the new steps and download the new script, but can you please explain more of what and when happened?

EDIT: I think I know what happened, but please try the steps above, and if they don't work tell me and I'll try and fix it
 
Last edited:

Mehr_DaD

Member
Feb 20, 2013
13
2
Hey! I've changed the post and the script a bit, so please follow the new steps and download the new script, but can you please explain more of what and when happened?

EDIT: I think I know what happened, but please try the steps above, and if they don't work tell me and I'll try and fix it

Thanks, I did the new script and it's kinda getting too long on that boot (circle things) screen. I hope it gets to "android" thing in the end :eek:

So I flashed the March rom, It stuck on those circle things. Turned it off to cool down a bit and will power on in an hour. Let's see what happens next.
 
Last edited:

Fabaki

Member
Oct 7, 2016
40
6
Thanks, I did the new script and it's kinda getting too long on that boot (circle things) screen. I hope it gets to "android" thing in the end :eek:

So I flashed the March rom, It stuck on those circle things. Turned it off to cool down a bit and will power on in an hour. Let's see what happens next.

For my 5x, it booted, but then I've tried to update, but it started bootlooping again, so I've flashed it again and again with no luck. Then I've turned the phone off for some time to cool down, and after that when I've powered it on it just magically worked, and is working since.
 

Mehr_DaD

Member
Feb 20, 2013
13
2
For my 5x, it booted, but then I've tried to update, but it started bootlooping again, so I've flashed it again and again with no luck. Then I've turned the phone off for some time to cool down, and after that when I've powered it on it just magically worked, and is working since.

That's a good news! Mine just loaded to Homescreen and I don't want to mess with it this time, Turned on Wifi and it didn't restarted, inserted sim and didn't restarted. I hope it never freezes again. Thanks again. By the way did you flashed any recovery, kernel, BLOD "workaround" patch or just your fix script?

Update: Again, As soon as I login my Google account and went to Play Store to turn auto update thing off, the phone froze!
 
Last edited:

Fabaki

Member
Oct 7, 2016
40
6
That's a good news! Mine just loaded to Homescreen and I don't want to mess with it this time, Turned on Wifi and it didn't restarted, inserted sim and didn't restarted. I hope it never freezes again. Thanks again. By the way did you flashed any recovery, kernel, BLOD "workaround" patch or just your fix script?

I'm glad to hear! If you could please "Thank" the post, it will be much appreciated. For your question, I haven't used my script on my phone, I've just followed the steps in @squabbi 's video, and then I've decided to create an automated script (which is the script in this thread) to patch it automatically. Which basically means, yes, I have flashed a BLOD "workaround" patch.
 

Fabaki

Member
Oct 7, 2016
40
6
That's a good news! Mine just loaded to Homescreen and I don't want to mess with it this time, Turned on Wifi and it didn't restarted, inserted sim and didn't restarted. I hope it never freezes again. Thanks again. By the way did you flashed any recovery, kernel, BLOD "workaround" patch or just your fix script?

Update: Again, As soon as I login my Google account and went to Play Store to turn auto update thing off, the phone froze!

Still frozen?
 

Fabaki

Member
Oct 7, 2016
40
6
Did system wipe from recovery and after some time (Cooling down process!) it boots again and this time I didn't entered my google account. However it freezes time to time even though I've only installed Telegram & Instagram. Is it ok?

When you say freezes do you mean that it lags?
I guess that's ok, as you've disabled the cores, it should get slower. And please (I don't know if you've done that, but I'll still say) NEVER disable oem unlocking on this phone, because maybe it will happen again.

And by the way, I'm a newbie. I've just made a script that automates the patching process but I don't really understand that much about it. I would recommend you (and that's what I've done) to download the newest image, open the flash-all.bat file to flash it onto your phone (this will wipe everything, and install the newest version), power your phone on (it should start bootlooping again) once, and then do what you would do (boot to bootloader, run the script). Maybe the problem is that you've downloaded a wrong version of the boot.img (that means that you haven't downloaded your version, but the newest one. What I just said insures that you flash the right one). To check the right version, go to about > build number, and where you download your image, search for the exact build number. If the problems continue, maybe it's the script. I'll patch the files myself and send them to you. And if all of the above doesn't work, I will redirect you to @XCnathan32 or @squabbi, they will probably help you more.
 
Last edited:

Mehr_DaD

Member
Feb 20, 2013
13
2
When you say freezes do you mean that it lags?
I guess that's ok, as you've disabled the cores, it should get slower. And please (I don't know if you've done that, but I'll still say) NEVER disable oem unlocking on this phone, because maybe it will happen again.

And by the way, I'm a newbie. I've just made a script that automates the patching process but I don't really understand that much about it. I would recommend you (and that's what I've done) to download the newest image, open the flash-all.bat file to flash it onto your phone (this will wipe everything, and install the newest version), power your phone on (it should start bootlooping again) once, and then do what you would do (boot to bootloader, run the script). Maybe the problem is that you've downloaded a wrong version of the boot.img (that means that you haven't downloaded your version, but the newest one. What I just said insures that you flash the right one). To check the right version, go to about > build number, and where you download your image, search for the exact build number. If the problems continue, maybe it's the script. I'll patch the files myself and send them to you. And if all of the above doesn't work, I will redirect you to @XCnathan32 or @squabbi, they will probably help you more.

No it just freezes for 3 to 5 seconds and then the phone restarts. But the boot image is also from march update...
 

theBeachBoy

Senior Member
Dec 3, 2012
79
9
I get error of adbwinapi...What can I do? (N5X)

Same here, I get an error

After selecting that I am unlocked...

The pop up is fastboot.exe - syetem error
The code execution cannot proceed because AdbWinApi.dll was not found. Reinstalling the program may fix this problem.

It does pop up a second time after you click ok...

and then your script says it's done.. but it's not.

=====

I added the dll whicih can be found in the adb tools, I don't get the pop up but then your script says "waiting for any device" so there is something wrong somewhere as my phone is plugged in, and ready.
 

Fabaki

Member
Oct 7, 2016
40
6
Same here, I get an error

After selecting that I am unlocked...

The pop up is fastboot.exe - syetem error
The code execution cannot proceed because AdbWinApi.dll was not found. Reinstalling the program may fix this problem.

It does pop up a second time after you click ok...

and then your script says it's done.. but it's not.

=====

I added the dll whicih can be found in the adb tools, I don't get the pop up but then your script says "waiting for any device" so there is something wrong somewhere as my phone is plugged in, and ready.

I fixed the AdbWinApi.dll error, download the script again and tell me what happens. Maybe the original fastboot.exe in my zip was a different version of the AdbWinApi.dll that you added and that's why it didn't work.
 

theBeachBoy

Senior Member
Dec 3, 2012
79
9
I fixed the AdbWinApi.dll error, download the script again and tell me what happens. Maybe the original fastboot.exe in my zip was a different version of the AdbWinApi.dll that you added and that's why it didn't work.

the script worked.

Now should I flash TWRP 4 core recovery (edit seems so) and use the AK injector or not needed?
What is Elemental X?

p.s. Thanks!
 

theBeachBoy

Senior Member
Dec 3, 2012
79
9
Last question hopefully.

I have tried sooo many things to fix this phone, unblod thing, flashing various files and the boot-safe.img, twrp 4 core, AK injector, factory image, in various order and multiple times. None of them worked, well unblod worked but no WiFi and when I fixed WiFi, BLOD restarted...

Is there a way the phone needs to be for the script to work? Factory image I guess?

Your script worked, but now at the Google logo stuck there. Not sure I should force reboot or wait. I't not in bootloop but doesn't move past the Google logo.
 

Fabaki

Member
Oct 7, 2016
40
6
Last question hopefully.

I have tried sooo many things to fix this phone, unblod thing, flashing various files and the boot-safe.img, twrp 4 core, AK injector, factory image, in various order and multiple times. None of them worked, well unblod worked but no WiFi and when I fixed WiFi, BLOD restarted...

Is there a way the phone needs to be for the script to work? Factory image I guess?

Your script worked, but now at the Google logo stuck there. Not sure I should force reboot or wait. I't not in bootloop but doesn't move past the Google logo.

I did a quick search and some website said try resetting the phone. If that doesn't work, try to flash a factory image to make it bootloop again, and try the script. If all of that doesn't work I suggest asking @XCnathan32 or @squabbi because they probably understand it better than me.