Fixing my bricked Sony Xperia XA2 Ultra

a

The photo above is not a mirrored image, it is actually two distinct Sony Xperia XA2 Ultra phones.

Whether it is fishing or phones, it all has to start with a story. Unlike fishing, though, this phone story really does start out as a big whopper! I guess I should back track to the beginning….

I was researching a new phone for Mom, and found that the Xperia XA2 Ultra is a really, really great phone. Sure, there are reviewers that were not enthusiastic, and some that were ecstatic, but I really felt that this would be a great phone for my mom. And I think it is. In fact, I liked it so much, that I picked up a slightly used one for myself. All was well.

Then, I decided to ditch the stock rom and start working on some custom stuff, as usual. The first thing I needed to do was test a current custom rom someone else made to make sure things work, and that I understand what’s going on under the hood. That is where things went horribly wrong.

I was following a guide on XDA. Several users had a similar guide, so I figure it must be right. Unfortunately, it not only didn’t work, but following the guide to a “T” bricked my phone. Here’s where I got hung up:

1. Download latest firmware with XperiFirm.
NOTE: When using mono XperiFirm will fail to unpack the firmware, you can do it manually using following commands:

Code:
for f in FILE_*; do unzip $f; done
unzip boot.zip -d boot

2. Go to the directory where the firmware got downloaded to and remove following files:
– kernel_X-FLASH-ALL-18AE_0x00.hash
– kernel_X-FLASH-ALL-18AE.sin
– persist_X-FLASH-ALL-18AE_0x00.hash
– persist_X-FLASH-ALL-18AE.sin
– system_other_X-FLASH-ALL-18AE_0x00.hash
– system_other_X-FLASH-ALL-18AE.sin
– system_other_X-FLASH-ALL-9B8D_0x00.hash
– system_X-FLASH-ALL-18AE_0x00.hash
– system_X-FLASH-ALL-18AE.sin
– system_X-FLASH-ALL-9B8D_0x00.hash
– userdata_X-FLASH-CUST-18AE.sin
– vendor_X-FLASH-ALL-18AE_0x00.hash
– vendor_X-FLASH-ALL-18AE.sin
– vendor_X-FLASH-ALL-9B8D_0x00.hash
3. Turn off your phone, hold vol dn and plug in the USB cable, the screen should be off and green LED lit.
4. Run Newflasher, it’ll flash entire FW to your current slot then unplug the USB cable and power on your phone.
5. Turn off your phone, hold vol up and plug in the USB cable, the screen should be off and blue LED lit.
6. Enter this command: `fastboot getvar current-slot`, it should return something like this:
current-slot: _b
Finished. Total time: 0.001s
7. Now switch to the opposite slot by entering command: `fastboot set_active a` if the current slot is `_b` or `fastboot set_active b` if its `_a`, you should see this:
Setting current slot to ‘a’…
OKAY [ 0.012s]
Finished. Total time: 0.014s
or
Setting current slot to ‘b’…
OKAY [ 0.012s]
Finished. Total time: 0.014s
8. Unplug usb cable and repeat steps: 3, 4
9. Profit?

At step 7, I was supposed to switch to the other slot. So I did, but when I unplugged the USB cable and repeat steps 3 and 4, it bricked the phone on the repeat of step 4. After that, it never booted up. All that happened when plugging it in or pressing any button combo was a triple blink of the green LED, and nothing else.

So, I made a post on the thread asking for help. But there was none to be found. Shortly after my post, others started posting as well. They all had the same issue. So, I take comfort in my misery loving company. Although I wish other’s phones had not also bricked, I was somewhat glad that I didn’t “mess up”, since several others following the instructions had the same results. What went wrong? I really don’t know.

The big question became, how do I fix it? I had about $100 invested in this useless paperweight, so I really wanted to turn a positive result. Thus enter ebay. I started bidding on phones with broken screens. I really just wanted to buy another main board, or motherboard for the phone, but I couldn’t find any suppliers. Eventually, I won a phone with a shattered screen.

The screen may have been shattered, but the phone still turned on and worked, so I simply disassembled the two phones (my brick and the one with the shattered screen) and swapped the main board! Now I had a working phone with the good screen, and I was back in business!

Next, I went about the process of installing Lineage 16 (pie) on the phone. According to the instructions, you have to update your phone to 50.1.A.13.123 to use this version of Lineage, but my phone was already 50.1.A.13.83, so I decided to try it as is, without updating the firmware. Praise God, it worked! So I was able to unlock the bootloader, boot TWRP, and flash LineageOS 16!

WARNING: This worked for me on software 50.1.A.13.83, but I don’t think it works if your software version is 50.2+! Try this at your own risk. I can’t promise that it won’t brick your phone.

