1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-05 23:53:33 +00:00

Compare commits

...

4 Commits

Author SHA1 Message Date
github-actions[bot]
43b7782872 Bumped version to 2.18.0 (#1893)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
(cherry picked from commit cdc41d3bef)
2022-04-27 08:25:37 -07:00
Federico Maccaroni
8f66e2a315 PS-291 Fix password history to update the collection on the main thread to load correctly (#1890) 2022-04-26 09:08:58 -04:00
sneakernuts
8e333e6d14 Switched org
(cherry picked from commit 9fd8dab9d6)
2022-04-22 07:44:22 -06:00
mp-bw
ac7a680a1b update XF and revert old workarounds (#1885) 2022-04-21 21:31:02 -04:00
18 changed files with 37 additions and 79 deletions

View File

@@ -544,7 +544,7 @@ jobs:
|| github.ref == 'refs/heads/hotfix-rc' || github.ref == 'refs/heads/hotfix-rc'
env: env:
APPCENTER_IOS_TOKEN: ${{ steps.retrieve-secrets.outputs.appcenter-ios-token }} APPCENTER_IOS_TOKEN: ${{ steps.retrieve-secrets.outputs.appcenter-ios-token }}
run: appcenter crashes upload-symbols -a kspearrin/bitwarden -s "./bitwarden-export/dSYMs" --token $APPCENTER_IOS_TOKEN run: appcenter crashes upload-symbols -a bitwarden/bitwarden -s "./bitwarden-export/dSYMs" --token $APPCENTER_IOS_TOKEN
shell: bash shell: bash
- name: Deploy to App Store - name: Deploy to App Store

View File

@@ -84,7 +84,7 @@
<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.2.5.2" /> <PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.2.5.2" />
<PackageReference Include="Xamarin.AndroidX.Migration" Version="1.0.8" /> <PackageReference Include="Xamarin.AndroidX.Migration" Version="1.0.8" />
<PackageReference Include="Xamarin.Essentials"> <PackageReference Include="Xamarin.Essentials">
<Version>1.7.1</Version> <Version>1.7.2</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Xamarin.Firebase.Messaging"> <PackageReference Include="Xamarin.Firebase.Messaging">
<Version>122.0.0</Version> <Version>122.0.0</Version>

View File

@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:versionCode="1" android:versionName="2.17.1" android:installLocation="internalOnly" package="com.x8bit.bitwarden"> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:versionCode="1" android:versionName="2.18.0" android:installLocation="internalOnly" package="com.x8bit.bitwarden">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30"/> <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30"/>

View File

@@ -1,13 +1,13 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Android.OS; using Android.OS;
using Android.Security.Keystore; using Android.Security.Keystore;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Java.Security; using Java.Security;
using Javax.Crypto; using Javax.Crypto;
#if !FDROID
using Microsoft.AppCenter.Crashes;
#endif
namespace Bit.Droid.Services namespace Bit.Droid.Services
{ {
@@ -74,6 +74,9 @@ namespace Bit.Droid.Services
catch (InvalidKeyException e) catch (InvalidKeyException e)
{ {
// Fallback for old bitwarden users without a key // Fallback for old bitwarden users without a key
#if !FDROID
Crashes.TrackError(e);
#endif
CreateKey(); CreateKey();
} }
@@ -94,10 +97,13 @@ namespace Bit.Droid.Services
keyGen.Init(keyGenSpec); keyGen.Init(keyGenSpec);
keyGen.GenerateKey(); keyGen.GenerateKey();
} }
catch catch (Exception e)
{ {
// Catch silently to allow biometrics to function on devices that are in a state where key generation // Catch silently to allow biometrics to function on devices that are in a state where key generation
// is not functioning // is not functioning
#if !FDROID
Crashes.TrackError(e);
#endif
} }
} }
} }

View File

