This documentation is for WSO2 Enterprise Mobility Manager 2.2.0. View documentation for the latest release.
Customizing the Android Agent to Disable the Get Location Operation - Enterprise Mobility Manager 2.2.0 - WSO2 Documentation
||
Skip to end of metadata
Go to start of metadata
The Android agent will retrieve the device location each time the get device information operation runs on the client side, even though you don't specifically run the get device location operation. Follow the steps given below to disable the get location operation when running the get device information operation.
  1. Clone the product-emm GIT repository. This will be referred to as <EMM_SOURCE_HOME>.

    git clone https://github.com/wso2/product-emm.git
  2. Open the AndroidManifest.xml file in the <EMM_SOURCE_HOME>/modules/mobile-agent/android/client/client/src/main directory via Android Studio.
  3. Comment out the ACCESS_GPS, ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION android permissions. 
    Example:

    <!-- <uses-permission android:name="android.permission.ACCESS_GPS" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permisssion.ACCESS_COARSE_LOCATION" />-->
  4. The Android agent can't be built via the usual android developer SDK, as it requires access to developer restricted APIs. Therefore, you need to replace the existing android.jar file that is in the <SDK_LOCATION>/platforms/android-<COMPILE_SDK_VERSION> directory with the explicitly built android.jar file that has access to the restricted APIs. 
    You can get the new jar file using one of the following methods:

  5. Build the project to create a new APK file that has all the changes you made.

  6. Rename the created .apk file to android-agent.apk.
  7. Copy the renamed file and replace it instead of the existing android-agent.apk file that is in the <EMM_HOME>/repository/deployment/server/jaggeryapps/emm-web-agent/units/asset-download-agent-android/public/asset directory.
  • No labels