|
27 | 27 | import com.flowcrypt.email.js.PgpKey; |
28 | 28 | import com.flowcrypt.email.model.KeyDetails; |
29 | 29 |
|
| 30 | +import org.acra.ACRA; |
| 31 | + |
30 | 32 | import java.io.IOException; |
31 | 33 | import java.lang.ref.WeakReference; |
32 | 34 |
|
@@ -203,20 +205,25 @@ public void handleMessage(Message msg) { |
203 | 205 | if (js != null) { |
204 | 206 | String clipboardText = (String) msg.obj; |
205 | 207 |
|
206 | | - String normalizedArmoredKey = js.crypto_key_normalize(clipboardText); |
207 | | - PgpKey pgpKey = js.crypto_key_read(normalizedArmoredKey); |
208 | | - |
209 | | - if (js.is_valid_key(pgpKey, isMustBePrivateKey)) { |
210 | | - try { |
211 | | - KeyDetails keyDetails = new KeyDetails(null, clipboardText, null, |
212 | | - null, |
213 | | - false, pgpKey.getPrimaryUserId()); |
214 | | - Messenger messenger = msg.replyTo; |
215 | | - messenger.send(Message.obtain(null, ReplyHandler.MESSAGE_WHAT, |
216 | | - keyDetails)); |
217 | | - } catch (RemoteException e) { |
218 | | - e.printStackTrace(); |
| 208 | + try { |
| 209 | + String normalizedArmoredKey = js.crypto_key_normalize(clipboardText); |
| 210 | + PgpKey pgpKey = js.crypto_key_read(normalizedArmoredKey); |
| 211 | + |
| 212 | + if (js.is_valid_key(pgpKey, isMustBePrivateKey)) { |
| 213 | + try { |
| 214 | + KeyDetails keyDetails = new KeyDetails(null, clipboardText, null, |
| 215 | + null, |
| 216 | + false, pgpKey.getPrimaryUserId()); |
| 217 | + Messenger messenger = msg.replyTo; |
| 218 | + messenger.send(Message.obtain(null, ReplyHandler.MESSAGE_WHAT, |
| 219 | + keyDetails)); |
| 220 | + } catch (RemoteException e) { |
| 221 | + e.printStackTrace(); |
| 222 | + } |
219 | 223 | } |
| 224 | + } catch (Exception e) { |
| 225 | + e.printStackTrace(); |
| 226 | + ACRA.getErrorReporter().handleException(e); |
220 | 227 | } |
221 | 228 | } |
222 | 229 | break; |
|
0 commit comments