[Xperia Arc General] spit_fire:
Right, so you’ve got your bootloader unlocked and/or custom ROM flashed and now want to get everything back to stock. The stock TrackID and the Like app don’t work (ERROR 5) however due to the DRM stuff.

So here’s your workaround. All you do is to get the trackID.apk off market and push/ replace it to system so it works. You wouldn’t get DRM back though, but this is as close as you’ll get to the stock thing. There may be alternate ways to do this but this tutorial lists the exact way I did it (trying to avoid root and custom kernels).

The result was that I finally did get TrackID working on stock firmware after relocking the bootloader. Furthermore, it did work after an OTA update as well. I did use an Xperia Pro MK16i but since everything is rather general, it should work on any phone.

What you'll need:

Yaffey

Flashtool

A .zip extractor (would recommend 7-zip)

The attached TrackID.apk

Unlocked bootloader

Fastboot drivers (You may have installed it while unlocking your bootloader. If you haven’t, go here and start at step 8 and end at 15)

Step 1: Flashing stock firmware.

1.	Find the required .ftf firmware file.

2.	Download and install Flashtool/

3.	Use this guide understand how Flashtool works and flash the downloaded firmware.

Now you should have stock firmware running on the phone. It doesn’t have root and neither do we need it as long as we still have the unlocked bootloader.

Step 2: Creating an edited .IMG file (which has the working TrackID.apk)

Note: You don’t need your phone for this step so keep it aside for now.

4.	Using 7-zip (or whatever) extract the contents of the .ftf file that you just flashed onto the phone to a folder- you’ll find several .sin files.

5.	Open Flashtool. Got to Advanced> SIN Editor and browse to the system.sin file you just extracted. Hit ‘Dump data’. You’ll find that it just created a system.yaffs2 file in the same folder which had the .sin file. Close Flashtool.

6.	Now, download and open up Yaffey. Click the open tab and browse to the system.yaffs2 file and open it. Close the summary tab.

7.	Expand the ‘app’ tab, find trackid.apk and delete it.

8.	Highlight the ‘app’ tab again and click import. Import the trackid.apk file which is attached below.

9.	Find the apk you just imported and edit the properties to what’s shown in the pic (-rw-r--r--). Hit OK.

10.	Now click ‘Save As’ option and type in the ‘.img’ extension before you save it anywhere you like. Close Yaffey. You’ve created the .IMG file.

Step 3. Flashing the .IMG file via fastboot.

11.	Switch off your phone and connect it via fastboot mode. Was holding menu while inserting the cable on the MKI6i but might be different based on your phone model. You should get the blue light once it’s connected.

12.	Open command prompt wherever you have fastboot drivers installed. Enter this command - fastboot.exe -i 0x0fce getvar version (just to verify that you’re properly connected, you should get some response back)

13.	Now hit fastboot.exe flash system C:\system.img (OR WHEREVER YOU HAD SAVED THE .IMG FILE, I saved it in C:\)

14.	Let it do its work and you’re done. Hit fastboot.exe reboot , remove the cable and wait till your phone boots.

TrackID should work fine now and all that’s left to do is to relock your bootloader. Follow Bagus’s thread by flashing the file via Flashtool and you’re done. Completely stock, Track ID works and the bootloader is locked.