- 対象 OS:4.2.2 (CyanogenMod 10.1-20130526-NIGHTLY-m7) -> 4.3 (CyanogenMod 10.2-20130819-NIGHTLY-m7ul)
- 修正箇所の行数
注意:
システムの改変は端末を動作不能にする危険性があります(e.g., 文鎮化). 必ず自己責任でお願いします.
【症状】
HTC One (m7) に IIJmio のデータ専用 SIM(docomo MVNO)を挿した際,
通信は可能だがアンテナピクトが常時ゼロになっており,
セルスタンバイによる電池消耗が激しい.
【環境】
- Android
- Device: HTC One (m7) UK 版(SIM-free, bootloader-unlocked, rooted)
- SIM: IIJmio 高速モバイル/D https://www.iijmio.jp/guide/outline/hdd/
- Kernel: CyanogenMod 10.2-20130819-NIGHTLY-m7ul
- Mother
- OS: Windows8 Pro
- ADB: 1.0.31
- Java: 1.7.0_21 (64 bit)
- smali/baksmali: v1.3.2 https://code.google.com/p/smali/downloads/list?can=1&q=&colspec=Filename+Summary+Uploaded+ReleaseDate+Size+DownloadCount
【解決方法】
流れは下記の通り.
適当なディレクトリに端末から pull してきた telephony-common.jar を展開し,
含まれる classes.dex をディスアセンブルする.
電波状況に関連する部分を書き換えた上で再度 jar に固め,端末の元の場所に push する.
> mkdir workspace > cd workspace > adb pull /system/framework/telephony-common.jar > mv telephony-common.jar telephony-common.orig.jar > unzip telephony-common.jar > 7za.exe e -so telephony-common.jar telephony-common\classes.dex > classes.dex.tmp > java -jar baksmali.jar -x classes.dex.tmp -o out (Modify: out\com\android\internal\telephony\gsm\GsmServiceStateTracker.smali) > Java -jar Somali. jar -o classes.dex out > zip telephony-common.jar META-INF classes.dex > adb push telephony-common.jar /system/framework/telephony-common.jar (Reboot into Recovery) (Wipe cache partition and Dalvik cache)下記コードの少し後にある定数値に関する記述を修正する. 私の環境では GsmServiceStateTracker.smali の 4,000 行目周辺だった.
.method private regCodeToServiceState(I)I
Before | After |
---|---|
.line 1251 :pswitch_data_20 .packed-switch 0x0 :pswitch_1b :pswitch_1c :pswitch_1b :pswitch_1b :pswitch_1b :pswitch_1e :pswitch_5 :pswitch_5 :pswitch_5 :pswitch_5 :pswitch_1b :pswitch_5 :pswitch_1b :pswitch_1b :pswitch_1b .end packed-switch | .line 1251 :pswitch_data_20 .packed-switch 0x0 :pswitch_1b :pswitch_1c :pswitch_1c // modified :pswitch_1c // modified :pswitch_1b :pswitch_1e :pswitch_5 :pswitch_5 :pswitch_5 :pswitch_5 :pswitch_1b :pswitch_5 :pswitch_1c // modified :pswitch_1c // modified :pswitch_1b .end packed-switch |
【参考】
- Android + b-mobile データ専用 SIM で電界強度を表示する http://bl.oov.ch/2012/01/b-mobile-sim.html
- Android + データ専用 SIM での動作修正パッチ http://bl.oov.ch/2012/01/android-sim.html
- Android 4.2.1 からの MVNO データ専用SIM http://bl.oov.ch/2012/12/android-421-mvno-sim.html
- Target OS:4.2.2 (CyanogenMod 10.1-20130526-NIGHTLY-m7) -> 4.3 (CyanogenMod 10.2-20130819-NIGHTLY-m7ul)
- Line number of revised part
Attention:
Modifying system may cause system failures (e.g., Bricked). Please take full responsibility for your actions.
[symptoms]
Although HTC One (m7) with a Data-Only SIM can communicate over 3G well,
it shows no signal and drains power.
[Environment]
- Android
- Device: HTC One (m7) UK edition(SIM-free, bootloader-unlocked, rooted)
- SIM: IIJmio High-speed Mobile/D https://www.iijmio.jp/guide/outline/hdd/
- Kernel: CyanogenMod 10.2-20130819-NIGHTLY-m7ul
- Mother
- OS: Windows8 Pro
- ADB: 1.0.31
- Java: 1.7.0_21 (64 bit)
- smali/baksmali: v1.3.2 https://code.google.com/p/smali/downloads/list?can=1&q=&colspec=Filename+Summary+Uploaded+ReleaseDate+Size+DownloadCount
[solution]
Below methods.
Pull "telephony-common.jar" from the device and put it into a working directory.
Disassenmble "classes.dex" in the JAR file.
Modified constants about radio status and re-assemble "classes.dex" and compress as a new JAR file.
Push the JAR file into the device (overwrite).
> mkdir workspace > cd workspace > adb pull /system/framework/telephony-common.jar > mv telephony-common.jar telephony-common.orig.jar > unzip telephony-common.jar > 7za.exe e -so telephony-common.jar telephony-common\classes.dex > classes.dex.tmp > java -jar baksmali.jar -x classes.dex.tmp -o out (Modify: out\com\android\internal\telephony\gsm\GsmServiceStateTracker.smali) > java -jar smali.jar -o classes.dex out > zip telephony-common.jar META-INF classes.dex > adb push telephony-common.jar /system/framework/telephony-common.jar (Reboot into Recovery) (Wipe cache partition and Dalvik cache)Modify constants after below code. In my environment, the code is around 4,000L of GsmServiceStateTracker.smali.
.method private regCodeToServiceState(I)I
Before | After |
---|---|
.line 1251 :pswitch_data_20 .packed-switch 0x0 :pswitch_1b :pswitch_1c :pswitch_1b :pswitch_1b :pswitch_1b :pswitch_1e :pswitch_5 :pswitch_5 :pswitch_5 :pswitch_5 :pswitch_1b :pswitch_5 :pswitch_1b :pswitch_1b :pswitch_1b .end packed-switch | .line 1251 :pswitch_data_20 .packed-switch 0x0 :pswitch_1b :pswitch_1c :pswitch_1c // modified :pswitch_1c // modified :pswitch_1b :pswitch_1e :pswitch_5 :pswitch_5 :pswitch_5 :pswitch_5 :pswitch_1b :pswitch_5 :pswitch_1c // modified :pswitch_1c // modified :pswitch_1b .end packed-switch |
[reference](In Japanese)
- Android + b-mobile データ専用 SIM で電界強度を表示する http://bl.oov.ch/2012/01/b-mobile-sim.html
- Android + データ専用 SIM での動作修正パッチ http://bl.oov.ch/2012/01/android-sim.html
- Android 4.2.1 からの MVNO データ専用SIM http://bl.oov.ch/2012/12/android-421-mvno-sim.html
0 件のコメント:
コメントを投稿