first version of OneDrive implementation in C#

This commit is contained in:
Philipp Crocoll
2019-09-30 10:42:27 +02:00
parent 57e36fb728
commit db26fb6f39
8 changed files with 417 additions and 263 deletions

View File

@@ -12,7 +12,7 @@
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile> <AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<TargetFrameworkVersion>v8.0</TargetFrameworkVersion> <TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk> <AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<NuGetPackageImportStamp> <NuGetPackageImportStamp>
</NuGetPackageImportStamp> </NuGetPackageImportStamp>
@@ -48,6 +48,19 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.Graph, Version=1.17.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Graph.1.17.0\lib\netstandard1.3\Microsoft.Graph.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Graph.Auth, Version=0.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.Graph.Auth.1.0.0-preview.1\lib\netstandard1.3\Microsoft.Graph.Auth.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Graph.Core, Version=1.17.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<Reference Include="Microsoft.Identity.Client, Version=4.4.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\Users\Philipp\.nuget\packages\microsoft.identity.client\4.4.0\ref\MonoAndroid9.0\Microsoft.Identity.Client.dll</HintPath>
</Reference>
<Reference Include="Mono.Android" /> <Reference Include="Mono.Android" />
<Reference Include="Mono.Security" /> <Reference Include="Mono.Security" />
<Reference Include="mscorlib" /> <Reference Include="mscorlib" />
@@ -118,6 +131,7 @@
<Compile Include="Io\JavaFileStorage.cs" /> <Compile Include="Io\JavaFileStorage.cs" />
<Compile Include="Io\NetFtpFileStorage.cs" /> <Compile Include="Io\NetFtpFileStorage.cs" />
<Compile Include="Io\OfflineSwitchableFileStorage.cs" /> <Compile Include="Io\OfflineSwitchableFileStorage.cs" />
<Compile Include="Io\OneDrive2FileStorage.cs" />
<Compile Include="Io\PCloudFileStorage.cs" /> <Compile Include="Io\PCloudFileStorage.cs" />
<Compile Include="Io\SftpFileStorage.cs" /> <Compile Include="Io\SftpFileStorage.cs" />
<Compile Include="Io\OneDriveFileStorage.cs" /> <Compile Include="Io\OneDriveFileStorage.cs" />
@@ -182,34 +196,83 @@
<Folder Include="Resources\" /> <Folder Include="Resources\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config" />
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" /> <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<Import Project="..\packages\Xamarin.Android.Support.Annotations.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Annotations.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets')" /> <Import Project="..\packages\Xamarin.Android.Support.Annotations.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Annotations.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Annotations.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Annotations.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText> <ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
</PropertyGroup> </PropertyGroup>
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Annotations.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Annotations.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Annotations.targets'))" /> <Error Condition="!Exists('..\packages\Xamarin.Android.Support.Annotations.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Annotations.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Annotations.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Annotations.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Arch.Core.Common.1.0.0\build\MonoAndroid80\Xamarin.Android.Arch.Core.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Arch.Core.Common.1.0.0\build\MonoAndroid80\Xamarin.Android.Arch.Core.Common.targets'))" /> <Error Condition="!Exists('..\packages\Xamarin.Android.Arch.Core.Common.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Core.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Arch.Core.Common.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Core.Common.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Arch.Lifecycle.Common.1.0.1\build\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Arch.Lifecycle.Common.1.0.1\build\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Common.targets'))" /> <Error Condition="!Exists('..\packages\Xamarin.Android.Arch.Core.Runtime.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Core.Runtime.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Arch.Core.Runtime.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Core.Runtime.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Arch.Lifecycle.Runtime.1.0.0\build\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Runtime.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Arch.Lifecycle.Runtime.1.0.0\build\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Runtime.targets'))" /> <Error Condition="!Exists('..\packages\Xamarin.Android.Arch.Lifecycle.Common.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Lifecycle.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Arch.Lifecycle.Common.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Lifecycle.Common.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Compat.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Compat.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Compat.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Compat.targets'))" /> <Error Condition="!Exists('..\packages\Xamarin.Android.Arch.Lifecycle.LiveData.Core.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Lifecycle.LiveData.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Arch.Lifecycle.LiveData.Core.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Lifecycle.LiveData.Core.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Core.UI.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Core.UI.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Core.UI.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Core.UI.targets'))" /> <Error Condition="!Exists('..\packages\Xamarin.Android.Arch.Lifecycle.LiveData.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Lifecycle.LiveData.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Arch.Lifecycle.LiveData.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Lifecycle.LiveData.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Core.Utils.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Core.Utils.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Core.Utils.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Core.Utils.targets'))" /> <Error Condition="!Exists('..\packages\Xamarin.Android.Arch.Lifecycle.Runtime.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Lifecycle.Runtime.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Arch.Lifecycle.Runtime.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Lifecycle.Runtime.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Fragment.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Fragment.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Fragment.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Fragment.targets'))" /> <Error Condition="!Exists('..\packages\Xamarin.Android.Arch.Lifecycle.ViewModel.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Lifecycle.ViewModel.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Arch.Lifecycle.ViewModel.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Lifecycle.ViewModel.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Media.Compat.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Media.Compat.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Media.Compat.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Media.Compat.targets'))" /> <Error Condition="!Exists('..\packages\Xamarin.Android.Support.Collections.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Collections.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Collections.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Collections.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.v13.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.v13.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.v13.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.v13.targets'))" /> <Error Condition="!Exists('..\packages\Xamarin.Android.Support.CursorAdapter.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.CursorAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.CursorAdapter.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.CursorAdapter.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.DocumentFile.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.DocumentFile.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.DocumentFile.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.DocumentFile.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Interpolator.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Interpolator.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Interpolator.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Interpolator.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.LocalBroadcastManager.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.LocalBroadcastManager.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.LocalBroadcastManager.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.LocalBroadcastManager.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Print.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Print.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Print.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Print.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.VersionedParcelable.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.VersionedParcelable.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.VersionedParcelable.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.VersionedParcelable.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Compat.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Compat.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Compat.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Compat.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.AsyncLayoutInflater.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.AsyncLayoutInflater.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.AsyncLayoutInflater.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.AsyncLayoutInflater.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.CustomView.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.CustomView.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.CustomView.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.CustomView.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.CoordinaterLayout.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.CoordinaterLayout.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.CoordinaterLayout.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.CoordinaterLayout.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.DrawerLayout.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.DrawerLayout.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.DrawerLayout.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.DrawerLayout.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Loader.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Loader.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Loader.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Loader.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Core.Utils.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Core.Utils.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Core.Utils.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Core.Utils.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Media.Compat.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Media.Compat.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Media.Compat.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Media.Compat.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.SlidingPaneLayout.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.SlidingPaneLayout.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.SlidingPaneLayout.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.SlidingPaneLayout.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.SwipeRefreshLayout.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.SwipeRefreshLayout.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.SwipeRefreshLayout.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.SwipeRefreshLayout.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Vector.Drawable.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Vector.Drawable.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Vector.Drawable.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Vector.Drawable.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.ViewPager.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.ViewPager.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.ViewPager.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.ViewPager.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Core.UI.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Core.UI.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Core.UI.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Core.UI.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Animated.Vector.Drawable.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Animated.Vector.Drawable.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.CustomTabs.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.CustomTabs.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.CustomTabs.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.CustomTabs.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.Fragment.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Fragment.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.Fragment.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Fragment.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.v4.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.v4.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.v4.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.v4.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.v13.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.v13.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.v13.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.v13.targets'))" />
<Error Condition="!Exists('..\packages\Xamarin.Android.Support.v7.AppCompat.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.v7.AppCompat.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Android.Support.v7.AppCompat.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.v7.AppCompat.targets'))" />
</Target> </Target>
<Import Project="..\packages\Xamarin.Android.Arch.Core.Common.1.0.0\build\MonoAndroid80\Xamarin.Android.Arch.Core.Common.targets" Condition="Exists('..\packages\Xamarin.Android.Arch.Core.Common.1.0.0\build\MonoAndroid80\Xamarin.Android.Arch.Core.Common.targets')" /> <Import Project="..\packages\Xamarin.Android.Arch.Core.Common.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Core.Common.targets" Condition="Exists('..\packages\Xamarin.Android.Arch.Core.Common.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Core.Common.targets')" />
<Import Project="..\packages\Xamarin.Android.Arch.Lifecycle.Common.1.0.1\build\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Common.targets" Condition="Exists('..\packages\Xamarin.Android.Arch.Lifecycle.Common.1.0.1\build\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Common.targets')" /> <Import Project="..\packages\Xamarin.Android.Arch.Core.Runtime.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Core.Runtime.targets" Condition="Exists('..\packages\Xamarin.Android.Arch.Core.Runtime.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Core.Runtime.targets')" />
<Import Project="..\packages\Xamarin.Android.Arch.Lifecycle.Runtime.1.0.0\build\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Runtime.targets" Condition="Exists('..\packages\Xamarin.Android.Arch.Lifecycle.Runtime.1.0.0\build\MonoAndroid80\Xamarin.Android.Arch.Lifecycle.Runtime.targets')" /> <Import Project="..\packages\Xamarin.Android.Arch.Lifecycle.Common.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Lifecycle.Common.targets" Condition="Exists('..\packages\Xamarin.Android.Arch.Lifecycle.Common.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Lifecycle.Common.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Compat.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Compat.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Compat.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Compat.targets')" /> <Import Project="..\packages\Xamarin.Android.Arch.Lifecycle.LiveData.Core.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Lifecycle.LiveData.Core.targets" Condition="Exists('..\packages\Xamarin.Android.Arch.Lifecycle.LiveData.Core.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Lifecycle.LiveData.Core.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Core.UI.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Core.UI.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Core.UI.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Core.UI.targets')" /> <Import Project="..\packages\Xamarin.Android.Arch.Lifecycle.LiveData.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Lifecycle.LiveData.targets" Condition="Exists('..\packages\Xamarin.Android.Arch.Lifecycle.LiveData.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Lifecycle.LiveData.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Core.Utils.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Core.Utils.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Core.Utils.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Core.Utils.targets')" /> <Import Project="..\packages\Xamarin.Android.Arch.Lifecycle.Runtime.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Lifecycle.Runtime.targets" Condition="Exists('..\packages\Xamarin.Android.Arch.Lifecycle.Runtime.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Lifecycle.Runtime.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Fragment.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Fragment.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Fragment.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Fragment.targets')" /> <Import Project="..\packages\Xamarin.Android.Arch.Lifecycle.ViewModel.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Lifecycle.ViewModel.targets" Condition="Exists('..\packages\Xamarin.Android.Arch.Lifecycle.ViewModel.1.1.1.1\build\monoandroid90\Xamarin.Android.Arch.Lifecycle.ViewModel.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Media.Compat.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Media.Compat.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Media.Compat.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.Media.Compat.targets')" /> <Import Project="..\packages\Xamarin.Android.Support.Collections.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Collections.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Collections.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Collections.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.v13.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.v13.targets" Condition="Exists('..\packages\Xamarin.Android.Support.v13.26.1.0.1\build\MonoAndroid80\Xamarin.Android.Support.v13.targets')" /> <Import Project="..\packages\Xamarin.Android.Support.CursorAdapter.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.CursorAdapter.targets" Condition="Exists('..\packages\Xamarin.Android.Support.CursorAdapter.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.CursorAdapter.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.DocumentFile.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.DocumentFile.targets" Condition="Exists('..\packages\Xamarin.Android.Support.DocumentFile.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.DocumentFile.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Interpolator.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Interpolator.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Interpolator.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Interpolator.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.LocalBroadcastManager.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.LocalBroadcastManager.targets" Condition="Exists('..\packages\Xamarin.Android.Support.LocalBroadcastManager.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.LocalBroadcastManager.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Print.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Print.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Print.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Print.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.VersionedParcelable.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.VersionedParcelable.targets" Condition="Exists('..\packages\Xamarin.Android.Support.VersionedParcelable.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.VersionedParcelable.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Compat.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Compat.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Compat.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Compat.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.AsyncLayoutInflater.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.AsyncLayoutInflater.targets" Condition="Exists('..\packages\Xamarin.Android.Support.AsyncLayoutInflater.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.AsyncLayoutInflater.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.CustomView.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.CustomView.targets" Condition="Exists('..\packages\Xamarin.Android.Support.CustomView.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.CustomView.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.CoordinaterLayout.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.CoordinaterLayout.targets" Condition="Exists('..\packages\Xamarin.Android.Support.CoordinaterLayout.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.CoordinaterLayout.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.DrawerLayout.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.DrawerLayout.targets" Condition="Exists('..\packages\Xamarin.Android.Support.DrawerLayout.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.DrawerLayout.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Loader.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Loader.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Loader.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Loader.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Core.Utils.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Core.Utils.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Core.Utils.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Core.Utils.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Media.Compat.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Media.Compat.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Media.Compat.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Media.Compat.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.SlidingPaneLayout.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.SlidingPaneLayout.targets" Condition="Exists('..\packages\Xamarin.Android.Support.SlidingPaneLayout.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.SlidingPaneLayout.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.SwipeRefreshLayout.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.SwipeRefreshLayout.targets" Condition="Exists('..\packages\Xamarin.Android.Support.SwipeRefreshLayout.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.SwipeRefreshLayout.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Vector.Drawable.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Vector.Drawable.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Vector.Drawable.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Vector.Drawable.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.ViewPager.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.ViewPager.targets" Condition="Exists('..\packages\Xamarin.Android.Support.ViewPager.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.ViewPager.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Core.UI.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Core.UI.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Core.UI.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Core.UI.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Animated.Vector.Drawable.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Animated.Vector.Drawable.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.CustomTabs.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.CustomTabs.targets" Condition="Exists('..\packages\Xamarin.Android.Support.CustomTabs.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.CustomTabs.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.Fragment.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Fragment.targets" Condition="Exists('..\packages\Xamarin.Android.Support.Fragment.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.Fragment.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.v4.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.v4.targets" Condition="Exists('..\packages\Xamarin.Android.Support.v4.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.v4.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.v13.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.v13.targets" Condition="Exists('..\packages\Xamarin.Android.Support.v13.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.v13.targets')" />
<Import Project="..\packages\Xamarin.Android.Support.v7.AppCompat.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.v7.AppCompat.targets" Condition="Exists('..\packages\Xamarin.Android.Support.v7.AppCompat.28.0.0.1\build\monoandroid90\Xamarin.Android.Support.v7.AppCompat.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">

View File

@@ -1,14 +1,93 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Xamarin.Android.Arch.Core.Common" version="1.0.0" targetFramework="monoandroid81" /> <package id="Microsoft.Graph" version="1.17.0" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Arch.Lifecycle.Common" version="1.0.1" targetFramework="monoandroid81" /> <package id="Microsoft.Graph.Auth" version="1.0.0-preview.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Arch.Lifecycle.Runtime" version="1.0.0" targetFramework="monoandroid81" /> <package id="Microsoft.Graph.Core" version="1.17.0" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.Annotations" version="26.1.0.1" targetFramework="monoandroid81" /> <package id="Microsoft.Identity.Client" version="4.4.0" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.Compat" version="26.1.0.1" targetFramework="monoandroid81" /> <package id="Microsoft.NETCore.Platforms" version="1.1.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.Core.UI" version="26.1.0.1" targetFramework="monoandroid81" /> <package id="Microsoft.NETCore.Targets" version="1.1.3" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.Core.Utils" version="26.1.0.1" targetFramework="monoandroid81" /> <package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.Fragment" version="26.1.0.1" targetFramework="monoandroid81" /> <package id="NETStandard.Library" version="1.6.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.Media.Compat" version="26.1.0.1" targetFramework="monoandroid81" /> <package id="Newtonsoft.Json" version="11.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.v13" version="26.1.0.1" targetFramework="monoandroid81" /> <package id="System.AppContext" version="4.3.0" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.v4" version="23.1.1.0" targetFramework="MonoAndroid50" /> <package id="System.Collections" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Collections.Concurrent" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Console" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Diagnostics.Tracing" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Globalization" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Globalization.Calendars" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.IO" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.IO.Compression" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.IO.Compression.ZipFile" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.IO.FileSystem" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Linq" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Linq.Expressions" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Net.Http" version="4.3.3" targetFramework="monoandroid90" />
<package id="System.Net.Primitives" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Net.Sockets" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.ObjectModel" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Private.Uri" version="4.3.2" targetFramework="monoandroid90" />
<package id="System.Reflection" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Reflection.Extensions" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Reflection.Primitives" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Resources.ResourceManager" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Runtime" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Runtime.Extensions" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Runtime.Handles" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Runtime.InteropServices.RuntimeInformation" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Runtime.Numerics" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Security.Claims" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Security.Principal" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Security.SecureString" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Text.Encoding" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Text.Encoding.Extensions" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Text.RegularExpressions" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Threading" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Threading.Tasks" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Threading.Timer" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.ValueTuple" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="monoandroid90" />
<package id="System.Xml.XDocument" version="4.3.0" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Arch.Core.Common" version="1.1.1.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Arch.Core.Runtime" version="1.1.1.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Arch.Lifecycle.Common" version="1.1.1.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Arch.Lifecycle.LiveData" version="1.1.1.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Arch.Lifecycle.LiveData.Core" version="1.1.1.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Arch.Lifecycle.Runtime" version="1.1.1.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Arch.Lifecycle.ViewModel" version="1.1.1.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.Animated.Vector.Drawable" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.Annotations" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.AsyncLayoutInflater" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.Collections" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.Compat" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.CoordinaterLayout" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.Core.UI" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.Core.Utils" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.CursorAdapter" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.CustomTabs" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.CustomView" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.DocumentFile" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.DrawerLayout" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.Fragment" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.Interpolator" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.Loader" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.LocalBroadcastManager" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.Media.Compat" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.Print" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.SlidingPaneLayout" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.SwipeRefreshLayout" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.v13" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.v4" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.v7.AppCompat" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.Vector.Drawable" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.VersionedParcelable" version="28.0.0.1" targetFramework="monoandroid90" />
<package id="Xamarin.Android.Support.ViewPager" version="28.0.0.1" targetFramework="monoandroid90" />
</packages> </packages>

