import: apply fixPgpMessage to text for import from clipboard

This commit is contained in:
Vincent Breitmoser
2015-11-06 12:09:27 +01:00
parent 33e8699be5
commit 5c47570e90
3 changed files with 24 additions and 3 deletions

View File

@@ -200,7 +200,7 @@ public class DecryptActivity extends BaseActivity {
}
// clean up ascii armored message, fixing newlines and stuff
String cleanedText = PgpHelper.getPgpContent(text);
String cleanedText = PgpHelper.getPgpMessageContent(text);
if (cleanedText == null) {
return null;
}

View File

@@ -29,6 +29,9 @@ import android.view.ViewGroup;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.compatibility.ClipboardReflection;
import org.sufficientlysecure.keychain.pgp.PgpHelper;
import org.sufficientlysecure.keychain.ui.util.Notify;
import org.sufficientlysecure.keychain.ui.util.Notify.Style;
import org.sufficientlysecure.keychain.util.FileHelper;
public class ImportKeysFileFragment extends Fragment {
@@ -78,12 +81,16 @@ public class ImportKeysFileFragment extends Fragment {
String sendText = "";
if (clipboardText != null) {
sendText = clipboardText.toString();
sendText = PgpHelper.getPgpKeyContent(sendText);
if (sendText == null) {
Notify.create(mImportActivity, "Bad data!", Style.ERROR).show();
return;
}
mImportActivity.loadCallback(new ImportKeysListFragment.BytesLoaderState(sendText.getBytes(), null));
}
}
});
return view;
}