diff --git a/Beezy.MvvmCross.Plugins.SecureStorage.Droid/Beezy.MvvmCross.Plugins.SecureStorage.Droid.csproj b/Beezy.MvvmCross.Plugins.SecureStorage.Droid/Beezy.MvvmCross.Plugins.SecureStorage.Droid.csproj index d949cff..1cedb9b 100644 --- a/Beezy.MvvmCross.Plugins.SecureStorage.Droid/Beezy.MvvmCross.Plugins.SecureStorage.Droid.csproj +++ b/Beezy.MvvmCross.Plugins.SecureStorage.Droid/Beezy.MvvmCross.Plugins.SecureStorage.Droid.csproj @@ -34,45 +34,27 @@ 4 - - ..\packages\MvvmCross.HotTuna.CrossCore.3.1.1\lib\MonoAndroid\Cirrious.CrossCore.dll - - - ..\packages\MvvmCross.HotTuna.CrossCore.3.1.1\lib\MonoAndroid\Cirrious.CrossCore.Droid.dll - - - ..\packages\MvvmCross.HotTuna.MvvmCrossLibraries.3.1.1\lib\MonoAndroid\Cirrious.MvvmCross.dll - - - ..\packages\MvvmCross.HotTuna.CrossCore.3.1.1\lib\MonoAndroid\Cirrious.MvvmCross.Binding.dll - - - ..\packages\MvvmCross.HotTuna.CrossCore.3.1.1\lib\MonoAndroid\Cirrious.MvvmCross.Binding.Droid.dll - - - ..\packages\MvvmCross.HotTuna.MvvmCrossLibraries.3.1.1\lib\MonoAndroid\Cirrious.MvvmCross.Droid.dll - - - ..\packages\MvvmCross.HotTuna.CrossCore.3.1.1\lib\MonoAndroid\Cirrious.MvvmCross.Localization.dll - - - False - ..\packages\MvvmCross.PortableSupport.3.1.1\lib\MonoAndroid\System.Net.dll - - False ..\packages\MvvmCross.PortableSupport.3.1.1\lib\MonoAndroid\System.Windows.dll - False ..\packages\MvvmCross.PortableSupport.3.1.1\lib\MonoAndroid\System.Xml.Serialization.dll + + ..\packages\MvvmCross.PortableSupport.3.1.1\lib\MonoAndroid\System.Net.dll + + + ..\packages\MvvmCross.Platform.4.1.0\lib\MonoAndroid\MvvmCross.Platform.Droid.dll + + + ..\packages\MvvmCross.Platform.4.1.0\lib\MonoAndroid\MvvmCross.Platform.dll + @@ -81,9 +63,9 @@ - + diff --git a/Beezy.MvvmCross.Plugins.SecureStorage.Droid/Plugin.cs b/Beezy.MvvmCross.Plugins.SecureStorage.Droid/Plugin.cs index dbc8bcc..e435005 100644 --- a/Beezy.MvvmCross.Plugins.SecureStorage.Droid/Plugin.cs +++ b/Beezy.MvvmCross.Plugins.SecureStorage.Droid/Plugin.cs @@ -3,8 +3,8 @@ // MvvmCross - Secure Storage Plugin is licensed using Microsoft Public License (Ms-PL) // -using Cirrious.CrossCore; -using Cirrious.CrossCore.Plugins; +using MvvmCross.Platform.Plugins; +using MvvmCross.Platform; namespace Beezy.MvvmCross.Plugins.SecureStorage.Droid { diff --git a/Beezy.MvvmCross.Plugins.SecureStorage.Droid/Resources/Resource.Designer.cs b/Beezy.MvvmCross.Plugins.SecureStorage.Droid/Resources/Resource.Designer.cs index 94d610e..ae296e6 100644 --- a/Beezy.MvvmCross.Plugins.SecureStorage.Droid/Resources/Resource.Designer.cs +++ b/Beezy.MvvmCross.Plugins.SecureStorage.Droid/Resources/Resource.Designer.cs @@ -1,15 +1,15 @@ #pragma warning disable 1591 -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.34014 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ +// ------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Mono Runtime Version: 4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ -[assembly: global::Android.Runtime.ResourceDesignerAttribute("Beezy.MvvmCross.Plugins.SecureStorage.Droid.Resource", IsApplication=false)] +[assembly: Android.Runtime.ResourceDesignerAttribute("Beezy.MvvmCross.Plugins.SecureStorage.Droid.Resource", IsApplication=false)] namespace Beezy.MvvmCross.Plugins.SecureStorage.Droid { diff --git a/Beezy.MvvmCross.Plugins.SecureStorage.Droid/packages.config b/Beezy.MvvmCross.Plugins.SecureStorage.Droid/packages.config index cc2d223..edb2fa8 100644 --- a/Beezy.MvvmCross.Plugins.SecureStorage.Droid/packages.config +++ b/Beezy.MvvmCross.Plugins.SecureStorage.Droid/packages.config @@ -1,6 +1,4 @@  - - - + \ No newline at end of file diff --git a/Beezy.MvvmCross.Plugins.SecureStorage.Touch/Beezy.MvvmCross.Plugins.SecureStorage.Touch.csproj b/Beezy.MvvmCross.Plugins.SecureStorage.Touch/Beezy.MvvmCross.Plugins.SecureStorage.Touch.csproj index 6947303..d8bb166 100644 --- a/Beezy.MvvmCross.Plugins.SecureStorage.Touch/Beezy.MvvmCross.Plugins.SecureStorage.Touch.csproj +++ b/Beezy.MvvmCross.Plugins.SecureStorage.Touch/Beezy.MvvmCross.Plugins.SecureStorage.Touch.csproj @@ -1,87 +1,73 @@ - - + + Debug - iPhoneSimulator - 8.0.30703 - 2.0 - {986D1130-0344-42D3-A927-2AFA2E4908C3} - {6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + AnyCPU + {7693A6D0-0A34-4834-9C1E-DD1197B5449D} + {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} Library Beezy.MvvmCross.Plugins.SecureStorage.Touch - Resources Beezy.MvvmCross.Plugins.SecureStorage.Touch - ..\ + Resources true full false - bin\iPhone\Debug - DEBUG + bin\Debug + DEBUG; prompt 4 false - true - iPhone Developer + true + true + + + - none true - bin\iPhone\Release + bin\Release + prompt 4 false - iPhone Developer + true + true + + + - - - + + + + + + ..\packages\MvvmCross.Platform.4.1.0\lib\Xamarin.iOS10\MvvmCross.Platform.iOS.dll + False + + + ..\packages\MvvmCross.Platform.4.1.0\lib\Xamarin.iOS10\MvvmCross.Platform.dll + False + - - + - - ..\packages\MvvmCross.HotTuna.CrossCore.3.1.1\lib\MonoTouch\Cirrious.CrossCore.dll - - - ..\packages\MvvmCross.HotTuna.CrossCore.3.1.1\lib\MonoTouch\Cirrious.CrossCore.Touch.dll - - - ..\packages\MvvmCross.HotTuna.MvvmCrossLibraries.3.1.1\lib\MonoTouch\Cirrious.MvvmCross.dll - - - ..\packages\MvvmCross.HotTuna.CrossCore.3.1.1\lib\MonoTouch\Cirrious.MvvmCross.Binding.dll - - - ..\packages\MvvmCross.HotTuna.CrossCore.3.1.1\lib\MonoTouch\Cirrious.MvvmCross.Binding.Touch.dll - - - ..\packages\MvvmCross.HotTuna.CrossCore.3.1.1\lib\MonoTouch\Cirrious.MvvmCross.Localization.dll - - - ..\packages\MvvmCross.HotTuna.MvvmCrossLibraries.3.1.1\lib\MonoTouch\Cirrious.MvvmCross.Touch.dll - - - - - + + + - {b58c3994-4663-4c3a-ab28-f82b3db1be99} + {B58C3994-4663-4C3A-AB28-F82B3DB1BE99} Beezy.MvvmCross.Plugins.SecureStorage - - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + + \ No newline at end of file diff --git a/Beezy.MvvmCross.Plugins.SecureStorage.Touch/MvxTouchProtectedData.cs b/Beezy.MvvmCross.Plugins.SecureStorage.Touch/MvxTouchProtectedData.cs index cc038fc..653c184 100644 --- a/Beezy.MvvmCross.Plugins.SecureStorage.Touch/MvxTouchProtectedData.cs +++ b/Beezy.MvvmCross.Plugins.SecureStorage.Touch/MvxTouchProtectedData.cs @@ -3,39 +3,48 @@ // MvvmCross - Secure Storage Plugin is licensed using Microsoft Public License (Ms-PL) // -using MonoTouch.Foundation; -using MonoTouch.Security; +using Foundation; +using Security; namespace Beezy.MvvmCross.Plugins.SecureStorage.Touch { public class MvxTouchProtectedData : IMvxProtectedData { - public void Protect(string key, string value) - { - SecKeyChain.Add(new SecRecord(SecKind.GenericPassword) - { - Service = NSBundle.MainBundle.BundleIdentifier, - Account = key, - ValueData = NSData.FromString(value, NSStringEncoding.UTF8) - }); - } + bool _synchronizable = false; + + public void Protect (string key, string value) + { + Remove (key.ToLower ()); + + var result = SecKeyChain.Add (new SecRecord (SecKind.GenericPassword) { + Service = NSBundle.MainBundle.BundleIdentifier, + Label = key.ToLower(), + Account = key.ToLower (), + ValueData = NSData.FromString (value), + Generic = NSData.FromString (key.ToLower ()), + Accessible = SecAccessible.WhenUnlockedThisDeviceOnly, + Synchronizable = _synchronizable + }); + } public string Unprotect(string key) { var existingRecord = new SecRecord(SecKind.GenericPassword) { - Account = key, - Label = key, - Service = NSBundle.MainBundle.BundleIdentifier + Generic = NSData.FromString (key.ToLower ()), + Service = NSBundle.MainBundle.BundleIdentifier, + Label = key.ToLower (), + Account = key.ToLower (), + Synchronizable = _synchronizable }; // Locate the entry in the keychain, using the label, service and account information. // The result code will tell us the outcome of the operation. SecStatusCode resultCode; - SecKeyChain.QueryAsRecord(existingRecord, out resultCode); + existingRecord = SecKeyChain.QueryAsRecord(existingRecord, out resultCode); if (resultCode == SecStatusCode.Success) - return NSString.FromData(existingRecord.ValueData, NSStringEncoding.UTF8); + return NSString.FromData(existingRecord.ValueData, NSStringEncoding.UTF8); else return null; } @@ -44,8 +53,9 @@ public void Remove(string key) { var existingRecord = new SecRecord(SecKind.GenericPassword) { - Account = key, - Label = key, + Generic = NSData.FromString (key.ToLower ()), + Account = key.ToLower (), + Label = key.ToLower (), Service = NSBundle.MainBundle.BundleIdentifier }; SecKeyChain.Remove(existingRecord); diff --git a/Beezy.MvvmCross.Plugins.SecureStorage.Touch/Plugin.cs b/Beezy.MvvmCross.Plugins.SecureStorage.Touch/Plugin.cs index be3ada5..4753b28 100644 --- a/Beezy.MvvmCross.Plugins.SecureStorage.Touch/Plugin.cs +++ b/Beezy.MvvmCross.Plugins.SecureStorage.Touch/Plugin.cs @@ -3,8 +3,8 @@ // MvvmCross - Secure Storage Plugin is licensed using Microsoft Public License (Ms-PL) // -using Cirrious.CrossCore; -using Cirrious.CrossCore.Plugins; +using MvvmCross.Platform.Plugins; +using MvvmCross.Platform; namespace Beezy.MvvmCross.Plugins.SecureStorage.Touch { diff --git a/Beezy.MvvmCross.Plugins.SecureStorage.Touch/SecureStoragePluginBootstrap.cs.pp b/Beezy.MvvmCross.Plugins.SecureStorage.Touch/SecureStoragePluginBootstrap.cs.pp index d30163c..454d742 100644 --- a/Beezy.MvvmCross.Plugins.SecureStorage.Touch/SecureStoragePluginBootstrap.cs.pp +++ b/Beezy.MvvmCross.Plugins.SecureStorage.Touch/SecureStoragePluginBootstrap.cs.pp @@ -1,4 +1,4 @@ -using Cirrious.CrossCore.Plugins; +using MvvmCross.Platform.Plugins; namespace $rootnamespace$.Bootstrap { diff --git a/Beezy.MvvmCross.Plugins.SecureStorage.Touch/packages.config b/Beezy.MvvmCross.Plugins.SecureStorage.Touch/packages.config index 42b8bac..9205733 100644 --- a/Beezy.MvvmCross.Plugins.SecureStorage.Touch/packages.config +++ b/Beezy.MvvmCross.Plugins.SecureStorage.Touch/packages.config @@ -1,8 +1,4 @@  - - - - - + \ No newline at end of file diff --git a/Beezy.MvvmCross.Plugins.SecureStorage.sln b/Beezy.MvvmCross.Plugins.SecureStorage.sln index be0b678..ce8bfa4 100644 --- a/Beezy.MvvmCross.Plugins.SecureStorage.sln +++ b/Beezy.MvvmCross.Plugins.SecureStorage.sln @@ -7,8 +7,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Beezy.MvvmCross.Plugins.Sec EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Beezy.MvvmCross.Plugins.SecureStorage.Droid", "Beezy.MvvmCross.Plugins.SecureStorage.Droid\Beezy.MvvmCross.Plugins.SecureStorage.Droid.csproj", "{46DF466D-F7D9-4833-A112-5383CE2943AF}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Beezy.MvvmCross.Plugins.SecureStorage.Touch", "Beezy.MvvmCross.Plugins.SecureStorage.Touch\Beezy.MvvmCross.Plugins.SecureStorage.Touch.csproj", "{986D1130-0344-42D3-A927-2AFA2E4908C3}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Beezy.MvvmCross.Plugins.SecureStorage.WindowsPhone", "Beezy.MvvmCross.Plugins.SecureStorage.WindowsPhone\Beezy.MvvmCross.Plugins.SecureStorage.WindowsPhone.csproj", "{062469D9-2A86-4963-AC7C-83643C592EAE}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Beezy.MvvmCross.Plugins.SecureStorage.WindowsStore", "Beezy.MvvmCross.Plugins.SecureStorage.WindowsStore\Beezy.MvvmCross.Plugins.SecureStorage.WindowsStore.csproj", "{57B21322-6EAB-403F-9495-B6FB366276E8}" @@ -19,6 +17,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution README.md = README.md EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Beezy.MvvmCross.Plugins.SecureStorage.Touch", "Beezy.MvvmCross.Plugins.SecureStorage.Touch\Beezy.MvvmCross.Plugins.SecureStorage.Touch.csproj", "{7693A6D0-0A34-4834-9C1E-DD1197B5449D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -51,16 +51,6 @@ Global {46DF466D-F7D9-4833-A112-5383CE2943AF}.Release|ARM.ActiveCfg = Release|Any CPU {46DF466D-F7D9-4833-A112-5383CE2943AF}.Release|x64.ActiveCfg = Release|Any CPU {46DF466D-F7D9-4833-A112-5383CE2943AF}.Release|x86.ActiveCfg = Release|Any CPU - {986D1130-0344-42D3-A927-2AFA2E4908C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {986D1130-0344-42D3-A927-2AFA2E4908C3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {986D1130-0344-42D3-A927-2AFA2E4908C3}.Debug|ARM.ActiveCfg = Debug|Any CPU - {986D1130-0344-42D3-A927-2AFA2E4908C3}.Debug|x64.ActiveCfg = Debug|Any CPU - {986D1130-0344-42D3-A927-2AFA2E4908C3}.Debug|x86.ActiveCfg = Debug|Any CPU - {986D1130-0344-42D3-A927-2AFA2E4908C3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {986D1130-0344-42D3-A927-2AFA2E4908C3}.Release|Any CPU.Build.0 = Release|Any CPU - {986D1130-0344-42D3-A927-2AFA2E4908C3}.Release|ARM.ActiveCfg = Release|Any CPU - {986D1130-0344-42D3-A927-2AFA2E4908C3}.Release|x64.ActiveCfg = Release|Any CPU - {986D1130-0344-42D3-A927-2AFA2E4908C3}.Release|x86.ActiveCfg = Release|Any CPU {062469D9-2A86-4963-AC7C-83643C592EAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {062469D9-2A86-4963-AC7C-83643C592EAE}.Debug|Any CPU.Build.0 = Debug|Any CPU {062469D9-2A86-4963-AC7C-83643C592EAE}.Debug|ARM.ActiveCfg = Debug|ARM @@ -91,6 +81,26 @@ Global {57B21322-6EAB-403F-9495-B6FB366276E8}.Release|x64.Build.0 = Release|x64 {57B21322-6EAB-403F-9495-B6FB366276E8}.Release|x86.ActiveCfg = Release|x86 {57B21322-6EAB-403F-9495-B6FB366276E8}.Release|x86.Build.0 = Release|x86 + {619D75BC-0471-4643-95E1-A5E92531B44A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {619D75BC-0471-4643-95E1-A5E92531B44A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {619D75BC-0471-4643-95E1-A5E92531B44A}.Debug|ARM.ActiveCfg = Debug|Any CPU + {619D75BC-0471-4643-95E1-A5E92531B44A}.Debug|ARM.Build.0 = Debug|Any CPU + {619D75BC-0471-4643-95E1-A5E92531B44A}.Debug|x64.ActiveCfg = Debug|Any CPU + {619D75BC-0471-4643-95E1-A5E92531B44A}.Debug|x64.Build.0 = Debug|Any CPU + {619D75BC-0471-4643-95E1-A5E92531B44A}.Debug|x86.ActiveCfg = Debug|Any CPU + {619D75BC-0471-4643-95E1-A5E92531B44A}.Debug|x86.Build.0 = Debug|Any CPU + {619D75BC-0471-4643-95E1-A5E92531B44A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {619D75BC-0471-4643-95E1-A5E92531B44A}.Release|Any CPU.Build.0 = Release|Any CPU + {619D75BC-0471-4643-95E1-A5E92531B44A}.Release|ARM.ActiveCfg = Release|Any CPU + {619D75BC-0471-4643-95E1-A5E92531B44A}.Release|ARM.Build.0 = Release|Any CPU + {619D75BC-0471-4643-95E1-A5E92531B44A}.Release|x64.ActiveCfg = Release|Any CPU + {619D75BC-0471-4643-95E1-A5E92531B44A}.Release|x64.Build.0 = Release|Any CPU + {619D75BC-0471-4643-95E1-A5E92531B44A}.Release|x86.ActiveCfg = Release|Any CPU + {619D75BC-0471-4643-95E1-A5E92531B44A}.Release|x86.Build.0 = Release|Any CPU + {7693A6D0-0A34-4834-9C1E-DD1197B5449D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7693A6D0-0A34-4834-9C1E-DD1197B5449D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7693A6D0-0A34-4834-9C1E-DD1197B5449D}.Release|Any CPU.ActiveCfg = Debug|Any CPU + {7693A6D0-0A34-4834-9C1E-DD1197B5449D}.Release|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Beezy.MvvmCross.Plugins.SecureStorage/Beezy.MvvmCross.Plugins.SecureStorage.csproj b/Beezy.MvvmCross.Plugins.SecureStorage/Beezy.MvvmCross.Plugins.SecureStorage.csproj index 69e9ab4..4ddf235 100644 --- a/Beezy.MvvmCross.Plugins.SecureStorage/Beezy.MvvmCross.Plugins.SecureStorage.csproj +++ b/Beezy.MvvmCross.Plugins.SecureStorage/Beezy.MvvmCross.Plugins.SecureStorage.csproj @@ -11,10 +11,9 @@ Beezy.MvvmCross.Plugins.SecureStorage Beezy.MvvmCross.Plugins.SecureStorage v4.5 - Profile78 + Profile259 512 {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - ..\ true @@ -33,23 +32,19 @@ prompt 4 - - - - - - ..\packages\MvvmCross.HotTuna.CrossCore.3.1.1\lib\portable-win+net45+sl50+wp8+MonoAndroid+MonoTouch\Cirrious.CrossCore.dll - - - ..\packages\MvvmCross.HotTuna.CrossCore.3.1.1\lib\portable-win+net45+sl50+wp8+MonoAndroid+MonoTouch\Cirrious.MvvmCross.Localization.dll + + ..\..\..\packages\MvvmCross.Platform.4.2.0\lib\portable-net45+win+wpa81+wp80\MvvmCross.Platform.dll + + +