From bf7029c7f643026b06fc45b2e402c61aa8a16e5a Mon Sep 17 00:00:00 2001 From: Travis Walker Date: Fri, 19 Jan 2024 15:00:00 -0800 Subject: [PATCH 01/17] Resolving missing test issue in classic pipeline (#4526) Updating value for classic test run --- build/template-run-integration-tests.yaml | 2 +- build/template-run-unit-tests.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/template-run-integration-tests.yaml b/build/template-run-integration-tests.yaml index 3cfb9758cc..81ffa8cbdf 100644 --- a/build/template-run-integration-tests.yaml +++ b/build/template-run-integration-tests.yaml @@ -5,7 +5,7 @@ steps: - task: VSTest@2 displayName: 'Run integration tests (.NET FX)' - condition: and(succeeded(), eq(variables['PipelineType'], '')) + condition: and(succeeded(), eq(variables['PipelineType'], 'legacy')) inputs: testSelector: 'testAssemblies' testAssemblyVer2: '**\Microsoft.Identity.Test.Integration.netfx\bin\**\Microsoft.Identity.Test.Integration.NetFx.dll' diff --git a/build/template-run-unit-tests.yaml b/build/template-run-unit-tests.yaml index e88dd6f107..ebaed2c966 100644 --- a/build/template-run-unit-tests.yaml +++ b/build/template-run-unit-tests.yaml @@ -8,7 +8,7 @@ steps: - task: VSTest@2 displayName: 'Run unit tests (.NET FX)' - condition: and(succeeded(), eq(variables['PipelineType'], '')) + condition: and(succeeded(), eq(variables['PipelineType'], 'legacy')) inputs: testSelector: 'testAssemblies' testAssemblyVer2: '**\Microsoft.Identity.Test.Unit\bin\**\net4*\Microsoft.Identity.Test.Unit.dll' From aacbebf02e5a6a85923f98a0c1cf06a46348b0f5 Mon Sep 17 00:00:00 2001 From: Bogdan Gavril Date: Tue, 23 Jan 2024 18:19:35 +0200 Subject: [PATCH 02/17] Remove unusused int tests (#4568) --- LibsAndSamples.sln | 45 -------------- .../Properties/InternalsVisibleTo.cs | 1 - .../BrokerOnWin8Tests.cs | 27 --------- .../DeviceAuthenticationTests.cs | 59 ------------------- ...soft.Identity.Test.Integration.Win8.csproj | 46 --------------- 5 files changed, 178 deletions(-) delete mode 100644 tests/Microsoft.Identity.Test.Integration.Win8/BrokerOnWin8Tests.cs delete mode 100644 tests/Microsoft.Identity.Test.Integration.Win8/DeviceAuthenticationTests.cs delete mode 100644 tests/Microsoft.Identity.Test.Integration.Win8/Microsoft.Identity.Test.Integration.Win8.csproj diff --git a/LibsAndSamples.sln b/LibsAndSamples.sln index 973efa4eda..b74586eb3e 100644 --- a/LibsAndSamples.sln +++ b/LibsAndSamples.sln @@ -113,8 +113,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pipelines", "pipelines", "{ build\template-sign-binary.yaml = build\template-sign-binary.yaml EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Identity.Test.Integration.Win8", "tests\Microsoft.Identity.Test.Integration.Win8\Microsoft.Identity.Test.Integration.Win8.csproj", "{B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Identity.Test.Unit", "tests\Microsoft.Identity.Test.Unit\Microsoft.Identity.Test.Unit.csproj", "{4A249A54-D81D-4C1F-9DB2-0D60FA4BE794}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WAM", "WAM", "{5FAAD966-36B8-4C19-A5FA-5410DD53063D}" @@ -866,48 +864,6 @@ Global {2EBB7FFE-47E0-46F8-A4D6-79A4CF44729C}.Release|x64.Build.0 = Release|Any CPU {2EBB7FFE-47E0-46F8-A4D6-79A4CF44729C}.Release|x86.ActiveCfg = Release|Any CPU {2EBB7FFE-47E0-46F8-A4D6-79A4CF44729C}.Release|x86.Build.0 = Release|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug + MobileApps|Any CPU.ActiveCfg = Debug + MobileApps|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug + MobileApps|Any CPU.Build.0 = Debug + MobileApps|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug + MobileApps|ARM.ActiveCfg = Debug + MobileApps|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug + MobileApps|ARM.Build.0 = Debug + MobileApps|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug + MobileApps|ARM64.ActiveCfg = Debug + MobileApps|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug + MobileApps|ARM64.Build.0 = Debug + MobileApps|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug + MobileApps|iPhone.ActiveCfg = Debug + MobileApps|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug + MobileApps|iPhone.Build.0 = Debug + MobileApps|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug + MobileApps|iPhoneSimulator.ActiveCfg = Debug + MobileApps|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug + MobileApps|iPhoneSimulator.Build.0 = Debug + MobileApps|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug + MobileApps|x64.ActiveCfg = Debug + MobileApps|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug + MobileApps|x64.Build.0 = Debug + MobileApps|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug + MobileApps|x86.ActiveCfg = Debug + MobileApps|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug + MobileApps|x86.Build.0 = Debug + MobileApps|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug|ARM.ActiveCfg = Debug|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug|ARM.Build.0 = Debug|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug|ARM64.Build.0 = Debug|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug|iPhone.Build.0 = Debug|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug|x64.ActiveCfg = Debug|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug|x64.Build.0 = Debug|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug|x86.ActiveCfg = Debug|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Debug|x86.Build.0 = Debug|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Release|Any CPU.Build.0 = Release|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Release|ARM.ActiveCfg = Release|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Release|ARM.Build.0 = Release|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Release|ARM64.ActiveCfg = Release|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Release|ARM64.Build.0 = Release|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Release|iPhone.ActiveCfg = Release|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Release|iPhone.Build.0 = Release|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Release|x64.ActiveCfg = Release|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Release|x64.Build.0 = Release|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Release|x86.ActiveCfg = Release|Any CPU - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C}.Release|x86.Build.0 = Release|Any CPU {4A249A54-D81D-4C1F-9DB2-0D60FA4BE794}.Debug + MobileApps|Any CPU.ActiveCfg = Debug + MobileApps|Any CPU {4A249A54-D81D-4C1F-9DB2-0D60FA4BE794}.Debug + MobileApps|Any CPU.Build.0 = Debug + MobileApps|Any CPU {4A249A54-D81D-4C1F-9DB2-0D60FA4BE794}.Debug + MobileApps|ARM.ActiveCfg = Debug + MobileApps|Any CPU @@ -2180,7 +2136,6 @@ Global {2EBB7FFE-47E0-46F8-A4D6-79A4CF44729C} = {384BA371-F17F-4A70-9423-D54F71BB3FCB} {384BA371-F17F-4A70-9423-D54F71BB3FCB} = {34BE693E-3496-45A4-B1D2-D3A0E068EEDB} {EA983957-DC2F-4D9E-A2E3-79ADEB5CEB26} = {E19B0572-BBD7-424E-81D5-E59E6884EB3A} - {B22B9B5D-9B2E-4B8F-8EDD-D706B4AA942C} = {9B0B5396-4D95-4C15-82ED-DC22B5A3123F} {4A249A54-D81D-4C1F-9DB2-0D60FA4BE794} = {9B0B5396-4D95-4C15-82ED-DC22B5A3123F} {5FAAD966-36B8-4C19-A5FA-5410DD53063D} = {34BE693E-3496-45A4-B1D2-D3A0E068EEDB} {F67DAC26-46A4-4695-B1ED-58B7D021D8BE} = {5FAAD966-36B8-4C19-A5FA-5410DD53063D} diff --git a/src/client/Microsoft.Identity.Client/Properties/InternalsVisibleTo.cs b/src/client/Microsoft.Identity.Client/Properties/InternalsVisibleTo.cs index fe2959e994..516144f759 100644 --- a/src/client/Microsoft.Identity.Client/Properties/InternalsVisibleTo.cs +++ b/src/client/Microsoft.Identity.Client/Properties/InternalsVisibleTo.cs @@ -7,7 +7,6 @@ [assembly: InternalsVisibleTo("Microsoft.Identity.Client.Desktop" + KeyTokens.MSAL)] [assembly: InternalsVisibleTo("Microsoft.Identity.Client.Broker" + KeyTokens.MSAL)] -[assembly: InternalsVisibleTo("Microsoft.Identity.Test.Integration.Win8" + KeyTokens.MSAL)] [assembly: InternalsVisibleTo("Microsoft.Identity.Test.Unit" + KeyTokens.MSAL)] [assembly: InternalsVisibleTo("Microsoft.Identity.Test.Common" + KeyTokens.MSAL)] [assembly: InternalsVisibleTo("Microsoft.Identity.Test.SideBySide" + KeyTokens.MSAL)] diff --git a/tests/Microsoft.Identity.Test.Integration.Win8/BrokerOnWin8Tests.cs b/tests/Microsoft.Identity.Test.Integration.Win8/BrokerOnWin8Tests.cs deleted file mode 100644 index fd4e3bb87f..0000000000 --- a/tests/Microsoft.Identity.Test.Integration.Win8/BrokerOnWin8Tests.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using Microsoft.Identity.Client; -#if !NET6_WIN -using Microsoft.Identity.Client.Broker; -#endif -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Microsoft.Identity.Test.Integration.Win8 -{ - [TestClass] - public class BrokerOnWin8Tests - { - [TestMethod] - public void WamOnWin8() - { - var pcaBuilder = PublicClientApplicationBuilder - .Create("d3adb33f-c0de-ed0c-c0de-deadb33fc0d3"); -#if !NET6_WIN - pcaBuilder = pcaBuilder.WithBroker(new BrokerOptions(BrokerOptions.OperatingSystems.Windows) { Title = "Only Windows" }); -#endif - - Assert.IsFalse(pcaBuilder.IsBrokerAvailable()); - } - } -} diff --git a/tests/Microsoft.Identity.Test.Integration.Win8/DeviceAuthenticationTests.cs b/tests/Microsoft.Identity.Test.Integration.Win8/DeviceAuthenticationTests.cs deleted file mode 100644 index e13c4bfe87..0000000000 --- a/tests/Microsoft.Identity.Test.Integration.Win8/DeviceAuthenticationTests.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Linq; -using System.Net; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Identity.Client; -using Microsoft.Identity.Client.PlatformsCommon.Shared; -using Microsoft.Identity.Test.Common; -using Microsoft.Identity.Test.LabInfrastructure; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Microsoft.Identity.Test.Integration.Win8 -{ - [TestClass] - public class DeviceAuthenticationTests - { - private const string _claims = "{\"access_token\":{\"deviceid\":{\"essential\":true}}}"; - private const string _deviceAuthuser = "idlabca@msidlab8.onmicrosoft.com"; - - [TestMethod] - public async Task PKeyAuthNonInteractiveTestAsync() - { - //Arrange - var labResponse = await LabUserHelper.GetSpecificUserAsync(_deviceAuthuser).ConfigureAwait(false); - var factory = new HttpSnifferClientFactory(); - var msalPublicClient = PublicClientApplicationBuilder - .Create(labResponse.App.AppId) - .WithAuthority("https://login.microsoftonline.com/organizations/") - .WithHttpClientFactory(factory) - .Build(); - - //Act - var authResult = msalPublicClient.AcquireTokenByUsernamePassword( - new[] { "user.read" }, - labResponse.User.Upn, - labResponse.User.GetOrFetchPassword()) - .WithClaims(_claims) - .ExecuteAsync(CancellationToken.None).Result; - - //Assert - Assert.IsNotNull(authResult); - Assert.IsNotNull(authResult.AccessToken); - Assert.IsNotNull(authResult.IdToken); - Assert.IsTrue(string.Equals(_deviceAuthuser, authResult.Account.Username, StringComparison.InvariantCultureIgnoreCase)); - - //Assert that the PKeyAuth header is used and the token response is successful - var (req, res) = factory.RequestsAndResponses - .Where(x => x.Item1.Headers.Authorization != null - && x.Item1.Headers.Authorization.Scheme.Contains(PKeyAuthConstants.PKeyAuthName) - && x.Item2.StatusCode == HttpStatusCode.OK).FirstOrDefault(); - - Assert.IsNotNull(req); - Assert.IsNotNull(res); - } - } -} diff --git a/tests/Microsoft.Identity.Test.Integration.Win8/Microsoft.Identity.Test.Integration.Win8.csproj b/tests/Microsoft.Identity.Test.Integration.Win8/Microsoft.Identity.Test.Integration.Win8.csproj deleted file mode 100644 index 06f994f2b2..0000000000 --- a/tests/Microsoft.Identity.Test.Integration.Win8/Microsoft.Identity.Test.Integration.Win8.csproj +++ /dev/null @@ -1,46 +0,0 @@ - - - - net48 - net6.0-windows10.0.17763.0 - - $(TargetFrameworkNetDesktop48);$(TargetFrameworkNetCore);$(TargetFrameworkNet6Win) - false - Debug;Release;Debug + MobileApps - - - - - {3433eb33-114a-4db7-bc57-14f17f55da3c} - Microsoft.Identity.Client - - - {A181778D-5917-41CE-AA5F-7DAAA7B7F5BB} - Microsoft.Identity.Test.LabInfrastructure - - - - - - - - - - - - - - - - - - - - $(DefineConstants);DESKTOP - - - $(DefineConstants);NET6_WIN - - - From a0b7dff12192b594ce0fbe912bfb76f3e8ad9e1e Mon Sep 17 00:00:00 2001 From: Bogdan Gavril Date: Wed, 24 Jan 2024 15:33:13 +0200 Subject: [PATCH 03/17] Remove Intune Xamarin dev apps (#4559) --- .../EnrollmentNotificationReceiver.cs | 45 ---- .../Intune-xamarin-Android.csproj | 180 ------------- .../Intune-xamarin-Android/IntuneSampleApp.cs | 53 ---- .../MAMWEAuthCallback.cs | 56 ---- .../Intune-xamarin-Android/MainActivity.cs | 155 ----------- .../Intune-xamarin-Android/PCAWrapper.cs | 117 --------- .../Properties/AndroidManifest.xml | 35 --- .../Properties/AssemblyInfo.cs | 29 --- .../Resources/AboutResources.txt | 44 ---- .../Resources/layout/activity_main.xml | 32 --- .../Resources/layout/content_main.xml | 31 --- .../Resources/menu/menu_main.xml | 9 - .../mipmap-anydpi-v26/ic_launcher.xml | 5 - .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 - .../Resources/mipmap-hdpi/ic_launcher.png | Bin 1634 -> 0 bytes .../mipmap-hdpi/ic_launcher_foreground.png | Bin 1441 -> 0 bytes .../mipmap-hdpi/ic_launcher_round.png | Bin 3552 -> 0 bytes .../Resources/mipmap-mdpi/ic_launcher.png | Bin 1362 -> 0 bytes .../mipmap-mdpi/ic_launcher_foreground.png | Bin 958 -> 0 bytes .../mipmap-mdpi/ic_launcher_round.png | Bin 2413 -> 0 bytes .../Resources/mipmap-xhdpi/ic_launcher.png | Bin 2307 -> 0 bytes .../mipmap-xhdpi/ic_launcher_foreground.png | Bin 2056 -> 0 bytes .../mipmap-xhdpi/ic_launcher_round.png | Bin 4858 -> 0 bytes .../Resources/mipmap-xxhdpi/ic_launcher.png | Bin 3871 -> 0 bytes .../mipmap-xxhdpi/ic_launcher_foreground.png | Bin 3403 -> 0 bytes .../mipmap-xxhdpi/ic_launcher_round.png | Bin 8001 -> 0 bytes .../Resources/mipmap-xxxhdpi/ic_launcher.png | Bin 5016 -> 0 bytes .../mipmap-xxxhdpi/ic_launcher_foreground.png | Bin 4889 -> 0 bytes .../mipmap-xxxhdpi/ic_launcher_round.png | Bin 10893 -> 0 bytes .../Resources/values/colors.xml | 6 - .../Resources/values/dimens.xml | 3 - .../values/ic_launcher_background.xml | 4 - .../Resources/values/strings.xml | 4 - .../Resources/values/styles.xml | 20 -- .../devapps/Intune-xamarin-ios/AppDelegate.cs | 87 ------- .../Intune-xamarin-ios/Entitlements.plist | 12 - .../HttpSnifferClientFactory.cs | 63 ----- tests/devapps/Intune-xamarin-ios/Info.plist | 98 ------- .../IntuneMAMSampleiOS.csproj | 185 -------------- tests/devapps/Intune-xamarin-ios/Main.cs | 18 -- .../MainIntuneMAMComplianceDelegate.cs | 43 ---- .../Intune-xamarin-ios/MainViewController.cs | 192 -------------- .../MainViewController.designer.cs | 121 --------- .../AppIcons.appiconset/Contents.json | 241 ------------------ .../AppIcons.appiconset/Intune_tile_1024.png | Bin 84636 -> 0 bytes .../AppIcons.appiconset/Intune_tile_120.png | Bin 866 -> 0 bytes .../AppIcons.appiconset/Intune_tile_152.png | Bin 1460 -> 0 bytes .../AppIcons.appiconset/Intune_tile_167.png | Bin 5361 -> 0 bytes .../AppIcons.appiconset/Intune_tile_180.png | Bin 1475 -> 0 bytes .../AppIcons.appiconset/Intune_tile_29.png | Bin 342 -> 0 bytes .../AppIcons.appiconset/Intune_tile_58.png | Bin 639 -> 0 bytes .../AppIcons.appiconset/Intune_tile_76.png | Bin 714 -> 0 bytes .../AppIcons.appiconset/Intune_tile_87.png | Bin 715 -> 0 bytes .../Resources/LaunchScreen.xib | 32 --- .../Intune-xamarin-ios/Sample.storyboard | 42 --- 55 files changed, 1967 deletions(-) delete mode 100644 tests/devapps/Intune-xamarin-Android/EnrollmentNotificationReceiver.cs delete mode 100644 tests/devapps/Intune-xamarin-Android/Intune-xamarin-Android.csproj delete mode 100644 tests/devapps/Intune-xamarin-Android/IntuneSampleApp.cs delete mode 100644 tests/devapps/Intune-xamarin-Android/MAMWEAuthCallback.cs delete mode 100644 tests/devapps/Intune-xamarin-Android/MainActivity.cs delete mode 100644 tests/devapps/Intune-xamarin-Android/PCAWrapper.cs delete mode 100644 tests/devapps/Intune-xamarin-Android/Properties/AndroidManifest.xml delete mode 100644 tests/devapps/Intune-xamarin-Android/Properties/AssemblyInfo.cs delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/AboutResources.txt delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/layout/activity_main.xml delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/layout/content_main.xml delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/menu/menu_main.xml delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/mipmap-anydpi-v26/ic_launcher.xml delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/mipmap-anydpi-v26/ic_launcher_round.xml delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/mipmap-hdpi/ic_launcher.png delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/mipmap-hdpi/ic_launcher_foreground.png delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/mipmap-hdpi/ic_launcher_round.png delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/mipmap-mdpi/ic_launcher.png delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/mipmap-mdpi/ic_launcher_foreground.png delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/mipmap-mdpi/ic_launcher_round.png delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/mipmap-xhdpi/ic_launcher.png delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/mipmap-xhdpi/ic_launcher_foreground.png delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/mipmap-xhdpi/ic_launcher_round.png delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/mipmap-xxhdpi/ic_launcher.png delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/mipmap-xxhdpi/ic_launcher_foreground.png delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/mipmap-xxhdpi/ic_launcher_round.png delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/mipmap-xxxhdpi/ic_launcher_foreground.png delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/mipmap-xxxhdpi/ic_launcher_round.png delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/values/colors.xml delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/values/dimens.xml delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/values/ic_launcher_background.xml delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/values/strings.xml delete mode 100644 tests/devapps/Intune-xamarin-Android/Resources/values/styles.xml delete mode 100644 tests/devapps/Intune-xamarin-ios/AppDelegate.cs delete mode 100644 tests/devapps/Intune-xamarin-ios/Entitlements.plist delete mode 100644 tests/devapps/Intune-xamarin-ios/HttpSnifferClientFactory.cs delete mode 100644 tests/devapps/Intune-xamarin-ios/Info.plist delete mode 100644 tests/devapps/Intune-xamarin-ios/IntuneMAMSampleiOS.csproj delete mode 100644 tests/devapps/Intune-xamarin-ios/Main.cs delete mode 100644 tests/devapps/Intune-xamarin-ios/MainIntuneMAMComplianceDelegate.cs delete mode 100644 tests/devapps/Intune-xamarin-ios/MainViewController.cs delete mode 100644 tests/devapps/Intune-xamarin-ios/MainViewController.designer.cs delete mode 100644 tests/devapps/Intune-xamarin-ios/Resources/Images.xcassets/AppIcons.appiconset/Contents.json delete mode 100644 tests/devapps/Intune-xamarin-ios/Resources/Images.xcassets/AppIcons.appiconset/Intune_tile_1024.png delete mode 100644 tests/devapps/Intune-xamarin-ios/Resources/Images.xcassets/AppIcons.appiconset/Intune_tile_120.png delete mode 100644 tests/devapps/Intune-xamarin-ios/Resources/Images.xcassets/AppIcons.appiconset/Intune_tile_152.png delete mode 100644 tests/devapps/Intune-xamarin-ios/Resources/Images.xcassets/AppIcons.appiconset/Intune_tile_167.png delete mode 100644 tests/devapps/Intune-xamarin-ios/Resources/Images.xcassets/AppIcons.appiconset/Intune_tile_180.png delete mode 100644 tests/devapps/Intune-xamarin-ios/Resources/Images.xcassets/AppIcons.appiconset/Intune_tile_29.png delete mode 100644 tests/devapps/Intune-xamarin-ios/Resources/Images.xcassets/AppIcons.appiconset/Intune_tile_58.png delete mode 100644 tests/devapps/Intune-xamarin-ios/Resources/Images.xcassets/AppIcons.appiconset/Intune_tile_76.png delete mode 100644 tests/devapps/Intune-xamarin-ios/Resources/Images.xcassets/AppIcons.appiconset/Intune_tile_87.png delete mode 100644 tests/devapps/Intune-xamarin-ios/Resources/LaunchScreen.xib delete mode 100644 tests/devapps/Intune-xamarin-ios/Sample.storyboard diff --git a/tests/devapps/Intune-xamarin-Android/EnrollmentNotificationReceiver.cs b/tests/devapps/Intune-xamarin-Android/EnrollmentNotificationReceiver.cs deleted file mode 100644 index 47261668ac..0000000000 --- a/tests/devapps/Intune-xamarin-Android/EnrollmentNotificationReceiver.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using Android.Runtime; -using Microsoft.Intune.Mam.Client.Notification; -using Microsoft.Intune.Mam.Policy; -using Microsoft.Intune.Mam.Policy.Notification; - -namespace Intune_xamarin_Android -{ - /// - /// Receives enrollment notifications from the Intune service and performs the corresponding action for the enrollment result. - /// See: https://docs.microsoft.com/en-us/intune/app-sdk-android#mamnotificationreceiver - /// - class EnrollmentNotificationReceiver : Java.Lang.Object, IMAMNotificationReceiver - { - /// - /// When using the MAM-WE APIs found in IMAMEnrollManager, your app wil receive - /// IMAMEnrollmentNotifications back to signal the result of your calls. - /// When enrollment is successful, this will signal that app has been registered and it can proceed ahead. - /// - /// The notification that was received. - /// - /// The receiver should return true if it handled the notification without error(or if it decided to ignore the notification). - /// If the receiver tried to take some action in response to the notification but failed to complete that action it should return false. - /// - public bool OnReceive(IMAMNotification notification) - { - if (notification.Type == MAMNotificationType.MamEnrollmentResult) - { - IMAMEnrollmentNotification enrollmentNotification = notification.JavaCast(); - MAMEnrollmentManagerResult result = enrollmentNotification.EnrollmentResult; - - if (result.Equals(MAMEnrollmentManagerResult.EnrollmentSucceeded)) - { - // this signals that MAM registration is complete and the app can proceed - IntuneSampleApp.MAMRegsiteredEvent.Set(); - } - } - - return true; - } - } -} diff --git a/tests/devapps/Intune-xamarin-Android/Intune-xamarin-Android.csproj b/tests/devapps/Intune-xamarin-Android/Intune-xamarin-Android.csproj deleted file mode 100644 index de5192f08e..0000000000 --- a/tests/devapps/Intune-xamarin-Android/Intune-xamarin-Android.csproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {C6CA2F00-E48A-478F-ABC3-1FE3FE20286B} - {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - {84dd83c5-0fe3-4294-9419-09e7c8ba324f} - Library - Properties - Intune_xamarin_Android - Intune-xamarin-Android - 512 - True - True - Resources\Resource.designer.cs - Resource - Off - false - v11.0 - Properties\AndroidManifest.xml - Resources - Assets - true - true - Xamarin.Android.Net.AndroidClientHandler - - - True - portable - False - bin\Debug\ - DEBUG;TRACE - prompt - 4 - True - None - true - true - true - true - false - - - True - portable - True - bin\Release\ - TRACE - prompt - 4 - true - False - SdkOnly - True - - - true - bin\Debug + MobileApps\ - DEBUG;TRACE - portable - AnyCPU - Off - 8.0 - prompt - - - - - - - - - - - - - - - - - - - - - - - - - - Designer - - - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3.0.4635.1 - - - 28.0.0.3 - - - - - 28.0.0.3 - - - 28.0.0.3 - - - 1.1.2 - - - 28.0.0.3 - - - - 28.0.0.3 - - - 28.0.0.3 - - - 28.0.0.3 - - - 28.0.0.3 - - - - - - - - - - {60117a9b-4bb8-472e-bfff-52cbf67ca95a} - Microsoft.Identity.Client - - - - - \ No newline at end of file diff --git a/tests/devapps/Intune-xamarin-Android/IntuneSampleApp.cs b/tests/devapps/Intune-xamarin-Android/IntuneSampleApp.cs deleted file mode 100644 index 8aa1136761..0000000000 --- a/tests/devapps/Intune-xamarin-Android/IntuneSampleApp.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using Android.App; -using Android.Content; -using Android.OS; -using Android.Runtime; -using Android.Views; -using Android.Widget; -using Microsoft.Intune.Mam.Client.App; -using Microsoft.Intune.Mam.Client.Notification; -using Microsoft.Intune.Mam.Policy; -using Microsoft.Intune.Mam.Policy.Notification; - -namespace Intune_xamarin_Android -{ -#if DEBUG - /// - /// Due to an issue with debugging the Xamarin bound MAM SDK the Debuggable = false attribute must be added to the Application in order to enable debugging. - /// Without this attribute the application will crash when launched in Debug mode. Additional investigation is being performed to identify the root cause. - /// - [Application(Debuggable = false)] -#else - [Application] -#endif - class IntuneSampleApp : MAMApplication - { - // This event coordinates between different callbacks - internal static ManualResetEvent MAMRegsiteredEvent { get; } = new ManualResetEvent(false); - public IntuneSampleApp(IntPtr handle, Android.Runtime.JniHandleOwnership transfer) - : base(handle, transfer) { } - - public override void OnMAMCreate() - { - // as per Intune SDK doc, callback registration must be done here. - // https://docs.microsoft.com/en-us/mem/intune/developer/app-sdk-android - IMAMEnrollmentManager mgr = MAMComponents.Get(); - mgr.RegisterAuthenticationCallback(new MAMWEAuthCallback()); - - // Register the notification receivers to receive MAM notifications. - // Along with other, this will receive notification that the device has been enrolled. - IMAMNotificationReceiverRegistry registry = MAMComponents.Get(); - registry.RegisterReceiver(new EnrollmentNotificationReceiver(), MAMNotificationType.MamEnrollmentResult); - - base.OnMAMCreate(); - } - } -} diff --git a/tests/devapps/Intune-xamarin-Android/MAMWEAuthCallback.cs b/tests/devapps/Intune-xamarin-Android/MAMWEAuthCallback.cs deleted file mode 100644 index 86c858a80e..0000000000 --- a/tests/devapps/Intune-xamarin-Android/MAMWEAuthCallback.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using Android.App; -using Android.Content; -using Android.OS; -using Android.Runtime; -using Android.Views; -using Android.Widget; -using Microsoft.Intune.Mam.Policy; - -namespace Intune_xamarin_Android -{ - /// - /// Required by the MAM SDK. A token may be needed very early in the app lifecycle so the ideal - /// place to register the callback is in the OnMAMCreate() method of the app's implementation - /// of IMAMApplication. - /// See https://docs.microsoft.com/en-us/intune/app-sdk-android#account-authentication - /// - class MAMWEAuthCallback : Java.Lang.Object, IMAMServiceAuthenticationCallback - { - /// - /// MAM expects that this method performs silent authentication for the give resourceID - /// Note. This resource is not the same one from the App. The resource is api for MAM service. - /// - /// UPN of the user - /// Active directory ID - /// ID of the resource. - /// Access token - public string AcquireToken(string upn, string aadId, string resourceId) - { - string ret = null; - try - { - // append with /.default - string[] scopes = new string[] { resourceId + "/.default" }; - - // do the silent authentication for the resource - var authresult = PCAWrapper.Instance.DoSilentAsync(scopes).GetAwaiter().GetResult(); - ret = authresult?.AccessToken; - } - catch (Exception ex) - { - // write the exception and return null - System.Diagnostics.Debug.WriteLine(ex.Message); - } - - return ret; - } - } -} diff --git a/tests/devapps/Intune-xamarin-Android/MainActivity.cs b/tests/devapps/Intune-xamarin-Android/MainActivity.cs deleted file mode 100644 index 4738bb0fe6..0000000000 --- a/tests/devapps/Intune-xamarin-Android/MainActivity.cs +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using Android.App; -using Android.OS; -using Android.Runtime; -using AndroidX.AppCompat.Widget; -using AndroidX.AppCompat.App; -using Microsoft.Identity.Client; -using Android.Content; -using Microsoft.Intune.Mam.Policy; -using Microsoft.Intune.Mam.Client.App; -using System.Threading.Tasks; - -namespace Intune_xamarin_Android -{ - [Activity(Label = "@string/app_name", Theme = "@style/AppTheme.NoActionBar", MainLauncher = true)] - public class MainActivity : AppCompatActivity - { - /// - /// The scopes that are protected by conditional access - /// - internal static string[] Scopes = { "api://a8bf4bd3-c92d-44d0-8307-9753d975c21e/Hello.World" }; // TODO - change scopes are per your enterprise app - - protected override void OnCreate(Bundle savedInstanceState) - { - base.OnCreate(savedInstanceState); - Xamarin.Essentials.Platform.Init(this, savedInstanceState); - SetContentView(Resource.Layout.activity_main); - - Toolbar toolbar = FindViewById(Resource.Id.toolbar); - SetSupportActionBar(toolbar); - - Android.Widget.Button actButton = FindViewById(Resource.Id.acqToken); - actButton.Click += ActButton_Click; - - Android.Widget.Button signOutButton = FindViewById(Resource.Id.signOut); - signOutButton.Click += SignOutButton_Click; - } - - /// - /// This method shows calling pattern to access resource protected by Conditional Access with App Protection Policy - /// - /// Sender button - /// arguments - private async void ActButton_Click(object sender, EventArgs e) - { - AuthenticationResult result = null; - - try - { - // attempt silent login. - // If this is very first time and the device is not enrolled, it will throw MsalUiRequiredException - // If the device is enrolled, this will succeed. - result = await PCAWrapper.Instance.DoSilentAsync(Scopes).ConfigureAwait(false); - - _ = await ShowMessage("Silent 1", result.AccessToken).ConfigureAwait(false); - } - catch (MsalUiRequiredException ) - { - try - { - // This executes UI interaction - result = await PCAWrapper.Instance.DoInteractiveAsync(Scopes, this).ConfigureAwait(false); - - _ = await ShowMessage("Interactive 1", result.AccessToken).ConfigureAwait(false); - } - catch (IntuneAppProtectionPolicyRequiredException exProtection) - { - // if the scope requires App Protection Policy, IntuneAppProtectionPolicyRequiredException is thrown. - // Perform registration operation here and then do the silent token acquisition - _ = await DoMAMRegister(exProtection).ContinueWith(async (s) => - { - try - { - // Now the device is registered, perform silent token acquisition - result = await PCAWrapper.Instance.DoSilentAsync(Scopes).ConfigureAwait(false); - - _ = await ShowMessage("Silent 2", result.AccessToken).ConfigureAwait(false) ; - } - catch (Exception ex) - { - _ = await ShowMessage("Exception 1", ex.Message).ConfigureAwait(false); - } - }).ConfigureAwait(false); - } - } - catch (Exception ex) - { - _ = await ShowMessage("Exception 2", ex.Message).ConfigureAwait(false); - } - } - - private async void SignOutButton_Click(object sender, EventArgs e) - { - // Even after the signout, broker may retain the token - await PCAWrapper.Instance.SignOut().ConfigureAwait(false); - } - - /// - /// Perform registration with MAM - /// - /// - /// - private async Task DoMAMRegister(IntuneAppProtectionPolicyRequiredException exProtection) - { - // reset the registered event - IntuneSampleApp.MAMRegsiteredEvent.Reset(); - - // Invoke compliance API on a different thread - await Task.Run(() => - { - IMAMComplianceManager mgr = MAMComponents.Get(); - mgr.RemediateCompliance(exProtection.Upn, exProtection.AccountUserId, exProtection.TenantId, exProtection.AuthorityUrl, false); - }).ConfigureAwait(false); - - // wait till the registration completes - // Note: This is a sample app for MSAL.NET. Scenarios such as what if enrollment fails or user chooses not to enroll will be as - // per the business requirements of the app and not considered in the sample app. - IntuneSampleApp.MAMRegsiteredEvent.WaitOne(); - } - - private Task ShowMessage(string title, string message) - { - TaskCompletionSource tcs = new TaskCompletionSource(); - - RunOnUiThread(() => - { - - var builder = new Android.App.AlertDialog.Builder(this); - builder.SetTitle(title); - builder.SetMessage(message); - builder.SetNeutralButton("OK", (s, e) => { tcs.SetResult(true); }); - - var alertDialog = builder.Show(); - alertDialog.Show(); - }); - return tcs.Task; - } - - 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); - } - - protected override void OnActivityResult(int requestCode, [GeneratedEnum] Result resultCode, Intent data) - { - base.OnActivityResult(requestCode, resultCode, data); - AuthenticationContinuationHelper.SetAuthenticationContinuationEventArgs(requestCode, resultCode, data); - } - } -} diff --git a/tests/devapps/Intune-xamarin-Android/PCAWrapper.cs b/tests/devapps/Intune-xamarin-Android/PCAWrapper.cs deleted file mode 100644 index f87a66a2ee..0000000000 --- a/tests/devapps/Intune-xamarin-Android/PCAWrapper.cs +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Linq; -using System.Threading.Tasks; -using Android.App; -using Microsoft.Identity.Client; - -namespace Intune_xamarin_Android -{ - /// - /// This is a wrapper for PCA. It is singleton and can be utilized by both application and the MAM callback - /// - public class PCAWrapper - { - - /// - /// This is the singleton used by consumers - /// - static internal PCAWrapper Instance { get; } - - internal IPublicClientApplication PCA { get; } - - /// - /// The authority for the MSAL PublicClientApplication. Sign in will use this URL. - /// - private const string _authority = "https://login.microsoftonline.com/organizations"; - - // ClientID of the application in (msidlab4.com) - private static string _clientID = "bd9933c9-a825-4f9a-82a0-bbf23c9049fd"; // TODO - Replace with your client Id. And also replace in the AndroidManifest.xml - - // redirect URI for the application - private static string _redirectURI = $"msauth://com.sameerk.intune.test.xamarin/EHyvOdXj4uLXJXDaOMy5lwANmp0="; // TODO - Replace with your redirectURI - - // TenantID of the organization (msidlab4.com) - private static string _tenantID = "f645ad92-e38d-4d1a-b510-d1b09a74a8ca"; // TODO - Replace with your TenantID. And also replace in the AndroidManifest.xml - - static string[] clientCapabilities = { "ProtApp" }; // It is must to have these capabilities - - // private constructor for singleton - private PCAWrapper() - { - // Create PCA once. Make sure that all the config parameters below are passed - // ClientCapabilities - must have ProtApp - var builder = PublicClientApplicationBuilder - .Create(_clientID) - .WithAuthority(_authority) - .WithBroker() - .WithClientCapabilities(clientCapabilities) - .WithTenantId(_tenantID) - .WithRedirectUri(_redirectURI); - - PCA = builder.Build(); - } - - /// - /// Static constructor to instantiate PCA - /// - static PCAWrapper() - { - Instance = new PCAWrapper(); - } - - /// - /// Perform the interactive acquisition of the token for the given scope - /// - /// Scope - /// Parent window - /// - internal async Task DoInteractiveAsync(string[] scopes, Activity parentWindow) - { - return await PCA.AcquireTokenInteractive(scopes) - .WithParentActivityOrWindow(parentWindow) - .WithUseEmbeddedWebView(true) - .ExecuteAsync() - .ConfigureAwait(false); - } - - /// - /// Acquire the token silently - /// - /// scopes - /// Authentication result - internal async Task DoSilentAsync(string[] scopes) - { - if (PCA == null) - { - return null; - } - - var accts = await PCA.GetAccountsAsync().ConfigureAwait(false); - var acct = accts.FirstOrDefault(); - - var silentParamBuilder = PCA.AcquireTokenSilent(scopes, acct); - var authResult = await silentParamBuilder - .ExecuteAsync().ConfigureAwait(false); - return authResult; - - } - - /// - /// Signout may not perform the complete signout as company portal may hold - /// the token. - /// - /// - internal async Task SignOut() - { - var accounts = await PCA.GetAccountsAsync().ConfigureAwait(false); - while (accounts.Any()) - { - var acct = accounts.FirstOrDefault(); - await PCA.RemoveAsync(acct).ConfigureAwait(false); - accounts = await PCA.GetAccountsAsync().ConfigureAwait(false); - } - } - } -} diff --git a/tests/devapps/Intune-xamarin-Android/Properties/AndroidManifest.xml b/tests/devapps/Intune-xamarin-Android/Properties/AndroidManifest.xml deleted file mode 100644 index 3a3db564c6..0000000000 --- a/tests/devapps/Intune-xamarin-Android/Properties/AndroidManifest.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/devapps/Intune-xamarin-Android/Properties/AssemblyInfo.cs b/tests/devapps/Intune-xamarin-Android/Properties/AssemblyInfo.cs deleted file mode 100644 index 45ee820316..0000000000 --- a/tests/devapps/Intune-xamarin-Android/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -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("Intune_xamarin_Android")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Intune_xamarin_Android")] -[assembly: AssemblyCopyright("Copyright © 2018")] -[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")] diff --git a/tests/devapps/Intune-xamarin-Android/Resources/AboutResources.txt b/tests/devapps/Intune-xamarin-Android/Resources/AboutResources.txt deleted file mode 100644 index f25399b99b..0000000000 --- a/tests/devapps/Intune-xamarin-Android/Resources/AboutResources.txt +++ /dev/null @@ -1,44 +0,0 @@ -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/ - 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 "R" -(this is an Android convention) that contains the tokens for each one of the resources -included. For example, for the above Resources layout, this is what the R class would expose: - -public class R { - 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 R.layout.main -to reference the layout/main.xml file, or R.strings.first_string to reference the first -string in the dictionary file values/strings.xml. \ No newline at end of file diff --git a/tests/devapps/Intune-xamarin-Android/Resources/layout/activity_main.xml b/tests/devapps/Intune-xamarin-Android/Resources/layout/activity_main.xml deleted file mode 100644 index 064be4c811..0000000000 --- a/tests/devapps/Intune-xamarin-Android/Resources/layout/activity_main.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - diff --git a/tests/devapps/Intune-xamarin-Android/Resources/layout/content_main.xml b/tests/devapps/Intune-xamarin-Android/Resources/layout/content_main.xml deleted file mode 100644 index da9a2cc144..0000000000 --- a/tests/devapps/Intune-xamarin-Android/Resources/layout/content_main.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - -