The unlock code can be given by your carrier only when you have finished the contract time or they will charge you a very big amount of money. You can get an unlock code by visiting local phone service shops. They will unlock your phone, but the phone will be out of warranty. Unfortunately, you can't keep the phone in factory condition and being unlock in the same time.