Welcome to Headwind MDM Q&A, where you can ask questions and receive answers from other members of the community.

Please do not post bug reports, missing feature requests, or demo inquiries. If you have such an inquiry, submit a contact form.

0 votes
We have a special device which provides its own programming interface for silent app installation.

How can we add custom code to Headwind MDM launcher? We would like to get our custom code synced with Headwind MDM repository to have it up to date.
by (37.5k points)

3 Answers

0 votes

You need to create your own repository and copy the existing code.

git clone https://github.com/h-mdm/hmdm-android

git remote rename origin headwind

git remote add origin https://github.com/my-account/hmdm-android.git

git push -u origin

After applying these commands, you can do your own changes in the code and push it in your repository.

git commit -m "My changes"

git push

To get the latest updates from Headwind MDM repository, use the commands:

git fetch headwind master

git merge headwind/master

or a single command

git pull headwind master

Since you renamed the old origin to "headwind", you will get the latest updates from our repository and your code will be up-to-date.

Note: you will get conflicts in build.gradle because your versioning will most likely be different from ours. We do not recommend to ignore our changes in build.gradle; it is better to manually resolve a conflict after merging.

by (37.5k points)
edited by
0 votes

If you're using gitlab.com to store your project, you can simply "fork" the source project:

https://docs.gitlab.com/ee/user/project/repository/forking_workflow.html

After forking, clone your project onto your work computer, and add the main repository to be able to pull the latest changes and be up to date.

Cloning your project:

git clone https://github.com/my-account/hmdm-android.git

Adding the main repository:

git remote add -f headwind https://gitlab.com/headwind/android-kiosk.git

Pulling changes from the main repository

git fetch headwind master

git merge headwind/master

After merging, you may get conflicts, in particular, in build.gradle.

Resolve the conflict manually in the IDE or text editor (you will see >>>>>> marks in conflicting places) then run the command to fix your changes:

git add build.gradle

Committing changes

git commit -m "Latest bugfixes"

Saving changes to the Github repository

git push

by (37.5k points)
edited by
0 votes

Note: if you would like to change the visible Package ID of Headwind MDM launcher, you DO NOT NEED to change the Java package ID in a whole source code! This will most probably stop you from getting further updates by merging your code with the main repository!

What you need to do is to change the applicationId in app/build.gradle and package in AndroidManifest.xml.

The package ID can be changed using Gradle build variants (flavors). Please take a look at sweetlife and aqualine build variants in app/build.gradle, you will see how it is done.

by (37.5k points)
...