aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main
diff options
context:
space:
mode:
authorVincent Breitmoser <valodim@mugenguild.com>2015-01-13 00:09:48 +0100
committerVincent Breitmoser <valodim@mugenguild.com>2015-01-13 00:09:48 +0100
commite71d62084017ff7c3c38f32ea27a78e5f1fa1a69 (patch)
treebd7a4851c10873fdcd4ae868952192846523eca2 /OpenKeychain/src/main
parentd51621538ab53e0f4c5a43dc9688a44b5fa2317d (diff)
downloadopen-keychain-e71d62084017ff7c3c38f32ea27a78e5f1fa1a69.tar.gz
open-keychain-e71d62084017ff7c3c38f32ea27a78e5f1fa1a69.tar.bz2
open-keychain-e71d62084017ff7c3c38f32ea27a78e5f1fa1a69.zip
some work on twitter resource
Diffstat (limited to 'OpenKeychain/src/main')
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/affirmation/resources/TwitterResource.java7
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/affirmations/AffirmationCreateDnsStep1Fragment.java125
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/affirmations/AffirmationCreateTwitterStep1Fragment.java132
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/affirmations/AffirmationCreateTwitterStep2Fragment.java142
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/affirmations/AffirmationCreateTwitterStep3Fragment.java243
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/affirmations/AffirmationSelectFragment.java22
-rw-r--r--OpenKeychain/src/main/res/layout/affirmation_create_dns_fragment_step1.xml121
-rw-r--r--OpenKeychain/src/main/res/layout/affirmation_create_https_fragment_step1.xml37
-rw-r--r--OpenKeychain/src/main/res/layout/affirmation_create_twitter_fragment_step1.xml128
-rw-r--r--OpenKeychain/src/main/res/layout/affirmation_create_twitter_fragment_step2.xml142
-rw-r--r--OpenKeychain/src/main/res/layout/affirmation_create_twitter_fragment_step3.xml192
-rw-r--r--OpenKeychain/src/main/res/values/strings.xml21
12 files changed, 1297 insertions, 15 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/affirmation/resources/TwitterResource.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/affirmation/resources/TwitterResource.java
index b426c16b9..f131a8da2 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/affirmation/resources/TwitterResource.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/affirmation/resources/TwitterResource.java
@@ -1,7 +1,7 @@
package org.sufficientlysecure.keychain.pgp.affirmation.resources;
+import android.content.Context;
import android.util.Base64;
-import android.util.JsonReader;
import com.textuality.keybase.lib.JWalk;
@@ -35,6 +35,11 @@ public class TwitterResource extends AffirmationResource {
super(flags, params, uri);
}
+ public static String generateText (Context context, byte[] fingerprint, String nonce) {
+ // nothing special here for now, might change this later
+ return AffirmationResource.generate(context, fingerprint, nonce);
+ }
+
private String getTwitterStream(String screenName) {
String results = null;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/affirmations/AffirmationCreateDnsStep1Fragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/affirmations/AffirmationCreateDnsStep1Fragment.java
new file mode 100644
index 000000000..fedbe120d
--- /dev/null
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/affirmations/AffirmationCreateDnsStep1Fragment.java
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann <dominik@dominikschuermann.de>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package org.sufficientlysecure.keychain.ui.affirmations;
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.util.Patterns;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.widget.EditText;
+
+import org.sufficientlysecure.keychain.R;
+import org.sufficientlysecure.keychain.pgp.affirmation.LinkedIdentity;
+import org.sufficientlysecure.keychain.pgp.affirmation.resources.GenericHttpsResource;
+
+public class AffirmationCreateDnsStep1Fragment extends Fragment {
+
+ AffirmationWizard mAffirmationWizard;
+
+ EditText mEditUri;
+
+ /**
+ * Creates new instance of this fragment
+ */
+ public static AffirmationCreateDnsStep1Fragment newInstance() {
+ AffirmationCreateDnsStep1Fragment frag = new AffirmationCreateDnsStep1Fragment();
+
+ Bundle args = new Bundle();
+ frag.setArguments(args);
+
+ return frag;
+ }
+
+ @Override
+ public void onActivityCreated(Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+
+ mAffirmationWizard = (AffirmationWizard) getActivity();
+
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ final View view = inflater.inflate(R.layout.affirmation_create_dns_fragment_step1, container, false);
+
+ view.findViewById(R.id.next_button).setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+
+ String uri = "https://" + mEditUri.getText();
+
+ if (!checkUri(uri)) {
+ return;
+ }
+
+ String proofNonce = LinkedIdentity.generateNonce();
+ String proofText = GenericHttpsResource.generateText(getActivity(),
+ mAffirmationWizard.mFingerprint, proofNonce);
+
+ AffirmationCreateHttpsStep2Fragment frag =
+ AffirmationCreateHttpsStep2Fragment.newInstance(uri, proofNonce, proofText);
+
+ mAffirmationWizard.loadFragment(null, frag, AffirmationWizard.FRAG_ACTION_TO_RIGHT);
+
+ }
+ });
+
+ mEditUri = (EditText) view.findViewById(R.id.affirmation_create_https_uri);
+
+ mEditUri.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable) {
+ String uri = "https://" + editable;
+ if (uri.length() > 0) {
+ if (checkUri(uri)) {
+ mEditUri.setCompoundDrawablesWithIntrinsicBounds(0, 0,
+ R.drawable.uid_mail_ok, 0);
+ } else {
+ mEditUri.setCompoundDrawablesWithIntrinsicBounds(0, 0,
+ R.drawable.uid_mail_bad, 0);
+ }
+ } else {
+ // remove drawable if email is empty
+ mEditUri.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
+ }
+ }
+ });
+
+ mEditUri.setText("mugenguild.com/pgpkey.txt");
+
+ return view;
+ }
+
+ private static boolean checkUri(String uri) {
+ return Patterns.WEB_URL.matcher(uri).matches();
+ }
+
+}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/affirmations/AffirmationCreateTwitterStep1Fragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/affirmations/AffirmationCreateTwitterStep1Fragment.java
new file mode 100644
index 000000000..6b47631c0
--- /dev/null
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/affirmations/AffirmationCreateTwitterStep1Fragment.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann <dominik@dominikschuermann.de>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package org.sufficientlysecure.keychain.ui.affirmations;
+
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.util.Patterns;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.widget.EditText;
+
+import org.sufficientlysecure.keychain.R;
+import org.sufficientlysecure.keychain.pgp.affirmation.LinkedIdentity;
+import org.sufficientlysecure.keychain.pgp.affirmation.resources.GenericHttpsResource;
+import org.sufficientlysecure.keychain.pgp.affirmation.resources.TwitterResource;
+import org.sufficientlysecure.keychain.ui.util.Notify;
+
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+
+public class AffirmationCreateTwitterStep1Fragment extends Fragment {
+
+ AffirmationWizard mAffirmationWizard;
+
+ EditText mEditHandle;
+
+ /**
+ * Creates new instance of this fragment
+ */
+ public static AffirmationCreateTwitterStep1Fragment newInstance() {
+ AffirmationCreateTwitterStep1Fragment frag = new AffirmationCreateTwitterStep1Fragment();
+
+ Bundle args = new Bundle();
+ frag.setArguments(args);
+
+ return frag;
+ }
+
+ @Override
+ public void onActivityCreated(Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+
+ mAffirmationWizard = (AffirmationWizard) getActivity();
+
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ final View view = inflater.inflate(R.layout.affirmation_create_twitter_fragment_step1, container, false);
+
+ view.findViewById(R.id.next_button).setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+
+ final String handle = mEditHandle.getText().toString();
+
+ new AsyncTask<Void,Void,Boolean>() {
+
+ @Override
+ protected Boolean doInBackground(Void... params) {
+ return true; // checkHandle(handle);
+ }
+
+ @Override
+ protected void onPostExecute(Boolean result) {
+ super.onPostExecute(result);
+
+ if (result == null) {
+ Notify.showNotify(getActivity(), "Connection error while checking username!", Notify.Style.ERROR);
+ return;
+ }
+
+ if (!result) {
+ Notify.showNotify(getActivity(), "This handle does not exist on Twitter!", Notify.Style.ERROR);
+ return;
+ }
+
+ String proofNonce = LinkedIdentity.generateNonce();
+ String proofText = TwitterResource.generateText(getActivity(),
+ mAffirmationWizard.mFingerprint, proofNonce);
+
+ AffirmationCreateTwitterStep2Fragment frag =
+ AffirmationCreateTwitterStep2Fragment.newInstance(handle, proofNonce, proofText);
+
+ mAffirmationWizard.loadFragment(null, frag, AffirmationWizard.FRAG_ACTION_TO_RIGHT);
+ }
+ }.execute();
+
+ }
+ });
+
+ mEditHandle = (EditText) view.findViewById(R.id.linked_create_twitter_handle);
+ mEditHandle.setText("Valodim");
+
+ return view;
+ }
+
+ private static Boolean checkHandle(String handle) {
+ try {
+ HttpURLConnection nection =
+ (HttpURLConnection) new URL("https://twitter.com/" + handle).openConnection();
+ nection.setRequestMethod("HEAD");
+ return nection.getResponseCode() == 200;
+ } catch (IOException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/affirmations/AffirmationCreateTwitterStep2Fragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/affirmations/AffirmationCreateTwitterStep2Fragment.java
new file mode 100644
index 000000000..8367d750b
--- /dev/null
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/affirmations/AffirmationCreateTwitterStep2Fragment.java
@@ -0,0 +1,142 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann <dominik@dominikschuermann.de>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package org.sufficientlysecure.keychain.ui.affirmations;
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.text.Editable;
+import android.text.InputFilter;
+import android.text.TextWatcher;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import org.sufficientlysecure.keychain.R;
+
+public class AffirmationCreateTwitterStep2Fragment extends Fragment {
+
+ private static final int REQUEST_CODE_OUTPUT = 0x00007007;
+
+ public static final String HANDLE = "uri", NONCE = "nonce", TEXT = "text";
+
+ AffirmationWizard mAffirmationWizard;
+
+ EditText mEditTweetCustom, mEditTweetPreview;
+ ImageView mVerifyImage;
+ View mVerifyProgress;
+ TextView mVerifyStatus, mEditTweetTextLen;
+
+ String mResourceHandle;
+ String mResourceNonce, mResourceString;
+
+ /**
+ * Creates new instance of this fragment
+ */
+ public static AffirmationCreateTwitterStep2Fragment newInstance
+ (String handle, String proofNonce, String proofText) {
+
+ AffirmationCreateTwitterStep2Fragment frag = new AffirmationCreateTwitterStep2Fragment();
+
+ Bundle args = new Bundle();
+ args.putString(HANDLE, handle);
+ args.putString(NONCE, proofNonce);
+ args.putString(TEXT, proofText);
+ frag.setArguments(args);
+
+ return frag;
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ final View view = inflater.inflate(R.layout.affirmation_create_twitter_fragment_step2, container, false);
+
+ mResourceHandle = getArguments().getString(HANDLE);
+ mResourceNonce = getArguments().getString(NONCE);
+ mResourceString = getArguments().getString(TEXT);
+
+ view.findViewById(R.id.next_button).setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+
+ AffirmationCreateTwitterStep3Fragment frag =
+ AffirmationCreateTwitterStep3Fragment.newInstance(mResourceHandle,
+ mResourceNonce, mResourceString,
+ mEditTweetCustom.getText().toString());
+
+ mAffirmationWizard.loadFragment(null, frag, AffirmationWizard.FRAG_ACTION_TO_RIGHT);
+ }
+ });
+
+ mVerifyImage = (ImageView) view.findViewById(R.id.verify_image);
+ mVerifyProgress = view.findViewById(R.id.verify_progress);
+ mVerifyStatus = (TextView) view.findViewById(R.id.verify_status);
+
+ mEditTweetPreview = (EditText) view.findViewById(R.id.linked_create_twitter_preview);
+ mEditTweetPreview.setText(mResourceString);
+
+ mEditTweetCustom = (EditText) view.findViewById(R.id.linked_create_twitter_custom);
+ mEditTweetCustom.setFilters(new InputFilter[] {
+ new InputFilter.LengthFilter(139 - mResourceString.length())
+ });
+
+ mEditTweetTextLen = (TextView) view.findViewById(R.id.linked_create_twitter_textlen);
+ mEditTweetTextLen.setText(mResourceString.length() + "/140");
+
+ mEditTweetCustom.addTextChangedListener(new TextWatcher() {
+ @Override
+ public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
+ }
+
+ @Override
+ public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
+ }
+
+ @Override
+ public void afterTextChanged(Editable editable) {
+ if (editable != null && editable.length() > 0) {
+ String str = editable + " " + mResourceString;
+ mEditTweetPreview.setText(str);
+
+ mEditTweetTextLen.setText(str.length() + "/140");
+ mEditTweetTextLen.setTextColor(getResources().getColor(str.length() == 140
+ ? R.color.android_red_dark
+ : R.color.primary_dark_material_light));
+
+
+ } else {
+ mEditTweetPreview.setText(mResourceString);
+ mEditTweetTextLen.setText(mResourceString.length() + "/140");
+ }
+ }
+ });
+
+ return view;
+ }
+
+ @Override
+ public void onActivityCreated(Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+
+ mAffirmationWizard = (AffirmationWizard) getActivity();
+ }
+
+}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/affirmations/AffirmationCreateTwitterStep3Fragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/affirmations/AffirmationCreateTwitterStep3Fragment.java
new file mode 100644
index 000000000..3b4c38893
--- /dev/null
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/affirmations/AffirmationCreateTwitterStep3Fragment.java
@@ -0,0 +1,243 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann <dominik@dominikschuermann.de>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package org.sufficientlysecure.keychain.ui.affirmations;
+
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.graphics.PorterDuff;
+import android.net.Uri;
+import android.os.AsyncTask;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Environment;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import org.sufficientlysecure.keychain.Constants;
+import org.sufficientlysecure.keychain.R;
+import org.sufficientlysecure.keychain.operations.results.LinkedVerifyResult;
+import org.sufficientlysecure.keychain.pgp.affirmation.resources.GenericHttpsResource;
+import org.sufficientlysecure.keychain.pgp.affirmation.resources.TwitterResource;
+import org.sufficientlysecure.keychain.ui.util.Notify;
+import org.sufficientlysecure.keychain.ui.util.Notify.Style;
+import org.sufficientlysecure.keychain.util.FileHelper;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.PrintWriter;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.List;
+
+public class AffirmationCreateTwitterStep3Fragment extends Fragment {
+
+ public static final String HANDLE = "uri", NONCE = "nonce", TEXT = "text", CUSTOM = "custom";
+
+ AffirmationWizard mAffirmationWizard;
+
+ EditText mEditTweetPreview;
+ ImageView mVerifyImage;
+ View mVerifyProgress;
+ TextView mVerifyStatus;
+
+ String mResourceHandle, mCustom, mFullString;
+ String mResourceNonce, mResourceString;
+
+ /**
+ * Creates new instance of this fragment
+ */
+ public static AffirmationCreateTwitterStep3Fragment newInstance
+ (String handle, String proofNonce, String proofText, String customText) {
+
+ AffirmationCreateTwitterStep3Fragment frag = new AffirmationCreateTwitterStep3Fragment();
+
+ Bundle args = new Bundle();
+ args.putString(HANDLE, handle);
+ args.putString(NONCE, proofNonce);
+ args.putString(TEXT, proofText);
+ args.putString(CUSTOM, customText);
+ frag.setArguments(args);
+
+ return frag;
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ final View view = inflater.inflate(R.layout.affirmation_create_twitter_fragment_step3, container, false);
+
+ mResourceHandle = getArguments().getString(HANDLE);
+ mResourceNonce = getArguments().getString(NONCE);
+ mResourceString = getArguments().getString(TEXT);
+ mCustom = getArguments().getString(CUSTOM);
+
+ mFullString = mCustom.isEmpty() ? mResourceString : (mCustom + " " + mResourceString);
+
+ mVerifyImage = (ImageView) view.findViewById(R.id.verify_image);
+ mVerifyProgress = view.findViewById(R.id.verify_progress);
+ mVerifyStatus = (TextView) view.findViewById(R.id.verify_status);
+
+ mEditTweetPreview = (EditText) view.findViewById(R.id.linked_create_twitter_preview);
+ mEditTweetPreview.setText(mFullString);
+
+ view.findViewById(R.id.button_send).setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ proofSend();
+ }
+ });
+
+ view.findViewById(R.id.button_share).setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ proofShare();
+ }
+ });
+
+ view.findViewById(R.id.button_verify).setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ proofVerify();
+ }
+ });
+
+ setVerifyProgress(false, null);
+ mVerifyStatus.setText(R.string.linked_verify_pending);
+
+
+ view.findViewById(R.id.next_button).setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+
+ // AffirmationCreateHttpsStep2Fragment frag =
+ // AffirmationCreateHttpsStep2Fragment.newInstance();
+
+ // mAffirmationWizard.loadFragment(null, frag, AffirmationWizard.FRAG_ACTION_TO_RIGHT);
+ }
+ });
+
+ return view;
+ }
+
+ @Override
+ public void onActivityCreated(Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+
+ mAffirmationWizard = (AffirmationWizard) getActivity();
+ }
+
+ public void setVerifyProgress(boolean on, Boolean success) {
+ mVerifyProgress.setVisibility(on ? View.VISIBLE : View.GONE);
+ mVerifyImage.setVisibility(on ? View.GONE : View.VISIBLE);
+ if (success == null) {
+ mVerifyStatus.setText(R.string.linked_verifying);
+ mVerifyImage.setImageResource(R.drawable.status_signature_unverified_cutout);
+ mVerifyImage.setColorFilter(getResources().getColor(R.color.tertiary_text_light),
+ PorterDuff.Mode.SRC_IN);
+ } else if (success) {
+ mVerifyStatus.setText(R.string.linked_verify_success);
+ mVerifyImage.setImageResource(R.drawable.status_signature_verified_cutout);
+ mVerifyImage.setColorFilter(getResources().getColor(R.color.android_green_dark),
+ PorterDuff.Mode.SRC_IN);
+ } else {
+ mVerifyStatus.setText(R.string.linked_verify_error);
+ mVerifyImage.setImageResource(R.drawable.status_signature_unknown_cutout);
+ mVerifyImage.setColorFilter(getResources().getColor(R.color.android_red_dark),
+ PorterDuff.Mode.SRC_IN);
+ }
+ }
+
+ public void proofVerify() {
+ setVerifyProgress(true, null);
+
+ /*
+ try {
+ final TwitterResource resource = TwitterResource.createNew(new URI(mResourceHandle));
+
+ new AsyncTask<Void,Void,LinkedVerifyResult>() {
+
+ @Override
+ protected LinkedVerifyResult doInBackground(Void... params) {
+ return resource.verify(mAffirmationWizard.mFingerprint, mResourceNonce);
+ }
+
+ @Override
+ protected void onPostExecute(LinkedVerifyResult result) {
+ super.onPostExecute(result);
+ if (result.success()) {
+ setVerifyProgress(false, true);
+ } else {
+ setVerifyProgress(false, false);
+ // on error, show error message
+ result.createNotify(getActivity()).show();
+ }
+ }
+ }.execute();
+ } catch (URISyntaxException e) {
+ e.printStackTrace();
+ }
+ */
+
+ }
+
+ private void proofShare() {
+ Intent sendIntent = new Intent();
+ sendIntent.setAction(Intent.ACTION_SEND);
+ sendIntent.putExtra(Intent.EXTRA_TEXT, mFullString);
+ sendIntent.setType("text/plain");
+ startActivity(sendIntent);
+ }
+
+ private void proofSend() {
+
+ Intent tweetIntent = new Intent(Intent.ACTION_SEND);
+ tweetIntent.putExtra(Intent.EXTRA_TEXT, mFullString);
+ tweetIntent.setType("text/plain");
+
+ PackageManager packManager = getActivity().getPackageManager();
+ List<ResolveInfo> resolvedInfoList = packManager.queryIntentActivities(tweetIntent,
+ PackageManager.MATCH_DEFAULT_ONLY);
+
+ boolean resolved = false;
+ for(ResolveInfo resolveInfo : resolvedInfoList){
+ if(resolveInfo.activityInfo.packageName.startsWith("com.twitter.android")) {
+ tweetIntent.setClassName(
+ resolveInfo.activityInfo.packageName,
+ resolveInfo.activityInfo.name );
+ resolved = true;
+ break;
+ }
+ }
+
+ if (resolved) {
+ startActivity(tweetIntent);
+ } else {
+ Notify.showNotify(getActivity(),
+ "Twitter app is not installed, please use the send intent!",
+ Notify.Style.ERROR);
+ }
+
+ }
+
+}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/affirmations/AffirmationSelectFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/affirmations/AffirmationSelectFragment.java
index 784e75789..c3667b5a2 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/affirmations/AffirmationSelectFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/affirmations/AffirmationSelectFragment.java
@@ -56,6 +56,28 @@ public class AffirmationSelectFragment extends Fragment {
}
});
+ view.findViewById(R.id.affirmation_create_dns_button)
+ .setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ AffirmationCreateDnsStep1Fragment frag =
+ AffirmationCreateDnsStep1Fragment.newInstance();
+
+ mAffirmationWizard.loadFragment(null, frag, AffirmationWizard.FRAG_ACTION_TO_RIGHT);
+ }
+ });
+
+ view.findViewById(R.id.affirmation_create_twitter_button)
+ .setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ AffirmationCreateTwitterStep1Fragment frag =
+ AffirmationCreateTwitterStep1Fragment.newInstance();
+
+ mAffirmationWizard.loadFragment(null, frag, AffirmationWizard.FRAG_ACTION_TO_RIGHT);
+ }
+ });
+
return view;
}
diff --git a/OpenKeychain/src/main/res/layout/affirmation_create_dns_fragment_step1.xml b/OpenKeychain/src/main/res/layout/affirmation_create_dns_fragment_step1.xml
new file mode 100644
index 000000000..f50a4d9be
--- /dev/null
+++ b/OpenKeychain/src/main/res/layout/affirmation_create_dns_fragment_step1.xml
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
+
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:fillViewport="false"
+ android:layout_above="@+id/create_key_button_divider">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp"
+ android:orientation="vertical">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/aff_create_https_1_1" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="8dp"
+ android:orientation="horizontal">
+
+ <org.sufficientlysecure.keychain.ui.widget.HttpsPrefixedText
+ android:id="@+id/affirmation_create_https_uri"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:imeOptions="actionNext"
+ android:ems="10"
+ android:inputType="textUri"
+ android:layout_gravity="center_horizontal"
+ />
+
+ </LinearLayout>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/aff_create_https_1_2" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/aff_create_https_1_3" />
+
+ </LinearLayout>
+
+ </ScrollView>
+
+ <View
+ android:id="@+id/create_key_button_divider"
+ android:layout_width="match_parent"
+ android:layout_height="1dip"
+ android:layout_marginLeft="16dp"
+ android:layout_marginRight="16dp"
+ android:background="?android:attr/listDivider"
+ android:layout_alignTop="@+id/create_key_buttons"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:layout_marginLeft="16dp"
+ android:layout_marginRight="16dp"
+ android:id="@+id/create_key_buttons">
+
+ <TextView
+ android:id="@+id/create_key_back_button"
+ android:paddingLeft="8dp"
+ android:paddingRight="8dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text=""
+ android:minHeight="?android:attr/listPreferredItemHeight"
+ android:gravity="center_vertical"
+ android:layout_gravity="center_vertical" />
+
+ <View
+ android:layout_width="1dp"
+ android:layout_height="match_parent"
+ android:layout_marginTop="8dp"
+ android:layout_marginBottom="8dp"
+ android:background="?android:attr/listDivider" />
+
+ <TextView
+ android:id="@+id/next_button"
+ android:paddingLeft="8dp"
+ android:paddingRight="8dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="@string/btn_next"
+ android:minHeight="?android:attr/listPreferredItemHeight"
+ android:drawableRight="@drawable/ic_action_play"
+ android:drawablePadding="8dp"
+ android:gravity="center_vertical"
+ android:clickable="true"
+ style="@style/SelectableItem"
+ android:layout_gravity="center_vertical" />
+ </LinearLayout>
+</RelativeLayout> \ No newline at end of file
diff --git a/OpenKeychain/src/main/res/layout/affirmation_create_https_fragment_step1.xml b/OpenKeychain/src/main/res/layout/affirmation_create_https_fragment_step1.xml
index f50a4d9be..b966c824b 100644
--- a/OpenKeychain/src/main/res/layout/affirmation_create_https_fragment_step1.xml
+++ b/OpenKeychain/src/main/res/layout/affirmation_create_https_fragment_step1.xml
@@ -16,44 +16,59 @@
android:paddingRight="16dp"
android:orientation="vertical">
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:id="@+id/certify_key_action_certify_image"
+ android:layout_width="60dip"
+ android:layout_height="60dip"
+ android:padding="8dp"
+ android:src="@drawable/ssl_lock"
+ android:layout_gravity="center_vertical" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/aff_create_https_1_1" />
+
+ </LinearLayout>
+
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:text="@string/aff_create_https_1_1" />
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="8dp"
- android:orientation="horizontal">
+ android:text="@string/aff_create_https_1_2" />
<org.sufficientlysecure.keychain.ui.widget.HttpsPrefixedText
android:id="@+id/affirmation_create_https_uri"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionNext"
+ android:layout_marginTop="16dp"
android:ems="10"
android:inputType="textUri"
android:layout_gravity="center_horizontal"
/>
- </LinearLayout>
-
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:text="@string/aff_create_https_1_2" />
+ android:text="@string/aff_create_https_1_3" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:text="@string/aff_create_https_1_3" />
+ android:text="@string/aff_create_https_1_4" />
</LinearLayout>
diff --git a/OpenKeychain/src/main/res/layout/affirmation_create_twitter_fragment_step1.xml b/OpenKeychain/src/main/res/layout/affirmation_create_twitter_fragment_step1.xml
new file mode 100644
index 000000000..1ba8d46c4
--- /dev/null
+++ b/OpenKeychain/src/main/res/layout/affirmation_create_twitter_fragment_step1.xml
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
+
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:fillViewport="false"
+ android:layout_above="@+id/create_key_button_divider">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp"
+ android:orientation="vertical">
+
+ <LinearLayout
+ android:layout_marginTop="16dp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:id="@+id/certify_key_action_certify_image"
+ android:layout_width="60dip"
+ android:layout_height="60dip"
+ android:padding="8dp"
+ android:src="@drawable/twitter"
+ android:layout_gravity="center_vertical" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/linked_create_twitter_1_1" />
+
+ </LinearLayout>
+
+ <EditText
+ android:id="@+id/linked_create_twitter_handle"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:imeOptions="actionNext"
+ android:layout_marginTop="16dp"
+ android:ems="10"
+ android:layout_gravity="center_horizontal"
+ android:hint="@string/linked_create_twitter_handle"/>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/linked_create_twitter_1_2" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/linked_create_twitter_1_3" />
+
+ </LinearLayout>
+
+ </ScrollView>
+
+ <View
+ android:id="@+id/create_key_button_divider"
+ android:layout_width="match_parent"
+ android:layout_height="1dip"
+ android:layout_marginLeft="16dp"
+ android:layout_marginRight="16dp"
+ android:background="?android:attr/listDivider"
+ android:layout_alignTop="@+id/create_key_buttons"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:layout_marginLeft="16dp"
+ android:layout_marginRight="16dp"
+ android:id="@+id/create_key_buttons">
+
+ <TextView
+ android:id="@+id/create_key_back_button"
+ android:paddingLeft="8dp"
+ android:paddingRight="8dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text=""
+ android:minHeight="?android:attr/listPreferredItemHeight"
+ android:gravity="center_vertical"
+ android:layout_gravity="center_vertical" />
+
+ <View
+ android:layout_width="1dp"
+ android:layout_height="match_parent"
+ android:layout_marginTop="8dp"
+ android:layout_marginBottom="8dp"
+ android:background="?android:attr/listDivider" />
+
+ <TextView
+ android:id="@+id/next_button"
+ android:paddingLeft="8dp"
+ android:paddingRight="8dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="@string/btn_next"
+ android:minHeight="?android:attr/listPreferredItemHeight"
+ android:drawableRight="@drawable/ic_action_play"
+ android:drawablePadding="8dp"
+ android:gravity="center_vertical"
+ android:clickable="true"
+ style="@style/SelectableItem"
+ android:layout_gravity="center_vertical" />
+ </LinearLayout>
+</RelativeLayout> \ No newline at end of file
diff --git a/OpenKeychain/src/main/res/layout/affirmation_create_twitter_fragment_step2.xml b/OpenKeychain/src/main/res/layout/affirmation_create_twitter_fragment_step2.xml
new file mode 100644
index 000000000..61957aa9b
--- /dev/null
+++ b/OpenKeychain/src/main/res/layout/affirmation_create_twitter_fragment_step2.xml
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
+
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:fillViewport="false"
+ android:layout_above="@+id/create_key_button_divider">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp"
+ android:orientation="vertical">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/linked_create_twitter_2_1" />
+
+ <EditText
+ android:id="@+id/linked_create_twitter_custom"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:imeOptions="actionNext"
+ android:layout_marginTop="8dp"
+ android:hint="Custom Text"
+ android:ems="10"
+ android:layout_gravity="center_horizontal"
+ />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:layout_weight="1"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/linked_create_twitter_2_2" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:id="@+id/linked_create_twitter_textlen"
+ android:text="0/140" />
+
+ </LinearLayout>
+
+ <EditText
+ android:id="@+id/linked_create_twitter_preview"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:imeOptions="actionNext"
+ android:layout_marginTop="8dp"
+ android:ems="10"
+ android:layout_gravity="center_horizontal"
+ android:inputType="textMultiLine"
+ android:enabled="false"
+ android:textAppearance="?android:attr/textAppearanceSmall" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/linked_create_twitter_2_3" />
+
+ </LinearLayout>
+
+ </ScrollView>
+
+ <View
+ android:id="@+id/create_key_button_divider"
+ android:layout_width="match_parent"
+ android:layout_height="1dip"
+ android:layout_marginLeft="16dp"
+ android:layout_marginRight="16dp"
+ android:background="?android:attr/listDivider"
+ android:layout_alignTop="@+id/create_key_buttons"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:layout_marginLeft="16dp"
+ android:layout_marginRight="16dp"
+ android:id="@+id/create_key_buttons">
+
+ <TextView
+ android:id="@+id/create_key_back_button"
+ android:paddingLeft="8dp"
+ android:paddingRight="8dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text=""
+ android:minHeight="?android:attr/listPreferredItemHeight"
+ android:gravity="center_vertical"
+ android:layout_gravity="center_vertical" />
+
+ <View
+ android:layout_width="1dp"
+ android:layout_height="match_parent"
+ android:layout_marginTop="8dp"
+ android:layout_marginBottom="8dp"
+ android:background="?android:attr/listDivider" />
+
+ <TextView
+ android:id="@+id/next_button"
+ android:paddingLeft="8dp"
+ android:paddingRight="8dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="@string/btn_next"
+ android:minHeight="?android:attr/listPreferredItemHeight"
+ android:drawableRight="@drawable/ic_action_play"
+ android:drawablePadding="8dp"
+ android:gravity="center_vertical"
+ android:clickable="true"
+ style="@style/SelectableItem"
+ android:layout_gravity="center_vertical" />
+ </LinearLayout>
+</RelativeLayout> \ No newline at end of file
diff --git a/OpenKeychain/src/main/res/layout/affirmation_create_twitter_fragment_step3.xml b/OpenKeychain/src/main/res/layout/affirmation_create_twitter_fragment_step3.xml
new file mode 100644
index 000000000..55d85490e
--- /dev/null
+++ b/OpenKeychain/src/main/res/layout/affirmation_create_twitter_fragment_step3.xml
@@ -0,0 +1,192 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
+
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:fillViewport="false"
+ android:layout_above="@+id/create_key_button_divider">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingLeft="16dp"
+ android:paddingRight="16dp"
+ android:orientation="vertical">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/linked_create_twitter_3_1" />
+
+ <EditText
+ android:id="@+id/linked_create_twitter_preview"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:imeOptions="actionNext"
+ android:layout_marginTop="8dp"
+ android:ems="10"
+ android:layout_gravity="center_horizontal"
+ android:inputType="textMultiLine"
+ android:enabled="false"
+ android:textSize="@dimen/abc_text_size_small_material"/>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/linked_create_twitter_3_2" />
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="8dp"
+ android:layout_gravity="center_horizontal">
+
+ <Button
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:drawableLeft="@android:drawable/ic_menu_send"
+ android:drawableStart="@android:drawable/ic_menu_send"
+ android:text="Tweet"
+ android:id="@+id/button_send"
+ android:layout_marginRight="8dip" />
+
+ <Button
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:drawableLeft="@android:drawable/ic_menu_share"
+ android:drawableStart="@android:drawable/ic_menu_share"
+ android:text="Share"
+ android:id="@+id/button_share"
+ android:layout_marginLeft="8dip" />
+
+ </LinearLayout>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/linked_create_twitter_3_3" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="8dp">
+
+ <ImageView
+ android:id="@+id/verify_image"
+ android:src="@drawable/status_signature_unverified_cutout"
+ android:layout_gravity="center_vertical"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="16dip"
+ android:layout_marginStart="16dip"
+ />
+
+ <ProgressBar
+ android:id="@+id/verify_progress"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone"
+ android:indeterminateOnly="true"/>
+
+ <TextView
+ android:id="@+id/verify_status"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/linked_verify_pending"
+ android:layout_marginLeft="16dip"
+ android:layout_marginStart="16dip"
+ android:layout_weight="1"
+ />
+
+ <Button
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Verify"
+ android:id="@+id/button_verify"
+ android:layout_marginRight="16dp"
+ android:layout_marginEnd="16dip"
+ />
+
+ </LinearLayout>
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/linked_create_twitter_3_4" />
+
+ </LinearLayout>
+
+ </ScrollView>
+
+ <View
+ android:id="@+id/create_key_button_divider"
+ android:layout_width="match_parent"
+ android:layout_height="1dip"
+ android:layout_marginLeft="16dp"
+ android:layout_marginRight="16dp"
+ android:background="?android:attr/listDivider"
+ android:layout_alignTop="@+id/create_key_buttons"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:layout_marginLeft="16dp"
+ android:layout_marginRight="16dp"
+ android:id="@+id/create_key_buttons">
+
+ <TextView
+ android:id="@+id/create_key_back_button"
+ android:paddingLeft="8dp"
+ android:paddingRight="8dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text=""
+ android:minHeight="?android:attr/listPreferredItemHeight"
+ android:gravity="center_vertical"
+ android:layout_gravity="center_vertical" />
+
+ <View
+ android:layout_width="1dp"
+ android:layout_height="match_parent"
+ android:layout_marginTop="8dp"
+ android:layout_marginBottom="8dp"
+ android:background="?android:attr/listDivider" />
+
+ <TextView
+ android:id="@+id/next_button"
+ android:paddingLeft="8dp"
+ android:paddingRight="8dp"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="@string/btn_next"
+ android:minHeight="?android:attr/listPreferredItemHeight"
+ android:drawableRight="@drawable/ic_action_play"
+ android:drawablePadding="8dp"
+ android:gravity="center_vertical"
+ android:clickable="true"
+ style="@style/SelectableItem"
+ android:layout_gravity="center_vertical" />
+ </LinearLayout>
+</RelativeLayout> \ No newline at end of file
diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml
index 236bfe3db..7477ee7c5 100644
--- a/OpenKeychain/src/main/res/values/strings.xml
+++ b/OpenKeychain/src/main/res/values/strings.xml
@@ -1134,14 +1134,29 @@
<string name="unlocked">Unlocked</string>
<string name="nfc_settings">Settings</string>
- <string name="aff_create_https_1_1">"You can connect your key to a website you own. This website must support https! Please enter a url where you are able to place a text file for proof:"</string>
- <string name="aff_create_https_1_2">"Example: https://example.com/pgpkey.txt"</string>
- <string name="aff_create_https_1_3">"In the next step, a proof text file will be generated and signed with your key. After that, you will then be asked to upload the proof file for verification."</string>
+ <string name="aff_create_https_1_1">"You can link your key to a website you control. Note that your server must have a valid https certificate!"</string>
+ <string name="aff_create_https_1_2">"Please enter the url where you are able to place a text file for proof:"</string>
+ <string name="aff_create_https_1_3">"Example: https://example.com/pgpkey.txt"</string>
+ <string name="aff_create_https_1_4">"In the next step, a text file will be generated, which you will be asked to upload to the uri. This file links back to your pgp key, to make the connection verifiable in both directions."</string>
+
<string name="aff_create_https_created">"The proof file has been created. For the next step, you should save and upload it to the URI you indicated:"</string>
<string name="aff_create_https_2_1">"A proof file for this URI has been created:"</string>
<string name="aff_create_https_2_2">"For the next step, you should save and upload this file."</string>
<string name="aff_create_https_2_3">"Make sure the file is reachable at the correct URI, then verify your setup."</string>
<string name="aff_create_https_2_4">"After verification is successful, hit next to add the linked identity to your keyring and finish the process."</string>
+
+ <string name="linked_create_twitter_1_1">"You can link your pgp key to your account on Twitter. Please enter your username:"</string>
+ <string name="linked_create_twitter_1_2">"A message will be generated in the next step, which you can then customize and finally publish to your timeline."</string>
+ <string name="linked_create_twitter_1_3">"This tweet links back to your pgp key, to make the connection verifiable in both directions."</string>
+ <string name="linked_create_twitter_handle">Twitter Handle</string>
+ <string name="linked_create_twitter_2_1">"A message for this Twitter account has been created. You can add some text in front if you like."</string>
+ <string name="linked_create_twitter_2_2">"Here's a preview of the full tweet:"</string>
+ <string name="linked_create_twitter_2_3">"Once you are happy with the tweet, click next to proceed."</string>
+ <string name="linked_create_twitter_3_1">"Alright, here's the finished text:"</string>
+ <string name="linked_create_twitter_3_2">"Tweet the message using either method."</string>
+ <string name="linked_create_twitter_3_3">"After the tweet is published, hit the button to verify that everything is correct"</string>
+ <string name="linked_create_twitter_3_4">"Next"</string>
+
<string name="linked_id_generic_text">"This file claims ownership of the OpenPGP key with long id %2$s.\n\nCookie for proof:\n%1$s"</string>
<string name="linked_verifying">Verifying…</string>
<string name="linked_verify_success">Verification successful!</string>