[Guide]Modify stock rom and delete bootloader with Knox for Galaxy S4 Mini

SilviuMik

Senior Member
Nov 17, 2011
1,494
1,511
0
Quick and dirty guide on how-to delete bootloader stuff that contain Knox from stock rom ( only works on Jelly Bean ) . On KitKat we have Knox 2.0 which is more harder to conquer :)
Only use it if u do not have KNOX WARRANTY in download mode
U need : a virtual machine or any linux environment . I use Vmware player + Linux Mint 16 x64
First download the rom from Sammobile and place it on your Desktop in a folder called work in linux
Let`s say we download Russia one for I9192
I9192XXUBMK4_I9192SERBMJ3_SER.zip
U can use this guide on other versions of this phone I9190/I9195
Firmwares that contain MK4/MK5/ML1/ML2/ML4/NA1/NA2 and so on from here have Knox bootloader inside
Only the name will be different but what is inside is the same
Only latest versions of firmware contain Knox Bootloader ( usually the ones released in late november/december 2013 )
Open terminal and type
Code:
cd Desktop
cd work
Now we need to extract it
Code:
unzip *.zip
U will get 2 files
First: I9192XXUBMK4_I9192SERBMJ3_I9192XXUBMK4_HOME.tar.md5
Second: SS_DL.dll
Now again in terminal type:
Code:
rm -rf SS_DL.dll
tar -xvf *.tar.md5
After it will finish to extract we can delete the files we do not need
Code:
rm -rf aboot.mbn - bootloader ( knox included )
rm -rf sbl1.mbn - part of bootloader
rm -rf sbl2.mbn - part of bootloader
rm -rf sbl3.mbn - part of bootloader
rm -rf *.tar.md5
Now we can place it back in an archive. Choose any name u want i had chosen original name for reference only.
Code:
tar -H ustar -c rpm.mbn tz.mbn boot.img recovery.img system.img.ext4 NON-HLOS.bin cache.img.ext4 hidden.img.ext4 > I9192XXUBMK4_I9192SERBMJ3_I9192XXUBMK4_HOME.tar
After comes md5 stuff
Code:
md5sum -t I9192XXUBMK4_I9192SERBMJ3_I9192XXUBMK4_HOME.tar >> I9192XXUBMK4_I9192SERBMJ3_I9192XXUBMK4_HOME.tar
mv I9192XXUBMK4_I9192SERBMJ3_I9192XXUBMK4_HOME.tar I9192XXUBMK4_I9192SERBMJ3_I9192XXUBMK4_HOME.tar.md5
Now transfer it to your windows pc and flash it with Odin :) Make sure u do not rename the file at this stage or md5 checksum will fail
Double check it before u flash, look inside the archive that u don`t have those files u just deleted :) Maybe u did not move the correct file :)

Video of "How to" credit to @Mitko
 
Last edited:

hobbya

Senior Member
Aug 28, 2013
54
15
0
Quick and dirty guide on how-to delete bootloader stuff that contain Knox from stock rom
Only use it if u do not have KNOX WARRANTY in download mode
U need : a virtual machine or any linux environment . I use Vmware player + Linux Mint 16 x64
First download the rom from Sammobile and place it on your Desktop in a folder called work in linux
Let`s say we download Russia one
I9192XXUBMK4_I9192SERBMJ3_SER.zip
Open terminal and type
Code:
cd Desktop
cd work
Now we need to extract it
Code:
unzip I9192XXUBMK4_I9192SERBMJ3_SER.zip
U will get 2 files
First: I9192XXUBMK4_I9192SERBMJ3_I9192XXUBMK4_HOME.tar.md5
Second: SS_DL.dll
Now again in terminal type:
Code:
rm -rf SS_DL.dll
tar -xvf I9192XXUBMK4_I9192SERBMJ3_I9192XXUBMK4_HOME.tar.md5
After it will finish to extract we can delete the files we do not need
Code:
rm -rf aboot.mbn
rm -rf sbl1.mbn
rm -rf sbl2.mbn
rm -rf sbl3.mbn
rm -rf I9192XXUBMK4_I9192SERBMJ3_I9192XXUBMK4_HOME.tar.md5
Now we can place it back in an archive. Choose any name u want i had chosen original name for reference only.
Code:
tar -H ustar -c rpm.mbn tz.mbn boot.img recovery.img system.img.ext4 NON-HLOS.bin cache.img.ext4 hidden.img.ext4 > I9192XXUBMK4_I9192SERBMJ3_I9192XXUBMK4_HOME.tar
After comes md5 stuff
Code:
md5sum -t I9192XXUBMK4_I9192SERBMJ3_I9192XXUBMK4_HOME.tar >> I9192XXUBMK4_I9192SERBMJ3_I9192XXUBMK4_HOME.tar
mv I9192XXUBMK4_I9192SERBMJ3_I9192XXUBMK4_HOME.tar I9192XXUBMK4_I9192SERBMJ3_I9192XXUBMK4_HOME.tar.md5
Now transfer it to your windows pc and flash it with Odin :) Make sure u do not rename the file at this stage or md5 checksum will fail
Double check it before u flash, look inside the archive that u don`t have those files u just deleted :) Maybe u did not move the correct file :)
Is this BMK4 firmware different from previous versions by introducing Knox and improvement of battery? Can we transfer the rpm bootloader to previous version and enjoy the battery consumption improvement?
 

