API
Variables
TalsecConfig
TalsecConfigSpecifies configuration for your app. See the table below for a detailed description of the attributes.
expectedPackageName
String
Package name of the app.
"com.talsec.freerasp.demoapp"
expectedSigningCertificateHashBase64
Array<String>
Certificate hashes of your app. You must get your expected signing certificate hashes in Base64 form. You can go through this manual to learn how to sign your app in more detail, including manual signing and using Google's Play app signing.
arrayOf( "mVr/qQLO8DKTwqlL+B1qigl9NoBnbiUs8b4c2Ewcz0k=")
watcherMail
String?
The value is automatically used for Security Reports, Product Updates, and Talsec Portal updates, learn more.
Mail has a strict form '[email protected]'.
supportedAlternativeStores
Array<String>
Package names of the alternative stores on which you are publishing the application. The Google Play Store and Huawei AppGallery, are included internally. (You can assign just emptyArray()). For more information, visit the Detecting Unofficial Installation wiki page.
arrayOf( "com.sec.android.app.samsungapps")
isProd
Boolean?
Defaults to true when undefined. If you want to use the Dev version to make the development process viable, set the parameter to false. Make sure that you have the Release version in the production (i.e. isProd set to true)!. To simplify switching between debug and release version of freeRASP based on the build type, you can use BuildConfig.BUILD_TYPE.contains("Release", true) as a value for isProd.
true
killOnBypass
Boolean?
Defaults to false .
Determines whether the app should be killed within the SDK, if the callbacks are hooked or modified by an attacker.
true
Classes
public class ThreatListener
public class ThreatListenerConstructor
public ThreatListener(@NonNull ThreatDetected threatsCallback, @Nullable DeviceState deviceStateCallback, @Nullable RaspExecutionState raspExecutionCallback)
Listener for the threats detected by freeRASP
Methods
public void registerListener(@NonNull Context context)
Registers your reactions to detected threats with freeRASP.
public void unregisterListener(@NonNull Context context)
Unregisters the reactions to detected threats.
public final class Talsec
Methods
public static void start(@NonNull Context context, @NonNull TalsecConfig config, @Nullable TalsecMode mode)
The method used to start freeRASP's functionality. TalsecMode is an optional parameter that can be used to force the execution of freeRASP in FOREGROUND / BACKGROUND thread (default value is TalsecMode.BACKGROUND).
public static void blockScreenCapture(@NonNull Activity activity, boolean enable)
The method used to block/unblock screen capture.
public static void isScreenCaptureBlocked()
The method used to know the state of screen capture blocking whether blocked or not.
Interfaces
public interface ThreatDetected
public interface ThreatDetectedSends callbacks to your app when a threat is detected. Read more about the meaning of the callbacks in the wiki.
Methods:
void onRootDetected()void onDebuggerDetected()void onEmulatorDetected()void onTamperDetected()void onUntrustedInstallationSourceDetected()void onHookDetected()void onDeviceBindingDetected()void onObfuscationIssuesDetected()void onScreenshotDetected()void onScreenRecordingDetected()void onMultiInstanceDetected()void onLocationSpoofingDetected()void onTimeSpoofingDetected()void onUnsecureWifiDetected()void onMalwareDetected(@NonNull List<SuspiciousAppInfo> suspiciousApps)
public interface DeviceState
public interface DeviceStateProvides device state listener to get additional information about device state. Read more about the meaning of the device state listeners in the wiki.
Methods:
void onUnlockedDeviceDetected()void onHardwareBackedKeystoreNotAvailableDetected()void onDeveloperModeDetected()void onADBEnabledDetected()void onSystemVPNDetected()
public interface RaspExecutionState
public interface RaspExecutionStateA class which represents a set of callbacks that are used to notify the application when state of executing RASP checks changes.
Methods:
void onAllChecksFinished()
Last updated

