diff --git a/app/src/main/java/fr/free/nrw/commons/Utils.java b/app/src/main/java/fr/free/nrw/commons/Utils.java index 414fd39dd..275264e8c 100644 --- a/app/src/main/java/fr/free/nrw/commons/Utils.java +++ b/app/src/main/java/fr/free/nrw/commons/Utils.java @@ -79,43 +79,6 @@ public class Utils { Log.e(TAG, "Exception on closing MD5 input stream", e); } } - - } - - public static boolean testSHA1(String sha1, InputStream is) { - MessageDigest digest; - try { - digest = MessageDigest.getInstance("SHA1"); - } catch (NoSuchAlgorithmException e) { - Log.e(TAG, "Exception while getting Digest", e); - return false; - } - - byte[] buffer = new byte[8192]; - int read; - try { - while ((read = is.read(buffer)) > 0) { - digest.update(buffer, 0, read); - } - byte[] md5sum = digest.digest(); - BigInteger bigInt = new BigInteger(1, md5sum); - String output = bigInt.toString(16); - // Fill to 40 chars - output = String.format("%40s", output).replace(' ', '0'); - - Log.i(TAG, "Test: " + sha1); - Log.i(TAG, "Generated: " + output); - - return (sha1.equals(output)); - } catch (IOException e) { - throw new RuntimeException("Unable to process file for MD5", e); - } finally { - try { - is.close(); - } catch (IOException e) { - Log.e(TAG, "Exception on closing MD5 input stream", e); - } - } } public static Date parseMWDate(String mwDate) { diff --git a/app/src/main/java/fr/free/nrw/commons/upload/ShareActivity.java b/app/src/main/java/fr/free/nrw/commons/upload/ShareActivity.java index b82bb2658..beae5ba90 100644 --- a/app/src/main/java/fr/free/nrw/commons/upload/ShareActivity.java +++ b/app/src/main/java/fr/free/nrw/commons/upload/ShareActivity.java @@ -259,10 +259,7 @@ public class ShareActivity } catch (IOException e) { Log.d(TAG, "IO Exception: ", e); } - - - - //File imageFile = new File(mediaUri.getPath()); + } if(savedInstanceState != null) {