MultiROM Makes its Way Over to the HTC One (M8)

While browsing our forum, you will undoubtedly find more than a few enticing ROMs available … more

Welcome to the New XDA-Developers Portal!

You may recall that a few weeks ago, we opened up the XDA-2015 forum themesto intrepid users … more

An Android Enthusiast’s Apple iPhone 6 Challenge

The media has gone batty again over Apple “revolutionizing” smartphones. … more

Sony to Extend its AOSP Program to Other Devices

Sony will be offering its users the possibility to use AOSP ROMs as an alternative to the … more
Post Reply

[GUIDE] How to properly port RIL part | avoid SIM LOCKING in Sony devices

8th October 2013, 05:31 PM   |  #1  
lozohcum's Avatar
OP Senior Member
Flag Internety
Thanks Meter: 1,374
 
1,550 posts
Join Date:Joined: Jan 2013
More
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.
Last edited by lozohcum; 29th August 2014 at 05:52 PM.
The Following 26 Users Say Thank You to lozohcum For This Useful Post: [ View ]
14th February 2014, 09:46 PM   |  #2  
Senior Member
Flag Lafayette, IN
Thanks Meter: 102
 
366 posts
Join Date:Joined: May 2012
More
If anyone inadvertently flashes a ROM which locks the SIM, can this be reversed?
27th March 2014, 05:31 PM   |  #3  
Member
Thanks Meter: 1
 
40 posts
Join Date:Joined: Feb 2013
same question as the user above..
31st March 2014, 02:31 PM   |  #4  
lozohcum's Avatar
OP Senior Member
Flag Internety
Thanks Meter: 1,374
 
1,550 posts
Join Date:Joined: Jan 2013
More
It cannot be undone. Please stop asking this is thread for devs.
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Sony Cross-Device Development General by ThreadRank