Remove EXTRA_NOT_UNKNOWN_SOURCE from DefaultInstaller
Doesn't work because: * In this installer, we are not a system app * Our intent action is of type ACTION_VIEW, not ACTION_INSTALL_PACKAGE The equivalent of "we are not an unknown source" would be the other installers, such as the Root and System ones.
This commit is contained in:
parent
53d9a15d11
commit
7d3723fe69
@ -57,7 +57,6 @@ public class DefaultInstaller extends Installer {
|
|||||||
intent.setAction(android.content.Intent.ACTION_VIEW);
|
intent.setAction(android.content.Intent.ACTION_VIEW);
|
||||||
intent.setDataAndType(Uri.parse("file://" + apkFile.getPath()),
|
intent.setDataAndType(Uri.parse("file://" + apkFile.getPath()),
|
||||||
"application/vnd.android.package-archive");
|
"application/vnd.android.package-archive");
|
||||||
extraNotUnknownSource(intent);
|
|
||||||
try {
|
try {
|
||||||
mActivity.startActivityForResult(intent, REQUEST_CODE_INSTALL);
|
mActivity.startActivityForResult(intent, REQUEST_CODE_INSTALL);
|
||||||
} catch (ActivityNotFoundException e) {
|
} catch (ActivityNotFoundException e) {
|
||||||
@ -65,14 +64,6 @@ public class DefaultInstaller extends Installer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TargetApi(14)
|
|
||||||
private void extraNotUnknownSource(Intent intent) {
|
|
||||||
if (Build.VERSION.SDK_INT < 14) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
intent.putExtra(Intent.EXTRA_NOT_UNKNOWN_SOURCE, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deletePackage(String packageName) throws AndroidNotCompatibleException {
|
public void deletePackage(String packageName) throws AndroidNotCompatibleException {
|
||||||
super.deletePackage(packageName);
|
super.deletePackage(packageName);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user