[OFFICIAL][TWRP]Official TWRP For Xiaomi Redmi 5

Search This thread

TingyiChen

Senior Member
May 28, 2016
179
1,241
Huanggang
Team Win Recovery Project 3.x, or TWRP3.x 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.
Code:
/*
 * Your warranty is now void.
 *
 * 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.
 *
 */
Download : TWRP For Rosy
Source Device Tree: Device Tree For Building TWRP
 
Last edited:

rishi4082

Senior Member
Team Win Recovery Project 3.x, or TWRP3.x 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.

Download : TWRP For Rosy
Source Device Tree: Device Tree For Building TWRP
Can we expect any custom ROMs for this device?

PS:Sorry for Quoting the OP:3
 

rishi4082

Senior Member
Team Win Recovery Project 3.x, or TWRP3.x 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.

Download : TWRP For Rosy
Source Device Tree: Device Tree For Building TWRP
Thread is dead for so long..
Do u plan to support Rosy? In the future?
 

miteshmhapankar

New member
Mar 18, 2015
3
0
TWRP flash is successful But cannot reboot into TWRP

I successfully flashed TWRP via fastboot. But every time I reboot into recovery, it reboots into Mi Recovery. I tried flashing multiple times, but get the same result every time. Please help.
 

norryhox

Senior Member
May 31, 2015
176
31
Wegberg
I have twrp now installed for about 2 weeks
but every time I use it the settings are gone, so language time
vibration and so on
There seems to be no memory access
 

vetzki

Senior Member
Jan 5, 2011
204
71
decryption not working

to fix:

repo init twrp source

add rosy device
add qcom common device

device/xiaomi/rosy:

Code:
diff --git a/BoardConfig.mk b/BoardConfig.mk
index e51c06e..9d4ba21 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -71,6 +71,10 @@ TARGET_RECOVERY_PIXEL_FORMAT := "RGBX_8888"
 TARGET_USERIMAGES_USE_EXT4 := true
 TARGET_USERIMAGES_USE_F2FS := true
 
+# Crypto
+TARGET_HW_DISK_ENCRYPTION := true
+
 # TWRP Configuration
 TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/twrp.fstab
 RECOVERY_SDCARD_ON_DATA := true
diff --git a/omni.dependencies b/omni.dependencies
deleted file mode 100644
index 0d4f101..0000000
--- a/omni.dependencies
+++ /dev/null
@@ -1,2 +0,0 @@
-[
-]

dl:
https://drive.google.com/file/d/1rfaaQ0f6JqE7MgYdhEq-o0Olo7d_ZxzP/view?usp=sharing

edit:
TARGET_KEYMASTER_WAIT_FOR_QSEE := true not needed
 
Last edited:
  • Like
Reactions: alecxs

vetzki

Senior Member
Jan 5, 2011
204
71
for treble support only different fstab and BoardConfig parameter needed (at least I think so),

Code:
diff --git a/BoardConfig.mk b/BoardConfig.mk
index ce63750..c631a53 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -90,3 +90,7 @@ TW_THEME := portrait_hdpi
 
 # Disable Mouse Cursor
 TW_INPUT_BLACKLIST := "hbtp_vm"
+
+# Treble
+BOARD_NEEDS_VENDORIMAGE_SYMLINK := false
+TARGET_COPY_OUT_VENDOR := vendor
diff --git a/twrp.fstab b/twrp.fstab
index a581921..97dad11 100644
--- a/twrp.fstab
+++ b/twrp.fstab
@@ -3,15 +3,45 @@
 # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
 
 /system         ext4      /dev/block/bootdevice/by-name/system               flags=display="System"
-/data           ext4      /dev/block/bootdevice/by-name/userdata             flags=length=-16384
+#/system_image   emmc      /dev/block/bootdevice/by-name/system               flags=backup=0;flashimg=1
+/system_image   emmc      /dev/block/bootdevice/by-name/system               flags=flashimg=1;display="Image system partition"
+#/data           ext4      /dev/block/bootdevice/by-name/userdata             flags=encryptable=footer;length=-16384
+/data           ext4      /dev/block/bootdevice/by-name/userdata             length=-16384
+/data_image     emmc      /dev/block/bootdevice/by-name/userdata    flags=backup=1;display="Image data partition"
+/boot           emmc      /dev/block/bootdevice/by-name/boot                 flags=display="Boot"
 /cache          ext4      /dev/block/bootdevice/by-name/cache                flags=display="Cache"
