• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[GUIDE][RECOVERY+LOKI][D800] How to flash CWM 6.0.4.4 the right way with loki_tool

Search This thread

fatguy1121

Member
Jul 12, 2014
21
11
The following guide should work for all loki-locked bootloaders, but I can only confirm that it worked on my D800. The problem I was having, was that loki_flash has been replaced with loki_tools, and there arent any guides out for loki_tools.
The right way to flash CWM requires you to generate your own recovery.lok from the aboot.img, and recovery.img (CWM) which you need to use loki_tools for.

PREREQUISITES​
  1. Device must be rooted
  2. Device must be in Developer Mode
  3. USB Debugging turned ON
  4. Debugging RSA Signature must be accepted
  5. Download CWM HERE
  6. Download loki_tool HERE
  7. Download ADB HERE

STEP 1 (Getting Files)​

  • Follow this GUIDE to install ADB and FASTBOOT, once its complete, you will have adb installed to C:\adb
  • Download CWM, rename the file to 'recovery.img' (so its easier to work with) and move it to C:\adb
  • Download loki_tool and extract the file 'loki_tool' from the bin folder and place it in C:\adb

STEP 2 (Preparing for the Procedure)​

  • Plug in your phone to the computer
  • In Windows Explorer, navigate to C:\
  • Shift+Right Click on the 'adb' folder, select 'Open command window here'
  • Type "adb devices" you should see:
Code:
C:\adb>adb devices
List of devices attached
<devid>        device
If not, go back and turn on Develper Mode, USB Debugging, and accept the RSA Signature

STEP 3 (Flashing process)​
(note: I copied everything from the cmd prompt and edited it as a text file before thinking to post my procedure here, thats why it looks different)

