[Testers needed] Prevent WP7 from Relocking on HTC, LG, Dell & Samsung!

Search This thread

Morpheus90

Retired Recognized Developer
Jan 8, 2009
264
202
Lecce
www.ugopiemontese.eu
Hi Guys,

I tought a simple and universal method to avoid WP7 relocking problem: edit the Windows\System32\drivers\etc\hosts file on your pc after unlocking your device with CrevronWP7. Let me explain.

Technical explaination, you can skip to the next paragraph if you're not interested in

I used open source Network analyzer Wireshark on my pc to discover which domains Zune connect once a WP7 is connected via usb (while WiFi is off on the device).
They where:
developerservices.windowsphone-int.com
developerservices.windowsphone.com

catalog.zune.net (-> media info, covers, apps info etc...?)
socialapi.zune.net (-> Zune social access)
commerce.zune.net (-> Zune market access)
download.windowsupdate.com (-> updates check)
download.microsoft.com (-> updates check)
update.microsoft.com (-> updates check)
login.live.com (-> Live.com access)

Of course the first 2 domains are the ones responsible of the relock, they are also listed in each phone registry. Editing the Windows\System32\drivers\etc\hosts file on your pc make your pc unable to connect to the real M$ servers, pointing it to your ip on the local loopback net (127.0.0.1) instead.

How to edit the file mentioned
  1. Unlock your phone with Chevron before doing anything, then disconnect it from your pc. If it's already unlocked you can go on to the next step.
  2. With text editors like Notepad or Notepad++ (absolutely NOT Wordpad or Word) open the
    C:\Windows\System32\drivers\etc
    file on your pc. Eventually, modify "C" letter with the matching one of the partition where Windows system is. Check modify and write permissions for your user from file properties before, of course, otherwise you will not be able to save.
  3. Add the following lines at the end of the file:
    127.0.0.1 developerservices.windowsphone.com
    127.0.0.1 developerservices.windowsphone-int.com​
    then save it and close the editor. Modify user permissions for the hosts file disabling write and modify capability, then reboot your pc.
  4. Turn Off WiFi on your WP7 device before connect it to Zune, then Sync via usb. It should not relock anymore.

It's working fine on my LG Optimus 7 and HTC HD7 since I bought them, about a month ago (It's true that I am a registered student developer since January 7, but I never registered any phone of mine to AppHub). A friend of mine also tried this method and worked. A blog author I know is instead having troubles with his Omnia 7, his phone is still relocking.

I need some feedback from you, xda members. Try this method and report your impressions in this topic! ;)
Link to the Italian version: http://www.sevenphone.it/2011/01/18/come-impedire-relock-wp7-zune/
 
Last edited:

Morpheus90

Retired Recognized Developer
Jan 8, 2009
264
202
Lecce
www.ugopiemontese.eu
Does not work for my Samsung Focus. I did everything listed but it still relocks every time I connect to the Zune software.

Mmm I suppose it's a samsung devices problem...

Could you please download and install Wireshark? I need some network dumps!

If you or someone else is interested in testing, I'll post detailed instructions...
 
Last edited:

xmckinzie

Senior Member
Feb 22, 2009
277
40
Atlanta, GA
Hi Guys,

I tought a simple and universal method to avoid WP7 relocking problem: edit the Windows\System32\drivers\etc\hosts file on your pc after unlocking your device with CrevronWP7. Let me explain.

Technical explaination, you can skip it to the next paragraph if you're not interested in

This didn't work on my Samsung Focus. The best way to prevent it was to put it in Airplane mode before connecting to computer, then disabling airplane mode when I disconnect from computer.
 

Morpheus90

Retired Recognized Developer
Jan 8, 2009
264
202
Lecce
www.ugopiemontese.eu
Just installed Wireshark. What do I do now?

Well, once Wireshark opens you have to select the Network card you use to connect to the internet with your pc.
Under the "Capture" and "Interface list" titles (on the left) you can find a list, be sure to click on the right one.
(Remember to close the browser or other apps accessing the internet while you are dumping packages on the network.)

Open Zune, the connect the phone. Wait until the phone relocks, then stop live capture in WireShark.
stoplivecapture.png


To save the dump, click on
File -> Save
and choose a name and a position on your Hard Disk (saving as .pcap is fine).

Upload it somewhere (on this forum is fine, too) and post the link in this thread ;)

Any volunteer could do the same!

For security reasons, please don't use your browser or any other program to log in with your Username and password anywhere on the net while dumping!
 
Last edited:

lucasryan

Senior Member
Dec 20, 2010
442
74
Tennessee
I also have a samsung focus and this did not work for me either...what would it matter what device we are using if they all connect to that domain using zune? After editing the host file and then going back and unlocking device then going back in to the host file wpd shows back up:
127.0.0.1 developerservices.windowsphone.com
127.0.0.1 developerservices.windowsphone-int.com

192.168.1.64 developerservices.windowsphone.com

and in the firewall it says that zune is not enabled but says to allow?
 
Last edited:

Morpheus90

Retired Recognized Developer
Jan 8, 2009
264
202
Lecce
www.ugopiemontese.eu
I also have a samsung focus and this did not work for me either...what would it matter what device we are using if they all connect to that domain using zune? After editing the host file and then going back and unlocking device then going back in to the host file wpd shows back up:
127.0.0.1 developerservices.windowsphone.com
127.0.0.1 developerservices.windowsphone-int.com

192.168.1.64 developerservices.windowsphone.com

and in the firewall it says that zune is not enabled but says to allow?

Well, I tought this method would be device-indipendent, too, but Samsung users are still having issues while on LG, HTC and (probably) Dell is working fine. Maybe they use another subdomain on Microsoft's servers? I dunno.

BTW, you have to unlock the device BEFORE following this tutorial, otherwise ChevronWP7 changes that file adding an unwanted line at the end.
 

lucasryan

Senior Member
Dec 20, 2010
442
74
Tennessee
Well, I tought this method would be device-indipendent, too, but Samsung users are still having issues while on LG, HTC and (probably) Dell is working fine. Maybe they use another subdomain on Microsoft's servers? I dunno.

BTW, you have to unlock the device BEFORE following this tutorial, otherwise ChevronWP7 changes that file adding an unwanted line at the end.


yes i did have mine unlocked...but i found a simpler way to keep from unlocking with registry editor
 

gropich

Senior Member
Oct 16, 2008
54
1
for me,for the moment it works.. i unlocked my HD7 (with hard reset before cause was impossible to re-unlock) and after your tweak my phone is always unlocked :p
Speriamo che dura e che continua cosi,mi vedo male resetare tutto ogni volta :D
 

DanielNTX

Senior Member
Aug 18, 2010
268
82
Austin, Texas
Interesting, but I have a different method from my thread over in the HD2 forum:
I wrote this inside of another thread, but decided to make a new thread because others may not find it or read it. For those who have tried everything, this is the reason why you can't unlock the phone unless you do a full reset:

The majority of the failures to unlock your phone again is because you used a registry script that changed the HD2 to identify it as an HD7 and may have included registry entries that set PortalUrlProd and PortalUrlInt to 127.0.0.1 or a Null value and somehow your phone became relocked. Once it's set this way, no matter what you do to unlock the phone it won't work because the proper server to query is "developerservices.windowsphone.com" is not defined on the phone. ChevronWP7 works by hijacking and spoofing the address of developerservices.windowsphone.com to be your local computer and then responds appropriately over port HTTPS (443) to the phone.

From this post, Microsoft/ChevronWP7 responds with this:
Code:
<DaysLeft>365</DaysLeft>
<AppsAllowed>10</a:AppsAllowed>

If you set it to 127.0.0.1 in the registry this references your phone when it tries to unlock. The phone itself is not running a spoofed HTTPS server so it will never work. Setting it to null means it doesn't no where to go either. If your phone is working in Zune and you hit the end button on the phone, you will notice ChevronWP7 will report that the phone is pin-locked, this means ChevronWP7 knows about the phone, but the "uh oh - Please make sure it's connected using USB, Please start the Zune application" message it generates is kind of ambiguous and is not the actual error we are seeing here.

The original values are these:
Code:
[HKEY_LOCAL_MACHINE\Software\Microsoft\DeviceReg]
"PortalUrlProd"="https://developerservices.windowsphone.com/Services/WindowsPhoneRegistration.svc/01/2010"
PortalUrlInt"="https://developerservices.windowsphone-int.com/Services/WindowsPhoneRegistration.svc/01/2010"

and the corresponding certificate is this:
chevroncert.jpg


That's how the phone can trust the HTTPS connection because you imported the certificate.

Now if you change the URL to something else, you will need a corresponding certificate. You can make one with makecert.exe or makessl.exe form the various resource/development toolkits out there on the Microsoft website.

In my example, I'm going to use a site that doesn't exist "developerservices.unlock.me". You should change the PortalUrlProd and PortalUrlInt on the phone as follows:
Code:
[HKEY_LOCAL_MACHINE\Software\Microsoft\DeviceReg]
"PortalUrlProd"="https://developerservices.unlock.me/Services/WindowsPhoneRegistration.svc/01/2010"
 "PortalUrlInt"="https:/developerservices.unlock.me/Services/WindowsPhoneRegistration.svc/01/2010"

Now in your hosts. file in \windows\system32\drivers\etc folder, you should set up an entry for developerservices.unlock.me with your computer's own IP address.

Once you do you need to install a new certificate on the phone for whatever host in the URL you made and you will be able to use ChevronWP7 to unlock incase it ever locks you out again.

