Android: how to get calling application developer's public key -
i have following situation. application calling mine (using startactivityforresult). since have sure calling activity comes developer trust i'd read developer public key , compare value hardcoded in app. tried following:
string packagename = callingactivity.getpackagename(); string signature = null; try { packageinfo pi = manager.getpackageinfo(packagename, packagemanager.get_signatures); // assumption: first available signature // according google applications there 1 element signature = pi.signatures[0]. tocharsstring(); }
but gives me application (not developer) signature.
use android custom permissions purpose. defining permission in application, can restrict other apps use activity/service unless have uses-permission in manifest. read more info :
http://developer.android.com/training/articles/security-tips.html#permissions
for example:
Comments
Post a Comment