samedi 18 février 2017

Make a class act as if it was inside the Android package to access hidden and package methods

I'm trying to improve a TextView performance by removing everything that I won't use: RTL, spell checker, error popup, XML attributes, unused input types, etc, and eventually the drawing part. I "cleared" the code to remove those but now I realize some methods and classes and hidden (@hide) and can't be accessed.

I see two solutions: adding the missing class to my package, or using reflection to get it. First method can't work because most added classes also tries to access hidden methods, so I need to add them too, I'll end up having to import the whole Android source code which is nonsense. That leaves me with reflection, lots of it. Is it really my only choice? (seems like a hacky one)

Is there something I can do to make the class act as if it was inside the Android package, being able to access any of its methods?





Aucun commentaire:

Enregistrer un commentaire