[S4][Hack][Root] SIM Unlock for FREE

Search This thread

The Lich

Member
Oct 22, 2013
44
20
Method 1 worked for me. Already rooted with meefik's busybox. Just used adb instead:
Code:
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:
 
Last edited:

Stanmash

New member
Jul 31, 2016
3
0
Lagos
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

I have got the same error too. Please any fix on this problem?
 

billyboy2316

Senior Member
Mar 22, 2012
210
29
California
deleted

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

Background:

The HTC Sensation has a sim unlock code on /dev/block/mmcblk0p6.
This was found and exploited months ago by Sensation users.
For the One S, HTC have decided to get a bit sneaky. The code still exists on the same block but they have encrypted the actual SIM unlock code by adding a key generated from the phone’s IMEI number.
This method uses the IMEI number to calculate the key which can then be subtracted to give a working SIM unlock code.

Thanks to contributions from various users, we now have 3 different methods of obtaining your SIM unlock code.
All are tested and confirmed to work on all versions of the HTC One S.

Method 1 (details below) requires no downloads and takes about 5 minutes.
Method 2 uses the first step of method 1 and then a small executable program on a Windows PC to do the calculation.
Method 3 requires the download of a Bash Script but fully automates the procedure.

Note 1: All methods require Root and only work at present for the S4 version.

Note 2: It is possible that the 'strings' command referred to in the text will only work if you have Busybox installed. If you are already using a custom ROM, you will probably have this. If you are on a rooted Stock ROM and cannot execute the strings command, try installing Busybox first.
Any feedback on this issue would be welcomed in the thread.

Note 3: CM10 based ROMS will normally return the correct values for UN_Lock_code, but fail to unlock when a new SIM card is inserted. If you have this problem, revert to a Sense-based ROM (e.g Trickdroid, Venom) for the unlock process. You may return to a CM10 base after the phone is unlocked.

Methods 2 and 3 can be found in Post 2.

METHOD 1

To find your SIM UNLOCK CODE you need:

1) Root
2) Android Terminal Emulator (free from the market)
3) Your IMEI number (dial *#06# on your dialler)

There are 4 steps to the process:

1) Obtain your UN_lock_code from your phone
2) Calculate the key from your IMEI number
3) Subtract (2) from (1)
4) Unlock your phone

Step 1

Obtain your UN_lock_code from your phone as follows:

Open the Terminal Emulator app and type:

su [enter]
strings -n 8 /dev/block/mmcblk0p6 [enter]

It will output several lines of data (including your IMEI number)
One of the lines will be [eg] UN_Lock_code=063312345

Make a note of this number (This is NOT your SIM unlock code)!

Step 2

Make a key from your IMEI number:

a) Write down the last 7 digits of your IMEI number in this format: 1234 567

b) Reverse the 2 blocks: 567 1234

c) Add a 4th digit X: 567 X 1234 where:

X = the sum of the first 3 digits (If the sum is 2 digits, write only the 2nd digit)

[5 + 6 + 7 = 18 in the example above so X = 8]

[if the sum is 3, X = 3]
[if the sum is 17, X = 7]
[if the sum is 25, X = 5] etc.

Using the above IMEI number we get:

567 8 1234 (= the key)

Step 3

Perform a simple sum.

UN_Lock_code [step 1] – key [step 2] = SIM UNLOCK CODE

e.g. 063312345 - 56781234 = 6 531 111

This needs to be an 8-digit number, so add a zero at the beginning if necessary

YOUR SIM UNLOCK CODE IS: 0653 1111

Step 4

Unlock your phone

a) Remove your SIM card (no need to turn off the phone)
b) Insert alternate SIM card
c) When prompted, enter SIM UNLOCK CODE obtained from step 3
d) Reboot when instructed
Worked perfectly. Thank you Sir
 
Last edited:

oldlabguy0

Member
Dec 15, 2015
13
0
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.
 
Last edited:

jetjacky

New member
Dec 20, 2016
4
1
Background:

The HTC Sensation has a sim unlock code on /dev/block/mmcblk0p6.
This was found and exploited months ago by Sensation users.
For the One S, HTC have decided to get a bit sneaky. The code still exists on the same block but they have encrypted the actual SIM unlock code by adding a key generated from the phone’s IMEI number.
This method uses the IMEI number to calculate the key which can then be subtracted to give a working SIM unlock code.

Thanks to contributions from various users, we now have 3 different methods of obtaining your SIM unlock code.
All are tested and confirmed to work on all versions of the HTC One S.

Method 1 (details below) requires no downloads and takes about 5 minutes.
Method 2 uses the first step of method 1 and then a small executable program on a Windows PC to do the calculation.
Method 3 requires the download of a Bash Script but fully automates the procedure.

Note 1: All methods require Root and only work at present for the S4 version.

Note 2: It is possible that the 'strings' command referred to in the text will only work if you have Busybox installed. If you are already using a custom ROM, you will probably have this. If you are on a rooted Stock ROM and cannot execute the strings command, try installing Busybox first.
Any feedback on this issue would be welcomed in the thread.

Note 3: CM10 based ROMS will normally return the correct values for UN_Lock_code, but fail to unlock when a new SIM card is inserted. If you have this problem, revert to a Sense-based ROM (e.g Trickdroid, Venom) for the unlock process. You may return to a CM10 base after the phone is unlocked.

Methods 2 and 3 can be found in Post 2.

METHOD 1

To find your SIM UNLOCK CODE you need:

1) Root
2) Android Terminal Emulator (free from the market)
3) Your IMEI number (dial *#06# on your dialler)

There are 4 steps to the process:

1) Obtain your UN_lock_code from your phone
2) Calculate the key from your IMEI number
3) Subtract (2) from (1)
4) Unlock your phone

Step 1

Obtain your UN_lock_code from your phone as follows:

Open the Terminal Emulator app and type:

su [enter]
strings -n 8 /dev/block/mmcblk0p6 [enter]

It will output several lines of data (including your IMEI number)
One of the lines will be [eg] UN_Lock_code=063312345

Make a note of this number (This is NOT your SIM unlock code)!

Step 2

Make a key from your IMEI number:

a) Write down the last 7 digits of your IMEI number in this format: 1234 567

b) Reverse the 2 blocks: 567 1234

c) Add a 4th digit X: 567 X 1234 where:

X = the sum of the first 3 digits (If the sum is 2 digits, write only the 2nd digit)

[5 + 6 + 7 = 18 in the example above so X = 8]

[if the sum is 3, X = 3]
[if the sum is 17, X = 7]
[if the sum is 25, X = 5] etc.

Using the above IMEI number we get:

567 8 1234 (= the key)

Step 3

Perform a simple sum.

UN_Lock_code [step 1] – key [step 2] = SIM UNLOCK CODE

e.g. 063312345 - 56781234 = 6 531 111

This needs to be an 8-digit number, so add a zero at the beginning if necessary

YOUR SIM UNLOCK CODE IS: 0653 1111

Step 4

Unlock your phone

a) Remove your SIM card (no need to turn off the phone)
b) Insert alternate SIM card
c) When prompted, enter SIM UNLOCK CODE obtained from step 3
d) Reboot when instructed
please what of other phones?
 
  • Like
Reactions: gabrielpetriella

gabrielpetriella

New member
Jul 17, 2013
1
0
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
 

chopwell20

Senior Member
Feb 6, 2012
70
11
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
 

Hnkwar

New member
Jul 21, 2017
1
0
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.
 
Last edited:

Benjamin H

New member
Aug 25, 2017
1
0
same problem

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.



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
 
Last edited:

hakeryk2

Member
May 13, 2019
5
0
Links to programs does not work - can anyone provide working ones? dl.dropbox.com/u/7524314/SIM%20Unlock.zip is not working
 

