OAuthDialogFragment extends DialogFragmentCompat { static boolean isRedirectUriFound(String uri, String redirectUri) { Uri u = null; Uri r = null; try { u = Uri.parse(uri); r = Uri.parse(redirectUri); } catch (NullPointerException e) { return false; } if (u == null || r == null) { return false; } boolean rOpaque = r.isOpaque(); boolean uOpaque = u.isOpaque(); if (rOpaque != uOpaque) { return false; } if (rOpaque) { return TextUtils.equals(uri, redirectUri); } if (!TextUtils.equals(r.getScheme(), u.getScheme())) { return false; } if (!TextUtils.equals(r.getAuthority(), u.getAuthority())) { return false; } if (r.getPort() != u.getPort()) { return false; } if (!TextUtils.isEmpty(r.getPath()) && !TextUtils.equals(r.getPath(), u.getPath())) { return false; } Set<String> paramKeys = CompatUri.getQueryParameterNames(r); for (String key : paramKeys) { if (!TextUtils.equals(r.getQueryParameter(key), u.getQueryParameter(key))) { return false; } } String frag = r.getFragment(); if (!TextUtils.isEmpty(frag) && !TextUtils.equals(frag, u.getFragment())) { return false; } return true; } private  OAuthDialogFragment(android.app.DialogFragment fragment, boolean fullScreen,
        boolean horizontalProgress, boolean hideFullScreenTitle); private  OAuthDialogFragment(android.support.v4.app.DialogFragment fragment,
        boolean fullScreen, boolean horizontalProgress, boolean hideFullScreenTitle); @TargetApi(HONEYCOMB) static final OAuthDialogFragment newInstance(
            GenericUrl authorizationRequestUrl,
            DialogFragmentController controller);  }
@Test public void testRedirectUriDetection() { String r1 = "http: String r2 = "http: String r3 = "http: String r4 = "http: String r5 = "http: assertTrue(OAuthDialogFragment.isRedirectUriFound(r1, r1)); assertTrue(OAuthDialogFragment.isRedirectUriFound(r2, r2)); assertTrue(OAuthDialogFragment.isRedirectUriFound(r3, r2)); assertTrue(OAuthDialogFragment.isRedirectUriFound(r4, r2)); assertTrue(OAuthDialogFragment.isRedirectUriFound(r5, r2)); assertTrue(OAuthDialogFragment.isRedirectUriFound(r4, r3)); assertTrue(OAuthDialogFragment.isRedirectUriFound(r5, r3)); assertTrue(OAuthDialogFragment.isRedirectUriFound(r4, r4)); assertTrue(OAuthDialogFragment.isRedirectUriFound(r5, r5)); assertFalse(OAuthDialogFragment.isRedirectUriFound(r1, r2)); assertFalse(OAuthDialogFragment.isRedirectUriFound(r1, r3)); assertFalse(OAuthDialogFragment.isRedirectUriFound(r1, r4)); assertFalse(OAuthDialogFragment.isRedirectUriFound(r1, r5)); assertFalse(OAuthDialogFragment.isRedirectUriFound(r2, r1)); assertFalse(OAuthDialogFragment.isRedirectUriFound(r2, r3)); assertFalse(OAuthDialogFragment.isRedirectUriFound(r2, r4)); assertFalse(OAuthDialogFragment.isRedirectUriFound(r2, r5)); assertFalse(OAuthDialogFragment.isRedirectUriFound(r3, r1)); assertFalse(OAuthDialogFragment.isRedirectUriFound(r3, r4)); assertFalse(OAuthDialogFragment.isRedirectUriFound(r3, r5)); assertFalse(OAuthDialogFragment.isRedirectUriFound(r4, r1)); assertFalse(OAuthDialogFragment.isRedirectUriFound(r4, r5)); assertFalse(OAuthDialogFragment.isRedirectUriFound(r5, r1)); assertFalse(OAuthDialogFragment.isRedirectUriFound(r5, r4)); assertTrue(OAuthDialogFragment.isRedirectUriFound(r4 + "&c=3", r4)); assertTrue(OAuthDialogFragment.isRedirectUriFound("http: assertTrue(OAuthDialogFragment.isRedirectUriFound("http: }