Skip to content

Instantly share code, notes, and snippets.

@oboenikui
Last active December 17, 2015 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save oboenikui/5653234 to your computer and use it in GitHub Desktop.
Save oboenikui/5653234 to your computer and use it in GitHub Desktop.
Samsung端末でServiceMode行くのに、ダイヤルからの行き方が塞がれた場合

以前まではSamsung端末でServiceMode行くにはダイヤルアプリから飛べたのだが、最近のSamsung端末(SC-05D以降の端末の最新アップデートを適用した場合?)では飛べなくなってしまった模様。しかしこれはdocomoやSamsungが悪いのではなく、端末を初期化するコードが見つかってしまったためと思われる。 ([参考](http://thenextweb.com/mobile/2012/09/25/possible-flaw-samsungs-touchwiz-ui-leaves-smartphones-open-data-wiping-sim-locks/"Possible flaw in Samsung’s TouchWiz UI leaves smartphones open to data-wiping, SIM locks and more - The Next Web") 元サイトは現存せず)
しかし一部のユーザーにとってこのメニューは不可欠で(Xiの無効化など)、やっぱり無いとなぁと思ったので、ちょっと調べてみた。

初めに、一般的な端末では、"com.android.settings.RadioInfo"にIntentを飛ばせば、LTE無効化などのメニューを表示できる。某アプリでもこの方法が使われている。この場合は次のようにIntentを発行すれば良い。

Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setClassName("com.android.settings", "com.android.settings.RadioInfo");
startActivity(intent);

しかし、最近のSamsung端末ではそこにIntentを飛ばそうにも、"com.sec.android.app.factorymode.permission.KEYSTRING"というパーミッションが無いと言われて弾かれる。このパーミッションを持てるのはどうやらシステムアプリだけのようで(間違ってたらこっそり教えて下さい)、じゃあどうするのか、というと、/system/app/serviceModeApp.apk というアプリがあるのだが、これにIntentを渡せば良いらしい。ただし注意事項があり、"keyString"という名前のStringExtraを付加する必要がある(これについては後述)。コードは以下のようになる。

Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setClassName("com.sec.android.app.servicemodeapp", "com.sec.android.app.servicemodeapp.ServiceModeApp");
intent.putExtra("keyString", "197328640"); //197328640 の部分は下記の文字列で置き換えて下さい
startActivity(intent);

(2013/06/01追記)
SC-04Eから、仕様が変更され、/system/app/ServiceModeApp_RIL.apk と /system/app/serviceModeApp_FB.apk の2つのアプリになった。とりあえずServiceModeを開くのに必要なのはRILの方なので、Intentは以下のようになると思われる(実機では試していない)。

Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setClassName("com.sec.android.RilServiceModeApp", "com.sec.android.RilServiceModeApp.ServiceModeApp");
intent.putExtra("keyString", "197328640");
startActivity(intent);

また、以下のkeyStringは使えないものがあることに注意されたい。

そしてこのkeyStringだが、ダイヤルから起動していたときの、#197328640#などからや#を除いた番号と同じである(一部例外あり)。このkeyStringを付加しないと、ぬるぽを吐くので注意。以下に動くと思われる文字列を挙げるが、挙動は全く確認していないので、自己責任で実行して下さい。

  • 197328640 : Service Modeの最初の画面
  • 2684
  • 0011
  • 123456
  • 0228
  • 32489
  • 2580
  • 9090
  • 0599
  • 7284
  • 4238378
  • 1575
  • 73876766
  • 738767633
  • 7387678378
  • 7387677763
  • 4387264636
  • 6984125*
  • 2886
  • 2767*2878
  • 1111
  • 2222
  • 8888
  • 301279
  • 279301 ※上と同じ
  • 2263 : Band Preference
  • 66336
  • LTE_ANT_PATH_NORMAL

最後にもう一度注意するが、挙動を全て確認しているわけではなく、最悪Factory ResetのkeyStrignが含まれているかもしれないので、実行は自己責任でお願いします。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment