Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
jfversluis authored Feb 2, 2023
2 parents b08fd9b + 3bad14f commit 57d9c59
Show file tree
Hide file tree
Showing 20 changed files with 47 additions and 67 deletions.
2 changes: 1 addition & 1 deletion PRODUCT-FEEDBACK.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
We'd love to hear your thoughts on Xamarin.Essentials. Here are a few links to help get you to the right place:

### Setup and Common Questions
* Read through our full [Getting Started with Xamarin.Essetials Guide](https://docs.microsoft.com/xamarin/essentials/get-started)
* Read through our full [Getting Started with Xamarin.Essetials Guide](https://learn.microsoft.com/xamarin/essentials/get-started)
* [Frequently Asked Questions on our Wiki](https://github.com/xamarin/Essentials/wiki/FAQ-%7C-Essentials)

### Propose a Feature
Expand Down
18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ iOS, Android, and UWP offer unique operating system and platform APIs that devel

## Questions

Get your technical questions answered by experts on [Microsoft Q&A](https://docs.microsoft.com/answers/topics/dotnet-xamarinessentials.html?WT.mc_id=friends-0000-jamont).
Get your technical questions answered by experts on [Microsoft Q&A](https://learn.microsoft.com/answers/topics/dotnet-xamarinessentials.html?WT.mc_id=friends-0000-jamont).

## Contribution Discussion

Expand All @@ -16,15 +16,7 @@ Contributing to Xamarin.Essentials? Join our [Discord server](https://discord.co

| Build Server | Type | Platform | Status |
|--------------|--------------|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| VSTS | Build | Windows | [![Build Status](https://dev.azure.com/devdiv/DevDiv/_apis/build/status/Xamarin/Components/Xamarin.Essentials?branchName=main)](https://dev.azure.com/xamarin/public/_build?definitionId=7&_a=summary) |
| App Center | Sample App | Android | [![Build status](https://build.appcenter.ms/v0.1/apps/7a1f46ca-ba2f-477e-aacc-ff013c7d5f7a/branches/main/badge)](https://appcenter.ms) |
| App Center | Sample App | iOS | [![Build status](https://build.appcenter.ms/v0.1/apps/43b39e9e-2b2b-482f-8afa-e9906334c85e/branches/main/badge)](https://appcenter.ms) |

## Sample App

Try out Xamarin.Essentials on your device!

* [Android Sample App](https://install.appcenter.ms/orgs/microsoft-liveplayer/apps/essentials-android/distribution_groups/public%20testers) via App Center.
| Azure DevOps | Build | Windows | [![Build Status](https://dev.azure.com/xamarin/public/_apis/build/status/xamarin/Essentials/Xamarin.Essentials%20(Public)?repoName=xamarin%2FEssentials&branchName=main)](https://dev.azure.com/xamarin/public/_build/latest?definitionId=7&repoName=xamarin%2FEssentials&branchName=main) |

## Installation

Expand All @@ -33,15 +25,15 @@ Xamarin.Essentials is available via NuGet & is included in every template:
* NuGet Official Releases: [![NuGet](https://img.shields.io/nuget/vpre/Xamarin.Essentials.svg?label=NuGet)](https://www.nuget.org/packages/Xamarin.Essentials)
* Nightly / CI Releases: https://aka.ms/xamarin-essentials-ci/index.json

Please read our [Getting Started with Xamarin.Essentials guide](https://docs.microsoft.com/xamarin/essentials/get-started?WT.mc_id=friends-0000-jamont) for full setup instructions.
Please read our [Getting Started with Xamarin.Essentials guide](https://learn.microsoft.com/xamarin/essentials/get-started?WT.mc_id=friends-0000-jamont) for full setup instructions.

## Documentation

Browse our [full documentation for Xamarin.Essentials](https://docs.microsoft.com/xamarin/essentials?WT.mc_id=friends-0000-jamont), including feature guides, on how to use each feature.
Browse our [full documentation for Xamarin.Essentials](https://learn.microsoft.com/xamarin/essentials?WT.mc_id=friends-0000-jamont), including feature guides, on how to use each feature.

## Supported Platforms

Platform support & feature support can be found on our [documentation](https://docs.microsoft.com/xamarin/essentials/platform-feature-support?WT.mc_id=friends-0000-jamont)
Platform support & feature support can be found on our [documentation](https://learn.microsoft.com/xamarin/essentials/platform-feature-support?WT.mc_id=friends-0000-jamont)


## Contributing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AspNet.Security.OAuth.Apple" Version="3.0.0" />
<PackageReference Include="AspNet.Security.OAuth.Apple" Version="3.1.8" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Facebook" Version="3.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="3.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.MicrosoftAccount" Version="3.1.2" />
Expand Down
2 changes: 1 addition & 1 deletion Samples/Samples.Android/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.xamarin.essentials" android:installLocation="auto">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="30" />
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Expand Down
8 changes: 4 additions & 4 deletions Samples/Samples.Android/Samples.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AppCenter" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Distribute" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter" Version="4.5.3" />
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="4.5.3" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="4.5.3" />
<PackageReference Include="Microsoft.AppCenter.Distribute" Version="4.5.3" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2083" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="5.0.0.2083" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
Expand Down
8 changes: 4 additions & 4 deletions Samples/Samples.Mac/Samples.Mac.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
<Reference Include="OpenTK" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AppCenter" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Distribute" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter" Version="4.5.3" />
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="4.5.3" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="4.5.3" />
<PackageReference Include="Microsoft.AppCenter.Distribute" Version="4.5.3" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2083" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="5.0.0.2083" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
Expand Down
8 changes: 4 additions & 4 deletions Samples/Samples.UWP/Samples.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AppCenter" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Distribute" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter" Version="4.5.3" />
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="4.5.3" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="4.5.3" />
<PackageReference Include="Microsoft.AppCenter.Distribute" Version="4.5.3" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2083" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="5.0.0.2083" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.9" />
Expand Down
8 changes: 4 additions & 4 deletions Samples/Samples.iOS/Samples.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AppCenter" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Distribute" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter" Version="4.5.3" />
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="4.5.3" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="4.5.3" />
<PackageReference Include="Microsoft.AppCenter.Distribute" Version="4.5.3" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2083" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="5.0.0.2083" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
Expand Down
8 changes: 4 additions & 4 deletions Samples/Samples/Samples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AppCenter" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter.Distribute" Version="3.0.0" />
<PackageReference Include="Microsoft.AppCenter" Version="4.5.3" />
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="4.5.3" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="4.5.3" />
<PackageReference Include="Microsoft.AppCenter.Distribute" Version="4.5.3" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2083" />
<PackageReference Include="Xamarin.Forms.Visual.Material" Version="5.0.0.2083" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
Expand Down
2 changes: 1 addition & 1 deletion Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
</ItemGroup>
Expand Down
4 changes: 0 additions & 4 deletions Xamarin.Essentials/AppInfo/AppInfo.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ static void PlatformShowSettingsUI()

var flags = ActivityFlags.NewTask | ActivityFlags.NoHistory | ActivityFlags.ExcludeFromRecents;

#if __ANDROID_24__
if (Platform.HasApiLevelN)
flags |= ActivityFlags.LaunchAdjacent;
#endif
settingsIntent.SetFlags(flags);

context.StartActivity(settingsIntent);
Expand Down
5 changes: 1 addition & 4 deletions Xamarin.Essentials/Email/Email.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ static Task PlatformComposeAsync(EmailMessage message)
{
var intent = CreateIntent(message);
var flags = ActivityFlags.ClearTop | ActivityFlags.NewTask;
#if __ANDROID_24__
if (Platform.HasApiLevelN)
flags |= ActivityFlags.LaunchAdjacent;
#endif

intent.SetFlags(flags);

Platform.AppContext.StartActivity(intent);
Expand Down
10 changes: 2 additions & 8 deletions Xamarin.Essentials/Launcher/Launcher.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ static Task PlatformOpenAsync(Uri uri)
{
var intent = new Intent(Intent.ActionView, AndroidUri.Parse(uri.OriginalString));
var flags = ActivityFlags.ClearTop | ActivityFlags.NewTask;
#if __ANDROID_24__
if (Platform.HasApiLevelN)
flags |= ActivityFlags.LaunchAdjacent;
#endif

intent.SetFlags(flags);

Platform.AppContext.StartActivity(intent);
Expand All @@ -46,10 +43,7 @@ static Task PlatformOpenAsync(OpenFileRequest request)

var chooserIntent = Intent.CreateChooser(intent, request.Title ?? string.Empty);
var flags = ActivityFlags.ClearTop | ActivityFlags.NewTask;
#if __ANDROID_24__
if (Platform.HasApiLevelN)
flags |= ActivityFlags.LaunchAdjacent;
#endif

chooserIntent.SetFlags(flags);

Platform.AppContext.StartActivity(chooserIntent);
Expand Down
5 changes: 1 addition & 4 deletions Xamarin.Essentials/Map/Map.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ static void StartIntent(string uri)
{
var intent = new Intent(Intent.ActionView, AndroidUri.Parse(uri));
var flags = ActivityFlags.ClearTop | ActivityFlags.NewTask;
#if __ANDROID_24__
if (Platform.HasApiLevelN)
flags |= ActivityFlags.LaunchAdjacent;
#endif

intent.SetFlags(flags);

Platform.AppContext.StartActivity(intent);
Expand Down
5 changes: 4 additions & 1 deletion Xamarin.Essentials/MediaPicker/MediaPicker.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ static Task<FileResult> PlatformCaptureVideoAsync(MediaPickerOptions options)
static async Task<FileResult> PlatformCaptureAsync(MediaPickerOptions options, bool photo)
{
await Permissions.EnsureGrantedAsync<Permissions.Camera>();
await Permissions.EnsureGrantedAsync<Permissions.StorageWrite>();

// StorageWrite no longer exists starting from Android API 33
if (!Platform.HasApiLevel(33))
await Permissions.EnsureGrantedAsync<Permissions.StorageWrite>();

var capturePhotoIntent = new Intent(photo ? MediaStore.ActionImageCapture : MediaStore.ActionVideoCapture);

Expand Down
5 changes: 1 addition & 4 deletions Xamarin.Essentials/PhoneDialer/PhoneDialer.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ static void PlatformOpen(string number)
var dialIntent = ResolveDialIntent(phoneNumber);

var flags = ActivityFlags.ClearTop | ActivityFlags.NewTask;
#if __ANDROID_24__
if (Platform.HasApiLevelN)
flags |= ActivityFlags.LaunchAdjacent;
#endif

dialIntent.SetFlags(flags);

Platform.AppContext.StartActivity(dialIntent);
Expand Down
5 changes: 5 additions & 0 deletions Xamarin.Essentials/SecureStorage/SecureStorage.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ static void PlatformRemoveAll() =>

internal static bool AlwaysUseAsymmetricKeyStorage { get; set; } = false;

// While MD5 is deemed to be not secure anymore, it is not used in a security context here.
// Here we hash a key value to ensure compatibility with the underlying platform's preferences storage (so the key was a determinate length and didn't exceed platform limits).
// As part as Microsofts ongoing efforts to secure the .NET ecosystem, this usage of an insecure hashing mechanism was flagged.
// An exception has been requested for the usage of this "unsafe" hashing mechanism.
// More details here (internal link): https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1676270
internal static string Md5Hash(string input)
{
var hash = new StringBuilder();
Expand Down
5 changes: 1 addition & 4 deletions Xamarin.Essentials/Sms/Sms.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ static Task PlatformComposeAsync(SmsMessage message)
var intent = CreateIntent(message?.Body, message?.Recipients);

var flags = ActivityFlags.ClearTop | ActivityFlags.NewTask;
#if __ANDROID_24__
if (Platform.HasApiLevelN)
flags |= ActivityFlags.LaunchAdjacent;
#endif

intent.SetFlags(flags);

Platform.AppContext.StartActivity(intent);
Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Essentials/Xamarin.Essentials.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<Reference Include="System.Numerics" />
<AndroidResource Include="Resources\xml\*.xml" />
<PackageReference Include="Xamarin.AndroidX.Browser" Version="[1.3.0.5,1.4)" />
<PackageReference Include="Xamarin.AndroidX.Browser" Version="[1.3.0.5,1.4.0.3)" />
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.iOS')) ">
<Compile Include="**\*.ios.cs" />
Expand Down
1 change: 1 addition & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ variables:
GIT_SHA: $(Build.SourceVersion)
GIT_BRANCH_NAME: $(Build.SourceBranchName)
AREA_PATH: 'DevDiv\Xamarin SDK\Build and Tools'
Codeql.Enabled: true

resources:
repositories:
Expand Down

0 comments on commit 57d9c59

Please sign in to comment.