yashsingh1/xdaforums huggingface dataset:
[HTC One S] nodyarg:
unlock.sh outputs wrong imei

so ive successfully done this unlock on about 10-12 htc one s's before. ive got one here that im trying to unlock, so far ive used the toolkit to unlock the bootloader, flash recovery, root, and busybox. the unlock.sh is executing from terminal and everything looks normal, but its outputting the WRONG IMEI, (and wrong un_lock code i think), when i look at the back of my phone i see a different imei number than the script outputs. ive tried using that imei number + the un_lock code to get the sim unlock, but of course it wont work because im guessing the un_lock is wrong too. another thing thats strange is when i go in to settings->about->phone identity it displays the correct imei. how can i correct the script to give me my real un_lock code?

edit: im guessing my /dev/block/mmcblk0p6 file is corrupted or something, how can i regenerate this? will it regenerate if deleted?
[HTC One S] dsstest:
How do I locate the correct original rom to load back to normal?
[HTC One S] xewier:
This method is works on Galaxy S3?:D
[HTC One S] gt500kr:
Worked like a charm, thanks a lot!
[HTC One S] asdfasdfvful:
Just wondering, do custom roms affect the SIM unlock? I've been on odyssey and have received the unlock code from both the carrier and other companies, all of which matching what I got here. However, it doesn't work. Do I need to be on stock or non rooted to use the code?
[HTC One S] claudiuslu2011:
i thou it is illegal to sim unlock after Jan, where did you guys buy the code from if this method doesnt work?

any one tried this on att one x?
[HTC One S] asdfasdfvful:
Since when was sim unlock illegal? I went to third party companies and also to the phone carrier themselves. They both gave me the same non functional code though, which makes me suspect that rooting might have done something

Sent from my One S
[HTC One S] claudiuslu2011:
http://www.theverge.com/2013/8/22/4648656/fcc-urges-cellphone-companies-to-let-customers-unlock-cellphones
[HTC One S] asdfasdfvful:
I'm not in the US though. Pretty sure it's legal if my carrier offers the service publicly (I also contacted HTC as well)

Sent from my One S
[HTC One S] beyored:
I sim unlocked my phone but had to install viper then reboot with other carriers sim to use the code....it wouldn't work with cm based ROMs for me.....

PS. I was rooted....

just hit thanks if I helped.....
[HTC One S] asdfasdfvful:
I was actually just stupid. It was even written in the op post to use a sense rom. Had it unlocked a few days ago but thanks anyways

Sent from my One S
[HTC One S] MrPickleFicker:
If I sim unlock my phone and then RUU to sell my phone to the technically challenged, will I lose SIM unlock?
[HTC One S] tivofool:
according to this post, it is permanently unlocked.

http://xdaforums.com/showpost.php?p=28879406&postcount=134
[HTC One S] shikhar623:
Can I unlock HTC One S (T-Mobile) with this method?
[HTC One S] Insecret:
what you are w8ing for ? Try !!!
[HTC One S] Ihtsham:
unable to access any option

dear

Can you please tell, how i can copy Move the unlock.sh to /system/?

This method seems easy.

kindly reply soon.

thanks
[HTC One S] Ihtsham:
A great work indeed. thank you ascot & other developers. Finally, i was able to install BusyBox & to follow step-1. My phone is htc one s. I really dont know which ROM version is it, but its software number is: 3.16.161.9 kernel version: 3.4.10 root@abm030

but what i got after step-1 is as below:

u0_a199@android:/ $ su

u0_a199@android:/ # strings -n 8 /dev/block/mmcblk0p6

macaddr=1C:B0:94:C7:7D:63

20130312

419L527905982

MB311W405982

@Iz3@"yT@

@Iz3@"yT@

@Iz3@"yT@

@Iz3@"yT@

1.75.997.1

EBR_Update

u0_a199@android:/ #

I didnt get my IMEI number nor UN_Lock_code. Kindly help, what is missing. Early reply would be highly appreciated. Also, i am unable to copy unlock.sh file to /system, i tried copying from reocovery even, but failed.

thanks.
[HTC One S] goldenfish:
hi, i got this error

