Hi, I don't know if this is the right place to ask this question, but here goes:
I have a Xamarin.Forms application that downloads an apk-file (from my GitHub-repository).
When executing that apk-file, I get a security-error:
Java.Lang.SecurityException: "UID 10105" does not have permission to content:... .apk [user 0]"
Here's my Android-code:
Intent intent = new Intent(Intent.ActionView);
Android.Net.Uri fileUri = null;
if ((int)Build.VERSION.SdkInt < 23)
fileUri = Android.Net.Uri.FromFile(new Java.IO.File(path));
else
fileUri = FileProvider.GetUriForFile(AutoUpdate.Context, AutoUpdate.Authority, new Java.IO.File(path));intent.SetDataAndType(fileUri, "application/vnd.android.package-archive");
intent.SetFlags(ActivityFlags.GrantReadUriPermission);AutoUpdate.Context.StartActivity(intent);
In the manifest-page of the Android-project, the following permissions have been checked:
- INSTALL_PACKAGES
- READ_EXTERNAL_STORAGE
- REQUEST_INSTALL_PACKAGES
- RESTART_PACKAGES
What am I doing wrong ?
Luk.