To simplify the making a self-signed certificate portion, I've created a cert for "developerservices.unlock.me" with the validity date of 1000 days. It's included in this post. Hope this helps you all with maintaining an unlocked Windows Phone 7 and understanding why ChevronWP7 won't unlock anymore.
I haven't had it relock on me yet.
 

Attachments

  • unlockme_cert.zip
    875 bytes · Views: 103
  • unlockme_rgu_provxml.zip
    1,017 bytes · Views: 93

Morpheus90

Retired Recognized Developer
Jan 8, 2009
264
202
Lecce
www.ugopiemontese.eu
Well, the problem seems simple to me: who modifies the

Code:
[HKEY_LOCAL_MACHINE\Software\Microsoft\DeviceReg]
"PortalUrlProd"="https://developerservices.windowsphone.com/Services/WindowsPhoneRegistration.svc/01/2010"
PortalUrlInt"="https://developerservices.windowsphone-int.com/Services/WindowsPhoneRegistration.svc/01/2010"

registry values on the phone will not be able to use the trick I posted in this thread to avoid relocking...
Reverting back to the original values will solve the problem! Thanks DanielNTX!
 

christopher1973

New member
Nov 29, 2010
1
0
I also have a samsung focus and this did not work for me either...what would it matter what device we are using if they all connect to that domain using zune? After editing the host file and then going back and unlocking device then going back in to the host file wpd shows back up:
127.0.0.1 developerservices.windowsphone.com
127.0.0.1 developerservices.windowsphone-int.com

192.168.1.64 developerservices.windowsphone.com

and in the firewall it says that zune is not enabled but says to allow?

The problem is you have to save for overwriting the hosts.when u make shure that zune or what never be able overwrite the host,the reunlock never happend again
 

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    Hi Guys,

    I tought a simple and universal method to avoid WP7 relocking problem: edit the Windows\System32\drivers\etc\hosts file on your pc after unlocking your device with CrevronWP7. Let me explain.

    Technical explaination, you can skip to the next paragraph if you're not interested in

    I used open source Network analyzer Wireshark on my pc to discover which domains Zune connect once a WP7 is connected via usb (while WiFi is off on the device).
    They where:
    developerservices.windowsphone-int.com
    developerservices.windowsphone.com

    catalog.zune.net (-> media info, covers, apps info etc...?)
    socialapi.zune.net (-> Zune social access)
    commerce.zune.net (-> Zune market access)
    download.windowsupdate.com (-> updates check)
    download.microsoft.com (-> updates check)
    update.microsoft.com (-> updates check)
    login.live.com (-> Live.com access)

    Of course the first 2 domains are the ones responsible of the relock, they are also listed in each phone registry. Editing the Windows\System32\drivers\etc\hosts file on your pc make your pc unable to connect to the real M$ servers, pointing it to your ip on the local loopback net (127.0.0.1) instead.

    How to edit the file mentioned
    1. Unlock your phone with Chevron before doing anything, then disconnect it from your pc. If it's already unlocked you can go on to the next step.
    2. With text editors like Notepad or Notepad++ (absolutely NOT Wordpad or Word) open the
      C:\Windows\System32\drivers\etc
      file on your pc. Eventually, modify "C" letter with the matching one of the partition where Windows system is. Check modify and write permissions for your user from file properties before, of course, otherwise you will not be able to save.
    3. Add the following lines at the end of the file:
      127.0.0.1 developerservices.windowsphone.com
      127.0.0.1 developerservices.windowsphone-int.com​
      then save it and close the editor. Modify user permissions for the hosts file disabling write and modify capability, then reboot your pc.
    4. Turn Off WiFi on your WP7 device before connect it to Zune, then Sync via usb. It should not relock anymore.

    It's working fine on my LG Optimus 7 and HTC HD7 since I bought them, about a month ago (It's true that I am a registered student developer since January 7, but I never registered any phone of mine to AppHub). A friend of mine also tried this method and worked. A blog author I know is instead having troubles with his Omnia 7, his phone is still relocking.

    I need some feedback from you, xda members. Try this method and report your impressions in this topic! ;)
    Link to the Italian version: http://www.sevenphone.it/2011/01/18/come-impedire-relock-wp7-zune/
    1
    I'm happy to go forward and test this, but I'm just wondering (and this might be a lame n00b question): why not (also) delete it from the phone?

    Or have I already done this when I installed WP7 on my HD2?

    Well, the problem was that not all the phones could access and modify registry until yesterday. ;)

    Now HTC, Samsung and Lg registries can be modified with Advanced Configuration Tool. Dunno about Dell. So the strings involved can be modified directly into the phones now, but - after that - you have to install a new certificate for the 127.0.0.1 domain.

    My tweak, listed in the first post of this thread, is (in my humble opinion) easier and lasts after an upgrade of the firmware, too.
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone