How Android determines if the APK is an unknown source

Source: Internet
Author: User

1. Native System Judgment method

http://blog.csdn.net/xidiankk/article/details/49533245

According to this analysis, the necessary conditions are:

1) The way to emit intent (the way to start packageinstalleractivity)

Must Forresult

2) Intent must set the unknown source to False

Feel the design is rather lame, third-party apps can be arbitrary.

It is estimated that Chrome is not installed in the default way to meet the above conditions, so as long as it is under chrome is unknown.

And AppStore is wanton for it, all for Ming, which fool AppStore will his own set as unclear?

Packages\apps\packageinstaller\src\com\android\packageinstaller\packageinstalleractivity.java

2. Android Customization

Goal: Download only from your own App store.

All browsers and other stores cannot be installed. The SD card is not limited at this stage.

Consider the following scenarios:

1) custom system Android Marketplace app that specifies intent special data when starting packageinstalleractivity.

2) packageinstalleractivity Mandatory check of special data when Isinstallrequestfromunknownsource.

(but this will affect the system itself, the installation of the app, the first time the system should be pre-installed, when the pre-installed if also go this path is bullshit.) So do you want to distinguish it from pre-installed? )

3) Packageinstalleractivity is set to not allow installation of unknown sources. Isinstallingunknownappsallowed

http://www.android100.org/html/201307/18/3656.html

Alternative options:

Take a look at this earlier entrance, if it can be blocked early. This is a straightforward URI to judge.

http://blog.csdn.net/dadoneo/article/details/8047931

public void InstallPackage (
Final Uri Packageuri, Final ipackageinstallobserver Observer, final int flags,
Final String Installerpackagename)

InstallPackage of the Packagemanagerservice class

http://blog.csdn.net/dadoneo/article/details/8047931

How Android determines if the APK is an unknown source

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.