SilviuMik

Senior Member
Nov 17, 2011
1,494
1,511
0
Is this BMK4 firmware different from previous versions by introducing Knox and improvement of battery? Can we transfer the rpm bootloader to previous version and enjoy the battery consumption improvement?
I think u can yes :) But i also think some improvements were made in Modem/Kernel
That rpm.mbn file gets flashed in a special partition and does not get overwritten only if u flash a new one from a firmware that contain it. As i mentioned in other forum only last ones does contain it Russia, Brazil, Trinidad MK4
 

Trepanator56

Senior Member
Feb 17, 2008
108
23
48
allows downgrade?

Once flashed this firmware without knox, would can move back to a previous version?

I ask that flashing the stock rom of samsung knox is no longer possible downgrade.

Thanks and regards,
 

SilviuMik

Senior Member
Nov 17, 2011
1,494
1,511
0
Once flashed this firmware without knox, would can move back to a previous version?

I ask that flashing the stock rom of samsung knox is no longer possible downgrade.

Thanks and regards,
Yes u can downgrade as long as u don`t flash new bootloader
Use the tutorial and remove the files from stock rom before flashing. If u already have the new bootloader on phone u are out of luck :p
 

Dijinn

Senior Member
Feb 19, 2008
106
44
0
33
São Paulo
Yes u can downgrade as long as u don`t flash new bootloader
Use the tutorial and remove the files from stock rom before flashing. If u already have the new bootloader on phone u are out of luck :p
One question, I flashed the stock thing via Heimdall and my wi-fi is not working. I think it didn't flash the tz.bin, since I saw you say on other thread that it was important for wifi to work in Brazil...

Is there anyway to fix it? Or I got myself screwed?
 

SilviuMik

Senior Member
Nov 17, 2011
1,494
1,511
0
One question, I flashed the stock thing via Heimdall and my wi-fi is not working. I think it didn't flash the tz.bin, since I saw you say on other thread that it was important for wifi to work in Brazil...

Is there anyway to fix it? Or I got myself screwed?
Flash it with Odin that tz file and u are good to go :)
Same procedure as making an kernel from stock or modem
tar -H ustar -c tz.mbn > name.tar
md5sum -t name.tar >> name.tar
mv name.tar name.tar.md5
 

Dijinn

Senior Member
Feb 19, 2008
106
44
0
33
São Paulo
Flash it with Odin that tz file and u are good to go :)
Same procedure as making an kernel from stock or modem
tar -H ustar -c tz.mbn > name.tar
md5sum -t name.tar >> name.tar
mv name.tar name.tar.md5
Well, we got another problem... Here... I'm on a MAC right now, so my only flashing thingy is Heimdall or ADB...

I tried flashing the tz.mbn file 3 times via Heimdall, it doesn't even open the recovery after I flash it... And wi-fi is never back...

I got ur version of the files and flashed everything again, still, no wi-fi, probably because of the tz.mbn

The funny thing is that Heimdall himself says the file was uploaded to the phone, but it seems it's not "installing" it if u understand what I mean...
 

SilviuMik

Senior Member
Nov 17, 2011
1,494
1,511
0
Well, we got another problem... Here... I'm on a MAC right now, so my only flashing thingy is Heimdall or ADB...