Here’s what I did:

  • Went to Sony’s Unlock Bootloader section of their website and followed the specific instructions there to unlock the bootloader. You have to input your IMEI to generate a code that you use to unlock it in fastboot.
  • Downloaded TWRP for “discovery” (the nickname for XA2 Ultra).
  • Turned off my phone, held Volume up and plugged in the USB cable, which turned it on and put it in fastboot mode.
  • Typed fastboot boot ./twrp-3.2.3-0-discovery.img

fastboot boot ./twrp-3.2.3-0-discovery.img
downloading ‘boot.img’…
OKAY [ 1.431s]
booting…
OKAY [ 5.131s]
finished. total time: 6.562s

  • The phone rebooted into TWRP. I suggest making a backup at this point. I did, and copied it to my computer.
  • Download the latest LineageOS 16 (pie) rom for your XA2 Ultra. I used the 20190621 nightly, and it worked great for me.
  • Then, since I was ready to install LineageOS, select wipe, advanced, and wipe everything, then format data! Really important, if you don’t format data, you can’t boot lineageOS, as it will hang trying to unencrypt the data directory.
  • Still in TWRP, go to advanced, and select sideload.
  • On the computer, type:

adb sideload <name_of_lineage_zip.zip>

  • It will show a type of progress bar, and then will tell you when it is done. Don’t be alarmed if it “hangs” for a few minutes at the end, that was normal for me.
  • Reboot to system and enjoy LineageOS!

So, after a test run, I went back into TWRP, from fastboot, and flashed Magisk v19.3, and that worked great as well. I didn’t try Gapps, since I am actually going Gapp-less again. But that’s another post for another time….

Hopefully this was helpful for you. It was a lengthy process for me, and not optimal to say the least. If you do go this route, I will note that the Xperia XA2 ultra has been phenomenal for me. The battery life on Pie is incredible, the camera (that everyone loves or hates) is the best I’ve ever used, and I love it so far!

Linux – keep it simple.

TWRP on the Urbane!

One of the side projects I have been working on is playing around with my new to me smart watch, an LG Urbane (W150). Among the different projects, I built TWRP for it. It had already been built before, but I like to build my own as well. You can download it here if you want:

http://www.mediafire.com/folder/2xfs23b79kfzo/Urbane

One of the little highlights I did to make it more fun was to add a custom slider to the build. Now when you unlock or use the slider, you will see my icon on the slider!

slider_touch

Your welcome to use it if you like. Or you can head over to the TWRP homepage and download the official versions.

Linux – keep it simple.

BLU Life XL (L0050UU) TWRP Complete!

I was fortunate enough to be given a used BLU Life XL (L0050UU) from my sister when she upgraded her phone. The great part about having a new toy is getting to build Android for it from scratch, since no one has made custom roms for it yet. But to God be the glory, today I just completed making TWRP for it, so it will have a custom recovery to make backups and flash the new roms I’m hoping to make.

You can download the TWRP image here: http://www.mediafire.com/folder/vh3urh1yuybmn/Life_XL_(L0050UU)

And, as always you can check out the device tree on my GitLab!

Linux – keep it simple.

Update to Rom/Kernel/TWRP building guide!

Hey everyone!

Just wanted to let you know that I was able to finish and upload another hour worth of videos! That’s right, currently there is more than 9 hours of video tutorial available. As promised, this was added to the series:

* Installing/using VirtualBox
* Fixing a VB Ubuntu problem with screen resolution
* Syncing minimal LineageOS or Omni for building TWRP
* Converting an Omni TWRP device to LineageOS/CM and building it.
* Custom TWRP mods with fonts/icons/splash screens/etc….

twrp

Hope that you are enjoying the series, but mostly, I hope that it is informative and gets you building!
I did try to up the video quality, but I had to tone it back down a bit, as the files became a bit large for uploading and handling. The quality is a little better than the first videos, but not exactly 1080p! 

Thanks again for all of the thanks button slaps and YouTube subscriptions. That lets me know that you guys really appreciate the videos. Be sure to check out my Video Tutorial section in the menu for links to the videos!

Linux – keep it simple.

LG G4 on SlimRoms: delete the pin key in TWRP!

In my last post, I told the epic adventure of figuring out how to get into recovery mode so I could fix my unbooting phone. I had performed a backup of SlimRoms before trying to flash OmniRom, and since I was back into TWRP, I restored my backup. Figuring all was well, I rebooted.

Everything booted up great. However, once into the rom, it asked for my screen lock pin, as usual. But unlike the normal response, it kept saying that I was entering the wrong pin. I tried my pin, my old pin, and no pin. No luck. It wasn’t working.

