com.ardic.android.managers.appinstall.IAppInstallManager |
Provides a set APIs to manage applications silent installation and uninstallation.
AppInstallManager class defines and uses blacklist, whitelist, trustedsignature and trustedstore entities. The installation APIs relies on the active policies set by the user. For more details please refer to
isInstallBlocked(AppInstallItem)
.
By using this manager user can define installation policies, installs and uninstalls an applications silently and do much more.
Installation policy decision needs some steps as follows;
AppInstallManager aim = AppInstallManager.getInterface(Context);1- Add specified policy with specified control order to installation policy list by;
aim.addInstallPolicy(PolicyName.POLICYNAME_WHITELIST, 5);2- Initialize the added installation policy related list by;aim.addAppToWhitelist("com.xxx.yyy", null);3- Then installation policy can be queried by;aim.isInstallBlocked("com.xxx.yyy"); // Returns false because it is in whitelist.a) User can add another installation policy after preceding operations by;aim.addInstallPolicy(PolicyName.POLICYNAME_TRUSTEDSTORE, 2);b) User should initialize the preceding installation policy related list by;aim.addTrustedStore("com.android.playstore");c) Then installation policy can be queried by;aim.isInstallBlocked("com.xxx.zzz"); // Returns false while it is installing from AndroidPlayStore else true.Kind of variances can be created by choosing installation policy and initialization of chose policy list. Each installation policy is represent on OR (||) decision item. All policies making OR'ed (||) one by one from lower order to higher order which means if whitelist is order 5 and blacklist is order 2 then blacklist control is done firstly and if there is no decision for blacklist, whitelist control is done secondly and returns OR'ed (||) installation result. Adding item to related policy (for example addAppToWhitelist and etc) is not sufficient to activate the policy. User have to add related policies to installation policy list by calling addInstallPolicy else nothing will be controlled. Sample Usages as follows; Sample-1:AppInstallManager aim = AppInstallManager.getInterface(Context); aim.addInstallPolicy(PolicyName.POLICYNAME_WHITELIST, 1); aim.addAppToWhitelist("com.xxx.yyy", null); boolean resultY = aim.isInstallBlocked("com.xxx.yyy"); boolean resultZ = aim.isInstallBlocked("com.xxx.zzz");Sample-1 results will be as resultY=false and resultZ=true. Warning: If user would not add any item to whitelist, all application installation will be blocked because of empty whitelist. Sample-2:AppInstallManager aim = AppInstallManager.getInterface(Context); aim.addInstallPolicy(PolicyName.POLICYNAME_WHITELIST, 2); aim.addInstallPolicy(PolicyName.POLICYNAME_BLACKLIST, 1); aim.addAppToWhitelist("com.xxx.yyy", null); aim.addAppToBlacklist("com.xxx.zzz", null); boolean resultY = aim.isInstallBlocked("com.xxx.yyy"); boolean resultZ = aim.isInstallBlocked("com.xxx.zzz"); boolean resultQ = aim.isInstallBlocked("com.xxx.qqq");Sample-2 results will be as resultY=false, resultZ=true and resultQ=true. Sample-3:AppInstallManager aim = AppInstallManager.getInterface(Context); aim.addInstallPolicy(PolicyName.POLICYNAME_TRUSTEDSTORE, 3); aim.addInstallPolicy(PolicyName.POLICYNAME_TRUSTEDSIGNATURE, 4); aim.addTrustedStore("com.android.playstore"); aim.addTrustedSignature("ABC123"); boolean resultY = aim.isInstallBlocked("com.xxx.yyy"); // yyy's signature is "ABC123" boolean resultZ = aim.isInstallBlocked("com.xxx.zzz"); // zzz is installing from "com.android.playstore" boolean resultQ = aim.isInstallBlocked("com.xxx.qqq"); // qqq is not complying any prerequisite to pass policies.Sample-2 results will be as resultY=false, resultZ=false and resultQ=true. So as sample represents setting policies and related parts, user has many options while defining installation policy by using blacklist, whitelist, trustedstore and trustedsignature.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | DELETE_ALL_USERS | Flag parameter for uninstall(String, int) to indicate
that you want the package deleted for all users. |
|||||||||
int | DELETE_FAILED_AFEX_UNINSTALL_POLICY | Deletion failed return code: this is passed to the IPackageDeleteObserver by
uninstall(String, int) if the system failed to delete the
package for the afex uninstallation policies. |
|||||||||
int | DELETE_FAILED_DEVICE_POLICY_MANAGER | Deletion failed return code: this is passed to the IPackageDeleteObserver by
uninstall(String, int) if the system failed to delete the
package because it is the active DevicePolicy manager. |
|||||||||
int | DELETE_FAILED_INTERNAL_ERROR | Deletion failed return code: this is passed to the IPackageDeleteObserver by
uninstall(String, int) if the system failed to delete the
package for an unspecified reason. |
|||||||||
int | DELETE_KEEP_DATA | Flag parameter for uninstall(String, int) to indicate
that you don't want to delete the package's data directory. |
|||||||||
int | DELETE_SUCCEEDED | Return code for when package deletion succeeds. | |||||||||
int | INSTALL_ALLOW_DOWNGRADE | Flag parameter for install(String, int) to indicate that it is
okay to install an update to an app where the newly installed app has a lower version code
than the currently installed app. |
|||||||||
int | INSTALL_ALLOW_TEST | Flag parameter for install(String, int) to indicate that you
want to allow test packages (those that have set android:testOnly in their manifest) to be
installed. |
|||||||||
int | INSTALL_ALL_USERS | Flag parameter for install(String, int) to indicate that this
install should immediately be visible to all users. |
|||||||||
int | INSTALL_EXTERNAL | Flag parameter for install(String, int) to indicate that this
package has to be installed on the sdcard. |
|||||||||
int | INSTALL_FAILED_AFEX_INSTALL_POLICY | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the new package couldn't be installed
in the specified install location because of the afex installation policies. |
|||||||||
int | INSTALL_FAILED_ALREADY_EXISTS | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the package is already installed. |
|||||||||
int | INSTALL_FAILED_CONFLICTING_PROVIDER | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the new package failed because it
contains a content provider with the same authority as a provider already installed in the
system. |
|||||||||
int | INSTALL_FAILED_CONTAINER_ERROR | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if a secure container mount point couldn't
be accessed on external media. |
|||||||||
int | INSTALL_FAILED_CPU_ABI_INCOMPATIBLE | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the package being installed contains
native code, but none that is compatible with the the device's CPU_ABI. |
|||||||||
int | INSTALL_FAILED_DEXOPT | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the new package failed while optimizing
and validating its dex files, either because there was not enough storage or the validation
failed. |
|||||||||
int | INSTALL_FAILED_DUPLICATE_PACKAGE | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if a package is already installed with the
same name. |
|||||||||
int | INSTALL_FAILED_INSUFFICIENT_STORAGE | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the package manager service found that
the device didn't have enough storage space to install the app. |
|||||||||
int | INSTALL_FAILED_INTERNAL_ERROR | Installation failed return code: this is passed to the IPackageInstallObserver by
install(String, int) if the system failed to install the
package because of system issues. |
|||||||||
int | INSTALL_FAILED_INVALID_APK | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the package archive file is invalid. |
|||||||||
int | INSTALL_FAILED_INVALID_INSTALL_LOCATION | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the new package couldn't be installed
in the specified install location. |
|||||||||
int | INSTALL_FAILED_INVALID_URI | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the URI passed in is invalid. |
|||||||||
int | INSTALL_FAILED_MEDIA_UNAVAILABLE | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the new package couldn't be installed
in the specified install location because the media is not available. |
|||||||||
int | INSTALL_FAILED_MISSING_FEATURE | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the new package uses a feature that is
not available. |
|||||||||
int | INSTALL_FAILED_MISSING_SHARED_LIBRARY | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the new package uses a shared library
that is not available. |
|||||||||
int | INSTALL_FAILED_NEWER_SDK | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the new package failed because the
current SDK version is newer than that required by the package. |
|||||||||
int | INSTALL_FAILED_NO_SHARED_USER | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the requested shared user does not
exist. |
|||||||||
int | INSTALL_FAILED_OLDER_SDK | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the new package failed because the
current SDK version is older than that required by the package. |
|||||||||
int | INSTALL_FAILED_PACKAGE_CHANGED | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the package changed from what the
calling program expected. |
|||||||||
int | INSTALL_FAILED_REPLACE_COULDNT_DELETE | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the new package uses a shared library
that is not available. |
|||||||||
int | INSTALL_FAILED_SHARED_USER_INCOMPATIBLE | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the new package is requested a shared
user which is already installed on the device and does not have matching signature. |
|||||||||
int | INSTALL_FAILED_TEST_ONLY | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the new package failed because it has
specified that it is a test-only package and the caller has not supplied the
INSTALL_ALLOW_TEST flag. |
|||||||||
int | INSTALL_FAILED_UID_CHANGED | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the new package is assigned a different
UID than it previously held. |
|||||||||
int | INSTALL_FAILED_UPDATE_INCOMPATIBLE | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if a previously installed package of the
same name has a different signature than the new package (and the old package's data was not
removed). |
|||||||||
int | INSTALL_FAILED_VERIFICATION_FAILURE | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the new package couldn't be installed
because the verification did not succeed. |
|||||||||
int | INSTALL_FAILED_VERIFICATION_TIMEOUT | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the new package couldn't be installed
because the verification timed out. |
|||||||||
int | INSTALL_FAILED_VERSION_DOWNGRADE | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) if the new package has an older version
code than the currently installed package. |
|||||||||
int | INSTALL_FORWARD_LOCK | Flag parameter for install(String, int) to indicate that this
package should be installed as forward locked, i.e. |
|||||||||
int | INSTALL_FROM_ADB | Flag parameter for install(String, int) to indicate that this
install was initiated via ADB. |
|||||||||
int | INSTALL_INTERNAL | Flag parameter for install(String, int) to indicate that this
package has to be installed on the sdcard. |
|||||||||
int | INSTALL_PARSE_FAILED_BAD_MANIFEST | Installation parse return code: this is passed to the IPackageInstallObserver by
install(String, int) if the parser was unable to retrieve the
AndroidManifest.xml file. |
|||||||||
int | INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME | Installation parse return code: this is passed to the IPackageInstallObserver by
install(String, int) if the parser encountered a bad or missing
package name in the manifest. |
|||||||||
int | INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID | Installation parse return code: this is passed to the IPackageInstallObserver by
install(String, int) if the parser encountered a bad shared
user id name in the manifest. |
|||||||||
int | INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING | Installation parse return code: this is passed to the IPackageInstallObserver by
install(String, int) if the parser encountered a
CertificateEncodingException in one of the files in the .apk. |
|||||||||
int | INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES | Installation parse return code: this is passed to the IPackageInstallObserver by
install(String, int) if the parser found inconsistent
certificates on the files in the .apk. |
|||||||||
int | INSTALL_PARSE_FAILED_MANIFEST_EMPTY | Installation parse return code: this is passed to the IPackageInstallObserver by
install(String, int) if the parser did not find any actionable
tags (instrumentation or application) in the manifest. |
|||||||||
int | INSTALL_PARSE_FAILED_MANIFEST_MALFORMED | Installation parse return code: this is passed to the IPackageInstallObserver by
install(String, int) if the parser encountered some structural
problem in the manifest. |
|||||||||
int | INSTALL_PARSE_FAILED_NOT_APK | Installation parse return code: this is passed to the IPackageInstallObserver by
install(String, int) if the parser was given a path that is not
a file, or does not end with the expected '.apk' extension. |
|||||||||
int | INSTALL_PARSE_FAILED_NO_CERTIFICATES | Installation parse return code: this is passed to the IPackageInstallObserver by
install(String, int) if the parser did not find any
certificates in the .apk. |
|||||||||
int | INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION | Installation parse return code: this is passed to the IPackageInstallObserver by
install(String, int) if the parser encountered an unexpected
exception. |
|||||||||
int | INSTALL_REPLACE_EXISTING | Flag parameter for install(String, int) to indicate that you
want to replace an already installed package, if one exists. |
|||||||||
int | INSTALL_SUCCEEDED | Installation return code: this is passed to the IPackageInstallObserver by
install(String, int) on success. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds the given application to the installation black list.
| |||||||||||
Adds the given application to the installation white list.
| |||||||||||
Adds the given policy to the installation policy list.
| |||||||||||
Adds the given trusted signature to the installation trusted signature list.
| |||||||||||
Adds the given trusted store to the installation trusted store list.
| |||||||||||
Clears all applications in the installation black list.
| |||||||||||
Clears all policies in the installation policy list.
| |||||||||||
Clears all trusted signatures in the installation trusted signature list.
| |||||||||||
Clears all trusted stores in the installation trusted store list.
| |||||||||||
Clears all applications in the installation white list.
| |||||||||||
Returns all applications in the installation black list.
| |||||||||||
Returns all policies in the installation policy list.
| |||||||||||
Returns installed application list.
| |||||||||||
Returns all trusted signatures in the installation trusted signatures list.
| |||||||||||
Returns all trusted stores in the installation trusted store list.
| |||||||||||
Returns all applications in the installation black list.
| |||||||||||
Installs the given application list with specified installation flag.
| |||||||||||
Installs the given application list with specified installation flag.
| |||||||||||
Installs the given application with default installation flag.
| |||||||||||
Installs the given application with specified installation flag.
| |||||||||||
Returns passed installation result's enumaration name which is used for converting results in
more understandable format.
| |||||||||||
Returns installation blocked state.
| |||||||||||
Checks if application complies with the current application installation policies.
| |||||||||||
Checks if the given application installed on the system or not.
| |||||||||||
Returns non market install blocked state.
| |||||||||||
Returns non market installation state.
| |||||||||||
Returns the package verifier blocked state.
| |||||||||||
Returns the package verifier state.
| |||||||||||
Returns uninstallation blocked state.
| |||||||||||
Removes the given application from the installation black list.
| |||||||||||
Removes the given application from the installation white list.
| |||||||||||
Removes the given policy from the installation policy list.
| |||||||||||
Removes the given trusted signature from the installation trusted signature list.
| |||||||||||
Removes the given trusted store from the installation trusted store list.
| |||||||||||
Sets system install state which blocks all application installation on the system regardless
of any other attributes.
| |||||||||||
Sets system non market install state which blocks all non market installation on the system
regardless of any other attributes.
| |||||||||||
Sets non market installation enabled.
| |||||||||||
Sets the package verifier blocked state.
| |||||||||||
Sets the package verifier enabled.
| |||||||||||
Sets system uninstall state which blocks all application uninstallation on the system
regardless of any other attributes.
| |||||||||||
Uninstalls the given application list with specified uninstallation flag.
| |||||||||||
Uninstalls the given application with specified uninstallation flag.
| |||||||||||
Uninstalls the given application.
| |||||||||||
Uninstalls the given application list.
| |||||||||||
Returns passed uninstallation result's enumaration name which is used for converting results
in more understandable format.
|
Flag parameter for uninstall(String, int)
to indicate
that you want the package deleted for all users.
Deletion failed return code: this is passed to the IPackageDeleteObserver by
uninstall(String, int)
if the system failed to delete the
package for the afex uninstallation policies.
Deletion failed return code: this is passed to the IPackageDeleteObserver by
uninstall(String, int)
if the system failed to delete the
package because it is the active DevicePolicy manager.
Deletion failed return code: this is passed to the IPackageDeleteObserver by
uninstall(String, int)
if the system failed to delete the
package for an unspecified reason.
Flag parameter for uninstall(String, int)
to indicate
that you don't want to delete the package's data directory.
Return code for when package deletion succeeds. This is passed to the IPackageDeleteObserver
by uninstall(String, int)
if the system succeeded in
deleting the package.
Flag parameter for install(String, int)
to indicate that it is
okay to install an update to an app where the newly installed app has a lower version code
than the currently installed app.
Flag parameter for install(String, int)
to indicate that you
want to allow test packages (those that have set android:testOnly in their manifest) to be
installed.
Flag parameter for install(String, int)
to indicate that this
install should immediately be visible to all users.
Flag parameter for install(String, int)
to indicate that this
package has to be installed on the sdcard.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the new package couldn't be installed
in the specified install location because of the afex installation policies.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the package is already installed.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the new package failed because it
contains a content provider with the same authority as a provider already installed in the
system.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if a secure container mount point couldn't
be accessed on external media.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the package being installed contains
native code, but none that is compatible with the the device's CPU_ABI.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the new package failed while optimizing
and validating its dex files, either because there was not enough storage or the validation
failed.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if a package is already installed with the
same name.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the package manager service found that
the device didn't have enough storage space to install the app.
Installation failed return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the system failed to install the
package because of system issues.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the package archive file is invalid.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the new package couldn't be installed
in the specified install location.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the URI passed in is invalid.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the new package couldn't be installed
in the specified install location because the media is not available.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the new package uses a feature that is
not available.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the new package uses a shared library
that is not available.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the new package failed because the
current SDK version is newer than that required by the package.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the requested shared user does not
exist.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the new package failed because the
current SDK version is older than that required by the package.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the package changed from what the
calling program expected.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the new package uses a shared library
that is not available.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the new package is requested a shared
user which is already installed on the device and does not have matching signature.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the new package failed because it has
specified that it is a test-only package and the caller has not supplied the
INSTALL_ALLOW_TEST
flag.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the new package is assigned a different
UID than it previously held.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if a previously installed package of the
same name has a different signature than the new package (and the old package's data was not
removed).
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the new package couldn't be installed
because the verification did not succeed.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the new package couldn't be installed
because the verification timed out.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the new package has an older version
code than the currently installed package.
Flag parameter for install(String, int)
to indicate that this
package should be installed as forward locked, i.e. only the app itself should have access to
its code and non-resource assets.
Flag parameter for install(String, int)
to indicate that this
install was initiated via ADB.
Flag parameter for install(String, int)
to indicate that this
package has to be installed on the sdcard.
Installation parse return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the parser was unable to retrieve the
AndroidManifest.xml file.
Installation parse return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the parser encountered a bad or missing
package name in the manifest.
Installation parse return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the parser encountered a bad shared
user id name in the manifest.
Installation parse return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the parser encountered a
CertificateEncodingException in one of the files in the .apk.
Installation parse return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the parser found inconsistent
certificates on the files in the .apk.
Installation parse return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the parser did not find any actionable
tags (instrumentation or application) in the manifest.
Installation parse return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the parser encountered some structural
problem in the manifest.
Installation parse return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the parser was given a path that is not
a file, or does not end with the expected '.apk' extension.
Installation parse return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the parser did not find any
certificates in the .apk.
Installation parse return code: this is passed to the IPackageInstallObserver by
install(String, int)
if the parser encountered an unexpected
exception.
Flag parameter for install(String, int)
to indicate that you
want to replace an already installed package, if one exists.
Installation return code: this is passed to the IPackageInstallObserver by
install(String, int)
on success.
Adds the given application to the installation black list.
Parameters | |
---|---|
packageName |
String :
Application package name |
signature |
String :
Application package public signature. If public signature won't be used user
can give null as parameter. |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Adds the given application to the installation white list.
Parameters | |
---|---|
packageName |
String :
Application package name |
signature |
String :
Application package public signature. If public signature won't be used,
user can give null as parameter. |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Adds the given policy to the installation policy list.
Parameters | |
---|---|
policyName |
PolicyItem.PolicyName :
PolicyItem.PolicyName is predefined policy types |
policyOrder |
int :
Order of policy which defines policy priority which is not unique
parameter. There could be more than one policy which has same order so executing
can be change due to same order. policyOrder can be any integer value without 0. |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
See also:
Adds the given trusted signature to the installation trusted signature list.
Parameters | |
---|---|
signature |
String :
Trusted signature |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Adds the given trusted store to the installation trusted store list.
Parameters | |
---|---|
store |
String :
Trusted store package name |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Clears all applications in the installation black list.
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Clears all policies in the installation policy list.
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
See also:
Clears all trusted signatures in the installation trusted signature list.
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Clears all trusted stores in the installation trusted store list.
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Clears all applications in the installation white list.
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Returns all applications in the installation black list.
Returns | |
---|---|
List<String> |
List of application package name |
Throws | |
---|---|
AfexException |
Returns all policies in the installation policy list.
Returns | |
---|---|
List<PolicyItem> |
List of installation PolicyItem |
Throws | |
---|---|
AfexException |
See also:
Returns installed application list.
Returns | |
---|---|
List<String> |
List of installed application package names |
Throws | |
---|---|
AfexException |
Returns all trusted signatures in the installation trusted signatures list.
Returns | |
---|---|
List<String> |
List of trusted signature hash. |
Throws | |
---|---|
AfexException |
Returns all trusted stores in the installation trusted store list.
Returns | |
---|---|
List<String> |
List of trusted store package name |
Throws | |
---|---|
AfexException |
Returns all applications in the installation black list.
Returns | |
---|---|
List<String> |
List of application package name |
Throws | |
---|---|
AfexException |
Installs the given application list with specified installation flag.
Warning; Application installation time can be change due to apk size so if apk size large than 10MB use this api in Thread and Handler to avoid ANR.
Parameters | |
---|---|
apkPathList |
List :
Full path list of target applications |
installFlags |
int :
Possible values: INSTALL_FORWARD_LOCK INSTALL_REPLACE_EXISTING INSTALL_ALLOW_TEST INSTALL_EXTERNAL INSTALL_INTERNAL INSTALL_FROM_ADB INSTALL_ALL_USERS INSTALL_ALLOW_DOWNGRADE |
Returns | |
---|---|
List<Integer> |
Installation result in integer format as follows; |
Throws | |
---|---|
AfexException |
Installs the given application list with specified installation flag.
Warning; Application installation time can be change due to apk size so if apk size large than 10MB use this api in Thread and Handler to avoid ANR.
Parameters | |
---|---|
apkPathList |
List :
Full path list of target applications |
Returns | |
---|---|
List<Integer> |
Installation result in integer format as follows; |
Throws | |
---|---|
AfexException |
Installs the given application with default installation flag. If application already
installed default flag is set to INSTALL_REPLACE_EXISTING
else 0 Warning;
Application installation time can be change due to apk size so if apk size large than 10MB
use this api in Thread and Handler to avoid ANR.
Parameters | |
---|---|
apkPath |
String :
Full path of target application |
Returns | |
---|---|
int |
Installation result in integer format as follows; |
Throws | |
---|---|
AfexException |
Installs the given application with specified installation flag.
Warning; Application installation time can be change due to apk size so if apk size large than 10MB use this api in Thread and Handler to avoid ANR.
Parameters | |
---|---|
apkPath |
String :
Full path of target application |
installFlags |
int :
Possible values: INSTALL_FORWARD_LOCK INSTALL_REPLACE_EXISTING INSTALL_ALLOW_TEST INSTALL_EXTERNAL INSTALL_INTERNAL INSTALL_FROM_ADB INSTALL_ALL_USERS INSTALL_ALLOW_DOWNGRADE |
Returns | |
---|---|
int |
Installation result in integer format as follows; |
Throws | |
---|---|
AfexException |
Returns passed installation result's enumaration name which is used for converting results in more understandable format.
Parameters | |
---|---|
result |
int :
Installation result in integer format |
Returns | |
---|---|
String |
Passed installation result's enumaration name |
Returns installation blocked state.
Returns | |
---|---|
boolean |
true if installation blocked, else false |
Throws | |
---|---|
AfexException |
Checks if application complies with the current application installation policies. Installation policy list is used to check if application is installable or not. Prior to checking if application is installable or not, the user must execute the following steps to setup the installation policy. For example; the steps to add a blacklist policy are:
addAppToBlacklist(String, String)
addInstallPolicy(PolicyName, int)
isInstallBlocked(AppInstallItem)
Parameters | |
---|---|
item |
AppInstallItem :
AppInstallItem |
Returns | |
---|---|
boolean |
true if complies with the installation policies or no policies are defined
else false |
Throws | |
---|---|
AfexException |
Checks if the given application installed on the system or not.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
boolean |
true if the application has installed else false |
Throws | |
---|---|
AfexException |
Returns non market install blocked state.
Returns | |
---|---|
boolean |
true if non market install blocked, else false |
Throws | |
---|---|
AfexException |
Returns non market installation state.
Returns | |
---|---|
boolean |
true if non market installation enabled else false |
Throws | |
---|---|
AfexException |
Returns the package verifier blocked state.
Returns | |
---|---|
boolean |
true if package verifier blocked, else false |
Throws | |
---|---|
AfexException |
Returns the package verifier state.
Returns | |
---|---|
boolean |
true if package verifier enabled else false |
Throws | |
---|---|
AfexException |
Returns uninstallation blocked state.
Returns | |
---|---|
boolean |
true if uninstallation blocked, else false |
Throws | |
---|---|
AfexException |
Removes the given application from the installation black list.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Removes the given application from the installation white list.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Removes the given policy from the installation policy list.
Parameters | |
---|---|
policyName |
PolicyItem.PolicyName :
PolicyItem.PolicyName is predefined policy types |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
See also:
Removes the given trusted signature from the installation trusted signature list.
Parameters | |
---|---|
signature |
String :
Trusted signature hash |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Removes the given trusted store from the installation trusted store list.
Parameters | |
---|---|
store |
String :
Trusted store package name |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Sets system install state which blocks all application installation on the system regardless of any other attributes.
Parameters | |
---|---|
state |
boolean :
true to block installation, else false |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Sets system non market install state which blocks all non market installation on the system regardless of any other attributes.
Parameters | |
---|---|
state |
boolean :
true to block non market install, else false |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Sets non market installation enabled.
Parameters | |
---|---|
enabled |
boolean :
true to enable non market application installation, else false |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Sets the package verifier blocked state.
Parameters | |
---|---|
state |
boolean :
true to block package verifier, else false |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Sets the package verifier enabled.
Parameters | |
---|---|
enabled |
boolean :
true to enable package verifier else false |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Sets system uninstall state which blocks all application uninstallation on the system regardless of any other attributes.
Parameters | |
---|---|
state |
boolean :
true to block uninstallation, else false |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Uninstalls the given application list with specified uninstallation flag.
Warning; Application uninstallation time can be change due to apk size so if apk size large than 10MB use this api in Thread and Handler to avoid ANR.
Parameters | |
---|---|
packageNameList |
List :
Application package name list |
uninstallFlags |
int :
Possible values: DELETE_KEEP_DATA DELETE_ALL_USERS |
Returns | |
---|---|
List<Integer> |
Uninstallation result in integer format as follows; |
Throws | |
---|---|
AfexException |
Uninstalls the given application with specified uninstallation flag.
Warning; Application uninstallation time can be change due to apk size so if apk size large than 10MB use this api in Thread and Handler to avoid ANR.
Parameters | |
---|---|
packageName |
String :
Application package name |
uninstallFlags |
int :
Possible values: DELETE_KEEP_DATA DELETE_ALL_USERS |
Returns | |
---|---|
int |
Uninstallation result in integer format as follows; |
Throws | |
---|---|
AfexException |
Uninstalls the given application.
Warning; Application uninstallation time can be change due to apk size so if apk size large than 10MB use this api in Thread and Handler to avoid ANR.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
int |
Uninstallation result in integer format as follows; |
Throws | |
---|---|
AfexException |
Uninstalls the given application list.
Warning; Application uninstallation time can be change due to apk size so if apk size large than 10MB use this api in Thread and Handler to avoid ANR.
Parameters | |
---|---|
packageNameList |
List :
Application package name list |
Returns | |
---|---|
List<Integer> |
Uninstallation result in integer format as follows; |
Throws | |
---|---|
AfexException |
Returns passed uninstallation result's enumaration name which is used for converting results in more understandable format.
Parameters | |
---|---|
result |
int :
Uninstallation result in integer format |
Returns | |
---|---|
String |
Passed uninstallation result's enumaration name |