@@ -16,10 +16,10 @@
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="4.4.0" /> <PackageReference Include="Microsoft.AppCenter.Crashes" Version="4.4.0" />
<PackageReference Include="Plugin.Fingerprint" Version="2.1.4" /> <PackageReference Include="Plugin.Fingerprint" Version="2.1.4" />
<PackageReference Include="SkiaSharp.Views.Forms" Version="2.80.3" /> <PackageReference Include="SkiaSharp.Views.Forms" Version="2.80.3" />
<PackageReference Include="Xamarin.CommunityToolkit" Version="2.0.0" /> <PackageReference Include="Xamarin.CommunityToolkit" Version="2.0.1" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.1" /> <PackageReference Include="Xamarin.Essentials" Version="1.7.2" />
<PackageReference Include="Xamarin.FFImageLoading.Forms" Version="2.4.11.982" /> <PackageReference Include="Xamarin.FFImageLoading.Forms" Version="2.4.11.982" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2337" /> <PackageReference Include="Xamarin.Forms" Version="5.0.0.2401" />
<PackageReference Include="ZXing.Net.Mobile" Version="2.4.1" /> <PackageReference Include="ZXing.Net.Mobile" Version="2.4.1" />
<PackageReference Include="ZXing.Net.Mobile.Forms" Version="2.4.1" /> <PackageReference Include="ZXing.Net.Mobile.Forms" Version="2.4.1" />
</ItemGroup> </ItemGroup>

View File

@@ -41,8 +41,11 @@ namespace Bit.App.Pages
public async Task InitAsync() public async Task InitAsync()
{ {
var history = await _passwordGenerationService.GetHistoryAsync(); var history = await _passwordGenerationService.GetHistoryAsync();
History.ResetWithRange(history ?? new List<GeneratedPasswordHistory>()); Device.BeginInvokeOnMainThread(() =>
ShowNoData = History.Count == 0; {
History.ResetWithRange(history ?? new List<GeneratedPasswordHistory>());
ShowNoData = History.Count == 0;
});
} }
public async Task ClearAsync() public async Task ClearAsync()

View File

@@ -256,23 +256,24 @@
x:Name="_btnOptions" x:Name="_btnOptions"
StyleClass="box-row-button" StyleClass="box-row-button"
TextColor="{DynamicResource PrimaryColor}" TextColor="{DynamicResource PrimaryColor}"
Margin="0" /> Margin="0"
Clicked="ToggleOptions_Clicked"/>
<controls:IconButton <controls:IconButton
x:Name="_btnOptionsUp" x:Name="_btnOptionsUp"
Text="{Binding Source={x:Static core:BitwardenIcons.ChevronUp}}" Text="{Binding Source={x:Static core:BitwardenIcons.ChevronUp}}"
StyleClass="box-row-button" StyleClass="box-row-button"
TextColor="{DynamicResource PrimaryColor}" TextColor="{DynamicResource PrimaryColor}"
Clicked="ToggleOptions_Clicked" Clicked="ToggleOptions_Clicked"
IsVisible="False" /> IsVisible="{Binding ShowOptions}" />
<controls:IconButton <controls:IconButton
x:Name="_btnOptionsDown" x:Name="_btnOptionsDown"
Text="{Binding Source={x:Static core:BitwardenIcons.AngleDown}}" Text="{Binding Source={x:Static core:BitwardenIcons.AngleDown}}"
StyleClass="box-row-button" StyleClass="box-row-button"
TextColor="{DynamicResource PrimaryColor}" TextColor="{DynamicResource PrimaryColor}"
Clicked="ToggleOptions_Clicked" Clicked="ToggleOptions_Clicked"
IsVisible="False" /> IsVisible="{Binding ShowOptions, Converter={StaticResource inverseBool}}" />
</StackLayout> </StackLayout>
<StackLayout IsVisible="True"> <StackLayout IsVisible="{Binding ShowOptions}">
<StackLayout <StackLayout
StyleClass="box-row" StyleClass="box-row"
Margin="0,10,0,0"> Margin="0,10,0,0">

View File

