How to network unlock your Samsung i5800/i5801 phone using ADB
(or not as the case may be! Please read the entire thread before starting.)
Firstly, if you are concerned that unlocking your phone will void your warranty with your network carrier/provider, instructions are included at the end on how to re-lock your phone to your chosen carrier/provider.
Secondly, the instructions that follow do not harm you phone in anyway. You are simply copying a file from the phone to your PC and working on the file on your PC to extract the unlock code. The worst that can happen is that the program does not find the code. I have provided methods for rooted phones and non-rooted phones.
Thirdly, this guide is very detailed and is aimed at those new to Android phones and those with limited programming knowledge. There is plenty of explanation at each stage.
Preparation
ADB stands for Android Debug Bridge. The adb commands are meant to be run from the host machine (PC) that your phone is connected to via USB. The adb utility is installed automatically if you install the Android SDK (Software Development Kit) on your host machine. If you don’t want to install the full Android SDK you can install smaller tools which contain the adb utility.
The one we are going to install is AndroidControl, a tool developed by the xda-developers and available to download from their forum at
[TOOL] AndroidControl v1.3 - control your Android - xda-developers
Registration is free. Download it and install it to a drive/folder on your PC which is easy to find. For example you could create a folder called ‘Workbench’ on the C: drive.
For phones that are rooted
Download the tool Samsung Galaxy Unlock code eXtractor SGUX2.exe file. It's a win32 executable.
You can download sguX2.exe (v.0.92b) at: Multiupload.com - upload your files to multiple file hosting sites!
For phones that are NOT rooted
Download the tool Generate Unlock Windows.zip which is a compressed file.
It can be downloaded from Generate Unlock Windows.zip
Once downloaded extract the .zip file. A folder(s) will be created in which there will be a Windows batch file called Generate_Code.
Step 1
On your phone, go to the keypad and type the code *#7465625#
On typing the last character # , a pop up screen should appear titled Personalisation status. You should see the following:
Network Lock (on/off)
Network Subset Lock (on/off)
Service Provider(SP) lock (on/off)
Corporate Service Provider (CP) Lock (on/off)
Only the Network Lock should be showing as ON.
Step 2
On your PC, depending on your version of Windows, go to Start >All programs > Accessories and open Command prompt. Alternatively go to Start > Run and type cmd and hit <enter>.
This will take you to the Windows Command Prompt (it replaces the MS-DOS command prompt if you are old enough to remember it!). It will look something like
C:\Users\your_name>
You need to locate the drive/directory where you saved AndroidControl.
If you are unfamiliar with Windows / MS DOS commands the following should help:
To change drive, eg to drive E, type E: and hit <enter>.
To change to the root directory of a drive, type cd \ and hit <enter>
To change to another director/sub directory type the path
eg cd \Workbench\AndroidControl_v1.3 and hit<enter>
To see the contents of a directory type dir and hit <enter>
You are looking for the sub-directory in which adb.exe file is located. Mine is located in the directory AndroidControl_v1.3 itself.
Once located you should have a command prompt similar to:
C:\Workbench\AndroidControl_v1.3>
Step 3
Set your phone into USB debugging mode by going to Applications > Settings > Development > USB Debugging.
Step 4
Connect your phone to a USB port on your PC using the cable.
Step 5
Back on the computer, at the Windows command prompt
C:\Workbench\AndroidControl_v1.3>
type adb devices and hit <enter>
It should show your phone listed on one of the ports, eg:
List of devices attached
644298c722a9 device
Note: If you run adb devices and it comes back with an empty list, then make sure you have set the phone into USB debugging mode (Application > Settings > Development > USB Debugging) before connecting it to the PC.
Once successful with the above step
type adb Shell and hit <Enter>
the command prompt will change to #
Now type su and hit <Enter>
Back on your phone screen, if your phone is NOT rooted, you should see a pop up message for "Superuser Permission" (try to keep your screen on. The timer automatically turns the screen off, so you might miss the pop up message). "grant it permission" to allow, else you will get a "permission denied" ). If your phone is rooted, nothing will appear on your screen as you already have Superuser permission !
Step 6
If your phone is rooted
On the ADB shell command prompt #
type cd /dev/block and hit <Enter> (Note the change from \ to / )
Then type dd if=/dev/block/bml3 of=/sdcard/bml3.bak and hit <Enter>
The dd command line says, "Reading from the input file /dev/block/bml3 on the phone, write all of the data to the output file /sdcard/bml3.bak to be created on the sd card",
which effectively is making a backup copy of the bml3 file and storing it on the root of the sd card. You should get something like:
Code:
20480+0 records in
20480+0 records out
10485760 bytes transferred in 0.826 secs (12694624 bytes/sec)
If your phone is not rooted
On the ADB shell command prompt #
type cd /efs and hit <enter>
Then type dd if=/efs/nv_data.bin of=/sdcard/nv_data.bin and hit <enter>
The dd command line is explained above.
You should get something like:
Code:
1024+0 records in
1024+0 records out
524288 bytes transferred in 0.633 secs (828259 bytes/sec)
bml3.bak or nv_data.bin is now on the root of your sd card.
Step 7
Now, on your phone disable USB debugging by going to Applications > Settings > Applications > Development > USB debugging. Unplug the USB cable from the phone.
Step 8
Plug the USB cable back to the phone. Now go to Settings > Wireless and Network > USB settings and choose USB Mass Storage mode.
Accept the choice to copy files between your device and PC. A pop-up window should appear on your Windows desktop (called 'Autoplay'). Choose the option 'Open folder to view files using Windows Explorer'. You should now see your phone as a 'Removable Drive' and should see the the bml3.bak or nv_data.bin file listed. Using Windows Explorer copy the file from the sd card to your PC.
If your phone is rooted
Copy the bml3.bak file from the internal SD card to your working folder on your PC where you have downloaded SGUX2.exe file
If your phone is NOT rooted
Copy the nv_data.bin file from the internal SD card to your working folder on your PC where the Generate_Code batch file is located.
Step 9
Back on the Windows Command Prompt screen we have finished with ADB, so type exit at both the # and $ prompts to completely clear the PC from the phone. You should now be back to the MS DOS command prompt C:\Workbench\AndroidControl_v1.3>
Step 10
If your phone is rooted
change directory to the folder where you have the SGUX2.exe file and the bml3.bak file (they should be in the same folder).
type sgux2.exe bml3.bak and hit <enter>
You should get something like this
SGUX v0.92b (C) 2010 By Mark0 & rbnet
Samsung Galaxy Unlock code eXtractor
(based on info by rhcp0112345 & RazvanG)
Opening file <bml3.bak>...
Searching code block...
Found.
Searching codes...
Freeze code : 98765432
Network Control Key: 12345678
Take a note of both the Freeze Code and the NCK (Network Control Key)
If your phone is NOT rooted
change directory to the folder where you have the Generate_Code batch file and nv_data.bin file (they should be in the same folder)
type Generate_Code.bat and hit <enter>
Look for the line
Network Control Key:YourCode
Take a note of the Code.
Step 11
Cancel the USB storage mode and disconnect the USB cable.
Power off your phone.
Put in a SIM card from another carrier / provider
Power the phone back on.
When it boots up it will ask for the unlock code. Enter the NCK (Network Control Key) code you found in Step 10.
It should say "Requesting network unlock" followed by "Network unlock successful"
Done, the phone should now be unlocked.
HOW TO RE-LOCK SAMSUNG Apollo – FOR WARRANTY PURPOSES ONLY (TESTED)
After you get the NCK code using the method above,
use the phone keypad and type *7465625*638*#
A pop-up box will appear with two boxes:
MCC/MNC and
Control Key
MCC/MNC stands for Mobile Country Code and Mobile Network Code. The codes can be found on the internet eg at
UnlockMe - Mobile Network Provider Codes MCC & MNC - Unlock Code
or
http://users.zipworld.com.au/~rmills/MCCandMNCValues.htm
Complete the first box (MCC/MNC) with the country and network code you want your phone locked to (eg. 22610 where 226 = romania; 10 = orange etc.).
Complete the second field (Control Key) with the NCK code you obtained.
Press OK and your phone should relock.
References:
[REF] How to: Extract "Freeze Code" for Free [NOT_UPDATED_ANYMORE] - xda-developers
[HOWTO] Software Unlock; How to unlock Bell Galaxy S Vibrant i9000M - xda-developers
[REF] How to unlock/unfreeze all SGS Models [NOW WORKS ON Vibrant 4G][Updated 4-9-11] - xda-developers
(or not as the case may be! Please read the entire thread before starting.)
Firstly, if you are concerned that unlocking your phone will void your warranty with your network carrier/provider, instructions are included at the end on how to re-lock your phone to your chosen carrier/provider.
Secondly, the instructions that follow do not harm you phone in anyway. You are simply copying a file from the phone to your PC and working on the file on your PC to extract the unlock code. The worst that can happen is that the program does not find the code. I have provided methods for rooted phones and non-rooted phones.
Thirdly, this guide is very detailed and is aimed at those new to Android phones and those with limited programming knowledge. There is plenty of explanation at each stage.
Preparation
ADB stands for Android Debug Bridge. The adb commands are meant to be run from the host machine (PC) that your phone is connected to via USB. The adb utility is installed automatically if you install the Android SDK (Software Development Kit) on your host machine. If you don’t want to install the full Android SDK you can install smaller tools which contain the adb utility.
The one we are going to install is AndroidControl, a tool developed by the xda-developers and available to download from their forum at
[TOOL] AndroidControl v1.3 - control your Android - xda-developers
Registration is free. Download it and install it to a drive/folder on your PC which is easy to find. For example you could create a folder called ‘Workbench’ on the C: drive.
For phones that are rooted
Download the tool Samsung Galaxy Unlock code eXtractor SGUX2.exe file. It's a win32 executable.
You can download sguX2.exe (v.0.92b) at: Multiupload.com - upload your files to multiple file hosting sites!
For phones that are NOT rooted
Download the tool Generate Unlock Windows.zip which is a compressed file.
It can be downloaded from Generate Unlock Windows.zip
Once downloaded extract the .zip file. A folder(s) will be created in which there will be a Windows batch file called Generate_Code.
Step 1
On your phone, go to the keypad and type the code *#7465625#
On typing the last character # , a pop up screen should appear titled Personalisation status. You should see the following:
Network Lock (on/off)
Network Subset Lock (on/off)
Service Provider(SP) lock (on/off)
Corporate Service Provider (CP) Lock (on/off)
Only the Network Lock should be showing as ON.
Step 2
On your PC, depending on your version of Windows, go to Start >All programs > Accessories and open Command prompt. Alternatively go to Start > Run and type cmd and hit <enter>.
This will take you to the Windows Command Prompt (it replaces the MS-DOS command prompt if you are old enough to remember it!). It will look something like
C:\Users\your_name>
You need to locate the drive/directory where you saved AndroidControl.
If you are unfamiliar with Windows / MS DOS commands the following should help:
To change drive, eg to drive E, type E: and hit <enter>.
To change to the root directory of a drive, type cd \ and hit <enter>
To change to another director/sub directory type the path
eg cd \Workbench\AndroidControl_v1.3 and hit<enter>
To see the contents of a directory type dir and hit <enter>
You are looking for the sub-directory in which adb.exe file is located. Mine is located in the directory AndroidControl_v1.3 itself.
Once located you should have a command prompt similar to:
C:\Workbench\AndroidControl_v1.3>
Step 3
Set your phone into USB debugging mode by going to Applications > Settings > Development > USB Debugging.
Step 4
Connect your phone to a USB port on your PC using the cable.
Step 5
Back on the computer, at the Windows command prompt
C:\Workbench\AndroidControl_v1.3>
type adb devices and hit <enter>
It should show your phone listed on one of the ports, eg:
List of devices attached
644298c722a9 device
Note: If you run adb devices and it comes back with an empty list, then make sure you have set the phone into USB debugging mode (Application > Settings > Development > USB Debugging) before connecting it to the PC.
Once successful with the above step
type adb Shell and hit <Enter>
the command prompt will change to #
Now type su and hit <Enter>
Back on your phone screen, if your phone is NOT rooted, you should see a pop up message for "Superuser Permission" (try to keep your screen on. The timer automatically turns the screen off, so you might miss the pop up message). "grant it permission" to allow, else you will get a "permission denied" ). If your phone is rooted, nothing will appear on your screen as you already have Superuser permission !
Step 6
If your phone is rooted
On the ADB shell command prompt #
type cd /dev/block and hit <Enter> (Note the change from \ to / )
Then type dd if=/dev/block/bml3 of=/sdcard/bml3.bak and hit <Enter>
The dd command line says, "Reading from the input file /dev/block/bml3 on the phone, write all of the data to the output file /sdcard/bml3.bak to be created on the sd card",
which effectively is making a backup copy of the bml3 file and storing it on the root of the sd card. You should get something like:
Code:
20480+0 records in
20480+0 records out
10485760 bytes transferred in 0.826 secs (12694624 bytes/sec)
If your phone is not rooted
On the ADB shell command prompt #
type cd /efs and hit <enter>
Then type dd if=/efs/nv_data.bin of=/sdcard/nv_data.bin and hit <enter>
The dd command line is explained above.
You should get something like:
Code:
1024+0 records in
1024+0 records out
524288 bytes transferred in 0.633 secs (828259 bytes/sec)
bml3.bak or nv_data.bin is now on the root of your sd card.
Step 7
Now, on your phone disable USB debugging by going to Applications > Settings > Applications > Development > USB debugging. Unplug the USB cable from the phone.
Step 8
Plug the USB cable back to the phone. Now go to Settings > Wireless and Network > USB settings and choose USB Mass Storage mode.
Accept the choice to copy files between your device and PC. A pop-up window should appear on your Windows desktop (called 'Autoplay'). Choose the option 'Open folder to view files using Windows Explorer'. You should now see your phone as a 'Removable Drive' and should see the the bml3.bak or nv_data.bin file listed. Using Windows Explorer copy the file from the sd card to your PC.
If your phone is rooted
Copy the bml3.bak file from the internal SD card to your working folder on your PC where you have downloaded SGUX2.exe file
If your phone is NOT rooted
Copy the nv_data.bin file from the internal SD card to your working folder on your PC where the Generate_Code batch file is located.
Step 9
Back on the Windows Command Prompt screen we have finished with ADB, so type exit at both the # and $ prompts to completely clear the PC from the phone. You should now be back to the MS DOS command prompt C:\Workbench\AndroidControl_v1.3>
Step 10
If your phone is rooted
change directory to the folder where you have the SGUX2.exe file and the bml3.bak file (they should be in the same folder).
type sgux2.exe bml3.bak and hit <enter>
You should get something like this
SGUX v0.92b (C) 2010 By Mark0 & rbnet
Samsung Galaxy Unlock code eXtractor
(based on info by rhcp0112345 & RazvanG)
Opening file <bml3.bak>...
Searching code block...
Found.
Searching codes...
Freeze code : 98765432
Network Control Key: 12345678
Take a note of both the Freeze Code and the NCK (Network Control Key)
If your phone is NOT rooted
change directory to the folder where you have the Generate_Code batch file and nv_data.bin file (they should be in the same folder)
type Generate_Code.bat and hit <enter>
Look for the line
Network Control Key:YourCode
Take a note of the Code.
Step 11
Cancel the USB storage mode and disconnect the USB cable.
Power off your phone.
Put in a SIM card from another carrier / provider
Power the phone back on.
When it boots up it will ask for the unlock code. Enter the NCK (Network Control Key) code you found in Step 10.
It should say "Requesting network unlock" followed by "Network unlock successful"
Done, the phone should now be unlocked.
HOW TO RE-LOCK SAMSUNG Apollo – FOR WARRANTY PURPOSES ONLY (TESTED)
After you get the NCK code using the method above,
use the phone keypad and type *7465625*638*#
A pop-up box will appear with two boxes:
MCC/MNC and
Control Key
MCC/MNC stands for Mobile Country Code and Mobile Network Code. The codes can be found on the internet eg at
UnlockMe - Mobile Network Provider Codes MCC & MNC - Unlock Code
or
http://users.zipworld.com.au/~rmills/MCCandMNCValues.htm
Complete the first box (MCC/MNC) with the country and network code you want your phone locked to (eg. 22610 where 226 = romania; 10 = orange etc.).
Complete the second field (Control Key) with the NCK code you obtained.
Press OK and your phone should relock.
References:
[REF] How to: Extract "Freeze Code" for Free [NOT_UPDATED_ANYMORE] - xda-developers
[HOWTO] Software Unlock; How to unlock Bell Galaxy S Vibrant i9000M - xda-developers
[REF] How to unlock/unfreeze all SGS Models [NOW WORKS ON Vibrant 4G][Updated 4-9-11] - xda-developers