mardi 9 mars 2021

Android: fields exist but not returned from reflection getDecalredFields() in interface stub

I want to get all the transaction codes in a service class for testing purpose. Take IStorageManager for example, what I have right now is something like

Class stub = Class.forName("android.os.storage.IStorageManager$Stub");
Field[] fields = stub.getDeclaredFields();

Then I iterate through the fields and print out the names but only to find the code above only got 1 field and the field was not found in IStorageManager from the linked above.

I have also tried to use the interface or the proxy instead of stub but these two did not show the right number of fields/methids as well.

Thanks in advance!





Aucun commentaire:

Enregistrer un commentaire