@@ -53,10 +53,9 @@ namespace Bit.App.Pages
_vm.SegmentedButtonFontSize = 13; _vm.SegmentedButtonFontSize = 13;
_vm.SegmentedButtonMargins = new Thickness(0, 10, 0, 0); _vm.SegmentedButtonMargins = new Thickness(0, 10, 0, 0);
_vm.EditorMargins = new Thickness(0, 5, 0, 0); _vm.EditorMargins = new Thickness(0, 5, 0, 0);
// Review this when https://github.com/bitwarden/mobile/pull/1454 workaround can be reverted _btnOptions.WidthRequest = 70;
//_btnOptions.WidthRequest = 70; _btnOptionsDown.WidthRequest = 30;
//_btnOptionsDown.WidthRequest = 30; _btnOptionsUp.WidthRequest = 30;
//_btnOptionsUp.WidthRequest = 30;
} }
else if (Device.RuntimePlatform == Device.iOS) else if (Device.RuntimePlatform == Device.iOS)
{ {

View File

@@ -732,7 +732,6 @@
<BoxView StyleClass="box-row-separator" /> <BoxView StyleClass="box-row-separator" />
</StackLayout> </StackLayout>
<controls:RepeaterView <controls:RepeaterView
x:Name="_collectionsRepeaterView"
ItemsSource="{Binding Collections}" ItemsSource="{Binding Collections}"
IsVisible="{Binding HasCollections}"> IsVisible="{Binding HasCollections}">
<controls:RepeaterView.ItemTemplate> <controls:RepeaterView.ItemTemplate>

View File

@@ -51,7 +51,6 @@ namespace Bit.App.Pages
_vm.CipherId = cipherId; _vm.CipherId = cipherId;
_vm.FolderId = folderId == "none" ? null : folderId; _vm.FolderId = folderId == "none" ? null : folderId;
_vm.CollectionIds = collectionId != null ? new HashSet<string>(new List<string> { collectionId }) : null; _vm.CollectionIds = collectionId != null ? new HashSet<string>(new List<string> { collectionId }) : null;
_vm.CollectionsRepeaterView = _collectionsRepeaterView;
_vm.Type = type; _vm.Type = type;
_vm.DefaultName = name ?? appOptions?.SaveName; _vm.DefaultName = name ?? appOptions?.SaveName;
_vm.DefaultUri = uri ?? appOptions?.Uri; _vm.DefaultUri = uri ?? appOptions?.Uri;
@@ -171,7 +170,6 @@ namespace Bit.App.Pages
{ {
RequestFocus(_nameEntry); RequestFocus(_nameEntry);
} }
_scrollView.Scrolled += (sender, args) => _vm.HandleScroll();
}); });
// Hide password reprompt option if using key connector // Hide password reprompt option if using key connector
_passwordPrompt.IsVisible = !await _keyConnectorService.GetUsesKeyConnector(); _passwordPrompt.IsVisible = !await _keyConnectorService.GetUsesKeyConnector();

View File

