I'm not a developer. After 4 days of messing with files I made this using AIK (Android Image Kitchen). It include files from different TWRPs. The theme is not mine. I provided all credits below.
As you guys know, our 64 bit TWRP from this thread is usable, but has some major bugs. Specially the touchscreen doesn't work & it's too big to flash. Now, here is a fixed twrp, no need to hassle with OTG & adb anymore!
fastboot flash recovery <filename>.img
Booting into TWRP-
- Power off
- Volume down + Power
- Keep pressing volume down until Recovery mode option comes
- Press power
adb reboot recovery
Install magisk.zip to avoid twrp being replaced by the stock recovery
- Format data
- Install Disable_Dm-Verity_ForceEncrypt.zip
I didn't know these steps from the beginning. I had to discover these. After 30-40 attempts & making 7 versions, the final result came out. To make the thread "To the point" here is what I did for the final one-
Touchscreen Fix :
- Extracted the old TWRP and started modifying it.
- Extracted plus-linux kernel, took "kernel image" & "kernel offset" from there. Inside TWRP, replaced kernel image & kernel offset with these new files. Touchscreen got fixed.
Minimal size :
The TWRP file must be 16 MB or less to be flashable for moto e5. This is because the device has very low recovery partition size. Making a 64 bit TWRP v3.7 under 16 MB was almost an impossible task. Here is how I finally did it-
- Removed txt files.
- Replaced /ramdisk/sbin/ folder with the sbin folder of official TWRP for Asus Nexus 7 2012 3G. This greatly reduced the file size & also made the TWRP v3.7. This happened because that TWRP is 32 bit. Means I used sbin from a 32 bit recovery. But our TWRP didn't become 32 bit because "bit" depends on split_image folder (specially kernel image file inside it)- not sbin folder. After this step, the twrp became 15.1 MB !
- Because of the previous step, a bug came where the cursor was always showing on the middle of the screen even though I was not using mouse via OTG. So I replaced cursor.png with a completely transparent image. So now, the cursor is hidden. And also you won't see cursor while using mouse. But no one need that, as touchscreen is fixed.
- Replaced files inside /ramdisk/twres/ with the files I got by extracting flashable zip of SHADOW"S BLACK THEME. We had a useless font that took almost 4 MB in our old TWRP. After doing the step, got the same font in 100 kb. But the overall file size increased because of new images in /ramdisk/twres/images folder. These images makes the recovery look better. After all, the size became 15.4 mb.
The steps look pretty much easier. But I had to suffer 3 days to discover them. I can briefly say that I ported a 32 bit twrp, used sbin from 8 TWRPs, tried to port 64 bit, removed languages and fonts, removed files from sbin folder, repacked & booted image every time after making every single changes, compressed images using online tools and many more !
I shared all these in case anyone finds them useful.
- Adb push / pull (Sideload works though)
NB. Use adb version (boot only) to use adb features like push/pull & inbuilt terminal.
MTP works fine. If you aren't able to use mtp & adb (in adb version), the problem is related to drivers. Here is the fix for windows (Sorry for linux / mac)-
1. Download Drivers.zip.
2. While in twrp, connect it with computer.
3. Go to device manager & uninstall devices related to adb - mtp. Adb device can be under "universal serial bus devices".
4. Disconnect the mobile.
5. In Device Manager, click on view & select "show hidden devices".
6. Again, Uninstall all drivers/devices related to adb - mtp.
7. Re-connect the mobile.
If windows doesn't install the drivers / the installed driver doesn't work, uninstall those and install working drivers manually-
How to install the drivers?
Install automatically- Run the exe file
Install manually (Recommended) - Device manager > Right click on the device > Update driver > Browse my computer >Let me pick > Have disk > Browse > Select the appropiate .inf file provided in each folder.
If you can't see mtp device under portable devices, try running the mtp driver exe file & reconnecting. However, adb fix is guaranteed. Good luck for MTP!
adb version (boot only) - Drive / Mega
v2.1- Drive / Mega
v2.1 (stock)- Drive / Mega
v2- Drive / Mega
v1- Drive / Mega
Drivers.zip- Drive / Mega
Disable dm verity force encrypt
Credits & Links