[HOW TO] Easily flash Factory images to GSM TAKJU UPDATED to handle JOP40C (4.2)

Search This thread

Smurph82

Senior Member
Mar 17, 2011
249
45
Greensboro, NC
I had some time this afternoon and thought that I would create a script to flash JZO54K to a unlocked GSM TAKJU Galaxy Nexus.

The attached file "flash_JZO54K.zip" will flash the .img for you from your computer.

I have tested this on my GSM TAKJU Galaxy Nexus and it worked for me

I am not responsible for any damage you may cause to your device. Flashing can be dangerous. You have been warned

You will need adb and fastboot for this to work.
Required files:
  • flash_JZO54K.bat
  • bootloader.img
  • radio.img
  • system.img
  • userdata.img (optional don't include in folder)
  • boot.img
  • recovery.img (optional don't include in folder)

To run the script:
  1. Download the takju 4.1.2 factory image from Google Direct Link or get it from this page Google Factory Images
  2. Open the .tgz file and extract the takju-jzo54k folder
  3. Then open the image-takju-jzo54k.zip and extract the .img files to the takju-jzo54k folder
  4. Place the flash_JZO54K.bat that is in the flash_JZO54K.zip file in the takju-jzo54k folder with the images
  5. Now WARNING I would not flash the userdata.img as it will erase your data on the phone. You have been warned.
    • When you run the bat file and it gets to the userdata it will ask you if you are sure you want to do this. Again you have been warned.
  6. I have added that if the <insert-name-here>.img is not in the folder where the bat file is located it will not try to flash that image. <cough>userdata.img<cough>

If you want instead of the stock recovery download either custom recovery in image form. Then rename it to "recovery.img" and place it in the takju-jzo54k folder instead of the stock recovery to flash the custom recovery from the script.
ClockworkMOD
TWRP

After this is complete you will have to reflash/install your superuser of choice from recovery so I would not flash the stock recovery if you are using a custom one like CWM or TRMP. Superuser Direct download or Webpage link or SuperSU is located here http://xdaforums.com/showthread.php?t=1538053

This batch file is based on "flash-all.bat" that is included in the factory image. But mine will not flash userdata unless you allow it to.
 

Attachments

  • flash_JZO54K.zip
    1 KB · Views: 137
  • flash_JOP40C.zip
    1 KB · Views: 86
Last edited:

Smurph82

Senior Member
Mar 17, 2011
249
45
Greensboro, NC
Source code for the batch file

Code:
@ECHO OFF
:: Copyright 2012 Ben Murphy (Smurph82)
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
::      http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.

%cd:~0,2%
SET workDIR=%~dp0


ECHO ***** WARNING *****
ECHO WILL WIPE YOUR DATA HOPE YOU HAVE BACKUP
ECHO ***** WARNING *****
SET /P _choice=Do you want to flash userdata [Y/N]? 

adb reboot bootloader
ping -n 5 127.0.0.1 >nul
goto bootloader

:: Flash bootloader
:bootloader
IF EXIST "%workDIR%bootloader-maguro-primelc03.img" (
	fastboot flash bootloader bootloader-maguro-primelc03.img
	fastboot reboot-bootloader
	ping -n 5 127.0.0.1 >nul
	goto radio
) ELSE (
	ECHO %workDIR%bootloader-maguro-primelc03.img not found to flash
	goto radio
)

:: Flash radio
:radio
IF EXIST "%workDIR%radio-maguro-i9250xxlf1.img" (
	fastboot flash radio radio-maguro-i9250xxlf1.img
	fastboot reboot-bootloader
	ping -n 5 127.0.0.1 >nul
	ECHO radio
	goto system
) ELSE (
	ECHO %workDIR%radio-maguro-i9250xxlf1.img not found to flash
	goto system
)

:: Flash system
:system
IF EXIST "%workDIR%system.img" (
	fastboot flash system system.img
	IF /I "%_choice%"=="Y" goto userdata
	goto boot
) ELSE (
	ECHO %workDIR%system.img not found to flash
	IF /I "%_choice%"=="Y" goto userdata
	goto boot
)

:: Flash userdata
:userdata
IF EXIST "%workDIR%userdata.img" (
	fastboot flash userdata userdata.img
	goto boot
) ELSE (
 	ECHO %workDIR%userdata.img not found to flash
	goto boot
)

:: Flash boot aka kernel
:boot
IF EXIST "%workDIR%boot.img" (
	fastboot flash boot boot.img
	goto recovery
) ELSE (
	ECHO %workDIR%boot.img not found to flash
	goto recovery
)

:: Flash recovery
:recovery
IF EXIST "%workDIR%recovery.img" (
	fastboot flash recovery recovery.img
	goto end
) ELSE (
	ECHO %workDIR%recovery.img not found to flash
	goto end
)

:end
ECHO Everything completed. Press any key to exit/reboot...
PAUSE >nul
fastboot reboot
EXIT
 
Last edited:
  • Like
Reactions: strumcat

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Source code for the batch file

    Code:
    @ECHO OFF
    :: Copyright 2012 Ben Murphy (Smurph82)
    ::
    :: Licensed under the Apache License, Version 2.0 (the "License");
    :: you may not use this file except in compliance with the License.
    :: You may obtain a copy of the License at
    ::
    ::      http://www.apache.org/licenses/LICENSE-2.0
    ::
    :: Unless required by applicable law or agreed to in writing, software
    :: distributed under the License is distributed on an "AS IS" BASIS,
    :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    :: See the License for the specific language governing permissions and
    :: limitations under the License.
    
    %cd:~0,2%
    SET workDIR=%~dp0
    
    
    ECHO ***** WARNING *****
    ECHO WILL WIPE YOUR DATA HOPE YOU HAVE BACKUP
    ECHO ***** WARNING *****
    SET /P _choice=Do you want to flash userdata [Y/N]? 
    
    adb reboot bootloader
    ping -n 5 127.0.0.1 >nul
    goto bootloader
    
    :: Flash bootloader
    :bootloader
    IF EXIST "%workDIR%bootloader-maguro-primelc03.img" (
    	fastboot flash bootloader bootloader-maguro-primelc03.img
    	fastboot reboot-bootloader
    	ping -n 5 127.0.0.1 >nul
    	goto radio
    ) ELSE (
    	ECHO %workDIR%bootloader-maguro-primelc03.img not found to flash
    	goto radio
    )
    
    :: Flash radio
    :radio
    IF EXIST "%workDIR%radio-maguro-i9250xxlf1.img" (
    	fastboot flash radio radio-maguro-i9250xxlf1.img
    	fastboot reboot-bootloader
    	ping -n 5 127.0.0.1 >nul
    	ECHO radio
    	goto system
    ) ELSE (
    	ECHO %workDIR%radio-maguro-i9250xxlf1.img not found to flash
    	goto system
    )
    
    :: Flash system
    :system
    IF EXIST "%workDIR%system.img" (
    	fastboot flash system system.img
    	IF /I "%_choice%"=="Y" goto userdata
    	goto boot
    ) ELSE (
    	ECHO %workDIR%system.img not found to flash
    	IF /I "%_choice%"=="Y" goto userdata
    	goto boot
    )
    
    :: Flash userdata
    :userdata
    IF EXIST "%workDIR%userdata.img" (
    	fastboot flash userdata userdata.img
    	goto boot
    ) ELSE (
     	ECHO %workDIR%userdata.img not found to flash
    	goto boot
    )
    
    :: Flash boot aka kernel
    :boot
    IF EXIST "%workDIR%boot.img" (
    	fastboot flash boot boot.img
    	goto recovery
    ) ELSE (
    	ECHO %workDIR%boot.img not found to flash
    	goto recovery
    )
    
    :: Flash recovery
    :recovery
    IF EXIST "%workDIR%recovery.img" (
    	fastboot flash recovery recovery.img
    	goto end
    ) ELSE (
    	ECHO %workDIR%recovery.img not found to flash
    	goto end
    )
    
    :end
    ECHO Everything completed. Press any key to exit/reboot...
    PAUSE >nul
    fastboot reboot
    EXIT