Top Liked Posts

  • There are no posts matching your filters.
  • 245
    Background:

    The HTC Sensation has a sim unlock code on /dev/block/mmcblk0p6.
    This was found and exploited months ago by Sensation users.
    For the One S, HTC have decided to get a bit sneaky. The code still exists on the same block but they have encrypted the actual SIM unlock code by adding a key generated from the phone’s IMEI number.
    This method uses the IMEI number to calculate the key which can then be subtracted to give a working SIM unlock code.

    Thanks to contributions from various users, we now have 3 different methods of obtaining your SIM unlock code.
    All are tested and confirmed to work on all versions of the HTC One S.

    Method 1 (details below) requires no downloads and takes about 5 minutes.
    Method 2 uses the first step of method 1 and then a small executable program on a Windows PC to do the calculation.
    Method 3 requires the download of a Bash Script but fully automates the procedure.

    Note 1: All methods require Root and only work at present for the S4 version.

    Note 2: It is possible that the 'strings' command referred to in the text will only work if you have Busybox installed. If you are already using a custom ROM, you will probably have this. If you are on a rooted Stock ROM and cannot execute the strings command, try installing Busybox first.
    Any feedback on this issue would be welcomed in the thread.

    Note 3: CM10 based ROMS will normally return the correct values for UN_Lock_code, but fail to unlock when a new SIM card is inserted. If you have this problem, revert to a Sense-based ROM (e.g Trickdroid, Venom) for the unlock process. You may return to a CM10 base after the phone is unlocked.

    Methods 2 and 3 can be found in Post 2.

    METHOD 1

    To find your SIM UNLOCK CODE you need:

    1) Root
    2) Android Terminal Emulator (free from the market)
    3) Your IMEI number (dial *#06# on your dialler)

    There are 4 steps to the process:

    1) Obtain your UN_lock_code from your phone
    2) Calculate the key from your IMEI number
    3) Subtract (2) from (1)
    4) Unlock your phone

    Step 1

    Obtain your UN_lock_code from your phone as follows:

    Open the Terminal Emulator app and type:

    su [enter]
    strings -n 8 /dev/block/mmcblk0p6 [enter]

    It will output several lines of data (including your IMEI number)
    One of the lines will be [eg] UN_Lock_code=063312345

    Make a note of this number (This is NOT your SIM unlock code)!

    Step 2

    Make a key from your IMEI number:

    a) Write down the last 7 digits of your IMEI number in this format: 1234 567

    b) Reverse the 2 blocks: 567 1234

    c) Add a 4th digit X: 567 X 1234 where:

    X = the sum of the first 3 digits (If the sum is 2 digits, write only the 2nd digit)

    [5 + 6 + 7 = 18 in the example above so X = 8]

    [if the sum is 3, X = 3]
    [if the sum is 17, X = 7]
    [if the sum is 25, X = 5] etc.

    Using the above IMEI number we get:

    567 8 1234 (= the key)

    Step 3

    Perform a simple sum.

    UN_Lock_code [step 1] – key [step 2] = SIM UNLOCK CODE

    e.g. 063312345 - 56781234 = 6 531 111

    This needs to be an 8-digit number, so add a zero at the beginning if necessary

    YOUR SIM UNLOCK CODE IS: 0653 1111

    Step 4

    Unlock your phone

    a) Remove your SIM card (no need to turn off the phone)
    b) Insert alternate SIM card
    c) When prompted, enter SIM UNLOCK CODE obtained from step 3
    d) Reboot when instructed
    94
    Please hit the thanks button! ;)


    METHOD 2 - Semi Automatic

    Windows PC.

    For this method follow step (1) from the above post to obtain your UN_Lock code

    You can then download this app which will automate the calculation process.

    simunlock.jpg


    Enter your UN_Lock code and the last 7 digits of your IMEI number and press the 'OK' button.
    Your SIM Unlock code will be shown in the bottom box.


    METHOD 3 - Fully Automatic

    a) Download this Bash Script
    b) Extract the zip
    c) Move the unlock.sh to /system/ (it will not run from the sdcard due to Android restrictions)
    d) Open terminal and run:

    su <enter>
    /system/unlock.sh <enter>

    (Or execute the .sh file directly from root explorer)

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

    Credits

    This is not all my own work!
    Several people have contributed to this thread. If you appreciate their work, please hit the thanks button in their posts as well.

    Method 1

    Thank you to jh787 for this post. He was the first guy to compare the UN_Lock_code to his real (paid-for) sim unlock code.
    I just tweaked the idea to find the mysterious X (and provided this guide).
    Thanks also to jh787, mycomputerisjunk, rh387 and eneka who provided me with their actual unlock codes.
    This allowed me to work out how to calculate the key and validate the method.

    Method 2

    Many thanks to Josnaro for the code and Wel1973 for the translation (this post).

    Method 3

    Bash script courtesy of WCCobra in this post
    11
    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.
    5
    PC App for Unlock ( Based on his Work!! )

    The first thing, to congratulate them on the tutorial. It is fantastic.

    Now, do I leave to you an application based on his work, so that it could use it also, because not??
    The author of the application, does not raise it because it does not have sufficient Post, and cannot. Explained this:
    The translation of the aplicascion is mine. JOSNARO is not on good terms with English. So that they all enjoy it in this Forum. Of which I feel proud to serve them...
    I give to him thank you on his part for his Big Work.
    Here the application:

    View attachment 1110830

    https://sourceforge.net/projects/josnaro/files/SIM%20Unlock_Eng.zip/download


    This would be to automate the whole process of operations...
    Greetings!!
    2
    Will Be Really Thankful To You If You Do This Properly.
    I am Getting a HTC One S From Canada and I would Need to Unlock It After I Get It
    Thanks In Advance !!
    Also Pressed It !!

    I wrote an Easy Guide On My Blog
    http://www.freshnewsarea.com/?p=1411