[General Questions and Answers] Matt07211:
[MENTION=7690994]VolterPL[/MENTION] [MENTION=6027581]yy1[/MENTION]

So but this is gonna be an onslaught of questions and information, I would appreciate if you are able to work through this (READ EVERYTHING AT LEAST ONCE) and test/answer my questions.

Some info: When I was searching for info for how to use heimdall for yy1 because I never used it before, I happened to stumble upon a bit of info that I found interesting, and which may solve one of our problems.

In one of the comment sections a user mentioned that their recovery gets replaced each time with stock, a user replied mentioning that their is a script that runs at boot that replaces the recovery if its been tampered with e.g. TWRP, with a stock recovery. So with a bit of digging (ES File Explorer FTW!!) I happened to find the script mentioned in "/system/bin/install-recovery.sh" and the fix is to rename the file, therefore being unable to run at boot and therfore not replacing the custom recovery.

So I believe one (maybe all) of our problems with the recovery being unable to boot can be fixed as follows, would appreciate help/testing here.

Sidenote: I still plan to build a custom kernel, as I would like the ability to run in permissive mode if needed (also including running recovery in permissive mode as well) and adding custom governors as time progress.

Now time for the fix/instructions:

NOTE: I am not responsible for any damage to the phone, system, tripping KNOX, warranty or your insanity

1. Download Odin, I am using version v3.12.3 (sorry yy1, won't have a guide for Haimdell yet as on phone typing this out) and make sure to have ADB, Fastboot and Samsung drivers installed and backup any important files

2. Download newest SuperSu (yep we are gonna try rooting the phone) from this link: http://xdaforums.com/apps/supersu/2014-09-02-supersu-v2-05-t2868133/page1

and then put it on the root of the phones internal memory

3. Download the newest TWRP image for our device, which should be 3.0.2-0, link: https://dl.twrp.me/xcover3ltexx/ which should be in the .img.tar format

4. Would probably be best to enable USB Debugging and make sure you have everything backed up and have all files downloaded and Samsung drivers working before preceding any further. If you don't then you should fix that.

5. Launch Odin and boot device into download mode (Power, Volume Down and Home buttons at the same time, for a few seconds.), ensure that the phone is connected to the computer USB port

6. Check Odin and make sure the "added" message is displayed; also, the ID:COM field should now be turned yellow or blue â?? if not, reinstall USB drivers and retry the steps from above.

7. Click on the AP button and then load the TWRP recovery file from desktop. Then, make sure Re Partition and Auto Reboot fields are not checked. Make sure especially that the auto reboot is un-ticked, or this wont work properly as the install-recovery.sh would be able to work before we could get into the recovery at least once.

8. Click "Start" and once finished the â??passâ? message will be displayed; also the ID:COM field will be turned green â?? then you should unplug the USB cord and reboot your device into recovery mode (Reboot straight into recovery or you are gonna have to flash it all over again, due to the install-recovery.sh script)

9. Once in recovery, do a nandroid backup and then flash the SuperSu.zip and reboot

10. Verify that you have root and then download and install a file manager that allows you to modify the /system area, I suggest ES File Explorer and then navigate to "/system/bin/install-recovery.sh" and rename the "install-recovery.sh" to "install-recovery.sh.bak". On a side note, according to the TWRP page, if you boot into TWRP at least once it will patch the stock ROM to prevent this happening. So if TWRP has acctually done this then you probably wont need to modify this file, but try rebooting into recovery at least once after booting to the android OS to see if TWRP is their before modifying the file. If TWRP is their then you can skip the last step.

11. Now due to the "install-recovery.sh" script running at the most recent boot, we will have to re-flash the TWRP recovery once more as the current recovery has been reverted back to stock due to the script. So repeat the steps to flash TWRP one more time and verify that the recovery is persistent across reboots etc.

Outcomes:

- Should have a persistent recovery due to the disabling of "install-recovery.sh" script

- Should have Root on the phone

Stuff wanted to be completed in the future:

- IF this has actually worked, I would like feedback once completed the above steps stating if recovery is persistent across boots and can verify root access. If this worked I will write up a separate thread for rooting this phone and see if we can then get a section on XDA for this phone

- Recompiling the kernel to allow the changing of selinux modes between "enforcing" and "permissive", and as time progresses adding more CPU governors. I will be working to develop this myself so any help would be appreciated.

NOTES/Questions:

- Appreciate your input if this is successful

- If it still flashes the "recovery is not seandroid enforcing" and if the recovery still works in spite of that fact

- If you achieved root, please mention this

- Thank you for taking the time to read and test this if you do :)

- [MENTION=6027581]yy1[/MENTION] I will write a tutorial for using Heimdall depending on this success of rooting and twrp this phone

Sorry for the wall of text and good luck ;)