From 2531c88f2c8a992aa0c40c9f96e88099dc94139e Mon Sep 17 00:00:00 2001 From: steckbrief Date: Fri, 20 Nov 2015 22:41:30 +0100 Subject: Implements FS#67: Introduce central logging class to use log prefix, new activity to show logcat output and button to copy contents --- .../entities/DownloadableFile.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/main/java/de/thedevstack/conversationsplus/entities') diff --git a/src/main/java/de/thedevstack/conversationsplus/entities/DownloadableFile.java b/src/main/java/de/thedevstack/conversationsplus/entities/DownloadableFile.java index 9a677cd0..8d608ae7 100644 --- a/src/main/java/de/thedevstack/conversationsplus/entities/DownloadableFile.java +++ b/src/main/java/de/thedevstack/conversationsplus/entities/DownloadableFile.java @@ -22,7 +22,7 @@ import javax.crypto.spec.SecretKeySpec; import de.thedevstack.conversationsplus.Config; import de.thedevstack.conversationsplus.utils.MimeUtils; -import android.util.Log; +import de.thedevstack.conversationsplus.utils.Logging; public class DownloadableFile extends File { @@ -114,19 +114,19 @@ public class DownloadableFile extends File { IvParameterSpec ips = new IvParameterSpec(iv); Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); cipher.init(Cipher.ENCRYPT_MODE, this.getKey(), ips); - Log.d(Config.LOGTAG, "opening encrypted input stream"); + Logging.d(Config.LOGTAG, "opening encrypted input stream"); return new CipherInputStream(new FileInputStream(this), cipher); } catch (NoSuchAlgorithmException e) { - Log.d(Config.LOGTAG, "no such algo: " + e.getMessage()); + Logging.d(Config.LOGTAG, "no such algo: " + e.getMessage()); return null; } catch (NoSuchPaddingException e) { - Log.d(Config.LOGTAG, "no such padding: " + e.getMessage()); + Logging.d(Config.LOGTAG, "no such padding: " + e.getMessage()); return null; } catch (InvalidKeyException e) { - Log.d(Config.LOGTAG, "invalid key: " + e.getMessage()); + Logging.d(Config.LOGTAG, "invalid key: " + e.getMessage()); return null; } catch (InvalidAlgorithmParameterException e) { - Log.d(Config.LOGTAG, "invavid iv:" + e.getMessage()); + Logging.d(Config.LOGTAG, "invavid iv:" + e.getMessage()); return null; } catch (FileNotFoundException e) { return null; @@ -146,20 +146,20 @@ public class DownloadableFile extends File { IvParameterSpec ips = new IvParameterSpec(this.iv); Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); cipher.init(Cipher.DECRYPT_MODE, this.getKey(), ips); - Log.d(Config.LOGTAG, "opening encrypted output stream"); + Logging.d(Config.LOGTAG, "opening encrypted output stream"); return new CipherOutputStream(new FileOutputStream(this), cipher); } catch (NoSuchAlgorithmException e) { - Log.d(Config.LOGTAG, "no such algo: " + e.getMessage()); + Logging.d(Config.LOGTAG, "no such algo: " + e.getMessage()); return null; } catch (NoSuchPaddingException e) { - Log.d(Config.LOGTAG, "no such padding: " + e.getMessage()); + Logging.d(Config.LOGTAG, "no such padding: " + e.getMessage()); return null; } catch (InvalidKeyException e) { - Log.d(Config.LOGTAG, "invalid key: " + e.getMessage()); + Logging.d(Config.LOGTAG, "invalid key: " + e.getMessage()); return null; } catch (InvalidAlgorithmParameterException e) { - Log.d(Config.LOGTAG, "invavid iv:" + e.getMessage()); + Logging.d(Config.LOGTAG, "invavid iv:" + e.getMessage()); return null; } catch (FileNotFoundException e) { return null; -- cgit v1.2.3