Skip to content

SanthoshKuma6/SilentInstallation

Repository files navigation

MDM/MAM Silent Installation

Overview

The Silent installation refers to the process of installing applications without user interaction, providing a discreet and automated experience. On the other hand, silent uninstallation involves the removal of applications without user intervention.

Triggering Actions on Device Boot

It is commonly used to trigger actions after the device has completed the boot process. The command you provided is using the am broadcast command to send the broadcast intent.

Screenshot 2024-03-04 at 3 33 24 PM

am:

Activity Manager command-line tool for Android system interaction.

broadcast:

Command to send a broadcast intent.

-a android.intent.action.BOOT_COMPLETED:

Sets the intent action to "BOOT_COMPLETED".

-n com.daimler.silentinstallation/.service.BootCompleteService:

Specifies the component to receive the broadcast; it's a service named BootCompleteService in the package com.daimler.silentinstallation. When the device boots up, the system sends out a "BOOT_COMPLETED" broadcast intent. If you've registered a receiver for this intent in your AndroidManifest.xml

Here's an example of how you might register a receiver in the AndroidManifest.xml:

Screenshot 2024-03-04 at 3 33 41 PM

Screenshot 2024-03-04 at 3 33 53 PM

Boot Receiver for Device Initialisation

This Kotlin class, BootCompleteService, extends BroadcastReceiver and is responsible for handling the "BOOT_COMPLETED" broadcast intent. Upon receiving the intent, it initiates the ForegroundService, retrieves the device Id, and logs relevant information.

Screenshot 2024-03-04 at 3 34 48 PM

Foreground Service for App Package Handling

The ForegroundService class, extending Service, initiates a foreground service for app package operations, utilizing Executors.newSingleThreadScheduledExecutor() to create a single- threaded executor that periodically runs the appPackageImpl.appPackageDetail() function every 60 seconds.

Screenshot 2024-03-04 at 3 35 00 PM

App Package Detail Handler

The AppPackageDetailImpl class is designed to handle the appPackageDetail API service. The appPackageDetail function manages the installation and uninstallation of application packages on an Android device based on information fetched from an external API. It handles asynchronous execution, error handling, and dispatches tasks for silent installation or uninstallation based on package details.

Screenshot 2024-03-04 at 3 41 12 PM

Package Installation Handler

The installPackage function is designed to handle the installation of a package from an InputStream. It utilizes the PackageInstaller to create a session, write the package content, and commit the installation.

Screenshot 2024-03-04 at 3 41 26 PM

Here's a brief description:

This code snippet demonstrates a package installation handler. You need to create an instance and call the installPackage function with the appropriate parameters.

Demo Video

Link: http://bit.ly/3Oj5pBd

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages