Flash firmware using Mobile odin to keep root intact & counter untouched.
If you have device already rooted, you can use Mobile Odin to flash stock firmware to keep Root intact, as well flash counter will also remain untouched.
Here is example to flash leaked firmware LJ2 4.1.2
1.Download & extract ROM file and Copy to SD card.
2.Install Mobile Odin Pro
When you first time open Mobile Odin, it will ask to download required flasher file.
3.Open Mobile odin - select open file
4.Point to ROM file you have copied
5.It will fill up all available field automatically
6.select Ever root option and check mark 'Inject SuperSU' And Then Flash.
Device will reboot in special recovery and firmware will be flashed
After finishing flashing device will be reboot normally and you will have SuperSU installed and flash counter will remain untouched too.