For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.
Enabling the web resources checksum feature
Use the web resources checksum feature to verify the integrity of your cross-platform app.
Before you begin
- You must have the Cordova development tools installed. This example uses the Apache Cordova CLI. If we use other Cordova development tools, some of your steps will be different. Refer to our Cordova tool documentation for instructions.
- You must have the MobileFirst Platform CLI installed. For more information, see Install the MobileFirst Platform CLI.
- You must have the IBM MobileFirst Platform Foundation plugin.
- You must add the platform to our Cordova project before we can enable the web resources checksum feature for that operating system by entering the cordova platform add [android|ios|windows] command.
When it is enabled, the web resources checksum feature compares the original web resources of an app when it is started to a stored baseline that was captured the first time that app was started. This is a good way of identifying any differences in the app that might indicate that the app was modified. This procedure is compatible with the Direct Update feature.
To enable the web resources checksum feature for a Cordova app, complete the following steps:
Procedure
- In a terminal window, navigate to the root directory of your target app.
- Enter the following command to enable the web resources checksum feature for an operating system environment of your Cordova app:
mfpdev app config [android|ios|windows10|windows8| windowsphone8]_security_test_web_resources_checksum trueFor example:
mfpdev app config android_security_test_web_resources_checksum trueWe can disable the feature by replacing true in the command with false.
Tip: We can view information about the mfpdev app config command by entering mfpdev help app config.
- Enter the following command to identify the types of files that we want to ignore during the checksum test:
mfpdev app config [android|ios|windows10|windows8| windowsphone8]_security_ignore_file_extensions [ file_extension1,file_extension2 ]Multiple extensions must be separated by a comma with no spaces between them. For example:
mfpdev app config android_security_ignore_file_extensions jpg,png,pdf
Important: Running this command overwrites the values that are set. The more files that the web resources checksum scans for its test, the longer it takes for the app to open. We can specify the extension of a file type to skip, which might improve the speed of starting the app.
Results
Your app has the web resources checksum feature enabled.
What to do next
- Run the following command to integrate the changes into the app:
cordova prepare
- Build your app by entering the following command:
cordova build
- Run your app by entering the following command:
cordova run
Related concepts: