0

I can not be used in com.android.internal.telephony in Android SDK? Okay! I decided to try to do this using smali/dalvik opcodes.

PhoneFactory.makeDefaultPhone(this);

And application waits. Why?

swiftBoy
  • 35,607
  • 26
  • 136
  • 135
  • Smali seems like overkill. This is simply done with Reflection/Introspection. There are any number of reason that it might hang. Did you read the code, here: https://android.googlesource.com/platform/frameworks/opt/telephony/+/f39de086fddea9e9f6b8c56b04d8dd38a84237db/src/java/com/android/internal/telephony/PhoneFactory.java – G. Blake Meike Oct 15 '16 at 18:07
  • Yes. I have read this code. Is it possible to do using reflection? How to do it? –  Oct 15 '16 at 18:27
  • Roughly: Class.forName("com.android.internal.telephony.PhoneFactory).getMethod("makeDefaultPhone", Context.class).invoke(ctxt); – G. Blake Meike Oct 15 '16 at 18:34
  • What is `ctxt`? –  Oct 15 '16 at 19:00
  • i need too in method `getDefaultPhone` which call using reflection don't really –  Oct 15 '16 at 19:01
  • Class.forName("com.android.internal.telephony.PhoneFactory).‌​getMethod("getDefau‌​ltPhone").invoke() – G. Blake Meike Oct 15 '16 at 19:12
  • `NoSuchMethodException - makeDefau‌​ltPhone [class android.content.Context]` –  Oct 16 '16 at 03:48
  • It's impossible :( –  Oct 16 '16 at 03:49
  • 1
    It is quite possible: http://stackoverflow.com/questions/2143754/can-a-telephony-phone-object-be-instantiated-through-the-sdk – G. Blake Meike Oct 16 '16 at 15:01
  • OMG!! I'm add to sdk it's com.android.internal.telephony! Yeeeeesss!!! –  Oct 17 '16 at 01:39

0 Answers0