Building a pre-rooted, de-knoxed stock ROM for S4 (i337m)

Will this work or will I royally #$%# my phone


  • Total voters
    26
Search This thread

copenhagen

Inactive Recognized Developer
May 21, 2005
2,115
1,866
inside the Grid
bumpage

so... how did this go? thread activity went dead as soon as you said "I have the goods" lol that's never good.
I have a i337m, actually I now have two lol. picked up from rogers s4 release day 1 (it was rooted same day as launch and a cm rom was released next day - thankyou steve k. et al)

despite my years of exp in this department I (un researched) flashed my baby to the newest samsung software ver via kies to take advantage of the latest radio software - with the expectation that after updating i would be flashing back to cm. HA! hahahahhaha. Dummy. After hours of looking for somehow/someone to fix what I had done, I tried all the suggestions bestbuy (yah.. not the canadian bustbuys...), samsungkiosk (noope, those dont exist in canada from what I can find) and the samsung store.. USELESS, even 3rd party vendors who make a living from "jail breaking, and rooting phones" couldnt do shyt... SO -- That phone is currently off to samsung via the only half decent "samsung approved service vendor" I could find -- Memory Express. Was straight up with them, this is what I wanted and did, this is the outcome, this is the resolution I need. Awaiting word of return from samsung. again.. dummy. /facepalm.

in the meantime I tracked down and used my hardware upgrade to get myself a second s4. wont be getting an s5 and if samsung keeps this bs knox business up I'm out from their brand which means no s6 - prob go to the source ;) cm itself. I refuse to be tied to amazing hardware with SH|+ oem softeware that has both "touch" and "wiz" as it's predominate selling feature. Tracking one down was a nightmare, i am willing to bet there is now at most a 5% chance of tracking down someone who has stock on NEW s4's with the original MDJ shipping firmware on them. TLDL i have a new s4 with mdj firmware, running cm11 nightlies one again. phewwwwwwwwwww!

anyways.. yah.... anyword on how your venture went? lol

p.s. gotta give props to Target. This was the first time I stepped foot in a target (supporting local is priority). They had the stock, they were fast and efficient, they even have by far the best replacement warranty i have ever seen. you pay once for year 2 coverage, if you don't use it, it rolls over to your new phone. crazy. plus .. rogers was having a promotion. pay $99 dollars for phone. get $75 dollars credit. plus a free pair of samsung level on headphones msrv $200. so.. good time to take advantage of the hardward upgrade lol.

k PEAACE!
 
Last edited:

The French Tickl3r

Senior Member
May 19, 2013
175
31
Montreal
so... how did this go? thread activity went dead as soon as you said "I have the goods" lol that's never good.
I have a i337m, actually I now have two lol. picked up from rogers s4 release day 1 (it was rooted same day as launch and a cm rom was released next day - thankyou steve k. et al)

despite my years of exp in this department I (un researched) flashed my baby to the newest samsung software ver via kies to take advantage of the latest radio software - with the expectation that after updating i would be flashing back to cm. HA! hahahahhaha. Dummy. After hours of looking for somehow/someone to fix what I had done, I tried all the suggestions bestbuy (yah.. not the canadian bustbuys...), samsungkiosk (noope, those dont exist in canada from what I can find) and the samsung store.. USELESS, even 3rd party vendors who make a living from "jail breaking, and rooting phones" couldnt do shyt... SO -- That phone is currently off to samsung via the only half decent "samsung approved service vendor" I could find -- Memory Express. Was straight up with them, this is what I wanted and did, this is the outcome, this is the resolution I need. Awaiting word of return from samsung. again.. dummy. /facepalm.

in the meantime I tracked down and used my hardware upgrade to get myself a second s4. wont be getting an s5 and if samsung keeps this bs knox business up I'm out from their brand which means no s6 - prob go to the source ;) cm itself. I refuse to be tied to amazing hardware with SH|+ oem softeware that has both "touch" and "wiz" as it's predominate selling feature. Tracking one down was a nightmare, i am willing to bet there is now at most a 5% chance of tracking down someone who has stock on NEW s4's with the original MDJ shipping firmware on them. TLDL i have a new s4 with mdj firmware, running cm11 nightlies one again. phewwwwwwwwwww!

anyways.. yah.... anyword on how your venture went? lol

p.s. gotta give props to Target. This was the first time I stepped foot in a target (supporting local is priority). They had the stock, they were fast and efficient, they even have by far the best replacement warranty i have ever seen. you pay once for year 2 coverage, if you don't use it, it rolls over to your new phone. crazy. plus .. rogers was having a promotion. pay $99 dollars for phone. get $75 dollars credit. plus a free pair of samsung level on headphones msrv $200. so.. good time to take advantage of the hardward upgrade lol.

k PEAACE!


hi copenhagen,

the build i had put together initially booted, but was glitchy and had a lot of FC, however, the build that @Adizzzle provided was much smoother.

I ended up soon thereafter selling my s4, got an s5, then sold it as well as I was not too impressed, so I got a OnePlus One and it is #@$#%@# awesome
 
  • Like
Reactions: copenhagen

copenhagen

Inactive Recognized Developer
May 21, 2005
2,115
1,866
inside the Grid
hi copenhagen,

the build i had put together initially booted, but was glitchy and had a lot of FC, however, the build that @Adizzzle provided was much smoother.

I ended up soon thereafter selling my s4, got an s5, then sold it as well as I was not too impressed, so I got a OnePlus One and it is #@$#%@# awesome

As I suspected. Samsung is on the OUT ;) Cyanogen is IN! Glad you got and are happy with a OPO.. I'll probably ride out these (2) s4's for a bit, but see you soon in the cm hw camp.

Thanks for the reply. =D
 
  • Like
