This commit is contained in:
Marco 2015-11-13 12:48:01 +01:00
commit 937b7885ed
2 changed files with 13 additions and 11 deletions

View File

@ -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);

View File

@ -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;
}