Skip to content

Instantly share code, notes, and snippets.

@ScatteredRay
Created March 11, 2023 23:42
Show Gist options
  • Save ScatteredRay/94bf3ffff56376095f876c949b14f100 to your computer and use it in GitHub Desktop.
Save ScatteredRay/94bf3ffff56376095f876c949b14f100 to your computer and use it in GitHub Desktop.

I had some issues trying to troubleshoot unlock of my Xperia 5 IV using Windows 10, and finally got it to work, adding some brief notes here for anyone else running into the issue.

running: .\fastboot.exe oem unlock 0xXXXXXXXXXXXXXXXX

I got FAILED (remote: 'Command not supported in default implementation')

A few things here, first I tried this using 'fastbootd' (gotten there by powerbutton + volume down, and browsing to fastboot) This is differen't than the fastboot you get to via holding Volume Up while plugging into the PC, but it's confusing since fastboot devices works even with default drivers. You know you are in the correct fastboot because the screen remains black, and the LED lights up as and stays 'blue'.

Next, in the correct fastboot, it often appears to not work without the correct drivers installed, I downloaded the newest Google USB driver from: https://developer.android.com/studio/run/win-usb, and extracted the file usb_driver_r13-windows.zip, however the driver in there doesn't attach to the correct device. so, inside of android_winusb.inf, you need to add the lines

; SonyEricsson
%SingleAdbInterface%        = USB_Install, USB\VID_0FCE&PID_0DDE
%CompositeAdbInterface%     = USB_Install, USB\VID_0FCE&PID_0DDE&MI_01
%SingleBootLoaderInterface% = USB_Install, USB\VID_0FCE&PID_0DDE

under both the [Google.NTx86] and [Google.NTamd64] sections.

Now, trying to install the driver I got an error dialog saying

Windows encountered a problem installing the driver software for your device.
Windows found driver software for your device but encoutered an error while attempting to install it.
The hash for the file is not present in the specified catalog file. The file is likely corrupt or the victim of tampering.

The problem was window driver signing was causing the errors, so I followed the process

Hold SHIFT while rebooting windows. Select 'Troubleshoot', then 'Advanced Options', 'Startup Options' then 'Restart' In the reboot menu there should be an option accessed via '7' on the keyboard: 'Disable driver signing enforcement'

Lastly, I was getting:

FAILED (remote: 'Command not allowed')

It appears that during troubleshooting OEM Unlocking got disabled again, so I just booted the device, went back under the development menu, and enabled it again, at which point, rebooting in fastboot, and running:

.\fastboot.exe oem unlock 0xXXXXXXXXXXXXXXXX

worked without issue:

OKAY [ 20.469s]
Finished. Total time: 20.471s
@TechieAndroid
Copy link

I tried this on my Xperia XQ-AS62 and still get the "FAILED (remote: 'Unrecognized command flashing unlock') fastboot: error: Command failed" message.
I tried adding the code from the Xperia 5 ii driver to the Google USB driver too and still got the error.
Is there something I might be missing?
I have my phone connected using a 10G USB-C to USB-C data cable and I'm running the commands from an admin terminal with PowerShell 7 in the current directory with the platform tools.

@ScatteredRay
Copy link
Author

IIRC, I think the correct command is .\fastboot.exe oem unlock on this device, I think flashing unlock is for other versions.

@fedcas
Copy link

fedcas commented Nov 7, 2023

Thank you so much! I was stuck on unlocking the bootloader on 'Command not supported in default implementation' and it was driving me crazy! luckily I found your note by googling and now my Xperia 10 IV is finally unlocked :)

P.S.
I'd add to the notes a reminder that the unlocking procedure erases data, just in case.

@buttercookie42
Copy link

I didn't have to modify the driver package (and then disable driver signing), but after installing it, I really had to completely manually select the driver:

  1. Run device manager
  2. Right click on the unknown Android device, Update driver
  3. Search my computer for drivers
  4. Select from a list of drivers available on my computer
  5. Find out where exactly the Google driver is hiding (for some reason it was listed underneath Samsung) and choose the bootloader interface driver
  6. fastboot devices finally returns something

@buttercookie42
Copy link

And somehow the driver association doesn't stick, and after reconnecting the phone with my computer today I had to select the driver again (twice, and somehow on the second time the Google driver was now being listed underneath "Android device", not "Samsung whatever").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment