[AT&T Samsung Galaxy S 4 General] Aou:
Notice (4/16/14): I'm no longer here. I've said "goodbye" to AT&T and their locked bootloader schemes. I'm voting with my wallet - I've sold my I337 and switched to T-Mobile. My apologies to the community, but you're now on your own here.

"I337UCUAMF3 Unadulterated"

This rom is a 100% pure, untouched copy of the System and Kernel that came with the MF3 OTA update. The first question that many will have is, "Why did you release this - why wouldn't I just use <insert name here>'s stock rom?" It's simple: every other rom in this forum (at this time) has been modified from the original stock rom - whether they've added root, de-odexed it, debloated it, or otherwise. Because the Unadulterated rom is 100% stock (with stock kernel), it is possible for other developers to flash this rom and use it as a platform for attempting to find a root method for the MF3 users out there already. Plus, I like to make my own modifications from a stock base. ;)

UPDATE (8-1-13): a root method has been found for MF3. See thread

here

. This ROM's purpose has been fulfilled, but your are still welcome to use it, of course!

UPDATE: The MF3 Odin files have been uploaded by [MENTION=5512958]Shockndrop[/MENTION] over in his thread

here

. Remember that the Odin files will flash your bootloader to MF3 (if you allow them), so be careful out there. ;)

Rest assured, this rom will not update your bootloaders, it will not break your custom recovery, and it won't flash your modems. Like most roms, it will simply replace your /system and flash a Kernel. It's also scripted to wipe cache and dalvik for you. It will not wipe your /data partition - you might want to do so if you run into problems, especially when coming from other roms.

Next, you might ask, "How can you say this is 100% stock? How did you construct it?" I'll hide nothing from you - you can build it yourself if you'd like. Here's how I did it:

Rooted with motochopper

Installed TWRP 2.6.0.0

Wiped data & cache

Odin to MDL stock

Allow one full reboot:

Boot script runs (installs CSC - this is REQUIRED for the MF3 update to patch correctly)

Clears up any SysScope flags, etc. that may have persisted from previous rom or root.

"Temporary Root" using motochopper:

adb shell chmod 755 /data/local/tmp/pwn
adb shell /data/local/tmp/pwn
adb shell rm /data/local/tmp/pwn

NOTE: Possible outcomes of temporary root:

Failure

Success, motochopper exploit hangs, device spontaneously reboots

Success, immediate return to prompt, but adb shell is still not root (indicated by $ prompt)