-/cust           ext4      /dev/block/bootdevice/by-name/cust                 flags=display="Cust";backup=1
+/storage        ext4      /data/media/0                                     flags=display="Internal Storage";usermrf;backup=1;fsflags="bind";removable
+/vendor         ext4      /dev/block/bootdevice/by-name/cust                 flags=display="Vendor";backup=1;wipeingui
+/vendor_image   emmc      /dev/block/bootdevice/by-name/cust                 flags=backup=0;flashimg=1
+
 /recovery       emmc      /dev/block/bootdevice/by-name/recovery             flags=display="Recovery";backup=1
-/boot           emmc      /dev/block/bootdevice/by-name/boot                 flags=display="Boot"
 /misc           emmc      /dev/block/bootdevice/by-name/misc                 flags=display="Misc"
-/efs1           emmc      /dev/block/bootdevice/by-name/modemst1             flags=display="EFS";backup=1
-/efs2           emmc      /dev/block/bootdevice/by-name/modemst2             flags=backup=1;subpartitionof=/efs1
-/firmware       vfat      /dev/block/bootdevice/by-name/modem                flags=display="Firmware";mounttodecrypt
 /persist        ext4      /dev/block/bootdevice/by-name/persist              flags=display="Persist";backup=1
+/persist_image  emmc      /dev/block/bootdevice/by-name/persist              flags=backup=0;flashimg=1
+/splash         emmc      /dev/block/bootdevice/by-name/splash               flags=display="Boot Logo";backup=1;flashimg=1
+
 /sdcard1        auto      /dev/block/mmcblk1p1                               flags=display="MicroSD";storage;wipeingui;removable
 /usb-otg        auto      /dev/block/sda1                                    flags=display="USB Storage";storage;wipeingui;removable
+
+# Bootloader
+/aboot         emmc      /dev/block/bootdevice/by-name/aboot                flags=backup=1;display="Bootloader"
+/cmnlib                emmc      /dev/block/bootdevice/by-name/cmnlib               flags=backup=1;subpartitionof=/aboot
+/tz            emmc      /dev/block/bootdevice/by-name/tz                   flags=backup=1;subpartitionof=/aboot
+/rpm           emmc      /dev/block/bootdevice/by-name/rpm                  flags=backup=1;subpartitionof=/aboot
+/keymaster     emmc      /dev/block/bootdevice/by-name/keymaster            flags=backup=1;subpartitionof=/aboot
+/devcfg                emmc      /dev/block/bootdevice/by-name/devcfg               flags=backup=1;subpartitionof=/aboot
+
+# Modem backup/restore
+/firmware       vfat      /dev/block/bootdevice/by-name/modem                flags=display="Firmware";backup=0;mounttodecrypt;fsflags=ro
+/modem                 emmc      /dev/block/bootdevice/by-name/modem                flags=display="Modem (Image)";backup=1;flashimg=1
+/dsp           emmc      /dev/block/bootdevice/by-name/dsp                  flags=backup=1;subpartitionof=/firmware
+/sec           emmc      /dev/block/bootdevice/by-name/sec                  flags=backup=1;display="Sec"
+#/config       emmc      /dev/block/bootdevice/by-name/config               flags=display="OEM";backup=1
+#/sec          emmc      /dev/block/bootdevice/by-name/sec                  flags=display="Sec";backup=1;subpartitionof=/config
+
+
+# EFS backup/restore
+/efs1          emmc      /dev/block/bootdevice/by-name/modemst1             flags=backup=1;display="EFS"
+/efs2          emmc      /dev/block/bootdevice/by-name/modemst2             flags=backup=1;subpartitionof=/efs1
+/efsg          emmc      /dev/block/bootdevice/by-name/fsg                  flags=backup=1;subpartitionof=/efs1
+/efsc          emmc      /dev/block/bootdevice/by-name/fsc                  flags=backup=1;subpartitionof=/efs1
(note: not all partitions needed, e.g. efs, bootloader, _image stuff)

built recovery but didn't test anything beside backup and flashing xiaomi.eu rom

