title: Reflection methods are not working when used proguard for android application
body: <p>I am facing a problem when i use proguard for application having used telephonyservice apis using reflection in android. </p>
  
  <p>I have defined a package com.android.internal.telephony and there i have copied ITelephony.aidl file.</p>
  
  <p>Here is the snippet of the code where i am using the methods of telephony using reflection.</p>
  
  <pre><code>Class&lt;?&gt; c = Class.forName(tm.getClass().getName());
  Method m = c.getDeclaredMethod("getITelephony");
  m.setAccessible(true);
  com.android.internal.telephony.ITelephony telephonyService = 
       (com.android.internal.telephony.ITelephony) m.invoke(tm);
  
      if(buttonInAction == acceptButton){
         Log.v(TAG, "Answering the call");
         telephonyService.answerRingingCall();
         finish();
      }
      else{
         Log.v(TAG, "Rejecting the call");
         telephonyService.endCall();
         finish();
      }
  </code></pre>
  
  <p>Now without proguard i am able to use this apis, but when i use proguard for compliling, it gives classcastexception. I know i need to add something in proguard.cfg file and i also tried several things like -dontshrink -dontoptimize, but still it did not work.</p>
  
  <p>Please let me know if i am missing something which needs to be added in that file or any other solution to this problem.
  Thanks
  Nawab</p>