Created
July 29, 2014 04:00
-
-
Save dynamis/677ef2268e0f1240f83f to your computer and use it in GitHub Desktop.
一部の国内 SIM で APN 設定ができない問題を修正するパッチを適用するスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Firefox OS 1.3 などでは APN 設定ファイル (を読み込む処理) に問題があり、一部の国内 SIM で Setting アプリで APN の設定をしてデータ通信を有効にすることができません。このスクリプトとパッチファイルはその問題を解決するために端末中の Settings アプリを取り出し該当ファイルにパッチを当てて再度端末中に書き込むものです。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ru a/shared/resources/apn.json b/shared/resources/apn.json | |
--- a/shared/resources/apn.json 1970-01-01 09:00:00.000000000 +0900 | |
+++ b/shared/resources/apn.json 1970-01-01 09:00:00.000000000 +0900 | |
@@ -3030,12 +3030,12 @@ | |
}, | |
"440": { | |
"10": [ | |
- {"carrier":"mopera U","apn":"mopera.net","user":"","server":"","password":"","mmsc":""}, | |
- {"carrier":"b-mobile 3G・4G 1GB/Fair","apn":"bmobile.ne.jp","user":"bmobile@fr","server":"","password":"bmobile","authtype":"3","mmsc":""}, | |
- {"carrier":"b-mobile 3G・4G U300","apn":"bmobile.ne.jp","user":"bmobile@u300","server":"","password":"bmobile","authtype":"3","mmsc":""}, | |
- {"carrier":"b-mobile スマホ電話","apn":"bmobile.ne.jp","user":"bmobile@spd","server":"","password":"bmobile","authtype":"3","mmsc":""}, | |
- {"carrier":"b-mobile 4G カメレオンSIM","apn":"bmobile.ne.jp","user":"bmobile@cm","server":"","password":"bmobile","authtype":"3","mmsc":""}, | |
- {"carrier":"IIJmio","apn":"iijmio.jp","user":"mio@iij","server":"","password":"iij","authtype":"3","mmsc":""} | |
+ {"carrier":"mopera U","apn":"mopera.net","user":"","server":"","password":"","mmsc":"","type":["default","supl"]}, | |
+ {"carrier":"b-mobile 3G・4G 1GB/Fair","apn":"bmobile.ne.jp","user":"bmobile@fr","server":"","password":"bmobile","authtype":"3","mmsc":"","type":["default","supl"]}, | |
+ {"carrier":"b-mobile 3G・4G U300","apn":"bmobile.ne.jp","user":"bmobile@u300","server":"","password":"bmobile","authtype":"3","mmsc":"","type":["default","supl"]}, | |
+ {"carrier":"b-mobile スマホ電話","apn":"bmobile.ne.jp","user":"bmobile@spd","server":"","password":"bmobile","authtype":"3","mmsc":"","type":["default","supl"]}, | |
+ {"carrier":"b-mobile 4G カメレオンSIM","apn":"bmobile.ne.jp","user":"bmobile@cm","server":"","password":"bmobile","authtype":"3","mmsc":"","type":["default","supl"]}, | |
+ {"carrier":"IIJmio","apn":"iijmio.jp","user":"mio@iij","server":"","password":"iij","authtype":"3","mmsc":"","type":["default","supl"]} | |
], | |
"20": [ | |
{"carrier":"Application","apn":"plus.acs.jp","user":"plusw6q9tattkmpk","password":"msfbbam83bsdetxb","mmsproxy":"andmms.plusacs.ne.jp","mmsport":"8080","mmsc":"http://mms-s","type":["default","mms","supl"],"authtype":"2"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BASEDIR=$(pwd) | |
PATCHDIR=$BASEDIR | |
TEMPDIR=temp | |
# temporary directory | |
rm -rf $TEMPDIR | |
mkdir -p $TEMPDIR | |
cd $TEMPDIR | |
# pull, extract and edit apn.json file | |
adb pull /system/b2g/webapps/settings.gaiamobile.org/application.zip | |
unzip application.zip shared/resources/apn.json | |
patch shared/resources/apn.json $PATCHDIR/apn.json.diff | |
zip -u application.zip shared/resources/apn.json | |
# Remount file systems and push to the device | |
adb shell mount -o remount rw /system | |
adb push application.zip /system/b2g/webapps/settings.gaiamobile.org/application.zip | |
# Reboot | |
echo "Please restart Setting apps (or reboot the device) and set up apn for your SIM!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment