[EOL][RECOVERY][Android 8 / 9][Stock/SODP][XZ2/C/P/3] TWRP 3.3.1-0 [UNofficial]

Should I continue this project?

  • Yes, for the XZ2.

    Votes: 180 35.4%
  • Yes, for the XZ2C.

    Votes: 205 40.3%
  • Yes, for the XZ2P.

    Votes: 69 13.6%
  • Yes, for the XZ3.

    Votes: 108 21.2%
  • No.

    Votes: 2 0.4%

  • Total voters
    509
Search This thread

TPlatt

Senior Member
Jun 14, 2015
142
1

Ok so let me break this all down,

I need to download twrp from v10.

I plug phone to computer with vol up

I enter fastboot mode. Open command window from download (and extracted folder)

I type fastboot devices.

I see my device

I type "fastboot boot boot.img"

Hopefully works, if so while in twrp, I flash twrp.
I then flash magisk and

Done

Do I need to do the disable vbmeta because I could never get it to work.

Also when do I boot vendor.img if at all.
 

MartinX3

Recognized Contributor
Sep 14, 2014
5,991
3,039
Mars
martinx3.github.io
Ok so let me break this all down,



I need to download twrp from v10.



I plug phone to computer with vol up



I enter fastboot mode. Open command window from download (and extracted folder)



I type fastboot devices.



I see my device



I type "fastboot boot boot.img"



Hopefully works, if so while in twrp, I flash twrp.

I then flash magisk and



Done



Do I need to do the disable vbmeta because I could never get it to work.



Also when do I boot vendor.img if at all.
You need to flash the vendor and boot from V10 and boot the V8 twrp
Otherwise you won't have touch
 

TPlatt

Senior Member
Jun 14, 2015
142
1
You need to flash the vendor and boot from V10 and boot the V8 twrp
Otherwise you won't have touch

Would the command be

Fastboot flash boot.img

Wait

Fastboot flash vendor.img

Wait

Fastboot boot twrp.img


And do I need to do the vbmeta part? I never got that command to work. My intentions are spoofing gps. But pretty sure I'll use smali patcher with magisk.
 

TPlatt

Senior Member
Jun 14, 2015
142
1

C:\adb\5-17-2020 root>fastboot devices
BH9019A5CU fastboot

C:\adb\5-17-2020 root>fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
Rewriting vbmeta struct at offset: 0
Sending 'vbmeta' (4 KB) OKAY [ 0.016s]
Writing 'vbmeta' OKAY [ 0.000s]
Finished. Total time: 0.297s


C:\adb\5-17-2020 root>fastboot flash boot boot.img
Sending 'boot_a' (65536 KB) OKAY [ 2.868s]
Writing 'boot_a' OKAY [ 0.352s]
Finished. Total time: 3.458s


C:\adb\5-17-2020 root>fastboot flash vendor vendor.img
Sending 'vendor' (46516 KB) OKAY [ 1.898s]
Writing 'vendor' OKAY [ 0.014s]
Finished. Total time: 2.277s



C:\adb\5-17-2020 root>fastboot boot twrp.img
Sending 'boot.img' (65536 KB) OKAY [ 2.649s]
Booting OKAY [ 5.676s]
Finished. Total time: 9.240s

C:\adb\5-17-2020 root>



this resulted in illuminated blackscreen. twrp did not show up to work at all. what did i do wrong?
i used v10 vendor and boot img files and twrp v8. so im still stuck with no proper twrp. and now my phone wont boot normally either. says its been corrupted. so how do i flash the firmware. i downloaded the german one, that you used and i click the file newflasher.exe but it doesnt prompt me to install it.

---------- Post added at 04:18 AM ---------- Previous post was at 04:05 AM ----------

Also when flashing the firmware, I get error

No USB device with vid:0x0fce pid:0xb00b !
Press any key to continue . . .

Should I be trying a different firmware....?
 

MartinX3

Recognized Contributor
Sep 14, 2014
5,991
3,039
Mars
martinx3.github.io
C:\adb\5-17-2020 root>fastboot devices

BH9019A5CU fastboot



C:\adb\5-17-2020 root>fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img

Rewriting vbmeta struct at offset: 0

Sending 'vbmeta' (4 KB) OKAY [ 0.016s]