In ADB type the following commands each step is commented out with what it does (someone could make it into a bat, but I'm too lazy.

Code:
// Sending recovery.img to device
C:\adb>adb push recovery.img /data/local/tmp/recovery.img
---------------
3456 KB/s (10510336 bytes in 2.969s)
---------------

// Sending loki_tool to device
C:\adb>adb push loki_tool /data/local/tmp/loki_tool
---------------
2777 KB/s (379248 bytes in 0.133s)
---------------

// entering Android Linux environment
C:\adb>adb shell

// sudo
[email protected]:/ $ su

// generating aboot.img
[email protected]:/ # dd if=/dev/block/platform/msm_sdcc.1/by-name/aboot of=/data/local/tmp/aboot.img
---------------
2048+0 records in
2048+0 records out
1048576 bytes transferred in 0.072 secs (14563555 bytes/sec)
---------------

// changing permissions on aboot.img
[email protected]:/ # chmod 644 /data/local/tmp/aboot.img

// exiting Android Linux environment
[email protected]:/ # exit
[email protected]:/ $ exit

// saving aboot.img locally in case you need it again.
C:\adb>adb pull /data/local/tmp/aboot.img
---------------
2992 KB/s (1048576 bytes in 0.342s)
---------------

// entering Android Linux environment
C:\adb>adb shell

// changing directory
[email protected]:/ $ cd /data/local/tmp

// ls should list the following 3 files, if not, you are missing them and need to push them, or generate another aboot.img
[email protected]:/data/local/tmp $ ls
---------------
aboot.img
loki_tool
recovery.img
---------------

// changing the permissions of the files so loki_tool can use them
[email protected]:/data/local/tmp $ chmod 755 /data/local/tmp/loki_tool
[email protected]:/data/local/tmp $ chmod 755 /data/local/tmp/recovery.img

// executing loki_tool to generate the recovery.lok file
[email protected]:/data/local/tmp $ ./loki_tool patch recovery aboot.img recovery.img recovery.lok
---------------
Loki tool v2.1
[+] Detected target AT&T LG G2 build D80010o
[+] Original kernel address: 00008000
[+] Original ramdisk address: 05000000
[+] Writing device tree.
[+] Output file written to recovery.lok
---------------

// exiting Android Linux environment
[email protected]:/data/local/tmp $ exit

// Saving recovery.lok locally in case you need it again
C:\adb>adb pull /data/local/tmp/recovery.lok
---------------
2939 KB/s (10512384 bytes in 3.493s)
---------------

// entering Android Linux environment
C:\adb>adb shell

// sudo
[email protected]:/ $ su

// changing directory
[email protected]:/ $ cd /data/local/tmp

// flashing recovery.lok with loki_tool
[email protected]:/data/local/tmp # /data/local/tmp/loki_tool flash recovery /data/local/tmp/recovery.lok
---------------
Loki tool v2.1
[+] Loki validation passed, flashing image.
[+] Loki flashing complete!
---------------

// exiting Android Linux environment
[email protected]:/data/local/tmp # exit
[email protected]:/ $ exit

// reboot device into recovery
C:\adb>adb reboot recovery
---------------------------------

At this point your device should reboot into CWM, Congrats!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    The following guide should work for all loki-locked bootloaders, but I can only confirm that it worked on my D800. The problem I was having, was that loki_flash has been replaced with loki_tools, and there arent any guides out for loki_tools.
    The right way to flash CWM requires you to generate your own recovery.lok from the aboot.img, and recovery.img (CWM) which you need to use loki_tools for.

    PREREQUISITES​
    1. Device must be rooted
    2. Device must be in Developer Mode
    3. USB Debugging turned ON
    4. Debugging RSA Signature must be accepted
    5. Download CWM HERE
    6. Download loki_tool HERE
    7. Download ADB HERE

    STEP 1 (Getting Files)​

    • Follow this GUIDE to install ADB and FASTBOOT, once its complete, you will have adb installed to C:\adb
    • Download CWM, rename the file to 'recovery.img' (so its easier to work with) and move it to C:\adb
    • Download loki_tool and extract the file 'loki_tool' from the bin folder and place it in C:\adb

    STEP 2 (Preparing for the Procedure)​

    • Plug in your phone to the computer
    • In Windows Explorer, navigate to C:\
    • Shift+Right Click on the 'adb' folder, select 'Open command window here'
    • Type "adb devices" you should see:
    Code:
    C:\adb>adb devices
    List of devices attached
    <devid>        device
    If not, go back and turn on Develper Mode, USB Debugging, and accept the RSA Signature

    STEP 3 (Flashing process)​
    (note: I copied everything from the cmd prompt and edited it as a text file before thinking to post my procedure here, thats why it looks different)

    In ADB type the following commands each step is commented out with what it does (someone could make it into a bat, but I'm too lazy.

    Code:
    // Sending recovery.img to device
    C:\adb>adb push recovery.img /data/local/tmp/recovery.img
    ---------------
    3456 KB/s (10510336 bytes in 2.969s)
    ---------------
    
    // Sending loki_tool to device
    C:\adb>adb push loki_tool /data/local/tmp/loki_tool
    ---------------
    2777 KB/s (379248 bytes in 0.133s)
    ---------------
    
    // entering Android Linux environment
    C:\adb>adb shell
    
    // sudo
    [email protected]:/ $ su
    
    // generating aboot.img
    [email protected]:/ # dd if=/dev/block/platform/msm_sdcc.1/by-name/aboot of=/data/local/tmp/aboot.img
    ---------------
    2048+0 records in
    2048+0 records out
    1048576 bytes transferred in 0.072 secs (14563555 bytes/sec)
    ---------------
    
    // changing permissions on aboot.img
    [email protected]:/ # chmod 644 /data/local/tmp/aboot.img
    
    // exiting Android Linux environment
    [email protected]:/ # exit
    [email protected]:/ $ exit
    
    // saving aboot.img locally in case you need it again.
    C:\adb>adb pull /data/local/tmp/aboot.img
    ---------------
    2992 KB/s (1048576 bytes in 0.342s)
    ---------------
    
    // entering Android Linux environment
    C:\adb>adb shell
    
    // changing directory
    [email protected]:/ $ cd /data/local/tmp
    
    // ls should list the following 3 files, if not, you are missing them and need to push them, or generate another aboot.img
    [email protected]:/data/local/tmp $ ls
    ---------------
    aboot.img
    loki_tool
    recovery.img
    ---------------
    
    // changing the permissions of the files so loki_tool can use them
    [email protected]:/data/local/tmp $ chmod 755 /data/local/tmp/loki_tool
    [email protected]:/data/local/tmp $ chmod 755 /data/local/tmp/recovery.img
    
    // executing loki_tool to generate the recovery.lok file
    [email protected]:/data/local/tmp $ ./loki_tool patch recovery aboot.img recovery.img recovery.lok
    ---------------
    Loki tool v2.1
    [+] Detected target AT&T LG G2 build D80010o
    [+] Original kernel address: 00008000
    [+] Original ramdisk address: 05000000
    [+] Writing device tree.
    [+] Output file written to recovery.lok
    ---------------
    
    // exiting Android Linux environment
    [email protected]:/data/local/tmp $ exit
    
    // Saving recovery.lok locally in case you need it again
    C:\adb>adb pull /data/local/tmp/recovery.lok
    ---------------
    2939 KB/s (10512384 bytes in 3.493s)
    ---------------
    
    // entering Android Linux environment
    C:\adb>adb shell
    
    // sudo
    [email protected]:/ $ su
    
    // changing directory
    [email protected]:/ $ cd /data/local/tmp
    
    // flashing recovery.lok with loki_tool
    [email protected]:/data/local/tmp # /data/local/tmp/loki_tool flash recovery /data/local/tmp/recovery.lok
    ---------------
    Loki tool v2.1
    [+] Loki validation passed, flashing image.
    [+] Loki flashing complete!
    ---------------
    
    // exiting Android Linux environment
    [email protected]:/data/local/tmp # exit
    [email protected]:/ $ exit
    
    // reboot device into recovery
    C:\adb>adb reboot recovery
    ---------------------------------

    At this point your device should reboot into CWM, Congrats!