Change the UI of WSO2 EMM Android Agent
Android Agent has several activities that are used to perform the user activities for device enrollment. The current ui is branded as the WSO2 agent. Most important part of customizing the agent is to make sure that future changes can be merged back to the application source code.
If you haven’t read the getting started post, please read that post below before continuing the next steps.
Creating a branch
Since the source code is available on git, we can create a branch to manage custom source changes.
git checkout -b customizations
Package name change
There are two configurations to change in order to have the custom agent generated for a given package name. client/client/src/main
has the build.gradle
. Application Id is used when gradle build the apk file. Change this to your custom package name. If you are deploying this customized agent to the Google Playstore, it will have to have a unique package name. Refactoring the physical packages are not required.
defaultConfig {
applicationId "org.dulitha.emm.agent"
minSdkVersion 17
targetSdkVersion 23
multiDexEnabled true
}
The next file is the FCM configuration file. This is available on client/client/google-services.json
.
"android_client_info": {
"package_name": "org.dulitha.emm.agent"
}
Adb can be used to check whether the package name changed occurred once the apk is installed to the device.
adb shell ‘pm list packages -f’
Change the App Name
App name is available in the AndroidManifest.xml
located in client/client/src/main
.
<activity
android:name=".AgentReceptionActivity"
android:label="Dulitha Agent">
<intent-filter>
<action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Change the Logo and Color
There are three significant images to change.
- Logo which is shown on each activity [ic_logo_dark.png, ic_logo.png]
- App Icon [ic_launcher.png]
- Background image [repeat_bg.png]
These logos are available in the client/client/src/main/res
directory. Tools are available to convert the images to sizes required.
Color can be changed by changing the properties in btn_orange.xml
located inside client/client/src/main/res/drawable
.
Changes can be committed to the branch. Later down the line — you can obtain upstream changes by pull from the source repo. This way — new features and updates can be integrated to the code base.