Open Forage opened 7 years ago
We thought of that, but unfortunately, never found a way how to check if TWRP is installed.
If you/anyone else knows a way, feel free to comment how it works :)
Mhm, assuming a TWRP user has also root installed I would traverse /dev/block/platform/*/by-name and grep for "recovery" so we get the recovery partition path.
Then copy (dd) that partition to a temporary folder, unpack the image and examine the ramdisk. A good indicator is the "twres" folder which is only available in TWRP. This should be sufficient to determine it I think :)
Also you could just ask the user, lolz.
How about the recovery log? They seems to be output the last recovery used. And also the version.
@Rendyindo Thanks for your tip! Indeed, we already considered that :)
check for /cache/recovery/last_log
Or check, is a .twrp config file on internal or external Storage in the TWRP folder available. TWRP is so mostly installed.
If possible, it might be good to check if TWRP is actually installed as a boot manager. If not, the install button will do nothing but kick you to the recovery (stock, CM, etc).
If it's not TWRP that's installed, either refuse to install if it's not possible with the current recovery or tell people to do it manually. If TWRP is install, tell people the installation will be automagically started.