diff --git a/open_file_android/android/src/main/java/com/crazecoder/openfile/OpenFilePlugin.java b/open_file_android/android/src/main/java/com/crazecoder/openfile/OpenFilePlugin.java index 4e5876df..256f21e4 100644 --- a/open_file_android/android/src/main/java/com/crazecoder/openfile/OpenFilePlugin.java +++ b/open_file_android/android/src/main/java/com/crazecoder/openfile/OpenFilePlugin.java @@ -56,8 +56,6 @@ public class OpenFilePlugin implements MethodCallHandler private int REQUEST_CODE_FOR_DIR = 0x111; - private static final String TYPE_STRING_APK = "application/vnd.android.package-archive"; - @Override public void onMethodCall(MethodCall call, @NonNull Result result) { isResultSubmitted = false; @@ -112,10 +110,6 @@ private void doOpen() { } } - if (TYPE_STRING_APK.equals(mimeType)) { - openApkFile(); - return; - } startActivity(); } @@ -166,24 +160,6 @@ private void startActivity() { result(type, message); } - private void openApkFile() { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !canInstallApk()) { - result(-3, "Permission denied: " + Manifest.permission.REQUEST_INSTALL_PACKAGES); - } else { - startActivity(); - } - } - - @RequiresApi(api = Build.VERSION_CODES.O) - private boolean canInstallApk() { - try { - return activity.getPackageManager().canRequestPackageInstalls(); - } catch (SecurityException e) { - e.printStackTrace(); - return false; - } - } - private void result(int type, String message) { if (result != null && !isResultSubmitted) { Map map = MapUtil.createMap(type, message);