Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Redth committed Apr 29, 2020
1 parent 50af23b commit 61c1abf
Show file tree
Hide file tree
Showing 96 changed files with 22,332 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Certificates/sample.exposurenotification.xamarin.com.cert
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-----BEGIN CERTIFICATE-----
MIIDKzCCAhOgAwIBAgIJAOcPwki3xLfvMA0GCSqGSIb3DQEBBQUAMCwxKjAoBgNV
BAMMIXNhbXBsZS5jb250YWN0dHJhY2luZy54YW1hcmluLmNvbTAeFw0yMDA0MjMx
MzE5NThaFw0zMDA0MjExMzE5NThaMCwxKjAoBgNVBAMMIXNhbXBsZS5jb250YWN0
dHJhY2luZy54YW1hcmluLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
ggEBAJjMBMZQKZ37AWWR85SuiyRBmarE8bhhEoEhZ09vf2ul+ppiQ+jEtnVk3qB3
USStiTDlvrS/mxcKNX0hdcfLkDR1+unDH0izosVBLF3gSxgayKKMPxFm1870Cfun
0fOdOWAudUbe2sXFpEowxGAvRds+i3jlf9T9L5yi/FD1XIj7CQwm4oyrVoMj6728
+xhp1KLz+x+PIVK4TvfAkcHQWynwMXQrvkQ7NgiEp7Wj6ZaxjPJCAgbn8+L7S0U0
EO8ouVUsf1r4HUdmqphi0TBrTLmo27r26fNr4TcfUs+N6VP7jF+iKNaPr3x6xhLE
szgQBYSbLglZsjvPCrhaRQsFuVECAwEAAaNQME4wHQYDVR0OBBYEFJFL5dCPantW
GrC//hpZm1N++jGRMB8GA1UdIwQYMBaAFJFL5dCPantWGrC//hpZm1N++jGRMAwG
A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAsTOUDBVhRK0I+p7ScyBrT3
M2h/9vZeV+FzXlCw/luajEu01CTU0OlmiFWcz7UUbWBF3OeoCT/yXcLMjYgfLzce
o1U5OmYumtdNg8vUU2A2QShpcjl+mAWhkKYNVKoYoDSTwMJejfVSJy48QVti6ffz
ipx0pHuTsSAJ7sLdSGkAa+u0e8QkYmtQpG3sI+cvJA3Re5Zf9XZT4vUqTR7v1dmY
vEbYDPbGb1GKcuWiFdYVRg8eHsUUbgxdYa9PwxcLS5PsDm1T9AL+x5qZtVNPiVEs
3fZ5aIYiBFO9BTJDbppSfv2okppnj947pnzvQdw9r7RsIJ0E3FQuU4zbFPEqevI=
-----END CERTIFICATE-----
27 changes: 27 additions & 0 deletions Certificates/sample.exposurenotification.xamarin.com.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAmMwExlApnfsBZZHzlK6LJEGZqsTxuGESgSFnT29/a6X6mmJD
6MS2dWTeoHdRJK2JMOW+tL+bFwo1fSF1x8uQNHX66cMfSLOixUEsXeBLGBrIoow/
EWbXzvQJ+6fR8505YC51Rt7axcWkSjDEYC9F2z6LeOV/1P0vnKL8UPVciPsJDCbi
jKtWgyPrvbz7GGnUovP7H48hUrhO98CRwdBbKfAxdCu+RDs2CISntaPplrGM8kIC
Bufz4vtLRTQQ7yi5VSx/WvgdR2aqmGLRMGtMuajbuvbp82vhNx9Sz43pU/uMX6Io
1o+vfHrGEsSzOBAFhJsuCVmyO88KuFpFCwW5UQIDAQABAoIBAQCQ4uSkJ99OrnTk
m0Ed+2R1PL857wZGj8W8LLCJ4nAw43J+ci9yyRU6vCtefcWzwdoVQ8VSH14wur19
qfzFN4HGPRlwEFXZ2ny+Ds7DNav/b2ZQvCwRlDOPSlktCDVNjAib63HJgghxALiI
oTWU/z5+ZxBZ00Uj8fDz1pjrK75TJECZmtHx2+87Y1THLp/suYwOAC2wS4f0TI3f
b4QQm6NSefSVQwXDNcTN3770CXVqmELSPKeq3QyHZNOeH1196hp9LhyKpaU0JyLv
35bJDHvf1gSVjeXI6tCCR/KRbnlRUECkmK8VrKIytWQxHwBnIq0GkCDcELJMj92i
eVsj/gMBAoGBAMbTh4f/eE7tkcHvDYUb+DJUKMnAoopCJwma2RFrpktcFPFGdC4+
uOp0nSLBGE9PplWJaZ8DU7SKaexLNpfVh4eFWGmSqJUa1Gfa6KzvowTZ+Hxp0AAw
pylPF6beaKxaKWfvt5Amq2FTk52q+ljFlF4/K05zVNppimFZYNY6mWV/AoGBAMS8
EZi4P4xdmgGO3n4L5OB/QQ9sqWRyCCqNsIRKbuxJHz4BuQh7YIP7oVY1XhW2gnX7
bzedAGCtyScSTJW3hazFxkUBP8ebQG93EsPa3quc6bJzFg8awfooyTvJuePdTsXV
lE2e54CmkJZzYLDl0LpY9WEeHp8EWhtSfQB9RWkvAoGBAJ/ruiKIOFN7wHY1ejFr
WsnYaWpFeDcumEmgdCIP7RTGPs4GNiKQLpneLBmtKIl6bjZ0rTDKM0SO5D28DXA4
vqcheQiJfvFXQCs8p1OZ+AxJ6hTf4v6UI5AVXtfIIncmmhFQfdwDTmudFqmFwZEv
cnQP6RxTpZd7tmMwybPmNEWvAoGAB0FsYLaC2XlmQaJ0QC/OHB11V81JHgQ6mt8o
4GgiWSKFPXMw0MhEEfoIxDYppyFZBGLmgiWPKwGdxowdOPRQwMN2gXr/UCxAnxvE
HGcJCUk7MTKfYKU6/C/e5A6XhXjW++LZmlc+8Ha0JGhS65M+NHEtc4x50qGFdTaA
l7EHC08CgYBY7hr+EgcLibLgpn7Ez/UHxMoLUMLnTgju9MKK4s/oUgXyYDPyxZJ/
OeUnvfXcextNh2B+UkuyEgp735K4kH/8ygPV+JMK3jbJBL8z844gTdGfXM737dF0
9beIZ26FqtyU906ki5T12GIjl145gi4E2G+akfo1nKFtBeSAtp87kg==
-----END RSA PRIVATE KEY-----
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Any raw assets you want to be deployed with your application can be placed in
this directory (and child directories) and given a Build Action of "AndroidAsset".