Writing 'vbmeta' OKAY [ 0.000s]

Finished. Total time: 0.297s





C:\adb\5-17-2020 root>fastboot flash boot boot.img

Sending 'boot_a' (65536 KB) OKAY [ 2.868s]

Writing 'boot_a' OKAY [ 0.352s]

Finished. Total time: 3.458s





C:\adb\5-17-2020 root>fastboot flash vendor vendor.img

Sending 'vendor' (46516 KB) OKAY [ 1.898s]

Writing 'vendor' OKAY [ 0.014s]

Finished. Total time: 2.277s







C:\adb\5-17-2020 root>fastboot boot twrp.img

Sending 'boot.img' (65536 KB) OKAY [ 2.649s]

Booting OKAY [ 5.676s]

Finished. Total time: 9.240s



C:\adb\5-17-2020 root>







this resulted in illuminated blackscreen. twrp did not show up to work at all. what did i do wrong?

i used v10 vendor and boot img files and twrp v8. so im still stuck with no proper twrp. and now my phone wont boot normally either. says its been corrupted. so how do i flash the firmware. i downloaded the german one, that you used and i click the file newflasher.exe but it doesnt prompt me to install it.

---------- Post added at 04:18 AM ---------- Previous post was at 04:05 AM ----------

Also when flashing the firmware, I get error

No USB device with vid:0x0fce pid:0xb00b !
Press any key to continue . . .

Should I be trying a different firmware....?

It's nice, that you have now the correct Fastboot/ADB :D

Please reboot into the fastboot mode with
fastboot reboot bootloader
Or
adb reboot bootloader
And not with the hardware keys, if you want to boot twrp
There is a bootloader bug



The newflasher error in Windows indicates that your computer misses the "download mode" (green led) usb drivers?
Does your device manager show something special after you connected your device in the green download mode?
 

TPlatt

Senior Member
Jun 14, 2015
142
1
It's nice, that you have now the correct Fastboot/ADB :D

Please reboot into the fastboot mode with
fastboot reboot bootloader
Or
adb reboot bootloader
And not with the hardware keys, if you want to boot twrp
There is a bootloader bug



The newflasher error in Windows indicates that your computer misses the "download mode" (green led) usb drivers?
Does your device manager show something special after you connected your device in the green download mode?

As of now my phone is bricked, it keeps saying it is corrupt. I want to flash over the new firmware. But when I hold vol down and plug in, the computer recognizes device, however the android driver has an exclamation point. So I will need to download another driver. What should I google for it so I can ensure proper download for my device? I'm not flash driver, and I'm not sure what this driver would be called.

---------- Post added at 12:11 PM ---------- Previous post was at 12:03 PM ----------

Also when I follow your command above about twrp, it goes black when I boot twrp. Or should I just flash twrp and then use your command of "fastboot reboot bootloader"
 

MartinX3

Recognized Contributor
Sep 14, 2014
5,991
3,039
Mars
martinx3.github.io
As of now my phone is bricked, it keeps saying it is corrupt. I want to flash over the new firmware. But when I hold vol down and plug in, the computer recognizes device, however the android driver has an exclamation point. So I will need to download another driver. What should I google for it so I can ensure proper download for my device? I'm not flash driver, and I'm not sure what this driver would be called.

Did you flash OEM to slot A and B, deactivated on the used slot vbmeta, flashed the v10 boot and vendor to the boot/vendor partition on the used slot and just "fastboot boot twrp.mg" the v8 twrp?

https://lmgtfy.com/?q=sony+adb+driver&iie=1
There from the sony page
Just connect the phone in fastboot mode/adb/download mode in windows and install the driver .inf file in the device manager.
 

TPlatt

Senior Member
Jun 14, 2015
142
1
Did you flash OEM to slot A and B, deactivated on the used slot vbmeta, flashed the v10 boot and vendor to the boot/vendor partition on the used slot and just "fastboot boot twrp.mg" the v8 twrp?

https://lmgtfy.com/?q=sony+adb+driver&iie=1
There from the sony page
Just connect the phone in fastboot mode/adb/download mode in windows and install the driver .inf file in the device manager.

So I have correct driver for fastboot mode (blue led) but not for adb mode (green led)

Also, the stuff above that, I have no idea. I'll post my log briefly from command window.
 

TPlatt

