I saw that a company had managed to unlock the g1, only needing the IMEI number to do so. This made me wonder how much information I would be able to obtain about the unlocking process, just by looking at the code, so I grabed a copy and started searching (thanks to grep), this is what I got so far.
From the video showing of the unlocking process, I found the string (SIM network unlock PIN:) displayed when the user is about enter the unlocking key, and started by searching for this, and got a file packages/apps/Phone/res/values/strings.xml, which containes the line “<string name=”label_ndp”>SIM network unlock PIN:</string>”, and some additional lines with content like “Network unlock successful”, this seems to be some translation like file (other translation is also in the folder “values”).
Next I tried searching for “label_ndp”, and among others got the file packages/apps/Phone/res/layout/sim_ndp.xml, which seems to be a layout file, for tha network unlock screen (or network depersonalization as it seems to be referrenced by the system), which has a line containg “android:text=”@string/label_ndp”/>”.
By searching for “sim_ndb”, i found a file, containing a line “setContentView(R.layout.sim_ndp);”, “packages/apps/Phone/src/com/android/phone/SimNetworkDepersonalizationPanel.java”. This file seems to be loading the layout, and linking it to some code, like the lines:
|
1 2 3 4 |
if (DBG) log("requesting network depersonalization with code " + pin); mPhone.getSimCard().supplyNetworkDepersonalization(pin, Message.obtain(mHandler, EVENT_SIM_NTWRK_DEPERSONALIZATION_RESULT)); indicateBusy(); |
My next search was on the string “supplyNetworkDepersonalization“, which gave a about a handful of results, the most interesting was /frameworks/base/telephony/java/com/android/internal/telephony/gsm/RIL.java, which has the following function
|
1 2 3 4 5 6 7 8 9 |
public void supplyNetworkDepersonalization(String netpin, Message result) { RILRequest rr = RILRequest.obtain(RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION, result); if (RILJ_LOG) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); rr.mp.writeInt(1); rr.mp.writeString(netpin); send(rr); } |
This is about as far as I got, if any one else has some interresting knowledge/links about this subject, please let me know…
It is very interesting…
So you had already getten the way how to unlock the G1 SIM lock..right?
Would you pls share to me?
Thanks a lot
Eric: No haven’t figured out how to unlock the phone, I do not event have a android phone. If you want unlocked android phone you could try http://www.unlock-tmobileg1.com/ or buy a android dev phone http://code.google.com/intl/da/android/dev-devices.html
Thanks for the interest
Yeah..It should be a littel hard..but I think what you found is close to fingure out how to get it done..
I had updated the bootloader to Dev1..but still doens’t work for unlocking the SIM card.
It”s weird.. so there is a number of retry before it get locked forever? I could not find anything in the sources, I think that I can try as many I wish.. or I’m wrong? (if yes, show me where in the source code)