Customizing the Android APK File
You will want to make changes to the Android Application Package (APK) that is in WSO2 EMM to suit your business or Organization requirements. For example, you will want to white label the WSO2 EMM Android agent. In such situations, you need to do the required changes and create a new APK file.
Prerequisites
Download and install Android Studio.
For more information, see installing Android Studio.
Replace the
android.jar
file that is in the<ANDROID_STUDIO>/<SDK location>/platforms/android-<CURRENT_API_LEVEL>
directory with theandroid.jar
file found here.Why is this needed?
The WSO2 Android agent requires access to hidden APIs (APIs are available at runtime). Therefore, you need to replace the
anrdoid.jar
file as mentioned in this step.- WSO2 EMM supports API levels 16 to 22. Therefore, install the Android API levels 16 to 22 on Android Studio.
- Open Android Studio.
- Click SDK Manager.
- Click the SDK Platform tab and select the 16 and 22 API levels.
- Click Apply.
Creating a new APK
Clone the
product-emm
GIT repository. This will be referred to as<EMM_SOURCE_HOME>
.git clone https://github.com/wso2/product-emm.git
- Open the client folder that is in the
<EMM_SOURCE_HOME>/modules/mobile-agent/android
directory via Android Studio. - Do the necessary changes you wish to make.
Example:
White Labeling the WSO2 EMM Android Agent or changing the Android agentSERVER_PROTOCOL
tohttps
andSERVER_PORT
to 9443
in theconstant.java
file that is in the<EMM_SOURCE_HOME>/modules/mobile-agents/android/client/client/src/main/java/org/wso2/emm/agent/utils
directory. Build the project to create a new APK file that has all the changes you made.
- Rename the created
.apk
file toandroid-agent.apk
. - 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.