aboutsummaryrefslogtreecommitdiffstats
path: root/OpenKeychain/src/main/java
diff options
pre { line-height: 125%; margin: 0; } td.linenos pre { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; } span.linenos { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; } td.linenos pre.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; } .highlight .hll { background-color: #ffffcc } .highlight { background: #ffffff; } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#
# Copyright (C) 2006-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk

ARCH:=mipsel
BOARD:=rb532
BOARDNAME:=Mikrotik RouterBoard 532
FEATURES:=pci targz squashfs minor nand

KERNEL_PATCHVER:=4.4

include $(INCLUDE_DIR)/target.mk

DEFAULT_PACKAGES += wpad-mini kmod-ath5k kmod-input-rb532 e2fsprogs mkf2fs nand-utils

$(eval $(call BuildTarget))
context:
space:
mode:
iv class='del'>-
- /**
- * Creates new instance of this fragment
- */
public static LinkedIdCreateDnsStep2Fragment newInstance
(String uri, int proofNonce, String proofText) {
LinkedIdCreateDnsStep2Fragment frag = new LinkedIdCreateDnsStep2Fragment();
Bundle args = new Bundle();
+ args.putInt(ARG_NONCE, proofNonce);
args.putString(DOMAIN, uri);
- args.putInt(NONCE, proofNonce);
args.putString(TEXT, proofText);
frag.setArguments(args);
@@ -95,30 +66,22 @@ public class LinkedIdCreateDnsStep2Fragment extends Fragment {
}
@Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- final View view = inflater.inflate(R.layout.linked_create_dns_fragment_step2, container, false);
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
mResourceDomain = getArguments().getString(DOMAIN);
- mResourceNonce = getArguments().getInt(NONCE);
mResourceString = getArguments().getString(TEXT);
- view.findViewById(R.id.next_button).setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- startCertify();
- }
- });
+ }
- view.findViewById(R.id.back_button).setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- mLinkedIdWizard.loadFragment(null, null, LinkedIdWizard.FRAG_ACTION_TO_LEFT);
- }
- });
+ @Override
+ protected View newView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ return inflater.inflate(R.layout.linked_create_dns_fragment_step2, container, false);
+ }
- mVerifyImage = (ImageView) view.findViewById(R.id.verify_image);
- mVerifyProgress = view.findViewById(R.id.verify_progress);
- mVerifyStatus = (TextView) view.findViewById(R.id.verify_status);
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View view = super.onCreateView(inflater, container, savedInstanceState);
view.findViewById(R.id.button_send).setOnClickListener(new OnClickListener() {
@Override
@@ -134,48 +97,15 @@ public class LinkedIdCreateDnsStep2Fragment extends Fragment {
}
});
- view.findViewById(R.id.button_verify).setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- proofVerify();
- }
- });
-
mTextView = (TextView) view.findViewById(R.id.linked_create_dns_text);
mTextView.setText(mResourceString);
- setVerifyProgress(false, null);
- mVerifyStatus.setText(R.string.linked_verify_pending);
-
return view;
}
@Override
- public void onActivityCreated(Bundle savedInstanceState) {
- super.onActivityCreated(savedInstanceState);
-
- mLinkedIdWizard = (LinkedIdWizard) 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_24dp);
- 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_24dp);
- 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_24dp);
- mVerifyImage.setColorFilter(getResources().getColor(R.color.android_red_dark),
- PorterDuff.Mode.SRC_IN);
- }
+ LinkedCookieResource getResource() {
+ return DnsResource.createNew(mResourceDomain);
}
private void proofSend () {
@@ -218,125 +148,6 @@ public class LinkedIdCreateDnsStep2Fragment extends Fragment {
}
}
- public void proofVerify() {
- setVerifyProgress(true, null);
-
- final DnsResource resource = DnsResource.createNew(mResourceDomain);
-
- new AsyncTask<Void,Void,LinkedVerifyResult>() {
-
- @Override
- protected LinkedVerifyResult doInBackground(Void... params) {
- return resource.verify(mLinkedIdWizard.mFingerprint, mResourceNonce);
- }
-
- @Override
- protected void onPostExecute(LinkedVerifyResult result) {
- super.onPostExecute(result);
- if (result.success()) {
- setVerifyProgress(false, true);
- mVerifiedResource = resource;
- } else {
- setVerifyProgress(false, false);
- mVerifiedResource = resource;
- // on error, show error message
- result.createNotify(getActivity()).show();
- }
- }
- }.execute();
-
- }
-
- public void startCertify() {
-
- if (mVerifiedResource == null) {
- Notify.showNotify(getActivity(), R.string.linked_need_verify, Style.ERROR);
- return;
- }
-
- Intent intent = new Intent(getActivity(), PassphraseDialogActivity.class);
- intent.putExtra(PassphraseDialogActivity.EXTRA_SUBKEY_ID, mLinkedIdWizard.mMasterKeyId);
- startActivityForResult(intent, REQUEST_CODE_PASSPHRASE);
-
- }
-
- public void certifyLinkedIdentity (String passphrase) {
- KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(
- getActivity(),
- getString(R.string.progress_saving),
- ProgressDialog.STYLE_HORIZONTAL,
- true) {
- public void handleMessage(Message message) {
- // handle messages by standard KeychainIntentServiceHandler first
- super.handleMessage(message);
-
- if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) {
-
- // get returned data bundle
- Bundle returnData = message.getData();
- if (returnData == null) {
- return;
- }
- final OperationResult result =
- returnData.getParcelable(OperationResult.EXTRA_RESULT);
- if (result == null) {
- return;
- }
-
- // if bad -> display here!
- if (!result.success()) {
- result.createNotify(getActivity()).show();
- return;
- }
-
- result.createNotify(getActivity()).show();
-
- // if good -> finish, return result to showkey and display there!
- // Intent intent = new Intent();
- // intent.putExtra(OperationResult.EXTRA_RESULT, result);
- // getActivity().setResult(EditKeyActivity.RESULT_OK, intent);
-
- // AffirmationCreateHttpsStep3Fragment frag =
- // AffirmationCreateHttpsStep3Fragment.newInstance(
- // mResourceDomain, mResourceNonce, mResourceString);
-
- // mAffirmationWizard.loadFragment(null, frag, AffirmationWizard.FRAG_ACTION_TO_RIGHT);
-
- }
- }
- };
-
- SaveKeyringParcel skp =
- new SaveKeyringParcel(mLinkedIdWizard.mMasterKeyId, mLinkedIdWizard.mFingerprint);
-
- WrappedUserAttribute ua =
- LinkedIdentity.fromResource(mVerifiedResource, mResourceNonce).toUserAttribute();
-
- skp.mAddUserAttribute.add(ua);
-
- // Send all information needed to service to import key in other thread
- Intent intent = new Intent(getActivity(), KeychainIntentService.class);
- intent.setAction(KeychainIntentService.ACTION_EDIT_KEYRING);
-
- // fill values for this action
- Bundle data = new Bundle();
- data.putString(KeychainIntentService.EDIT_KEYRING_PASSPHRASE, passphrase);
- data.putParcelable(KeychainIntentService.EDIT_KEYRING_PARCEL, skp);
- intent.putExtra(KeychainIntentService.EXTRA_DATA, data);
-
- // Create a new Messenger for the communication back
- Messenger messenger = new Messenger(saveHandler);
- intent.putExtra(KeychainIntentService.EXTRA_MESSENGER, messenger);
-
- // show progress dialog
- saveHandler.showProgressDialog(getActivity());
-
- // start service with intent
- getActivity().startService(intent);
-
- }
-
-
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) {
@@ -348,15 +159,9 @@ public class LinkedIdCreateDnsStep2Fragment extends Fragment {
Uri uri = data.getData();
saveFile(uri);
break;
- case REQUEST_CODE_PASSPHRASE:
- if (resultCode == Activity.RESULT_OK && data != null) {
- String passphrase =
- data.getStringExtra(PassphraseDialogActivity.MESSAGE_DATA_PASSPHRASE);
- certifyLinkedIdentity(passphrase);
- }
- break;
+ default:
+ super.onActivityResult(requestCode, resultCode, data);
}
- super.onActivityResult(requestCode, resultCode, data);
}
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateFinalFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateFinalFragment.java
index b02d70b33..c8c0c1239 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateFinalFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateFinalFragment.java
@@ -33,7 +33,7 @@ public abstract class LinkedIdCreateFinalFragment extends Fragment {
public static final String ARG_NONCE = "nonce";
protected static final int REQUEST_CODE_PASSPHRASE = 0x00007008;
- LinkedIdWizard mLinkedIdWizard;
+ private LinkedIdWizard mLinkedIdWizard;
private ImageView mVerifyImage;
private View mVerifyProgress;