but do you need such a recovery to install los-15.1 ?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Team Win Recovery Project 3.x, or TWRP3.x 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.
    Code:
    /*
     * Your warranty is now void.
     *
     * 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.
     *
     */
    Download : TWRP For Rosy
    Source Device Tree: Device Tree For Building TWRP
    2
    Is OrangeFox a better idea than TWRP for this device?
    It is different in some respects - but "better" or not is a matter of taste! However, I do not think that this is the place for that discussion ;)
    1
    decryption not working

    to fix:

    repo init twrp source

    add rosy device
    add qcom common device

    device/xiaomi/rosy:

    Code:
    diff --git a/BoardConfig.mk b/BoardConfig.mk
    index e51c06e..9d4ba21 100644
    --- a/BoardConfig.mk
    +++ b/BoardConfig.mk
    @@ -71,6 +71,10 @@ TARGET_RECOVERY_PIXEL_FORMAT := "RGBX_8888"
     TARGET_USERIMAGES_USE_EXT4 := true
     TARGET_USERIMAGES_USE_F2FS := true
     
    +# Crypto
    +TARGET_HW_DISK_ENCRYPTION := true
    +
     # TWRP Configuration
     TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/twrp.fstab
     RECOVERY_SDCARD_ON_DATA := true
    diff --git a/omni.dependencies b/omni.dependencies
    deleted file mode 100644
    index 0d4f101..0000000
    --- a/omni.dependencies
    +++ /dev/null
    @@ -1,2 +0,0 @@
    -[
    -]

    dl:
    https://drive.google.com/file/d/1rfaaQ0f6JqE7MgYdhEq-o0Olo7d_ZxzP/view?usp=sharing

    edit:
    TARGET_KEYMASTER_WAIT_FOR_QSEE := true not needed
    1
    after MIUI update Oreo (miui_HM5Global_V10.3.2.0.ODAMIXM_c9235681be_8.1.zip) the TWRP from post #14 does not work anymore

    Code:
    Data successfully decrypted, new block device: '/dev/block/dm-0'
    Successfully decrypted with default password.
    Failed to mount '/data' (No such process)

    however, seems it has just problem with mounting /data but no problem with decryption. so i checked the file system showing the magic 53 ef at offset 0x438 which confirmed to me it is a ext4 partition. i mounted manually and was able to create a backup to external MicroSD Card

    Code:
    mint@debian ~/Android/Backup/rosy $ adb shell
    / # hexdump -C -n1088 /dev/block/dm-0
    00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    *
    00000400  e0 33 18 00 f3 bb 60 00  00 80 00 00 6c a0 2a 00  |.3....`.....l.*.|
    00000410  9c 16 17 00 00 00 00 00  02 00 00 00 02 00 00 00  |................|
    00000420  00 80 00 00 00 80 00 00  f0 1f 00 00 bd 76 59 5d  |.............vY]|
    00000430  bd 76 59 5d d1 00 0a 00  53 ef 01 00 02 00 00 00  |.vY]....S.......|
    00000440
    / # mkdir /tmp/data
    / # busybox mount -t ext4 -o ro,noexec,noload /dev/block/dm-0 /tmp/data
    / # cd /tmp/data
    /tmp/data # ls
    FTM_AP          connectivity    mediadrm        security
    adb             dalvik-cache    misc            shared
    anr             data            misc_ce         ss
    app             dpm             misc_de         system
    app-asec        drm             miui            system_ce
    app-ephemeral   fota            mqsas           system_de
    app-lib         fpc_tpl         nfc             thermal
    app-private     hostapd         ota             time
    audio           local           ota_package     tombstones
    backup          log             property        user
    bootchart       lost+found      resource-cache  user_de
    cache           media           sdcard          vendor
    /tmp/data # busybox mount -o bind /tmp/data /data
    /tmp/data # busybox mount -o bind /tmp/data/media /sdcard
    /tmp/data # busybox mount -o bind /tmp/data/media/0 /sdcard
    /tmp/data # ls /sdcard
    Android          MiVideoGlobal    Tumblr           fac_sources
    Camera           PeriodCalendar   WhatsApp         temp
    DCIM             Pictures         bluetooth        usb_cam_log.txt
    Download         Recording        dctp             wlan_logs
    Kik              Snapseed         did              wt_logs
    MIUI             TWRP             downloaded_rom
    /tmp/data # df
    Filesystem           1K-blocks      Used Available Use% Mounted on
    tmpfs                  1439020       156   1438864   0% /dev
    tmpfs                  1439020        32   1438988   0% /tmp
    /dev/block/mmcblk0p25
                            507848      6356    491008   1% /cache
    /dev/block/mmcblk1p1  30367456  17639040  12728416  58% /sdcard1
    /dev/block/dm-0       24960064  13785744  11026864  56% /tmp/data
    /dev/block/dm-0       24960064  13785744  11026864  56% /data
    /dev/block/dm-0       24960064  13785744  11026864  56% /sdcard
    /tmp/data #

    i managed to copy all files from Internal storage to PC via USB
    Code:
    adb pull /sdcard/

    edit: even when /dev/block/mmcblk0p49 formatted with mke2fs TWRP is not able to mount, neither encrypted nor unencrypted. manually mount works. does anybody know the reason for this? Redmi 5 Plus seems to have similar issue related to disk quota

    edit2: i have included the read-only mount for encrypted userdata and added option to backup internal storage in this twrp-recovery-3.2.3-redmi5-rosy-emergency.zip - use it for backup to external MicroSD Card only. USB MTP is working, too