Senior Member
Jun 14, 2015
142
1
Fastboot -> blue
Download -> green (to flash signed stock firmwares via newflasher)
ADB -> running system/twrp

Ok. Well I got newflasher to start working. As far as optional steps, what do I need to do?

---------- Post added at 12:24 PM ---------- Previous post was at 12:23 PM ----------

First optional step is asking if I want to dump trim area
 

MartinX3

Recognized Contributor
Sep 14, 2014
5,991
3,039
Mars
martinx3.github.io
Ok. Well I got newflasher to start working. As far as optional steps, what do I need to do?

---------- Post added at 12:24 PM ---------- Previous post was at 12:23 PM ----------

First optional step is asking if I want to dump trim area

Ah, you already used xperifirm and newflasher.
Please deny it.
And you don't need to flash persist or both slots in newflasher.
 

TPlatt

Senior Member
Jun 14, 2015
142
1
Ah, you already used xperifirm and newflasher.
Please deny it.
And you don't need to flash persist or both slots in newflasher.

Do I need to delete any files from the firmware folders before going through with newflasher?

---------- Post added at 12:31 PM ---------- Previous post was at 12:27 PM ----------

here is my log from newflasher.

newflasher.exe v20 by Munjeni @ 2017/2019
--------------------------------------------------------

Determining available free space by GetDiskFreeSpaceEx:

Available space to caller = 212936 MB
Total space on current drive = 282994 MB
Free space on drive = 212936 MB

Optional step! Type 'y' and press ENTER if you need GordonGate flash driver, or type 'n' to skip.
This creates GordonGate.7z archive in the same dir with newflasher.exe!
n
Device path: \\?\usb#vid_0fce&pid_b00b#5&4547346&0&2#{a5dcbf10-6530-11d2-901f-00c04fb951ed}
Class Description: Sony sa0118
Device Instance Id: USB\VID_0FCE&PID_B00B\5&4547346&0&2


Optional step! Type 'y' and press ENTER if you want dump trim area, or type 'n' and press ENTER to skip.
Do in mind this doesn't dump drm key since sake authentifiction is need for that!
n

Optional step! Type 'y' and press ENTER if you need to flash bootloader,bluetooth,dsp,modem,rdimage to booth a,b slots, or type 'n' to skip.
By default it is NOT flashed to booth slots, do on your own risk!
n
ERROR: GetOverLapped_out_Result: failed with error code 1 as follows:
Incorrect function.

- Error write! Need nBytes: 0x18 but done: 0x0
nBytes[0x0]:


- Error writing command getvar:max-download-size!

End. You can disconnect your device when you close newflasher.exe
Press any key to continue . . .
 