There are a lot of articles on this, and this will not be much new, however, the names of my lock files were different than the article I read, so I am posting the names of the files here in case I forget when this happens to me again. (Most of this blog is simply my own scratchpad of notes to help me remember something….)

So, power off the phone, and jump back into TWRP (see the previous post if you need help with that). In TWRP, go to Advanced – > File Manager.

Scroll down to the /data folder. Open the /system folder and look at the contents.

On my phone I had to delete these files to disable the lock:

gatekeeper.password.key

gatekeeper.pattern.key

locksettings.db

locksettings.db-shm

locksettings.db-wal

After deleting these five files in the TWRP file manager, I then rebooted the phone. Sure enough, now I had no lock screen settings nor pin in the ROM. Back in action! I, of course, immediately set up a new lock screen and pin for security purposes. Hopefully that helps you too!

Linux – keep it simple.

How to get to TWRP on a LG G4 with the hardware buttons….

This is something that should be easy. Really easy. However, it took me a while to find this on the web, and since it did, I’m posting it here too. On XDA, there is a thread about this, intermingled with numerous other threads that say different or sometimes erroneous information.

Back story:

I flashed my LG G4 T-Mobile (H811) phone with a new custom rom I built – OmniRom. Only it didn’t boot. Don’t know why yet, I’m making an engineering build now so I can use ADB to figure that out. As far as I knew, the only ways to get to TWRP were to choose such from your power down menu, or use ADB to reboot into recovery. I thought all was lost, because ADB was not set to on in my custom build, and there was no way to get to TWRP, or so I thought.

I started trying every button combination I could think of.

Found the IMEI screen:

This did lead me to an interesting discovery, if you press Volume down + Volume up + Power, then, when you see the LG logo, release Power (but hold the volumes) wait a second, then press and hold the Power button with the volume buttons, you go into a special IEMI screen that displays a barcode with your IMEI on it.

But I didn’t need that. Quite frankly, you can just open the case and read the sticker to know your IMEI, so this was useless to me, but interesting enough for me to note it here.

After multiple tries, I found the “Factory Reset” screen by holding Volume down + Power, then, when you see the LG logo, release Power (but hold the volume) wait a second, then press and hold the Power button with the volume button. This will take you to the “Factory Reset” screen.  I thought that was no good. I wanted to get to the recovery mode.

However, feeling frustrated and hopeless, I chose “yes” for the factory reset. Interestingly, it then flashed the screen, and took me to TWRP!

Believe me, I was very happy!

So, if TWRP is installed properly, then you can get there by entering “Factory Reset” mode, and selecting “yes”. Simply confusing, right? I guess when you say “yes” on stock firmware, it boots stock recovery and performs a factory reset, but since there is no stock recovery, it enters TWRP with a reset flag, which TWRP doesn’t use. Makes sense, I guess. Too bad they just didn’t make it so when you push volume down and the power button during startup that it would just take you to recovery mode like every other Android phone on the market.

Linux – keep it simple.

Change your TWRP theme!

Until recently, I was completely oblivious to the fact that you can change the way TWRP looks. Actually, to be quite honest, I thought that it looked great the way it was. However, it was pointed out to me that you can now download new themes and even make your own! I haven’t made any themes myself, but for now, I thought I would share how you can change your theme by downloading new ones.

It may seem daunting, but truth be told, it was actually really simple. Once TWRP is installed, all you have to do is download one that is appropriate for your device. Since I am on TWRP 3+, I downloaded mine from a user named fichl on XDA, you can find it here: http://forum.xda-developers.com/android/themes/theme-twrp-3-0-0-0-dark-stock-colors-t3310235

Be sure to slap his thanks button!

In particular, I downloaded the fichls_twrp3_theme_pack_portrait_v2_marshmallow_flashable.zip

After rebooting my phone into recovery mode, I simply pressed install, navigated to the directory with the zip file, and chose to install it. After installing it, you either need to reboot into recovery, or press:

home -> advanced -> reload theme.

Now I can change the theme by going to: home -> advanced -> change theme!

That was the coolest TWRP modification I have ever done, with instant gratification for minimal effort! So, I thought I’d share. Enjoy!

Linux – keep it simple.

 

How to put TWRP and Custom Roms on the Samsung Galaxy S4

I have been getting quite a few requests on XDA from members who need to know how to put TWRP and custom roms on their Samsung Galaxy S4. So, I thought I would post it here as well. Keep in mind, this does not work for Verizon, Sprint, or AT&T models, but will work for the International and T-Mobile models, as well as the Canadian models.

You can download any of the custom roms from my site at the title bar links.

If you use Windows instructions

[CODE]
If your phone is a JFLTEXX (i9505)
Go to: https://dl.twrp.me/jfltexx/
and download 3.0.2-0 tar

