Advertisement
Guest User

Untitled

a guest
May 28th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. public class MyApplication extends Application{
  2.  
  3. @Override
  4. public void onCreate() {
  5. super.onCreate();
  6. TwitterAuthConfig authConfig = new TwitterAuthConfig(TWITTER_KEY, TWITTER_SECRET);
  7. Fabric.with(this, new Twitter(authConfig));
  8. FacebookSdk.sdkInitialize(getApplicationContext());
  9. AppEventsLogger.activateApp(this);
  10. try {
  11. @SuppressLint("PackageManagerGetSignatures") PackageInfo info = getPackageManager().getPackageInfo(
  12. "com.tettares.whatdoieat",
  13. PackageManager.GET_SIGNATURES);
  14. for (Signature signature : info.signatures) {
  15. MessageDigest md = MessageDigest.getInstance("SHA");
  16. md.update(signature.toByteArray());
  17. Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
  18. }
  19. } catch (PackageManager.NameNotFoundException | NoSuchAlgorithmException e) {
  20. e.printStackTrace();
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement