yashsingh1/xdaforums huggingface dataset:
[Xperia SP Original Android Development] Barkuti:
TWRP adb install

Hello!

A friend of mine has requested me to upgrade his Sony Xperia SP, he's using a Lumia and wants to migrate to Android quick, cheap and compact sized. :o

Our aim is a rooted Oreo system. :)

So here I am reading related tutorials, but this TWRP thing leaves me certain :confused: questions. I understand that I need to flash TWRP via adb from a computer with the smartphone in fastboot mode.

As far as I know the standard procedure adb commands are:

adb reboot bootloader

fastboot flash recovery recovery.img

However, in the first page of this thread this is what I've found:

HOW TO INSTALL MANUALLY TO FOTA :

* Bootimage : Download the TWRP bootimage you want to flash

* File storage : Adapt the path and push the file to the device this way :

Code:

adb root

adb wait-for-device

adb push FullPathToTheRecovery.img /tmp/twrp.img

* Flash : Extract the TWRP image to the FOTA partition

Code:

adb shell dd if=/tmp/twrp.img of=/dev/block/platform/msm_sdcc.1/by-name/FOTAKernel

* Reboot to recovery : adb reboot recovery

:eek:

So up there it first copies the “recovery.img” file (FullPathToTheRecovery.img) to /tmp/twrp.img in the device.

Then “something is done” to install the thing with:

adb shell dd if=/tmp/twrp.img of=/dev/block/platform/msm_sdcc.1/by-name/FOTAKernel

(Does something needs to be changed in the above command line to make it fit for a particular device?)

Excuse me if I do not know what is going on up :confused: there. Is this serious? This is very different from the standard procedure I'm familiar with, which I also have seen in other tutorials for the Xperia :eek: SP. May someone sufficiently explain this to me?

Thanks a lot and best regards.
[Xperia SP Original Android Development] Barkuti:
Just tinkered a bit with the Xperia SP. Tried Power + VolUp and Power + VolDown, to no avail. Looks like the device does not have a standard :confused: bootloader, hence the described procedure here makes a lot more sense to me now, with the terminal in fastboot mode (phone off, hold VolUP button and plug in USB cable) as described here.

Mmmkay, will report later. Wish me luck. Thanks. :o
[Xperia SP Original Android Development] Barkuti:
So I went to the HUASHAN development downloads page and downloaded 3.2.3 twrp img and zip files. Pushed the twrp-3.2.3-20180810-fota-huashan.zip file to internal storage (in /sdcard/twrp.zip) and flashed the img to boot with:

fastboot flash boot twrp-3.2.3-20180810-boot-huashan.img

Once in recovery I installed the twrp.zip (twrp-3.2.3-20180810-fota-huashan.zip) file.

Suffice to say the only thing I can do with the terminal now is to enter fastboot with VolUP + plugging in USB cable to computer, or booting into TWRP. There is no way to boot into the stock ROM.

Is this normal? :silly:

Thanks.

:confused:
[Xperia SP Original Android Development] AdrianDC:
As you found out, Sony 8960 devices, in this case Xperia SP Huashan, do not have a standard recovery bootloader.

We install the recovery in the FOTA partition and use a specific init sequence to boot the recovery out of FOTA.

Upon first installation, TWRP (or Lineage Recovery for that matter) has to be installed in the Boot partition through fastboot

in order to have a first step into flashing the FOTA, as you did, and to format / install the new ROM.

Having overwritten the boot partition, you can't boot the Stock ROM.

You'd either require the original ROM's bootimage, or start using a new ROM.

We detailed everything extensively in the LineageOS Wiki for each Sony devices : https://wiki.lineageos.org/devices/huashan/install
[Xperia SP Original Android Development] jinkaal:
I am on WIndows 10, Cant get in to fastboot mode.

What driver/requisite are need to get into fastboot mode for my xperia sp.