If your phone is a JFLTETMO (M919)
Go to: https://dl.twrp.me/jfltetmo/
and download 3.0.2-0 tar

If your phone is a JFLTEAIO (i337z)
Go to: https://dl.twrp.me/jflteatt/
and download 3.0.2-0 tar

Then, download this:
http://www.mediafire.com/download/7us5q44aab1xl9d/Odin304.zip

-Unzip Odin.
-Turn on your phone (normal turn on) boot up into the stock system.
-plug in your phone, let Windows find the drivers.
-Once Windows found your drivers, unplug the phone, turn your phone off.
-open Odin.exe
-Click on PDA, and choose the TWRP file you downloaded.
-With your phone unplugged and off, Now press and hold the DOWN volume button and the power button.
-When the phone vibrates, you can release the power button, but keep holding the down button.
-You will see a warning screen. Release the down button, and press the volume up button to enter “download” mode.
-Plug your phone into the computer.
-Press start/ok button on Odin.

You should see a blue bar on your phone screen that fills up from left to right. Odin should say “pass” or “success”. Your phone should automatically reboot itself. If this did not happen, seek help. Seriously. 😀

-Plug your phone into the computer again, and copy the Gapps and Rom from post #1 to your external sdcard of your phone.
-Now, turn off the phone again.
-Hold the UP volume button, and the power button.
-When the phone vibrates, you can release the power button, but keep holding the UP volume button.
-You will enter TWRP. Now you can release the UP volume button.
-You should now MAKE A BACKUP TO YOUR EXTERNAL SDCARD. -With this, you can always go back!
-After making a backup, you should wipe your phone. Select wipe, slide the slider to wipe your phone. This will not wipe your external sdcard.
-Install Rom.
-Wipe Cache and Davlik.
-Install Gapps. – Optional
-Reboot to system and enjoy!
[/CODE]

If you use Linux instructions

[CODE]
If your phone is a JFLTEXX (i9505)
Go to: https://dl.twrp.me/jfltexx/
and download 3.0.2-0 tar

If your phone is a JFLTETMO (M919)
Go to: https://dl.twrp.me/jfltetmo/
and download 3.0.2-0 tar

If your phone is a JFLTEAIO (i337z)
Go to: https://dl.twrp.me/jflteatt/
and download 3.0.2-0 tar

Then,
$ sudo apt-get heimdall heimdall-frontend -y

$ sudo heimdall-frontend

-This will open up heimdall.
-Click on the tab called Utilities
-With your phone unplugged and off, press and hold the DOWN volume button and the power button.
-When the phone vibrates, you can release the power button, but keep holding the down button.
-You will see a warning screen. Release the down button, and press the volume up button to enter “download” mode.
-Plug your phone into the computer.
-Under Detect Device, click “detect” – the Output box will say something like, detected.
-Under Download PIT -> destination file -> click save as.
-Choose a name for your pit, like jfltexx.pit
-Click Download.
-Exit heimdall-frontend and power off your phone by holding the power button.
-Open heimdall again with the command: $ sudo heimdall-frontend
-Click the tab called “Flash”
-Under “pit” click browse.
-Choose the pit file you downloaded.
-Under partitions(files), click “add”
-Under Partition Details, click partition name, and click recovery.
-Under File (recovery.img), click browse.
-Choose the 3.0.2-0 img you downloaded.
-Click on the “Utilities” tab.
-With your phone unplugged and off, Now press and hold the DOWN volume button and the power button.
-When the phone vibrates, you can release the power button, but keep holding the down button.
-You will see a warning screen. Release the down button, and press the volume up button to enter “download” mode.
-Plug your phone into the computer.
-Under Detect Device, click “detect” – the Output box will say something like, detected.
-Click on the Flash tab.
-Under Session, click “start”

You should see a blue bar on your phone screen that fills up from left to right. Heimdall should say “pass” or “success”. Your phone should automatically reboot itself. If this did not happen, seek help. Seriously. 😀

-Plug your phone into the computer again, and copy the Gapps and Rom from post #1 to your external sdcard of your phone.
-Now, turn off the phone again.
-Hold the UP volume button, and the power button.
-When the phone vibrates, you can release the power button, but keep holding the UP volume button.
-You will enter TWRP. Now you can release the UP volume button.
-You should now MAKE A BACKUP TO YOUR EXTERNAL SDCARD. -With this, you can always go back!
-After making a backup, you should wipe your phone. Select wipe, slide the slider to wipe your phone. This will not wipe your external sdcard.
-Install Rom.
-Wipe Cache and Davlik.
-Install Gapps. – Optional
-Reboot to system and enjoy!
[/CODE]

I hope that clears things up a bit. Leave a comment if you have any trouble following this process, I would be glad to help out.

Linux – keep it simple.