[Verizon Samsung Galaxy S 4] HowardZ:
THIS IS MY FIRST THREAD IN A DEVELOPMENT SECTION - forgive me if I do something wrong, or if the subject has already been discussed.

It took me a while to figure this out, and I hope it helps others.

I SHALL DESCRIBE HOW TO LOKI ANY recovery.img FOR USE ON VERIZON SAMSUNG GALAXY S4 MDK PHONE.

Clockworkmod posts new recovery img files for our phone here:

http://www.clockworkmod.com/rommanager

However these recovery image files are not LOKI patched yet.

First one must create an aboot.img file from the phone.

This is something which must be run on the rooted phone.

It is basically two lines:

dd if=/dev/block/platform/msm_sdcc.1/by-name/aboot of=/data/local/tmp/aboot.img

chmod 644 /data/local/tmp/aboot.im

Then once the aboot.img file has been created, it needs to be copied up to your Ubuntu-Linux PC.

One needs the "loki_patch-lilnux-x86_64" executable file available from the github:

https://github.com/djrbliss/loki

Then the command to read a recovery.img file and create a loki version is:

./loki_patch-linux-x86_64 recovery aboot.img recovery.img recovery_loki.img

The following is a shell file for performing the above work with ample comments about the procedure:

# run_getAboot.sh

# Purpose: create a aboot.img file on the Verizon S4 phone

# to then be copied back to the linux PC

# so a kernel or recovery can be loki patched.

#

# This shell file must be:

# Copied to the Verizon S4 into folder /data/local/tmp

# for example from linux pc : adb push run_getAboot.sh /data/local/tmp

# Give it executable priviledges - I did this using ES File Explorer

# Run it from "Terminal Emulator"

# su

# ./run_getAboot.sh

#

#

dd if=/dev/block/platform/msm_sdcc.1/by-name/aboot of=/data/local/tmp/aboot.img

chmod 644 /data/local/tmp/aboot.im

#

# After this, the aboot.img file should be copied back to the linux pc

# for example from linux pc: adb pull /data/local/tmp/aboot.img aboot.img

# One then gets the loki_patch-linux-x86_64 file from the loki-doki github

# The github is located here: https://github.com/djrbliss/loki

# look under the "bin" folder.

# Now a recovery can be loki-doki modified.

# We now have the aboot.img created from the Verizon S4 phone,

# and we have a recovery.img which needs to be loki modified.

# The following command will create the recovery_loki.img file:

# ./loki_patch-linux-x86_64 recovery aboot.img recovery.img recovery_loki.img

#

# The recovery_loki.img file can be installed on the Verizon S4 phone.

#

Now, I also wanted to make a ZIP file which a custom recovery can run to LOKI and install a non-loki recovery.img file.

The LOKI operation will be performed while the ZIP file is being installed.

I used the following loki-doki.zip file as an example found here:

http://rootzwiki.com/topic/41841-lo...tom-boot-image-on-att-and-verizon-galaxy-s-4/

I added CWM touch version 6.0.4.4 recovery.img file, and modified the script to LOKI the recovery.img file rather than the currently installed kernel/boot.

Here is my completed sample zip file: https://db.tt/xLi6c4dd

When a new version of a recovery becomes available, one just renames it recovery.img and replaces the recovery.img file which is in the zip file. Then one can flash to the new version of the recovery.

The script in this zip file will only work on I337UCUAMDB, I337UCUAMDL, and I545VRUAMDK bootloaders.

Credits to: attn1 at rootzwiki for the ZIP file which I modified.

and of course to drjbliss's LOKI github https://github.com/djrbliss/loki