Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,739,262 Members 49,852 Now Online
XDA Developers Android and Mobile Development Forum

[FOR DEVS] Advice - how to avoid SIM LOCKING |VERY IMPORTANT|

Tip us?
 
lozohcum
Old
#1  
lozohcum's Avatar
Senior Member - OP
Thanks Meter 1220
Posts: 1,412
Join Date: Jan 2013
Location: Internety
Default [FOR DEVS] Advice - how to avoid SIM LOCKING |VERY IMPORTANT|

Hey,

I noticed some people started making roms without proper knowledge about porting and it's consequences.

So I'm here to explain how to fix issue of getting sim-locked phones. It occurs mostly to new phones.



1. Ensure you have correctly ported framework.jar - this stage is critical

Explanation:
base - rom/file that is working on our phone, mostly it's our CM10 FXP
port - rom/file that we are porting

a) Decompile framework.jar using apktool (both files from port and base rom)
b) Navigate to: smali/com/android/internal/telephony/
c) Copy& Replace all .smali files that have "RIL" in name - from base to port, it's logical. We want working "gsm drivers".
d) Ensure that PhoneFactory.smali is identical as the one from base rom
e) Compile framework.jar

2. Fix Phone.apk - this is the place where most of people fail in porting, mostly sim locking is caused by forgetting about this

a) Decompile Phone.apk from port rom
b) Navigate to res/values and open bools.xml in Notepad++ or Geany (program is important too)
c) you will have something like this: (focus on red values)


Quote:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="ignore_sim_network_locked_events">false</bool>
<bool name="sim_network_unlock_allow_dismiss">false</bool>
<bool name="world_phone">false</bool>
<bool name="config_enable_dialer_key_vibration">true</bool>
<bool name="tty_enabled">true</bool>
<bool name="hac_enabled">false</bool>
<bool name="dtmf_type_enabled">false</bool>
<bool name="auto_retry_enabled">false</bool>
<bool name="allow_local_dtmf_tones">true</bool>
<bool name="config_show_onscreen_dial_button">true</bool>
<bool name="send_mic_mute_to_AudioManager">false</bool>
<bool name="has_in_call_noise_suppression">false</bool>
<bool name="allow_emergency_numbers_in_call_log">false</bool>
<bool name="csp_enabled">false</bool>
<bool name="config_voice_privacy_disable">false</bool>
<bool name="config_voice_capable">true</bool>
<bool name="config_built_in_sip_phone">true</bool>
<bool name="config_call_recording">true</bool>
<bool name="config_call_stream_recording">false</bool>
<bool name="config_download_mms_always">true</bool>
<bool name="config_preferred_network_type_when_data_enab led">true</bool>
<bool name="config_smsc_address_encoded">false</bool>
<bool name="config_support_dialing_emergency_number_suff ix">true</bool>
<bool name="config_support_dialing_emergency_number_dire ctly">true</bool>
</resources>
All those red values are wrong.

This is CORRECTED version:

Quote:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="ignore_sim_network_locked_events">true</bool>
<bool name="sim_network_unlock_allow_dismiss">true</bool>
<bool name="world_phone">false</bool>
<bool name="config_enable_dialer_key_vibration">true</bool>
<bool name="tty_enabled">true</bool>
<bool name="hac_enabled">false</bool>
<bool name="dtmf_type_enabled">false</bool>
<bool name="auto_retry_enabled">false</bool>
<bool name="allow_local_dtmf_tones">true</bool>
<bool name="config_show_onscreen_dial_button">true</bool>
<bool name="send_mic_mute_to_AudioManager">true</bool>
<bool name="has_in_call_noise_suppression">false</bool>
<bool name="allow_emergency_numbers_in_call_log">false</bool>
<bool name="csp_enabled">false</bool>
<bool name="config_voice_privacy_disable">false</bool>
<bool name="config_voice_capable">true</bool>
<bool name="config_built_in_sip_phone">true</bool>
<bool name="config_call_recording">true</bool>
<bool name="config_call_stream_recording">false</bool>
<bool name="config_download_mms_always">true</bool>
<bool name="config_preferred_network_type_when_data_enab led">true</bool>
<bool name="config_smsc_address_encoded">false</bool>
<bool name="config_support_dialing_emergency_number_suff ix">true</bool>
<bool name="config_support_dialing_emergency_number_dire ctly">true</bool>
</resources>

So ensure you have the correct values in bools.xml.

Also small explanation:

Quote:
<bool name="send_mic_mute_to_AudioManager">true</bool>
This is for working microphone in calls, if the value is false microphone doesn't work on our phones.
d) Compile Phone.apk



Now use fixed framework.jar and Phone.apk in rom your are porting to our devices.

I hope now you understand the issue.
I don't reply PM if the answer is on the forum.


The Following 24 Users Say Thank You to lozohcum For This Useful Post: [ Click to Expand ]
 
pTeronaut
Old
#2  
Senior Member
Thanks Meter 97
Posts: 348
Join Date: May 2012
Location: Lafayette, IN
If anyone inadvertently flashes a ROM which locks the SIM, can this be reversed?
[This space for rent]
 
inaroom
Old
#3  
Member
Thanks Meter 1
Posts: 36
Join Date: Feb 2013
same question as the user above..
 
lozohcum
Old
#4  
lozohcum's Avatar
Senior Member - OP
Thanks Meter 1220
Posts: 1,412
Join Date: Jan 2013
Location: Internety
It cannot be undone. Please stop asking this is thread for devs.
I don't reply PM if the answer is on the forum.


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Device Review: OnePlus One

Seemingly every day, there are a bunch of new devices being released. Some are budget devices and some are … more

Browse the Internet with the Innovative Atlas Web Browser

For the most part, Chrome, Firefox, and Dolphin Browser have no real rivals among … more

Choose from Over a Thousand Battery Styles with 3Minit Battery Mod

The battery style in stock Android looks pretty dull. It doesn’t … more

Organize Your Cloud Storage Files with Unclouded

Cloud storage services like Dropbox or Google Drive have grown in popularity dramatically … more