These files will be deployed with your package and will be accessible using Android's
AssetManager, like this:

public class ReadAsset : Activity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);

InputStream input = Assets.Open ("my_asset.txt");
}
}

Additionally, some Android functions will automatically load asset files:

Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{4F880B27-5839-4214-8AB1-4BBDD780A783}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TemplateGuid>{c9e5eea5-ca05-42a1-839b-61506e0a37df}</TemplateGuid>
<OutputType>Library</OutputType>
<RootNamespace>ExposureNotification.App.Droid</RootNamespace>
<AssemblyName>ExposureNotification.App.Android</AssemblyName>
<Deterministic>True</Deterministic>
<AndroidApplication>True</AndroidApplication>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidResgenClass>Resource</AndroidResgenClass>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
<AndroidUseAapt2>true</AndroidUseAapt2>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidManagedSymbols>true</AndroidManagedSymbols>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Acr.UserDialogs">
<Version>7.1.0.442</Version>
</PackageReference>
<PackageReference Include="System.Text.Json">
<Version>4.7.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.5.0.657" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.1" />
<PackageReference Include="Xamarin.Forms.Visual.Material">
<Version>4.5.0.657</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
<Compile Include="Resources\Resource.designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\AboutResources.txt" />
<None Include="Assets\AboutAssets.txt" />
<None Include="Properties\AndroidManifest.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\layout\Tabbar.xml" />
<AndroidResource Include="Resources\layout\Toolbar.xml" />
<AndroidResource Include="Resources\values\styles.xml" />
<AndroidResource Include="Resources\values\colors.xml" />
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon.xml" />
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon_round.xml" />
<AndroidResource Include="Resources\mipmap-hdpi\icon.png" />
<AndroidResource Include="Resources\mipmap-hdpi\launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-mdpi\icon.png" />
<AndroidResource Include="Resources\mipmap-mdpi\launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xhdpi\icon.png" />
<AndroidResource Include="Resources\mipmap-xhdpi\launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xxhdpi\icon.png" />
<AndroidResource Include="Resources\mipmap-xxhdpi\launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xxxhdpi\icon.png" />
<AndroidResource Include="Resources\mipmap-xxxhdpi\launcher_foreground.png" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\drawable\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\ExposureNotification.Core\ExposureNotification.Core.csproj">
<Project>{6ddc5dce-9b68-45ac-8b7a-a010167e1343}</Project>
<Name>ExposureNotification.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\Xamarin.ExposureNotification\Xamarin.ExposureNotification.csproj">
<Project>{455bd53e-c845-4530-be1f-27e871c256fe}</Project>
<Name>Xamarin.ExposureNotification</Name>
</ProjectReference>
<ProjectReference Include="..\ExposureNotification.App\ExposureNotification.App.csproj">
<Project>{D2A09F84-0478-4932-91B8-5F50D0CA9345}</Project>
<Name>ExposureNotification.App</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System;

