Demo Application

The repository contains demo application that shows the following features:

  • Initialization and Shutdown
  • Listen to RASP events
  • Gather all information about RASP and Antivirus modules
  • Android custom Smart Protection Styling

By default the application starts in offline mode because the Malwarelytics configuration has no service section configured.

Run Demo Application

  1. Clone the repository
    git clone https://github.com/wultra/react-native-malwarelytics.git
    
  2. Prepare dependencies
    cd react-native-malwarelytics
    yarn
    cd example
    
  3. Run Android App
    yarn android
    
  4. Run iOS App
    yarn pods
    yarn ios
    

To start the Malwarelytics click Initialize button. Some information is displayed to debug log only (like RASP events), so check the React Native’s log after the application starts. To change the configuration, open example/src/Config.ts. To apply the changes in config you have to click Shutdown and re-initialize the Malwarelytics.

If you want to configure the application for online service, then follow the next chapter.

Configure Online Service

  1. Copy environment example into .env file. It’s expected that your currend directory is example:
    cp .env-example .env
    
  2. Edit newly created file .env and update the following properties:
    • SERVICE_APPLE_USERNAME with your username for iOS applicatiion
    • SERVICE_APPLE_PASSWORD with your password for iOS application
    • SERVICE_APPLE_PUBLIC_KEY with your signing public key for iOS application
    • SERVICE_ANDROID_USERNAME with your username for Android applicatiion
    • SERVICE_ANDROID_PASSWORD with your password for Android application
    • SERVICE_ANDROID_PUBLIC_KEY with your signing public key for Android application
  3. Make sure that each time you edit .env file you must run the following steps to apply the changes:
    yarn android
    yarn pods
    yarn ios
    yarn ios # repeat ios, to detect the changes properly
    
  4. Update package name for Android App to match one you have registered in Malwarelytics Console:
    • Open example/android/app/build.gradle
    • Find and edit applicationId "com.wultra.android.malwarelytics.reactnative.demo"
  5. Update Bundle ID for iOS App to match one you have registered in Malwarelytics Console:
    • Open example/ios/Config.xcconfig
    • Update PRODUCT_BUNDLE_IDENTIFIER property

Make sure you don’t commit and push your local changes to git repository.

Last updated on May 10, 2023 (09:33) View product
Search

1.1.x

Malwarelytics for React Native