public class SecurityLog extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
SecurityLog.SECURITY_LOG_TAG |
static class |
SecurityLog.SecurityEvent
A class representing a security event log entry.
|
Modifier and Type | Field and Description |
---|---|
static int |
TAG_ADB_SHELL_CMD
Indicate that an shell command was issued over ADB via "adb shell command"
The log entry contains a string data of the shell command, accessible via
SecurityLog.SecurityEvent.getData() |
static int |
TAG_ADB_SHELL_INTERACTIVE
Indicate that an ADB interactive shell was opened via "adb shell".
|
static int |
TAG_APP_PROCESS_START
Indicate that an app process was started.
|
static int |
TAG_KEYGUARD_DISMISS_AUTH_ATTEMPT
Indicate that there has been an authentication attempt to dismiss the keyguard.
|
static int |
TAG_KEYGUARD_DISMISSED
Indicate that keyguard is being dismissed.
|
static int |
TAG_KEYGUARD_SECURED
Indicate that the device has been locked, either by user or by timeout.
|
static int |
TAG_SYNC_RECV_FILE
Indicate that a file was pulled from the device via the adb daemon, for example via
"adb pull".
|
static int |
TAG_SYNC_SEND_FILE
Indicate that a file was pushed to the device via the adb daemon, for example via
"adb push".
|
Constructor and Description |
---|
SecurityLog() |
Modifier and Type | Method and Description |
---|---|
static boolean |
getLoggingEnabledProperty() |
static boolean |
isLoggingEnabled()
Returns if security logging is enabled.
|
static void |
readEvents(Collection<SecurityLog.SecurityEvent> output)
Retrieve all security logs and return immediately.
|
static void |
readEventsOnWrapping(long timestamp,
Collection<SecurityLog.SecurityEvent> output)
Retrieve all security logs whose timestamp (in nanosceonds) is equal to or greater than the
given timestamp.
|
static void |
readEventsSince(long timestamp,
Collection<SecurityLog.SecurityEvent> output)
Retrieve all security logs since the given timestamp in nanoseconds and return immediately.
|
static void |
readPreviousEvents(Collection<SecurityLog.SecurityEvent> output)
Retrieve all security logs before the last reboot.
|
static void |
setLoggingEnabledProperty(boolean enabled) |
static int |
writeEvent(int tag,
Object... payloads)
Write a log entry to the underlying storage, with several payloads.
|
static int |
writeEvent(int tag,
String str)
Write a log entry to the underlying storage, with a string payload.
|
public static final int TAG_ADB_SHELL_INTERACTIVE
public static final int TAG_ADB_SHELL_CMD
SecurityLog.SecurityEvent.getData()
public static final int TAG_SYNC_RECV_FILE
SecurityLog.SecurityEvent.getData()
public static final int TAG_SYNC_SEND_FILE
SecurityLog.SecurityEvent.getData()
public static final int TAG_APP_PROCESS_START
Object
array, accessible via
SecurityLog.SecurityEvent.getData()
:
process name (String), exact start time (long), app Uid (integer), app Pid (integer),
seinfo tag (String), SHA-256 hash of the base APK in hexadecimal (String)public static final int TAG_KEYGUARD_DISMISSED
public static final int TAG_KEYGUARD_DISMISS_AUTH_ATTEMPT
Object
array,
accessible via SecurityLog.SecurityEvent.getData()
:
attempt result (integer, 1 for successful, 0 for unsuccessful), strength of auth method
(integer, 1 if strong auth method was used, 0 otherwise)public static final int TAG_KEYGUARD_SECURED
public static boolean isLoggingEnabled()
PROPERTY_LOGGING_ENABLED
.public static void setLoggingEnabledProperty(boolean enabled)
public static boolean getLoggingEnabledProperty()
public static void readEvents(Collection<SecurityLog.SecurityEvent> output) throws IOException
IOException
public static void readEventsSince(long timestamp, Collection<SecurityLog.SecurityEvent> output) throws IOException
IOException
public static void readPreviousEvents(Collection<SecurityLog.SecurityEvent> output) throws IOException
IOException
public static void readEventsOnWrapping(long timestamp, Collection<SecurityLog.SecurityEvent> output) throws IOException
IOException
public static int writeEvent(int tag, String str)
public static int writeEvent(int tag, Object... payloads)