diff --git a/app/src/main/java/eu/faircode/netguard/ActivityMain.java b/app/src/main/java/eu/faircode/netguard/ActivityMain.java index dfd9982d..576d862d 100644 --- a/app/src/main/java/eu/faircode/netguard/ActivityMain.java +++ b/app/src/main/java/eu/faircode/netguard/ActivityMain.java @@ -546,18 +546,17 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences tvLicense.setMovementMethod(LinkMovementMethod.getInstance()); // Handle logcat - if (Util.hasValidFingerprint(TAG, this)) - view.setOnClickListener(new View.OnClickListener() { - private short tap = 0; + view.setOnClickListener(new View.OnClickListener() { + private short tap = 0; - @Override - public void onClick(View view) { - if (++tap == 7) { - tap = 0; - Util.sendLogcat(TAG, ActivityMain.this); - } + @Override + public void onClick(View view) { + if (++tap == 7) { + tap = 0; + Util.sendLogcat(TAG, ActivityMain.this); } - }); + } + }); // Handle rate btnRate.setVisibility(getIntentRate(this).resolveActivity(getPackageManager()) == null ? View.GONE : View.VISIBLE); diff --git a/app/src/main/java/eu/faircode/netguard/Util.java b/app/src/main/java/eu/faircode/netguard/Util.java index 30613cf9..414d4ae0 100644 --- a/app/src/main/java/eu/faircode/netguard/Util.java +++ b/app/src/main/java/eu/faircode/netguard/Util.java @@ -214,10 +214,11 @@ public class Util { private static StringBuilder getLogcat(String tag) { String pid = Integer.toString(android.os.Process.myPid()); StringBuilder builder = new StringBuilder(); + Process process = null; BufferedReader br = null; try { String[] command = new String[]{"logcat", "-d", "-v", "threadtime"}; - Process process = Runtime.getRuntime().exec(command); + process = Runtime.getRuntime().exec(command); br = new BufferedReader(new InputStreamReader(process.getInputStream())); String line; while ((line = br.readLine()) != null) @@ -233,6 +234,8 @@ public class Util { br.close(); } catch (IOException ignored) { } + if (process != null) + process.destroy(); } return builder; }