[Galaxy Tab 2 7" Android Development] ketut.kumajaya:
Phone Disabler Patch

Patch for framework-res.apk to disable phone functionality:

diff -U 3 -H -d -r -N -- framework-res/res/values/arrays.xml framework-res/res/values/arrays.xml
[COLOR="Blue"]--- framework-res/res/values/arrays.xml	2013-08-21 16:23:34.000000000 +0700
+++ framework-res/res/values/arrays.xml	2013-08-21 21:44:07.298611970 +0700
@@ -513,11 +513,7 @@[/COLOR]
<string-array name="networkAttributes">
<item>wifi,1,1,1,-1,true</item>
<item>mobile,0,0,0,-1,true</item>
[COLOR="Red"]- <item>mobile_mms,2,0,2,60000,true</item>
- <item>mobile_supl,3,0,2,60000,true</item>
- <item>mobile_dun,4,0,3,60000,true</item>
- <item>mobile_hipri,5,0,3,60000,true</item>
- <item>mobile_bluetooth,7,7,1,-1,true</item>[/COLOR]
[COLOR="Blue"]+ <item>bluetooth,7,7,0,-1,true</item>[/COLOR]
<item>wifi_p2p,13,1,0,-1,true</item>
</string-array>
<integer-array name="config_protectedNetworks">
[COLOR="Blue"]@@ -527,7 +523,6 @@[/COLOR]
</integer-array>
<string-array name="radioAttributes">
<item>1,1</item>
[COLOR="Red"]- <item>0,1</item>[/COLOR]
<item>7,1</item>
</string-array>
<integer-array name="config_data_usage_network_types">
diff -U 3 -H -d -r -N -- framework-res/res/values/bools.xml framework-res/res/values/bools.xml
[COLOR="Blue"]--- framework-res/res/values/bools.xml	2013-08-21 16:23:33.000000000 +0700
+++ framework-res/res/values/bools.xml	2013-08-21 16:35:17.189743553 +0700
@@ -49,8 +49,8 @@[/COLOR]
<bool name="config_bluetooth_wide_band_speech">false</bool>
<bool name="config_bluetooth_adapter_quick_switch">true</bool>
<bool name="config_bluetooth_address_validation">false</bool>
[COLOR="Red"]- <bool name="config_voice_capable">true</bool>
- <bool name="config_sms_capable">true</bool>[/COLOR]
[COLOR="Blue"]+ <bool name="config_voice_capable">false</bool>
+ <bool name="config_sms_capable">false</bool>[/COLOR]
<bool name="config_bluetooth_default_profiles">true</bool>
<bool name="config_sip_wifi_only">false</bool>
<bool name="config_built_in_sip_phone">true</bool>

SecSettings.apk patch to disable WiFi tethering:

diff -U 3 -H -d -r -N -- SecSettings/smali/com/android/settings/Settings.smali SecSettings/smali/com/android/settings/Settings.smali
[COLOR="Blue"]--- SecSettings/smali/com/android/settings/Settings.smali	2013-08-21 16:23:52.000000000 +0700
+++ SecSettings/smali/com/android/settings/Settings.smali	2013-08-20 12:07:22.000000000 +0700
@@ -1942,7 +1942,7 @@[/COLOR]

move-result v0

[COLOR="Red"]- if-ge v1, v0, :cond_51[/COLOR]
[COLOR="Blue"]+ if-ge v1, v0, :cond_52[/COLOR]

.line 997
invoke-interface {p1, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;
[COLOR="Blue"]@@ -1999,13 +1999,13 @@[/COLOR]

move-result v3

[COLOR="Red"]- if-ge v1, v3, :cond_52[/COLOR]
[COLOR="Blue"]+ if-ge v1, v3, :cond_53[/COLOR]

invoke-interface {p1, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

move-result-object v3

[COLOR="Red"]- if-ne v3, v0, :cond_52[/COLOR]
[COLOR="Blue"]+ if-ne v3, v0, :cond_53[/COLOR]

.line 1409
iget-object v3, p0, Lcom/android/settings/Settings;->mFirstHeader:Landroid/preference/PreferenceActivity$Header;
[COLOR="Blue"]@@ -3157,7 +3157,7 @@[/COLOR]
.line 1347
const v3, 0x7f0b051b

[COLOR="Red"]- if-ne v6, v3, :cond_46[/COLOR]
[COLOR="Blue"]+ if-ne v6, v3, :cond_47[/COLOR]

.line 1348
const-string v3, "DCM"
[COLOR="Blue"]@@ -3171,15 +3171,16 @@[/COLOR]
if-eqz v3, :cond_0

.line 1351
[COLOR="Blue"]+ :cond_46[/COLOR]
invoke-interface {p1, v1}, Ljava/util/List;->remove(I)Ljava/lang/Object;

goto/16 :goto_1

.line 1353
[COLOR="Red"]- :cond_46[/COLOR]
[COLOR="Blue"]+ :cond_47[/COLOR]
const v3, 0x7f0b0519

[COLOR="Red"]- if-ne v6, v3, :cond_47[/COLOR]
[COLOR="Blue"]+ if-ne v6, v3, :cond_48[/COLOR]

.line 1355
invoke-interface {p1, v1}, Ljava/util/List;->remove(I)Ljava/lang/Object;
[COLOR="Blue"]@@ -3187,10 +3188,10 @@[/COLOR]
goto/16 :goto_1

.line 1357
[COLOR="Red"]- :cond_47[/COLOR]
[COLOR="Blue"]+ :cond_48[/COLOR]
const v3, 0x7f0b051e

[COLOR="Red"]- if-ne v6, v3, :cond_48[/COLOR]
[COLOR="Blue"]+ if-ne v6, v3, :cond_49[/COLOR]

.line 1359
:try_start_6
[COLOR="Blue"]@@ -3218,10 +3219,10 @@[/COLOR]
goto/16 :goto_1

.line 1363
[COLOR="Red"]- :cond_48[/COLOR]
[COLOR="Blue"]+ :cond_49[/COLOR]
const v3, 0x7f0b0550

[COLOR="Red"]- if-ne v6, v3, :cond_49[/COLOR]
[COLOR="Blue"]+ if-ne v6, v3, :cond_4a[/COLOR]

.line 1365
invoke-interface {p1, v1}, Ljava/util/List;->remove(I)Ljava/lang/Object;
[COLOR="Blue"]@@ -3229,17 +3230,17 @@[/COLOR]
goto/16 :goto_1

.line 1367
[COLOR="Red"]- :cond_49[/COLOR]
[COLOR="Blue"]+ :cond_4a[/COLOR]
const v3, 0x7f0b052d

[COLOR="Red"]- if-ne v6, v3, :cond_4b[/COLOR]
[COLOR="Blue"]+ if-ne v6, v3, :cond_4c[/COLOR]

.line 1368
invoke-direct {p0, v0}, Lcom/android/settings/Settings;->getVoiceControlIntent(Landroid/preference/PreferenceActivity$Header;)Z

move-result v3

[COLOR="Red"]- if-eqz v3, :cond_4a[/COLOR]
[COLOR="Blue"]+ if-eqz v3, :cond_4b[/COLOR]

invoke-direct {p0}, Lcom/android/settings/Settings;->isVoiceControlEnabled()Z

[COLOR="Blue"]@@ -3248,16 +3249,16 @@[/COLOR]
if-nez v3, :cond_0

.line 1370
[COLOR="Red"]- :cond_4a[/COLOR]
[COLOR="Blue"]+ :cond_4b[/COLOR]
invoke-interface {p1, v1}, Ljava/util/List;->remove(I)Ljava/lang/Object;

goto/16 :goto_1

.line 1372
[COLOR="Red"]- :cond_4b[/COLOR]
[COLOR="Blue"]+ :cond_4c[/COLOR]
const v3, 0x7f0b054e

[COLOR="Red"]- if-ne v6, v3, :cond_4c[/COLOR]
[COLOR="Blue"]+ if-ne v6, v3, :cond_4d[/COLOR]

.line 1374
invoke-interface {p1, v1}, Ljava/util/List;->remove(I)Ljava/lang/Object;
[COLOR="Blue"]@@ -3265,10 +3266,10 @@[/COLOR]
goto/16 :goto_1

.line 1376
[COLOR="Red"]- :cond_4c[/COLOR]
[COLOR="Blue"]+ :cond_4d[/COLOR]
const v3, 0x7f0b0556

[COLOR="Red"]- if-ne v6, v3, :cond_4d[/COLOR]
[COLOR="Blue"]+ if-ne v6, v3, :cond_4e[/COLOR]

.line 1378
invoke-interface {p1, v1}, Ljava/util/List;->remove(I)Ljava/lang/Object;
[COLOR="Blue"]@@ -3276,10 +3277,10 @@[/COLOR]
goto/16 :goto_1

.line 1380
[COLOR="Red"]- :cond_4d[/COLOR]
[COLOR="Blue"]+ :cond_4e[/COLOR]
const v3, 0x7f0b0558

[COLOR="Red"]- if-ne v6, v3, :cond_4e[/COLOR]
[COLOR="Blue"]+ if-ne v6, v3, :cond_4f[/COLOR]

.line 1382
invoke-interface {p1, v1}, Ljava/util/List;->remove(I)Ljava/lang/Object;
[COLOR="Blue"]@@ -3287,10 +3288,10 @@[/COLOR]
goto/16 :goto_1

.line 1384
[COLOR="Red"]- :cond_4e[/COLOR]
[COLOR="Blue"]+ :cond_4f[/COLOR]
const v3, 0x7f0b050d

[COLOR="Red"]- if-ne v6, v3, :cond_4f[/COLOR]
[COLOR="Blue"]+ if-ne v6, v3, :cond_50[/COLOR]

.line 1385
const-string v3, "ALL"
[COLOR="Blue"]@@ -3309,10 +3310,10 @@[/COLOR]
goto/16 :goto_1

.line 1388
[COLOR="Red"]- :cond_4f[/COLOR]
[COLOR="Blue"]+ :cond_50[/COLOR]
const v3, 0x7f0b0527

[COLOR="Red"]- if-ne v6, v3, :cond_50[/COLOR]
[COLOR="Blue"]+ if-ne v6, v3, :cond_51[/COLOR]

.line 1389
invoke-static {p0}, Lcom/android/settings/Utils;->hasFingerprintFeature(Landroid/content/Context;)Z
@@ -3327,7 +3328,7 @@
goto/16 :goto_1

.line 1392
[COLOR="Red"]- :cond_50[/COLOR]
[COLOR="Blue"]+ :cond_51[/COLOR]
const v3, 0x7f0b0523

if-ne v6, v3, :cond_0
[COLOR="Blue"]@@ -3351,10 +3352,10 @@[/COLOR]
goto/16 :goto_1

.line 1417
[COLOR="Red"]- :cond_51[/COLOR]
[COLOR="Blue"]+ :cond_52[/COLOR]
return-void

[COLOR="Red"]- :cond_52[/COLOR]
[COLOR="Blue"]+ :cond_53[/COLOR]
move v0, v1

goto/16 :goto_2
diff -U 3 -H -d -r -N -- SecSettings/smali/com/android/settings/TetherSettings.smali SecSettings/smali/com/android/settings/TetherSettings.smali
[COLOR="Blue"]--- SecSettings/smali/com/android/settings/TetherSettings.smali	2013-08-21 16:23:54.000000000 +0700
+++ SecSettings/smali/com/android/settings/TetherSettings.smali	2013-08-21 16:40:59.407440524 +0700
@@ -2885,6 +2885,9 @@[/COLOR]
:goto_1
iput-boolean v7, p0, Lcom/android/settings/TetherSettings;->wifiAvailable:Z

[COLOR="Blue"]+ .line 248
+ iput-boolean v9, p0, Lcom/android/settings/TetherSettings;->wifiAvailable:Z
+[/COLOR]
.line 252
iget-object v7, p0, Lcom/android/settings/TetherSettings;->mBluetoothRegexs:[Ljava/lang/String;

diff -U 3 -H -d -r -N -- SecSettings/smali/com/android/settings/WirelessSettings.smali SecSettings/smali/com/android/settings/WirelessSettings.smali
[COLOR="Blue"]--- SecSettings/smali/com/android/settings/WirelessSettings.smali	2013-08-21 16:23:52.000000000 +0700
+++ SecSettings/smali/com/android/settings/WirelessSettings.smali	2013-08-21 16:07:08.000000000 +0700
@@ -1105,21 +1105,13 @@[/COLOR]
if-eq v0, v1, :cond_b

.line 689
[COLOR="Red"]- invoke-virtual/range {p0 .. p0}, Lcom/android/settings/WirelessSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
-
- move-result-object v28
-
- const-string v29, "roaming_settings"[/COLOR]
[COLOR="Blue"]+ const-string v28, "roaming_settings"[/COLOR]

move-object/from16 v0, p0

[COLOR="Red"]- move-object/from16 v1, v29
-
- invoke-virtual {v0, v1}, Lcom/android/settings/WirelessSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
-
- move-result-object v29[/COLOR]
[COLOR="Blue"]+ move-object/from16 v1, v28[/COLOR]

[COLOR="Red"]- invoke-virtual/range {v28 .. v29}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z[/COLOR]
[COLOR="Blue"]+ invoke-virtual {v0, v1}, Lcom/android/settings/WirelessSettings;->removePreference(Ljava/lang/String;)V[/COLOR]

.line 696
:cond_b
[COLOR="Blue"]@@ -1899,21 +1891,13 @@[/COLOR]
if-nez v28, :cond_b

.line 692
[COLOR="Red"]- invoke-virtual/range {p0 .. p0}, Lcom/android/settings/WirelessSettings;->getPreferenceScreen()Landroid/preference/PreferenceScreen;
-
- move-result-object v28
-
- const-string v29, "roaming_settings"[/COLOR]
[COLOR="Blue"]+ const-string v28, "roaming_settings"[/COLOR]

move-object/from16 v0, p0

[COLOR="Red"]- move-object/from16 v1, v29
-
- invoke-virtual {v0, v1}, Lcom/android/settings/WirelessSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
-
- move-result-object v29[/COLOR]
[COLOR="Blue"]+ move-object/from16 v1, v28[/COLOR]

[COLOR="Red"]- invoke-virtual/range {v28 .. v29}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z[/COLOR]
[COLOR="Blue"]+ invoke-virtual {v0, v1}, Lcom/android/settings/WirelessSettings;->removePreference(Ljava/lang/String;)V[/COLOR]

goto/16 :goto_4

android.policy.jar patch to disable "Data network mode" in boot menu:

diff -U 3 -H -d -r -N -- android.policy.jar.out/smali/com/android/internal/policy/impl/GlobalActions$1.smali android.policy.jar.out/smali/com/android/internal/policy/impl/GlobalActions$1.smali
[COLOR="Blue"]--- android.policy.jar.out/smali/com/android/internal/policy/impl/GlobalActions$1.smali	2013-08-21 16:22:58.000000000 +0700
+++ android.policy.jar.out/smali/com/android/internal/policy/impl/GlobalActions$1.smali	2013-08-21 23:24:30.676480306 +0700
@@ -396,7 +396,7 @@[/COLOR]

move-result v2

[COLOR="Red"]- if-eqz v2, :cond_5[/COLOR]
[COLOR="Blue"]+ if-eqz v2, :cond_0[/COLOR]

.line 378
const-string v2, "SKT"