diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger/services/AbstractConnectionManager.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/AbstractConnectionManager.java | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/main/java/de/pixart/messenger/services/AbstractConnectionManager.java b/src/main/java/de/pixart/messenger/services/AbstractConnectionManager.java index 8fd7dc814..1c4c6ca19 100644 --- a/src/main/java/de/pixart/messenger/services/AbstractConnectionManager.java +++ b/src/main/java/de/pixart/messenger/services/AbstractConnectionManager.java @@ -86,7 +86,7 @@ public class AbstractConnectionManager { is = new FileInputStream(file); size = (int) file.getSize(); if (file.getKey() == null) { - return new Pair<InputStream, Integer>(is, size); + return new Pair<>(is, size); } try { if (gcm) { @@ -99,16 +99,10 @@ public class AbstractConnectionManager { Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(file.getKey(), "AES"), ips); Log.d(Config.LOGTAG, "opening encrypted input stream"); - return new Pair<InputStream, Integer>(new CipherInputStream(is, cipher), (size / 16 + 1) * 16); + return new Pair<>(new CipherInputStream(is, cipher), (size / 16 + 1) * 16); } - } catch (InvalidKeyException e) { - return null; - } catch (NoSuchAlgorithmException e) { - return null; - } catch (NoSuchPaddingException e) { - return null; - } catch (InvalidAlgorithmParameterException e) { - return null; + } catch (Exception e) { + throw new AssertionError(e); } } |