PS-currently have los 15.1 installed. its been a year since i installed and didn't use the device much. but now its seems I dont have a recovery installed. Although I remember having twrp recovery installed.

I tried Hardware button and also "adb reboot bootloader". couldn't get into recovery
[Xperia SP Original Android Development] AdrianDC:
TWRP 3.4.0 FOTA flashables built and released.
[Xperia SP Original Android Development] ze7zez:
WOW!

.

I was speechless with amazement.

Does TWRP 3.4 mean there are plans for Android 10 or Android 11 for Xperia SP?

.

.

.
[Xperia SP Original Android Development] AdrianDC:
LineageOS 17.0 used to run on Huashan winter 2019, but over the whole last year,

I only worked on Huashan / Blue devices once every few months due to work related things.

LineageOS 17.1 runs fine since a few months but haven't had time to fight once again the Camera stack.

Started again yesterday, will see how it goes and what I decide to do.

Already merged most of the "finished" parts for both Huashan and Blue, continuing the unfinished ones.
[Xperia SP Original Android Development] AdrianDC:
TWRP 3.5.0 FOTA flashables built and released.

Happy New Year 2021 !
[Xperia SP Original Android Development] davidwongsw:
Does this version support os 11 for one plus 7 pro?
[Xperia SP Original Android Development] Ice530:
Thank you!
[Xperia SP Original Android Development] AdrianDC:
Please do check the reboot issue happens with or without USB connected,

and if connected, unplug and see if ( / that xD) it reboots.

I'm looking into the issue and may have an idea, but I need to fix it on CM level and not huashan only.
[Xperia SP Original Android Development] OsGhaly:
Happened without USB connected

Update:

Happened also with USB connected and not rebooting if I disconnect the USB but once I reconnect the USB again it reboots
[Xperia SP Original Android Development] aumAP:
I found two little bugs :

1. When I press 'Power off' button (to prevent reboot bug) recovery delay about 10 second then phone power off.

2. Some overheat while using recovery about 45-50°
[Xperia SP Original Android Development] juliomb179:
1. Same here

2. Not happen to me
[Xperia SP Original Android Development] ralfbergs:
TA can no longer be backed up?

Hi [MENTION=2233641]Adrian DC[/MENTION],

thanks for your strong support of the Huashan community.

I just installed TWRP 3.0.0-0 and noticed that the partitions you can back up in 3.0.0-0 differ from what could be backed up in 2.8.7.0:

2.8.7.0: kernel image, trim area, system, cache, data

3.0.0-0: boot, recovery, system, data

I guess "kernel image" is "boot," but what about "trim area" (is it really "trim area" or rather "trusted area?") and "cache?"

The lack of a way to back up "cache" probably is not a big deal. When it comes to the ART cache backing that up would only save you time on the first boot after restoring a backup. Also you might lose a FOTA update that was already downloaded to the device (not sure whether this applies to Huashan).

However the lack of support to back up "TA" might be more serious. Does this partition not contain vital data, such as DRM keys? Would it not be strongly desired to be able to back this up? Could you in that case add support for it?

Kind regards,

Ralf
[Xperia SP Original Android Development] dic1911:
if you have twrp installed, you probably already had unlocked your bootloader, and yes, ta partition do contain those things, but since you unlocked the bootloader, if you hadn't backup your ta partition before you unlock, your drm key had lost, and there's nothing you could do with it, so it might be ok that this version of twrp can't backup/restore the ta partition
[Xperia SP Original Android Development] ralfbergs:
You have a point here. :)

But what about the /cache partition? Is there a reason not to implement backup support for that partition either? As I already acknowledged the "loss" of your cache partition is not catastrophical, but still it would be a minor benefit for a quick boot after restore plus you do not lose the OTA update file...
[Xperia SP Original Android Development] Arturk8791:
Works good on cm12.1 :D Thanks!
[Xperia SP Original Android Development] Ankit Gajera:
OTG doesn't work in recovery for me...!!!
[Xperia SP Original Android Development] sanzNya:
Thanks for another shot adrian. Its sweet... likes new look...