View File

@@ -1,6 +1,7 @@
package keepass2android.javafilestorage; package keepass2android.javafilestorage;
import android.app.Activity; import android.app.Activity;
import android.app.Application;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
@@ -8,51 +9,60 @@ import android.util.Base64;
import android.util.Log; import android.util.Log;
import com.microsoft.graph.authentication.MSALAuthenticationProvider;
import com.microsoft.graph.core.ClientException; import com.microsoft.graph.core.ClientException;
import com.microsoft.graph.core.DefaultClientConfig; import com.microsoft.graph.core.DefaultClientConfig;
import com.microsoft.graph.core.GraphErrorCodes; import com.microsoft.graph.core.GraphErrorCodes;
import com.microsoft.graph.extensions.DriveItem;
import com.microsoft.graph.extensions.Folder;
import com.microsoft.graph.extensions.GraphServiceClient;
import com.microsoft.graph.extensions.IDriveItemCollectionPage;
import com.microsoft.graph.extensions.IDriveItemCollectionRequestBuilder;
import com.microsoft.graph.extensions.IDriveItemRequest;
import com.microsoft.graph.extensions.IDriveItemRequestBuilder;
import com.microsoft.graph.extensions.IDriveSharedWithMeCollectionPage;
import com.microsoft.graph.extensions.IDriveSharedWithMeCollectionRequestBuilder;
import com.microsoft.graph.extensions.IGraphServiceClient;
import com.microsoft.graph.http.GraphServiceException; import com.microsoft.graph.http.GraphServiceException;
import com.microsoft.graph.models.extensions.DriveItem;
import com.microsoft.graph.models.extensions.Folder;
import com.microsoft.graph.models.extensions.SharedDriveItem;
import com.microsoft.graph.models.extensions.User;
import com.microsoft.graph.requests.extensions.GraphServiceClient;
import com.microsoft.graph.requests.extensions.IDriveItemCollectionPage;
import com.microsoft.graph.requests.extensions.IDriveItemCollectionRequestBuilder;
import com.microsoft.graph.requests.extensions.IDriveItemRequest;
import com.microsoft.graph.requests.extensions.IDriveItemRequestBuilder;
import com.microsoft.graph.models.extensions.IGraphServiceClient;
import com.microsoft.graph.requests.extensions.IDriveSharedWithMeCollectionPage;
import com.microsoft.graph.requests.extensions.IDriveSharedWithMeCollectionRequestBuilder;
import com.microsoft.identity.client.AuthenticationCallback; import com.microsoft.identity.client.AuthenticationCallback;
import com.microsoft.identity.client.AuthenticationResult; import com.microsoft.identity.client.AuthenticationResult;
import com.microsoft.identity.client.MsalException; import com.microsoft.identity.client.IAccount;
import com.microsoft.identity.client.Logger;
import com.microsoft.identity.client.exception.MsalClientException;
import com.microsoft.identity.client.exception.MsalException;
import com.microsoft.identity.client.PublicClientApplication; import com.microsoft.identity.client.PublicClientApplication;
import com.microsoft.identity.client.User; import com.microsoft.identity.client.exception.MsalServiceException;
import com.microsoft.identity.client.exception.MsalUiRequiredException;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.InputStream; import java.io.InputStream;
import java.net.URI;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.UUID;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import keepass2android.javafilestorage.onedrive2.GraphServiceClientManager;
/**
* Created by Philipp on 20.11.2016.
*/
public class OneDriveStorage2 extends JavaFileStorageBase public class OneDriveStorage2 extends JavaFileStorageBase
{ {
Activity mDummyActivity = new Activity();
private final Application mApplication;
PublicClientApplication mPublicClientApp; PublicClientApplication mPublicClientApp;
final HashMap<String /*userid*/, IGraphServiceClient> mClientByUser = new HashMap<String /*userid*/, IGraphServiceClient>(); final HashMap<String /*userid*/, IGraphServiceClient> mClientByUser = new HashMap<String /*userid*/, IGraphServiceClient>();
private static final String[] scopes = {"openid","offline_access", "https://graph.microsoft.com/Files.ReadWrite","https://graph.microsoft.com/User.Read"}; private static final String[] scopes = {/*"openid", */"Files.ReadWrite", "User.Read.All","Group.Read.All"};
public OneDriveStorage2(final Activity context, final String clientId) {
public OneDriveStorage2(final Context context, final String clientId) {
mPublicClientApp = new PublicClientApplication(context, clientId); mPublicClientApp = new PublicClientApplication(context, clientId);
initAuthenticator(context);
mApplication = context.getApplication();
} }
@@ -60,27 +70,76 @@ public class OneDriveStorage2 extends JavaFileStorageBase
@Override @Override
public boolean requiresSetup(String path) public boolean requiresSetup(String path)
{ {
return false;
return !isConnected(null);
} }
@Override @Override
public void startSelectFile(FileStorageSetupInitiatorActivity activity, boolean isForSave, int requestCode) { public void startSelectFile(FileStorageSetupInitiatorActivity activity, boolean isForSave, int requestCode) {
String path = getProtocolId()+":///"; initAuthenticator((Activity)activity.getActivity());
Log.d("KP2AJ", "startSelectFile "+path);
activity.startSelectFileProcess(path, isForSave, requestCode);
String path = getProtocolId()+":///";
Log.d("KP2AJ", "startSelectFile "+path+", connected: "+path);
if (isConnected(null))
{
Intent intent = new Intent();
intent.putExtra(EXTRA_IS_FOR_SAVE, isForSave);
intent.putExtra(EXTRA_PATH, path);
activity.onImmediateResult(requestCode, RESULT_FILECHOOSER_PREPARED, intent);
}
else
{
activity.startSelectFileProcess(path, isForSave, requestCode);
}
} }
private boolean isConnected(String path) { private boolean isConnected(String path) {
try { try {
logDebug("isConnected? " + path); if (tryGetMsGraphClient(path) == null)
try {
final CountDownLatch latch = new CountDownLatch(1);
Log.d("KP2AJ", "trying silent login");
String userId = extractUserId(path);
final MsalException[] _exception = {null};
final AuthenticationResult[] _result = {null};
IAccount account = mPublicClientApp.getAccount(userId);
mPublicClientApp.acquireTokenSilentAsync(scopes, account,
new AuthenticationCallback() {
@Override
public void onSuccess(AuthenticationResult authenticationResult) {
_result[0] = authenticationResult;
latch.countDown();
}
@Override
public void onError(MsalException exception) {
_exception[0] = exception;
latch.countDown();
}
@Override
public void onCancel() {
latch.countDown();
}
});
latch.await();
if (_result[0] != null) {
buildClient(_result[0]);
} else if (_exception[0] != null){
_exception[0].printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
}
return tryGetMsGraphClient(path) != null; return tryGetMsGraphClient(path) != null;
} }
catch (Exception e) catch (Exception e)
{ {
logDebug("exception in isConnected: " + e.toString());
return false; return false;
} }
@@ -89,28 +148,32 @@ public class OneDriveStorage2 extends JavaFileStorageBase
private IGraphServiceClient tryGetMsGraphClient(String path) throws Exception private IGraphServiceClient tryGetMsGraphClient(String path) throws Exception
{ {
String userId = extractUserId(path); String userId = extractUserId(path);
Log.d(TAG, "userid for path " + path + " is " + userId);
if (mClientByUser.containsKey(userId)) if (mClientByUser.containsKey(userId))
return mClientByUser.get(userId); return mClientByUser.get(userId);
Log.d(TAG, "no client found for user");
return null; return null;
} }
private String extractUserId(String path) throws Exception { private String extractUserId(String path) throws Exception {
String pathWithoutProtocol = removeProtocol(path); String pathWithoutProtocol = removeProtocol(path);
String[] parts = pathWithoutProtocol.split("/",2); String[] parts = pathWithoutProtocol.split("/",1);
logDebug("extractUserId for path " + path); if (parts.length != 2 || ("".equals(parts[0])))
logDebug("# parts: " + parts.length);
if (parts.length < 1 || ("".equals(parts[0])))
{ {
throw new Exception("path does not contain user"); throw new Exception("path does not contain user");
} }
logDebug("parts[0]: " + parts[0]);
return parts[0]; return parts[0];
} }
private void initAuthenticator(Activity activity) {
}
@Override @Override
public void prepareFileUsage(FileStorageSetupInitiatorActivity activity, String path, int requestCode, boolean alwaysReturnSuccess) { public void prepareFileUsage(FileStorageSetupInitiatorActivity activity, String path, int requestCode, boolean alwaysReturnSuccess) {
initAuthenticator((Activity)activity.getActivity());
if (isConnected(path)) if (isConnected(path))
{ {
Intent intent = new Intent(); Intent intent = new Intent();
@@ -131,7 +194,7 @@ public class OneDriveStorage2 extends JavaFileStorageBase
@Override @Override
public void prepareFileUsage(Context appContext, String path) throws UserInteractionRequiredException { public void prepareFileUsage(Context appContext, String path) throws UserInteractionRequiredException {
if (!isConnected(path)) if (!isConnected(null))
{ {
throw new UserInteractionRequiredException(); throw new UserInteractionRequiredException();
} }
@@ -155,16 +218,18 @@ public class OneDriveStorage2 extends JavaFileStorageBase
private IGraphServiceClient buildClient(AuthenticationResult authenticationResult) throws Exception { private IGraphServiceClient buildClient(AuthenticationResult authenticationResult) throws InterruptedException {
logDebug("buildClient..."); //TODO should we use a separate public client app per account?
IGraphServiceClient newClient = new GraphServiceClient.Builder() MSALAuthenticationProvider authProvider = new MSALAuthenticationProvider(
.fromConfig(DefaultClientConfig.createWithAuthenticationProvider(new GraphServiceClientManager(authenticationResult.getAccessToken()))) mDummyActivity, //it looks like the activity is only used to set the "current activity" in the lifecycle callbacks, the MS Sample app doesn't use a real activity either
mApplication,
mPublicClientApp,
scopes);
IGraphServiceClient newClient = GraphServiceClient.builder()
.authenticationProvider(authProvider)
.buildClient(); .buildClient();
logDebug("authToken = " + authenticationResult.getAccessToken()); mClientByUser.put(authenticationResult.getAccount().getHomeAccountIdentifier().getIdentifier(), newClient);
if (authenticationResult.getUser() == null)
throw new Exception("authenticationResult.getUser() == null!");
mClientByUser.put(authenticationResult.getUser().getUserIdentifier(), newClient);
return newClient; return newClient;
} }
@@ -209,19 +274,17 @@ public class OneDriveStorage2 extends JavaFileStorageBase
public IDriveItemRequestBuilder getPathItem() throws Exception { public IDriveItemRequestBuilder getPathItem() throws Exception {
IDriveItemRequestBuilder pathItem; IDriveItemRequestBuilder pathItem;
if (!hasShare()) { if (!hasShare()) {
logDebug("p: " + oneDrivePath);
for (StackTraceElement ste : Thread.currentThread().getStackTrace()) { for (StackTraceElement ste : Thread.currentThread().getStackTrace()) {
logDebug(ste.toString()); logDebug(ste.toString());
} }
throw new Exception("Cannot get path item without share"); throw new Exception("Cannot get path item without share");
} }
if ("me".equals(share)) if ("me".equals(share))
pathItem = client.getMe().getDrive().getRoot(); pathItem = client.me().drive().root();
else else
pathItem = client.getShares(share).getRoot(); pathItem = client.shares(share).root();
if ("".equals(oneDrivePath) == false) { if ("".equals(oneDrivePath) == false) {
pathItem = pathItem.getItemWithPath(oneDrivePath); pathItem = pathItem.itemWithPath(oneDrivePath);
} }
return pathItem; return pathItem;
} }
@@ -236,9 +299,8 @@ public class OneDriveStorage2 extends JavaFileStorageBase
try { try {
ClientAndPath clientAndpath = getOneDriveClientAndPath(path); ClientAndPath clientAndpath = getOneDriveClientAndPath(path);
logDebug("openFileForRead. Path="+path); logDebug("openFileForRead. Path="+path);
InputStream result = clientAndpath InputStream result = clientAndpath.getPathItem()
.getPathItem() .content()
.getContent()
.buildRequest() .buildRequest()
.get(); .get();
logDebug("ok"); logDebug("ok");
@@ -261,28 +323,24 @@ public class OneDriveStorage2 extends JavaFileStorageBase
throw new Exception("path does not contain user"); throw new Exception("path does not contain user");
} }
result.client = mClientByUser.get(parts[0]); result.client = mClientByUser.get(parts[0]);
if (result.client == null) result.oneDrivePath = parts[1];
throw new Exception("failed to get client for " + parts[0]); if (parts.length > 2)
result.share = parts[2];
logDebug("building client for " + path + " results in " + parts.length + " segments");
logDebug("share is " + parts[1]);
result.share = parts[1];
if (parts.length > 2) {
result.oneDrivePath = parts[2];
}
return result; return result;
} }
private Exception convertException(ClientException e) { private Exception convertException(ClientException e) {
if (e.isError(GraphErrorCodes.ItemNotFound)) Log.d(TAG, "received exception.");
return new FileNotFoundException(e.getMessage()); if (e instanceof GraphServiceException)
if (e.getMessage().contains("\n\n404 : ")) //hacky solution to check for not found. errorCode was null in my tests so I had to find a workaround. {
Log.d(TAG, "exception is GraphServiceException. " + ((GraphServiceException) e).getResponseCode());
if ((((GraphServiceException) e).getResponseCode() == 404
|| ((GraphServiceException)e).getServiceError().isError(GraphErrorCodes.ITEM_NOT_FOUND)))
return new FileNotFoundException(e.getMessage()); return new FileNotFoundException(e.getMessage());
}
return e; return e;
} }
@@ -290,9 +348,8 @@ public class OneDriveStorage2 extends JavaFileStorageBase
public void uploadFile(String path, byte[] data, boolean writeTransactional) throws Exception { public void uploadFile(String path, byte[] data, boolean writeTransactional) throws Exception {
try { try {
ClientAndPath clientAndPath = getOneDriveClientAndPath(path); ClientAndPath clientAndPath = getOneDriveClientAndPath(path);
clientAndPath clientAndPath.getPathItem()
.getPathItem() .content()
.getContent()
.buildRequest() .buildRequest()
.put(data); .put(data);
} catch (ClientException e) { } catch (ClientException e) {
@@ -313,7 +370,7 @@ public class OneDriveStorage2 extends JavaFileStorageBase
logDebug("building request for " + clientAndPath.oneDrivePath); logDebug("building request for " + clientAndPath.oneDrivePath);
DriveItem res = clientAndPath.getPathItem() DriveItem res = clientAndPath.getPathItem()
.getChildren() .children()
.buildRequest() .buildRequest()
.post(driveItem); .post(driveItem);
return createFilePath(parentPath, newDirName); return createFilePath(parentPath, newDirName);
@@ -332,82 +389,22 @@ public class OneDriveStorage2 extends JavaFileStorageBase
return path; return path;
} }
private List<FileEntry> listShares(String parentPath, IGraphServiceClient client) throws Exception {
ArrayList<FileEntry> result = new ArrayList<FileEntry>();
logDebug("listShares: " + (client == null));
if (!parentPath.endsWith("/"))
parentPath += "/";
logDebug("listShares");
FileEntry myEntry = getFileEntry(parentPath+"me/", client.getMe().getDrive().getRoot().buildRequest().get());
//if ((myEntry.displayName == null) || "".equals(myEntry.displayName))
myEntry.displayName = "My OneDrive";
logDebug("myEntry.path = " + myEntry.path + ", isDir = " + myEntry.isDirectory);
result.add(myEntry);
IDriveSharedWithMeCollectionPage sharedWithMeCollectionPage = client.getMe().getDrive().getSharedWithMe().buildRequest().get();
while (true) {
List<DriveItem> sharedWithMeItems = sharedWithMeCollectionPage.getCurrentPage();
if (sharedWithMeItems.isEmpty())
break;
for (DriveItem i : sharedWithMeItems) {
Log.d("kp2aSHARE",i.name + " " + i.description + " " + i.id + " " + i.webUrl);
String urlToEncode = i.webUrl;
//calculate shareid according to https://docs.microsoft.com/en-us/graph/api/shares-get?view=graph-rest-1.0&tabs=java
String shareId = "u!"+android.util.Base64.encodeToString(urlToEncode.getBytes(), Base64.NO_PADDING).replace('/','_').replace('+','_')
.replace("\n",""); //encodeToString adds a newline character add the end - remove
Log.d("kp2aSHARE","shareId: " +shareId);
FileEntry sharedFileEntry = getFileEntry(parentPath + shareId +"/", i);
result.add(sharedFileEntry);
/*
try {
DriveItem x2 = client.shares(shareId).root().buildRequest().get();
Log.d("kp2aSHARE","x2: " + x2.name + " " + x2.description + " " + x2.id + " ");
}
catch (ClientException e)
{
if (e.getCause() != null)
Log.d("kp2aSHARE","cause: " + e.getCause().toString());
Log.d("kp2aSHARE","exception: " + e.toString());
}
catch (Exception e)
{
Log.d("kp2aSHARE","share item exc: " + e.toString());
}
*/
}
IDriveSharedWithMeCollectionRequestBuilder b = sharedWithMeCollectionPage.getNextPage();
if (b == null) break;
sharedWithMeCollectionPage =b.buildRequest().get();
}
return result;
}
@Override @Override
public List<FileEntry> listFiles(String parentPath) throws Exception { public List<FileEntry> listFiles(String parentPath) throws Exception {
try { try {
ClientAndPath clientAndPath = getOneDriveClientAndPath(parentPath); ClientAndPath clientAndPath = getOneDriveClientAndPath(parentPath);
logDebug("listing files for " + parentPath +", " + clientAndPath.share + clientAndPath.hasShare());
if (!clientAndPath.hasShare()) if (!clientAndPath.hasShare())
{ {
logDebug("listing shares.");
return listShares(parentPath, clientAndPath.client); return listShares(parentPath, clientAndPath.client);
} }
logDebug("listing regular children.");
ArrayList<FileEntry> result = new ArrayList<FileEntry>(); ArrayList<FileEntry> result = new ArrayList<FileEntry>();
/*logDebug("parent before:" + parentPath); parentPath = clientAndPath.oneDrivePath;
parentPath = parentPath.substring(getProtocolPrefix().length());
logDebug("parent after: " + parentPath);*/
IDriveItemCollectionPage itemsPage = clientAndPath.getPathItem() IDriveItemCollectionPage itemsPage = clientAndPath.getPathItem()
.getChildren() .children()
.buildRequest() .buildRequest()
.get(); .get();
if (parentPath.endsWith("/")) if (parentPath.endsWith("/"))
@@ -435,6 +432,59 @@ public class OneDriveStorage2 extends JavaFileStorageBase
} }
} }
private List<FileEntry> listShares(String parentPath, IGraphServiceClient client) throws Exception {
ArrayList<FileEntry> result = new ArrayList<FileEntry>();
logDebug("listShares: " + (client == null));
if (!parentPath.endsWith("/"))
parentPath += "/";
logDebug("listShares");
FileEntry myEntry = getFileEntry(parentPath+"me", client.me().drive().root().buildRequest().get());
if ((myEntry.displayName == null) || "".equals(myEntry.displayName))
myEntry.displayName = "My OneDrive";
result.add(myEntry);
IDriveSharedWithMeCollectionPage sharedWithMeCollectionPage = client.me().drive().sharedWithMe().buildRequest().get();
while (true) {
List<DriveItem> sharedWithMeItems = sharedWithMeCollectionPage.getCurrentPage();
if (sharedWithMeItems.isEmpty())
break;
for (DriveItem i : sharedWithMeItems) {
Log.d("kp2aSHARE",i.name + " " + i.description + " " + i.id + " " + i.webUrl);
String urlToEncode = i.webUrl;
//calculate shareid according to https://docs.microsoft.com/en-us/graph/api/shares-get?view=graph-rest-1.0&tabs=java
String shareId = "u!"+android.util.Base64.encodeToString(urlToEncode.getBytes(), Base64.NO_PADDING).replace('/','_').replace('+','_')
.replace("\n",""); //encodeToString adds a newline character add the end - remove
Log.d("kp2aSHARE","shareId: " +shareId);
FileEntry sharedFileEntry = getFileEntry(parentPath + shareId, i);
result.add(sharedFileEntry);
/*
try {
DriveItem x2 = client.shares(shareId).root().buildRequest().get();
Log.d("kp2aSHARE","x2: " + x2.name + " " + x2.description + " " + x2.id + " ");
}
catch (ClientException e)
{
if (e.getCause() != null)
Log.d("kp2aSHARE","cause: " + e.getCause().toString());
Log.d("kp2aSHARE","exception: " + e.toString());
}
catch (Exception e)
{
Log.d("kp2aSHARE","share item exc: " + e.toString());
}
*/
}
IDriveSharedWithMeCollectionRequestBuilder b = sharedWithMeCollectionPage.getNextPage();
if (b == null) break;
sharedWithMeCollectionPage =b.buildRequest().get();
}
return result;
}
private FileEntry getFileEntry(String path, DriveItem i) { private FileEntry getFileEntry(String path, DriveItem i) {
FileEntry e = new FileEntry(); FileEntry e = new FileEntry();
if (i.size != null) if (i.size != null)
@@ -458,16 +508,6 @@ public class OneDriveStorage2 extends JavaFileStorageBase
try { try {
ClientAndPath clientAndPath = getOneDriveClientAndPath(filename); ClientAndPath clientAndPath = getOneDriveClientAndPath(filename);
if (((clientAndPath.oneDrivePath == null) || "".equals(clientAndPath.oneDrivePath))
&& !clientAndPath.hasShare())
{
FileEntry rootEntry = new FileEntry();
rootEntry.displayName = "";
rootEntry.isDirectory = true;
return rootEntry;
}
IDriveItemRequestBuilder pathItem = clientAndPath.getPathItem(); IDriveItemRequestBuilder pathItem = clientAndPath.getPathItem();
IDriveItemRequest request = pathItem.buildRequest(); IDriveItemRequest request = pathItem.buildRequest();
@@ -493,120 +533,70 @@ public class OneDriveStorage2 extends JavaFileStorageBase
boolean acquireTokenRunning = false; boolean acquireTokenRunning = false;
@Override @Override
public void onStart(final FileStorageSetupActivity activity) { public void onStart(final FileStorageSetupActivity activity) {
Log.d("KP2AJ", "onStart " + activity.getPath()); logDebug( "onStart " + activity.getPath());
if (activity.getProcessName().equals(PROCESS_NAME_SELECTFILE)) if (activity.getProcessName().equals(PROCESS_NAME_SELECTFILE))
activity.getState().putString(EXTRA_PATH, activity.getPath()); activity.getState().putString(EXTRA_PATH, activity.getPath());
String userId = activity.getState().getString("OneDriveUser");
User user = null;
try {
String userId = extractUserId(activity.getPath());
if (mClientByUser.containsKey(userId)) { if (mClientByUser.containsKey(userId)) {
finishActivityWithSuccess(activity); finishActivityWithSuccess(activity);
return; return;
} }
logDebug("needs acquire token");
Log.d("KP2AJ", "trying silent login " + activity.getPath()); JavaFileStorage.FileStorageSetupActivity storageSetupAct = activity;
final MsalException[] _exception = {null}; final CountDownLatch latch = new CountDownLatch(1);
final AuthenticationResult[] _result = {null}; final AuthenticationResult[] _authenticationResult = {null};
logDebug("getting user for " + userId); MsalException _exception[] = {null};
user = mPublicClientApp.getUser(userId);
logDebug("getting user ok.");
} catch (Exception e) {
logDebug(e.toString());
e.printStackTrace();
}
if (user != null)
{
mPublicClientApp.acquireTokenSilentAsync(scopes, user,
new AuthenticationCallback() {
@Override
public void onSuccess(AuthenticationResult authenticationResult) {
successAuthCallback(authenticationResult, activity);
}
@Override
public void onError(MsalException exception) {
startInteractiveAcquireToken(activity);
}
@Override
public void onCancel() {
cancelAuthCallback((Activity) activity);
}
});
return;
}
startInteractiveAcquireToken(activity);
}
private void startInteractiveAcquireToken(FileStorageSetupActivity activity) {
if (!acquireTokenRunning) { if (!acquireTokenRunning) {
acquireTokenRunning = true; acquireTokenRunning = true;
mPublicClientApp.acquireToken((Activity) activity, scopes, new AuthenticationCallback() { mPublicClientApp.acquireToken((Activity) activity, scopes, new AuthenticationCallback() {
@Override @Override
public void onSuccess(AuthenticationResult authenticationResult) { public void onSuccess(AuthenticationResult authenticationResult) {
successAuthCallback(authenticationResult, activity); logDebug( "authenticating successful");
try {
buildClient(authenticationResult);
} catch (InterruptedException e) {
e.printStackTrace();
}
activity.getState().putString(EXTRA_PATH, getProtocolPrefix() + authenticationResult.getAccount().getHomeAccountIdentifier().getIdentifier() + "/");
finishActivityWithSuccess(activity);
acquireTokenRunning = false;
return;
} }
@Override @Override
public void onError(MsalException exception) { public void onError(MsalException exception) {
errorAuthCallback((Activity) activity); logDebug( "authenticating not successful");
Intent data = new Intent();
data.putExtra(EXTRA_ERROR_MESSAGE, "authenticating not successful");
((Activity) activity).setResult(Activity.RESULT_CANCELED, data);
((Activity) activity).finish();
acquireTokenRunning = false;
} }
@Override @Override
public void onCancel() { public void onCancel() {
cancelAuthCallback((Activity) activity); logDebug( "authenticating cancelled");
Intent data = new Intent();
data.putExtra(EXTRA_ERROR_MESSAGE, "authenticating cancelled");
((Activity) activity).setResult(Activity.RESULT_CANCELED, data);
((Activity) activity).finish();
acquireTokenRunning = false;
} }
}); });
} }
} }
private void successAuthCallback(AuthenticationResult authenticationResult, FileStorageSetupActivity activity) {
Log.i(TAG, "authenticating successful");
try {
buildClient(authenticationResult);
} catch (Exception e) {
logDebug(e.toString());
e.printStackTrace();
}
activity.getState().putString(EXTRA_PATH, getProtocolPrefix() + authenticationResult.getUser().getUserIdentifier() + "/");
finishActivityWithSuccess(activity);
acquireTokenRunning = false;
}
private void errorAuthCallback(Activity activity) {
Log.i(TAG, "authenticating not successful");
Intent data = new Intent();
data.putExtra(EXTRA_ERROR_MESSAGE, "authenticating not successful");
activity.setResult(Activity.RESULT_CANCELED, data);
activity.finish();
acquireTokenRunning = false;
}
private void cancelAuthCallback(Activity activity) {
Log.i(TAG, "authenticating cancelled");
Intent data = new Intent();
data.putExtra(EXTRA_ERROR_MESSAGE, "authenticating not cancelled");
activity.setResult(Activity.RESULT_CANCELED, data);
activity.finish();
acquireTokenRunning = false;
}
@Override @Override
public void onActivityResult(FileStorageSetupActivity activity, int requestCode, int resultCode, Intent data) { public void onActivityResult(FileStorageSetupActivity activity, int requestCode, int resultCode, Intent data) {
logDebug( "handleInteractiveRequestRedirect");
mPublicClientApp.handleInteractiveRequestRedirect(requestCode, resultCode, data); mPublicClientApp.handleInteractiveRequestRedirect(requestCode, resultCode, data);
} }
} }

View File

@@ -55,6 +55,11 @@ namespace keepass2android
//this is there for legacy reasons, new protocol is onedrive //this is there for legacy reasons, new protocol is onedrive
_displayedProtocolIds.Remove("skydrive"); _displayedProtocolIds.Remove("skydrive");
//onedrive was replaced by onedrive2 in a later implementation, but we still have the previous implementation to open existing connections (without the need to re-authenticate etc.)
_displayedProtocolIds.Remove("onedrive");
//special handling for local files: //special handling for local files:
if (!Util.IsKitKatOrLater) if (!Util.IsKitKatOrLater)
{ {

View File

@@ -12,7 +12,14 @@
<uses-library <uses-library
android:name="org.apache.http.legacy" android:name="org.apache.http.legacy"
android:required="false"/> android:required="false"/>
<activity android:name="microsoft.identity.client.BrowserTabActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="msal8374f801-0f55-407d-80cc-9a04fe86d9b2" android:host="auth" />
</intent-filter>
</activity>
<activity android:name="com.dropbox.core.android.AuthActivity" android:launchMode="singleTask" android:configChanges="orientation|keyboard"> <activity android:name="com.dropbox.core.android.AuthActivity" android:launchMode="singleTask" android:configChanges="orientation|keyboard">
<intent-filter> <intent-filter>
<data android:scheme="db-2gormiq7iq1jls1" /> <data android:scheme="db-2gormiq7iq1jls1" />

View File

@@ -19,6 +19,14 @@
android:name="org.apache.http.legacy" android:name="org.apache.http.legacy"
android:required="false"/> android:required="false"/>
<activity android:name="microsoft.identity.client.BrowserTabActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="msal8374f801-0f55-407d-80cc-9a04fe86d9b2" android:host="auth" />
</intent-filter>
</activity>
<activity android:name="com.dropbox.core.android.AuthActivity" android:launchMode="singleTask" android:configChanges="orientation|keyboard"> <activity android:name="com.dropbox.core.android.AuthActivity" android:launchMode="singleTask" android:configChanges="orientation|keyboard">
<intent-filter> <intent-filter>
<data android:scheme="db-i8shu7v1hgh7ynt" /> <data android:scheme="db-i8shu7v1hgh7ynt" />

View File

@@ -552,6 +552,7 @@
<string name="filestoragename_pcloud">PCloud</string> <string name="filestoragename_pcloud">PCloud</string>
<string name="filestoragehelp_pcloud">This storage type will only request access to the "Applications/Keepass2Android" folder. If you want to use an existing database from your PCloud account, please make sure the file is placed in this folder.</string> <string name="filestoragehelp_pcloud">This storage type will only request access to the "Applications/Keepass2Android" folder. If you want to use an existing database from your PCloud account, please make sure the file is placed in this folder.</string>
<string name="filestoragename_onedrive">OneDrive</string> <string name="filestoragename_onedrive">OneDrive</string>
<string name="filestoragename_onedrive2">OneDrive</string>
<string name="filestoragename_sftp">SFTP (SSH File Transfer)</string> <string name="filestoragename_sftp">SFTP (SSH File Transfer)</string>
<string name="filestoragename_content">System file picker</string> <string name="filestoragename_content">System file picker</string>

View File

@@ -688,6 +688,7 @@ namespace keepass2android
new DropboxAppFolderFileStorage(Application.Context, this), new DropboxAppFolderFileStorage(Application.Context, this),
new GoogleDriveFileStorage(Application.Context, this), new GoogleDriveFileStorage(Application.Context, this),
new OneDriveFileStorage(Application.Context, this), new OneDriveFileStorage(Application.Context, this),
new OneDrive2FileStorage(),
new SftpFileStorage(Application.Context, this), new SftpFileStorage(Application.Context, this),
new NetFtpFileStorage(Application.Context, this), new NetFtpFileStorage(Application.Context, this),
new WebDavFileStorage(this), new WebDavFileStorage(this),