Tuesday, December 30, 2014

Rooting Samsung Galaxy S5 and maintaining KNOX 0x0

I am not responsible for anything that may happen or does happen to your device, as a result of following this tutorial. You are choosing to install this yourself and thus accept any/all risks involved.

What is KNOX

http://www.samsung.com/pl/business/solutions-services/mobile-solutions/security/samsung-knox

In my opinion KNOX has noble goal and the platform itself is helpful for businesses and IT admins.

Sadly current hardware solution comes down to setting flag 0-1, the flag which can be changed only once. In case of unauthorized changes in system it is marked as 0x1 and KNOX platform stops functioning. Still, I can agree with this.

After buying Samsung Galaxy S5 I've come to know about possibility that devices with KNOX flag ``0x1`` will not be fixed by Samsung. So when you flash CyanogenMod (to be precise - during flashing) we can bid farewell to our warranty.

Tripping KNOX 0x1

To my knowledge the bootloader manages KNOX flag (in PC world it would be LILO, GRUP, NTDLR - the program which answers question what to do to start a system.)

In this context Download mode is ran by bootloader too.

Bootloader KNOX checks whatever kernel and recovery (and possibly bootloader itself) are valid. If not - the 0x1 bit is set. There is no possibility to flash custom recovery or kernela, even from download mode.

Help

Without flashing custom recovery there is no possibility for rooting a device. Happily for Samsung Galaxy S5 owners kernel used in stock Roms has a loophole, you could call it a bug even :) Thanks to towelroot and with using accordingly old firmware you still have a way to root your device!

towelroot homepage: https://towelroot.com/

Let's begin

Install towelroot and try to root your device. Next, if you now have:

Device without root

You can find original tutorial at http://forum.xda-developers.com/galaxy-s5/development/rom-neatrom-v1-t2828562

We start at Installation Instructions: If you're coming from a Samsung stock NON-Rooted NG2/NG7/NG9/NH4/NH6/NJ1 ROM (KNOX 0x0). It describes how to flash older firmware which suffers from bug used by towelroot.

Available firmwares: http://samsung-updates.com/device/?id=SM-G900F

In this example I've used G900FXXU1ANCE_G900FXEO1ANC7_G900FXXU1ANCE_HOME.tar.md5, after flashing you can root device with towelroot.

Go to Rooted device below.

Rooted device

Reboot and install SuperSu, after starting it confirm disabling KNOX.

You will have to buy Mobile Odin Pro, it allows to flash firmware in zip form easily without tripping KNOX.

For flashing I've choosen: http://forum.xda-developers.com/galaxy-s5/development/rom-ane4-kitkat-4-4-2-multi-csc-t2813628

Flashing zip file comes down to finding it in Mobile Odin Pro through OTA/Update ZIP. Remember to read installation steps for your choosen ROM, in my case you need to untick Everroot option.

Push Flash Firmware".

After reboot and at the end of system installation, untick Reboot Device. You should be soon in Download Mode.

Firmware update

If your bootloader or modem needs an update you can do it from Download Mode.

Install PC Odin, connect phone in download mode to the PC. Modem add as CP, bootloader as BL. Flash choosen files.

At this moment available were:

  • BL_G900FXXU1ANK7.tar.md5

  • CP_G900FXXU1ANK1.tar.md5

Flashed system was based on ANK7 version so I can assure that flashing bit older CP doesn't change anything.

Finishing

Go to Settings/Security:

  • untick Reactivation lock

  • untick Send security reports

Go to Security policy updates and untick Automatic updates.

The End, you have now a rooted device :)

Removing unnecessary apps

To remove applications listed below I've used System App Remover by Jumobile.

  • Software Update

  • ANT HAL Service

  • ANT Radio Service

  • ANT+ Plugins

  • Application Kontyngent SCloud

  • Beaming Service

  • BlurbCheckout

  • Addon for Samsung Print Services

  • FWUpdate

  • HealthService

  • Samsung Account

  • Additional Module HP Print Service

  • Samsung Settlements

  • S Search

  • S Calendar (12MB)

  • S Calendar (908KB)

  • S Voice

  • Samsung Apps

  • Samsung Celandar SyncAdapter

  • Samsung Cloud Data Relay

  • Samsung Contact SyncAdapter

  • Samsung Galaxy

  • Samsung GALAXY Apps Widget

  • Samsung Link Platform Connectivity

  • Samsung Memo SyncAdapter

  • Samsung Push Service

  • Samsung SBrowser SyncAdapter

  • Samsung SNote3 SyncAdapter

  • Samsung Syncadapters