UNPKG

react-native-malwarelytics

Version:

Malwarelytics for React Native protects your banking or fintech app from a broad range of mobile security threats with an industry-leading mobile threat intelligence solution.

77 lines (59 loc) 2.69 kB
# Demo Application The repository contains a 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 <!-- begin box info --> By default, the application starts in offline mode because the Malwarelytics configuration has no service section configured. <!-- end --> ## Run Demo Application 1. Clone the repository ```bash git clone https://github.com/wultra/react-native-malwarelytics.git ``` 1. Prepare dependencies ```bash cd react-native-malwarelytics yarn cd example ``` 1. Run Android App ```bash yarn android ``` 1. Run iOS App ```bash yarn pods yarn ios ``` To start Malwarelytics click the `Initialize` button. Some information is displayed to debug logs 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 the environment example into the `.env` file. It's expected that your current directory is `example`: ```bash cp .env-example .env ``` 1. Edit the newly created file `.env` and update the following properties: - `SERVICE_APPLE_USERNAME` with your username for iOS application - `SERVICE_APPLE_PASSWORD` with your password for the iOS application - `SERVICE_APPLE_PUBLIC_KEY` with your signing public key for the iOS application - `SERVICE_ANDROID_USERNAME` with your username for Android application - `SERVICE_ANDROID_PASSWORD` with your password for Android application - `SERVICE_ANDROID_PUBLIC_KEY` with your signing public key for the Android application 1. Make sure that each time you edit the `.env` file you must run the following steps to apply the changes: ```bash yarn android yarn pods yarn ios yarn ios # repeat ios, to detect the changes properly ``` 1. Update the package name for the Android App to match the one you have registered in Malwarelytics Console: - Open `example/android/app/build.gradle` - Find and edit `applicationId "com.wultra.android.malwarelytics.reactnative.demo"` 1. Update the Bundle ID for iOS App to match the one you have registered in Malwarelytics Console: - Open `example/ios/Config.xcconfig` - Update the `PRODUCT_BUNDLE_IDENTIFIER` property <!-- begin box warning --> Make sure you don't commit and push your local changes to the git repository. <!-- end -->