From 8556e992414d074c1d59fea78bebcd8f2624ed61 Mon Sep 17 00:00:00 2001 From: wb9688 Date: Wed, 21 Mar 2018 10:55:22 +0100 Subject: [PATCH] Remove IP range This would close #1148. I haven't tested it myself yet. @TheAssassin: Could you update the Sentry part? --- .../schabi/newpipe/report/ErrorActivity.java | 45 +------------------ 1 file changed, 1 insertion(+), 44 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/report/ErrorActivity.java b/app/src/main/java/org/schabi/newpipe/report/ErrorActivity.java index 8e3509032..017c094aa 100644 --- a/app/src/main/java/org/schabi/newpipe/report/ErrorActivity.java +++ b/app/src/main/java/org/schabi/newpipe/report/ErrorActivity.java @@ -77,12 +77,10 @@ public class ErrorActivity extends AppCompatActivity { public static final String ERROR_EMAIL_ADDRESS = "crashreport@newpipe.schabi.org"; public static final String ERROR_EMAIL_SUBJECT = "Exception in NewPipe " + BuildConfig.VERSION_NAME; - Thread globIpRangeThread; private String[] errorList; private ErrorInfo errorInfo; private Class returnActivity; private String currentTimeStamp; - private String globIpRange; // views private TextView errorView; private EditText userCommentBox; @@ -224,9 +222,6 @@ public class ErrorActivity extends AppCompatActivity { }); reportButton.setEnabled(false); - globIpRangeThread = new Thread(new IpRangeRequester()); - globIpRangeThread.start(); - // normal bugreport buildInfo(errorInfo); if (errorInfo.message != 0) { @@ -342,8 +337,7 @@ public class ErrorActivity extends AppCompatActivity { .put("package", getPackageName()) .put("version", BuildConfig.VERSION_NAME) .put("os", getOsString()) - .put("time", currentTimeStamp) - .put("ip_range", globIpRange); + .put("time", currentTimeStamp); JSONArray exceptionArray = new JSONArray(); if (errorList != null) { @@ -454,41 +448,4 @@ public class ErrorActivity extends AppCompatActivity { dest.writeInt(this.message); } } - - private class IpRangeRequester implements Runnable { - Handler h = new Handler(); - - public void run() { - String ipRange = "none"; - try { - Downloader dl = Downloader.getInstance(); - String ip = dl.download("https://ipv4.icanhazip.com"); - - ipRange = Parser.matchGroup1("([0-9]*\\.[0-9]*\\.)[0-9]*\\.[0-9]*", ip) - + "0.0"; - } catch (Throwable e) { - Log.w(TAG, "Error while error: could not get iprange", e); - } finally { - h.post(new IpRangeReturnRunnable(ipRange)); - } - } - } - - private class IpRangeReturnRunnable implements Runnable { - String ipRange; - - public IpRangeReturnRunnable(String ipRange) { - this.ipRange = ipRange; - } - - public void run() { - globIpRange = ipRange; - if (infoView != null) { - String text = infoView.getText().toString(); - text += "\n" + globIpRange; - infoView.setText(text); - reportButton.setEnabled(true); - } - } - } }