The simplest way to initialize Malwarelytics for Android is in Application.onCreate() system callback. The absolute minimum required for integration is to provide apiUsername, apiPassword and apiSignaturePublicKey in AppProtectionConfig.Builder.

An example of minimum initialization code:

class MyApplication : Application() {

    override fun onCreate() {
        // Prepare minimum configuration
        val config = AppProtectionConfig.Builder(appContext)
            .clientAppUserId(INTERNAL_CLIENT_ID) // Use if the internal user ID is available at config time

        // Initialize AppProtection class
        val appProtection = AppProtection.getInstance()
        appProtection.initializeAsync(config, object: AppProtection.InitializationObserver {
            // App Protection is fully ready to be used now
            override fun onInitialized() {
                // Setup internal user ID if you are able to obtain it
        // ...           

You can find API_USERNAME, API_PASSWORD and API_SIGNATURE_PUBLIC_KEY values in the Malwarelytics console. Use some user identifier you understand for INTERNAL_CLIENT_ID. To obtain the SIGNATURE_HASH value, please follow the Repackaging Detection guide.

See RASP feature overview for a detailed documentation of available detections and security features.

Last updated on Jul 21, 2021 (14:15) View product


Malwarelytics for Android