god bless you and ur family...
[Xperia SP Original Android Development] efex92:
was looking at Adrian's directory... found a fastboot and gestures zip... what are those can anyone explain me?

PS: trying TWRP 3.0 on CM12.1 '0212' hope it goes well.. not clearing FOTA though... direct flashing it via Present TWRP
[Xperia SP Original Android Development] yusufozm:
On cm13.020160215 dont installing twrp and dont cleaning fota

I am still see cm recovery after installing twrp
[Xperia SP Original Android Development] ghst7:
Lol

It doesn't matter if you don't clean the FOTA first, as you would've known if read the thread, but most important, Of course as you've just said "don't installing twrp" will continue to leave you with cm recovery only.

But if you meant that even if flashing twrp, you still got stuck on cm recovery remember that while on boot press volume down for cm recovery OR VOLUME UP for twrp recovery.

Best of luck
[Xperia SP Original Android Development] ParanoidNemo:
I think the problem here is another..the last build doesn't have the possibility of booting the FOTA partition (due to an erroneous compiling) so doesn't matter what you have in it..still boot only CM recovery
[Xperia SP Original Android Development] ghst7:
Oh ok, reading a second time with your comment in mind makes more sense, still a cm issue not twrp so hence the misunderstanding, either way the solution would be downgrade or wait a new cm13 build to fix that, not much we can do about that here.

Best of luck
[Xperia SP Original Android Development] flash-:
http://xdaforums.com/xperia-sp/themes-apps/mod-illumination-liblights-t3153918 :)
[Xperia SP Original Android Development] efex92:
thank you sir. and Adrian was kind enough to xplain other stuff to me. so i got what quickboot and gestures was.

can you explain me what this is ' cm-12.1-addons-fmtransmitter-huashan.zip ' and what it will do?
[Xperia SP Original Android Development] flash-:
u will be able to transmit a media from ur phone to specific radio wave ...it's really short range and i don't think u can use it but if u want u can try :)
[Xperia SP Original Android Development] Alvichone:
I used it a lot in my old nokia n86 to listen the music i had in my device with my car radio. And when a call came, the music stopped and then i perfectly heard the conversation from the speakers, like a basic handsfree.

Maybe this works similar. Try it! [emoji6]
[Xperia SP Original Android Development] efex92:
ohh so that is it... that means that i can listen to songs when i am in my grandpa's old car which has no aux connectors.... :P
[Xperia SP Original Android Development] AdrianDC:
TWRP 3.0.0 Release 2 - 18/02/2016 :

Cache and FOTA Recovery partitions allowed for Backup

OTG USB Storages support (Includes NTFS, FAT32 and EXT4)

Fastboot boot support improved, init_sony dual recovery implemented

Compatible with CM-13.0 and CM-12.1
[Xperia SP Original Android Development] tamthoima:
After flash 3.0.0 release 2 using twrp, I can not go to twrp anymore (system go to cyanogen recovery whenerver using volume up or volume down buttons)
[Xperia SP Original Android Development] dic1911:
after flash r2 in previous twrp3 release and use the "reboot recovery" button, i got my xsp booted into cm recovery, i tried to flash twrp3 r2 again in cm recovery, seems the installation was finished without error, but when i power off my xsp and press vol+ while booting, it still boot into cm recovery, i have no idea what's going on, please help and thanks

ps. I'm currently on AdrianDC's unofficial cm 12.1 0215 build.
[Xperia SP Original Android Development] Drummer605:
Confirm r2 doesn't boot neither from reboot option, nor pressing vol+
[Xperia SP Original Android Development] flash-:
ok so v2 of twrp 3.0 is not booting and not working .....get back to twrp 3.0 v1 or for 2.8 twrp by tomoms ...the deve will give some further info but as u saw some users confirmed it

no need to spam

the thread more :) ....it could be failure in building since adrian not having enough sleep coz of the developing of the xsp :eek:....so appreciate his work and don't bother him until he give us next instructions(here on cm12.1 thread or cm13 thread ),,,,i'm not pointing my fingers at any one ....i'm saying that for everyone !

thanks for the understanding of those who understand :)
[Xperia SP Original Android Development] AdrianDC:
TWRP 3.0.0 Release 3 - 18/02/2016 :

Important changes from Release 2 (http://xdaforums.com/showpost.php?p=65380977&postcount=41)

Dual boot removed, bootable as TWRP only to install ROMs or in the FOTA partition with flashable zip
[Xperia SP Original Android Development] Zenith:
Everything seems well in r3!

Backup: OK

Flashing: OK

OTG access: OK

Restoring backups and everything else: Pretty sure they're okay too, someone else can test and let us know

And this looks good:
[Xperia SP Original Android Development] dic1911:
sorry that my browser load the page from cache so i didn't saw there's already had a user reported that r2 isn't working :(
[Xperia SP Original Android Development] ralfbergs:
Thanks.

Version number still is 3.0.0-0... I thought the flash didn't work, but flashing cache and TA is possible, so it must be the new version...
[Xperia SP Original Android Development] AdrianDC:
Version number will not change, it's the TWRP version, not Huashan releases.

Hence the _rX version added to each flashable or bootable release.
[Xperia SP Original Android Development] ralfbergs:
Just trying to understand what that means...

So it's changes you made (as opposed to upstream changes by TWRP team)?

Would it not be an option to add a string, like 3.0.0-0 (Adrian r3), or similar?

I consider it bad practice not to have a unique version string in your software, after weeks or even months you will no longer remember the exact version you flashed back then...
[Xperia SP Original Android Development] Limakos:
Yesterday I flashed latest version of TWRP 3 from 2.8.7.0. Before doing that I did backup of the whole system. After reboot to system the phone was rebooting to TWRP only. Did I do something wrong?

To get phone working again I restored backup with TWRP 3 and system booted properly. What is weird is that today when I rebooted and went to recovery I have TWRP 2.8.7.0.

Any help will be appreciated as I would like to have TWRP 3 with phone booting to system correctly

Wysłane z mojego SM-T800 przy użyciu Tapatalka
[Xperia SP Original Android Development] Andreus94:
When I reboot system after a flash, the phone remains with black screen, as it did with an old release of twrp recovery...
[Xperia SP Original Android Development] dic1911:
i thought u had flashed twrp3 to the boot partition of your xsp

try again with the flashable zip
[Xperia SP Original Android Development] Limakos:
Previously I flashed fota IMG file and didn't wipe cache / dalvik. Today as per your suggestion I flashed zip file and also wiped cache / dalvik. After completion phone rebooted to system and for now it seems TWRP 3 is on board. Thanks for your help
[Xperia SP Original Android Development] AdrianDC:
The 4th release has 20% default brightness & a few sources cleanup.
[Xperia SP Original Android Development] kjeasan:
I think i found one bug..after installing ROM i press reboot but it was just a black blank screen instead of rebooting...i had to manually turn of my mobile...

someone confirm this...
[Xperia SP Original Android Development] mrskyou:
Known issue, Adrian working on it.
[Xperia SP Original Android Development] ishantanish:
how to install TWRP recovery ??? i have SP non rooted if any guide link den plz provide it and if there not Q/A den i m very sorry for my question now i unlock bootloader now i want install twrp recovery cos i want custom rom

Sorry for bad english
[Xperia SP Original Android Development] AdrianDC:
If you have unlocked your bootloader as you say, then using "fastboot flash boot nameoftheimgfile.img",

you can flash the bootimage from TWRP 3 latest release.

If you do not know how to use fastboot or don't want to install it,

you could also use Flashtool to flash the kernel in fastboot mode.

There's plenty more informations about these processes on the forum so please have a look.

When you boot to TWRP, then you can flash the TWRP zip for FOTA,

and flash the new ROM, GApps, and things you'd maybe want.
[Xperia SP Original Android Development] ishantanish:
thank u very much for nice replay :)

