Is there any way to find out if the user has checked the 'Unknown Sources' checkbox in the 'Application settings' menu?
You can use the INSTALL_NON_MARKET_APPS
setting. Something like that :
boolean canInstallFromOtherSources = Settings.Secure.getInt(Settings.Secure.INSTALL_NON_MARKET_APPS) == 1;
来源:https://stackoverflow.com/questions/4594503/android-anyway-to-know-if-unknown-sources-is-checked