Skip to content
This repository was archived by the owner on Apr 29, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions WebServices/TodoREST/Droid/HttpClientHandlerService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System.Net.Http;
using TodoREST.Droid;
using Xamarin.Forms;

[assembly: Dependency(typeof(HttpClientHandlerService))]
namespace TodoREST.Droid
{
public class HttpClientHandlerService : IHttpClientHandlerService
{
public HttpClientHandler GetInsecureHandler()
{
HttpClientHandler handler = new HttpClientHandler();
handler.ServerCertificateCustomValidationCallback = (message, cert, chain, errors) =>
{
if (cert.Issuer.Equals("CN=localhost"))
return true;
return errors == System.Net.Security.SslPolicyErrors.None;
};
return handler;
}
}
}
9 changes: 0 additions & 9 deletions WebServices/TodoREST/Droid/MainActivity.cs
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ protected override void OnCreate(Bundle bundle)
Instance = this;
global::Xamarin.Forms.Forms.Init(this, bundle);

#if DEBUG
System.Net.ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) =>
{
if (certificate.Issuer.Equals("CN=localhost"))
return true;
return sslPolicyErrors == System.Net.Security.SslPolicyErrors.None;
};
#endif

LoadApplication(new App());
}
}
Expand Down
2 changes: 1 addition & 1 deletion WebServices/TodoREST/Droid/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?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.companyname.todorest">
<uses-sdk android:minSdkVersion="19" />
<uses-sdk android:minSdkVersion="21" />
<application android:label="TodoREST"></application>
</manifest>
2 changes: 1 addition & 1 deletion WebServices/TodoREST/Droid/Resources/Resource.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file modified WebServices/TodoREST/Droid/Resources/layout/Tabbar.axml
100755 → 100644
Empty file.
Empty file modified WebServices/TodoREST/Droid/Resources/layout/Toolbar.axml
100755 → 100644
Empty file.
Empty file modified WebServices/TodoREST/Droid/Resources/values/colors.xml
100755 → 100644
Empty file.
Empty file modified WebServices/TodoREST/Droid/Resources/values/styles.xml
100755 → 100644
Empty file.
16 changes: 10 additions & 6 deletions WebServices/TodoREST/Droid/TodoREST.Droid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
<ConsolePause>false</ConsolePause>
<AndroidHttpClientHandlerType>System.Net.Http.HttpClientHandler</AndroidHttpClientHandlerType>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
<AndroidTlsProvider>btls</AndroidTlsProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>portable</DebugType>
Expand All @@ -39,18 +40,19 @@
<WarningLevel>4</WarningLevel>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
<ConsolePause>false</ConsolePause>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
<IntermediateOutputPath></IntermediateOutputPath>
<ExternalConsole>false</ExternalConsole>
<Commandlineparameters></Commandlineparameters>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms">
<Version>4.5.0.396</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.5.0.396" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Mono.Android" />
<Reference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TodoREST\TodoREST.csproj">
Expand All @@ -62,8 +64,10 @@
<Compile Include="MainActivity.cs" />
<Compile Include="Resources\Resource.designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="HttpClientHandlerService.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Resources\AboutResources.txt" />
<None Include="Properties\AndroidManifest.xml" />
<None Include="Assets\AboutAssets.txt" />
Expand All @@ -88,4 +92,4 @@
<AndroidResource Include="Resources\values\colors.xml" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
</Project>
</Project>
11 changes: 11 additions & 0 deletions WebServices/TodoREST/Droid/app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.0.0" newVersion="1.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
Expand All @@ -7,7 +8,6 @@
"sslPort": 44300
}
},
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
Expand Down
5 changes: 4 additions & 1 deletion WebServices/TodoREST/TodoAPI/TodoAPI/TodoAPI.csproj
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.App">
<PrivateAssets Condition="'%(PackageReference.Version)' == ''">all</PrivateAssets>
<Publish Condition="'%(PackageReference.Version)' == ''">true</Publish>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.1.2" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.1" />
</ItemGroup>
Expand Down
Loading