[Galaxy S III Themes and Apps] MattBooth:
This guide adds a 2G/3G/Auto toggle to the Lidroid 23 Toggles, making it 24 toggles instead. It is based on this guide by Neme77. I've just done some legwork and made it compatible with the wanam version of the lidroid framework we're all using.

For this guide you will need:

APKtool

signapk

2G_Toggle_SecPhone.apk.zip

2G_Toggle_SystemUI.apk.zip

CWM_2G_Toggle.zip - A Blank CWM zip for you to flash your modded files

once you've made them

.

The latest translated version of the Lidroid framework from here

You will be decompiling:

SystemUI.apk

SecPhone.apk

services.jar

Firstly decompile SecPhone.apk using apktool and then extract the contents of 2G_Toggle_SecPhone.apk.zip into:

SecPhone.apk/smali/

Now we need to add some lines to the AndroidManifest.xml for SecPhone.apk. Open up the file and add the lines in red:

<receiver android:name="CallerInfoCacheUpdateReceiver">
<intent-filter>
<action android:name="com.android.phone.UPDATE_CALLER_INFO_CACHE" />
</intent-filter>
</receiver>
<receiver android:name="PhoneApp$NotificationBroadcastReceiver" exported="false">
<intent-filter>
<action android:name="com.android.phone.ACTION_HANG_UP_ONGOING_CALL" />
<action android:name="com.android.phone.ACTION_CALL_BACK_FROM_NOTIFICATION" />
<action android:name="com.android.phone.ACTION_SEND_SMS_FROM_NOTIFICATION" />
</intent-filter>
</receiver>
[COLOR="Red"]<receiver android:name="NetworkModeReceiver">
<intent-filter>
<action android:name="com.android.phone.CHANGE_NETWORK_MODE" />
<action android:name="com.android.phone.NEW_NETWORK_MODE" />
</intent-filter>
</receiver>[/COLOR]
<uses-library android:name="com.sec.android.app.multiwindow" android:required="false" />
<uses-library android:name="libvtmanagerjar" />
<uses-library android:name="secmediarecorder" />
<uses-library android:name="sec_platform_library" />
<uses-library android:name="touchwiz" />
</application>
</manifest>

In the original guide, he goes about it differently, but it wouldn't work for me. However, since version XXEMR2 has changed the way the firmware handles the System user you need to edit the services.jar in order to get certain toggles working, as mentioned by wanam here.

Recompile SecPhone and sign it using signapk. You can use this command:

java -jar signapk.jar certificate.pem key.pk8 your-app.apk your-signed-app.apk

Next, decompile SystemUI.apk and extract the 2G_Toggle_SystemUI.apk.zip into:

SystemUI.apk/smali/

Overwrite any files.

You may want to prep your SystemUI for later revisions and open your AndroidManefest.xml file and change the header to this:

<?xml version="1.0" encoding="utf-8"?>
<manifest android:sharedUserId="android.uid.system" android:process="system" android:versionCode="16" [COLOR="Red"]android:versionName="4.1.2-I9300XXEMR2"[/COLOR] package="com.android.systemui" coreApp="true"
xmlns:android="http://schemas.android.com/apk/res/android">

Taking care to change the red text to your version.

Recompile SystemUI.apk. If you changed the AndroidManifest.xml, sign the package like we did the SecPhone.apk

Now decompile services.jar from /system/framework/

Find:

PackageManagerService.smali

and look for the method:

.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I

Replace the whole method with this:

.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
.locals 7
.parameter "s1"
.parameter "s2"

.prologue
const/4 v6, 0x0

const-string v3, "Wanam: PackageManager"

const-string v4, "Skip signature check."

invoke-static {v3, v4}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I

return v6
.end method

Recompile

You can now copy your modded files into the CWM_2G_Toggle.zip file. Take care to match the names as they go in. "SystemUI.apk" must be named like that, "SecPhone.apk" must be named like that also

NB: It takes about a minute to switch from 2G to 3G and vice versa. If you dial *#197328640# you can observe the change from WCDMA2100 to GSM1800 as you switch.