using Android.App;
using Android.Content.PM;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using Acr.UserDialogs;

namespace ExposureNotification.App.Droid
{
[Activity(Label = "Contact Tracing", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
protected override void OnCreate(Bundle savedInstanceState)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;

base.OnCreate(savedInstanceState);

Xamarin.Essentials.Platform.Init(this, savedInstanceState);
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
global::Xamarin.Forms.FormsMaterial.Init(this, savedInstanceState);

UserDialogs.Init(this);

LoadApplication(new App());
}
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
{
Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);

base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +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.companyname.ExposureNotification.app">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
<application android:label="ExposureNotification.App.Android"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Android.App;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ExposureNotification.App.Android")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ExposureNotification.App.Android")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

// Add some common permissions, these can be removed if not needed
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Images, layout descriptions, binary blobs and string dictionaries can be included
in your application as resource files. Various Android APIs are designed to
operate on the resource IDs instead of dealing with images, strings or binary blobs
directly.

For example, a sample Android app that contains a user interface layout (main.xml),
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
would keep its resources in the "Resources" directory of the application:

Resources/
drawable-hdpi/
icon.png

drawable-ldpi/
icon.png

drawable-mdpi/
icon.png

layout/
main.xml

values/
strings.xml

In order to get the build system to recognize Android resources, set the build action to
"AndroidResource". The native Android APIs do not operate directly with filenames, but
instead operate on resource IDs. When you compile an Android application that uses resources,
the build system will package the resources for distribution and generate a class called
"Resource" that contains the tokens for each one of the resources included. For example,
for the above Resources layout, this is what the Resource class would expose:

public class Resource {
public class drawable {
public const int icon = 0x123;
}

public class layout {
public const int main = 0x456;
}

public class strings {
public const int first_string = 0xabc;
public const int second_string = 0xbcd;
}
}

You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
string in the dictionary file values/strings.xml.
Loading

0 comments on commit 61c1abf

Please sign in to comment.