How to access com.android.internal.telephony.gsm.GsmSmsDispatcher instance?

前端 未结 1 453
孤街浪徒
孤街浪徒 2021-01-16 16:04

I need to access com.android.internal.telephony.gsm.GsmSmsDispatcher\'s sendRawPdu method.

I\'ve done a little research and found that GSMPhone<

1条回答
  •  时光说笑
    2021-01-16 16:36

    You can't access Android's internal classes using reflection. Each application in Android runs in its own process with its own instance of the Dalvik VM. Classes loaded in one process are not visible to another process. So when you try to access static variables from PhoneFactory, you end up loading the PhoneFactory class with unintialized variables.

    Your best will be to do whatever you want to get done using the Android APIs. There are a few ways to get access to some private Android services, but it won't get you too far. The only relevant one for SMS is the isms service. You can look through the methods available in it in the ISms.aidl file present in the com.android.internal.telephony package.

    0 讨论(0)
提交回复
热议问题