yashsingh1/xdaforums huggingface dataset:
[Captivate Android Development] joeshmoe08:
So then in superoneclick are you going to update the existing unlock method or will there be two ways?

Ps: when will the new version be availabe (I already unlocked of course but many friends who have captivate want to unlock but are afraid to even touch cmd prompt):rolleyes:
[Captivate Android Development] CLShortFuse:
Actually, this isn't the same method as I thought. I'll look into it...
[Captivate Android Development] Dave the Knave:
This is for people who went from 2.1 and were sim locked and then went to 2.2 and wanted to sim unlock but couldn't due to corrupted NV_data files.

And Joe, please keep those questions in his thread. I wanna keep this thread for troubleshooting this method.

Sent from my Captivate
[Captivate Android Development] CLShortFuse:
That's weird. My method is Helroz's method of patching the file with 00000000 instead of FFFFFFFF, but this website does something else completely different.

It's weird because the website says: "This tool is based off of Helroz's work, many thanks to him for the groundwork that made this possible."
[Captivate Android Development] Dave the Knave:
Does your method insert the unfreeze code as well?

Sent from my Captivate
[Captivate Android Development] CLShortFuse:
I just realized helroz has a new method: http://xdaforums.com/showpost.php?p=8887801&postcount=31

I'll take a look at it later.

public boolean effectuer(byte[] sim, byte[] freez)
throws IOException
{
boolean fail = false;

FileInputStream f = new FileInputStream("./nv_data.bin");
FileInputStream sortie_lect = new FileInputStream("./nv_data.binvierge");

int total_s = sortie_lect.available();
int total_e = f.available();

byte[] b = new byte[total_e];

byte[] s = new byte[total_s];

sortie_lect.read(s);
sortie_lect.close();

f.read(b, 0, total_e);

int val_imei = 85;

for (int i = 0; i < val_imei; ++i)
{
s[(1572868 + i)] = b[(1572868 + i)];
System.out.println(b[(1572868 + i)]);
}

int val_productcode = 238;

for (int i = 0; i < val_productcode; ++i)
{
s[(1605636 + i)] = b[(1605636 + i)];
System.out.println(b[(1605636 + i)]);
}

try
{
int val_unfreez = 8;

for (int i = 0; i < val_unfreez; ++i)
{
if ((freez[i] >= 48) && (freez[i] <= 57)) {
s[(1572937 + i)] = freez[i];
System.out.println(b[(1572937 + i)]);
}
else {
JOptionPane.showMessageDialog(null, "Erreur : Vous n'avez pas renseigner un chiffre a la position " + (i + 1) + " du code de defreezage");
fail = true;
break;
}
}

val_unfreez = 8;

for (int i = 0; i < val_unfreez; ++i) {
if ((freez[i] < 48) || (freez[i] > 57)) break;
s[(1572945 + i)] = freez[i];
System.out.println(b[(1572945 + i)]);
}

int val_simlock = 8;

for (int i = 0; i < val_simlock; ++i) {
if ((sim[i] >= 48) && (sim[i] <= 57)) {
s[(1572954 + i)] = sim[i];
System.out.println(b[(1572954 + i)]);
}
else {
JOptionPane.showMessageDialog(null, "Erreur : Vous n'avez pas renseigner un chiffre a la position " + (i + 1) + " du code de simlockage");
fail = true;
break;
}
}

val_simlock = 8;

for (int i = 0; i < val_simlock; ++i) {
if ((sim[i] >= 48) && (sim[i] <= 57)) {
s[(1578094 + i)] = sim[i];
System.out.println(b[(1578094 + i)]);
}

}

}
catch (ArrayIndexOutOfBoundsException e)
{
JOptionPane.showMessageDialog(null, "Erreur : Nombre de chiffres invalides, réessayer.");
fail = true;
}

FileOutputStream sortie_ecrit = new FileOutputStream("./nv_data.binvierge");

sortie_ecrit.write(s);

sortie_ecrit.close();
sortie_lect.close();
f.close();

return fail;
}
}

will port

Edit: This is just two things in one. It replaces your SIM and UNFREEZE code by replacing it with 000000, exactly as I theorized.

The rest "restores" your product code in case you messed it up. There's no need to do that unless you've been hex editing your files.

The code is pretty inefficient though. I still don't understand why the website makes so many changes to the file...

For some reason I the website doesn't actually patch your file. It just reads the IMEI and plugs it into another template file. That's pretty risky...
[Captivate Android Development] joeshmoe08:
my bad :o
[Captivate Android Development] sourkrawt:
When going through the steps outlined on the unlocker page I am running into an issue with step #11.

