diff --git a/Safe/src/main/java/org/openintents/safe/CryptoHelper.java b/Safe/src/main/java/org/openintents/safe/CryptoHelper.java index b8d5d055..b0db3503 100644 --- a/Safe/src/main/java/org/openintents/safe/CryptoHelper.java +++ b/Safe/src/main/java/org/openintents/safe/CryptoHelper.java @@ -138,9 +138,7 @@ private void initialize(int Strength) { try { keyFac = SecretKeyFactory .getInstance(algorithm, "BC"); - } catch (NoSuchAlgorithmException e) { - Log.e(TAG, "CryptoHelper(): " + e.toString()); - } catch (NoSuchProviderException e) { + } catch (NoSuchAlgorithmException | NoSuchProviderException e) { Log.e(TAG, "CryptoHelper(): " + e.toString()); } } @@ -208,9 +206,7 @@ public static byte[] md5String(String message) { dIn.read(); } - } catch (NoSuchAlgorithmException e) { - Log.e(TAG, "md5String(): " + e.toString()); - } catch (IOException e) { + } catch (NoSuchAlgorithmException | IOException e) { Log.e(TAG, "md5String(): " + e.toString()); } @@ -965,13 +961,8 @@ public boolean decryptStreamWithSessionKey(InputStream is, OutputStream os) thro pbeCipher.init(Cipher.DECRYPT_MODE, pbeKey, pbeParamSpec); byteSessionKey = pbeCipher.doFinal(byteCipherSessionKey); status = true; - } catch (IllegalBlockSizeException e) { - Log.e(TAG, "decrypt(): " + e.toString()); - } catch (BadPaddingException e) { - Log.e(TAG, "decrypt(): " + e.toString()); - } catch (InvalidKeyException e) { - Log.e(TAG, "decrypt(): " + e.toString()); - } catch (InvalidAlgorithmParameterException e) { + } catch (IllegalBlockSizeException | BadPaddingException + | InvalidKeyException | InvalidAlgorithmParameterException e) { Log.e(TAG, "decrypt(): " + e.toString()); } diff --git a/Safe/src/main/java/org/openintents/safe/Restore.java b/Safe/src/main/java/org/openintents/safe/Restore.java index 590487cd..34a30339 100644 --- a/Safe/src/main/java/org/openintents/safe/Restore.java +++ b/Safe/src/main/java/org/openintents/safe/Restore.java @@ -203,27 +203,7 @@ public boolean read(InputStreamData streamData, String masterPassword) { restoreDataSet = myRestoreHandler.getParsedData(); - } catch (ParserConfigurationException e) { - //e.printStackTrace(); - Toast.makeText( - Restore.this, getString( - R.string.restore_unable_to_open, - e.getLocalizedMessage() - ), - Toast.LENGTH_LONG - ).show(); - return false; - } catch (SAXException e) { - //e.printStackTrace(); - Toast.makeText( - Restore.this, getString( - R.string.restore_unable_to_open, - e.getLocalizedMessage() - ), - Toast.LENGTH_LONG - ).show(); - return false; - } catch (IOException e) { + } catch (ParserConfigurationException | SAXException | IOException e) { //e.printStackTrace(); Toast.makeText( Restore.this, getString(