Reactions: Adizzzle

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    Hello XDA-san

    This is my first time working with cygwin and Android Kitchen and I wanted to make sure I didn't miss anything that will royally brick my s4. I have attached screenshots of my journey for reference.

    I started with the stock ROM from you know where, version 4.4.2 (i337MOYAFNC1) and proceeded to remove the KNOX bootloader (using instructions from SilviuMik). I skipped the last step where it is re-md5, to continue on to the kitchen..

    Using the de-knoxed tar file, I created a working folder for the ROM in the kitchen. It started unpacking, everthing went well. When i was prompted to choose if I wanted to extract the CSC, I said no.. because the DiskInternals Linux reader was giving me an error saying along the lines of cant read disk..

    From my working folder, I proceeded to root & busybox, all went well. I then deodexed both the system apps and framework, all went well.

    lastly, I made a build from the working folder. Selected all default options while doing so (see pictures) , signed the freshly minted rom and voila.

    :cowboy:
    3
    One caveat to this, and this mostly applies to Verizon and AT&T users, but if you have upgraded to KitKat and kept root using SuperSu's survival mode and your planning to test a rom using Safestrap, you better make sure that the su binary is in xbin and bin (.ext/.su) and that the Superuser.apk is in /system/app. Also make sure that the permissions are set correctly for su (chmod 06755 chown 0.0) and have busybox in the rom as well, or at least have busybox install in the updater-script and make sure everything symlinks correctly.

    The best thing to do when testing roms to avoid having to worry about losing root is to download Chainfire's SuperSu zip and flash it after you flash your rom you're testing (but before it reboots into the rom for the first time) the reason I even mention all of this is because currently we (Verizon and AT&T users) have no way to root a device thats taken a complete 4.4.2 OTA.

    Seriously? wow, thanks for mentioning, I can't believe what a pricks Verizon and AT&T are. Same count for Samsung that handles knox regulation in the USA (while not in other countries). In the USA you get pretty much screwed by the carriers and manufacturers the hard way.

    In The Netherlands (where I live) it's even illegal to sell smartphones that are not unlocked by default. and the only thing a carrier may do is adding a CSC (Consumer Software Customization) package. This should be in the USA as well!

    In the USA companies get to private / independent it seems. they should be regulated by national government rules. instead of making their own. (this keeps the crap like the problem you described away)

    But Samsung should be regulated as well, there is no chance that will happen (south-korea), and their phones will contain more and more backdoors / suspicious daemons / methods of screwing you and so on, because who checks it, no one. Oh yes only someone, the NSA that adds even more of this stuff, like a VPN Interceptor, which no one is waiting for as well.

    Anyways, life (or actually companies) is (are) a *****. Only strict regulation could solve this, but who still believes in regulation after seeing what the NSA all did, they broke like every single rule and forced companies to merge their crap (most likely, or a huge payment, but no single company actually likes that)
    - NSA 'was allowed' to break in all PC's because that where outside the USA. that just ridiculous but true
    - NSA applied their 'jizz' to all super famous apps like Facebook.

    Even though it sounds like I say USA is the culprit thats not true, The netherlands have BREIN, which is the anti piracy company.

    This asshole tim kuik has,

    a. destroyed the piratebay for the whole world (even though it's recuping soon)
    b. have done a million requests on removing uploaded movies (on newsgroups)

    I really went OT all the way at this reply xd but you get my point :good:

    The product gets made, then infected by the creator, then gets forced to merge nsa crap. after that it goes to the carrier which installs even more crap.

    there is not a single bit of freedom left
    2
    Hi broodplank1337, thhank you for your reply

    So would it be better to go into my newly minted zip file and hunt down the knox apks / dependencies? Or should I flash the ROM then use root browser to get rid of them?

    I found this list "

    Delete the files in the following files in this order.


    /system/app/KNOXAgent.apk
    /system/app/KNOXAgent.odex
    /system/app/KLMSAgent.apk
    /system/app/KLMSAgent.odex
    /system/app/KnoxAttestationAgent.apk
    /system/app/KnoxAttestationAgent.odex
    /system/app/KNOXStore.apk
    /system/app/KNOXStore.odex
    /system/app/ContainerAgent.apk
    /system/app/ContainerAgent.odex

    /system/lib/libknoxdrawglfunction.so

    /system/app/ContainerEventsRelayManager.apk
    /system/app/ContainerEventsRelayManager.odex
    /system/app/KNOXStub.apk <--- delete if you have, some will not


    Delete the following folders

    /system/containers
    /system/preloadedkiosk
    /system/preloadedsso

    /system/etc/secure_storage/com.sec.knox.store
    /data/data/com.sec.knox.seandroid
    /data/data/com.sec.knox.store
    /data/data/com.sec.knox.containeragent
    /data/data/com.samsung.android.walletmanager

    Oh I thought you were building an odin rom? zip you say?
    Anyways, just remove em from the system folder and test it's result. You can always test roms without damaging your device at any time, read: it's impossible for a ROM to brick a phone, the thing that can brick it is the kernel, but only if using a kernel from an other device or so.

    so don't be afraid to test it, if it doesn't work just continue your work. if it works, good joob ;)
    1
    If the repacking was successful there is not much to fear about.

    (You may want to lookup if there is any dependents (in the rom) by using the removed knox bootloader (atleast remove the knox apks I guess)

    the CSC is really nothing important:

    A common short code (CSC) is a short telephone number, usually consisting of five digits, that is used to address SMS and MMS messages from a cellular telephone. Common short codes may also be called mobile short codes or short numbers. Each common short code is designed to be unique to each operator.

    Just include the one from the stockrom. btw, I have successfully manually unpacked the CSC file a year ago or so with simg2img, it only contained crap (samsung only files for altering behavior in TW rom and bloatware), the hidden partition or preload partition may also contain unwanted crap btw

    So go ahead and flash it, your phone will not get bricked by this in any way.
    1
    Oh I thought you were building an odin rom? zip you say?
    Anyways, just remove em from the system folder and test it's result. You can always test roms without damaging your device at any time, read: it's impossible for a ROM to brick a phone, the thing that can brick it is the kernel, but only if using a kernel from an other device or so.

    so don't be afraid to test it, if it doesn't work just continue your work. if it works, good joob ;)

    One caveat to this, and this mostly applies to Verizon and AT&T users, but if you have upgraded to KitKat and kept root using SuperSu's survival mode and your planning to test a rom using Safestrap, you better make sure that the su binary is in xbin and bin (.ext/.su) and that the Superuser.apk is in /system/app. Also make sure that the permissions are set correctly for su (chmod 06755 chown 0.0) and have busybox in the rom as well, or at least have busybox install in the updater-script and make sure everything symlinks correctly.

    The best thing to do when testing roms to avoid having to worry about losing root is to download Chainfire's SuperSu zip and flash it after you flash your rom you're testing (but before it reboots into the rom for the first time) the reason I even mention all of this is because currently we (Verizon and AT&T users) have no way to root a device thats taken a complete 4.4.2 OTA.