---------- Post added at 01:16 PM ---------- Previous post was at 12:23 PM ----------

i have problem there failed twrp fastboot flash method plz explain it how to use fastboot method for twrp recovery
[Xperia SP Original Android Development] ishantanish:
Hellow i cant flash twrp recovery something wrong plz give me step by step procedure plzzz i was flashed cwm recovery but i want twrp bcz cm12.1 not working on cwm recovery so plz guide me step by step
[Xperia SP Original Android Development] nandan21:
Can someone help me?

Hi,

I flashed twrp-3.0.0-r4-fota-huashan.zip and when i boot into recovery it says unmodified system partition along with "Keep System Read Only?"

"TWRP can leave your system partition unmodifed to make it easier for you to take official updates. TWRP will unable to prevent the stock rom from replacing TWRP and will not offer to root your device. Installing zips or performing adb operations may still modify the system partition."

It gave me options of either keep read only or swipe to allow modifications. Which one shall I choose? i don't which one i should pick? i came from doomkernel and i flashed your recovery and i also flashed cm12.1 rom i just want to change to marshmallow rom. But this thing shows up. Please reply as soon as possible.

Thanks Nandan
[Xperia SP Original Android Development] AdrianDC:
Swipe, it's ok, you want to be able to change the system.

Also know you can check the box to avoid seeing it again.

You can flash latest CM13 build directly there, along with the new GApps for 6.0.

Just flash the bootimage from twrp with fastboot (or FlashTool),

I talked about it before and there's a lot of topics talking about it so have a look.

When you've booted to TWRP, just flash the TWRP FOTA zip,

and flash the ROM & things like GApps you want.
[Xperia SP Original Android Development] leuteris23:
[MENTION=2233641]Adrian DC[/MENTION] just for report....I installed the twrp-r5 and i think reboot fixed!All you notice is that the restart time is a bit longer,that's all.Thank you for your work!! :good:
[Xperia SP Original Android Development] mrskyou:
+1,the reboot time is a bit more longer than r4...
[Xperia SP Original Android Development] ireaper4592:
hi noob question im on stock rom rooted and bootloader unlocked and doomkernal v03 flashed so got old recoveries installed can i flash this recovery with no issues not sure if work with stock rom and doomkernel thanks
[Xperia SP Original Android Development] ParanoidNemo:
This recovery is flashad onto fota partition so you have it independent of witch kernel you are using. You only have to flash it and then you can access it when booting pressing vol+ button. If you install new ROM/kernel the recovery stay as it is without any problem. Works with every ROM
[Xperia SP Original Android Development] ireaper4592:
take it you was responding to me thanks

---------- Post added at 12:58 PM ---------- Previous post was at 12:45 PM ----------

keeps booting to recovery?

---------- Post added at 01:09 PM ---------- Previous post was at 12:58 PM ----------

