Android emulator: Set mobile device number?

后端 未结 6 629
北海茫月
北海茫月 2020-12-29 17:24

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.

6条回答
  •  暖寄归人
    2020-12-29 18:07

    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.

提交回复
热议问题