[Xiaomi Mi A1 ROMs, Kernels, Recoveries, & Other De] Giovix92:
Thread template from CosmicDan's thread.

About

This is a TWRP Installer ZIP and bootable IMG with extra capability such as Treble-izing and other power-user tools with integrated TWRP-powered submenus that CosmicDan originally called Tissot Manager.

Few months ago, CosmicDan officially decided to leave Tissot development, and his twrp was stuck on 3.2.3. So I decided to update that to 3.3 and convert all the aroma stuff into TWRP-powered menus etc, in order to preserve better future compatibility.

HIGHLY recommended reading and guide for everyone new to Treble - [TREBLE][GUIDE] From Stock to Treble - everything you need to know! by CosmicDan. It also has some general protips hidden within there, for example the seamless/slot system interactions and nuances, so it's worth reading for anyone who wants to be a master of the Android flashing domain ;)

Features:

TWRP fully Treble-ready based on 3.3.1-0;

Fully compatible with non-Treble devices - can be used as normal without Treble partitioning;

Full USB-OTG support;

Full MTP support;

Optional TWRP Survival function, that works both in hotboot and real recovery;

Optional Active slot install method, selectable right before the zip flash;

Option to ignore Payload<>Recovery certificate failures (fix for newer LOS-based ROMs);

Added a Tissot Manager list item under Advanced Menu, totally built-into TWRP itself that allows you to do:

Has the option to shrink Userdata to create Vendor partitions. All relevant partitions will be resized and formatted in one go.

Treble-izing will ERASE DATA AND INTERNAL STORAGE COMPLETELY - but your device will stay compatible with all existing non-Treble ROM's

Adds a "Patches" section with the following current options:

Patch kernel from Enforcing to Permissive and vice versa

More features coming!

All of this info is detailed inside the Tissot Manager GUI.

See screenshots in post 2.

Since this is an early version (still stable), some original features from 3.2.3 are still not available. I'll do my best to constantly add new functions when possible!

Instructions

Optionally boot the boot-recovery.img to get a temporary TWRP if you don't have it installed, unzipped from TWRP-3.3-withTM-BOOT.zip

fastboot boot boot-recovery.img

Warning - do not EVER flash this img - hotboot it only.

Flash the TWRP Installer. Any slot, any ROM, any existing Recovery - it doesn't matter - it will be installed to both slot kernels.

Reboot Recovery

Optional - Use the "Advanced > Tissot Manager" option for repartition options and other advanced ROM patches, this time built-in TWRP itself for better compatibility with future versions.

About TWRP survival

Starting from 1.0, TWRP Survival will be able both in hotboot mode 'n real recovery mode. Just tick the checkbox 'n flash!

Download

All downloads (and source code) always at:

https://github.com/Giovix92/twrp_device_xiaomi_tissot/releases

Additional sources not able to be listed in DevBB:

Modified update_engine: https://github.com/Giovix92/android_system_update_engine

What's next?

See [TREBLE][GUIDE] From Stock to Treble - everything you need to know! by CosmicDan for detailed instructions and learning on how to Treble like a pro.

FAQ

Q) After I flash TWRP, I get kicked into a Recovery loop when trying to boot the ROM!

A) This is probably because you have a kernel that does not disable dm-verity. To fix this, flash Magisk.

Q) After I flash TWRP, I get kicked into fastboot when trying to boot the ROM!

A) Your kernel is not Treble-compatible.

Q) How do I update TWRP?

A) Just flash the ZIP installer again, then Reboot Recovery. Note that this will erase Magisk on BOTH slots if you have it installed to either, requiring you to reflash it to one/both slots. See my Treble guide FAQ section for more info on Magisk interaction.

Q) If I shrink Userdata for Treble, will stock and OTA work?

A) I have heard varying results on this. It does for some, not for others. Please assume that this will NOT work.

Q) Can I restore a non-Treble TWRP backup after I repartition for Treble? And the other way around?

A) Yes! In fact, this is the easiest way for using stock ROM on Treble repartition. May also require a custom kernel with dm-verity disabled (see Questions above regarding fastboot kick and recovery loop).

Q) I see "Failed to mount '/system' (Device or resource busy)" red error in TWRP after flashing a ROM

A) You can safely ignore it. You just need to reboot recovery before you can flash anything else (like Gapps) to this ROM. This may occur while flashing in the active slot.

Q) What "Inject TWRP after install" option does?

A) It's TWRP Survival. If you check that checkbox, then after the installation of your zip file the TWRP will automatically reinstall TWRP into your slot.

Bugs Report

If any bug/problem may occur, feel free to report it here! Explain the problem and attach the recovery log. You can get it by going to Advanced - Copy Log and sliding. Kernel log isn't necessary.

If, for some strange reasons, you are unable to get into that menu', connect your phone to PC, open up CMD (aka command prompt) and type:

adb pull /tmp/recovery.log

Credits and Thanks

- [MENTION=1844875]CosmicDan[/MENTION] for tips, helps and his amazing work on TWRP 3.2.3, which I've taken many things from

- [MENTION=5432026]nicknitewolf[/MENTION] for his DT

- [MENTION=578836]chondoe[/MENTION] for always being present in testing and reporting bugs/good news

- [MENTION=5120185]flex1911[/MENTION] for DT stuff

- [MENTION=4712355]mauronofrio[/MENTION] for inject twrp function

XDA:DevDB Information

TWRP 3.3.1-0 with Tissot Manager, ROM for the Xiaomi Mi A1

Contributors

Giovix92

Source Code: [url]https://github.com/Giovix92/device_xiaomi_tissot[/URL]

ROM OS Version: 9.x Pie

ROM Kernel: Linux 4.x

Version Information

Status: Stable

Current Stable Version: 1.0

Stable Release Date: 2019-10-01

Created 2019-10-01

Last Updated 2019-10-01