diff --git a/NAPS2.App.Console/NAPS2.App.Console.csproj b/NAPS2.App.Console/NAPS2.App.Console.csproj index 111405d77..18ce3d43f 100644 --- a/NAPS2.App.Console/NAPS2.App.Console.csproj +++ b/NAPS2.App.Console/NAPS2.App.Console.csproj @@ -14,7 +14,6 @@ None diff --git a/NAPS2.App.Server/NAPS2.App.Server.csproj b/NAPS2.App.Server/NAPS2.App.Server.csproj index a90fbcf08..4aa305a84 100644 --- a/NAPS2.App.Server/NAPS2.App.Server.csproj +++ b/NAPS2.App.Server/NAPS2.App.Server.csproj @@ -16,7 +16,6 @@ None diff --git a/NAPS2.App.Tests/.gitignore b/NAPS2.App.Tests/.gitignore index 30794521b..50815a5c0 100644 --- a/NAPS2.App.Tests/.gitignore +++ b/NAPS2.App.Tests/.gitignore @@ -29,5 +29,4 @@ _ReSharper*/ $tf*/ publish/ bin/ -temp/ -*.credentials.json \ No newline at end of file +temp/ \ No newline at end of file diff --git a/NAPS2.App.WinForms/NAPS2.App.WinForms.csproj b/NAPS2.App.WinForms/NAPS2.App.WinForms.csproj index fcb1d7e39..a139bcc6d 100644 --- a/NAPS2.App.WinForms/NAPS2.App.WinForms.csproj +++ b/NAPS2.App.WinForms/NAPS2.App.WinForms.csproj @@ -22,7 +22,6 @@ None diff --git a/NAPS2.Images.Gdi/.gitignore b/NAPS2.Images.Gdi/.gitignore index 30794521b..50815a5c0 100644 --- a/NAPS2.Images.Gdi/.gitignore +++ b/NAPS2.Images.Gdi/.gitignore @@ -29,5 +29,4 @@ _ReSharper*/ $tf*/ publish/ bin/ -temp/ -*.credentials.json \ No newline at end of file +temp/ \ No newline at end of file diff --git a/NAPS2.Images/.gitignore b/NAPS2.Images/.gitignore index 30794521b..50815a5c0 100644 --- a/NAPS2.Images/.gitignore +++ b/NAPS2.Images/.gitignore @@ -29,5 +29,4 @@ _ReSharper*/ $tf*/ publish/ bin/ -temp/ -*.credentials.json \ No newline at end of file +temp/ \ No newline at end of file diff --git a/NAPS2.Lib.Common/.gitignore b/NAPS2.Lib.Common/.gitignore index 50815a5c0..866b3a429 100644 --- a/NAPS2.Lib.Common/.gitignore +++ b/NAPS2.Lib.Common/.gitignore @@ -29,4 +29,6 @@ _ReSharper*/ $tf*/ publish/ bin/ -temp/ \ No newline at end of file +temp/ +google.credentials.json +microsoft.credentials.json \ No newline at end of file diff --git a/NAPS2.Sdk/ClientCreds.Designer.cs b/NAPS2.Lib.Common/ClientCreds-.Designer.cs similarity index 97% rename from NAPS2.Sdk/ClientCreds.Designer.cs rename to NAPS2.Lib.Common/ClientCreds-.Designer.cs index 1ddf05013..9f76f4412 100644 --- a/NAPS2.Sdk/ClientCreds.Designer.cs +++ b/NAPS2.Lib.Common/ClientCreds-.Designer.cs @@ -22,14 +22,14 @@ namespace NAPS2 { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class ClientCreds { + internal class ClientCreds_ { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal ClientCreds() { + internal ClientCreds_() { } /// @@ -39,7 +39,7 @@ namespace NAPS2 { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NAPS2.ClientCreds", typeof(ClientCreds).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NAPS2.ClientCreds-", typeof(ClientCreds_).Assembly); resourceMan = temp; } return resourceMan; diff --git a/NAPS2.Lib.Common/ClientCreds-.resx b/NAPS2.Lib.Common/ClientCreds-.resx new file mode 100644 index 000000000..956c81ce5 --- /dev/null +++ b/NAPS2.Lib.Common/ClientCreds-.resx @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + default.credentials.json;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + default.credentials.json;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + naps2-public.cer;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/NAPS2.Lib.Common/ClientCreds_.Designer.cs b/NAPS2.Lib.Common/ClientCreds_.Designer.cs new file mode 100644 index 000000000..6de9f9eb7 --- /dev/null +++ b/NAPS2.Lib.Common/ClientCreds_.Designer.cs @@ -0,0 +1,93 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace NAPS2 { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class ClientCreds_ { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal ClientCreds_() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NAPS2.ClientCreds_", typeof(ClientCreds_).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Byte[]. + /// + internal static byte[] google_credentials { + get { + object obj = ResourceManager.GetObject("google_credentials", resourceCulture); + return ((byte[])(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Byte[]. + /// + internal static byte[] microsoft_credentials { + get { + object obj = ResourceManager.GetObject("microsoft_credentials", resourceCulture); + return ((byte[])(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Byte[]. + /// + internal static byte[] naps2_public { + get { + object obj = ResourceManager.GetObject("naps2_public", resourceCulture); + return ((byte[])(obj)); + } + } + } +} diff --git a/NAPS2.Sdk/ClientCreds.resx b/NAPS2.Lib.Common/ClientCreds_.resx similarity index 100% rename from NAPS2.Sdk/ClientCreds.resx rename to NAPS2.Lib.Common/ClientCreds_.resx diff --git a/NAPS2.Lib.Common/ImportExport/Email/Oauth/GmailOauthProvider.cs b/NAPS2.Lib.Common/ImportExport/Email/Oauth/GmailOauthProvider.cs index 930912817..f6f8a7083 100644 --- a/NAPS2.Lib.Common/ImportExport/Email/Oauth/GmailOauthProvider.cs +++ b/NAPS2.Lib.Common/ImportExport/Email/Oauth/GmailOauthProvider.cs @@ -28,7 +28,7 @@ public class GmailOauthProvider : OauthProvider { if (_creds == null) { - var credObj = JObject.Parse(Encoding.UTF8.GetString(NAPS2.ClientCreds.google_credentials)); + var credObj = JObject.Parse(Encoding.UTF8.GetString(ClientCreds_.google_credentials)); var installed = credObj.Value("installed"); _creds = new OauthClientCreds(installed?.Value("client_id"), installed?.Value("client_secret")); diff --git a/NAPS2.Lib.Common/ImportExport/Email/Oauth/OutlookWebOauthProvider.cs b/NAPS2.Lib.Common/ImportExport/Email/Oauth/OutlookWebOauthProvider.cs index 54e092fa5..e2910bd56 100644 --- a/NAPS2.Lib.Common/ImportExport/Email/Oauth/OutlookWebOauthProvider.cs +++ b/NAPS2.Lib.Common/ImportExport/Email/Oauth/OutlookWebOauthProvider.cs @@ -27,7 +27,7 @@ public class OutlookWebOauthProvider : OauthProvider { if (_creds == null) { - var credObj = JObject.Parse(Encoding.UTF8.GetString(NAPS2.ClientCreds.microsoft_credentials)); + var credObj = JObject.Parse(Encoding.UTF8.GetString(ClientCreds_.microsoft_credentials)); _creds = new OauthClientCreds(credObj.Value("client_id"), credObj.Value("client_secret")); } return _creds; diff --git a/NAPS2.Lib.Common/NAPS2.Lib.Common.csproj b/NAPS2.Lib.Common/NAPS2.Lib.Common.csproj index 8ee5bffd1..e236d364d 100644 --- a/NAPS2.Lib.Common/NAPS2.Lib.Common.csproj +++ b/NAPS2.Lib.Common/NAPS2.Lib.Common.csproj @@ -50,4 +50,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/NAPS2.Lib.Common/default.credentials.json b/NAPS2.Lib.Common/default.credentials.json new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/NAPS2.Lib.Common/default.credentials.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/NAPS2.Sdk/naps2-public.cer b/NAPS2.Lib.Common/naps2-public.cer similarity index 100% rename from NAPS2.Sdk/naps2-public.cer rename to NAPS2.Lib.Common/naps2-public.cer diff --git a/NAPS2.Lib.Tests/.gitignore b/NAPS2.Lib.Tests/.gitignore index 30794521b..50815a5c0 100644 --- a/NAPS2.Lib.Tests/.gitignore +++ b/NAPS2.Lib.Tests/.gitignore @@ -29,5 +29,4 @@ _ReSharper*/ $tf*/ publish/ bin/ -temp/ -*.credentials.json \ No newline at end of file +temp/ \ No newline at end of file diff --git a/NAPS2.Lib.WinForms/Update/UpdateOperation.cs b/NAPS2.Lib.WinForms/Update/UpdateOperation.cs index 79e8feac8..23391e218 100644 --- a/NAPS2.Lib.WinForms/Update/UpdateOperation.cs +++ b/NAPS2.Lib.WinForms/Update/UpdateOperation.cs @@ -177,7 +177,7 @@ public class UpdateOperation : OperationBase private bool VerifySignature() { - var cert = new X509Certificate2(ClientCreds.naps2_public); + var cert = new X509Certificate2(ClientCreds_.naps2_public); var csp = (RSACryptoServiceProvider) cert.PublicKey.Key; return csp.VerifyHash(_update!.Sha1, CryptoConfig.MapNameToOID("SHA1"), _update.Signature); } diff --git a/NAPS2.Sdk.Network.Tests/.gitignore b/NAPS2.Sdk.Network.Tests/.gitignore index 30794521b..50815a5c0 100644 --- a/NAPS2.Sdk.Network.Tests/.gitignore +++ b/NAPS2.Sdk.Network.Tests/.gitignore @@ -29,5 +29,4 @@ _ReSharper*/ $tf*/ publish/ bin/ -temp/ -*.credentials.json \ No newline at end of file +temp/ \ No newline at end of file diff --git a/NAPS2.Sdk.Network/.gitignore b/NAPS2.Sdk.Network/.gitignore index 30794521b..50815a5c0 100644 --- a/NAPS2.Sdk.Network/.gitignore +++ b/NAPS2.Sdk.Network/.gitignore @@ -29,5 +29,4 @@ _ReSharper*/ $tf*/ publish/ bin/ -temp/ -*.credentials.json \ No newline at end of file +temp/ \ No newline at end of file diff --git a/NAPS2.Sdk.Samples/.gitignore b/NAPS2.Sdk.Samples/.gitignore index 30794521b..50815a5c0 100644 --- a/NAPS2.Sdk.Samples/.gitignore +++ b/NAPS2.Sdk.Samples/.gitignore @@ -29,5 +29,4 @@ _ReSharper*/ $tf*/ publish/ bin/ -temp/ -*.credentials.json \ No newline at end of file +temp/ \ No newline at end of file diff --git a/NAPS2.Sdk.ScannerTests/.gitignore b/NAPS2.Sdk.ScannerTests/.gitignore index 30794521b..50815a5c0 100644 --- a/NAPS2.Sdk.ScannerTests/.gitignore +++ b/NAPS2.Sdk.ScannerTests/.gitignore @@ -29,5 +29,4 @@ _ReSharper*/ $tf*/ publish/ bin/ -temp/ -*.credentials.json \ No newline at end of file +temp/ \ No newline at end of file diff --git a/NAPS2.Sdk.Tests/.gitignore b/NAPS2.Sdk.Tests/.gitignore index 30794521b..50815a5c0 100644 --- a/NAPS2.Sdk.Tests/.gitignore +++ b/NAPS2.Sdk.Tests/.gitignore @@ -29,5 +29,4 @@ _ReSharper*/ $tf*/ publish/ bin/ -temp/ -*.credentials.json \ No newline at end of file +temp/ \ No newline at end of file diff --git a/NAPS2.Sdk/.gitignore b/NAPS2.Sdk/.gitignore index 30794521b..50815a5c0 100644 --- a/NAPS2.Sdk/.gitignore +++ b/NAPS2.Sdk/.gitignore @@ -29,5 +29,4 @@ _ReSharper*/ $tf*/ publish/ bin/ -temp/ -*.credentials.json \ No newline at end of file +temp/ \ No newline at end of file diff --git a/NAPS2.Sdk/NAPS2.Sdk.csproj b/NAPS2.Sdk/NAPS2.Sdk.csproj index f5a0378d1..71ff85770 100644 --- a/NAPS2.Sdk/NAPS2.Sdk.csproj +++ b/NAPS2.Sdk/NAPS2.Sdk.csproj @@ -29,15 +29,6 @@ STANDALONE - - - If Not Exist $(ProjectDir)google.credentials.json ( - echo {} > $(ProjectDir)google.credentials.json - ) - If Not Exist $(ProjectDir)microsoft.credentials.json ( - echo { client_id: null, client_secret: null } > $(ProjectDir)microsoft.credentials.json - ) - diff --git a/NAPS2.Tools/.gitignore b/NAPS2.Tools/.gitignore index 30794521b..50815a5c0 100644 --- a/NAPS2.Tools/.gitignore +++ b/NAPS2.Tools/.gitignore @@ -29,5 +29,4 @@ _ReSharper*/ $tf*/ publish/ bin/ -temp/ -*.credentials.json \ No newline at end of file +temp/ \ No newline at end of file