sorry to keep asking about things but how come when i installed it i cant stay on stock rom and i had to flash a new rom for phone to start and then twrp recovery is gone and cwm is there
[Xperia SP Original Android Development] ParanoidNemo:
?? Twrp is in fota..no way that it's gone if you haven't flash the fota cleaner zip..for stock problem I don't really know sorry :(
[Xperia SP Original Android Development] ireaper4592:
i thought all i had to do is flash boot.img in flashtool and then boot to twrp and flash fota zip thats all?
[Xperia SP Original Android Development] ParanoidNemo:
Flash .IMG from flashtool and use the zip made the same thing..those are only 2 different form of the same package
[Xperia SP Original Android Development] ireaper4592:
the fota zip is to make recovery remain through flashing all roms maybe its because i flashed cm11 lbl version do u think thats the problem
[Xperia SP Original Android Development] ParanoidNemo:
If you have unlocked bootloader why you have flash a lbl zip? You should use ulb ROM..if you want cm try cm12.1 unofficial or wait for the new build of cm13 that should have working camera in it
[Xperia SP Original Android Development] ireaper4592:
so u think thats why then because lbl roms are different
[Xperia SP Original Android Development] ParanoidNemo:
Could be..lbl are more strict, should work on ulb only with stock kernel but it could also not work because of some tweak made by the dev to make it work with stock kernel
[Xperia SP Original Android Development] ireaper4592:
do u have link for unofficial cm12.1 and ido i still need to flash boot img with flastool or fastboot sorry i used to know how to do all this but i fogot somethings as i did not use phone for a while
[Xperia SP Original Android Development] ParanoidNemo:
http://xdaforums.com/showthread.php?t=3337303 here the link to the cm12.1 thread..choose the download link for the beta..is the unofficial one..if you have twrp installed just boot into it and flash the ROM+gapps, if not first flash twrp zip or use the .img file, the enter the recovery and follow the rules you find into the instructions post
[Xperia SP Original Android Development] ireaper4592:
thankyou so much for your help now have cm12.1 running with twrp staying thankyou again
[Xperia SP Original Android Development] SecFry:
Latest (r5) build doesn't work with adopted storage. Tho there is commit (https://github.com/TeamWin/Team-Win-Recovery-Project/commit/66a1949df91cc558bf5573c395fa9084c1365e81) in source tree pointing it was fixed . Probably some config flag involved, could it be TW_INCLUDE_CRYPTO?

[UPD:] It actually is (https://github.com/search?q=org:TeamWin+TW_INCLUDE_CRYPTO&type=Code).

[UPD2:] No, it's actually not (https://github.com/TeamWin/Team-Win-Recovery-Project/search?utf8=✓&q=TW_INCLUDE_L_CRYPTO).

[UPD3:] I guess fstab partition should p2 for external-sd if it is encrypted (via adopted storage method) and p1 is it's not encrypted. Currently building with p2 to check it it's true. If it will fix this, I'll try to come with solution that works in both cases.

[UPD4:] I was wrong, but got it to recognise adopted storage anyway. Little changes to fstab made the trick. Sad part is n't mount after decrypt. Investigating further.

[UPD5:] Ehm, I made it work with changes to TWRP source and I can't judge if my code is good enough. IDK what to do in such situation. Will upload to gerrit. Also I will post my build here.

[UPD6:] Well, partially working adopted storage is here (https://www.dropbox.com/s/i5ti2qzajfz8qgu/recovery-twrp-3.0.0-0-sf-1.img?dl=0). It does work only if you phone is plugged to USB (that somehows change behaviour of "blkid_do_fullprobe").
[Xperia SP Original Android Development] AdrianDC:
Updated to TWRP 3.0.1 (r6) : https://twrp.me/site/update/2016/04/01/twrp-3.0.1-0-released.html
[Xperia SP Original Android Development] sanzNya:
Its okey to flash twrp 3.0.1 on cm 12.1 over twrp 3.0.0 without format fota kernel before? Or i have flash formatter first then update the twrp?
[Xperia SP Original Android Development] dic1911:
it's ok, just flash it, no worries ;)
[Xperia SP Original Android Development] motaleby:
Is it possible to use software like Rashr, MobileUncleTools,... for the 2nd step (twrp-3.0.1-rX-boot-huashan.img : Fastboot bootable TWRP 3 image)?
[Xperia SP Original Android Development] flash-:
rashr app yeah ...it should work :)
[Xperia SP Original Android Development] motaleby:
Thanks flash-

I had Philz touch 6.59 recovery and tried to flash above twrp image with Rashr but recovery came back to Cyanogen.