forked from cSploit/android
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogcat.java
More file actions
55 lines (46 loc) · 1.12 KB
/
Copy pathLogcat.java
File metadata and controls
55 lines (46 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package org.csploit.android.tools;
/**
* Manage android logcat
*
* this isn't a cSploit tool
*/
public class Logcat extends Raw {
/**
* receive logcat output
*/
public abstract static class FullReceiver extends RawReceiver {
private final StringBuilder sb = new StringBuilder();
@Override
public void onNewLine(String line) {
sb.append(line);
sb.append("\n");
}
@Override
final public void onEnd(int exitValue) {
onLogcat(sb.toString());
}
public abstract void onLogcat(String logcat);
}
/**
* receive libc fatal messages from logcat
*/
public abstract static class LibcReceiver extends FullReceiver {
private String libcFingerprint = null;
@Override
public void onNewLine(String line) {
if (libcFingerprint == null) {
if(!line.contains("*** *** ***")) {
return;
}
libcFingerprint = line.substring(0, line.indexOf(':') + 1);
} else if (!line.startsWith(libcFingerprint)) {
return;
}
super.onNewLine(line);
}
}
public Logcat() {
super();
mCmdPrefix = "logcat -d";
}
}