Success, immediate return to prompt, adb shell is root (indicated by # prompt)

Repeat as needed (usually only twice or so?)

NOTE: Don't both trying to run su. It isn't installed. We're just relying on motochopper to give us a temporary adb root shell.

From adb root shell, installed TWRP recovery:

dd if=/sdcard/openrecovery-twrp-2.6.0.0-jflteatt.img of=/dev/block/mmcblk0p21

Rebooted, checked to be sure system status is still Official. Note that at this point, we've got a 100% stock MDL rom, without root, but with a custom recovery. Woot.

Rebooted into TWRP, installed custom-neutered OTA update (mf3-sys-only.zip), which only does the following:

Verifies all system files

Removes "unneeded" files (as determined by AT&T, not me)

Patches files

Copies new files

Sets permissions

Patches build.prop

Wiped data & cache for good measure

Booted phone, verified ROM works okay, system status = official. Rebooted, checked Odin Mode:

CURRENT BINARY: Samsung Official
SYSTEM STATUS: Official

Booted back to TWRP to begin pulling dumps

... Now, on to the good stuff!

ROM Install Instructions:

Important Recommendation:

You are advised to disable the OTA update applications! If AT&T/Samsung release a new OTA update (beyond MF3), it is theoretically possible to download and install it while using this rom! Accepting such an update could do just as much damage as the original MF3 update did. You can easily disable OTA updates from a root ADB shell using the following commands:

pm disable com.wssyncmldm
pm disable com.LocalFota
pm disable com.sec.android.fwupgrade

You could also use Titanium Backup Pro to accomplish the same thing. I will later look into the possibility of disabling these using a flashable Add-on zip that otherwise keeps your system as stock as possible.

Known Bugs:

If you do not flash a custom kernel, you will lose WiFi. The WiFi in the MF3 Kernel is expecting the MF3 bootloaders, which we aren't flashing. Therefore it breaks.

If you happen to have the MF3 modem/baseband installed, your WiFi might work, but your sound may stop working completely. This is also a result of not having MF3 bootloaders. A custom Kernel should fix this too.

If you use the "remove-SysScope" Add-on, be careful of any other mods that may poke around with SecSettings.apk - these are rare, but there's some risk of conflict here.

With the custom kernel I installed, I frequently received the "The device has detected an application attempting..." message. This can be pinpointed to the KNOX agent, and can be fixed a different ways (your choice!):

I found this post to be very helpful.

You can also try using the command pm disable com.sec.knox.seandroid from a root ADB shell. This just freezes the app. Personally, I used this method.

[MENTION=2471504]jeboo[/mention] also mentioned that the KNOXAgent.apk can be patched using smali/baksmali. Check out his post about it.

Also with the kernel I installed, there was a bug regarding updating the camera firmware. I was forced to restore the stock kernel temporarily, open the camera app to update the camera firmware, and then re-flash the custom kernel. The original MF3 kernel is included in the Add-ons.

Any other bugs are likely straight from AT&T/Samsung, otherwise they could be from your custom kernel, if you flashed one.

Be sure to make good backups of everything, and be prepared to use Odin back to stock. One member has reported that after flashing away from this rom to any other rom/kernel, their SIM card would not work until they used Odin to return to stock. After Odin, it worked fine.

It seems most custom kernels are expecting you to have an MDL baseband. Some people are reporting strange issues (such as problems with video streaming) when using MF3 modems and their choice of custom kernels. Check out File #11 for various modems, NON-HLOS modems, and kernels.

Custom Kernels:

Here's a list of custom kernels that are known-working with this rom. Please feel free to test and report other working kernels, and I will gladly add them to the list!

[MENTION=2471504]jeboo[/mention]'s Kernel - built for [MENTION=1670609]shoman94[/MENTION]'s SHOstock rom. Available in post #3 of their thread.

[MENTION=1823993]Jamison904[/mention]'s Bioshock Kernel - available on the Infamous Development Website. This kernel is working great for me - no issues to report at this time. It also includes BusyBox v1.19.3, which was particularly useful for me. It appears that the kernels in their thread require Loki-Doki to be flashed after flashing the kernels. However, the one that I downloaded came from here: http://d-h.st/WVs and it was pre-patched for the I337.

[MENTION=1823993]Jamison904[/mention]'s Infamous Kernel works really well, it seems. It also has BusyBox v1.19.3. I'm currently using v4.0, but there are newer versions available on his Dev-Host folder. These are for the M919, so flash Loki-Doki afterwards if you're on I337!

Downloads:

I've provided the rom in several different formats. When I last tested the odin-flashable tarballs, they did not work for me (due to signatures, etc). However, I'm still providing these for a few XDA members who will be testing them out on their semi-bricked devices. Additionally, someone might be able to get these signed somehow, and I'll leave this hanging out there as an invitation. ;)

File #1 - mf3-stock-rom.zip - CWM/TWRP-Flashable ROM .zip file - created by hand (you are welcome to dissect it if you'd like - take a look inside the updater-script)

Files #2-#7 (individual image files and odin-flashables):

File #2 - system.img.ext4 - EXT4 format copy of the System partition - pulled using make_ext4fs in TWRP:

Used fdisk to obtain partition size:

# fdisk -l /dev/block/mmcblk0p16

Disk /dev/block/mmcblk0p16: 2894 MB, 2894069760 bytes
4 heads, 16 sectors/track, 88320 cylinders
Units = cylinders of 64 * 512 = 32768 bytes

Disk /dev/block/mmcblk0p16 doesn't contain a valid partition table

Dumped the partition:

# make_ext4fs -s -l 2894069760 -a system /sdcard/system.img.ext4 /system
Creating filesystem with parameters:
Size: 2894069760
Block size: 4096
Blocks per group: 32768
Inodes per group: 8032
Inode size: 256
Journal blocks: 11040
Label:
Blocks: 706560
Block groups: 22
Reserved block group size: 175
Created filesystem with 3192/176704 inodes and 584765/706560 blocks

File #3 - system.img - Binary copy of the System Partition - pulled using dd:

This was much easier to create:

# dd if=/dev/block/mmcblk0p16 of=/sdcard/system.img bs=4096

File #4 - boot.img - Kernel - pulled from the OTA update file

File #5 - mf3-sys-boot.tar.md5 - "Odin-flashable" tarball - created without any modification:

Using a Linux PC or Cygwin, executed the following:

$ tar -H ustar -c system.img.ext4 boot.img > mf3-sys-boot.tar
$ md5sum -t mf3-sys-boot.tar >> mf3-sys-boot.tar
$ mv mf3-sys-boot.tar mf3-sys-boot.tar.md5

File #6 - mf3-sys-boot-sgs4ext4fs.tar.md5 - "Odin-flashable" tarball - "bloated" with Chainfire's sgs4ext4fs

Using a Linux PC (I used Ubuntu 13.04 64bit - couldn't get the win32 version to process the file entirely):

$ mv ./sgs4ext4fs.linux.amd64 ./sgs4ext4fs
$ sudo chmod 755 ./sgs4ext4fs
$ mv system.img.ext4 system.img.ext4.orig
$ ./sgs4ext4fs --bloat system.img.ext4.orig system.img.ext4

Optionally, you can use the "--list" option to view the file before and after the bloating. Once complete, pack it up in a tarball again.

File #7 - mf3-factoryfs.tar.md5 - "Odin-flashable" tarball - created using the system.img instead:

Using a Linux PC or Cygwin, executed the following:

$ mv system.img factoryfs.img
$ tar -H ustar -c factoryfs.img boot.img > mf3-factoryfs.tar
$ md5sum -t mf3-factoryfs.tar >> mf3-factoryfs.tar
$ mv mf3-factoryfs.tar mf3-factoryfs.tar.md5

Files #8-#11 (Add-ons!):

File #8 - UPDATE-SuperSU-v1.41.zip - ROOT! Flash this to root your new MF3 rom!

Original is found on Chainfire's website.

File #9 - remove-SysScope.zip - Want to stay "Official", even though you rooted? Flash this! It will remove SysScope and customize your SecSettings.apk to not check for SysScope anymore. Must be flashed before first boot, otherwise you'll just be stuck with a "custom" status until you remove it by some other means.

File #10 - mf3-kernel-only.zip - Want to quickly flash back to the MF3 stock Kernel again? Flash this. No need to use Loki-Doki after flashing this - the I337 will accept this just fine and boot.

File #11 - all-kernel-modem-apnhlos.zip - My personal collection of flashable .zip's of all available versions of the stock kernel, stock modem, and stock NON-HLOS modem for the I337 - including MDB, MDL, MF3. Unzip this file first, and flash individual partitions/versions in whatever combination you want.

Disclaimers, etc.:

I have only tested this with my AT&T Galaxy S4 (I337). While you are welcome to try this with other devices, I can't guarantee anything!

You are free to use this ROM, whole or in part, as a base for any other rom, mod, or otherwise. I do not gain profit from this, and the original rom was of course made by AT&T and Samsung. All I'm providing is a way to install it safely and easily. If you do use this rom as a base, please mention my name in your credits/thanks (thank you!).

I cannot be held liable for any damage you do to your own devices due to not following instructions or cataclysmic events beyond my control. Like any other rom, you assume all risks by flashing it to your device.

If you appreciate my work, please use the THANKS button below to let me know!