How to use Android restricted API methods ¿reflection? -



How to use Android restricted API methods ¿reflection? -

i'm developing app has scheme privileges , want utilize intallpackage() , deletepackage() methods, aren't visible in regular api. have no thought how utilize reflection create these methods available. knows how can access methods code? steps create them available on android sdk? tutorials it?

as suggested, can done reflection. avoid changes in sdk causing problems it's thought validate methods first before calling them, ensure exists , have right method signature.

if grab android source code should able find of hidden methods, marked @hide annotation.

edit:

here (incomplete) example, enabling access point programatically should give clues:

wifimanager wifimanager = (wifimanager) getsystemservice(context.wifi_service); method method = wifimanager.getclass().getmethod("setwifiapenabled", wificonfiguration.class, boolean.class); method.invoke(wifimanager, config, true);

essentially, method , invoke it.

android reflection android-package-managers

Comments

Popular posts from this blog

php - How to pass multiple values from url -

database - php search bar when I press submit with nothing in the search bar it shows all the data -

ios - How to load .png images from Documents folder of an app -