mirror of https://github.com/M66B/NetGuard.git
Merge branch 'master' of https://github.com/M66B/NetGuard
This commit is contained in:
commit
937b7885ed
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue