Device identifier of Android emulator

后端 未结 4 924

I want to test in the emulator an app that depends of the device identifier (ANDROID_ID).

I currently obtain device identifier with the following code:



        
4条回答
  •  情歌与酒
    2020-12-04 17:13

    It's fine to hack the emulator binary to put in an alternate value. However, it must start with a decimal digit because in reference-ril.c, it calls at_send_command_numeric() to read the value. I believe that has to be changed to at_send_command_singleline() to support MEID strings (that are typically 14 hex digits starting with 'A'). Unless you're really clever and can find and swap the function addresses in the binary, you'll have to build from source after patching it to use the same value that some phones have.

提交回复
热议问题