Top Liked Posts

  • There are no posts matching your filters.
  • 50
    The Sony Open Devices Project is always happy about volunteers (coding, testing, etc) :)
    Also mainlining your favorite snapdragon powered xperia device into the mainline kernel is possible and we will be glad to help you!


    Code:
    #include <std_disclaimer.h>
    /*
     *
     * We are not responsible for bricked devices, dead SD cards,
     * thermonuclear war, or you getting fired because the alarm app failed. Please
     * do some research if you have any concerns about features included in this ROM
     * before flashing it! YOU are choosing to make these modifications, and if
     * you point the finger at us for messing up your device, we will laugh at you.
     *
     */

    Team Win Recovery Project 3.x, or twrp3 for short, is a custom recovery built with ease of use and customization in mind. Its a fully touch driven user interface no more volume rocker or power buttons to mash. The GUI is also fully XML driven and completely theme-able. You can change just about every aspect of the look and feel.

    FAQ:

    Known Bugs:
    • The "fastboot boot twrp.img" doesn't work, if you use the hardware buttons to open the blue fastboot bootloader mode. Only use adb, twrp or the android system to reboot into blue fastboot bootloader mode or flash the twrp.img, boot the device, reboot into bootloader and flash the original boot.img back, before booting into twrp.
      You can also "fastboot reboot bootloader" in the blue fastboot mode.
      This is a bootloader bug, maybe it gets fixed with the stock Q bootloader.

    Bugtracker:

    Bugreport:
    • A bugreport needs your device name, dmesg, the /tmp/recovery.log and a way to reproduce the issue.
    • If the TWRP is stuck at the TWRP logo, the chances are high, that the decryption didn't succeed.
      • The TWRP should be still usable if you just "fastboot boot twrp.img" it.
    • To rescue a not responding phone:
      • VOLUP+POWER for 3 Seconds -> RESTART with one Vibration.
      • VOLUP+POWER for 20 Seconds -> SHUTDOWN with 3 Vibrations.
      • VOLUP+POWER+CAMERA for 30 Seconds -> HARDWARE SHUTDOWN by discharging a capacitor.

    Thank you very much for your help, code contribution & testing! (Random order):
    • @dees_troy and his team of volunteers for the TWRP code
    • @M-ROM for his hint activating the touch in TWRP
    • @osm0sis
    • @nreuge
    • @FartyParty
    • @pandemic
    • @nasko_spasko
    • @VeixES
    • @Klaus N.
    • @old.splatterhand
    • @yanke928
    • @michele2
    • @niaboc79
    • @j4nn for hacking the kernel to make "fastboot boot twrp.img" possible
    • @shoey63 for testing @j4nn 's hack
    • @oshmoun for a better "fastboot boot twrp.img" solution
    • @dhacke thank your for providing a download server
    • Shame on me if I forgot someone after searching through the thread and my PM's!
    • And many thanks to the few donators! :)

    A telegram group for technical SODP stuff:
    https://t.me/xda_tv

    XDA:DevDB Information
    TWRP, ROM for the Xperia XZ2

    Contributors
    MartinX3, oshmoun, Marijn, Sony
    Source Code: https://github.com/MartinX3-AndroidDevelopment

    ROM OS Version: 9.x Pie
    ROM Kernel: Linux 4.x
    ROM Firmware Required: Matching to firmware in twrp name
    Based On: AOSP

    Version Information
    Status: No Longer Updated
    Current Stable Version: 3.3.1-0
    Stable Release Date: 2019-08-10

    Created 2018-07-26
    Last Updated 2020-10-23
    12
    Download & Installation

    Download:

    Installation Android 9.0:
    1. Update to newest stock firmware before unlocking!!!
    2. Enter fastboot via software, not hardware buttons. See "Known Bugs".
    3. (Optional; If you modify the system or need the camerafix.zip)
      fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
    4. fastboot boot twrp.img
    5. Advanced menu -> "Install recovery ramdisk" -> Choose twrp.img
    6. Reboot into installed TWRP
    7. Want Root? -> Magisk
    8. (Optional; Security degradation; Only if you know what you're doing) Switch SELinux to permissive (with my permissive.zip)

    In case of touch issues on the XZ2 compact:
    1. Download (try the v10 zip first, if it doesn't work try v9 or v8)
    2. Do the same steps, but with the TWRP test release.

    Installation Android 8.0:
    1. fastboot --disable-verity --disable-verification flash vbmeta vbmeta-xz2(?).img
    2. fastboot flash boot twrp.img
    3. Install stockkernel-xz2(?)-installer.zip
    4. Install twrp-3.2.3-0-xz2-xz2c-xz2p-installer-xz?-installer.zip
    5. Install Magisk-v17.1.zip
    6. (Optional; Security degradation; Only if you know what you're doing) Switch SELinux to permissive (with my permissive.zip)
    12
    @MartinX3 @sToRm// @modpunk
    I got drmfix working on enforcing selinux! ;)

    How-to:
    After reboot into system (post #3 - First time installation of TWRP & after newflasher installation), open a shell window and type:
    Code:
    su
    mount -orw,remount /vendor
    magiskpolicy --load /vendor/etc/selinux/precompiled_sepolicy --save /vendor/etc/selinux/precompiled_sepolicy "allow init domain process { noatsecure }" "allow init secd process { noatsecure }"
    mount -oro,remount /vendor
    Enjoy it!
    (you may now add it in your scripts if you want to)
    12
    09.04.2019
    stock twrp firmware 52.0.A.8.25 (april security patch level)
    fixed touch problems some people have.
    Twrp is now at version 3.3.0-0.
    12
    13.10.2019
    September security patch level:
    Stock twrp 52.0.A.10.6

    Smaller download size:
    Removed bundled magisk, since the newest one doesn't make bootloops anymore.
    Removed touch drivers from twrp, now a script greps them dynamically from the vendor partition.