@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.App.Abstractions; using Bit.App.Abstractions;
using Bit.App.Controls;
using Bit.App.Models; using Bit.App.Models;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.Core; using Bit.Core;
@@ -44,7 +43,6 @@ namespace Bit.App.Pages
private int _ownershipSelectedIndex; private int _ownershipSelectedIndex;
private bool _hasCollections; private bool _hasCollections;
private string _previousCipherId; private string _previousCipherId;
private DateTime _lastHandledScrollTime;
private List<Core.Models.View.CollectionView> _writeableCollections; private List<Core.Models.View.CollectionView> _writeableCollections;
private string[] _additionalCipherProperties = new string[] private string[] _additionalCipherProperties = new string[]
{ {
@@ -168,7 +166,7 @@ namespace Bit.App.Pages
public ExtendedObservableCollection<LoginUriView> Uris { get; set; } public ExtendedObservableCollection<LoginUriView> Uris { get; set; }
public ExtendedObservableCollection<AddEditPageFieldViewModel> Fields { get; set; } public ExtendedObservableCollection<AddEditPageFieldViewModel> Fields { get; set; }
public ExtendedObservableCollection<CollectionViewModel> Collections { get; set; } public ExtendedObservableCollection<CollectionViewModel> Collections { get; set; }
public RepeaterView CollectionsRepeaterView { get; set; }
public int TypeSelectedIndex public int TypeSelectedIndex
{ {
get => _typeSelectedIndex; get => _typeSelectedIndex;
@@ -821,30 +819,13 @@ namespace Bit.App.Pages
{ {
var cols = _writeableCollections.Where(c => c.OrganizationId == Cipher.OrganizationId) var cols = _writeableCollections.Where(c => c.OrganizationId == Cipher.OrganizationId)
.Select(c => new CollectionViewModel { Collection = c }).ToList(); .Select(c => new CollectionViewModel { Collection = c }).ToList();
HasCollections = cols.Any();
Collections.ResetWithRange(cols); Collections.ResetWithRange(cols);
Collections = new ExtendedObservableCollection<CollectionViewModel>(cols);
} }
else else
{ {
HasCollections = false;
Collections.ResetWithRange(new List<CollectionViewModel>()); Collections.ResetWithRange(new List<CollectionViewModel>());
Collections = new ExtendedObservableCollection<CollectionViewModel>(new List<CollectionViewModel>());
} }
} HasCollections = Collections.Any();
public void HandleScroll()
{
// workaround for https://github.com/xamarin/Xamarin.Forms/issues/13607
// required for org ownership/collections to render properly in XF4.5+
if (!HasCollections ||
EditMode ||
(DateTime.Now - _lastHandledScrollTime < TimeSpan.FromMilliseconds(200)))
{
return;
}
CollectionsRepeaterView.ItemsSource = Collections;
_lastHandledScrollTime = DateTime.Now;
} }
private void TriggerCipherChanged() private void TriggerCipherChanged()

View File

@@ -1,13 +1,11 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Enums; using Bit.Core.Enums;
using Bit.Core.Models.Data; using Bit.Core.Models.Data;
using Bit.Core.Models.Domain; using Bit.Core.Models.Domain;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using Newtonsoft.Json;
namespace Bit.Core.Services namespace Bit.Core.Services
{ {
@@ -354,7 +352,6 @@ namespace Bit.Core.Services
private async Task<T> GetValueAsync<T>(Storage storage, string key) private async Task<T> GetValueAsync<T>(Storage storage, string key)
{ {
var value = await GetStorageService(storage).GetAsync<T>(key); var value = await GetStorageService(storage).GetAsync<T>(key);
Log("GET", storage, key, JsonConvert.SerializeObject(value));
return value; return value;
} }
@@ -365,13 +362,11 @@ namespace Bit.Core.Services
await RemoveValueAsync(storage, key); await RemoveValueAsync(storage, key);
return; return;
} }
Log("SET", storage, key, JsonConvert.SerializeObject(value));
await GetStorageService(storage).SaveAsync(key, value); await GetStorageService(storage).SaveAsync(key, value);
} }
private async Task RemoveValueAsync(Storage storage, string key) private async Task RemoveValueAsync(Storage storage, string key)
{ {
Log("REMOVE", storage, key, null);
await GetStorageService(storage).RemoveAsync(key); await GetStorageService(storage).RemoveAsync(key);
} }
@@ -387,29 +382,5 @@ namespace Bit.Core.Services
return _liteDbStorageService; return _liteDbStorageService;
} }
} }
private void Log(string tag, Storage storage, string key, string value)
{
// TODO Remove this once all bugs are squished
string text;
switch (storage)
{
case Storage.Secure:
text = "SECURE / ";
break;
case Storage.Prefs:
text = "PREFS / ";
break;
default:
text = "LITEDB / ";
break;
}
text += "Key: " + key + " / ";
if (value != null)
{
text += "Value: " + value;
}
Debug.WriteLine(text, ">>> " + tag);
}
} }
} }

View File

@@ -11,7 +11,7 @@
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>com.8bit.bitwarden.autofill</string> <string>com.8bit.bitwarden.autofill</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>2.17.1</string> <string>2.18.0</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1</string> <string>1</string>
<key>CFBundleLocalizations</key> <key>CFBundleLocalizations</key>

View File

@@ -11,7 +11,7 @@
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>com.8bit.bitwarden.find-login-action-extension</string> <string>com.8bit.bitwarden.find-login-action-extension</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>2.17.1</string> <string>2.18.0</string>
<key>CFBundleLocalizations</key> <key>CFBundleLocalizations</key>
<array> <array>
<string>en</string> <string>en</string>

View File

@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>XPC!</string> <string>XPC!</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>2.17.1</string> <string>2.18.0</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1</string> <string>1</string>
<key>MinimumOSVersion</key> <key>MinimumOSVersion</key>

View File

@@ -167,7 +167,7 @@
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2337" /> <PackageReference Include="Xamarin.Forms" Version="5.0.0.2401" />
<PackageReference Include="Microsoft.AppCenter.Crashes"> <PackageReference Include="Microsoft.AppCenter.Crashes">
<Version>4.4.0</Version> <Version>4.4.0</Version>
</PackageReference> </PackageReference>

View File

@@ -11,7 +11,7 @@
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>com.8bit.bitwarden</string> <string>com.8bit.bitwarden</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>2.17.1</string> <string>2.18.0</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1</string> <string>1</string>
<key>CFBundleIconName</key> <key>CFBundleIconName</key>

View File

@@ -183,7 +183,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Xamarin.Essentials"> <PackageReference Include="Xamarin.Essentials">
<Version>1.7.1</Version> <Version>1.7.2</Version>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" /> <Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />