open_file icon indicating copy to clipboard operation
open_file copied to clipboard

Can't install apk downloaded

Open Israelmath opened this issue 2 years ago • 0 comments

Hello!

When we try to update my own app, downloading and reinstalling, open_file asks for a permission to "install from unknown sources". But, after I give the permission and come back to my app, the installation not proceed. It just not do anything. Indeed, If I try to install again, open_file asks again for the same permission, which creates a kind of loop.

What we did, in intet to solve it, is to comment the lines 316-325 (OpenFilePlugin.java) and running the method startActivity() without any verifications, which obviously works for what we need.

Do you know if there is something different to do?

Environment open_file: 3.2.1 Flutter: 2.10.4 Dart: 2.16.2 DevTools: 2.9.2

@RequiresApi(api = Build.VERSION_CODES.M)
    private void openApkFile() {
//        if (!canInstallApk()) {
//            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
//                startInstallPermissionSettingActivity();
//            } else {
//                ActivityCompat.requestPermissions(activity,
//                        new String[]{Manifest.permission.REQUEST_INSTALL_PACKAGES}, REQUEST_CODE);
//            }
//        } else {
//            startActivity();
//        }
        startActivity();
    }

Israelmath avatar Jun 24 '22 21:06 Israelmath