I tried flashing the tz.mbn file 3 times via Heimdall, it doesn't even open the recovery after I flash it... And wi-fi is never back...

I got ur version of the files and flashed everything again, still, no wi-fi, probably because of the tz.mbn

The funny thing is that Heimdall himself says the file was uploaded to the phone, but it seems it's not "installing" it if u understand what I mean...
Sorry mate then :( flash an older file that does not contain Knox Hope u get your Wifi back :(
 

Dijinn

Senior Member
Feb 19, 2008
106
44
0
33
São Paulo
Sorry mate then :( flash an older file that does not contain Knox Hope u get your Wifi back :(
I solved the problem!

If someone else has trouble fixing the Wi-Fi after the flash via Heimdall, here goes!

Flashing TZ partition only won't do anything...you upload the file, but it doesn't seem to get flashed...

The solution is to flash both MODEM and TZ partitions... It seems that when you reflash the modem, the cellphone tends to check for TZ again and TADA! Now it will be there!
 

SilviuMik

Senior Member
Nov 17, 2011
1,494
1,511
0
Apparently the contents of S4 (I9505) is same ... I made the change with Ubuntu, it does.

Before to flash, I would like to be sure.
Think it should do as correctly as your model?
I have no ideea about S4 :( Maybe knox is in other places too like modem or no ideea. I can`t guarantee. On S4 mini is in aboot.mbn sbl1 sbl2 sbl3 ( bootloader )
 

SilviuMik

Senior Member
Nov 17, 2011
1,494
1,511
0
Thanks for answer! ;)

So, that's the reason you removed the modem.bin file?

What is the risk to try? Except to have the new bootloader.
I did not remove modem file :)
modem is named NON-HLOS.bin i keep it :)
If u have old bootloader ( no knox in download mode ) yes risk is to get new bootloader with knox
Pls check on S4 forums maybe someone did the same as me with S4 and knows more :)
 

franzyroy

Senior Member
Aug 23, 2010
7,924
5,015
0
Normandy
forum.xda-developers.com
I did not remove modem file :)
modem is named NON-HLOS.bin i keep it :)
If u have old bootloader ( no knox in download mode ) yes risk is to get new bootloader with knox
Pls check on S4 forums maybe someone did the same as me with S4 and knows more :)
On the S4 (I9505), I also have NON-HLOS.bin, but I also have modem.bin file.

Not seen on the S4 forums a subject on that!

---------- Post added at 03:17 PM ---------- Previous post was at 03:15 PM ----------

If u have old bootloader ( no knox in download mode ) yes risk is to get new bootloader with knox
Except this risk... This one, I'll have it certainly with the SAV!! :(

---------- Post added at 03:21 PM ---------- Previous post was at 03:17 PM ----------

Otherwise, I followed your tuto and like I didn't see the modem.bin file, I removed it. At worse, I could flash it after.
 

SilviuMik

Senior Member
Nov 17, 2011
1,494
1,511
0
On the S4 (I9505), I also have NON-HLOS.bin, but I also have modem.bin file.

Not seen on the S4 forums a subject on that!

---------- Post added at 03:17 PM ---------- Previous post was at 03:15 PM ----------



Except this risk... This one, I'll have it certainly with the SAV!! :(

---------- Post added at 03:21 PM ---------- Previous post was at 03:17 PM ----------

Otherwise, I followed your tuto and like I didn't see the modem.bin file, I removed it. At worse, I could flash it after.
Yes of course , better to try then flash all the files and see after :)
Btw, S4 Mini Knox firmware contains:
sbl1.mbn - part of new bootloader , safe to delete
sbl2.mbn - part of new bootloader , safe to delete
sbl3.mbn - part of new bootloader , safe to delete
aboot.mbn - New Knox bootloader , DELETE
rpm.mbn - Resource power Management link
tz.mbn - Trusted zone ( Wifi won`t work if u don`t flash it together with new Modem )
boot.img - Kernel
recovery.img - Recovery/Download mode
system.img.ext4 - your apps/framework/android
NON-HLOS.bin - modem
cache.img.ext4 - CSC / APN settins / What bloat is to be installed depending on zone / carrier
hidden.img.ext4 - Another "system" part of apps that are too big for /system ( for now almost empty ) on S2 was full of apps

Try and see :)