public class PCSDK
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PCSDK.PCQRType
QR-code types to process by PCSDK
|
Modifier and Type | Field and Description |
---|---|
static int |
PC_LOG_DEBUG
Log level - debug logs to logcat
|
static int |
PC_LOG_KEY_VALUES
Log level - log key values to logcat.
|
static int |
PC_LOG_VERBOSE
Log level - log key values to logcat.
|
static int |
PC_NO_LOGGING
Log level - no logging
|
Constructor and Description |
---|
PCSDK() |
Modifier and Type | Method and Description |
---|---|
static PCSDK.PCQRType |
analyzeQRValue(java.lang.String qrValue)
Function to analyze data from scanned QR-code
Should be used to detect if PCSDK can process QR-code data |
boolean |
areCallbacksInvokedInMainThread()
Returns the same value as was passed to last call of
setCallbacksInvokedInMainThread(boolean) or
true if this method was never called from the app. |
boolean |
checkRoot()
Function to check if device is rooted
Returns true if root detected Does not checks if BusyBox presents |
void |
clearCaches()
Used for clear caches
. |
void |
destroy()
Destructor
|
Context |
getContext() |
long |
getRealTime()
Returns real rime provided by google server
|
java.util.HashMap<java.lang.String,java.lang.String> |
getSpyAppsList()
Function to build list of potentially dangerous installed apps which include:
(1) Apps with PACKAGE_USAGE_STATS and SYSTEM_ALERT_WINDOW privileges excluding system apps
(2) Apps from predefined blacklist which might be dangerous Apps with privileges PACKAGE_USAGE_STATS and SYSTEM_ALERT_WINDOW can track active app name in any time and show it's own content over the top This ability is required to make overlay-attack Function excludes following apps: com.sec.android.easyMover com.google.android.apps.nbu.files |
static java.lang.String |
getVersion()
Returns PCSDK SDK version
|
void |
init(Context context)
Lib initialization.
|
void |
pause()
Deprecated.
|
void |
resume()
Deprecated.
|
void |
setCallbacksInvokedInMainThread(boolean isInMainThread)
Defines whether the callbacks passed to various methods which involve interaction with server should be invoked
in main thread or not.
|
void |
setFixedApiVersion(boolean isFixed)
Determines whether the API version for a particular
PCUser is fixed once it has been discovered. |
void |
setHandlesBackgroundTimeout(int timeout)
Defines maximum period (in milliseconds), during which handles for private keys will be kept
while the app in the background.
|
void |
setLogLevel(int logLevel)
Set PCSDK SDK log level
|
public static final int PC_NO_LOGGING
public static final int PC_LOG_DEBUG
public static final int PC_LOG_KEY_VALUES
public static final int PC_LOG_VERBOSE
public void init(Context context)
context
- Application context. Required for access to Android services on behalf of Applicationpublic void destroy()
public long getRealTime()
public void setCallbacksInvokedInMainThread(boolean isInMainThread)
init(Context)
in case you
intend to alter default behaviour.isInMainThread
- Pass true if you want callbacks to be invoked in main thread. Pass
false if you do not care about actual thread where callbacks will be
invoked. If false is passed callbacks will be executed either in separate thread (which
is created by SDK for interaction with server) or in the same thread where SDK method
is called in case the separate thread was not created (e.g. when there is no internet
connection and callback returns error of type
PCNetError.PCIS_ERROR_NO_CONNECTION
).public boolean areCallbacksInvokedInMainThread()
setCallbacksInvokedInMainThread(boolean)
or
true if this method was never called from the app.@Deprecated public void resume()
@Deprecated public void pause()
public void setLogLevel(int logLevel)
logLevel
- - log levelpublic void setFixedApiVersion(boolean isFixed)
PCUser
is fixed once it has been discovered.isFixed
- true if API version must be fixed across the sessions with PC Server, false if
API version is supposed to be checked before every new sessionpublic boolean checkRoot()
public java.util.HashMap<java.lang.String,java.lang.String> getSpyAppsList()
public static java.lang.String getVersion()
public static PCSDK.PCQRType analyzeQRValue(java.lang.String qrValue)
qrValue
- data from QR-codePCSDK.PCQRType
public Context getContext()
public void setHandlesBackgroundTimeout(int timeout)
timeout
- max time in milliseconds for being in background during which handles are keptpublic void clearCaches()