I am trying to read the IMPI from ISIM(required for GBA bootstraping). I tried the following snippet of code:
Class<?> class1 = Class
.forName("com.android.internal.telephony.ims.IsimUiccRecords");
Object object = class1.newInstance();
Method method1 = class1.getDeclaredMethod("getIsimImpi");
System.out.println(method1.invoke(object, null));
But call to getIsimImpi(), this way, returns null. I believe, this is due to new instance of IsimUiccRecords, being created, instead of using the appropriate instance (which I am unsure of how to retrive one)
Here is the link to source of IsimUiccRecords.java
Is is possible at all to retrieve the IMPI, using reflection?
I understand that using internal API might break the code on different versions of android, but it's not a concern for me.