F:\DROID\adb>adb shell

shell@android:/ $ su

su

root@android:/ # strings -n 8 /dev/block/mmcblk0p6

strings -n 8 /dev/block/mmcblk0p6

sh: strings: not found

127|root@android:/ # :(

how to fix this ? :(
[HTC One S] indgirl6:
i have the same issue.. strings not found..

tried the unlock method, and it says grep and some other commands not found.. please advice..

trying this on my huawei Inspira
[HTC One S] goldenfish:
stuck with this, help !

---------- Post added at 06:13 AM ---------- Previous post was at 05:52 AM ----------

fixed thi error with this rom (HTC ONE S Tmobile)

http://www.androidfilehost.com/?fid=9390113915771289754 TrickDroid_v7.0.0_TMOUS.zip

Require

Recovery
[HTC One S] ibancioiu:
So it is for the C2 version too? [S3]
[HTC One S] indgirl6:
I actually fixed the issue by installing busy box which i did not have earlier..

now the strings command works but the output does not show the unlock code..

so i think this method will not work for all android.. just HTC i guess..

I am trying this on Huawei Inspira.. Any tips on what else i can try?
[HTC One S] goldenfish:
Just flash it :good: if you have a HTC One S Tmobile ;) and then do as #1 say :laugh:
[HTC One S] indgirl6:
unfortunately.. the phone i am trying to unlock is Huawei Inspira and not HTC.. am trying to find a ROM for it.. but could not find one..
[HTC One S] goldenfish:
so sad about that. :(
[HTC One S] LibertyMonger:
Tried method 3 first and it didn't work, method one worked first try.
[HTC One S] krischat1001:
No Un_lock_code for my T-mobile phone

Hi ascot17,

As already mentioned by many others, the Un_lock_code string isn't there for me too!

Output of strings -n 8 mmcblk0p6:

macaddr=xx:xx:xx:xx:xx:xx

20121205

41AD527X00095

MB249W400095

1.75.997.1

EBR_Update

1. Will I get the unlock code if I downgrade/upgrade to a different hboot? My current hboot version is 1.14.0004

2. I already have S-OFF. So if I flash a different ROM will my phone be network-unlocked?

Any help is appreciated!
[HTC One S] nashwing:
Ditto, no Unlock_code in my output either I'm on 2.14 HBOOT with Stock Rom - No SOFF
[HTC One S] krischat1001:
Unlock Code

Hmm, I bought the unlock code for 9.99$ from freeunlocks.com. I just provided my IMEI number, and they gave me the unlock code!

If anyone is interested, I am willing to provide my unlock code, last few numbers of IMEI in case they want to try decoding this puzzle!

I've looked at all possible numbers that I can see on the screen after printing the mmcblk*** but couldn't figureout a relation b/w the unlock code and those numbers!
[HTC One S] maremestera:
don't buy a code if u have those carriers

Unsupported carriers (those operators change factory codes so don't buy codes unless is for specific operator) :

Mexico Telcel

Mexico Lusacell

Macedonia networks

Bulgaria networks

Romania networks

Slovakia networks

Croatia networks

Serbia networks

Hungary networks

HTC ONE X plus AT&T

NOTE

Credits for unsuitable code will not be refunded.If you want to unlock the phone from the list do so at your own risk!
[HTC One S] zgomot:
So what's there to be done for those using, Vodafone Romania, for instance. All three methods output the same unlock code, but it's refused by the phone.
[HTC One S] Rapier:
I think the only way is to go to vodafone and pay for unlocking it. Or if you have access to a J-Tag device which are rare in RO

Sent from nowhere over the air...
[HTC One S] chrisb1357:
Hi all,

I have a HTC One S on T-Mobile UK and its now running cyanogenmod and is rooted but the unlock method 1 and 2 do not work for me. When I work out the unlock code I get the same code that the program gives me in method 2 but the sim unlock does not work

Any ideas?

Chris
[HTC One S] maremestera:
#zgomot

Vodafone can be unlocked by IMEI on many local servers. As far as I know, Orange RO work only for iPhone.

If u can find it, contact me for direction.

BR
[HTC One S] benJX:
Thanks for your great and very useful work !

I'm actually on Orange FR carrier.

When I insert a sim from another carrier the phone asked me & I wrote the combination.

It said it was now unlocked and when I press "Reboot" the phone freeze instead of rebooting :confused:

Any idea ? The CID perhaps ?

Device : hTC One S

About : Facepalm S-OFF -- Hboot 2.16 -- CID HTC__203 -- Radio 1.20

Rom : MaximusHD -- SENSE 5.0 ANDROID 4.2.2

Kernel : ElementalX v6.1

Thx in advance

Edit : I get this error while running the script :

sh: /system/unlock.sh[65]: length: not found
[HTC One S] rafspeik:
Just to confirm

Hi

My friend has just been gifted an HTC One S, but it's locked to Vodafone and she wants to stay with Three (3). I'm new to unlocking, but not rooting. I've rooted and heavily modded every Android phone I've had, at least once, so I'm confident I can do this. But yeah, just to confirm, once this procedure is done will she be able to use her Three (3) SIM in it?

Thanks
[HTC One S] Rapier:
Once is unlocked, she should be able to use any SIM

Sent from nowhere over the air...
[HTC One S] rafspeik:
Great, thank you!
[HTC One S] ascot17:
Go back and read the OP! You need to be on a Sense ROM for the unlock to work. It does not work on CM.
[HTC One S] ascot17:
I started this thread nearly 2 years ago and all methods worked then.

Over time, there have been more and more reports users unable to find the string. To be honest I have no idea whether this is HBOOT related or not, but it certainly seems possible. I believe that at the time of the OP, my HBOOT was at 1.06, so it MAY be possible to uncover the correct string by returning to 1.06 if there is still a version around....
[HTC One S] benJX:
I unlocked my phone when I was on 2.15 HBOOT, but now I'm on 2.16 HBOOT. Is my phone still unlocked ? Thx

Sent from my ElementalXed One S
[HTC One S] Rapier:
Put a SIM from another carrier in it and find out... It's quicker than waiting for an answer. And 100% sure

Sent from nowhere over the air...
[HTC One S] jboy15:
No luck for me with this one. Also showing two different imei's from terminal and *#06#.

Help please. Followed every step but code is not valid.
[HTC One S] roadhero:
I am stuck in the same situation here. Was wondering if we need to correct the IMEI everywhere on the phone to the same one, would this help? I see it's usually in mmcblk 0p4, 0p6 and 0p23. Does anyone know if it is hidden in any other block and if correcting IMEI all over would help to actually unlock?
[HTC One S] roadhero:
Solution for S-Off devices!

Well, neither calculated, nor purchased code worked for me. So I tried solution posted in this topic and it worked flawlessly. You will need a Y USB-Host cable or you can make one yourself by supplying additional power from your PC:
[HTC One S] Bad.Fish:
Method 2 is the easiest
[HTC One S] mikaaa6:
Some of these methods works on Xperia J?
[HTC One S] kylelaker:
Is it possible to use it on my ascend p6 I already tried to execute the unlock.sh but it doesn't work
[HTC One S] Bad.Fish:
Try method 2 on any device
[HTC One S] Sertico:
i've try the mthod 1 and 2 and none worked.... I dont know why, my Unlock_Code starts with 0, this had anithing to do? what im doing wrong?

Im using Cyanogenmod btw, so i have root and the emulator works just fine, gives me the Unlock_code very easy but my phone says "the unlock request was no successful"

Im from Venezuela
[HTC One S] lmcmil:
Tryed option 1 and i get:

su

root@android:/ # strings -n 8 /dev/block/mmcblk0p6

strings -n 8 /dev/block/mmcblk0p6

macaddr=84:7A:88:47:E2:5F

20140801

419L52C812455

SH26KW403040

1.75.997.2

EBR_Update

root@android:/ #

Option 2 i don't also get the UN_Lock_code= :(
[HTC One S] trigger1209:
Its been a while since I have unlocked my One S but I would go with method 3. Download the bash script and follow to directions running on a stock based rom. (Like trick droid) how that helps. :)
[HTC One S] lmcmil:
Already tryed, also don't work...
[HTC One S] Bad.Fish:
Method 2 worked for me on my one s hboot 2.15
[HTC One S] lmcmil:
I think the problem is my HTC One S was locked to Portuguese Vodafone, wich i unlocked using an ebay unlock code.

Recently had to send the phone to repair, under warranty.

The changed the main board and also IMEI, so the phone got locked again but now it says Vodafone UK.

Already contacted several unlock code pages and someone told me that after repair not every IMEI has unlock code :(
[HTC One S] lmcmil:
On step 1 of method 1 i get:

su

root@android:/ # strings -n 8 /dev/block/mmcblk0p6

strings -n 8 /dev/block/mmcblk0p6

macaddr=84:7A:88:47:E2:5F

20140801

419L52C812455

SH26KW403040

1.75.997.2

EBR_Update

root@android:/ #

So no IMEI or UN_Lock_code=XXXXXX

On method 3 :

su

root@android:/ # /system/unlock.sh

/system/unlock.sh

This script will calculate the SIM Network Unlock Code for the HTC One S.

*You must run this script as root

*You must have BusyBox installed (free from the Google Play Store)

Full credit goes to ascot17 and jh787 for their work in breaking the code.

IMEI:

UN_Lock_code:

/system/unlock.sh[34]: + + : unexpected 'end of expression'

1|root@android:/ #

Any tips?
[HTC One S] edge540T:
I want :D

This works easier, may op can update to 1st post for better psicological health of users.

path dev->block->mmcblk0p6. Opened the file as text and found a line saying

9 digits for me, Un_lock_code = XXXXXXXXX
[HTC One S] sco0by:
This is exactly what I get, regardless of ROM installed :(

I tried this method: http://www.sieempi.eu/blog/2011/09/22/universal-sim-unlock-for-s-offed-htc-devices-536

No matter where I save the config.dat file (intenally or externally) I get "SD init fail !!!"

Interestingly the phone was repaired before, although I had no problem unlocking it and getting S-OFF, SUPERCID etc.

It's on HBOOT 2.16 if that makes any difference?
[HTC One S] edge540T:
Do it manually, a post before of yours. hboot doesn't matter
[HTC One S] crazykas:
Worked!Thanks alot!!

Method 1 & 2 with SENSE ROM Works perfectly!
[HTC One S] Pintxeti:
I have the same issue. How did you solve it?
[HTC One S] lmcmil:
I didn't...

Sold the phone and bought another one.
[HTC One S] edge540T:
http://xdaforums.com/showthread.php?p=29686585#post29686585
[HTC One S] XCT:
bad post
[HTC One S] benyto:
I wanted to post that I was able to unlock my One S using the information in this thread.

I used Method 1 and it worked perfectly to give me my unlock code. However, I was unable to use the code to actually unlock the phone from an AOSP ROM (CM 11). I flashed a Sense ROM (ViperOne S 2.1.0) and the code worked.

Thanks!
[HTC One S] Semmy22:
I have spend the last 3 hours trying to SIMunlock my SGH-1337M Samsung S4 on Bell. This method. Root/RegionAway method. Short of going to a provider to get me an unlock code, any recommendations? Even a reputable unlock code provider?

heading to EU in a few weeks with wife/child and I'd like to get my phone on a EU SIM so I can contact our travel mates and use GPS navigation for the drive from Zurich to Siena via Milan.

Thanks in advance,

Semmy
[HTC One S] vic_111:
Sorry we can´t help you , this forum is only for HTC One S users and this method for HTC One S S4.
[HTC One S] bnight5672:
I am trying to get the un_lock_code for my htc one s and when I hit enter after typing /dev/block/mmcblk0p6 in the terminal emulator it says "permission denied" can anyone help ? I know its an old thread but this is the only phone I currently have to use and I need to unlock it
[HTC One S] george913!:
hello,

i have UN_Lock_code 136210266

imei: 359901048047415

sim unlock code 9470 2219 is incorect password

strange

best regards
[HTC One S] jyotheesh reddy:
Cheap and Best Factory unlocking

Wow > i unlocking my phone in just 5 minutes using mobile unlock 4 ever service

Guys try this Mobile unlock 4 ever Services and save money & time.

no root and no need any tools & no need any software.

i highly recommend this.

find them in facebook by typing mobile unlock 4 ever.

or mail them (mobileunlock4ever@gmail.com )
[HTC One S] ttukka:
This is great. Excellent work! I just tried method 1 and it worked first time!
[HTC One S] skm4u:
i get my HTC one s rooted but i cant install busybox... any suggestion please tell me
[HTC One S] The Lich:
Method 1 worked for me. Already rooted with meefik's busybox. Just used adb instead:

adb shell su 0 strings -n 8 /dev/block/mmcblk0p6

Followed OP instructions without having to use a tool because I can read.

Boom. :good:
[HTC One S] Stanmash:
I have got the same error too. Please any fix on this problem?
[HTC One S] razor26:
Do you have root access?
[HTC One S] Kurajmo:
Is this working on any device? Or only htc? I want unlock my LG F70 for free
[HTC One S] billyboy2316:
deleted

---------- Post added at 11:01 AM ---------- Previous post was at 10:58 AM ----------

Worked perfectly. Thank you Sir
[HTC One S] oldlabguy0:
Here is another sim unlocking guide if you have problem with op method. It supports mode android devices other than htc. However, you should pay for a few bucks. please be noted.
[HTC One S] jetjacky:
please what of other phones?
[HTC One S] gabrielpetriella:
Pleaseeee help

I know is has been a while since this post but is there any posibility to get the Bash script because the link is dead and my sister gave me away this smartphone, so please give me a hand :D
[HTC One S] chopwell20:
this method still working fine..only step i did was method 1 step 1 didnt work then i installed es file explorer then navigate to / dev then block then mmcblk0p6 copied to internal storage .. connected phone to pc and opened that file with notepad ..there are so many spaces so dont think file has finished after reading first line scroll down to the end and to the right left all ways to find all lines .. my lines are as below..

`6î    qßV 0 macaddr=18:87:96:89:3F:37

ƒ÷4ÄŒÏ±µTøØ¥Nw4Ø•]ôWÞ+T

UN_Lock_code=034971607

bottom lines are deleted as post is not going though
[HTC One S] Hnkwar:
Hi there. I ran into an issue attempting to unlock an HTC One S. My IMEI from the dialer is different than the IMEI from mmcblk. Is it possible that a RUU flashed or and HBOOT update changed the IMEI from mmcblk?

Here's the result of my calculation:

--------------------------------------------------

IMEI from mmcblk: xxxxxxxx1313903

Un Lock code from mmcblk: 159454797

Key: 90321313

unlockcode 159454797-90321313=69133484 which was rejected

I also used method 2, and it came up with the same value.

--------------------------------------------------

IMEI from Dialer: xxxxxxxx7821171

Un Lock code from mmcblk: 159454797

Key: 17197821

unlockcode 159454797-17197821=142256976 <- this is 9 digits but the code is supposed to be 8 digits only

I used up 2 attempts with a miscalculation and 1 attempt with the 69133484. I am hoping I could avoid further issues to avoid permanent network sim lock. Any help would be appreciated.
[HTC One S] Benjamin H:
same problem

i have same problem i have different imei in my info also.. and also i cannt find bash script anywhere!! would the auto method work if it calculates the info in my mmcblk06 as it is wrong ? i now have the unlock.sh file but if refuses to let me move it to system help needed
[HTC One S] hakeryk2:
Links to programs does not work - can anyone provide working ones? dl.dropbox.com/u/7524314/SIM%20Unlock.zip is not working
[HTC One S] radumire:
i tried with two terminals emulator but not work. aloways...string not found. i`m root and i unlocked the bootloader.thanks anyway,great job.
[HTC One S] radumire:
ok, I did. I searched manually mmcblk0p6 ficero browser and opened it on the laptop and found the unlock code. desoues was easy to calculate for the password with which you have programilla listo.telefono postado and released. thank you very much, you are the best
[HTC One S] agentc13:
Boot into recovery and open a command prompt, "adb shell" then you can do it from there. I couldn't do it using a terminal emulator either, but it worked when I did that.
[HTC One S] pkshr:
Thanks a lot. The terminal emulator did not work, but this worked. Successfully unlocked the TMOUS HOS
[HTC One S] asterix005:
works on tmobile usa as well. great job.

thanx
[HTC One S] WCCobra:
Wrote an bash script to make it a little easier for the people who have poor math skills like me and also find it hard to enter all those commands in the terminal. Make sure you have all of the prerequisites:

Option 1:

Download the zip

Extract the zip

Move the unlock.sh to /system (it will not run from the sdcard due to Android restrictions)

Open terminal and run:

su <enter>

chmod 777 /system/unlock.sh <enter> (recommended)

/system/unlock.sh <enter>

The unlock code will be shown in the terminal and also saved to /sdcard/sim_unlock_code.txt

To leave the terminal:

exit <enter>

exit <enter>

Option 2:

Download the zip

Extract the zip

Move the unlock.sh to /system (it will not run from the sdcard due to Android restrictions)

Open Root Explorer

Check permissions on /system/unlock.sh are set to allow everyone read, write, and execute (recommended)

Execute the script

The unlock code will be shown in the terminal and also saved to /sdcard/sim_unlock_code.txt

That's it! Feel free to improve the script all you want.
[HTC One S] betostunts:
worked great! I had to do the string command in recovery with adb. I'll try and send donation this weekend :)
[HTC One S] mr.tenuki:
now that we have that method, let's try to find a relation between "UN_Lock_code" and the IMEI or the serial number of the device.

If we can find such a relation, that will help also people who are not rooted.

so, for those who already unlocked, are you willing to post (or send the OP) your "UN_Lock_code" and the phone S/N?

in order to find the SN, go to "settings -> about -> phone identity"
[HTC One S] ascot17:
Many thanks for this. It might need a little tweaking however. It did not work for me in Terminal or via adb shell. Both methods give me this output:

My UN_Lock_code starts with a 'zero' - is that causing a problem?

I changed permissions for /system/ to r/w with root explorer but still get a read-only error....

If you can make it fool-proof I will be glad to add it to the OP.

I would imagine that it is also possible to write an .apk that extracts the appropriate data and delivers a result but I don't have those skills!
[HTC One S] WCCobra:
Typo in the if statement. It should be changed to "if [ $sum -gt 9 ]; then".

Not sure about the "bad number" error. Can you PM me an example IMEI and Un_Lock_code? You can change some of the numbers around... I just want to see if the length is causing it.
[HTC One S] smb282:
Curious, is there a practical use to having SIM unlock other than wanting to use an active AT&T contract on your TMO phone, or vice versa, for example? I'm liable to do it for kicks anyway but was curious if anyone thought of any other uses for having your SIM unlocked. Thanks!
[HTC One S] WCCobra:
Unlocking the SIM only allows the devices to be used with any carrier.
[HTC One S] ascot17:
It is possibly of more practical use in Europe than in the US where there is a greater choice of carriers. Reasons for doing it:

1) Because you can!

2) To use a local SIM when roaming

3) To change carrier at the end of a contract

4) To use the phone in a different country from where you bought it

5) To increase the value of your phone when you eventually sell it on eBay

6) Because you can - again!

:)
[HTC One S] ascot17:
Seems to be bug-free now. Great job!

Added as Method 3 in Post #2
[HTC One S] tritran18518:
i never known our 1S can use ATT 3G. interesting :D
[HTC One S] pkshr:
ATT 3G/4G (or 3.5G) both :) .. that's what I am using
[HTC One S] tritran18518:
An i wonder can htc one x be used on tmobile 4G?
[HTC One S] yajinni:
Just so everyone knows. I tried using the script and it was causing me problems.

First make sure the permissions of the script are set to execute.

Then make sure you have busybox installed.

Then the script will run right.

Also if you use the command way, make sure busybox is installed. i was getting an error with the strings command, and that fixed it. Might want to update the OP to make sure people have busybox.
[HTC One S] viper2000:
Hello,

Are those three working for all SIM locked One S among the carriers? Also, can those work without SIM because I have an AT&T locked One S but don't have AT&T SIM card in hand.