diff --git a/src/Android/Services/DeviceActionService.cs b/src/Android/Services/DeviceActionService.cs index 933f739da..43799eee3 100644 --- a/src/Android/Services/DeviceActionService.cs +++ b/src/Android/Services/DeviceActionService.cs @@ -318,6 +318,16 @@ namespace Bit.Droid.Services return manager.IsAutofillSupported; } + public int SystemMajorVersion() + { + return (int)Build.VERSION.SdkInt; + } + + public string SystemModel() + { + return Build.Model; + } + private bool DeleteDir(Java.IO.File dir) { if(dir != null && dir.IsDirectory) diff --git a/src/App/Abstractions/IDeviceActionService.cs b/src/App/Abstractions/IDeviceActionService.cs index 9ee2ea512..08a135da6 100644 --- a/src/App/Abstractions/IDeviceActionService.cs +++ b/src/App/Abstractions/IDeviceActionService.cs @@ -21,5 +21,7 @@ namespace Bit.App.Abstractions bool SupportsNfc(); bool SupportsCamera(); bool SupportsAutofillService(); + int SystemMajorVersion(); + string SystemModel(); } } diff --git a/src/iOS/Services/DeviceActionService.cs b/src/iOS/Services/DeviceActionService.cs index 097fd9554..601a0849c 100644 --- a/src/iOS/Services/DeviceActionService.cs +++ b/src/iOS/Services/DeviceActionService.cs @@ -248,6 +248,22 @@ namespace Bit.iOS.Services return true; } + public int SystemMajorVersion() + { + var versionParts = UIDevice.CurrentDevice.SystemVersion.Split('.'); + if(versionParts.Length > 0 && int.TryParse(versionParts[0], out int version)) + { + return version; + } + // unable to determine version + return -1; + } + + public string SystemModel() + { + return UIDevice.CurrentDevice.Model; + } + private void ImagePicker_FinishedPickingMedia(object sender, UIImagePickerMediaPickedEventArgs e) { if(sender is UIImagePickerController picker) @@ -364,16 +380,5 @@ namespace Bit.iOS.Services var documents = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); return Path.Combine(documents, "..", "tmp"); } - - private int SystemMajorVersion() - { - var versionParts = UIDevice.CurrentDevice.SystemVersion.Split('.'); - if(versionParts.Length > 0 && int.TryParse(versionParts[0], out int version)) - { - return version; - } - // unable to determine version - return -1; - } } } \ No newline at end of file