diff --git a/bitwarden-mobile.sln b/bitwarden-mobile.sln index f86e31321..5b4e19d85 100644 --- a/bitwarden-mobile.sln +++ b/bitwarden-mobile.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.539 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29009.5 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Android", "src\Android\Android.csproj", "{304400AF-F0ED-40FA-B102-EA3C3EC43E4F}" EndProject @@ -35,6 +35,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iOS.Core", "src\iOS.Core\iO EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iOS", "src\iOS\iOS.csproj", "{599E0201-420A-4C3E-A7BA-5349F72E0B15}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iOS.Extension", "src\iOS.Extension\iOS.Extension.csproj", "{324BE76C-38FA-4F11-8BB1-95C7B3B1B545}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Ad-Hoc|Any CPU = Ad-Hoc|Any CPU @@ -286,6 +288,34 @@ Global {599E0201-420A-4C3E-A7BA-5349F72E0B15}.Release|iPhone.Build.0 = Release|iPhone {599E0201-420A-4C3E-A7BA-5349F72E0B15}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator {599E0201-420A-4C3E-A7BA-5349F72E0B15}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.Ad-Hoc|Any CPU.ActiveCfg = Release|iPhone + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.Ad-Hoc|Any CPU.Build.0 = Release|iPhone + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.Ad-Hoc|iPhone.ActiveCfg = Release|iPhone + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.Ad-Hoc|iPhone.Build.0 = Release|iPhone + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.AppStore|Any CPU.ActiveCfg = Release|iPhone + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.AppStore|Any CPU.Build.0 = Release|iPhone + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.AppStore|iPhone.ActiveCfg = Release|iPhone + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.AppStore|iPhone.Build.0 = Release|iPhone + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.AppStore|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.AppStore|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.Debug|Any CPU.ActiveCfg = Debug|iPhone + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.Debug|iPhone.ActiveCfg = Debug|iPhone + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.Debug|iPhone.Build.0 = Debug|iPhone + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.FDroid|Any CPU.ActiveCfg = Release|iPhone + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.FDroid|Any CPU.Build.0 = Release|iPhone + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.FDroid|iPhone.ActiveCfg = Release|iPhone + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.FDroid|iPhone.Build.0 = Release|iPhone + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.FDroid|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.FDroid|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.Release|Any CPU.ActiveCfg = Release|iPhone + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.Release|iPhone.ActiveCfg = Release|iPhone + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.Release|iPhone.Build.0 = Release|iPhone + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -299,6 +329,7 @@ Global {256F9E44-0AF5-4D97-A2F9-DA26080C0A5D} = {2E399654-26A2-46F6-B9CA-1B496A3F370A} {E71F3053-056C-4381-9638-048ED73BDFF6} = {D10CA4A9-F866-40E1-B658-F69051236C71} {599E0201-420A-4C3E-A7BA-5349F72E0B15} = {D10CA4A9-F866-40E1-B658-F69051236C71} + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545} = {D10CA4A9-F866-40E1-B658-F69051236C71} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7D436EA3-8B7E-45D2-8D14-0730BD2E0410} diff --git a/src/Android/Android.csproj b/src/Android/Android.csproj index f700e8098..64d9816bc 100644 --- a/src/Android/Android.csproj +++ b/src/Android/Android.csproj @@ -74,7 +74,6 @@ - diff --git a/src/Android/MainApplication.cs b/src/Android/MainApplication.cs index 60a4986ab..d8ba361d2 100644 --- a/src/Android/MainApplication.cs +++ b/src/Android/MainApplication.cs @@ -40,7 +40,7 @@ namespace Bit.Droid if(ServiceContainer.RegisteredServices.Count == 0) { RegisterLocalServices(); - ServiceContainer.Init(new AndroidClientHandler()); + ServiceContainer.Init(); if(App.Migration.MigrationHelpers.NeedsMigration()) { var task = App.Migration.MigrationHelpers.PerformMigrationAsync(); diff --git a/src/Core/Services/ApiService.cs b/src/Core/Services/ApiService.cs index 15d70265f..68ae77ed8 100644 --- a/src/Core/Services/ApiService.cs +++ b/src/Core/Services/ApiService.cs @@ -8,7 +8,6 @@ using Newtonsoft.Json.Linq; using Newtonsoft.Json.Serialization; using System; using System.Collections.Generic; -using System.Linq; using System.Net; using System.Net.Http; using System.Text; @@ -22,7 +21,7 @@ namespace Bit.Core.Services { ContractResolver = new CamelCasePropertyNamesContractResolver() }; - private readonly HttpClient _httpClient; + private readonly HttpClient _httpClient = new HttpClient(); private readonly ITokenService _tokenService; private readonly IPlatformUtilsService _platformUtilsService; private readonly Func _logoutCallbackAsync; @@ -31,22 +30,13 @@ namespace Bit.Core.Services public ApiService( ITokenService tokenService, IPlatformUtilsService platformUtilsService, - Func logoutCallbackAsync, - HttpMessageHandler httpMessageHandler = null) + Func logoutCallbackAsync) { _tokenService = tokenService; _platformUtilsService = platformUtilsService; _logoutCallbackAsync = logoutCallbackAsync; var device = _platformUtilsService.GetDevice(); _deviceType = device.ToString(); - if(httpMessageHandler != null) - { - _httpClient = new HttpClient(httpMessageHandler); - } - else - { - _httpClient = new HttpClient(); - } } public bool UrlsSet { get; private set; } diff --git a/src/Core/Utilities/ServiceContainer.cs b/src/Core/Utilities/ServiceContainer.cs index 29359602e..0b5669d1d 100644 --- a/src/Core/Utilities/ServiceContainer.cs +++ b/src/Core/Utilities/ServiceContainer.cs @@ -2,7 +2,6 @@ using Bit.Core.Services; using System; using System.Collections.Generic; -using System.Net.Http; using System.Threading.Tasks; namespace Bit.Core.Utilities @@ -12,7 +11,7 @@ namespace Bit.Core.Utilities public static Dictionary RegisteredServices { get; set; } = new Dictionary(); public static bool Inited { get; set; } - public static void Init(HttpClientHandler httpClientHandler = null) + public static void Init() { if(Inited) { @@ -32,8 +31,7 @@ namespace Bit.Core.Utilities var cryptoFunctionService = new PclCryptoFunctionService(cryptoPrimitiveService); var cryptoService = new CryptoService(storageService, secureStorageService, cryptoFunctionService); var tokenService = new TokenService(storageService); - var apiService = new ApiService(tokenService, platformUtilsService, (bool expired) => Task.FromResult(0), - httpClientHandler); + var apiService = new ApiService(tokenService, platformUtilsService, (bool expired) => Task.FromResult(0)); var appIdService = new AppIdService(storageService); var userService = new UserService(storageService, tokenService); var settingsService = new SettingsService(userService, storageService); diff --git a/src/iOS.Core/Models/AppExtensionContext.cs b/src/iOS.Core/Models/AppExtensionContext.cs new file mode 100644 index 000000000..7b288e18e --- /dev/null +++ b/src/iOS.Core/Models/AppExtensionContext.cs @@ -0,0 +1,50 @@ +using System; + +namespace Bit.iOS.Core.Models +{ + public class AppExtensionContext + { + private string _uriString; + + public Uri Uri + { + get + { + if(string.IsNullOrWhiteSpace(UrlString) || !Uri.TryCreate(UrlString, UriKind.Absolute, out Uri uri)) + { + return null; + } + return uri; + } + } + + public string UrlString + { + get + { + return _uriString; + } + set + { + _uriString = value; + if(string.IsNullOrWhiteSpace(_uriString)) + { + return; + } + if(!_uriString.StartsWith(Bit.Core.Constants.iOSAppProtocol) && _uriString.Contains(".")) + { + if(!_uriString.Contains("://") && !_uriString.Contains(" ")) + { + _uriString = string.Concat("http://", _uriString); + } + } + if(!_uriString.StartsWith("http") && !_uriString.StartsWith(Bit.Core.Constants.iOSAppProtocol)) + { + _uriString = string.Concat(Bit.Core.Constants.iOSAppProtocol, _uriString); + } + } + } + + public PasswordGenerationOptions PasswordOptions { get; set; } + } +} \ No newline at end of file diff --git a/src/iOS.Core/Models/CipherViewModel.cs b/src/iOS.Core/Models/CipherViewModel.cs new file mode 100644 index 000000000..5aa36d466 --- /dev/null +++ b/src/iOS.Core/Models/CipherViewModel.cs @@ -0,0 +1,42 @@ +using Bit.Core.Enums; +using Bit.Core.Models.View; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Bit.iOS.Core.Models +{ + public class CipherViewModel + { + public CipherViewModel(CipherView cipher) + { + Id = cipher.Id; + Name = cipher.Name; + Username = cipher.Login?.Username; + Password = cipher.Login?.Password; + Totp = cipher.Login?.Totp; + Uris = cipher.Login?.Uris?.Select(u => new LoginUriModel(u)).ToList(); + Fields = cipher.Fields?.Select(f => new Tuple(f.Name, f.Value)).ToList(); + } + + public string Id { get; set; } + public string Name { get; set; } + public string Username { get; set; } + public string Password { get; set; } + public List Uris { get; set; } + public string Totp { get; set; } + public List> Fields { get; set; } + + public class LoginUriModel + { + public LoginUriModel(LoginUriView data) + { + Uri = data?.Uri; + Match = data?.Match; + } + + public string Uri { get; set; } + public UriMatchType? Match { get; set; } + } + } +} diff --git a/src/iOS.Core/Models/PasswordGenerationOptions.cs b/src/iOS.Core/Models/PasswordGenerationOptions.cs new file mode 100644 index 000000000..4c2aa0c8b --- /dev/null +++ b/src/iOS.Core/Models/PasswordGenerationOptions.cs @@ -0,0 +1,13 @@ +using System; + +namespace Bit.iOS.Core.Models +{ + public class PasswordGenerationOptions + { + public int MinLength { get; set; } + public int MaxLength { get; set; } + public bool RequireDigits { get; set; } + public bool RequireSymbols { get; set; } + public string ForbiddenCharacters { get; set; } + } +} diff --git a/src/iOS.Core/iOS.Core.csproj b/src/iOS.Core/iOS.Core.csproj index d5b418526..082ff1fd7 100644 --- a/src/iOS.Core/iOS.Core.csproj +++ b/src/iOS.Core/iOS.Core.csproj @@ -54,6 +54,9 @@ + + + diff --git a/src/iOS.Extension/ActionViewController.cs b/src/iOS.Extension/ActionViewController.cs new file mode 100644 index 000000000..d4c79eeae --- /dev/null +++ b/src/iOS.Extension/ActionViewController.cs @@ -0,0 +1,71 @@ +using System; + +using MobileCoreServices; +using Foundation; +using UIKit; + +namespace iOS.Extension +{ + public partial class ActionViewController : UIViewController + { + public ActionViewController(IntPtr handle) : base(handle) + { + } + + public override void DidReceiveMemoryWarning() + { + // Releases the view if it doesn't have a superview. + base.DidReceiveMemoryWarning(); + + // Release any cached data, images, etc that aren't in use. + } + + public override void ViewDidLoad() + { + base.ViewDidLoad(); + + // Get the item[s] we're handling from the extension context. + + // For example, look for an image and place it into an image view. + // Replace this with something appropriate for the type[s] your extension supports. + bool imageFound = false; + + foreach(var item in ExtensionContext.InputItems) + { + foreach(var itemProvider in item.Attachments) + { + if(itemProvider.HasItemConformingTo(UTType.Image)) + { + // This is an image. We'll load it, then place it in our image view. + itemProvider.LoadItem(UTType.Image, null, delegate (NSObject image, NSError error) + { + if(image != null) + { + NSOperationQueue.MainQueue.AddOperation(delegate + { + imageView.Image = (UIImage)image; + }); + } + }); + + imageFound = true; + break; + } + } + + if(imageFound) + { + // We only handle one image, so stop looking for more. + break; + } + } + } + + partial void DoneClicked(NSObject sender) + { + // Return any edited content to the host app. + // This template doesn't do anything, so we just echo the passed-in items. + ExtensionContext.CompleteRequest(ExtensionContext.InputItems, null); + } + } +} diff --git a/src/iOS.Extension/ActionViewController.designer.cs b/src/iOS.Extension/ActionViewController.designer.cs new file mode 100644 index 000000000..1fcdee7e8 --- /dev/null +++ b/src/iOS.Extension/ActionViewController.designer.cs @@ -0,0 +1,24 @@ +// +// This file has been generated automatically to store outlets and +// actions made in the Xcode designer. If it is removed, they will be lost. +// Manual changes to this file may not be handled correctly. +// +using UIKit; +using Foundation; + +namespace iOS.Extension +{ + [Register("ActionViewController")] + partial class ActionViewController + { + [Outlet] + UIImageView imageView { get; set; } + + [Action("DoneClicked:")] + partial void DoneClicked(NSObject sender); + + void ReleaseDesignerOutlets() + { + } + } +} \ No newline at end of file diff --git a/src/iOS.Extension/AppDelegate.cs b/src/iOS.Extension/AppDelegate.cs new file mode 100644 index 000000000..6dc3fa4a5 --- /dev/null +++ b/src/iOS.Extension/AppDelegate.cs @@ -0,0 +1,30 @@ +using Foundation; +using UIKit; + +namespace Bit.iOS.Extension +{ + [Register("AppDelegate")] + public partial class AppDelegate : UIApplicationDelegate + { + public override UIWindow Window + { + get; set; + } + + public override void OnResignActivation(UIApplication application) + { + } + + public override void DidEnterBackground(UIApplication application) + { + } + + public override void WillEnterForeground(UIApplication application) + { + } + + public override void WillTerminate(UIApplication application) + { + } + } +} diff --git a/src/iOS.Extension/Entitlements.plist b/src/iOS.Extension/Entitlements.plist new file mode 100644 index 000000000..b20900dcc --- /dev/null +++ b/src/iOS.Extension/Entitlements.plist @@ -0,0 +1,14 @@ + + + + + com.apple.security.application-groups + + group.com.8bit.bitwarden + + keychain-access-groups + + $(AppIdentifierPrefix)com.8bit.bitwarden + + + diff --git a/src/iOS.Extension/Info.plist b/src/iOS.Extension/Info.plist new file mode 100644 index 000000000..04213d30a --- /dev/null +++ b/src/iOS.Extension/Info.plist @@ -0,0 +1,109 @@ + + + + + MinimumOSVersion + 10.0 + CFBundleDisplayName + Bitwarden + CFBundleName + Bitwarden Extension + CFBundleIdentifier + com.8bit.bitwarden.find-login-action-extension + CFBundleShortVersionString + 2.0.6 + CFBundleVersion + 50 + CFBundleLocalizations + + en + es + zh-Hans + zh-Hant + pt-PT + pt-BR + sv + sk + it + fi + fr + ro + id + hr + hu + nl + tr + uk + de + dk + cz + nb + ja + et + vi + pl + ko + fa + + CFBundleDevelopmentRegion + en + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + XPC! + CFBundleSignature + ???? + UIDeviceFamily + + 1 + 2 + + UISupportedInterfaceOrientations + + UIAppFonts + + FontAwesome.ttf + MaterialIcons_Regular.ttf + + UIRequiredDeviceCapabilities + + arm64 + + + ITSAppUsesNonExemptEncryption + + ITSEncryptionExportComplianceCode + ecf076d3-4824-4d7b-b716-2a9a47d7d296 + NSFaceIDUsageDescription + Use Face ID to unlock your vault. + NSExtension + + NSExtensionAttributes + + NSExtensionJavaScriptPreprocessingFile + extension + NSExtensionActivationRule + SUBQUERY ( + extensionItems, + $extensionItem, + SUBQUERY ( + $extensionItem.attachments, + $attachment, + ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.url" + || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.plain-text" + || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "org.appextension.find-login-action" + || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "org.appextension.save-login-action" + || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "org.appextension.change-password-action" + || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "org.appextension.fill-webview-action" + || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "org.appextension.fill-browser-action" + || ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "com.8bit.bitwarden.extension-setup" + ).@count == $extensionItem.attachments.@count + ).@count == 1 + + NSExtensionMainStoryboard + MainInterface + NSExtensionPointIdentifier + com.apple.ui-services + + + diff --git a/src/iOS.Extension/Main.cs b/src/iOS.Extension/Main.cs new file mode 100644 index 000000000..d79a88971 --- /dev/null +++ b/src/iOS.Extension/Main.cs @@ -0,0 +1,12 @@ +using UIKit; + +namespace Bit.iOS.Extension +{ + public class Application + { + static void Main(string[] args) + { + UIApplication.Main(args, null, "AppDelegate"); + } + } +} \ No newline at end of file diff --git a/src/iOS.Extension/MainInterface.storyboard b/src/iOS.Extension/MainInterface.storyboard new file mode 100644 index 000000000..76eede89d --- /dev/null +++ b/src/iOS.Extension/MainInterface.storyboard @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/iOS.Extension/Properties/AssemblyInfo.cs b/src/iOS.Extension/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..81d22147a --- /dev/null +++ b/src/iOS.Extension/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// 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("BitwardeniOSExtension")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("8bit Solutions LLC")] +[assembly: AssemblyProduct("Bitwarden")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("324be76c-38fa-4f11-8bb1-95c7b3b1b545")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/iOS.Extension/Resources/Icon.png b/src/iOS.Extension/Resources/Icon.png new file mode 100644 index 000000000..e4b594ad5 Binary files /dev/null and b/src/iOS.Extension/Resources/Icon.png differ diff --git a/src/iOS.Extension/Resources/Icon@2x.png b/src/iOS.Extension/Resources/Icon@2x.png new file mode 100644 index 000000000..37369f4d3 Binary files /dev/null and b/src/iOS.Extension/Resources/Icon@2x.png differ diff --git a/src/iOS.Extension/Resources/Icon@3x.png b/src/iOS.Extension/Resources/Icon@3x.png new file mode 100644 index 000000000..0bfafae46 Binary files /dev/null and b/src/iOS.Extension/Resources/Icon@3x.png differ diff --git a/src/iOS.Extension/Resources/ext-icon.png b/src/iOS.Extension/Resources/ext-icon.png new file mode 100644 index 000000000..2663f2a8e Binary files /dev/null and b/src/iOS.Extension/Resources/ext-icon.png differ diff --git a/src/iOS.Extension/Resources/ext-icon@2x.png b/src/iOS.Extension/Resources/ext-icon@2x.png new file mode 100644 index 000000000..c2ea619de Binary files /dev/null and b/src/iOS.Extension/Resources/ext-icon@2x.png differ diff --git a/src/iOS.Extension/Resources/ext-icon@3x.png b/src/iOS.Extension/Resources/ext-icon@3x.png new file mode 100644 index 000000000..96e4d1ce0 Binary files /dev/null and b/src/iOS.Extension/Resources/ext-icon@3x.png differ diff --git a/src/iOS.Extension/Resources/logo.png b/src/iOS.Extension/Resources/logo.png new file mode 100644 index 000000000..33ced5b12 Binary files /dev/null and b/src/iOS.Extension/Resources/logo.png differ diff --git a/src/iOS.Extension/Resources/logo@2x.png b/src/iOS.Extension/Resources/logo@2x.png new file mode 100644 index 000000000..2a0ba60b9 Binary files /dev/null and b/src/iOS.Extension/Resources/logo@2x.png differ diff --git a/src/iOS.Extension/Resources/logo@3x.png b/src/iOS.Extension/Resources/logo@3x.png new file mode 100644 index 000000000..904731676 Binary files /dev/null and b/src/iOS.Extension/Resources/logo@3x.png differ diff --git a/src/iOS.Extension/Resources/logo_white.png b/src/iOS.Extension/Resources/logo_white.png new file mode 100644 index 000000000..b5856a638 Binary files /dev/null and b/src/iOS.Extension/Resources/logo_white.png differ diff --git a/src/iOS.Extension/Resources/logo_white@2x.png b/src/iOS.Extension/Resources/logo_white@2x.png new file mode 100644 index 000000000..7424b6f77 Binary files /dev/null and b/src/iOS.Extension/Resources/logo_white@2x.png differ diff --git a/src/iOS.Extension/Resources/logo_white@3x.png b/src/iOS.Extension/Resources/logo_white@3x.png new file mode 100644 index 000000000..7d76d07d2 Binary files /dev/null and b/src/iOS.Extension/Resources/logo_white@3x.png differ diff --git a/src/iOS.Extension/extension.js b/src/iOS.Extension/extension.js new file mode 100644 index 000000000..6bbad37f2 --- /dev/null +++ b/src/iOS.Extension/extension.js @@ -0,0 +1,101 @@ +var BitwardenExtension = function () { }; + +BitwardenExtension.prototype = { + run: function (arguments) { + console.log('Run'); + console.log(arguments); + + var args = { + 'url_string': document.URL, + pageDetails: this.collect(document) + }; + + console.log(args); + arguments.completionFunction(args); + }, + finalize: function (arguments) { + console.log('Finalize'); + console.log(arguments); + + if (arguments.fillScript) { + this.fill(document, JSON.parse(arguments.fillScript)); + } + }, + + /* + 1Password Extension + + Lovingly handcrafted by Dave Teare, Michael Fey, Rad Azzouz, and Roustem Karimov. + Copyright (c) 2014 AgileBits. All rights reserved. + + ================================================================================ + + Copyright (c) 2014 AgileBits Inc. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + */ + + collect: function(document, undefined) { + var isFirefox = false, isChrome = false, isSafari = true; + document.elementsByOPID={};document.addEventListener('input',function(b){!1!==b.a&&'input'===b.target.tagName.toLowerCase()&&(b.target.dataset['com.agilebits.onepassword.userEdited']='yes')},!0); + function q(b,d){function f(a,e){var c=a[e];if('string'==typeof c)return c;c=a.getAttribute(e);return'string'==typeof c?c:null}function h(a,e){if(-1===['text','password'].indexOf(e.type.toLowerCase())||!(m.test(a.value)||m.test(a.htmlID)||m.test(a.htmlName)||m.test(a.placeholder)||m.test(a['label-tag'])||m.test(a['label-data'])||m.test(a['label-aria'])))return!1;if(!a.visible)return!0;if('password'==e.type.toLowerCase())return!1;var c=e.type;v(e,!0);return c!==e.type}function n(a){switch(p(a.type)){case 'checkbox':return a.checked? + '✓':'';case 'hidden':a=a.value;if(!a||'number'!=typeof a.length)return'';254\\?]/mg,''):null;return[c?c:null,a.value]}),{options:a}):null}function r(a){var e;for(a=a.parentElement||a.parentNode;a&&'td'!=p(a.tagName);)a=a.parentElement||a.parentNode;if(!a|| + void 0===a)return null;e=a.parentElement||a.parentNode;if('tr'!=e.tagName.toLowerCase())return null;e=e.previousElementSibling;if(!e||'tr'!=(e.tagName+'').toLowerCase()||e.cells&&a.cellIndex>=e.cells.length)return null;a=e.cells[a.cellIndex];a=a.textContent||a.innerText;return a=x(a)}function s(a){var e,c=[];if(a.labels&&a.labels.length&&0b.clientWidth||10>b.clientHeight)return!1;var s=b.getClientRects();if(0===s.length)return!1;for(var g=0;gh||0>r.right)return!1;if(0>l||l>h||0>d||d>n)return!1;for(f=b.ownerDocument.elementFromPoint(l+(f.right>window.innerWidth?(window.innerWidth-l)/2:f.width/2),d+(f.bottom>window.innerHeight? + (window.innerHeight-d)/2:f.height/2));f&&f!==b&&f!==document;){if(f.tagName&&'string'===typeof f.tagName&&'label'===f.tagName.toLowerCase()&&b.labels&&0 + + + Debug + iPhoneSimulator + {324BE76C-38FA-4F11-8BB1-95C7B3B1B545} + {EE2C853D-36AF-4FDB-B1AD-8E90477E2198};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Bit.iOS.Extension + BitwardeniOSExtension + Resources + Properties + + + true + full + false + bin\iPhoneSimulator\Debug + DEBUG + prompt + 4 + false + x86_64 + None + true + + + none + true + bin\iPhoneSimulator\Release + prompt + 4 + None + x86_64 + false + Entitlements.plist + + + true + full + false + bin\iPhone\Debug + DEBUG + prompt + 4 + false + ARM64 + Entitlements.plist + iPhone Developer + true + + + none + true + bin\iPhone\Release + prompt + 4 + Entitlements.plist + ARM64 + false + iPhone Developer + + + + + + + + + + + + ActionViewController.cs + + + + + + + + + + + + + {e71f3053-056c-4381-9638-048ed73bdff6} + iOS.Core + false + false + + + + + Always + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/iOS/AppDelegate.cs b/src/iOS/AppDelegate.cs index 08e602334..93c01acda 100644 --- a/src/iOS/AppDelegate.cs +++ b/src/iOS/AppDelegate.cs @@ -6,7 +6,6 @@ using Bit.App.Abstractions; using Bit.App.Resources; using Bit.App.Services; using Bit.App.Utilities; -using Bit.Core; using Bit.Core.Abstractions; using Bit.Core.Services; using Bit.Core.Utilities; @@ -40,7 +39,7 @@ namespace Bit.iOS public override bool FinishedLaunching(UIApplication app, NSDictionary options) { - Xamarin.Forms.Forms.Init(); + Forms.Init(); InitApp(); Bootstrap(); _deviceActionService = ServiceContainer.Resolve("deviceActionService"); diff --git a/src/iOS/iOS.csproj b/src/iOS/iOS.csproj index c53a67c51..6aab5dc7f 100644 --- a/src/iOS/iOS.csproj +++ b/src/iOS/iOS.csproj @@ -140,7 +140,6 @@ - @@ -166,6 +165,12 @@ false false + + {324be76c-38fa-4f11-8bb1-95c7b3b1b545} + iOS.Extension + true + false +