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:

https://stackoverflow.com/a/8817231/607968


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -