secret/public distinction in LinkedIdView
This commit is contained in:
@@ -109,7 +109,7 @@ public abstract class LinkedResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public abstract @DrawableRes int getDisplayIcon();
|
public abstract @DrawableRes int getDisplayIcon();
|
||||||
public abstract @StringRes int getVerifiedText();
|
public abstract @StringRes int getVerifiedText(boolean isSecret);
|
||||||
public abstract String getDisplayTitle(Context context);
|
public abstract String getDisplayTitle(Context context);
|
||||||
public abstract String getDisplayComment(Context context);
|
public abstract String getDisplayComment(Context context);
|
||||||
public boolean isViewable() {
|
public boolean isViewable() {
|
||||||
|
|||||||
@@ -106,8 +106,8 @@ public class DnsResource extends LinkedCookieResource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @StringRes
|
public @StringRes
|
||||||
int getVerifiedText() {
|
int getVerifiedText(boolean isSecret) {
|
||||||
return R.string.linked_verified_dns;
|
return isSecret ? R.string.linked_verified_secret_dns : R.string.linked_verified_dns;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -117,7 +117,7 @@ public class DnsResource extends LinkedCookieResource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDisplayTitle(Context context) {
|
public String getDisplayTitle(Context context) {
|
||||||
return "Domain Name";
|
return context.getString(R.string.linked_title_dns);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -6,26 +6,19 @@ import android.net.Uri;
|
|||||||
import android.support.annotation.DrawableRes;
|
import android.support.annotation.DrawableRes;
|
||||||
import android.support.annotation.StringRes;
|
import android.support.annotation.StringRes;
|
||||||
|
|
||||||
import com.textuality.keybase.lib.Search;
|
|
||||||
|
|
||||||
import org.apache.http.client.methods.HttpGet;
|
import org.apache.http.client.methods.HttpGet;
|
||||||
import org.sufficientlysecure.keychain.Constants;
|
|
||||||
import org.sufficientlysecure.keychain.R;
|
import org.sufficientlysecure.keychain.R;
|
||||||
import org.sufficientlysecure.keychain.operations.results.OperationResult.LogType;
|
import org.sufficientlysecure.keychain.operations.results.OperationResult.LogType;
|
||||||
import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog;
|
import org.sufficientlysecure.keychain.operations.results.OperationResult.OperationLog;
|
||||||
import org.sufficientlysecure.keychain.pgp.linked.LinkedCookieResource;
|
import org.sufficientlysecure.keychain.pgp.linked.LinkedCookieResource;
|
||||||
import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils;
|
import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils;
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.MalformedURLException;
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URL;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.net.ssl.HttpsURLConnection;
|
|
||||||
|
|
||||||
public class GenericHttpsResource extends LinkedCookieResource {
|
public class GenericHttpsResource extends LinkedCookieResource {
|
||||||
|
|
||||||
@@ -77,13 +70,13 @@ public class GenericHttpsResource extends LinkedCookieResource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @StringRes
|
public @StringRes
|
||||||
int getVerifiedText() {
|
int getVerifiedText(boolean isSecret) {
|
||||||
return R.string.linked_verified_https;
|
return isSecret ? R.string.linked_verified_secret_https : R.string.linked_verified_https;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDisplayTitle(Context context) {
|
public String getDisplayTitle(Context context) {
|
||||||
return "Website (HTTPS)";
|
return context.getString(R.string.linked_title_https);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -187,13 +187,13 @@ public class GithubResource extends LinkedCookieResource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @StringRes
|
public @StringRes
|
||||||
int getVerifiedText() {
|
int getVerifiedText(boolean isSecret) {
|
||||||
return R.string.linked_verified_github;
|
return isSecret ? R.string.linked_verified_secret_github : R.string.linked_verified_github;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDisplayTitle(Context context) {
|
public String getDisplayTitle(Context context) {
|
||||||
return "Github";
|
return context.getString(R.string.linked_title_github);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -113,13 +113,13 @@ public class TwitterResource extends LinkedCookieResource {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @StringRes
|
public @StringRes
|
||||||
int getVerifiedText() {
|
int getVerifiedText(boolean isSecret) {
|
||||||
return R.string.linked_verified_twitter;
|
return isSecret ? R.string.linked_verified_secret_twitter : R.string.linked_verified_twitter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getDisplayTitle(Context context) {
|
public String getDisplayTitle(Context context) {
|
||||||
return "Twitter";
|
return context.getString(R.string.linked_title_twitter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -315,13 +315,13 @@ public class LinkedIdViewFragment extends Fragment implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void showVerifyingContainer(boolean show) {
|
void showVerifyingContainer(boolean show, boolean isSecret) {
|
||||||
if (vVerifyingContainer.getDisplayedChild() == (show ? 1 : 0)) {
|
if (vVerifyingContainer.getDisplayedChild() == (show ? 1 : 0)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
vVerifyingContainer.setDisplayedChild(show ? 1 : 0);
|
vVerifyingContainer.setDisplayedChild(show ? 1 : 0);
|
||||||
vItemCertified.setDisplayedChild(show ? 1 : 0);
|
vItemCertified.setDisplayedChild(show && !isSecret ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void showButton(int which) {
|
void showButton(int which) {
|
||||||
@@ -363,7 +363,7 @@ public class LinkedIdViewFragment extends Fragment implements
|
|||||||
|
|
||||||
mViewHolder.showButton(0);
|
mViewHolder.showButton(0);
|
||||||
mViewHolder.vKeySpinner.setVisibility(View.GONE);
|
mViewHolder.vKeySpinner.setVisibility(View.GONE);
|
||||||
mViewHolder.showVerifyingContainer(false);
|
mViewHolder.showVerifyingContainer(false, mIsSecret);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -376,7 +376,7 @@ public class LinkedIdViewFragment extends Fragment implements
|
|||||||
manager.beginTransaction().addToBackStack("verification").commit();
|
manager.beginTransaction().addToBackStack("verification").commit();
|
||||||
manager.executePendingTransactions();
|
manager.executePendingTransactions();
|
||||||
manager.addOnBackStackChangedListener(this);
|
manager.addOnBackStackChangedListener(this);
|
||||||
mViewHolder.showVerifyingContainer(true);
|
mViewHolder.showVerifyingContainer(true, mIsSecret);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -474,7 +474,7 @@ public class LinkedIdViewFragment extends Fragment implements
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (result.success()) {
|
if (result.success()) {
|
||||||
mViewHolder.vText.setText(mLinkedResource.getVerifiedText());
|
mViewHolder.vText.setText(mLinkedResource.getVerifiedText(mIsSecret));
|
||||||
mViewHolder.setVerifyingState(VerifyState.VERIFY_OK, mIsSecret);
|
mViewHolder.setVerifyingState(VerifyState.VERIFY_OK, mIsSecret);
|
||||||
} else {
|
} else {
|
||||||
mViewHolder.setVerifyingState(VerifyState.VERIFY_ERROR, mIsSecret);
|
mViewHolder.setVerifyingState(VerifyState.VERIFY_ERROR, mIsSecret);
|
||||||
|
|||||||
@@ -1331,6 +1331,11 @@
|
|||||||
<string name="linked_verified_github">"The Gist has been fetched and verified."</string>
|
<string name="linked_verified_github">"The Gist has been fetched and verified."</string>
|
||||||
<string name="linked_verified_dns">"The DNS record has been fetched and verified."</string>
|
<string name="linked_verified_dns">"The DNS record has been fetched and verified."</string>
|
||||||
<string name="linked_verified_twitter">"The Tweet has been fetched and verified."</string>
|
<string name="linked_verified_twitter">"The Tweet has been fetched and verified."</string>
|
||||||
|
<string name="linked_verified_secret_https">"Your Website has been fetched and verified. Everything looks in order."</string>
|
||||||
|
<string name="linked_verified_secret_github">"Your Gist has been fetched and verified. Everything looks in order."</string>
|
||||||
|
<string name="linked_verified_secret_dns">"Your DNS record has been fetched and verified. Everything looks in order."</string>
|
||||||
|
<string name="linked_verified_secret_twitter">"Your Tweet has been fetched and verified. Everything looks in order."</string>
|
||||||
|
|
||||||
<plurals name="linked_id_expand">
|
<plurals name="linked_id_expand">
|
||||||
<item quantity="one">"There is one more unknown identity type"</item>
|
<item quantity="one">"There is one more unknown identity type"</item>
|
||||||
<item quantity="other">"There are %d more unknown identity types"</item>
|
<item quantity="other">"There are %d more unknown identity types"</item>
|
||||||
@@ -1348,5 +1353,9 @@
|
|||||||
<string name="menu_linked_add_identity">"Add Linked Identity"</string>
|
<string name="menu_linked_add_identity">"Add Linked Identity"</string>
|
||||||
<string name="section_linked_identities">"Linked Identities"</string>
|
<string name="section_linked_identities">"Linked Identities"</string>
|
||||||
<string name="btn_finish">"Finish"</string>
|
<string name="btn_finish">"Finish"</string>
|
||||||
|
<string name="linked_title_https">Website (HTTPS)</string>
|
||||||
|
<string name="linked_title_dns">Domain Name</string>
|
||||||
|
<string name="linked_title_github">Github</string>
|
||||||
|
<string name="linked_title_twitter">Twitter</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user