Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android emulator: Set mobile device number?

Does anyone know if its possible to set the emulator's mobile number? I have not been able to find information about this anywhere. Thanks.

like image 444
wuntee Avatar asked Apr 27 '11 13:04

wuntee


2 Answers

Mostly full control of the phone number detailed at the end of this blog:

http://blog.talosintel.com/2013/04/changing-imei-provider-model-and-phone.html

First 7 are fully configurable, last 4 can be one of 16 allowed port numbers.

It turns out that the phone number is stored on the SIM card. Since there is no actual SIM card, one is emulated. This emulated SIM is hard coded in the emulator-arm binary. The reason replacements for 1555521 failed is because SIM cards have a specification that does not store the MSISDN (Mobile Subscriber Integrated Services Digital Network-Number, AKA phone number) in plain text. Instead, each set of digits is swapped in some reverse nibbled endianness nightmare.

... A quick way to find the MSISDN is to search for %d%df%d in the binary (highlighted in red below). The corresponding source code is in external/qemu/telephony/sim_card.c on line 436 in the current repo. The following is the format string portion of that sprintf:

"+CRSM:144,0,ffffffffffffffffffffffffffffffffffff0781515525%d1%d%df%dffffffffffff"

The interesting part is 515525%d1 (highlighted in blue). Swapping each set of two digits produces 1555521%d (thanks again CodePainters). That looks like the prefix to our mobile number.

Edit it in a hex editor.

like image 151
douggard Avatar answered Sep 27 '22 23:09

douggard


As I have found each emulator already has a phone number. If you run two emulators you can call from one emulator to another. To find out this phone numbers you can run in the terminal window:

Path\To\Your\Android\Sdk\platform-tools>adb devices
List of devices attached
emulator-5554   device
emulator-5556   device

First phone number is +15555215554, second +15555215556, i.e. phone number is prefix +1555521 plus emulator suffix 5554 or 5556.

like image 43
isabsent Avatar answered Sep 28 '22 00:09

isabsent