The instructions read:

Step 11: Last step! Create a directory on your /sdcard called "efs_good" and copy the /efs files into it. This can be done via ADB shell ("adb shell" at the DOS command prompt) or in a terminal with:

su

mkdir /sdcard/efs_good

cp -d -r /efs/efs_good

efs reboot recovery

You are finished.

However, when I run those commands I get this a usage screen for the cp command as well as this:

# efs reboot recovery

efs: not found

What am I missing here?
[Captivate Android Development] Dave the Knave:
It's just "reboot recovery".
[Captivate Android Development] sourkrawt:
Thank you.

And the cp command? Do you suppose there was an incidental line wrap and the command should read cp -d -r /efs/efs_good efs?
[Captivate Android Development] dizx:
I'm sure I asked a question somewhere in my sea of babbling.

If I am indeed unlocked, how can I find out my unlock and freeze codes? Every program on the forum I have found and tried could not provide that. CLShortfuse's SuperOneClick gets the closest, but it says something on the order of failed FFFFFFFF, which I've read to not be a valid code.

Unfortunately, I don't have another service provider's SIM to test at the moment.
[Captivate Android Development] waghoba:
Need help urgently

I tried this method and it worked for me for 1 day only and it automatically lost the signal. But now when I checked my IMEI number it was completely messed up :eek: and the phone was showing 'Phone not allowed mm#6' message. Now can anyone please help me what should I do now to restore my IMEI and unlock the phone.
[Captivate Android Development] NWolf:
Well, without knowing exactly what's in your nv_data.bin file, it's hard to say. But if your IMEI is correct and it says unlocked, it's probably unlocked. Since it's unlocked, the code is irrelevant as far as I know. FroYo botched up the nv_data.bin file on most SGSs, and all the unlock codes got changed to FFFFFFFF and thus invalid, but as far as I know, that doesn't change the status of the unlocked-ness of the phone. I could be wrong though, I haven't investigated that particular circumstance. Your best bet is to try with another providers SIM. Find some dude on AT&T or T-Mobile (whichever is foreign to you) and use their SIM for a minute.

Only way is to restore your nv_data.bin file from the backup you made (You did make a backup, didn't you?). There's no (easy) way to recover your IMEI manually.
[Captivate Android Development] sjavvaji:
can't you do this entire process from the root manager?
[Captivate Android Development] waghoba:
yes I do have my backup of efs folder...but how to restore it to get my original IMEI back and then how to proceed in order to unlock the phone....:confused:
[Captivate Android Development] NWolf:
Copy the nv_data.bin backup to the /efs folder and then follow the instructions on http://www.communityhosting.net/sgsunlock
[Captivate Android Development] waghoba:
Thanks for your help but I just realized that my backup of /efs was also messedup and I have no original backup of stock /efs but I do have a backup of stock rom taken using clockwork mod so if I restore that backup will it also my /efs folder?? or what is the other method to restore the corrupted file??
[Captivate Android Development] NWolf:
There's no way to restore the corrupt file. The backup doesn't back up the /efs folder unfortunately. There's not a lot you can do without a backup.
[Captivate Android Development] emuneee:
The other methods (one click unlocker, sgux tool, etc.) didn't work. But this method did, thanks. Running rooted/self-tweaked JH7 by the way. Now I can travel to Brazil for my honeymoon next week and use a prepaid SIM!
[Captivate Android Development] GRACO:
same here... Now I cannot find signal, im using Cognition and I only see a crossed white circle.
[Captivate Android Development] waghoba:
well thanks for your help though..:) I am trying couple of other methods to replace the nv_data.bin and will post if I succeed..
[Captivate Android Development] GRACO:
WOW! I just found a backup of nv_data.bin, I adb push it to the efs folder and removed the battery ... I got my IMEI back!
[Captivate Android Development] dizx:
Finally found a T-Mobile user and verified my phone is indeed unlocked. Nice!
[Captivate Android Development] Tickie:
Need help puting back good nv_data.bin

How did you get that back into the phone. I have the same problem and I only have the nv_data.bin that's good, how can I just install it back into the /efs folder and overwrite the one that's in there now?

Thanks:(
[Captivate Android Development] dizx:
Do you have your root directory set to r/w?
[Captivate Android Development] Tickie:
Don't know I have been reading so many commands I am lost...

I have the nv_data.bin in the sdk tools directory so I should be able to just move it into the /efs folder but it keeps saying permission denied. if I could just get the simple commands to put it in to that folder and overwrite the one thats there.

Thanks
[Captivate Android Development] GRACO:
I dont remember the exact steps, but basically I just push the original bin and REMOVED THE BATTERY ... I got that idea from here:

http://forum.samdroid.net/f28/complete-imei-restore-how-1817/

And IMEI restored ...:)
[Captivate Android Development] impulser91:
This is fantastic!!! I just ran it and decided to thrown in my 2 bits.

I am running an i896 Rogers Captivate. Running Cognition B8.

Everything went fine except for pushing the nv_data.bin back to the phone. I was getting a permission denied. So i did a listing on the efs folder only to find that my original nv_data file was gone... like totally missing.

I then did a " ls -l / " and looked at the permission of /efs. It was a little limited, so i " chmod 777 /efs " and exited back to the adb push of the new bin file. And voila, it worked. Because of this additional chmod i wanted to make sure and put it back. So one last " chmod 775 /efs " and it looks like they are the same permissions as before. I followed the last couple steps and my phone is now unlocked!

Hopes this helps someone else who might have gotten stuck.
[Captivate Android Development] tbong777:
Just read this thread and have a couple questions.

People are talking about backing up a good EFS folder.

I used Root Explorer to copy my EFS folder to the SD card and then USB to copy it to the PC. Everything is working except the Product Code is wrong.

BTW in the nv2.Bak the Product code is correct but the file size is not the same. Not sure what nv2.bak is for. Maybe i should delete everything in the EFS folder except for nv2 files and reboot.....?

Using HEX edit I edited the Product Code to the correct one for and saved the edited nv_data.bin file.

Can I just copy that file to the root EFS folder and reboot? or does chmod 777 then 775 need to be applied to the folder afterward?

People who are just copying their EFS folders back to the Root are not indicating if they have to use adb to give it permissions as I read somewhere permissions change when you copy files from Root

I am not as interested in unlocking as I am about using this method on 2.2 to simply restore the Stock Product code after a ROM flash changes it..

I thought perhaps I could use the HEX editor on the nv_data.bin file and run it through Samsung Galaxy S Unlocker & Repair . I actually did so and the file came back unlocked and all that but i am a more than a little leery of copying it to the EFS folder as I am not completely understanding what the adb Commands are doing and which are actually needed for that file to be recognized on reboot. I noticed there is a . before the nv_data.bin name. My copied and hex edited files don't have that period. not sure of the significance of that.

Borking IMEI is my main concern. The IMEI is fine. only the product codes were changed flashing ROMS. If I am to continue flashing ROMS I think I should be able to restore the EFS folder with a correct product code.

Which files are safe to delete in the Root EFS folder when restoring the edited nv_data.bin?

Does a command have to be run on the EFS folder or any specific file through adb for that file to be recognized with a boot (ie "permissions") ?

I do have working backups of the EFS folder (albeit with the wrong Product code and correct IMEI so I assume I could get back to a working phone if i bork the IEMI trying to restore the Product code.
[Captivate Android Development] TorqueWrench001:
Miztaken,

Thank you for this guide. My Captivate is now unlocked. Thanks to everyone else on xda for all your work.

Samsung Captivate SGH-i897

Perception 9.5
[Captivate Android Development] mirceani:
help

I'm trying to unlock my Captivate following those instructions/thread and at the DOS prompt I get :

'adp' is not recognized as an internal or external command, operable program or batch file

I did install the programs indicated in the ADP guide/workshop

What do I do wrong?

Thank you
[Captivate Android Development] impulser91:
Lol, try looking up how to use ADB (yup, thats a B not a P)
[Captivate Android Development] mirceani:
well, I double checked and checked "how to use ADB"

However, I still get the same error at the DOS prompt: 'adb' not recognized

Somebody here with helpful ideas ?
[Captivate Android Development] impulser91:
I got lots of helpful ideas.

You need to CD into the directory in the dos box to where adb.exe is. So if you have R7 installed its probably something like c:\android-sdk-windows\tools if you have the new R8 it will be in C:\Program Files (x86)\Android\android-sdk-windows\platform-tools (if your on 64bit, if its 32bit windows then drop the (x86)
[Captivate Android Development] mirceani:
I just installed R8

I am right there C:\Program Files\Android\android-sdk-windows\tools

And in that directory there is NO adb.exe

A windows search returns NO such file, but the program did install correctly prior to this search.

However, I still get same error :'adb' not recognized...
[Captivate Android Development] impulser91:
You clearly need to learn how to read. Lets try this one more time.

If you have R8 then it will be in one of 2 places

64-bit windows

C:\Program Files (x86)\Android\android-sdk-windows\platform-tools

32-Bit Windows

C:\Program Files\Android\android-sdk-windows\platform-tools

The change between R7 and R8 was the installation directory of the entire SDK, as well the location of the adb.exe program moved from tools to platform-tools.
[Captivate Android Development] mirceani:
No such directory on my hard drive.

I do have C:\program files\Android\android-sdk-windows\tools

Under there I see "android.bat"

If I run that, a new window pops up, telling me that I have installed "Android SDK Tools, revision 8"

However the program "adb.exe" is nowhere to be found.

Windows search does not find it.

At the prompt I get the error from my first post.

The problem is that I will gladly spare myself all this trouble , and to those who post advises here (like you) and pay a few bucks to have this damn thing unlocked, but my latest try with "TheUnlockShack.com" was not successful.

They refunded my money and said they cannot provide the unlock code.
[Captivate Android Development] impulser91:
Is your OS 64 or 32 bit
[Captivate Android Development] mirceani:
32 bits Windows 7
[Captivate Android Development] impulser91:
So in C:\Program Files\Android\android-sdk-windows\ You do not see a platform-tools folder?

If you dont have that folder then i would say only the sdk installer is installed, not the sdk itself.

Go into C:\Program Files\Android\android-sdk-windows\ and run the "SDK Manager.exe"

You will see a dos box for a second or two, then the SDK installer will open, click accept all, and hit install. After it downloads and installs everything you should have a platform-tools folder.
[Captivate Android Development] mirceani:
thx

doing that right now

I'll let you know the outcome
[Captivate Android Development] mirceani:
Ok, SDK is now installed

thank you

Next, trying to follow the original thread and unlock my Captivate - that seems to be a problem for somebody not familiar with those commands. I have no clue what they mean, and I have no desire to learn programming now...

So it looks to me that it is a very dangerous thing to do, and I'm afraid I will brick my phone.

For ex I just typed the first command from DOS prompt:

adb pull /efs/nv_data.bin

I've got a permission denied error

I went to ADB shell and from the DOS prompt I am now at a $ prompt

from there, typing exactly what's written in this thread:

su

chmod...etc etc

I get errors

Are those commands really listed as they should be ?(for ex one space missing in the syntax, for somebody who does not know what those commands mean, this could be risky and dangerous)
[Captivate Android Development] impulser91:
this is a more advanced thing to try and do, and yes, you could brick you phone doing it.

Are you rooted?
[Captivate Android Development] mirceani:
yes, I am using z4root
[Captivate Android Development] impulser91:
Okay, go into settings, application, development. Tick Stay Awake.

Now try and do the part where you type in su

You will see a super user request pop up on the device. Hit allow, and you should be able to continue with the commands.
[Captivate Android Development] mirceani:
I went all the way to STEP 3, and I'm stuck

the command "adb pull /efs/nv_data.bin" did return this at the DOS prompt:

1877 KB/s (2097152 bytes in 1.091 s)

in Step 3, at that screen with "Select file" the file is nowhere to be found

I do see the two phone memories listed as external drives , but clicking on them tells me to "insert memory card", so I'm stuck

Hopefully the phone still works
[Captivate Android Development] impulser91:
I truly think you should get a bit more experience with the system before continuing. However, if you wish to carry on, you will find the nv_data.bin file in the platform-tools folder
[Captivate Android Development] mirceani:
OK, I did step 3 which returned a SUCCESS (finally)

So now I have this new nv_data.bin file, which supposedly will do the trick.

Shall I continue ???
[Captivate Android Development] impulser91:
That's up to you.
[Captivate Android Development] mirceani:
I probably will continue.

But before I do, I have another question.

So right now I do have the new nv_data.bin file, which I am supposed to replace on my phone, using steps in this thread, and get an unlocked phone.

However, after I did get this file, I did run the "Generate Unlock Windows" batch file also available on this forum (Samsung Galaxy Unlock code extractor), and this batch file aparently run fine and returned a code like this:

MCC/MNC lock : 00101

Script complete, etc

Is this a valid code I could try, thus avoiding all those adb steps from the first method?

Thank you
[Captivate Android Development] impulser91:
Type *#0011# on your phone. If it says network lock off then you are done.
[Captivate Android Development] impulser91:
Sorry, wrong code. Use *#7465625#
[Captivate Android Development] mirceani:
Network code still ON...
[Captivate Android Development] G-Man.:
THANK YOU SO MUCH!!!!!!!!! I have tried every other method and program to unlock my phone and have hit dead end after dead end!!! i thought it was a lost cause!!! this truly works, my phone is now unlocked and confirmed on T-Moble.
[Captivate Android Development] mirceani:
more help needed - thank you

Slowly, step by step I am making progress, but...I am stuck again in Step 6.

(everything till step 5 included went OK)

So, in step 6 , after typing command :

cp -d -r /efs/ sdcard/efs_backup I get this ERROR:

cp: not found

What do I do wrong?

(I have Captivate running Froyo, unrooted with z4root, and I have ZERO experience with adb....)

Thank you for any help
[Captivate Android Development] impulser91:
Are you sure you are in the "adb shell"
[Captivate Android Development] mirceani:
yes, from the DOS prompt I type "adb shell" and that returns a $ prompt
[Captivate Android Development] impulser91:
So adb shell

Then su

Then the cp command. And that's not working?
[Captivate Android Development] mirceani:
correct

After the cp command line I get :

cp: not found

(prior to the cp command I enter mkdir, as listed in Step 6, and that seems to be working fine)
[Captivate Android Development] sshvetsov:
You don't have busybox or it's a older version or it's in a wrong place. What method did you use to root your phone? You could also try prepending busybox before cp command: busybox cp ...
[Captivate Android Development] mirceani:
Ok, got it

I downloaded busybox and installed it on my phone.

Now that error is gone, and the comand is executed.

Thank you

One more question please:

Once I download the new nv_data file in Step 5, WHERE do I need to put this file to later accomplish Step 7 ?

Is it the same directory where the adb command is? If not, where?
[Captivate Android Development] mirceani:
more help needed - thank you

Step 6 finally completed.

I put the NEW nv_data file in the /platform-tools directory, from where I am running adb from

When I go to Step 7, with this command :

adb push nv_data.bin /efs

I get new error, which is:

"adb: not found"

Which (to me) means that the nv file is in the wrong place.

WHERE should it be?

Anybody could help with this please?
[Captivate Android Development] mirceani:
Finally done

After a long struggle, finally I'm done

It shows : Network OFF

Thank you guys
[Captivate Android Development] G-Man.:
Tried this and it did work... however after rebooting, my IMEI # had reverted to generic, and product code was wrong (not active). I have successfully restored my IMEI, but network lock is back ON now.... any ideas?? sgs unlocker used to say "no codes found" now it says "unlock code :null - unfreeze code :null" .... my brain hurts :(
[Captivate Android Development] jonnywords:
How did you restore the phones IMEI number?
[Captivate Android Development] NWolf:
Restored the backup nv_data.bin file.
[Captivate Android Development] Yaantra:
@NWolf,

I was able to pull the nv_data.bin file using root explorer and have also copied the complete efs folder for backup. Now, using your tool i generated the unlocked nv_data.bin. Can i use root explorer to just paste this new (unlocked) nv_data.bin over the exixting one in the efs folder on my phone?

Thanks in advance!

Yaantra
[Captivate Android Development] NWolf:
Yes, as long as you've made a backup of your original nv_data.bin file, you should be fine if anything goes wrong. You can overwrite the one you have now. You may have to delete some of the files in there and reboot, but that's detailed in the instructions on the tool page.
[Captivate Android Development] Yaantra:
Thanks for the quick reply... I'll try it right now. BTW, when you say "delete a few files" do you mean the instructions on your website or somewhere on this forum?

Thanks!

Yaantra

Never mind! going to your tool site...!
[Captivate Android Development] Yaantra:
Thanks!

Worked like a charm! "Root Explorer" extract-backup-copy-paste simplified the complete process! Beer money on the way (try Ally Cat)

Thanks!

Yaantra
[Captivate Android Development] unnamedsoul91:
"Download unlock1.bat and unlock2.bat . Run unlock1.bat first, then unlock2.bat after you have your new nv_data.bin file."

its meant after step 5 we must run that files?

when i run unlock1.bat it's ok. but when i run unlock2.bat, always stuck permission denied :"(
[Captivate Android Development] NWolf:
If you get permission denied, you have to do it manually via the instructions. When I get some time, I'm going to look into overcoming that problem, but I haven't had any free time lately.

Doing it manually gets you past that, though... if you follow the instructions step by step it will get your phone unlocked.

If you want me to do it for you, PM me and we can set something up.