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

Compare commits

..

1 Commits

Author SHA1 Message Date
Jacob Fink
664d8d1f2c create navigation service 2021-12-30 09:31:56 -05:00
553 changed files with 8678 additions and 22237 deletions

View File

@@ -1,12 +0,0 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-format": {
"version": "5.1.250801",
"commands": [
"dotnet-format"
]
}
}
}

View File

@@ -6,7 +6,6 @@ root = true
# Don't use tabs for indentation. # Don't use tabs for indentation.
[*] [*]
indent_style = space indent_style = space
end_of_line = lf
# (Please don't specify an indent_size here; that has too many unintended consequences.) # (Please don't specify an indent_size here; that has too many unintended consequences.)
# Code files # Code files

View File

@@ -1,2 +0,0 @@
# .NET format https://github.com/bitwarden/mobile/pull/1738
04539af2a66668b6e85476d5cf318c9150ec4357

2
.gitattributes vendored
View File

@@ -1,7 +1,7 @@
############################################################################### ###############################################################################
# Set default behavior to automatically normalize line endings. # Set default behavior to automatically normalize line endings.
############################################################################### ###############################################################################
* text=auto eol=lf * text=auto
############################################################################### ###############################################################################
# Set default behavior for command prompt diff. # Set default behavior for command prompt diff.

View File

@@ -21,8 +21,12 @@
## Testing requirements
<!--What functionality requires testing by QA? This includes testing new behavior and regression testing-->
## Before you submit ## Before you submit
- [ ] I have checked for formatting errors (`dotnet tool run dotnet-format --check`) (required)
- [ ] I have added **unit tests** where it makes sense to do so (encouraged but not required) - [ ] I have added **unit tests** where it makes sense to do so (encouraged but not required)
- [ ] This change requires a **documentation update** (notify the documentation team) - [ ] This change requires a **documentation update** (notify the documentation team)
- [ ] This change has particular **deployment requirements** (notify the DevOps team) - [ ] This change has particular **deployment requirements** (notify the DevOps team)

View File

@@ -12,8 +12,6 @@
<string>Dist: Autofill 2021</string> <string>Dist: Autofill 2021</string>
<key>com.8bit.bitwarden.find-login-action-extension</key> <key>com.8bit.bitwarden.find-login-action-extension</key>
<string>Dist: Extension 2021</string> <string>Dist: Extension 2021</string>
<key>com.8bit.bitwarden.share-extension</key>
<string>Dist: Share Extension 2021</string>
</dict> </dict>
</dict> </dict>
</plist> </plist>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -6,10 +6,6 @@ on:
branches-ignore: branches-ignore:
- 'l10n_master' - 'l10n_master'
- 'gh-pages' - 'gh-pages'
paths-ignore:
- '.github/workflows/**'
workflow_dispatch:
inputs: {}
jobs: jobs:
cloc: cloc:
@@ -17,7 +13,7 @@ jobs:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
- name: Set up CLOC - name: Set up CLOC
run: | run: |
@@ -36,7 +32,7 @@ jobs:
hotfix_branch_exists: ${{ steps.branch-check.outputs.hotfix_branch_exists }} hotfix_branch_exists: ${{ steps.branch-check.outputs.hotfix_branch_exists }}
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
- name: Check if special branches exist - name: Check if special branches exist
id: branch-check id: branch-check
@@ -47,7 +43,7 @@ jobs:
echo "::set-output name=rc_branch_exists::0" echo "::set-output name=rc_branch_exists::0"
fi fi
if [[ $(git ls-remote --heads origin hotfix-rc) ]]; then if [[ $(git ls-remote --heads origin hotfix) ]]; then
echo "::set-output name=hotfix_branch_exists::1" echo "::set-output name=hotfix_branch_exists::1"
else else
echo "::set-output name=hotfix_branch_exists::0" echo "::set-output name=hotfix_branch_exists::0"
@@ -60,13 +56,8 @@ jobs:
runs-on: windows-2019 runs-on: windows-2019
needs: setup needs: setup
steps: steps:
- name: Setup NuGet
uses: nuget/setup-nuget@b2bc17b761a1d88cab755a776c7922eb26eefbfa # v1.0.6
with:
nuget-version: 5.9.0
- name: Set up MSBuild - name: Set up MSBuild
uses: microsoft/setup-msbuild@ab534842b4bdf384b8aaf93765dc6f721d9f5fab uses: microsoft/setup-msbuild@c26a08ba26249b81327e26f6ef381897b6a8754d # v1
- name: Print environment - name: Print environment
run: | run: |
@@ -77,7 +68,7 @@ jobs:
echo "GitHub event: $GITHUB_EVENT" echo "GitHub event: $GITHUB_EVENT"
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
- name: Decrypt secrets - name: Decrypt secrets
env: env:
@@ -110,14 +101,6 @@ jobs:
- name: Restore packages - name: Restore packages
run: nuget restore run: nuget restore
- name: Restore tools
run: dotnet tool restore
shell: pwsh
- name: Verify Format
run: dotnet tool run dotnet-format --check
shell: pwsh
- name: Run Core tests - name: Run Core tests
run: dotnet test test/Core.Test/Core.Test.csproj run: dotnet test test/Core.Test/Core.Test.csproj
@@ -180,14 +163,14 @@ jobs:
shell: pwsh shell: pwsh
- name: Upload Play Store .aab artifact - name: Upload Play Store .aab artifact
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.4
with: with:
name: com.x8bit.bitwarden.aab name: com.x8bit.bitwarden.aab
path: ./com.x8bit.bitwarden.aab path: ./com.x8bit.bitwarden.aab
if-no-files-found: error if-no-files-found: error
- name: Upload Play Store .apk artifact - name: Upload Play Store .apk artifact
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.4
with: with:
name: com.x8bit.bitwarden.apk name: com.x8bit.bitwarden.apk
path: ./com.x8bit.bitwarden.apk path: ./com.x8bit.bitwarden.apk
@@ -199,9 +182,9 @@ jobs:
&& needs.setup.outputs.rc_branch_exists == 0 && needs.setup.outputs.rc_branch_exists == 0
&& needs.setup.outputs.hotfix_branch_exists == 0) && needs.setup.outputs.hotfix_branch_exists == 0)
|| (github.ref == 'refs/heads/rc' && needs.setup.outputs.hotfix_branch_exists == 0) || (github.ref == 'refs/heads/rc' && needs.setup.outputs.hotfix_branch_exists == 0)
|| github.ref == 'refs/heads/hotfix-rc' || github.ref == 'refs/heads/hotfix'
run: | run: |
PUBLISHER_PATH="$GITHUB_WORKSPACE/store/google/Publisher/bin/Release/netcoreapp3.1/Publisher.dll" PUBLISHER_PATH="$GITHUB_WORKSPACE/store/google/Publisher/bin/Release/netcoreapp2.0/Publisher.dll"
CREDS_PATH="$HOME/secrets/play_creds.json" CREDS_PATH="$HOME/secrets/play_creds.json"
AAB_PATH="$GITHUB_WORKSPACE/com.x8bit.bitwarden.aab" AAB_PATH="$GITHUB_WORKSPACE/com.x8bit.bitwarden.aab"
TRACK="internal" TRACK="internal"
@@ -214,13 +197,8 @@ jobs:
name: F-Droid Build name: F-Droid Build
runs-on: windows-2019 runs-on: windows-2019
steps: steps:
- name: Setup NuGet
uses: nuget/setup-nuget@b2bc17b761a1d88cab755a776c7922eb26eefbfa # v1.0.6
with:
nuget-version: 5.9.0
- name: Set up MSBuild - name: Set up MSBuild
uses: microsoft/setup-msbuild@ab534842b4bdf384b8aaf93765dc6f721d9f5fab uses: microsoft/setup-msbuild@c26a08ba26249b81327e26f6ef381897b6a8754d # v1
- name: Print environment - name: Print environment
run: | run: |
@@ -231,7 +209,7 @@ jobs:
echo "GitHub event: $GITHUB_EVENT" echo "GitHub event: $GITHUB_EVENT"
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
- name: Decrypt secrets - name: Decrypt secrets
env: env:
@@ -259,7 +237,6 @@ jobs:
run: | run: |
$androidPath = $($env:GITHUB_WORKSPACE + "/src/Android/Android.csproj"); $androidPath = $($env:GITHUB_WORKSPACE + "/src/Android/Android.csproj");
$appPath = $($env:GITHUB_WORKSPACE + "/src/App/App.csproj"); $appPath = $($env:GITHUB_WORKSPACE + "/src/App/App.csproj");
$corePath = $($env:GITHUB_WORKSPACE + "/src/Core/Core.csproj");
$androidManifest = $($env:GITHUB_WORKSPACE + "/src/Android/Properties/AndroidManifest.xml"); $androidManifest = $($env:GITHUB_WORKSPACE + "/src/Android/Properties/AndroidManifest.xml");
@@ -315,16 +292,16 @@ jobs:
$xml.Save($androidPath); $xml.Save($androidPath);
Write-Output "########################################" Write-Output "########################################"
Write-Output "##### Uninstall from Core.csproj" Write-Output "##### Uninstall from App.csproj"
Write-Output "########################################" Write-Output "########################################"
$xml=New-Object XML; $xml=New-Object XML;
$xml.Load($corePath); $xml.Load($appPath);
$appCenterNode=$xml.SelectSingleNode("/Project/ItemGroup/PackageReference[@Include='Microsoft.AppCenter.Crashes']"); $appCenterNode=$xml.SelectSingleNode("/Project/ItemGroup/PackageReference[@Include='Microsoft.AppCenter.Crashes']");
$appCenterNode.ParentNode.RemoveChild($appCenterNode); $appCenterNode.ParentNode.RemoveChild($appCenterNode);
$xml.Save($corePath); $xml.Save($appPath);
shell: pwsh shell: pwsh
- name: Restore packages - name: Restore packages
@@ -366,7 +343,7 @@ jobs:
shell: pwsh shell: pwsh
- name: Upload F-Droid .apk artifact - name: Upload F-Droid .apk artifact
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.4
with: with:
name: com.x8bit.bitwarden-fdroid.apk name: com.x8bit.bitwarden-fdroid.apk
path: ./com.x8bit.bitwarden-fdroid.apk path: ./com.x8bit.bitwarden-fdroid.apk
@@ -378,11 +355,6 @@ jobs:
runs-on: macos-11 runs-on: macos-11
needs: setup needs: setup
steps: steps:
- name: Setup NuGet
uses: nuget/setup-nuget@b2bc17b761a1d88cab755a776c7922eb26eefbfa # v1.0.6
with:
nuget-version: 5.9.0
- name: Print environment - name: Print environment
run: | run: |
nuget help | grep Version nuget help | grep Version
@@ -392,19 +364,7 @@ jobs:
echo "GitHub event: $GITHUB_EVENT" echo "GitHub event: $GITHUB_EVENT"
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
- name: Login to Azure - Prod Subscription
uses: Azure/login@1f63701bf3e6892515f1b7ce2d2bf1708b46beaf
with:
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
- name: Retrieve secrets
id: retrieve-secrets
uses: Azure/get-keyvault-secrets@b5c723b9ac7870c022b8c35befe620b7009b336f
with:
keyvault: "bitwarden-prod-kv"
secrets: "appcenter-ios-token"
- name: Decrypt secrets - name: Decrypt secrets
env: env:
@@ -422,9 +382,6 @@ jobs:
--output $HOME/secrets/dist_bitwarden.mobileprovision ./.github/secrets/dist_bitwarden.mobileprovision.gpg --output $HOME/secrets/dist_bitwarden.mobileprovision ./.github/secrets/dist_bitwarden.mobileprovision.gpg
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \ gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \
--output $HOME/secrets/dist_extension.mobileprovision ./.github/secrets/dist_extension.mobileprovision.gpg --output $HOME/secrets/dist_extension.mobileprovision ./.github/secrets/dist_extension.mobileprovision.gpg
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \
--output $HOME/secrets/dist_share_extension.mobileprovision \
./.github/secrets/dist_share_extension.mobileprovision.gpg
shell: bash shell: bash
- name: Increment version - name: Increment version
@@ -438,16 +395,6 @@ jobs:
perl -0777 -pi.bak -e 's/<key>CFBundleVersion<\/key>\s*<string>1<\/string>/<key>CFBundleVersion<\/key>\n\t<string>'"$BUILD_NUMBER"'<\/string>/' ./src/iOS/Info.plist perl -0777 -pi.bak -e 's/<key>CFBundleVersion<\/key>\s*<string>1<\/string>/<key>CFBundleVersion<\/key>\n\t<string>'"$BUILD_NUMBER"'<\/string>/' ./src/iOS/Info.plist
perl -0777 -pi.bak -e 's/<key>CFBundleVersion<\/key>\s*<string>1<\/string>/<key>CFBundleVersion<\/key>\n\t<string>'"$BUILD_NUMBER"'<\/string>/' ./src/iOS.Extension/Info.plist perl -0777 -pi.bak -e 's/<key>CFBundleVersion<\/key>\s*<string>1<\/string>/<key>CFBundleVersion<\/key>\n\t<string>'"$BUILD_NUMBER"'<\/string>/' ./src/iOS.Extension/Info.plist
perl -0777 -pi.bak -e 's/<key>CFBundleVersion<\/key>\s*<string>1<\/string>/<key>CFBundleVersion<\/key>\n\t<string>'"$BUILD_NUMBER"'<\/string>/' ./src/iOS.Autofill/Info.plist perl -0777 -pi.bak -e 's/<key>CFBundleVersion<\/key>\s*<string>1<\/string>/<key>CFBundleVersion<\/key>\n\t<string>'"$BUILD_NUMBER"'<\/string>/' ./src/iOS.Autofill/Info.plist
perl -0777 -pi.bak -e 's/<key>CFBundleVersion<\/key>\s*<string>1<\/string>/<key>CFBundleVersion<\/key>\n\t<string>'"$BUILD_NUMBER"'<\/string>/' ./src/iOS.ShareExtension/Info.plist
shell: bash
- name: Update Entitlements
run: |
echo "########################################"
echo "##### Updating Entitlements"
echo "########################################"
perl -0777 -pi.bak -e 's/<key>aps-environment<\/key>\s*<string>development<\/string>/<key>aps-environment<\/key>\n\t<string>production<\/string>/' ./src/iOS/Entitlements.plist
shell: bash shell: bash
- name: Set up Keychain - name: Set up Keychain
@@ -472,7 +419,6 @@ jobs:
AUTOFILL_PROFILE_PATH=$HOME/secrets/dist_autofill.mobileprovision AUTOFILL_PROFILE_PATH=$HOME/secrets/dist_autofill.mobileprovision
BITWARDEN_PROFILE_PATH=$HOME/secrets/dist_bitwarden.mobileprovision BITWARDEN_PROFILE_PATH=$HOME/secrets/dist_bitwarden.mobileprovision
EXTENSION_PROFILE_PATH=$HOME/secrets/dist_extension.mobileprovision EXTENSION_PROFILE_PATH=$HOME/secrets/dist_extension.mobileprovision
SHARE_EXTENSION_PROFILE_PATH=$HOME/secrets/dist_share_extension.mobileprovision
PROFILES_DIR_PATH=$HOME/Library/MobileDevice/Provisioning\ Profiles PROFILES_DIR_PATH=$HOME/Library/MobileDevice/Provisioning\ Profiles
mkdir -p "$PROFILES_DIR_PATH" mkdir -p "$PROFILES_DIR_PATH"
@@ -485,9 +431,6 @@ jobs:
EXTENSION_UUID=$(grep UUID -A1 -a $EXTENSION_PROFILE_PATH | grep -io "[-A-F0-9]\{36\}") EXTENSION_UUID=$(grep UUID -A1 -a $EXTENSION_PROFILE_PATH | grep -io "[-A-F0-9]\{36\}")
cp $EXTENSION_PROFILE_PATH "$PROFILES_DIR_PATH/$EXTENSION_UUID.mobileprovision" cp $EXTENSION_PROFILE_PATH "$PROFILES_DIR_PATH/$EXTENSION_UUID.mobileprovision"
SHARE_EXTENSION_UUID=$(grep UUID -A1 -a $SHARE_EXTENSION_PROFILE_PATH | grep -io "[-A-F0-9]\{36\}")
cp $SHARE_EXTENSION_PROFILE_PATH "$PROFILES_DIR_PATH/$SHARE_EXTENSION_UUID.mobileprovision"
shell: bash shell: bash
- name: Restore packages - name: Restore packages
@@ -520,51 +463,20 @@ jobs:
-exportOptionsPlist $EXPORT_OPTIONS_PATH -exportOptionsPlist $EXPORT_OPTIONS_PATH
shell: bash shell: bash
- name: Copy all dSYMs files to upload - name: Upload App Store .ipa artifact
run: | uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 # v2.2.4
ARCHIVE_DSYMS_PATH="$HOME/Library/Developer/Xcode/Archives/*/*.xcarchive/dSYMs"
EXPORT_PATH="./bitwarden-export"
cp -r $ARCHIVE_DSYMS_PATH $EXPORT_PATH
shell: bash
- name: Upload App Store .ipa & dSYMs artifacts
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535
with: with:
name: Bitwarden iOS name: Bitwarden.ipa
path: | path: ./bitwarden-export/Bitwarden.ipa
./bitwarden-export/Bitwarden.ipa
./bitwarden-export/dSYMs/*.*
if-no-files-found: error if-no-files-found: error
- name: Install AppCenter CLI
if: |
(github.ref == 'refs/heads/master'
&& needs.setup.outputs.rc_branch_exists == 0
&& needs.setup.outputs.hotfix_branch_exists == 0)
|| (github.ref == 'refs/heads/rc' && needs.setup.outputs.hotfix_branch_exists == 0)
|| github.ref == 'refs/heads/hotfix-rc'
run: npm install -g appcenter-cli
- name: Upload dSYMs to App Center
if: |
(github.ref == 'refs/heads/master'
&& needs.setup.outputs.rc_branch_exists == 0
&& needs.setup.outputs.hotfix_branch_exists == 0)
|| (github.ref == 'refs/heads/rc' && needs.setup.outputs.hotfix_branch_exists == 0)
|| github.ref == 'refs/heads/hotfix-rc'
env:
APPCENTER_IOS_TOKEN: ${{ steps.retrieve-secrets.outputs.appcenter-ios-token }}
run: appcenter crashes upload-symbols -a bitwarden/bitwarden -s "./bitwarden-export/dSYMs" --token $APPCENTER_IOS_TOKEN
shell: bash
- name: Deploy to App Store - name: Deploy to App Store
if: | if: |
(github.ref == 'refs/heads/master' (github.ref == 'refs/heads/master'
&& needs.setup.outputs.rc_branch_exists == 0 && needs.setup.outputs.rc_branch_exists == 0
&& needs.setup.outputs.hotfix_branch_exists == 0) && needs.setup.outputs.hotfix_branch_exists == 0)
|| (github.ref == 'refs/heads/rc' && needs.setup.outputs.hotfix_branch_exists == 0) || (github.ref == 'refs/heads/rc' && needs.setup.outputs.hotfix_branch_exists == 0)
|| github.ref == 'refs/heads/hotfix-rc' || github.ref == 'refs/heads/hotfix'
env: env:
APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }} APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
@@ -586,22 +498,22 @@ jobs:
_CROWDIN_PROJECT_ID: "269690" _CROWDIN_PROJECT_ID: "269690"
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
- name: Login to Azure - name: Login to Azure
uses: Azure/login@1f63701bf3e6892515f1b7ce2d2bf1708b46beaf uses: Azure/login@77f1b2e3fb80c0e8645114159d17008b8a2e475a
with: with:
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }} creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
- name: Retrieve secrets - name: Retrieve secrets
id: retrieve-secrets id: retrieve-secrets
uses: Azure/get-keyvault-secrets@b5c723b9ac7870c022b8c35befe620b7009b336f uses: Azure/get-keyvault-secrets@80ccd3fafe5662407cc2e55f202ee34bfff8c403
with: with:
keyvault: "bitwarden-prod-kv" keyvault: "bitwarden-prod-kv"
secrets: "crowdin-api-token" secrets: "crowdin-api-token"
- name: Upload Sources - name: Upload Sources
uses: crowdin/github-action@9237b4cb361788dfce63feb2e2f15c09e2fe7415 uses: crowdin/github-action@e39093fd75daae7859c68eded4b43d42ec78d8ea # v1.3.2
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }} CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }}
@@ -627,7 +539,7 @@ jobs:
if: | if: |
(github.ref == 'refs/heads/master') (github.ref == 'refs/heads/master')
|| (github.ref == 'refs/heads/rc') || (github.ref == 'refs/heads/rc')
|| (github.ref == 'refs/heads/hotfix-rc') || (github.ref == 'refs/heads/hotfix')
env: env:
CLOC_STATUS: ${{ needs.cloc.result }} CLOC_STATUS: ${{ needs.cloc.result }}
ANDROID_STATUS: ${{ needs.android.result }} ANDROID_STATUS: ${{ needs.android.result }}
@@ -648,21 +560,21 @@ jobs:
fi fi
- name: Login to Azure - Prod Subscription - name: Login to Azure - Prod Subscription
uses: Azure/login@1f63701bf3e6892515f1b7ce2d2bf1708b46beaf uses: Azure/login@77f1b2e3fb80c0e8645114159d17008b8a2e475a
if: failure() if: failure()
with: with:
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }} creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
- name: Retrieve secrets - name: Retrieve secrets
id: retrieve-secrets id: retrieve-secrets
uses: Azure/get-keyvault-secrets@b5c723b9ac7870c022b8c35befe620b7009b336f uses: Azure/get-keyvault-secrets@80ccd3fafe5662407cc2e55f202ee34bfff8c403
if: failure() if: failure()
with: with:
keyvault: "bitwarden-prod-kv" keyvault: "bitwarden-prod-kv"
secrets: "devops-alerts-slack-webhook-url" secrets: "devops-alerts-slack-webhook-url"
- name: Notify Slack on failure - name: Notify Slack on failure
uses: act10ns/slack@da3191ebe2e67f49b46880b4633f5591a96d1d33 uses: act10ns/slack@e4e71685b9b239384b0f676a63c32367f59c2522 # v1.2.2
if: failure() if: failure()
env: env:
SLACK_WEBHOOK_URL: ${{ steps.retrieve-secrets.outputs.devops-alerts-slack-webhook-url }} SLACK_WEBHOOK_URL: ${{ steps.retrieve-secrets.outputs.devops-alerts-slack-webhook-url }}

View File

@@ -1,16 +0,0 @@
---
name: Enforce PR labels
on:
pull_request:
types: [labeled, unlabeled, opened, edited, synchronize]
jobs:
enforce-label:
name: EnforceLabel
runs-on: ubuntu-20.04
steps:
- name: Enforce Label
uses: yogevbd/enforce-label-action@8d1e1709b1011e6d90400a0e6cf7c0b77aa5efeb
with:
BANNED_LABELS: "hold"
BANNED_LABELS_DESCRIPTION: "PRs on hold cannot be merged"

View File

@@ -12,7 +12,6 @@ on:
options: options:
- Initial Release - Initial Release
- Redeploy - Redeploy
- Dry Run
jobs: jobs:
release: release:
@@ -22,25 +21,39 @@ jobs:
branch-name: ${{ steps.branch.outputs.branch-name }} branch-name: ${{ steps.branch.outputs.branch-name }}
steps: steps:
- name: Branch check - name: Branch check
if: github.event.inputs.release_type != 'Dry Run'
run: | run: |
if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ "$GITHUB_REF" != "refs/heads/hotfix-rc" ]]; then if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ "$GITHUB_REF" != "refs/heads/hotfix" ]]; then
echo "===================================" echo "==================================="
echo "[!] Can only release from the 'rc' or 'hotfix-rc' branches" echo "[!] Can only release from the 'rc' or 'hotfix' branches"
echo "===================================" echo "==================================="
exit 1 exit 1
fi fi
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
- name: Check Release Version - name: Retrieve Mobile release version
id: version id: retrieve-mobile-version
uses: bitwarden/gh-actions/release-version-check@8f055ef543c7433c967a1b9b04a0f230923233bb run: |
with: ver=$(sed -n -e '/android:versionName/ s/.*\= *//p' ./src/Android/Properties/AndroidManifest.xml | tr -d '"')
release-type: ${{ github.event.inputs.release_type }} echo "::set-output name=mobile_version::${ver}"
project-type: xamarin shell: bash
file: src/Android/Properties/AndroidManifest.xml
- name: Check to make sure Mobile release version has been bumped
if: ${{ github.event.inputs.release_type == 'Initial Release' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
latest_ver=$(hub release -L 1 -f '%T')
latest_ver=${latest_ver:1}
echo "Latest version: $latest_ver"
ver=${{ steps.retrieve-mobile-version.outputs.mobile_version }}
echo "Version: $ver"
if [ "$latest_ver" = "$ver" ]; then
echo "Version has not been bumped!"
exit 1
fi
shell: bash
- name: Get branch name - name: Get branch name
id: branch id: branch
@@ -49,26 +62,22 @@ jobs:
echo "::set-output name=branch-name::$BRANCH_NAME" echo "::set-output name=branch-name::$BRANCH_NAME"
- name: Download all artifacts - name: Download all artifacts
uses: dawidd6/action-download-artifact@575b1e4167df67acf7e692af784566618b23c71e # v2.17.10 uses: dawidd6/action-download-artifact@b9571484721e8187f1fd08147b497129f8972c74 # v2.14.0
with: with:
workflow: build.yml workflow: build.yml
workflow_conclusion: success workflow_conclusion: success
branch: ${{ steps.branch.outputs.branch-name }} branch: ${{ steps.branch.outputs.branch-name }}
- name: Prep Bitwarden iOS release asset
run: zip -r Bitwarden\ iOS.zip Bitwarden\ iOS
- name: Create release - name: Create release
if: github.event.inputs.release_type != 'Dry Run' uses: ncipollo/release-action@95215a3cb6e6a1908b3c44e00b4fdb15548b1e09 # v2.8.5
uses: ncipollo/release-action@40bb172bd05f266cf9ba4ff965cb61e9ee5f6d01 # v1.9.0
with: with:
artifacts: "./com.x8bit.bitwarden.aab/com.x8bit.bitwarden.aab, artifacts: "./com.x8bit.bitwarden.aab/com.x8bit.bitwarden.aab,
./com.x8bit.bitwarden.apk/com.x8bit.bitwarden.apk, ./com.x8bit.bitwarden.apk/com.x8bit.bitwarden.apk,
./com.x8bit.bitwarden-fdroid.apk/com.x8bit.bitwarden-fdroid.apk, ./com.x8bit.bitwarden-fdroid.apk/com.x8bit.bitwarden-fdroid.apk,
./Bitwarden iOS.zip" ./Bitwarden.ipa/Bitwarden.ipa"
commit: ${{ github.sha }} commit: ${{ github.sha }}
tag: v${{ steps.version.outputs.version }} tag: v${{ steps.retrieve-mobile-version.outputs.mobile_version }}
name: Version ${{ steps.version.outputs.version }} name: Version ${{ steps.retrieve-mobile-version.outputs.mobile_version }}
body: "<insert release notes here>" body: "<insert release notes here>"
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
draft: true draft: true
@@ -80,10 +89,10 @@ jobs:
needs: release needs: release
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0 uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
- name: Download F-Droid .apk artifact - name: Download F-Droid .apk artifact
uses: dawidd6/action-download-artifact@575b1e4167df67acf7e692af784566618b23c71e # v2.17.10 uses: dawidd6/action-download-artifact@b9571484721e8187f1fd08147b497129f8972c74 # v2.14.0
with: with:
workflow: build.yml workflow: build.yml
workflow_conclusion: success workflow_conclusion: success
@@ -91,7 +100,7 @@ jobs:
name: com.x8bit.bitwarden-fdroid.apk name: com.x8bit.bitwarden-fdroid.apk
- name: Set up Node - name: Set up Node
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561 # v2.5.1 uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea # v2.3.0
with: with:
node-version: '10.x' node-version: '10.x'
@@ -155,5 +164,4 @@ jobs:
cd $GITHUB_WORKSPACE cd $GITHUB_WORKSPACE
- name: Deploy to gh-pages - name: Deploy to gh-pages
if: github.event.inputs.release_type != 'Dry Run'
run: npm run deploy run: npm run deploy

View File

@@ -27,31 +27,25 @@ jobs:
ref: version_bump_${{ github.event.inputs.version_number }} ref: version_bump_${{ github.event.inputs.version_number }}
- name: Bump Version - Android XML - name: Bump Version - Android XML
uses: bitwarden/gh-actions/version-bump@03ad9a873c39cdc95dd8d77dbbda67f84db43945 uses: bitwarden/gh-actions/version-bump@0c263b3963211ccaf5804313c3b3a0bcc52d4b19
with: with:
version: ${{ github.event.inputs.version_number }} version: ${{ github.event.inputs.version_number }}
file_path: "./src/Android/Properties/AndroidManifest.xml" file_path: "./src/Android/Properties/AndroidManifest.xml"
- name: Bump Version - iOS.Autofill - name: Bump Version - iOS.Autofill
uses: bitwarden/gh-actions/version-bump@03ad9a873c39cdc95dd8d77dbbda67f84db43945 uses: bitwarden/gh-actions/version-bump@0c263b3963211ccaf5804313c3b3a0bcc52d4b19
with: with:
version: ${{ github.event.inputs.version_number }} version: ${{ github.event.inputs.version_number }}
file_path: "./src/iOS.Autofill/Info.plist" file_path: "./src/iOS.Autofill/Info.plist"
- name: Bump Version - iOS.Extension - name: Bump Version - iOS.Extension
uses: bitwarden/gh-actions/version-bump@03ad9a873c39cdc95dd8d77dbbda67f84db43945 uses: bitwarden/gh-actions/version-bump@0c263b3963211ccaf5804313c3b3a0bcc52d4b19
with: with:
version: ${{ github.event.inputs.version_number }} version: ${{ github.event.inputs.version_number }}
file_path: "./src/iOS.Extension/Info.plist" file_path: "./src/iOS.Extension/Info.plist"
- name: Bump Version - iOS.ShareExtension
uses: bitwarden/gh-actions/version-bump@03ad9a873c39cdc95dd8d77dbbda67f84db43945
with:
version: ${{ github.event.inputs.version_number }}
file_path: "./src/iOS.ShareExtension/Info.plist"
- name: Bump Version - iOS - name: Bump Version - iOS
uses: bitwarden/gh-actions/version-bump@03ad9a873c39cdc95dd8d77dbbda67f84db43945 uses: bitwarden/gh-actions/version-bump@0c263b3963211ccaf5804313c3b3a0bcc52d4b19
with: with:
version: ${{ github.event.inputs.version_number }} version: ${{ github.event.inputs.version_number }}
file_path: "./src/iOS/Info.plist" file_path: "./src/iOS/Info.plist"
@@ -84,6 +78,6 @@ jobs:
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps) - [ ] Build/deploy pipeline (DevOps)
- [X] Other - [X] Other
## Objective ## Objective
Automated version bump to ${{ github.event.inputs.version_number }}" Automated version bump to ${{ github.event.inputs.version_number }}"

View File

@@ -1,11 +0,0 @@
---
name: Workflow Linter
on:
pull_request:
paths:
- .github/workflows/**
jobs:
call-workflow:
uses: bitwarden/gh-actions/.github/workflows/workflow-linter.yml@master

View File

@@ -14,7 +14,7 @@ Here is how you can get involved:
* **Write documentation:** Submit a pull request to the [Bitwarden help repository](https://github.com/bitwarden/help) * **Write documentation:** Submit a pull request to the [Bitwarden help repository](https://github.com/bitwarden/help)
* **Help other users:** Go to the [Ask the Bitwarden Community category](https://community.bitwarden.com/c/support/) on the Community Forums * **Help other users:** Go to the [User-to-User Support category](https://community.bitwarden.com/c/support/) on the Community Forums
* **Translate:** See the localization (i10n) section below * **Translate:** See the localization (i10n) section below
@@ -35,6 +35,6 @@ We use a translation tool called [Crowdin](https://crowdin.com) to help manage o
If you are interested in helping translate the Bitwarden mobile app into another language (or make a translation correction), please register an account at Crowdin and join our project here: https://crowdin.com/project/bitwarden-mobile If you are interested in helping translate the Bitwarden mobile app into another language (or make a translation correction), please register an account at Crowdin and join our project here: https://crowdin.com/project/bitwarden-mobile
If the language that you are interested in translating is not already listed, create a new account on Crowdin, join the project, and contact the project owner (https://crowdin.com/profile/dwbit). If the language that you are interested in translating is not already listed, create a new account on Crowdin, join the project, and contact the project owner (https://crowdin.com/profile/kspearrin).
You can read Crowdin's getting started guide for translators here: https://support.crowdin.com/crowdin-intro/ You can read Crowdin's getting started guide for translators here: https://support.crowdin.com/crowdin-intro/

View File

@@ -23,33 +23,9 @@ The Bitwarden mobile application is written in C# with Xamarin Android, Xamarin
- Restore the nuget packages. - Restore the nuget packages.
- Build and run the app. - Build and run the app.
# We're Hiring!
Interested in contributing in a big way? Consider joining our team! We're hiring for many positions. Please take a look at our [Careers page](https://bitwarden.com/careers/) to see what opportunities are currently open as well as what it's like to work at Bitwarden.
# Contribute # Contribute
Code contributions are welcome! Visual Studio with Xamarin is required to work on this project. Please commit any pull requests against the `master` branch. Code contributions are welcome! Visual Studio with Xamarin is required to work on this project. Please commit any pull requests against the `master` branch.
Learn more about how to contribute by reading the [`CONTRIBUTING.md`](CONTRIBUTING.md) file. Learn more about how to contribute by reading the [`CONTRIBUTING.md`](CONTRIBUTING.md) file.
Security audits and feedback are welcome. Please open an issue or email us privately if the report is sensitive in nature. You can read our security policy in the [`SECURITY.md`](SECURITY.md) file. Security audits and feedback are welcome. Please open an issue or email us privately if the report is sensitive in nature. You can read our security policy in the [`SECURITY.md`](SECURITY.md) file.
### Dotnet-format
We recently migrated to using dotnet-format as code formatter. All previous branches will need to updated to avoid large merge conflicts using the following steps:
1. Check out your local Branch
2. Run `git merge e0efcfbe45b2a27c73e9593bfd7a71fad2aa7a35`
3. Resolve any merge conflicts, commit.
4. Run `dotnet tool run dotnet-format`
5. Commit
6. Run `git merge -Xours 04539af2a66668b6e85476d5cf318c9150ec4357`
7. Push
#### Git blame
We also recommend that you configure git to ignore the prettier revision using:
```bash
git config blame.ignoreRevsFile .git-blame-ignore-revs
```

View File

@@ -1,11 +1,39 @@
Bitwarden believes that working with security researchers across the globe is crucial to keeping our users safe. If you believe you've found a security issue in our product or service, we encourage you to please submit a report through our [HackerOne Program](https://hackerone.com/bitwarden/). We welcome working with you to resolve the issue promptly. Thanks in advance! Bitwarden believes that working with security researchers across the globe is crucial to keeping our
users safe. If you believe you've found a security issue in our product or service, we encourage you to
notify us. We welcome working with you to resolve the issue promptly. Thanks in advance!
# Disclosure Policy # Disclosure Policy
- Let us know as soon as possible upon discovery of a potential security issue, and we'll make every effort to quickly resolve the issue. - Let us know as soon as possible upon discovery of a potential security issue, and we'll make every
- Provide us a reasonable amount of time to resolve the issue before any disclosure to the public or a third-party. We may publicly disclose the issue before resolving it, if appropriate. effort to quickly resolve the issue.
- Make a good faith effort to avoid privacy violations, destruction of data, and interruption or degradation of our service. Only interact with accounts you own or with explicit permission of the account holder. - Provide us a reasonable amount of time to resolve the issue before any disclosure to the public or a
- If you would like to encrypt your report, please use the PGP key with long ID `0xDE6887086F892325FEC04CC0D847525B6931381F` (available in the public keyserver pool). third-party. We may publicly disclose the issue before resolving it, if appropriate.
- Make a good faith effort to avoid privacy violations, destruction of data, and interruption or
degradation of our service. Only interact with accounts you own or with explicit permission of the
account holder.
- If you would like to encrypt your report, please use the PGP key with long ID
`0xDE6887086F892325FEC04CC0D847525B6931381F` (available in the public keyserver pool).
# In-scope
- Security issues in any current release of Bitwarden. This includes the web vault, browser extension,
and mobile apps (iOS and Android). Product downloads are available at https://bitwarden.com. Source
code is available at https://github.com/bitwarden.
# Exclusions
The following bug classes are out-of scope:
- Bugs that are already reported on any of Bitwarden's issue trackers (https://github.com/bitwarden),
or that we already know of. Note that some of our issue tracking is private.
- Issues in an upstream software dependency (ex: Xamarin, ASP.NET) which are already reported to the
upstream maintainer.
- Attacks requiring physical access to a user's device.
- Self-XSS
- Issues related to software or protocols not under Bitwarden's control
- Vulnerabilities in outdated versions of Bitwarden
- Missing security best practices that do not directly lead to a vulnerability
- Issues that do not have any impact on the general public
While researching, we'd like to ask you to refrain from: While researching, we'd like to ask you to refrain from:
@@ -14,8 +42,4 @@ While researching, we'd like to ask you to refrain from:
- Social engineering (including phishing) of Bitwarden staff or contractors - Social engineering (including phishing) of Bitwarden staff or contractors
- Any physical attempts against Bitwarden property or data centers - Any physical attempts against Bitwarden property or data centers
# We want to help you!
If you have something that you feel is close to exploitation, or if you'd like some information regarding the internal API, or generally have any questions regarding the app that would help in your efforts, please email us at https://bitwarden.com/contact and ask for that information. As stated above, Bitwarden wants to help you find issues, and is more than willing to help.
Thank you for helping keep Bitwarden and our users safe! Thank you for helping keep Bitwarden and our users safe!

View File

@@ -38,14 +38,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iOS", "src\iOS\iOS.csproj",
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iOS.Extension", "src\iOS.Extension\iOS.Extension.csproj", "{324BE76C-38FA-4F11-8BB1-95C7B3B1B545}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iOS.Extension", "src\iOS.Extension\iOS.Extension.csproj", "{324BE76C-38FA-4F11-8BB1-95C7B3B1B545}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iOS.Autofill", "src\iOS.Autofill\iOS.Autofill.csproj", "{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "test\Common\Common.csproj", "{4085B0A5-12A9-4993-B8B8-4ACE72E62E39}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "test\Common\Common.csproj", "{4085B0A5-12A9-4993-B8B8-4ACE72E62E39}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.Test", "test\Core.Test\Core.Test.csproj", "{8AE548D9-A567-4E97-995E-93EC7DB0FDE0}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core.Test", "test\Core.Test\Core.Test.csproj", "{8AE548D9-A567-4E97-995E-93EC7DB0FDE0}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iOS.ShareExtension", "src\iOS.ShareExtension\iOS.ShareExtension.csproj", "{F8C3F648-EA5A-4719-8005-85D1690B1655}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iOS.Autofill", "src\iOS.Autofill\iOS.Autofill.csproj", "{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
@@ -327,6 +325,35 @@ Global
{324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.Release|iPhone.Build.0 = 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.ActiveCfg = Release|iPhoneSimulator
{324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator {324BE76C-38FA-4F11-8BB1-95C7B3B1B545}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Ad-Hoc|Any CPU.ActiveCfg = Ad-Hoc|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Ad-Hoc|Any CPU.Build.0 = Ad-Hoc|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.AppStore|Any CPU.ActiveCfg = AppStore|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.AppStore|Any CPU.Build.0 = AppStore|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.AppStore|iPhone.ActiveCfg = AppStore|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.AppStore|iPhone.Build.0 = AppStore|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Debug|Any CPU.ActiveCfg = Debug|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Debug|iPhone.ActiveCfg = Debug|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Debug|iPhone.Build.0 = Debug|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Debug|iPhone.Deploy.0 = Debug|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.FDroid|Any CPU.ActiveCfg = Release|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.FDroid|Any CPU.Build.0 = Release|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.FDroid|iPhone.ActiveCfg = Release|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.FDroid|iPhone.Build.0 = Release|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.FDroid|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.FDroid|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Release|Any CPU.ActiveCfg = Release|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Release|iPhone.ActiveCfg = Release|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Release|iPhone.Build.0 = Release|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
{4085B0A5-12A9-4993-B8B8-4ACE72E62E39}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU {4085B0A5-12A9-4993-B8B8-4ACE72E62E39}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
{4085B0A5-12A9-4993-B8B8-4ACE72E62E39}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU {4085B0A5-12A9-4993-B8B8-4ACE72E62E39}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
{4085B0A5-12A9-4993-B8B8-4ACE72E62E39}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU {4085B0A5-12A9-4993-B8B8-4ACE72E62E39}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
@@ -387,65 +414,6 @@ Global
{8AE548D9-A567-4E97-995E-93EC7DB0FDE0}.Release|iPhone.Build.0 = Release|Any CPU {8AE548D9-A567-4E97-995E-93EC7DB0FDE0}.Release|iPhone.Build.0 = Release|Any CPU
{8AE548D9-A567-4E97-995E-93EC7DB0FDE0}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {8AE548D9-A567-4E97-995E-93EC7DB0FDE0}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{8AE548D9-A567-4E97-995E-93EC7DB0FDE0}.Release|iPhoneSimulator.Build.0 = Release|Any CPU {8AE548D9-A567-4E97-995E-93EC7DB0FDE0}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{F8C3F648-EA5A-4719-8005-85D1690B1655}.Ad-Hoc|Any CPU.ActiveCfg = Debug|iPhoneSimulator
{F8C3F648-EA5A-4719-8005-85D1690B1655}.Ad-Hoc|Any CPU.Build.0 = Debug|iPhoneSimulator
{F8C3F648-EA5A-4719-8005-85D1690B1655}.Ad-Hoc|iPhone.ActiveCfg = Release|iPhone
{F8C3F648-EA5A-4719-8005-85D1690B1655}.Ad-Hoc|iPhone.Build.0 = Release|iPhone
{F8C3F648-EA5A-4719-8005-85D1690B1655}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{F8C3F648-EA5A-4719-8005-85D1690B1655}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{F8C3F648-EA5A-4719-8005-85D1690B1655}.AppStore|Any CPU.ActiveCfg = Debug|iPhoneSimulator
{F8C3F648-EA5A-4719-8005-85D1690B1655}.AppStore|Any CPU.Build.0 = Debug|iPhoneSimulator
{F8C3F648-EA5A-4719-8005-85D1690B1655}.AppStore|iPhone.ActiveCfg = Release|iPhone
{F8C3F648-EA5A-4719-8005-85D1690B1655}.AppStore|iPhone.Build.0 = Release|iPhone
{F8C3F648-EA5A-4719-8005-85D1690B1655}.AppStore|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{F8C3F648-EA5A-4719-8005-85D1690B1655}.AppStore|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{F8C3F648-EA5A-4719-8005-85D1690B1655}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
{F8C3F648-EA5A-4719-8005-85D1690B1655}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
{F8C3F648-EA5A-4719-8005-85D1690B1655}.Debug|iPhone.ActiveCfg = Debug|iPhone
{F8C3F648-EA5A-4719-8005-85D1690B1655}.Debug|iPhone.Build.0 = Debug|iPhone
{F8C3F648-EA5A-4719-8005-85D1690B1655}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{F8C3F648-EA5A-4719-8005-85D1690B1655}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{F8C3F648-EA5A-4719-8005-85D1690B1655}.FDroid|Any CPU.ActiveCfg = Debug|iPhoneSimulator
{F8C3F648-EA5A-4719-8005-85D1690B1655}.FDroid|Any CPU.Build.0 = Debug|iPhoneSimulator
{F8C3F648-EA5A-4719-8005-85D1690B1655}.FDroid|iPhone.ActiveCfg = Release|iPhone
{F8C3F648-EA5A-4719-8005-85D1690B1655}.FDroid|iPhone.Build.0 = Release|iPhone
{F8C3F648-EA5A-4719-8005-85D1690B1655}.FDroid|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{F8C3F648-EA5A-4719-8005-85D1690B1655}.FDroid|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{F8C3F648-EA5A-4719-8005-85D1690B1655}.Release|Any CPU.ActiveCfg = Release|iPhone
{F8C3F648-EA5A-4719-8005-85D1690B1655}.Release|Any CPU.Build.0 = Release|iPhone
{F8C3F648-EA5A-4719-8005-85D1690B1655}.Release|iPhone.ActiveCfg = Release|iPhone
{F8C3F648-EA5A-4719-8005-85D1690B1655}.Release|iPhone.Build.0 = Release|iPhone
{F8C3F648-EA5A-4719-8005-85D1690B1655}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{F8C3F648-EA5A-4719-8005-85D1690B1655}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Ad-Hoc|Any CPU.ActiveCfg = Ad-Hoc|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Ad-Hoc|Any CPU.Build.0 = Ad-Hoc|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.AppStore|Any CPU.ActiveCfg = AppStore|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.AppStore|Any CPU.Build.0 = AppStore|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.AppStore|iPhone.ActiveCfg = AppStore|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.AppStore|iPhone.Build.0 = AppStore|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Debug|Any CPU.ActiveCfg = Debug|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Debug|iPhone.ActiveCfg = Debug|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Debug|iPhone.Build.0 = Debug|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Debug|iPhone.Deploy.0 = Debug|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.FDroid|Any CPU.ActiveCfg = Release|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.FDroid|Any CPU.Build.0 = Release|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.FDroid|iPhone.ActiveCfg = Release|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.FDroid|iPhone.Build.0 = Release|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.FDroid|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.FDroid|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Release|Any CPU.ActiveCfg = Release|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Release|iPhone.ActiveCfg = Release|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Release|iPhone.Build.0 = Release|iPhone
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@@ -460,10 +428,9 @@ Global
{E71F3053-056C-4381-9638-048ED73BDFF6} = {D10CA4A9-F866-40E1-B658-F69051236C71} {E71F3053-056C-4381-9638-048ED73BDFF6} = {D10CA4A9-F866-40E1-B658-F69051236C71}
{599E0201-420A-4C3E-A7BA-5349F72E0B15} = {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} {324BE76C-38FA-4F11-8BB1-95C7B3B1B545} = {D10CA4A9-F866-40E1-B658-F69051236C71}
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A} = {D10CA4A9-F866-40E1-B658-F69051236C71}
{4085B0A5-12A9-4993-B8B8-4ACE72E62E39} = {8904C536-C67D-420F-9971-51B26574C3AA} {4085B0A5-12A9-4993-B8B8-4ACE72E62E39} = {8904C536-C67D-420F-9971-51B26574C3AA}
{8AE548D9-A567-4E97-995E-93EC7DB0FDE0} = {8904C536-C67D-420F-9971-51B26574C3AA} {8AE548D9-A567-4E97-995E-93EC7DB0FDE0} = {8904C536-C67D-420F-9971-51B26574C3AA}
{F8C3F648-EA5A-4719-8005-85D1690B1655} = {D10CA4A9-F866-40E1-B658-F69051236C71}
{8A3ECD75-3EC8-4CB3-B3A2-A73A724C279A} = {D10CA4A9-F866-40E1-B658-F69051236C71}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7D436EA3-8B7E-45D2-8D14-0730BD2E0410} SolutionGuid = {7D436EA3-8B7E-45D2-8D14-0730BD2E0410}

View File

@@ -31,8 +31,6 @@ namespace Bit.Droid.Accessibility
// So keep them in sync with: // So keep them in sync with:
// - AutofillHelpers.{TrustedBrowsers,CompatBrowsers} // - AutofillHelpers.{TrustedBrowsers,CompatBrowsers}
// - Resources/xml/autofillservice.xml // - Resources/xml/autofillservice.xml
new Browser("alook.browser", "search_fragment_input_view"),
new Browser("alook.browser.google", "search_fragment_input_view"),
new Browser("com.amazon.cloud9", "url"), new Browser("com.amazon.cloud9", "url"),
new Browser("com.android.browser", "url"), new Browser("com.android.browser", "url"),
new Browser("com.android.chrome", "url_bar"), new Browser("com.android.chrome", "url_bar"),
@@ -56,7 +54,6 @@ namespace Bit.Droid.Accessibility
// Rem. for "com.google.android.captiveportallogin": URL displayed in ActionBar subtitle without viewId. // Rem. for "com.google.android.captiveportallogin": URL displayed in ActionBar subtitle without viewId.
new Browser("com.jamal2367.styx", "search"), new Browser("com.jamal2367.styx", "search"),
new Browser("com.kiwibrowser.browser", "url_bar"), new Browser("com.kiwibrowser.browser", "url_bar"),
new Browser("com.kiwibrowser.browser.dev", "url_bar"),
new Browser("com.microsoft.emmx", "url_bar"), new Browser("com.microsoft.emmx", "url_bar"),
new Browser("com.microsoft.emmx.beta", "url_bar"), new Browser("com.microsoft.emmx.beta", "url_bar"),
new Browser("com.microsoft.emmx.canary", "url_bar"), new Browser("com.microsoft.emmx.canary", "url_bar"),

View File

@@ -10,6 +10,7 @@ using Android.Views;
using Android.Views.Accessibility; using Android.Views.Accessibility;
using Android.Widget; using Android.Widget;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.Core;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Utilities; using Bit.Core.Utilities;
@@ -24,7 +25,7 @@ namespace Bit.Droid.Accessibility
private const string BitwardenPackage = "com.x8bit.bitwarden"; private const string BitwardenPackage = "com.x8bit.bitwarden";
private const string BitwardenWebsite = "vault.bitwarden.com"; private const string BitwardenWebsite = "vault.bitwarden.com";
private IStateService _stateService; private IStorageService _storageService;
private IBroadcasterService _broadcasterService; private IBroadcasterService _broadcasterService;
private DateTime? _lastSettingsReload = null; private DateTime? _lastSettingsReload = null;
private TimeSpan _settingsReloadSpan = TimeSpan.FromMinutes(1); private TimeSpan _settingsReloadSpan = TimeSpan.FromMinutes(1);
@@ -443,9 +444,9 @@ namespace Bit.Droid.Accessibility
private void LoadServices() private void LoadServices()
{ {
if (_stateService == null) if (_storageService == null)
{ {
_stateService = ServiceContainer.Resolve<IStateService>("stateService"); _storageService = ServiceContainer.Resolve<IStorageService>("storageService");
} }
if (_broadcasterService == null) if (_broadcasterService == null)
{ {
@@ -459,12 +460,12 @@ namespace Bit.Droid.Accessibility
if (_lastSettingsReload == null || (now - _lastSettingsReload.Value) > _settingsReloadSpan) if (_lastSettingsReload == null || (now - _lastSettingsReload.Value) > _settingsReloadSpan)
{ {
_lastSettingsReload = now; _lastSettingsReload = now;
var uris = await _stateService.GetAutofillBlacklistedUrisAsync(); var uris = await _storageService.GetAsync<List<string>>(Constants.AutofillBlacklistedUrisKey);
if (uris != null) if (uris != null)
{ {
_blacklistedUris = new HashSet<string>(uris); _blacklistedUris = new HashSet<string>(uris);
} }
var isAutoFillTileAdded = await _stateService.GetAutofillTileAddedAsync(); var isAutoFillTileAdded = await _storageService.GetAsync<bool?>(Constants.AutofillTileAdded);
AccessibilityHelpers.IsAutofillTileAdded = isAutoFillTileAdded.GetValueOrDefault(); AccessibilityHelpers.IsAutofillTileAdded = isAutoFillTileAdded.GetValueOrDefault();
} }
} }

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.3</Version> <Version>1.7.0</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Xamarin.Firebase.Messaging"> <PackageReference Include="Xamarin.Firebase.Messaging">
<Version>122.0.0</Version> <Version>122.0.0</Version>
@@ -145,15 +145,15 @@
<Compile Include="Tiles\GeneratorTileService.cs" /> <Compile Include="Tiles\GeneratorTileService.cs" />
<Compile Include="Tiles\MyVaultTileService.cs" /> <Compile Include="Tiles\MyVaultTileService.cs" />
<Compile Include="Utilities\AndroidHelpers.cs" /> <Compile Include="Utilities\AndroidHelpers.cs" />
<Compile Include="Utilities\AppCenterHelper.cs" />
<Compile Include="Utilities\ThemeHelpers.cs" /> <Compile Include="Utilities\ThemeHelpers.cs" />
<Compile Include="WebAuthCallbackActivity.cs" /> <Compile Include="WebAuthCallbackActivity.cs" />
<Compile Include="Renderers\SelectableLabelRenderer.cs" /> <Compile Include="Renderers\SelectableLabelRenderer.cs" />
<Compile Include="Services\ClipboardService.cs" /> <Compile Include="Services\ClipboardService.cs" />
<Compile Include="Utilities\IntentExtensions.cs" /> <Compile Include="Utilities\IntentExtensions.cs" />
<Compile Include="Renderers\CustomPageRenderer.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<AndroidAsset Include="Assets\bwi-font.ttf" /> <AndroidAsset Include="Assets\FontAwesome.ttf" />
<AndroidAsset Include="Assets\RobotoMono_Regular.ttf" /> <AndroidAsset Include="Assets\RobotoMono_Regular.ttf" />
<AndroidAsset Include="Assets\MaterialIcons_Regular.ttf" /> <AndroidAsset Include="Assets\MaterialIcons_Regular.ttf" />
<None Include="8bit.keystore.enc" /> <None Include="8bit.keystore.enc" />
@@ -171,8 +171,7 @@
<AndroidResource Include="Resources\drawable-xxhdpi\logo_legacy.png" /> <AndroidResource Include="Resources\drawable-xxhdpi\logo_legacy.png" />
<AndroidResource Include="Resources\drawable-xxhdpi\logo_white_legacy.png" /> <AndroidResource Include="Resources\drawable-xxhdpi\logo_white_legacy.png" />
<AndroidResource Include="Resources\drawable\card.xml" /> <AndroidResource Include="Resources\drawable\card.xml" />
<AndroidResource Include="Resources\drawable\cog_environment.xml" /> <AndroidResource Include="Resources\drawable\cog.xml" />
<AndroidResource Include="Resources\drawable\cog_settings.xml" />
<AndroidResource Include="Resources\drawable\icon.xml" /> <AndroidResource Include="Resources\drawable\icon.xml" />
<AndroidResource Include="Resources\drawable\ic_launcher_foreground.xml" /> <AndroidResource Include="Resources\drawable\ic_launcher_foreground.xml" />
<AndroidResource Include="Resources\drawable\ic_warning.xml" /> <AndroidResource Include="Resources\drawable\ic_warning.xml" />
@@ -183,16 +182,15 @@
<AndroidResource Include="Resources\drawable\login.xml" /> <AndroidResource Include="Resources\drawable\login.xml" />
<AndroidResource Include="Resources\drawable\logo.xml" /> <AndroidResource Include="Resources\drawable\logo.xml" />
<AndroidResource Include="Resources\drawable\logo_white.xml" /> <AndroidResource Include="Resources\drawable\logo_white.xml" />
<AndroidResource Include="Resources\drawable\send.xml" /> <AndroidResource Include="Resources\drawable\paper_plane.xml" />
<AndroidResource Include="Resources\drawable\pencil.xml" /> <AndroidResource Include="Resources\drawable\pencil.xml" />
<AndroidResource Include="Resources\drawable\plus.xml" /> <AndroidResource Include="Resources\drawable\plus.xml" />
<AndroidResource Include="Resources\drawable\generate.xml" /> <AndroidResource Include="Resources\drawable\refresh.xml" />
<AndroidResource Include="Resources\drawable\search.xml" /> <AndroidResource Include="Resources\drawable\search.xml" />
<AndroidResource Include="Resources\drawable\shield.xml" /> <AndroidResource Include="Resources\drawable\shield.xml" />
<AndroidResource Include="Resources\drawable-v23\splash_screen.xml" /> <AndroidResource Include="Resources\drawable-v23\splash_screen.xml" />
<AndroidResource Include="Resources\drawable-v23\splash_screen_dark.xml" /> <AndroidResource Include="Resources\drawable-v23\splash_screen_dark.xml" />
<AndroidResource Include="Resources\drawable\switch_thumb.xml" /> <AndroidResource Include="Resources\drawable\switch_thumb.xml" />
<AndroidResource Include="Resources\layout\progress_dialog_layout.xml" />
<AndroidResource Include="Resources\layout\Tabbar.axml" /> <AndroidResource Include="Resources\layout\Tabbar.axml" />
<AndroidResource Include="Resources\layout\Toolbar.axml" /> <AndroidResource Include="Resources\layout\Toolbar.axml" />
<AndroidResource Include="Resources\mipmap-anydpi-v26\ic_launcher.xml" /> <AndroidResource Include="Resources\mipmap-anydpi-v26\ic_launcher.xml" />

Binary file not shown.

Binary file not shown.

View File

@@ -51,8 +51,6 @@ namespace Bit.Droid.Autofill
// - ... to keep this list in sync with values in AccessibilityHelpers.SupportedBrowsers [Section A], too. // - ... to keep this list in sync with values in AccessibilityHelpers.SupportedBrowsers [Section A], too.
public static HashSet<string> CompatBrowsers = new HashSet<string> public static HashSet<string> CompatBrowsers = new HashSet<string>
{ {
"alook.browser",
"alook.browser.google",
"com.amazon.cloud9", "com.amazon.cloud9",
"com.android.browser", "com.android.browser",
"com.android.chrome", "com.android.chrome",
@@ -75,7 +73,6 @@ namespace Bit.Droid.Autofill
"com.google.android.captiveportallogin", "com.google.android.captiveportallogin",
"com.jamal2367.styx", "com.jamal2367.styx",
"com.kiwibrowser.browser", "com.kiwibrowser.browser",
"com.kiwibrowser.browser.dev",
"com.microsoft.emmx", "com.microsoft.emmx",
"com.microsoft.emmx.beta", "com.microsoft.emmx.beta",
"com.microsoft.emmx.canary", "com.microsoft.emmx.canary",
@@ -162,7 +159,7 @@ namespace Bit.Droid.Autofill
return new List<FilledItem>(); return new List<FilledItem>();
} }
public static FillResponse.Builder CreateFillResponse(Parser parser, List<FilledItem> items, bool locked, public static FillResponse BuildFillResponse(Parser parser, List<FilledItem> items, bool locked,
bool inlineAutofillEnabled, FillRequest fillRequest = null) bool inlineAutofillEnabled, FillRequest fillRequest = null)
{ {
// Acquire inline presentation specs on Android 11+ // Acquire inline presentation specs on Android 11+
@@ -213,8 +210,9 @@ namespace Bit.Droid.Autofill
} }
responseBuilder.AddDataset(BuildVaultDataset(parser.ApplicationContext, parser.FieldCollection, responseBuilder.AddDataset(BuildVaultDataset(parser.ApplicationContext, parser.FieldCollection,
parser.Uri, locked, inlinePresentationSpecs)); parser.Uri, locked, inlinePresentationSpecs));
AddSaveInfo(parser, fillRequest, responseBuilder, parser.FieldCollection);
responseBuilder.SetIgnoredIds(parser.FieldCollection.IgnoreAutofillIds.ToArray()); responseBuilder.SetIgnoredIds(parser.FieldCollection.IgnoreAutofillIds.ToArray());
return responseBuilder; return responseBuilder.Build();
} }
public static Dataset BuildDataset(Context context, FieldCollection fields, FilledItem filledItem, public static Dataset BuildDataset(Context context, FieldCollection fields, FilledItem filledItem,

View File

@@ -1,7 +1,4 @@
using System; using Android;
using System.Collections.Generic;
using System.Linq;
using Android;
using Android.App; using Android.App;
using Android.Content; using Android.Content;
using Android.OS; using Android.OS;
@@ -12,6 +9,8 @@ using Bit.Core;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Enums; using Bit.Core.Enums;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System.Collections.Generic;
using System.Linq;
namespace Bit.Droid.Autofill namespace Bit.Droid.Autofill
{ {
@@ -23,141 +22,122 @@ namespace Bit.Droid.Autofill
{ {
private ICipherService _cipherService; private ICipherService _cipherService;
private IVaultTimeoutService _vaultTimeoutService; private IVaultTimeoutService _vaultTimeoutService;
private IStorageService _storageService;
private IPolicyService _policyService; private IPolicyService _policyService;
private IStateService _stateService; private IUserService _userService;
private LazyResolve<ILogger> _logger = new LazyResolve<ILogger>("logger");
public async override void OnFillRequest(FillRequest request, CancellationSignal cancellationSignal, public async override void OnFillRequest(FillRequest request, CancellationSignal cancellationSignal,
FillCallback callback) FillCallback callback)
{ {
try var structure = request.FillContexts?.LastOrDefault()?.Structure;
if (structure == null)
{ {
var structure = request.FillContexts?.LastOrDefault()?.Structure; return;
if (structure == null)
{
return;
}
var parser = new Parser(structure, ApplicationContext);
parser.Parse();
if (_stateService == null)
{
_stateService = ServiceContainer.Resolve<IStateService>("stateService");
}
var shouldAutofill = await parser.ShouldAutofillAsync(_stateService);
if (!shouldAutofill)
{
return;
}
var inlineAutofillEnabled = await _stateService.GetInlineAutofillEnabledAsync() ?? true;
if (_vaultTimeoutService == null)
{
_vaultTimeoutService = ServiceContainer.Resolve<IVaultTimeoutService>("vaultTimeoutService");
}
List<FilledItem> items = null;
await _vaultTimeoutService.CheckVaultTimeoutAsync();
var locked = await _vaultTimeoutService.IsLockedAsync();
if (!locked)
{
if (_cipherService == null)
{
_cipherService = ServiceContainer.Resolve<ICipherService>("cipherService");
}
items = await AutofillHelpers.GetFillItemsAsync(parser, _cipherService);
}
// build response
var response = AutofillHelpers.CreateFillResponse(parser, items, locked, inlineAutofillEnabled, request);
var disableSavePrompt = await _stateService.GetAutofillDisableSavePromptAsync();
if (!disableSavePrompt.GetValueOrDefault())
{
AutofillHelpers.AddSaveInfo(parser, request, response, parser.FieldCollection);
}
callback.OnSuccess(response.Build());
} }
catch (Exception e)
var parser = new Parser(structure, ApplicationContext);
parser.Parse();
if (_storageService == null)
{ {
_logger.Value.Exception(e); _storageService = ServiceContainer.Resolve<IStorageService>("storageService");
} }
var shouldAutofill = await parser.ShouldAutofillAsync(_storageService);
if (!shouldAutofill)
{
return;
}
var inlineAutofillEnabled = await _storageService.GetAsync<bool?>(Constants.InlineAutofillEnabledKey) ?? true;
if (_vaultTimeoutService == null)
{
_vaultTimeoutService = ServiceContainer.Resolve<IVaultTimeoutService>("vaultTimeoutService");
}
List<FilledItem> items = null;
await _vaultTimeoutService.CheckVaultTimeoutAsync();
var locked = await _vaultTimeoutService.IsLockedAsync();
if (!locked)
{
if (_cipherService == null)
{
_cipherService = ServiceContainer.Resolve<ICipherService>("cipherService");
}
items = await AutofillHelpers.GetFillItemsAsync(parser, _cipherService);
}
// build response
var response = AutofillHelpers.BuildFillResponse(parser, items, locked, inlineAutofillEnabled, request);
callback.OnSuccess(response);
} }
public async override void OnSaveRequest(SaveRequest request, SaveCallback callback) public async override void OnSaveRequest(SaveRequest request, SaveCallback callback)
{ {
try var structure = request.FillContexts?.LastOrDefault()?.Structure;
if (structure == null)
{ {
var structure = request.FillContexts?.LastOrDefault()?.Structure; return;
if (structure == null)
{
return;
}
if (_stateService == null)
{
_stateService = ServiceContainer.Resolve<IStateService>("stateService");
}
var disableSavePrompt = await _stateService.GetAutofillDisableSavePromptAsync();
if (disableSavePrompt.GetValueOrDefault())
{
return;
}
_policyService ??= ServiceContainer.Resolve<IPolicyService>("policyService");
var personalOwnershipPolicyApplies = await _policyService.PolicyAppliesToUser(PolicyType.PersonalOwnership);
if (personalOwnershipPolicyApplies)
{
return;
}
var parser = new Parser(structure, ApplicationContext);
parser.Parse();
var savedItem = parser.FieldCollection.GetSavedItem();
if (savedItem == null)
{
Toast.MakeText(this, "Unable to save this form.", ToastLength.Short).Show();
return;
}
var intent = new Intent(this, typeof(MainActivity));
intent.SetFlags(ActivityFlags.NewTask | ActivityFlags.ClearTop);
intent.PutExtra("autofillFramework", true);
intent.PutExtra("autofillFrameworkSave", true);
intent.PutExtra("autofillFrameworkType", (int)savedItem.Type);
switch (savedItem.Type)
{
case CipherType.Login:
intent.PutExtra("autofillFrameworkName", parser.Uri
.Replace(Constants.AndroidAppProtocol, string.Empty)
.Replace("https://", string.Empty)
.Replace("http://", string.Empty));
intent.PutExtra("autofillFrameworkUri", parser.Uri);
intent.PutExtra("autofillFrameworkUsername", savedItem.Login.Username);
intent.PutExtra("autofillFrameworkPassword", savedItem.Login.Password);
break;
case CipherType.Card:
intent.PutExtra("autofillFrameworkCardName", savedItem.Card.Name);
intent.PutExtra("autofillFrameworkCardNumber", savedItem.Card.Number);
intent.PutExtra("autofillFrameworkCardExpMonth", savedItem.Card.ExpMonth);
intent.PutExtra("autofillFrameworkCardExpYear", savedItem.Card.ExpYear);
intent.PutExtra("autofillFrameworkCardCode", savedItem.Card.Code);
break;
default:
Toast.MakeText(this, "Unable to save this type of form.", ToastLength.Short).Show();
return;
}
StartActivity(intent);
} }
catch (Exception e)
if (_storageService == null)
{ {
_logger.Value.Exception(e); _storageService = ServiceContainer.Resolve<IStorageService>("storageService");
} }
var disableSavePrompt = await _storageService.GetAsync<bool?>(Constants.AutofillDisableSavePromptKey);
if (disableSavePrompt.GetValueOrDefault())
{
return;
}
_policyService ??= ServiceContainer.Resolve<IPolicyService>("policyService");
var personalOwnershipPolicyApplies = await _policyService.PolicyAppliesToUser(PolicyType.PersonalOwnership);
if (personalOwnershipPolicyApplies)
{
return;
}
var parser = new Parser(structure, ApplicationContext);
parser.Parse();
var savedItem = parser.FieldCollection.GetSavedItem();
if (savedItem == null)
{
Toast.MakeText(this, "Unable to save this form.", ToastLength.Short).Show();
return;
}
var intent = new Intent(this, typeof(MainActivity));
intent.SetFlags(ActivityFlags.NewTask | ActivityFlags.ClearTop);
intent.PutExtra("autofillFramework", true);
intent.PutExtra("autofillFrameworkSave", true);
intent.PutExtra("autofillFrameworkType", (int)savedItem.Type);
switch (savedItem.Type)
{
case CipherType.Login:
intent.PutExtra("autofillFrameworkName", parser.Uri
.Replace(Constants.AndroidAppProtocol, string.Empty)
.Replace("https://", string.Empty)
.Replace("http://", string.Empty));
intent.PutExtra("autofillFrameworkUri", parser.Uri);
intent.PutExtra("autofillFrameworkUsername", savedItem.Login.Username);
intent.PutExtra("autofillFrameworkPassword", savedItem.Login.Password);
break;
case CipherType.Card:
intent.PutExtra("autofillFrameworkCardName", savedItem.Card.Name);
intent.PutExtra("autofillFrameworkCardNumber", savedItem.Card.Number);
intent.PutExtra("autofillFrameworkCardExpMonth", savedItem.Card.ExpMonth);
intent.PutExtra("autofillFrameworkCardExpYear", savedItem.Card.ExpYear);
intent.PutExtra("autofillFrameworkCardCode", savedItem.Card.Code);
break;
default:
Toast.MakeText(this, "Unable to save this type of form.", ToastLength.Short).Show();
return;
}
StartActivity(intent);
} }
} }
} }

View File

@@ -80,13 +80,13 @@ namespace Bit.Droid.Autofill
} }
} }
public async Task<bool> ShouldAutofillAsync(IStateService stateService) public async Task<bool> ShouldAutofillAsync(IStorageService storageService)
{ {
var fillable = !string.IsNullOrWhiteSpace(Uri) && !AutofillHelpers.BlacklistedUris.Contains(Uri) && var fillable = !string.IsNullOrWhiteSpace(Uri) && !AutofillHelpers.BlacklistedUris.Contains(Uri) &&
FieldCollection != null && FieldCollection.Fillable; FieldCollection != null && FieldCollection.Fillable;
if (fillable) if (fillable)
{ {
var blacklistedUris = await stateService.GetAutofillBlacklistedUrisAsync(); var blacklistedUris = await storageService.GetAsync<List<string>>(Constants.AutofillBlacklistedUrisKey);
if (blacklistedUris != null && blacklistedUris.Count > 0) if (blacklistedUris != null && blacklistedUris.Count > 0)
{ {
fillable = !new HashSet<string>(blacklistedUris).Contains(Uri); fillable = !new HashSet<string>(blacklistedUris).Contains(Uri);

View File

@@ -1,24 +1,25 @@
using System; using Android.App;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Android.App;
using Android.Content;
using Android.Content.PM; using Android.Content.PM;
using Android.Nfc;
using Android.OS;
using Android.Runtime; using Android.Runtime;
using AndroidX.Core.Content; using Android.OS;
using Bit.App.Abstractions;
using Bit.App.Models;
using Bit.App.Utilities;
using Bit.Core; using Bit.Core;
using Bit.Core.Abstractions; using System.Linq;
using Bit.Core.Enums; using Bit.App.Abstractions;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using Bit.Droid.Receivers; using Bit.Core.Abstractions;
using System.IO;
using System;
using Android.Content;
using Bit.Droid.Utilities; using Bit.Droid.Utilities;
using Bit.Droid.Receivers;
using Bit.App.Models;
using Bit.Core.Enums;
using Android.Nfc;
using System.Threading.Tasks;
using AndroidX.Core.Content;
using Bit.App.Utilities;
using ZXing.Net.Mobile.Android; using ZXing.Net.Mobile.Android;
using Android.Util;
namespace Bit.Droid namespace Bit.Droid
{ {
@@ -32,7 +33,7 @@ namespace Bit.Droid
private IDeviceActionService _deviceActionService; private IDeviceActionService _deviceActionService;
private IMessagingService _messagingService; private IMessagingService _messagingService;
private IBroadcasterService _broadcasterService; private IBroadcasterService _broadcasterService;
private IStateService _stateService; private IUserService _userService;
private IAppIdService _appIdService; private IAppIdService _appIdService;
private IEventService _eventService; private IEventService _eventService;
private PendingIntent _eventUploadPendingIntent; private PendingIntent _eventUploadPendingIntent;
@@ -53,7 +54,7 @@ namespace Bit.Droid
_deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService"); _deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService");
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService"); _messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
_broadcasterService = ServiceContainer.Resolve<IBroadcasterService>("broadcasterService"); _broadcasterService = ServiceContainer.Resolve<IBroadcasterService>("broadcasterService");
_stateService = ServiceContainer.Resolve<IStateService>("stateService"); _userService = ServiceContainer.Resolve<IUserService>("userService");
_appIdService = ServiceContainer.Resolve<IAppIdService>("appIdService"); _appIdService = ServiceContainer.Resolve<IAppIdService>("appIdService");
_eventService = ServiceContainer.Resolve<IEventService>("eventService"); _eventService = ServiceContainer.Resolve<IEventService>("eventService");
@@ -69,20 +70,16 @@ namespace Bit.Droid
Window.AddFlags(Android.Views.WindowManagerFlags.Secure); Window.AddFlags(Android.Views.WindowManagerFlags.Secure);
} }
ServiceContainer.Resolve<ILogger>("logger").InitAsync(); #if !FDROID
var appCenterHelper = new AppCenterHelper(_appIdService, _userService);
var toplayout = Window?.DecorView?.RootView; var appCenterTask = appCenterHelper.InitAsync();
if (toplayout != null) #endif
{
toplayout.FilterTouchesWhenObscured = true;
}
Xamarin.Essentials.Platform.Init(this, savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState);
Xamarin.Forms.Forms.Init(this, savedInstanceState); Xamarin.Forms.Forms.Init(this, savedInstanceState);
_appOptions = GetOptions(); _appOptions = GetOptions();
LoadApplication(new App.App(_appOptions)); LoadApplication(new App.App(_appOptions));
_broadcasterService.Subscribe(_activityKey, (message) => _broadcasterService.Subscribe(_activityKey, (message) =>
{ {
if (message.Command == "startEventTimer") if (message.Command == "startEventTimer")
@@ -123,9 +120,6 @@ namespace Bit.Droid
base.OnResume(); base.OnResume();
Xamarin.Essentials.Platform.OnResume(); Xamarin.Essentials.Platform.OnResume();
AppearanceAdjustments(); AppearanceAdjustments();
ThemeManager.UpdateThemeOnPagesAsync();
if (_deviceActionService.SupportsNfc()) if (_deviceActionService.SupportsNfc())
{ {
try try
@@ -379,7 +373,7 @@ namespace Bit.Droid
{ {
Window?.SetStatusBarColor(ThemeHelpers.NavBarBackgroundColor); Window?.SetStatusBarColor(ThemeHelpers.NavBarBackgroundColor);
Window?.DecorView.SetBackgroundColor(ThemeHelpers.BackgroundColor); Window?.DecorView.SetBackgroundColor(ThemeHelpers.BackgroundColor);
ThemeHelpers.SetAppearance(ThemeManager.GetTheme(), ThemeManager.OsDarkModeEnabled()); ThemeHelpers.SetAppearance(ThemeManager.GetTheme(true), ThemeManager.OsDarkModeEnabled());
} }
private void ExitApp() private void ExitApp()

View File

@@ -12,14 +12,12 @@ using Bit.Core.Abstractions;
using Bit.Core.Services; using Bit.Core.Services;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using Bit.Droid.Services; using Bit.Droid.Services;
using Bit.Droid.Utilities;
using Plugin.CurrentActivity; using Plugin.CurrentActivity;
using Plugin.Fingerprint; using Plugin.Fingerprint;
using Xamarin.Android.Net; using Xamarin.Android.Net;
using System.Net.Http; using System.Net.Http;
using System.Net; using System.Net;
using Bit.App.Utilities;
using Bit.App.Pages;
using Bit.App.Utilities.AccountManagement;
#if !FDROID #if !FDROID
using Android.Gms.Security; using Android.Gms.Security;
#endif #endif
@@ -47,30 +45,6 @@ namespace Bit.Droid
var deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService"); var deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService");
ServiceContainer.Init(deviceActionService.DeviceUserAgent, Constants.ClearCiphersCacheKey, ServiceContainer.Init(deviceActionService.DeviceUserAgent, Constants.ClearCiphersCacheKey,
Constants.AndroidAllClearCipherCacheKeys); Constants.AndroidAllClearCipherCacheKeys);
// TODO: Update when https://github.com/bitwarden/mobile/pull/1662 gets merged
var deleteAccountActionFlowExecutioner = new DeleteAccountActionFlowExecutioner(
ServiceContainer.Resolve<IApiService>("apiService"),
ServiceContainer.Resolve<IMessagingService>("messagingService"),
ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService"),
ServiceContainer.Resolve<IDeviceActionService>("deviceActionService"),
ServiceContainer.Resolve<ILogger>("logger"));
ServiceContainer.Register<IDeleteAccountActionFlowExecutioner>("deleteAccountActionFlowExecutioner", deleteAccountActionFlowExecutioner);
var verificationActionsFlowHelper = new VerificationActionsFlowHelper(
ServiceContainer.Resolve<IKeyConnectorService>("keyConnectorService"),
ServiceContainer.Resolve<IPasswordRepromptService>("passwordRepromptService"),
ServiceContainer.Resolve<ICryptoService>("cryptoService"));
ServiceContainer.Register<IVerificationActionsFlowHelper>("verificationActionsFlowHelper", verificationActionsFlowHelper);
var accountsManager = new AccountsManager(
ServiceContainer.Resolve<IBroadcasterService>("broadcasterService"),
ServiceContainer.Resolve<IVaultTimeoutService>("vaultTimeoutService"),
ServiceContainer.Resolve<IStorageService>("secureStorageService"),
ServiceContainer.Resolve<IStateService>("stateService"),
ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService"),
ServiceContainer.Resolve<IAuthService>("authService"));
ServiceContainer.Register<IAccountsManager>("accountsManager", accountsManager);
} }
#if !FDROID #if !FDROID
if (Build.VERSION.SdkInt <= BuildVersionCodes.Kitkat) if (Build.VERSION.SdkInt <= BuildVersionCodes.Kitkat)
@@ -97,14 +71,7 @@ namespace Bit.Droid
private void RegisterLocalServices() private void RegisterLocalServices()
{ {
ServiceContainer.Register<INativeLogService>("nativeLogService", new AndroidLogService()); ServiceContainer.Register<ILogService>("logService", new AndroidLogService());
#if FDROID
ServiceContainer.Register<ILogger>("logger", new StubLogger());
#elif DEBUG
ServiceContainer.Register<ILogger>("logger", DebugLogger.Instance);
#else
ServiceContainer.Register<ILogger>("logger", Logger.Instance);
#endif
// Note: This might cause a race condition. Investigate more. // Note: This might cause a race condition. Investigate more.
Task.Run(() => Task.Run(() =>
@@ -130,17 +97,13 @@ namespace Bit.Droid
var secureStorageService = new SecureStorageService(); var secureStorageService = new SecureStorageService();
var cryptoPrimitiveService = new CryptoPrimitiveService(); var cryptoPrimitiveService = new CryptoPrimitiveService();
var mobileStorageService = new MobileStorageService(preferencesStorage, liteDbStorage); var mobileStorageService = new MobileStorageService(preferencesStorage, liteDbStorage);
var stateService = new StateService(mobileStorageService, secureStorageService, messagingService); var deviceActionService = new DeviceActionService(mobileStorageService, messagingService,
var stateMigrationService =
new StateMigrationService(liteDbStorage, preferencesStorage, secureStorageService);
var clipboardService = new ClipboardService(stateService);
var deviceActionService = new DeviceActionService(clipboardService, stateService, messagingService,
broadcasterService, () => ServiceContainer.Resolve<IEventService>("eventService")); broadcasterService, () => ServiceContainer.Resolve<IEventService>("eventService"));
var platformUtilsService = new MobilePlatformUtilsService(deviceActionService, clipboardService, var platformUtilsService = new MobilePlatformUtilsService(deviceActionService, messagingService,
messagingService, broadcasterService); broadcasterService);
var biometricService = new BiometricService(); var biometricService = new BiometricService();
var cryptoFunctionService = new PclCryptoFunctionService(cryptoPrimitiveService); var cryptoFunctionService = new PclCryptoFunctionService(cryptoPrimitiveService);
var cryptoService = new CryptoService(stateService, cryptoFunctionService); var cryptoService = new CryptoService(mobileStorageService, secureStorageService, cryptoFunctionService);
var passwordRepromptService = new MobilePasswordRepromptService(platformUtilsService, cryptoService); var passwordRepromptService = new MobilePasswordRepromptService(platformUtilsService, cryptoService);
ServiceContainer.Register<IBroadcasterService>("broadcasterService", broadcasterService); ServiceContainer.Register<IBroadcasterService>("broadcasterService", broadcasterService);
@@ -150,9 +113,7 @@ namespace Bit.Droid
ServiceContainer.Register<ICryptoPrimitiveService>("cryptoPrimitiveService", cryptoPrimitiveService); ServiceContainer.Register<ICryptoPrimitiveService>("cryptoPrimitiveService", cryptoPrimitiveService);
ServiceContainer.Register<IStorageService>("storageService", mobileStorageService); ServiceContainer.Register<IStorageService>("storageService", mobileStorageService);
ServiceContainer.Register<IStorageService>("secureStorageService", secureStorageService); ServiceContainer.Register<IStorageService>("secureStorageService", secureStorageService);
ServiceContainer.Register<IStateService>("stateService", stateService); ServiceContainer.Register<IClipboardService>("clipboardService", new ClipboardService(mobileStorageService));
ServiceContainer.Register<IStateMigrationService>("stateMigrationService", stateMigrationService);
ServiceContainer.Register<IClipboardService>("clipboardService", clipboardService);
ServiceContainer.Register<IDeviceActionService>("deviceActionService", deviceActionService); ServiceContainer.Register<IDeviceActionService>("deviceActionService", deviceActionService);
ServiceContainer.Register<IPlatformUtilsService>("platformUtilsService", platformUtilsService); ServiceContainer.Register<IPlatformUtilsService>("platformUtilsService", platformUtilsService);
ServiceContainer.Register<IBiometricService>("biometricService", biometricService); ServiceContainer.Register<IBiometricService>("biometricService", biometricService);
@@ -171,7 +132,7 @@ namespace Bit.Droid
ServiceContainer.Register<IPushNotificationListenerService>( ServiceContainer.Register<IPushNotificationListenerService>(
"pushNotificationListenerService", notificationListenerService); "pushNotificationListenerService", notificationListenerService);
var androidPushNotificationService = new AndroidPushNotificationService( var androidPushNotificationService = new AndroidPushNotificationService(
stateService, notificationListenerService); mobileStorageService, notificationListenerService);
ServiceContainer.Register<IPushNotificationService>( ServiceContainer.Register<IPushNotificationService>(
"pushNotificationService", androidPushNotificationService); "pushNotificationService", androidPushNotificationService);
#endif #endif
@@ -187,6 +148,10 @@ namespace Bit.Droid
private async Task BootstrapAsync() private async Task BootstrapAsync()
{ {
var disableFavicon = await ServiceContainer.Resolve<IStorageService>("storageService")
.GetAsync<bool?>(Constants.DisableFaviconKey);
await ServiceContainer.Resolve<IStateService>("stateService").SaveAsync(
Constants.DisableFaviconKey, disableFavicon);
await ServiceContainer.Resolve<IEnvironmentService>("environmentService").SetUrlsFromStorageAsync(); await ServiceContainer.Resolve<IEnvironmentService>("environmentService").SetUrlsFromStorageAsync();
} }
} }

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="2022.6.2" 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.15.1" 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

@@ -16,10 +16,10 @@ namespace Bit.Droid.Push
{ {
public async override void OnNewToken(string token) public async override void OnNewToken(string token)
{ {
var stateService = ServiceContainer.Resolve<IStateService>("stateService"); var storageService = ServiceContainer.Resolve<IStorageService>("storageService");
var pushNotificationService = ServiceContainer.Resolve<IPushNotificationService>("pushNotificationService"); var pushNotificationService = ServiceContainer.Resolve<IPushNotificationService>("pushNotificationService");
await stateService.SetPushRegisteredTokenAsync(token); await storageService.SaveAsync(Core.Constants.PushRegisteredTokenKey, token);
await pushNotificationService.RegisterAsync(); await pushNotificationService.RegisterAsync();
} }

View File

@@ -1,4 +1,5 @@
using Android.App; using System;
using Android.App;
using Android.Content; using Android.Content;
using Bit.App.Abstractions; using Bit.App.Abstractions;
using Bit.App.Utilities; using Bit.App.Utilities;
@@ -13,10 +14,9 @@ namespace Bit.Droid.Receivers
{ {
public override async void OnReceive(Context context, Intent intent) public override async void OnReceive(Context context, Intent intent)
{ {
await AppHelpers.PerformUpdateTasksAsync( var storageService = ServiceContainer.Resolve<IStorageService>("storageService");
ServiceContainer.Resolve<ISyncService>("syncService"), await AppHelpers.PerformUpdateTasksAsync(ServiceContainer.Resolve<ISyncService>("syncService"),
ServiceContainer.Resolve<IDeviceActionService>("deviceActionService"), ServiceContainer.Resolve<IDeviceActionService>("deviceActionService"), storageService);
ServiceContainer.Resolve<IStateService>("stateService"));
} }
} }
} }

View File

@@ -1,31 +0,0 @@
using System;
using Android.App;
using Android.Content;
using AndroidX.AppCompat.Widget;
using Bit.App.Resources;
using Bit.Droid.Renderers;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
[assembly: ExportRenderer(typeof(ContentPage), typeof(CustomPageRenderer))]
namespace Bit.Droid.Renderers
{
public class CustomPageRenderer : PageRenderer
{
public CustomPageRenderer(Context context) : base(context)
{
}
protected override void OnElementChanged(ElementChangedEventArgs<Page> e)
{
base.OnElementChanged(e);
Activity context = (Activity)this.Context;
var toolbar = context.FindViewById<Toolbar>(Resource.Id.toolbar);
if(toolbar != null)
{
toolbar.NavigationContentDescription = AppResources.TapToGoBack;
}
}
}
}

View File

@@ -1,9 +1,7 @@
using Android.Content; using Android.Content;
using Android.Views; using Android.Views;
using Bit.App.Pages;
using Bit.Droid.Renderers; using Bit.Droid.Renderers;
using Google.Android.Material.BottomNavigation; using Google.Android.Material.BottomNavigation;
using Google.Android.Material.Navigation;
using Xamarin.Forms; using Xamarin.Forms;
using Xamarin.Forms.Platform.Android; using Xamarin.Forms.Platform.Android;
using Xamarin.Forms.Platform.Android.AppCompat; using Xamarin.Forms.Platform.Android.AppCompat;
@@ -11,7 +9,7 @@ using Xamarin.Forms.Platform.Android.AppCompat;
[assembly: ExportRenderer(typeof(TabbedPage), typeof(CustomTabbedRenderer))] [assembly: ExportRenderer(typeof(TabbedPage), typeof(CustomTabbedRenderer))]
namespace Bit.Droid.Renderers namespace Bit.Droid.Renderers
{ {
public class CustomTabbedRenderer : TabbedPageRenderer, NavigationBarView.IOnItemReselectedListener public class CustomTabbedRenderer : TabbedPageRenderer, BottomNavigationView.IOnNavigationItemReselectedListener
{ {
private TabbedPage _page; private TabbedPage _page;
@@ -23,7 +21,7 @@ namespace Bit.Droid.Renderers
if (e.NewElement != null) if (e.NewElement != null)
{ {
_page = e.NewElement; _page = e.NewElement;
GetBottomNavigationView()?.SetOnItemReselectedListener(this); GetBottomNavigationView()?.SetOnNavigationItemReselectedListener(this);
} }
else else
{ {
@@ -55,10 +53,6 @@ namespace Bit.Droid.Renderers
{ {
if (_page?.CurrentPage?.Navigation != null && _page.CurrentPage.Navigation.NavigationStack.Count > 0) if (_page?.CurrentPage?.Navigation != null && _page.CurrentPage.Navigation.NavigationStack.Count > 0)
{ {
if (_page is TabsPage tabsPage)
{
tabsPage.OnPageReselected();
}
Device.BeginInvokeOnMainThread(async () => await _page.CurrentPage.Navigation.PopToRootAsync()); Device.BeginInvokeOnMainThread(async () => await _page.CurrentPage.Navigation.PopToRootAsync());
} }
} }

View File

@@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="640dp" android:width="24dp"
android:height="512dp" android:height="24dp"
android:viewportWidth="640" android:viewportWidth="2048"
android:viewportHeight="512"> android:viewportHeight="2048">
<path <path
android:fillColor="#FF777777" android:fillColor="#FF777777"
android:pathData="M532.864 80h-425.728c-12.067 0.695-23.371 6.129-31.451 15.118s-12.279 20.808-11.686 32.882v256c-0.594 12.074 3.606 23.891 11.686 32.88 8.079 8.992 19.383 14.425 31.451 15.12h425.599c12.090-0.663 23.427-6.083 31.533-15.075 8.109-8.995 12.327-20.832 11.731-32.925v-256c0.595-12.073-3.606-23.891-11.683-32.882-8.080-8.99-19.385-14.424-31.453-15.118v0zM107.264 112h425.6c4.013 0.248 7.766 2.066 10.451 5.059 2.682 2.995 4.077 6.925 3.885 10.941v28.8c0.186 3.465-1.011 6.862-3.328 9.447-2.313 2.585-5.558 4.147-9.024 4.345h-429.728c-3.459-0.207-6.695-1.773-9.003-4.356s-3.501-5.976-3.317-9.436v-28.8c-0.192-4.016 1.204-7.946 3.886-10.941s6.437-4.812 10.45-5.059h0.128zM532.864 399.808h-425.728c-3.978-0.247-7.703-2.038-10.38-4.992-2.677-2.95-4.097-6.832-3.956-10.816v-167.424c-0.183-3.465 1.013-6.862 3.329-9.446s5.559-4.147 9.023-4.345h429.76c3.466 0.198 6.711 1.761 9.024 4.345 2.317 2.584 3.514 5.982 3.328 9.447v167.424c0.192 4.026-1.213 7.965-3.907 10.963-2.697 2.995-6.467 4.806-10.493 5.037v-0.192zM494.496 340.96h-75.296c-2.717 0.358-5.213 1.69-7.021 3.75s-2.803 4.711-2.803 7.45c0 2.743 0.995 5.389 2.803 7.45s4.304 3.395 7.021 3.75h75.424c2.72-0.355 5.216-1.69 7.024-3.75s2.803-4.707 2.803-7.45c0-2.739-0.995-5.389-2.803-7.45s-4.304-3.392-7.024-3.75h-0.128z" /> android:pathData="M1824,256C1868,256 1905.67,271.67 1937,303C1968.33,334.33 1984,372 1984,416L1984,1632C1984,1676 1968.33,1713.67 1937,1745C1905.67,1776.33 1868,1792 1824,1792L224,1792C180,1792 142.33,1776.33 111,1745C79.67,1713.67 64,1676 64,1632L64,416C64,372 79.67,334.33 111,303C142.33,271.67 180,256 224,256L1824,256ZM224,384C215.33,384 207.83,387.17 201.5,393.5C195.17,399.83 192,407.33 192,416L192,640L1856,640L1856,416C1856,407.33 1852.83,399.83 1846.5,393.5C1840.17,387.17 1832.67,384 1824,384L224,384ZM1824,1664C1832.67,1664 1840.17,1660.83 1846.5,1654.5C1852.83,1648.17 1856,1640.67 1856,1632L1856,1024L192,1024L192,1632C192,1640.67 195.17,1648.17 201.5,1654.5C207.83,1660.83 215.33,1664 224,1664L1824,1664ZM320,1536L320,1408L576,1408L576,1536L320,1536ZM704,1536L704,1408L1088,1408L1088,1536L704,1536Z" />
</vector> </vector>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="1792"
android:viewportHeight="1792">
<path
android:fillColor="#FF000000"
android:pathData="M1152,896q0,-106 -75,-181t-181,-75 -181,75 -75,181 75,181 181,75 181,-75 75,-181zM1664,787v222q0,12 -8,23t-20,13l-185,28q-19,54 -39,91 35,50 107,138 10,12 10,25t-9,23q-27,37 -99,108t-94,71q-12,0 -26,-9l-138,-108q-44,23 -91,38 -16,136 -29,186 -7,28 -36,28h-222q-14,0 -24.5,-8.5t-11.5,-21.5l-28,-184q-49,-16 -90,-37l-141,107q-10,9 -25,9 -14,0 -25,-11 -126,-114 -165,-168 -7,-10 -7,-23 0,-12 8,-23 15,-21 51,-66.5t54,-70.5q-27,-50 -41,-99l-183,-27q-13,-2 -21,-12.5t-8,-23.5v-222q0,-12 8,-23t19,-13l186,-28q14,-46 39,-92 -40,-57 -107,-138 -10,-12 -10,-24 0,-10 9,-23 26,-36 98.5,-107.5t94.5,-71.5q13,0 26,10l138,107q44,-23 91,-38 16,-136 29,-186 7,-28 36,-28h222q14,0 24.5,8.5t11.5,21.5l28,184q49,16 90,37l142,-107q9,-9 24,-9 13,0 25,10 129,119 165,170 7,8 7,22 0,12 -8,23 -15,21 -51,66.5t-54,70.5q26,50 41,98l183,28q13,2 21,12.5t8,23.5z" />
</vector>

View File

@@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="640dp"
android:height="512dp"
android:viewportWidth="640"
android:viewportHeight="512">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M532.989 289.887l-3.872-2.528c-3.197-1.866-5.744-4.667-7.299-8.026-1.558-3.358-2.048-7.113-1.405-10.759v-24.64c-0.682-3.57-0.202-7.266 1.37-10.542s4.154-5.964 7.366-7.666l4.768-2.4c12.013-7.054 20.768-18.547 24.384-32 3.421-13.333 1.661-27.466-4.928-39.552l-25.056-43.872c-7.011-11.727-18.259-20.313-31.418-23.987-13.161-3.674-27.229-2.155-39.303 4.243l-4.384 2.208c-3.286 1.769-6.983 2.63-10.711 2.496-3.731-0.135-7.357-1.261-10.505-3.263-7.082-4.796-14.579-8.951-22.4-12.416-3.28-1.636-6.038-4.157-7.962-7.278s-2.935-6.719-2.918-10.386v-6.528c0.099-6.965-1.197-13.879-3.808-20.335s-6.49-12.326-11.401-17.264c-4.915-4.937-10.765-8.842-17.209-11.486s-13.351-3.972-20.317-3.907h-51.2c-6.952-0.043-13.842 1.301-20.267 3.954s-12.257 6.561-17.154 11.496c-4.896 4.935-8.758 10.797-11.361 17.243s-3.892 13.347-3.794 20.298v5.472c0.032 3.614-0.938 7.165-2.802 10.261s-4.55 5.614-7.758 7.275c-5.691 2.572-11.197 5.533-16.48 8.864l-6.080 3.584c-3.102 2.221-6.788 3.481-10.6 3.623s-7.582-0.839-10.84-2.823l-3.968-1.952c-5.856-3.516-12.377-5.778-19.153-6.642s-13.656-0.314-20.208 1.618c-13.446 3.716-24.885 12.58-31.84 24.672l-24.96 43.68c-3.566 6.048-5.867 12.757-6.763 19.721s-0.37 14.037 1.547 20.791c1.743 6.495 4.779 12.571 8.925 17.866s9.317 9.699 15.203 12.95l2.88 2.848 1.312 0.928c3.197 1.867 5.744 4.667 7.3 8.026s2.046 7.113 1.403 10.758v24.704c0.326 3.533-0.314 7.087-1.853 10.283s-3.918 5.913-6.883 7.861l-4.768 2.4c-11.724 7.217-20.258 18.63-23.866 31.917s-2.020 27.447 4.442 39.603l25.088 43.872c6.806 11.955 18.058 20.739 31.308 24.445 13.25 3.702 27.425 2.026 39.445-4.669l4.352-2.176c3.287-1.792 6.994-2.669 10.736-2.547 3.742 0.125 7.382 1.248 10.544 3.251 7.082 4.797 14.578 8.954 22.4 12.416 3.281 1.635 6.038 4.157 7.962 7.28 1.923 3.12 2.934 6.717 2.918 10.384v5.472c-0.102 6.954 1.185 13.859 3.788 20.31s6.468 12.317 11.368 17.251c4.901 4.938 10.738 8.845 17.169 11.495s13.327 3.987 20.282 3.936h51.2c6.957 0.051 13.856-1.286 20.288-3.936s12.272-6.557 17.175-11.491c4.902-4.938 8.771-10.8 11.379-17.251 2.605-6.451 3.897-13.357 3.798-20.313v-5.472c-0.032-3.613 0.938-7.165 2.803-10.259 1.863-3.098 4.547-5.616 7.757-7.277 5.683-2.567 11.181-5.526 16.448-8.864l1.376-0.8 4.704-2.784c3.111-2.211 6.803-3.466 10.618-3.606 3.815-0.144 7.587 0.832 10.854 2.807l3.968 1.952c5.993 3.568 12.653 5.878 19.565 6.791 6.915 0.912 13.945 0.409 20.659-1.478 6.599-1.805 12.755-4.95 18.080-9.248 5.325-4.295 9.706-9.645 12.864-15.712l24.96-43.68c3.504-5.907 5.757-12.474 6.615-19.289 0.861-6.816 0.307-13.735-1.622-20.327-3.584-13.397-12.298-24.846-24.256-31.873zM319.997 346.752c-17.949 0-35.495-5.322-50.419-15.296-14.924-9.971-26.556-24.144-33.424-40.727s-8.666-34.83-5.165-52.434c3.502-17.604 12.145-33.775 24.837-46.466s28.862-21.335 46.466-24.837c17.604-3.502 35.852-1.704 52.434 5.164s30.755 18.501 40.73 33.425c9.971 14.924 15.293 32.47 15.293 50.419 0 24.069-9.562 47.153-26.579 64.17-17.021 17.021-40.103 26.582-64.173 26.582z" />
</vector>

View File

@@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="640dp"
android:height="512dp"
android:viewportWidth="640"
android:viewportHeight="512">
<path
android:fillColor="#FF000000"
android:pathData="M532.989 289.887l-3.872-2.528c-3.197-1.866-5.744-4.667-7.299-8.026-1.558-3.358-2.048-7.113-1.405-10.759v-24.64c-0.682-3.57-0.202-7.266 1.37-10.542s4.154-5.964 7.366-7.666l4.768-2.4c12.013-7.054 20.768-18.547 24.384-32 3.421-13.333 1.661-27.466-4.928-39.552l-25.056-43.872c-7.011-11.727-18.259-20.313-31.418-23.987-13.161-3.674-27.229-2.155-39.303 4.243l-4.384 2.208c-3.286 1.769-6.983 2.63-10.711 2.496-3.731-0.135-7.357-1.261-10.505-3.263-7.082-4.796-14.579-8.951-22.4-12.416-3.28-1.636-6.038-4.157-7.962-7.278s-2.935-6.719-2.918-10.386v-6.528c0.099-6.965-1.197-13.879-3.808-20.335s-6.49-12.326-11.401-17.264c-4.915-4.937-10.765-8.842-17.209-11.486s-13.351-3.972-20.317-3.907h-51.2c-6.952-0.043-13.842 1.301-20.267 3.954s-12.257 6.561-17.154 11.496c-4.896 4.935-8.758 10.797-11.361 17.243s-3.892 13.347-3.794 20.298v5.472c0.032 3.614-0.938 7.165-2.802 10.261s-4.55 5.614-7.758 7.275c-5.691 2.572-11.197 5.533-16.48 8.864l-6.080 3.584c-3.102 2.221-6.788 3.481-10.6 3.623s-7.582-0.839-10.84-2.823l-3.968-1.952c-5.856-3.516-12.377-5.778-19.153-6.642s-13.656-0.314-20.208 1.618c-13.446 3.716-24.885 12.58-31.84 24.672l-24.96 43.68c-3.566 6.048-5.867 12.757-6.763 19.721s-0.37 14.037 1.547 20.791c1.743 6.495 4.779 12.571 8.925 17.866s9.317 9.699 15.203 12.95l2.88 2.848 1.312 0.928c3.197 1.867 5.744 4.667 7.3 8.026s2.046 7.113 1.403 10.758v24.704c0.326 3.533-0.314 7.087-1.853 10.283s-3.918 5.913-6.883 7.861l-4.768 2.4c-11.724 7.217-20.258 18.63-23.866 31.917s-2.020 27.447 4.442 39.603l25.088 43.872c6.806 11.955 18.058 20.739 31.308 24.445 13.25 3.702 27.425 2.026 39.445-4.669l4.352-2.176c3.287-1.792 6.994-2.669 10.736-2.547 3.742 0.125 7.382 1.248 10.544 3.251 7.082 4.797 14.578 8.954 22.4 12.416 3.281 1.635 6.038 4.157 7.962 7.28 1.923 3.12 2.934 6.717 2.918 10.384v5.472c-0.102 6.954 1.185 13.859 3.788 20.31s6.468 12.317 11.368 17.251c4.901 4.938 10.738 8.845 17.169 11.495s13.327 3.987 20.282 3.936h51.2c6.957 0.051 13.856-1.286 20.288-3.936s12.272-6.557 17.175-11.491c4.902-4.938 8.771-10.8 11.379-17.251 2.605-6.451 3.897-13.357 3.798-20.313v-5.472c-0.032-3.613 0.938-7.165 2.803-10.259 1.863-3.098 4.547-5.616 7.757-7.277 5.683-2.567 11.181-5.526 16.448-8.864l1.376-0.8 4.704-2.784c3.111-2.211 6.803-3.466 10.618-3.606 3.815-0.144 7.587 0.832 10.854 2.807l3.968 1.952c5.993 3.568 12.653 5.878 19.565 6.791 6.915 0.912 13.945 0.409 20.659-1.478 6.599-1.805 12.755-4.95 18.080-9.248 5.325-4.295 9.706-9.645 12.864-15.712l24.96-43.68c3.504-5.907 5.757-12.474 6.615-19.289 0.861-6.816 0.307-13.735-1.622-20.327-3.584-13.397-12.298-24.846-24.256-31.873zM319.997 346.752c-17.949 0-35.495-5.322-50.419-15.296-14.924-9.971-26.556-24.144-33.424-40.727s-8.666-34.83-5.165-52.434c3.502-17.604 12.145-33.775 24.837-46.466s28.862-21.335 46.466-24.837c17.604-3.502 35.852-1.704 52.434 5.164s30.755 18.501 40.73 33.425c9.971 14.924 15.293 32.47 15.293 50.419 0 24.069-9.562 47.153-26.579 64.17-17.021 17.021-40.103 26.582-64.173 26.582z" />
</vector>

View File

@@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="640dp"
android:height="512dp"
android:viewportWidth="640"
android:viewportHeight="512">
<path
android:fillColor="#FF000000"
android:pathData="M320.64 512.32c141.385 0 256-114.615 256-256s-114.615-256-256-256c-141.385 0-256 114.615-256 256s114.615 256 256 256zM488 278.402c3.315 0.796 6.199 2.832 8.055 5.69 1.859 2.858 2.547 6.318 1.93 9.671-8.887 36.99-28.976 70.334-57.529 95.474s-64.173 40.845-101.99 44.976c-6.4 0.64-12.8 0.928-19.2 0.928-34.070-0.307-67.349-10.301-95.948-28.819s-51.337-44.797-65.555-75.757c-0.339-0.387-0.768-0.688-1.248-0.877-0.48-0.185-0.998-0.253-1.511-0.195-0.512 0.055-1.003 0.233-1.43 0.522s-0.78 0.672-1.027 1.127l-8.032 16.576c-1.536 3.181-4.274 5.623-7.611 6.787s-6.999 0.957-10.181-0.579c-3.183-1.536-5.624-4.275-6.789-7.613-1.164-3.334-0.955-6.998 0.581-10.179l24.96-51.49c1.492-3.055 4.099-5.423 7.284-6.614s6.706-1.114 9.836 0.214l53.12 22.4c1.613 0.675 3.078 1.66 4.311 2.901s2.209 2.712 2.874 4.33c0.664 1.618 1.003 3.351 0.998 5.1s-0.356 3.479-1.030 5.094c-0.674 1.614-1.66 3.079-2.901 4.312s-2.712 2.208-4.33 2.873c-1.618 0.663-3.351 1.002-5.1 0.998-1.749-0.007-3.48-0.358-5.093-1.031l-20.832-8.738c-2.624-0.288-3.68 1.6-3.2 2.912 13.19 29.202 35.259 53.495 63.062 69.422s59.924 22.675 91.786 19.283c32.304-3.2 62.791-16.445 87.175-37.872s41.44-49.962 48.762-81.585c0.365-1.711 1.063-3.333 2.055-4.774s2.259-2.671 3.728-3.623c1.469-0.951 3.111-1.603 4.829-1.92 1.721-0.317 3.488-0.291 5.197 0.076zM502.947 157.296c3.331-1.163 6.989-0.962 10.173 0.56 1.622 0.746 3.075 1.811 4.275 3.131 1.203 1.32 2.125 2.867 2.717 4.551s0.838 3.469 0.726 5.25c-0.115 1.781-0.582 3.521-1.383 5.117l-24.928 51.488c-1.498 3.050-4.106 5.412-7.286 6.602-3.184 1.19-6.701 1.118-9.834-0.202l-53.152-22.4c-1.613-0.677-3.079-1.665-4.31-2.907s-2.205-2.715-2.87-4.335c-0.663-1.619-0.998-3.353-0.992-5.103 0.010-1.75 0.361-3.481 1.037-5.095 0.678-1.613 1.664-3.078 2.909-4.31 1.241-1.232 2.714-2.207 4.333-2.87s3.353-1 5.104-0.993c1.75 0.007 3.481 0.359 5.094 1.036l20.832 8.704c2.592 0.288 3.68-1.6 3.2-2.912-13.216-29.171-35.293-53.431-63.094-69.329s-59.911-22.621-91.753-19.216c-32.303 3.198-62.791 16.443-87.175 37.87s-41.437 49.961-48.761 81.585c-0.73 3.458-2.804 6.486-5.765 8.415s-6.569 2.603-10.027 1.874c-3.458-0.73-6.485-2.804-8.415-5.765s-2.603-6.569-1.874-10.027c8.919-36.975 29.038-70.293 57.608-95.403s64.194-40.785 102.008-44.886c6.4-0.64 12.8-0.928 19.2-0.928 34.055 0.283 67.325 10.252 95.923 28.742s51.347 44.737 65.581 75.674c0.339 0.394 0.768 0.7 1.255 0.891 0.483 0.19 1.005 0.261 1.523 0.204 0.515-0.056 1.011-0.238 1.443-0.53 0.429-0.291 0.784-0.683 1.027-1.142l8.032-16.576c1.549-3.173 4.285-5.606 7.619-6.768z" />
</vector>

View File

@@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="640dp" android:width="20dp"
android:height="512dp" android:height="20dp"
android:viewportWidth="640" android:viewportWidth="2048"
android:viewportHeight="512"> android:viewportHeight="2048">
<path <path
android:fillColor="#FF777777" android:fillColor="#FF777777"
android:pathData="M261.411 257.983c8.966-7.451 15.421-17.482 18.488-28.73s2.595-23.167-1.349-34.138c-3.945-10.97-11.171-20.461-20.697-27.181s-20.891-10.345-32.548-10.381c-11.658-0.036-23.044 3.518-32.612 10.18s-16.852 16.107-20.863 27.053c-4.012 10.946-4.556 22.862-1.559 34.129s9.39 21.337 18.31 28.843c-13.738 5.811-25.873 14.849-35.375 26.346s-16.095 25.116-19.216 39.704c-0.78 3.654-0.728 7.44 0.153 11.075 0.881 3.632 2.567 7.021 4.935 9.917 2.31 2.864 5.236 5.175 8.559 6.759s6.96 2.403 10.642 2.394h132.928c3.682 0.010 7.318-0.81 10.642-2.394s6.248-3.894 8.558-6.759c2.366-2.896 4.053-6.285 4.939-9.917s0.948-7.418 0.181-11.075c-3.106-14.498-9.639-28.038-19.054-39.491s-21.436-20.483-35.058-26.334v0zM225.123 180.319c6.798 0 13.442 2.016 19.094 5.792s10.056 9.144 12.658 15.423c2.601 6.28 3.282 13.19 1.956 19.857s-4.6 12.791-9.406 17.597c-4.806 4.806-10.93 8.079-17.597 9.406s-13.577 0.645-19.857-1.956c-6.28-2.601-11.648-7.006-15.423-12.658s-5.792-12.297-5.792-19.094c0.008-9.113 3.632-17.85 10.076-24.292s15.18-10.067 24.292-10.076v0zM291.202 331.552h-132.928l-2.368-3.2c3.409-15.714 12.094-29.788 24.61-39.88s28.112-15.596 44.19-15.596c16.079 0 31.673 5.504 44.19 15.596s21.202 24.166 24.61 39.88l-2.304 3.2zM369.376 202.178h80.288c2.825-0.214 5.466-1.487 7.389-3.563 1.926-2.077 2.998-4.804 2.998-7.637s-1.072-5.56-2.998-7.637c-1.923-2.077-4.563-3.35-7.389-3.563h-80.288c-2.822 0.214-5.462 1.487-7.389 3.563s-2.995 4.804-2.995 7.637c0 2.833 1.069 5.56 2.995 7.637s4.567 3.35 7.389 3.563v0zM484.445 309.699h-115.2c-2.825 0.214-5.466 1.486-7.389 3.563-1.926 2.077-2.995 4.805-2.995 7.637s1.069 5.558 2.995 7.639c1.923 2.077 4.563 3.347 7.389 3.562h115.2c2.822-0.214 5.462-1.485 7.389-3.562 1.926-2.080 2.995-4.807 2.995-7.639s-1.069-5.56-2.995-7.637c-1.926-2.077-4.567-3.349-7.389-3.563v0zM484.448 244.738h-115.2c-2.973 0-5.821 1.18-7.92 3.28-2.103 2.101-3.28 4.95-3.28 7.919s1.178 5.819 3.28 7.92c2.099 2.101 4.947 3.281 7.92 3.281h115.2c2.969 0 5.817-1.18 7.92-3.281 2.099-2.101 3.28-4.949 3.28-7.919s-1.181-5.819-3.28-7.919c-2.103-2.1-4.95-3.28-7.92-3.28v0zM544 80h-448c-8.487 0-16.626 3.371-22.627 9.373s-9.373 14.141-9.373 22.627v288c0 8.486 3.371 16.627 9.373 22.627s14.141 9.373 22.627 9.373h448c8.486 0 16.627-3.373 22.627-9.373s9.373-14.141 9.373-22.627v-288c0-8.487-3.373-16.626-9.373-22.627s-14.141-9.373-22.627-9.373v0zM528 400h-416c-4.243 0-8.314-1.687-11.314-4.685-3.001-3.002-4.686-7.072-4.686-11.315v-256c0-4.243 1.686-8.314 4.686-11.314s7.070-4.686 11.314-4.686h418.4c2.816 0.64 13.376 3.712 13.6 13.824v258.176c0 4.243-1.687 8.313-4.685 11.315-3.001 2.998-7.072 4.685-11.315 4.685z" /> android:pathData="M896,1340C896,1376.67 885.5,1407.83 864.5,1433.5C843.5,1459.17 818.33,1472 789,1472L363,1472C333.67,1472 308.5,1459.17 287.5,1433.5C266.5,1407.83 256,1376.67 256,1340C256,1304 258.5,1270.5 263.5,1239.5C268.5,1208.5 276.67,1178.5 288,1149.5C299.33,1120.5 316.33,1097.67 339,1081C361.67,1064.33 388.67,1056 420,1056C462.67,1098.67 514.67,1120 576,1120C637.33,1120 689.33,1098.67 732,1056C763.33,1056 790.33,1064.33 813,1081C835.67,1097.67 852.67,1120.5 864,1149.5C875.33,1178.5 883.5,1208.5 888.5,1239.5C893.5,1270.5 896,1304 896,1340ZM768,896C768,949.33 749.33,994.67 712,1032C674.67,1069.33 629.33,1088 576,1088C522.67,1088 477.33,1069.33 440,1032C402.67,994.67 384,949.33 384,896C384,842.67 402.67,797.33 440,760C477.33,722.67 522.67,704 576,704C629.33,704 674.67,722.67 712,760C749.33,797.33 768,842.67 768,896ZM1792,1312L1792,1376C1792,1385.33 1789,1393 1783,1399C1777,1405 1769.33,1408 1760,1408L1056,1408C1046.67,1408 1039,1405 1033,1399C1027,1393 1024,1385.33 1024,1376L1024,1312C1024,1302.67 1027,1295 1033,1289C1039,1283 1046.67,1280 1056,1280L1760,1280C1769.33,1280 1777,1283 1783,1289C1789,1295 1792,1302.67 1792,1312ZM1408,1056L1408,1120C1408,1129.33 1405,1137 1399,1143C1393,1149 1385.33,1152 1376,1152L1056,1152C1046.67,1152 1039,1149 1033,1143C1027,1137 1024,1129.33 1024,1120L1024,1056C1024,1046.67 1027,1039 1033,1033C1039,1027 1046.67,1024 1056,1024L1376,1024C1385.33,1024 1393,1027 1399,1033C1405,1039 1408,1046.67 1408,1056ZM1792,1056L1792,1120C1792,1129.33 1789,1137 1783,1143C1777,1149 1769.33,1152 1760,1152L1568,1152C1558.67,1152 1551,1149 1545,1143C1539,1137 1536,1129.33 1536,1120L1536,1056C1536,1046.67 1539,1039 1545,1033C1551,1027 1558.67,1024 1568,1024L1760,1024C1769.33,1024 1777,1027 1783,1033C1789,1039 1792,1046.67 1792,1056ZM1792,800L1792,864C1792,873.33 1789,881 1783,887C1777,893 1769.33,896 1760,896L1056,896C1046.67,896 1039,893 1033,887C1027,881 1024,873.33 1024,864L1024,800C1024,790.67 1027,783 1033,777C1039,771 1046.67,768 1056,768L1760,768C1769.33,768 1777,771 1783,777C1789,783 1792,790.67 1792,800ZM1920,1632L1920,512L128,512L128,1632C128,1640.67 131.17,1648.17 137.5,1654.5C143.83,1660.83 151.33,1664 160,1664L1888,1664C1896.67,1664 1904.17,1660.83 1910.5,1654.5C1916.83,1648.17 1920,1640.67 1920,1632ZM2048,416L2048,1632C2048,1676 2032.33,1713.67 2001,1745C1969.67,1776.33 1932,1792 1888,1792L160,1792C116,1792 78.33,1776.33 47,1745C15.67,1713.67 0,1676 0,1632L0,416C0,372 15.67,334.33 47,303C78.33,271.67 116,256 160,256L1888,256C1932,256 1969.67,271.67 2001,303C2032.33,334.33 2048,372 2048,416Z" />
</vector> </vector>

View File

@@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="640dp" android:width="24dp"
android:height="512dp" android:height="24dp"
android:viewportWidth="640" android:viewportWidth="24"
android:viewportHeight="512"> android:viewportHeight="24">
<path <path
android:fillColor="#FF000000" android:fillColor="#FF000000"
android:pathData="M320 421.763c-4.243 0-8.313-1.687-11.313-4.688s-4.687-7.069-4.687-11.312v-192.001c0-4.243 1.686-8.313 4.687-11.314s7.070-4.686 11.313-4.686c4.243 0 8.313 1.686 11.315 4.686 2.998 3 4.685 7.071 4.685 11.314v192.001c0 4.243-1.687 8.31-4.685 11.312-3.002 3.002-7.072 4.688-11.315 4.688zM320 142.049c10.481 0 18.976-8.495 18.976-18.976s-8.496-18.976-18.976-18.976c-10.48 0-18.976 8.496-18.976 18.976s8.496 18.976 18.976 18.976zM320 512c-50.632 0-100.127-15.014-142.226-43.142-42.099-28.131-74.911-68.112-94.287-114.889-19.376-46.779-24.446-98.252-14.568-147.911s34.26-95.274 70.062-131.076c35.802-35.802 81.417-60.184 131.076-70.061s101.134-4.808 147.911 14.568c46.777 19.376 86.758 52.188 114.89 94.287 28.128 42.099 43.143 91.594 43.143 142.226-0.077 67.872-27.072 132.944-75.065 180.935-47.99 47.993-113.063 74.989-180.935 75.066zM320 32c-44.303 0-87.611 13.138-124.447 37.751s-65.547 59.597-82.501 100.528c-16.954 40.93-21.39 85.969-12.747 129.422s29.977 83.365 61.304 114.693c31.327 31.325 71.24 52.659 114.692 61.303s88.49 4.208 129.422-12.745c40.931-16.957 75.913-45.667 100.528-82.502s37.75-80.145 37.75-124.448c-0.067-59.387-23.689-116.323-65.683-158.317s-98.928-65.615-158.317-65.683v0z"/> android:pathData="M11,7h2v2h-2zM11,11h2v6h-2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
</vector> </vector>

View File

@@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="640dp" android:width="24dp"
android:height="512dp" android:height="24dp"
android:viewportWidth="640" android:viewportWidth="1792"
android:viewportHeight="512"> android:viewportHeight="1792">
<path <path
android:fillColor="#FF000000" android:fillColor="#FF000000"
android:pathData="M484.32 163.488h-14.528c-1.142-0.004-2.275-0.233-3.328-0.674-1.056-0.441-2.013-1.086-2.816-1.898-0.807-0.811-1.443-1.773-1.878-2.831-0.432-1.058-0.653-2.191-0.649-3.333v-6.4c0.675-35.916-11.907-70.822-35.341-98.047-23.437-27.225-56.083-44.861-91.699-49.536-19.685-1.895-39.55 0.355-58.314 6.603s-36.011 16.357-50.632 29.675c-14.62 13.318-26.29 29.55-34.255 47.651s-12.054 37.671-11.999 57.447v10.24c0 0.224-0.768 10.944-10.080 11.104h-13.088c-5.76 0.017-11.46 1.168-16.774 3.389s-10.139 5.467-14.198 9.553c-4.059 4.086-7.274 8.932-9.46 14.262s-3.3 11.036-3.278 16.796v260.576c0.025 11.606 4.632 22.733 12.817 30.96s19.29 12.893 30.895 12.976h328.608c11.6-0.077 22.701-4.733 30.883-12.957 8.179-8.224 12.781-19.347 12.797-30.947v-260.608c0.023-5.757-1.091-11.462-3.277-16.789-2.183-5.327-5.395-10.172-9.449-14.257-4.058-4.086-8.877-7.333-14.189-9.555s-11.008-3.377-16.765-3.399v0zM331.808 391.104v43.072c0.083 1.6-0.16 3.2-0.714 4.704-0.557 1.504-1.411 2.877-2.515 4.041-1.101 1.161-2.429 2.087-3.904 2.72-1.472 0.63-3.056 0.957-4.659 0.957-1.602 0-3.188-0.327-4.66-0.957-1.473-0.634-2.8-1.558-3.904-2.72-1.103-1.165-1.958-2.538-2.513-4.041s-0.798-3.104-0.715-4.704v-43.072c-5.285-2.653-9.519-7.014-12.019-12.375s-3.117-11.408-1.753-17.161c1.364-5.753 4.63-10.88 9.269-14.55 4.639-3.667 10.38-5.661 16.295-5.661s11.654 1.993 16.294 5.661c4.64 3.671 7.904 8.797 9.271 14.55 1.363 5.753 0.745 11.801-1.753 17.161s-6.733 9.721-12.019 12.375v0zM429.12 154.752c0.003 1.146-0.217 2.281-0.653 3.341s-1.075 2.023-1.885 2.834c-0.81 0.812-1.769 1.456-2.829 1.895-1.056 0.44-2.192 0.666-3.337 0.666h-196.16c-1.624 0.141-3.258-0.042-4.81-0.536s-2.992-1.291-4.235-2.344c-1.244-1.053-2.266-2.341-3.010-3.792s-1.192-3.032-1.321-4.656v-10.016c-0.043-16.317 3.56-32.439 10.547-47.185s17.179-27.745 29.833-38.047c12.654-10.302 27.451-17.647 43.308-21.497s32.375-4.11 48.344-0.758c24.841 5.834 46.941 19.992 62.624 40.121s24.003 45.020 23.584 70.534v9.44z" /> android:pathData="M640,768h512v-192q0,-106 -75,-181t-181,-75 -181,75 -75,181v192zM1472,864v576q0,40 -28,68t-68,28h-960q-40,0 -68,-28t-28,-68v-576q0,-40 28,-68t68,-28h32v-192q0,-184 132,-316t316,-132 316,132 132,316v192h32q40,0 68,28t28,68z" />
</vector> </vector>

View File

@@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="640dp" android:width="24dp"
android:height="512dp" android:height="24dp"
android:viewportWidth="640" android:viewportWidth="1792"
android:viewportHeight="512"> android:viewportHeight="1792">
<path <path
android:fillColor="#FF777777" android:fillColor="#FF777777"
android:pathData="M571.2 205.825c-9.082-45.471-30.339-87.624-61.501-121.963-31.159-34.339-71.056-59.575-115.437-73.018-44.377-13.443-91.573-14.586-136.551-3.311s-86.052 34.55-118.84 67.338c-32.788 32.788-56.062 73.862-67.338 118.84s-10.132 92.173 3.311 136.551c13.442 44.381 38.679 84.279 73.018 115.437 34.339 31.161 76.492 52.419 121.964 61.501 41.367 8.409 84.172 6.442 124.594-5.728 40.419-12.166 77.197-34.157 107.046-64.007s51.84-66.627 64.007-107.046c12.169-40.422 14.138-83.228 5.728-124.594zM186.305 76.481c38.576-28.909 85.49-44.517 133.695-44.48 2.752 0 5.376 0.48 8.128 0.608 9.952 2.88 2.368 11.104 2.368 11.104-34.061 17.672-62.726 44.203-82.975 76.8-9.6 15.488-17.216 15.328-19.68 15.040-14.112-0.608-31.456-20.224-44.608-40.16-1.954-2.963-2.723-6.552-2.154-10.055s2.434-6.665 5.226-8.856v0zM253.505 461.184c-1.923 1.971-4.388 3.328-7.083 3.897s-5.497 0.327-8.054-0.697c-40.582-15.911-75.645-43.305-100.902-78.832s-39.611-77.643-41.306-121.199l9.44-13.888c30.432-11.36 60.416-17.504 68.512-10.496 3.744 3.2 1.184 13.12 0 17.216-22.88 74.143 36.288 93.183 58.624 100.383 2.464 0.8 4.576 1.504 6.4 2.112 23.392 9.024 36.736 22.112 39.712 38.848 0.56 11.645-1.404 23.274-5.757 34.087s-10.99 20.56-19.459 28.57h-0.128zM477.152 414.656c-41.667 41.728-98.183 65.226-157.152 65.344-9.798-0.067-19.581-0.807-29.279-2.208-1.884-0.298-3.663-1.063-5.178-2.221-1.514-1.161-2.716-2.678-3.498-4.419s-1.117-3.648-0.976-5.549c0.14-1.901 0.752-3.741 1.779-5.347v0c14.127-18.771 20.486-42.262 17.76-65.6-3.027-13.315-9.63-25.552-19.099-35.392s-21.44-16.909-34.63-20.448c-1.984-0.768-4.544-1.632-7.488-2.56-30.592-9.856-59.168-23.551-44.192-72.447 7.040-22.848 0.256-34.784-6.656-40.768-14.72-12.8-42.976-8.928-68.96-1.216-2.377 0.642-4.879 0.653-7.262 0.034s-4.563-1.849-6.326-3.566c-1.763-1.718-3.049-3.865-3.73-6.231s-0.734-4.868-0.155-7.26c7.821-33.432 23.251-64.608 45.088-91.104 1.379-1.599 3.102-2.864 5.042-3.698s4.043-1.216 6.151-1.118c2.109 0.099 4.167 0.675 6.020 1.688s3.452 2.431 4.674 4.152c14.304 20.224 35.040 42.4 57.6 43.392h1.6c8.108-0.433 15.946-3.062 22.676-7.605s12.098-10.829 15.532-18.188c25.389-38.702 62.678-68.096 106.239-83.744v0c9.504-2.946 19.648-3.124 29.248-0.512 29.693 11.669 56.55 29.538 78.784 52.416 1.798 1.852 3.053 4.159 3.635 6.674s0.467 5.138-0.333 7.591c-0.8 2.453-2.256 4.641-4.208 6.329s-4.327 2.81-6.87 3.247c-41.088 7.136-94.208 21.184-101.088 46.816-3.2 12.416 2.912 24.48 18.56 35.872 60.288 43.744 77.984 77.344 68.768 91.232-8.49 10.898-14.24 23.673-16.774 37.254-2.534 13.577-1.773 27.568 2.214 40.793 5.907 10.624 15.488 18.726 26.944 22.784 0 0 11.36 6.528 5.664 15.584h-0.128zM512 369.664c-2.966 3.639-6.743 6.531-11.024 8.448-4.285 1.917-8.96 2.807-13.648 2.592-4.595-0.729-8.992-2.409-12.909-4.925-3.917-2.519-7.267-5.821-9.843-9.699-7.584-14.624 2.432-38.944 13.312-55.359 11.296-17.12 16.736-55.68-74.304-121.76-7.648-5.536-10.592-10.080-10.080-11.936 3.2-11.808 52.608-27.072 108.8-34.336 2.845-0.366 5.735 0.123 8.298 1.405 2.567 1.282 4.691 3.299 6.102 5.794 18.557 33.828 27.891 71.942 27.066 110.518s-11.783 76.255-31.769 109.257v0z" /> android:pathData="M896,128q209,0 385.5,103t279.5,279.5 103,385.5 -103,385.5 -279.5,279.5 -385.5,103 -385.5,-103 -279.5,-279.5 -103,-385.5 103,-385.5 279.5,-279.5 385.5,-103zM1170,649q-2,1 -9.5,9.5t-13.5,9.5q2,0 4.5,-5t5,-11 3.5,-7q6,-7 22,-15 14,-6 52,-12 34,-8 51,11 -2,-2 9.5,-13t14.5,-12q3,-2 15,-4.5t15,-7.5l2,-22q-12,1 -17.5,-7t-6.5,-21q0,2 -6,8 0,-7 -4.5,-8t-11.5,1 -9,1q-10,-3 -15,-7.5t-8,-16.5 -4,-15q-2,-5 -9.5,-11t-9.5,-10q-1,-2 -2.5,-5.5t-3,-6.5 -4,-5.5 -5.5,-2.5 -7,5 -7.5,10 -4.5,5q-3,-2 -6,-1.5t-4.5,1 -4.5,3 -5,3.5q-3,2 -8.5,3t-8.5,2q15,-5 -1,-11 -10,-4 -16,-3 9,-4 7.5,-12t-8.5,-14h5q-1,-4 -8.5,-8.5t-17.5,-8.5 -13,-6q-8,-5 -34,-9.5t-33,-0.5q-5,6 -4.5,10.5t4,14 3.5,12.5q1,6 -5.5,13t-6.5,12q0,7 14,15.5t10,21.5q-3,8 -16,16t-16,12q-5,8 -1.5,18.5t10.5,16.5q2,2 1.5,4t-3.5,4.5 -5.5,4 -6.5,3.5l-3,2q-11,5 -20.5,-6t-13.5,-26q-7,-25 -16,-30 -23,-8 -29,1 -5,-13 -41,-26 -25,-9 -58,-4 6,-1 0,-15 -7,-15 -19,-12 3,-6 4,-17.5t1,-13.5q3,-13 12,-23 1,-1 7,-8.5t9.5,-13.5 0.5,-6q35,4 50,-11 5,-5 11.5,-17t10.5,-17q9,-6 14,-5.5t14.5,5.5 14.5,5q14,1 15.5,-11t-7.5,-20q12,1 3,-17 -4,-7 -8,-9 -12,-4 -27,5 -8,4 2,8 -1,-1 -9.5,10.5t-16.5,17.5 -16,-5q-1,-1 -5.5,-13.5t-9.5,-13.5q-8,0 -16,15 3,-8 -11,-15t-24,-8q19,-12 -8,-27 -7,-4 -20.5,-5t-19.5,4q-5,7 -5.5,11.5t5,8 10.5,5.5 11.5,4 8.5,3q14,10 8,14 -2,1 -8.5,3.5t-11.5,4.5 -6,4q-3,4 0,14t-2,14q-5,-5 -9,-17.5t-7,-16.5q7,9 -25,6l-10,-1q-4,0 -16,2t-20.5,1 -13.5,-8q-4,-8 0,-20 1,-4 4,-2 -4,-3 -11,-9.5t-10,-8.5q-46,15 -94,41 6,1 12,-1 5,-2 13,-6.5t10,-5.5q34,-14 42,-7l5,-5q14,16 20,25 -7,-4 -30,-1 -20,6 -22,12 7,12 5,18 -4,-3 -11.5,-10t-14.5,-11 -15,-5q-16,0 -22,1 -146,80 -235,222 7,7 12,8 4,1 5,9t2.5,11 11.5,-3q9,8 3,19 1,-1 44,27 19,17 21,21 3,11 -10,18 -1,-2 -9,-9t-9,-4q-3,5 0.5,18.5t10.5,12.5q-7,0 -9.5,16t-2.5,35.5 -1,23.5l2,1q-3,12 5.5,34.5t21.5,19.5q-13,3 20,43 6,8 8,9 3,2 12,7.5t15,10 10,10.5q4,5 10,22.5t14,23.5q-2,6 9.5,20t10.5,23q-1,0 -2.5,1t-2.5,1q3,7 15.5,14t15.5,13q1,3 2,10t3,11 8,2q2,-20 -24,-62 -15,-25 -17,-29 -3,-5 -5.5,-15.5t-4.5,-14.5q2,0 6,1.5t8.5,3.5 7.5,4 2,3q-3,7 2,17.5t12,18.5 17,19 12,13q6,6 14,19.5t0,13.5q9,0 20,10.5t17,19.5q5,8 8,26t5,24q2,7 8.5,13.5t12.5,9.5l16,8 13,7q5,2 18.5,10.5t21.5,11.5q10,4 16,4t14.5,-2.5 13.5,-3.5q15,-2 29,15t21,21q36,19 55,11 -2,1 0.5,7.5t8,15.5 9,14.5 5.5,8.5q5,6 18,15t18,15q6,-4 7,-9 -3,8 7,20t18,10q14,-3 14,-32 -31,15 -49,-18 0,-1 -2.5,-5.5t-4,-8.5 -2.5,-8.5 0,-7.5 5,-3q9,0 10,-3.5t-2,-12.5 -4,-13q-1,-8 -11,-20t-12,-15q-5,9 -16,8t-16,-9q0,1 -1.5,5.5t-1.5,6.5q-13,0 -15,-1 1,-3 2.5,-17.5t3.5,-22.5q1,-4 5.5,-12t7.5,-14.5 4,-12.5 -4.5,-9.5 -17.5,-2.5q-19,1 -26,20 -1,3 -3,10.5t-5,11.5 -9,7q-7,3 -24,2t-24,-5q-13,-8 -22.5,-29t-9.5,-37q0,-10 2.5,-26.5t3,-25 -5.5,-24.5q3,-2 9,-9.5t10,-10.5q2,-1 4.5,-1.5t4.5,0 4,-1.5 3,-6q-1,-1 -4,-3 -3,-3 -4,-3 7,3 28.5,-1.5t27.5,1.5q15,11 22,-2 0,-1 -2.5,-9.5t-0.5,-13.5q5,27 29,9 3,3 15.5,5t17.5,5q3,2 7,5.5t5.5,4.5 5,-0.5 8.5,-6.5q10,14 12,24 11,40 19,44 7,3 11,2t4.5,-9.5 0,-14 -1.5,-12.5l-1,-8v-18l-1,-8q-15,-3 -18.5,-12t1.5,-18.5 15,-18.5q1,-1 8,-3.5t15.5,-6.5 12.5,-8q21,-19 15,-35 7,0 11,-9 -1,0 -5,-3t-7.5,-5 -4.5,-2q9,-5 2,-16 5,-3 7.5,-11t7.5,-10q9,12 21,2 8,-8 1,-16 5,-7 20.5,-10.5t18.5,-9.5q7,2 8,-2t1,-12 3,-12q4,-5 15,-9t13,-5l17,-11q3,-4 0,-4 18,2 31,-11 10,-11 -6,-20 3,-6 -3,-9.5t-15,-5.5q3,-1 11.5,-0.5t10.5,-1.5q15,-10 -7,-16 -17,-5 -43,12zM1007,1526q206,-36 351,-189 -3,-3 -12.5,-4.5t-12.5,-3.5q-18,-7 -24,-8 1,-7 -2.5,-13t-8,-9 -12.5,-8 -11,-7q-2,-2 -7,-6t-7,-5.5 -7.5,-4.5 -8.5,-2 -10,1l-3,1q-3,1 -5.5,2.5t-5.5,3 -4,3 0,2.5q-21,-17 -36,-22 -5,-1 -11,-5.5t-10.5,-7 -10,-1.5 -11.5,7q-5,5 -6,15t-2,13q-7,-5 0,-17.5t2,-18.5q-3,-6 -10.5,-4.5t-12,4.5 -11.5,8.5 -9,6.5 -8.5,5.5 -8.5,7.5q-3,4 -6,12t-5,11q-2,-4 -11.5,-6.5t-9.5,-5.5q2,10 4,35t5,38q7,31 -12,48 -27,25 -29,40 -4,22 12,26 0,7 -8,20.5t-7,21.5q0,6 2,16z" />
</vector> </vector>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="600"
android:viewportHeight="600">
<path
android:fillColor="#FF000000"
android:pathData="M508.757,52.805L68.978,306.52C51.804,316.388 53.987,340.299 71.065,347.51L171.925,389.827L444.522,149.585C449.741,144.936 457.141,152.052 452.682,157.46L224.111,435.94L224.111,512.32C224.111,534.712 251.152,543.536 264.436,527.312L324.686,453.967L442.909,503.496C456.382,509.189 471.753,500.744 474.22,486.227L542.536,76.336C545.762,57.17 525.172,43.317 508.757,52.805Z" />
</vector>

View File

@@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp" android:width="24dp"
android:height="16dp" android:height="24dp"
android:viewportWidth="640" android:viewportWidth="1792"
android:viewportHeight="512"> android:viewportHeight="1792">
<path <path
android:fillColor="#FFFFFFFF" android:fillColor="#FFFFFFFF"
android:pathData="M558.781 17.216c-6.342-6.397-14.083-11.239-22.608-14.148-8.528-2.909-17.613-3.805-26.544-2.619-20.425 3.183-39.178 13.174-53.216 28.352l-323.807 323.872c-11.904 11.872-21.977 25.453-29.888 40.288l-33.696 64.64c-4.079 6.957-5.793 15.046-4.887 23.059s4.382 15.517 9.911 21.389c3.263 3.216 7.133 5.753 11.386 7.462s8.8 2.554 13.382 2.489c6.858-0.067 13.599-1.792 19.648-5.024l64.512-33.632c14.925-7.888 28.573-17.984 40.48-29.952l323.744-323.808c15.187-14.022 25.191-32.763 28.384-53.184 1.159-8.938 0.246-18.022-2.669-26.549-2.912-8.529-7.747-16.273-14.131-22.634v0zM483.741 137.6l-283.103 282.976c-9.575 9.632-20.546 17.767-32.544 24.128l-64.576 33.664c-3.2 1.76-5.76 1.6-6.656 0.736s-0.992-3.2 0.768-6.688l33.728-64.512c6.355-11.949 14.466-22.873 24.064-32.416l282.975-282.688c0.599-0.624 1.315-1.121 2.112-1.461 0.793-0.34 1.648-0.514 2.512-0.514s1.721 0.175 2.515 0.514c0.793 0.34 1.514 0.837 2.109 1.461l36.032 35.2c0.659 0.612 1.187 1.352 1.549 2.175s0.55 1.712 0.557 2.611c0.007 0.899-0.17 1.79-0.522 2.618s-0.867 1.575-1.52 2.196v0zM524.381 96.928l-16.352 16.384c-1.034 0.882-2.352 1.365-3.712 1.365s-2.675-0.484-3.712-1.365l-38.4-37.568c-0.803-0.851-1.286-1.957-1.36-3.125-0.077-1.168 0.256-2.326 0.944-3.275l17.376-17.376c8.906-10.032 20.915-16.791 34.112-19.2 1.222-0.153 2.451-0.227 3.68-0.224 3.517-0.046 7.005 0.616 10.259 1.947s6.208 3.302 8.685 5.797c13.76 13.472 9.216 35.744-11.52 56.48v0.16z" /> android:pathData="M491,1536l91,-91 -235,-235 -91,91v107h128v128h107zM1014,608q0,-22 -22,-22 -10,0 -17,7l-542,542q-7,7 -7,17 0,22 22,22 10,0 17,-7l542,-542q7,-7 7,-17zM960,416l416,416 -832,832h-416v-416zM1643,512q0,53 -37,90l-166,166 -416,-416 166,-165q36,-38 90,-38 53,0 91,38l235,234q37,39 37,91z" />
</vector> </vector>

View File

@@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp" android:width="32dp"
android:height="16dp" android:height="32dp"
android:viewportWidth="640" android:viewportWidth="24"
android:viewportHeight="512"> android:viewportHeight="24">
<path <path
android:fillColor="#FFFFFFFF" android:fillColor="#FFFFFFFF"
android:pathData="M560 237.568h-208c-4.243 0-8.313-1.686-11.315-4.686-2.998-3-4.685-7.070-4.685-11.314v-205.568c0-4.244-1.687-8.313-4.685-11.313-3.002-3.001-7.072-4.686-11.315-4.686s-8.313 1.685-11.313 4.686c-3 3.001-4.687 7.070-4.687 11.313v205.568c0 4.244-1.686 8.314-4.687 11.314s-7.070 4.686-11.313 4.686h-208c-2.101 0-4.182 0.414-6.123 1.218s-3.705 1.982-5.191 3.469c-1.486 1.486-2.665 3.25-3.469 5.19s-1.218 4.022-1.218 6.123c0 2.101 0.414 4.182 1.218 6.123s1.983 3.705 3.469 5.19c1.486 1.486 3.249 2.664 5.191 3.469s4.022 1.218 6.123 1.218h208c4.243 0 8.313 1.686 11.313 4.687s4.687 7.070 4.687 11.313v210.432c0 4.243 1.686 8.313 4.687 11.315 3 2.998 7.070 4.685 11.313 4.685s8.313-1.687 11.315-4.685c2.998-3.002 4.685-7.072 4.685-11.315v-210.432c0-4.243 1.687-8.313 4.685-11.313 3.002-3 7.072-4.687 11.315-4.687h208c4.243 0 8.313-1.686 11.315-4.687 2.999-3 4.685-7.070 4.685-11.314s-1.687-8.314-4.685-11.314c-3.001-3-7.072-4.686-11.315-4.686v0z"/> android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector> </vector>

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="128"
android:viewportHeight="128">
<path
android:fillColor="#FF000000"
android:pathData="M82.292,41.269C77.427,37.45 71.296,35.172 64.638,35.172C48.838,35.172 36.011,47.999 36.011,63.799C36.011,79.599 48.838,92.426 64.638,92.426C74.998,92.426 84.08,86.911 89.105,78.66C89.198,78.504 89.351,78.394 89.527,78.353C89.704,78.313 89.889,78.346 90.04,78.446C92.453,80.028 101.659,86.07 104.243,87.765C104.622,88.014 104.732,88.52 104.491,88.903C96.08,102.14 81.286,110.933 64.454,110.933C38.295,110.933 17.057,89.695 17.057,63.537C17.057,37.378 38.295,16.14 64.454,16.14C77.501,16.14 89.324,21.423 97.899,29.965L106.199,23.954C106.758,23.549 107.496,23.486 108.116,23.791C108.736,24.095 109.137,24.718 109.158,25.408C109.406,33.597 110.018,53.82 110.255,61.641C110.277,62.353 109.945,63.03 109.368,63.448C108.792,63.867 108.046,63.973 107.376,63.732C99.85,61.027 80.127,53.94 72.734,51.283C72.175,51.082 71.773,50.589 71.69,50.001C71.606,49.413 71.855,48.827 72.336,48.479L82.292,41.269Z" />
</vector>

View File

@@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="25dp" android:width="24dp"
android:height="20dp" android:height="24dp"
android:viewportWidth="640" android:viewportWidth="24"
android:viewportHeight="512"> android:viewportHeight="24">
<path <path
android:fillColor="#FFFFFFFF" android:fillColor="#FFFFFFFF"
android:pathData="M560.509 400.576l-90.304-90.56c-4.509-4.373-7.69-9.932-9.175-16.037s-1.209-12.504 0.791-18.459c13.549-38.522 15.271-80.213 4.947-119.721-10.327-39.507-32.224-75.027-62.883-101.996s-68.681-44.158-109.185-49.358c-40.501-5.2-81.633 1.826-118.112 20.176s-66.639 47.186-86.609 82.803c-19.969 35.618-28.835 76.392-25.459 117.087s18.84 79.45 44.406 111.29c25.566 31.84 60.066 55.312 99.070 67.399 42.909 13.382 89.040 12.189 131.198-3.392 5.974-2.064 12.413-2.377 18.56-0.902 6.144 1.472 11.741 4.672 16.128 9.223l89.6 89.952c4.906 4.909 10.729 8.806 17.139 11.462 6.409 2.659 13.283 4.026 20.221 4.026 6.941 0 13.811-1.366 20.224-4.026 6.409-2.656 12.234-6.553 17.136-11.462l22.4-22.4c9.923-9.942 15.495-23.411 15.495-37.456s-5.571-27.514-15.495-37.456l-0.096-0.192zM104.318 253.344c-8.181-29.267-8.441-60.183-0.752-89.584s23.049-56.232 44.509-77.748c21.461-21.516 48.252-36.946 77.633-44.709s60.297-7.584 89.585 0.522c28.303 7.74 54.098 22.735 74.827 43.501 20.733 20.766 35.687 46.583 43.379 74.899 8.183 29.267 8.442 60.183 0.755 89.584-7.69 29.401-23.050 56.232-44.512 77.747-21.459 21.517-48.25 36.947-77.632 44.711-29.381 7.763-60.298 7.584-89.586-0.522-28.303-7.741-54.097-22.736-74.829-43.501s-35.684-46.582-43.379-74.899zM536.317 451.264l-22.4 22.4c-1.728 1.744-3.783 3.127-6.048 4.070s-4.697 1.427-7.152 1.427c-2.454 0-4.883-0.483-7.149-1.427s-4.32-2.327-6.051-4.070l-88.768-88.992c-1.351-1.376-2.394-3.024-3.069-4.832-0.672-1.808-0.957-3.735-0.835-5.661 0.118-1.926 0.643-3.805 1.536-5.514 0.896-1.709 2.137-3.213 3.648-4.409 9.808-8.221 18.829-17.337 26.944-27.232 1.19-1.526 2.688-2.787 4.397-3.696s3.591-1.443 5.52-1.575c1.93-0.131 3.869 0.151 5.683 0.822 1.815 0.669 3.469 1.719 4.848 3.072l88.896 89.088c3.488 3.529 5.443 8.288 5.443 13.248s-1.955 9.721-5.443 13.248v0.032z"/> android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
</vector> </vector>

View File

@@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="640dp"
android:height="512dp"
android:viewportWidth="640"
android:viewportHeight="512">
<path
android:fillColor="#FF000000"
android:pathData="M418.883 157.792c0 0 9.28-7.552 15.36-0.512 5.344 6.144-1.472 14.112-1.472 14.112l-176.226 194.976c-3.936 4.57-6.075 10.416-6.016 16.448l0.768 112.32c0.046 3.571 1.213 7.040 3.338 9.911s5.099 5.002 8.502 6.089c1.692 0.567 3.464 0.861 5.248 0.864 2.682 0.003 5.327-0.624 7.724-1.827 2.396-1.207 4.474-2.96 6.069-5.117l49.666-67.2c2.72-3.664 6.576-6.329 10.969-7.581 4.39-1.248 9.072-1.014 13.318 0.669l108.64 42.88c2.333 0.921 4.839 1.325 7.341 1.175 2.505-0.151 4.947-0.845 7.155-2.038 2.195-1.184 4.106-2.839 5.587-4.848 1.481-2.007 2.502-4.32 2.989-6.768l87.84-441.056c0.634-3.203 0.33-6.521-0.88-9.553s-3.27-5.65-5.936-7.535c-2.665-1.909-5.824-3.012-9.097-3.176s-6.525 0.616-9.366 2.248l-477.858 273.376c-2.722 1.565-4.957 3.854-6.457 6.613s-2.206 5.879-2.041 9.014c0.166 3.135 1.197 6.164 2.98 8.75s4.246 4.625 7.118 5.895l106.080 48.256c5.627 3.837 12.391 5.645 19.181 5.133 6.791-0.509 13.206-3.312 18.195-7.949z" />
</vector>

View File

@@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="640dp" android:width="24dp"
android:height="512dp" android:height="24dp"
android:viewportWidth="640" android:viewportWidth="1792"
android:viewportHeight="512"> android:viewportHeight="1792">
<path <path
android:fillColor="#FF000000" android:fillColor="#FF000000"
android:pathData="M526.976 6.401c-1.929-2.029-4.253-3.644-6.826-4.745-2.576-1.101-5.351-1.663-8.151-1.655h-383.998c-2.802-0.016-5.576 0.543-8.153 1.645s-4.898 2.719-6.823 4.755c-2.031 1.928-3.647 4.252-4.748 6.827s-1.663 5.348-1.653 8.149v256c0.075 19.489 3.855 38.786 11.136 56.863 6.93 17.843 16.24 34.669 27.68 50.016 11.758 15.37 24.924 29.606 39.328 42.528 13.368 12.256 27.44 23.721 42.144 34.336 12.8 9.088 26.24 17.696 40.32 25.824s24.021 13.623 29.824 16.48c5.856 2.88 10.592 5.152 14.112 6.656 2.752 1.325 5.778 1.984 8.83 1.92 3.011 0.042 5.987-0.653 8.672-2.016 3.584-1.568 8.256-3.776 14.176-6.656s16-8.384 29.824-16.48c13.824-8.096 27.424-16.736 40.32-25.824 14.723-10.618 28.816-22.083 42.208-34.336 14.419-12.906 27.587-27.146 39.328-42.528 11.43-15.353 20.739-32.176 27.68-50.016 7.293-18.074 11.072-37.373 11.136-56.863v-256c0.013-2.784-0.544-5.541-1.641-8.101-1.095-2.559-2.704-4.867-4.726-6.779v0zM477.472 279.712c0 92.799-157.472 172.512-157.472 172.512v-397.375h157.472v224.864z" /> android:pathData="M1344,960v-640h-448v1137q119,-63 213,-137 235,-184 235,-360zM1536,192v768q0,86 -33.5,170.5t-83,150 -118,127.5 -126.5,103 -121,77.5 -89.5,49.5 -42.5,20q-12,6 -26,6t-26,-6q-16,-7 -42.5,-20t-89.5,-49.5 -121,-77.5 -126.5,-103 -118,-127.5 -83,-150 -33.5,-170.5v-768q0,-26 19,-45t45,-19h1152q26,0 45,19t19,45z" />
</vector> </vector>

View File

@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_centerInParent="true"
android:orientation="horizontal">
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="10dp" />
<TextView
android:id="@+id/txtLoading"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:gravity="center|left"
android:textSize="18sp" />
</LinearLayout>
</RelativeLayout>

View File

@@ -2,5 +2,4 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/> <background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/> <foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon> </adaptive-icon>

View File

@@ -2,5 +2,4 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/> <background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/> <foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon> </adaptive-icon>

View File

@@ -11,12 +11,6 @@
--> -->
<autofill-service xmlns:android="http://schemas.android.com/apk/res/android" <autofill-service xmlns:android="http://schemas.android.com/apk/res/android"
android:supportsInlineSuggestions="true"> android:supportsInlineSuggestions="true">
<compatibility-package
android:name="alook.browser"
android:maxLongVersionCode="10000000000"/>
<compatibility-package
android:name="alook.browser.google"
android:maxLongVersionCode="10000000000"/>
<compatibility-package <compatibility-package
android:name="com.amazon.cloud9" android:name="com.amazon.cloud9"
android:maxLongVersionCode="10000000000"/> android:maxLongVersionCode="10000000000"/>
@@ -83,9 +77,6 @@
<compatibility-package <compatibility-package
android:name="com.kiwibrowser.browser" android:name="com.kiwibrowser.browser"
android:maxLongVersionCode="10000000000"/> android:maxLongVersionCode="10000000000"/>
<compatibility-package
android:name="com.kiwibrowser.browser.dev"
android:maxLongVersionCode="10000000000"/>
<compatibility-package <compatibility-package
android:name="com.microsoft.emmx" android:name="com.microsoft.emmx"
android:maxLongVersionCode="10000000000"/> android:maxLongVersionCode="10000000000"/>

View File

@@ -3,7 +3,7 @@ using System;
namespace Bit.Core.Services namespace Bit.Core.Services
{ {
public class AndroidLogService : INativeLogService public class AndroidLogService : ILogService
{ {
private static readonly string _tag = "BITWARDEN"; private static readonly string _tag = "BITWARDEN";

View File

@@ -1,8 +1,8 @@
#if !FDROID #if !FDROID
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using AndroidX.Core.App;
using Bit.App.Abstractions; using Bit.App.Abstractions;
using Bit.Core;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Xamarin.Forms; using Xamarin.Forms;
@@ -10,27 +10,25 @@ namespace Bit.Droid.Services
{ {
public class AndroidPushNotificationService : IPushNotificationService public class AndroidPushNotificationService : IPushNotificationService
{ {
private readonly IStateService _stateService; private readonly IStorageService _storageService;
private readonly IPushNotificationListenerService _pushNotificationListenerService; private readonly IPushNotificationListenerService _pushNotificationListenerService;
public AndroidPushNotificationService( public AndroidPushNotificationService(
IStateService stateService, IStorageService storageService,
IPushNotificationListenerService pushNotificationListenerService) IPushNotificationListenerService pushNotificationListenerService)
{ {
_stateService = stateService; _storageService = storageService;
_pushNotificationListenerService = pushNotificationListenerService; _pushNotificationListenerService = pushNotificationListenerService;
} }
public bool IsRegisteredForPush => NotificationManagerCompat.From(Android.App.Application.Context)?.AreNotificationsEnabled() ?? false;
public async Task<string> GetTokenAsync() public async Task<string> GetTokenAsync()
{ {
return await _stateService.GetPushCurrentTokenAsync(); return await _storageService.GetAsync<string>(Constants.PushCurrentTokenKey);
} }
public async Task RegisterAsync() public async Task RegisterAsync()
{ {
var registeredToken = await _stateService.GetPushRegisteredTokenAsync(); var registeredToken = await _storageService.GetAsync<string>(Constants.PushRegisteredTokenKey);
var currentToken = await GetTokenAsync(); var currentToken = await GetTokenAsync();
if (!string.IsNullOrWhiteSpace(registeredToken) && registeredToken != currentToken) if (!string.IsNullOrWhiteSpace(registeredToken) && registeredToken != currentToken)
{ {
@@ -38,7 +36,7 @@ namespace Bit.Droid.Services
} }
else else
{ {
await _stateService.SetPushLastRegistrationDateAsync(DateTime.UtcNow); await _storageService.SaveAsync(Constants.PushLastRegistrationDateKey, DateTime.UtcNow);
} }
} }

View File

@@ -1,10 +1,11 @@
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 Bit.Core.Services;
using Bit.Core.Utilities;
using Java.Security; using Java.Security;
using Javax.Crypto; using Javax.Crypto;
@@ -42,22 +43,23 @@ namespace Bit.Droid.Services
public Task<bool> ValidateIntegrityAsync(string bioIntegrityKey = null) public Task<bool> ValidateIntegrityAsync(string bioIntegrityKey = null)
{ {
// bioIntegrityKey used in iOS only
if (Build.VERSION.SdkInt < BuildVersionCodes.M) if (Build.VERSION.SdkInt < BuildVersionCodes.M)
{ {
return Task.FromResult(true); return Task.FromResult(true);
} }
_keystore.Load(null);
IKey key = _keystore.GetKey(KeyName, null);
Cipher cipher = Cipher.GetInstance(Transformation);
if (key == null || cipher == null)
{
return Task.FromResult(true);
}
try try
{ {
_keystore.Load(null);
var key = _keystore.GetKey(KeyName, null);
var cipher = Cipher.GetInstance(Transformation);
if (key == null || cipher == null)
{
return Task.FromResult(true);
}
cipher.Init(CipherMode.EncryptMode, key); cipher.Init(CipherMode.EncryptMode, key);
} }
catch (KeyPermanentlyInvalidatedException e) catch (KeyPermanentlyInvalidatedException e)
@@ -73,7 +75,6 @@ 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
LoggerHelper.LogEvenIfCantBeResolved(e);
CreateKey(); CreateKey();
} }
@@ -94,11 +95,10 @@ namespace Bit.Droid.Services
keyGen.Init(keyGenSpec); keyGen.Init(keyGenSpec);
keyGen.GenerateKey(); keyGen.GenerateKey();
} }
catch (Exception e) catch
{ {
// 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
LoggerHelper.LogEvenIfCantBeResolved(e);
} }
} }
} }

View File

@@ -2,7 +2,7 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Android.App; using Android.App;
using Android.Content; using Android.Content;
using Android.OS; using Bit.Core;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Droid.Receivers; using Bit.Droid.Receivers;
using Plugin.CurrentActivity; using Plugin.CurrentActivity;
@@ -12,12 +12,12 @@ namespace Bit.Droid.Services
{ {
public class ClipboardService : IClipboardService public class ClipboardService : IClipboardService
{ {
private readonly IStateService _stateService; private readonly IStorageService _storageService;
private readonly Lazy<PendingIntent> _clearClipboardPendingIntent; private readonly Lazy<PendingIntent> _clearClipboardPendingIntent;
public ClipboardService(IStateService stateService) public ClipboardService(IStorageService storageService)
{ {
_stateService = stateService; _storageService = storageService;
_clearClipboardPendingIntent = new Lazy<PendingIntent>(() => _clearClipboardPendingIntent = new Lazy<PendingIntent>(() =>
PendingIntent.GetBroadcast(CrossCurrentActivity.Current.Activity, PendingIntent.GetBroadcast(CrossCurrentActivity.Current.Activity,
@@ -26,48 +26,20 @@ namespace Bit.Droid.Services
PendingIntentFlags.UpdateCurrent)); PendingIntentFlags.UpdateCurrent));
} }
public async Task CopyTextAsync(string text, int expiresInMs = -1, bool isSensitive = true) public async Task CopyTextAsync(string text, int expiresInMs = -1)
{ {
// Xamarin.Essentials.Clipboard currently doesn't support the IS_SENSITIVE flag for API 33+ await Clipboard.SetTextAsync(text);
if ((int)Build.VERSION.SdkInt < 33)
{
await Clipboard.SetTextAsync(text);
}
else
{
CopyToClipboard(text, isSensitive);
}
await ClearClipboardAlarmAsync(expiresInMs); await ClearClipboardAlarmAsync(expiresInMs);
} }
public bool IsCopyNotificationHandledByPlatform()
{
// Android 13+ provides built-in notification when text is copied to the clipboard
return (int)Build.VERSION.SdkInt >= 33;
}
private void CopyToClipboard(string text, bool isSensitive = true)
{
var activity = (MainActivity)CrossCurrentActivity.Current.Activity;
var clipboardManager = activity.GetSystemService(
Context.ClipboardService) as Android.Content.ClipboardManager;
var clipData = ClipData.NewPlainText("bitwarden", text);
if (isSensitive)
{
clipData.Description.Extras ??= new PersistableBundle();
clipData.Description.Extras.PutBoolean("android.content.extra.IS_SENSITIVE", true);
}
clipboardManager.PrimaryClip = clipData;
}
private async Task ClearClipboardAlarmAsync(int expiresInMs = -1) private async Task ClearClipboardAlarmAsync(int expiresInMs = -1)
{ {
var clearMs = expiresInMs; var clearMs = expiresInMs;
if (clearMs < 0) if (clearMs < 0)
{ {
// if not set then we need to check if the user set this config // if not set then we need to check if the user set this config
var clearSeconds = await _stateService.GetClearClipboardAsync(); var clearSeconds = await _storageService.GetAsync<int?>(Constants.ClearClipboardKey);
if (clearSeconds != null) if (clearSeconds != null)
{ {
clearMs = clearSeconds.Value * 1000; clearMs = clearSeconds.Value * 1000;

View File

@@ -13,7 +13,6 @@ using Android.OS;
using Android.Provider; using Android.Provider;
using Android.Text; using Android.Text;
using Android.Text.Method; using Android.Text.Method;
using Android.Views;
using Android.Views.Autofill; using Android.Views.Autofill;
using Android.Views.InputMethods; using Android.Views.InputMethods;
using Android.Webkit; using Android.Webkit;
@@ -28,34 +27,28 @@ using Bit.Core.Enums;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using Bit.Droid.Autofill; using Bit.Droid.Autofill;
using Bit.Droid.Utilities;
using Plugin.CurrentActivity; using Plugin.CurrentActivity;
namespace Bit.Droid.Services namespace Bit.Droid.Services
{ {
public class DeviceActionService : IDeviceActionService public class DeviceActionService : IDeviceActionService
{ {
private readonly IClipboardService _clipboardService; private readonly IStorageService _storageService;
private readonly IStateService _stateService;
private readonly IMessagingService _messagingService; private readonly IMessagingService _messagingService;
private readonly IBroadcasterService _broadcasterService; private readonly IBroadcasterService _broadcasterService;
private readonly Func<IEventService> _eventServiceFunc; private readonly Func<IEventService> _eventServiceFunc;
private AlertDialog _progressDialog; private ProgressDialog _progressDialog;
object _progressDialogLock = new object();
private bool _cameraPermissionsDenied; private bool _cameraPermissionsDenied;
private Toast _toast; private Toast _toast;
private string _userAgent; private string _userAgent;
public DeviceActionService( public DeviceActionService(
IClipboardService clipboardService, IStorageService storageService,
IStateService stateService,
IMessagingService messagingService, IMessagingService messagingService,
IBroadcasterService broadcasterService, IBroadcasterService broadcasterService,
Func<IEventService> eventServiceFunc) Func<IEventService> eventServiceFunc)
{ {
_clipboardService = clipboardService; _storageService = storageService;
_stateService = stateService;
_messagingService = messagingService; _messagingService = messagingService;
_broadcasterService = broadcasterService; _broadcasterService = broadcasterService;
_eventServiceFunc = eventServiceFunc; _eventServiceFunc = eventServiceFunc;
@@ -115,101 +108,22 @@ namespace Bit.Droid.Services
{ {
await HideLoadingAsync(); await HideLoadingAsync();
} }
var activity = (MainActivity)CrossCurrentActivity.Current.Activity;
var activity = CrossCurrentActivity.Current.Activity; _progressDialog = new ProgressDialog(activity);
var inflater = (LayoutInflater)activity.GetSystemService(Context.LayoutInflaterService); _progressDialog.SetMessage(text);
var dialogView = inflater.Inflate(Resource.Layout.progress_dialog_layout, null); _progressDialog.SetCancelable(false);
var txtLoading = dialogView.FindViewById<TextView>(Resource.Id.txtLoading);
txtLoading.Text = text;
txtLoading.SetTextColor(ThemeHelpers.TextColor);
_progressDialog = new AlertDialog.Builder(activity)
.SetView(dialogView)
.SetCancelable(false)
.Create();
_progressDialog.Show(); _progressDialog.Show();
} }
public Task HideLoadingAsync() public Task HideLoadingAsync()
{ {
// Based on https://github.com/redth-org/AndHUD/blob/master/AndHUD/AndHUD.cs if (_progressDialog != null)
lock (_progressDialogLock)
{ {
if (_progressDialog is null) _progressDialog.Dismiss();
{ _progressDialog.Dispose();
return Task.CompletedTask; _progressDialog = null;
}
void actionDismiss()
{
try
{
if (IsAlive(_progressDialog) && IsAlive(_progressDialog.Window))
{
_progressDialog.Hide();
_progressDialog.Dismiss();
}
}
catch
{
// ignore
}
_progressDialog = null;
}
// First try the SynchronizationContext
if (Application.SynchronizationContext != null)
{
Application.SynchronizationContext.Send(state => actionDismiss(), null);
return Task.CompletedTask;
}
// Otherwise try OwnerActivity on dialog
var ownerActivity = _progressDialog?.OwnerActivity;
if (IsAlive(ownerActivity))
{
ownerActivity.RunOnUiThread(actionDismiss);
return Task.CompletedTask;
}
// Otherwise try get it from the Window Context
if (_progressDialog?.Window?.Context is Activity windowActivity && IsAlive(windowActivity))
{
windowActivity.RunOnUiThread(actionDismiss);
return Task.CompletedTask;
}
// Finally if all else fails, let's see if current activity is MainActivity
if (CrossCurrentActivity.Current.Activity is MainActivity activity && IsAlive(activity))
{
activity.RunOnUiThread(actionDismiss);
return Task.CompletedTask;
}
return Task.CompletedTask;
} }
} return Task.FromResult(0);
bool IsAlive(Java.Lang.Object @object)
{
if (@object == null)
return false;
if (@object.Handle == IntPtr.Zero)
return false;
if (@object is Activity activity)
{
if (activity.IsFinishing)
return false;
if (activity.IsDestroyed)
return false;
}
return true;
} }
public bool OpenFile(byte[] fileData, string id, string fileName) public bool OpenFile(byte[] fileData, string id, string fileName)
@@ -336,7 +250,7 @@ namespace Bit.Droid.Services
try try
{ {
DeleteDir(CrossCurrentActivity.Current.Activity.CacheDir); DeleteDir(CrossCurrentActivity.Current.Activity.CacheDir);
await _stateService.SetLastFileCacheClearAsync(DateTime.UtcNow); await _storageService.SaveAsync(Constants.LastFileCacheClearKey, DateTime.UtcNow);
} }
catch (Exception) { } catch (Exception) { }
} }
@@ -677,7 +591,7 @@ namespace Bit.Droid.Services
else else
{ {
var data = new Intent(); var data = new Intent();
if (cipher?.Login == null) if (cipher == null)
{ {
data.PutExtra("canceled", "true"); data.PutExtra("canceled", "true");
} }
@@ -737,11 +651,6 @@ namespace Bit.Droid.Services
return Accessibility.AccessibilityHelpers.OverlayPermitted(); return Accessibility.AccessibilityHelpers.OverlayPermitted();
} }
public bool HasAutofillService()
{
return true;
}
public void OpenAccessibilityOverlayPermissionSettings() public void OpenAccessibilityOverlayPermissionSettings()
{ {
var activity = (MainActivity)CrossCurrentActivity.Current.Activity; var activity = (MainActivity)CrossCurrentActivity.Current.Activity;
@@ -924,29 +833,27 @@ namespace Bit.Droid.Services
{ {
if (!string.IsNullOrWhiteSpace(cipher?.Login?.Totp)) if (!string.IsNullOrWhiteSpace(cipher?.Login?.Totp))
{ {
var autoCopyDisabled = await _stateService.GetDisableAutoTotpCopyAsync(); var userService = ServiceContainer.Resolve<IUserService>("userService");
var canAccessPremium = await _stateService.CanAccessPremiumAsync(); var autoCopyDisabled = await _storageService.GetAsync<bool?>(Constants.DisableAutoTotpCopyKey);
var canAccessPremium = await userService.CanAccessPremiumAsync();
if ((canAccessPremium || cipher.OrganizationUseTotp) && !autoCopyDisabled.GetValueOrDefault()) if ((canAccessPremium || cipher.OrganizationUseTotp) && !autoCopyDisabled.GetValueOrDefault())
{ {
var totpService = ServiceContainer.Resolve<ITotpService>("totpService"); var totpService = ServiceContainer.Resolve<ITotpService>("totpService");
var totp = await totpService.GetCodeAsync(cipher.Login.Totp); var totp = await totpService.GetCodeAsync(cipher.Login.Totp);
if (totp != null) if (totp != null)
{ {
await _clipboardService.CopyTextAsync(totp); CopyToClipboard(totp);
} }
} }
} }
} }
public float GetSystemFontSizeScale() private void CopyToClipboard(string text)
{ {
var activity = CrossCurrentActivity.Current?.Activity as MainActivity; var activity = (MainActivity)CrossCurrentActivity.Current.Activity;
return activity?.Resources?.Configuration?.FontScale ?? 1; var clipboardManager = activity.GetSystemService(
} Context.ClipboardService) as Android.Content.ClipboardManager;
clipboardManager.PrimaryClip = ClipData.NewPlainText("bitwarden", text);
public async Task OnAccountSwitchCompleteAsync()
{
// for any Android-specific cleanup required after switching accounts
} }
} }
} }

View File

@@ -4,6 +4,7 @@ using Android.Content;
using Android.Runtime; using Android.Runtime;
using Android.Service.QuickSettings; using Android.Service.QuickSettings;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.Core;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using Bit.Droid.Accessibility; using Bit.Droid.Accessibility;
@@ -17,7 +18,7 @@ namespace Bit.Droid.Tile
[Register("com.x8bit.bitwarden.AutofillTileService")] [Register("com.x8bit.bitwarden.AutofillTileService")]
public class AutofillTileService : TileService public class AutofillTileService : TileService
{ {
private IStateService _stateService; private IStorageService _storageService;
public override void OnTileAdded() public override void OnTileAdded()
{ {
@@ -58,11 +59,11 @@ namespace Bit.Droid.Tile
private void SetTileAdded(bool isAdded) private void SetTileAdded(bool isAdded)
{ {
AccessibilityHelpers.IsAutofillTileAdded = isAdded; AccessibilityHelpers.IsAutofillTileAdded = isAdded;
if (_stateService == null) if (_storageService == null)
{ {
_stateService = ServiceContainer.Resolve<IStateService>("stateService"); _storageService = ServiceContainer.Resolve<IStorageService>("storageService");
} }
_stateService.SetAutofillTileAddedAsync(isAdded); _storageService.SaveAsync(Constants.AutofillTileAdded, isAdded);
} }
private void ScanAndFill() private void ScanAndFill()

View File

@@ -15,7 +15,7 @@ using Java.Lang;
namespace Bit.Droid.Tile namespace Bit.Droid.Tile
{ {
[Service(Permission = Android.Manifest.Permission.BindQuickSettingsTile, Label = "@string/PasswordGenerator", [Service(Permission = Android.Manifest.Permission.BindQuickSettingsTile, Label = "@string/PasswordGenerator",
Icon = "@drawable/generate")] Icon = "@drawable/refresh")]
[IntentFilter(new string[] { ActionQsTile })] [IntentFilter(new string[] { ActionQsTile })]
[Register("com.x8bit.bitwarden.GeneratorTileService")] [Register("com.x8bit.bitwarden.GeneratorTileService")]
public class GeneratorTileService : TileService public class GeneratorTileService : TileService

View File

@@ -0,0 +1,58 @@
#if !FDROID
using Bit.Core.Abstractions;
using System.Threading.Tasks;
using Microsoft.AppCenter;
using Microsoft.AppCenter.Crashes;
using Newtonsoft.Json;
namespace Bit.Droid.Utilities
{
public class AppCenterHelper
{
private const string AppSecret = "d3834185-b4a6-4347-9047-b86c65293d42";
private readonly IAppIdService _appIdService;
private readonly IUserService _userService;
private string _userId;
private string _appId;
public AppCenterHelper(
IAppIdService appIdService,
IUserService userService)
{
_appIdService = appIdService;
_userService = userService;
}
public async Task InitAsync()
{
_userId = await _userService.GetUserIdAsync();
_appId = await _appIdService.GetAppIdAsync();
AppCenter.Start(AppSecret, typeof(Crashes));
AppCenter.SetUserId(_userId);
Crashes.GetErrorAttachments = (ErrorReport report) =>
{
return new ErrorAttachmentLog[]
{
ErrorAttachmentLog.AttachmentWithText(Description, "crshdesc.txt"),
};
};
}
public string Description
{
get
{
return JsonConvert.SerializeObject(new
{
AppId = _appId,
UserId = _userId
}, Formatting.Indented);
}
}
}
}
#endif

View File

@@ -36,10 +36,6 @@ namespace Bit.Droid.Utilities
{ {
get => ThemeManager.GetResourceColor("SwitchThumbColor").ToAndroid(); get => ThemeManager.GetResourceColor("SwitchThumbColor").ToAndroid();
} }
public static Color TextColor
{
get => ThemeManager.GetResourceColor("TextColor").ToAndroid();
}
public static void SetAppearance(string theme, bool osDarkModeEnabled) public static void SetAppearance(string theme, bool osDarkModeEnabled)
{ {

View File

@@ -1,12 +0,0 @@
using System;
using System.Threading.Tasks;
using Bit.App.Models;
namespace Bit.App.Abstractions
{
public interface IAccountsManager
{
void Init(Func<AppOptions> getOptionsFunc, IAccountsManagerHost accountsManagerHost);
Task NavigateOnAccountChangeAsync(bool? isAuthed = null);
}
}

View File

@@ -1,14 +0,0 @@
using System.Threading.Tasks;
using Bit.Core.Enums;
namespace Bit.App.Abstractions
{
public interface INavigationParams { }
public interface IAccountsManagerHost
{
Task SetPreviousPageInfoAsync();
void Navigate(NavigationTarget navTarget, INavigationParams navParams = null);
Task UpdateThemeAsync();
}
}

View File

@@ -1,6 +1,6 @@
using System.Threading.Tasks; using Bit.Core.Enums;
using Bit.Core.Enums;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using System.Threading.Tasks;
namespace Bit.App.Abstractions namespace Bit.App.Abstractions
{ {
@@ -35,7 +35,6 @@ namespace Bit.App.Abstractions
void Background(); void Background();
bool AutofillAccessibilityServiceRunning(); bool AutofillAccessibilityServiceRunning();
bool AutofillAccessibilityOverlayPermitted(); bool AutofillAccessibilityOverlayPermitted();
bool HasAutofillService();
bool AutofillServiceEnabled(); bool AutofillServiceEnabled();
void DisableAutofillService(); void DisableAutofillService();
bool AutofillServicesEnabled(); bool AutofillServicesEnabled();
@@ -46,7 +45,5 @@ namespace Bit.App.Abstractions
long GetActiveTime(); long GetActiveTime();
void CloseMainApp(); void CloseMainApp();
bool SupportsFido2(); bool SupportsFido2();
float GetSystemFontSizeScale();
Task OnAccountSwitchCompleteAsync();
} }
} }

View File

@@ -0,0 +1,45 @@
using Bit.App.Pages;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace Bit.App.Abstractions
{
public interface INavigationService
{
/// <summary>
/// Sets the viewmodel to be the main page of the application
/// </summary>
void PresentAsMainPage(BaseViewModel viewModel);
/// <summary>
/// Sets the viewmodel as the main page of the application, and wraps its page within a Navigation page
/// </summary>
void PresentAsNavigatableMainPage(BaseViewModel viewModel);
/// <summary>
/// Navigate to the given page on top of the current navigation stack
/// </summary>
Task NavigateTo(BaseViewModel viewModel);
/// <summary>
/// Navigate to the previous item in the navigation stack
/// </summary>
Task NavigateBack();
/// <summary>
/// Navigate back to the element at the root of the navigation stack
/// </summary>
Task NavigateBackToRoot();
}
public interface IViewLocator
{
Page CreateAndBindPageFor<TViewModel>(TViewModel viewModel) where TViewModel : BaseViewModel;
}
public interface IMainPage
{
Page MainPage { get; set; }
}
}

View File

@@ -7,7 +7,7 @@ namespace Bit.App.Abstractions
string[] ProtectedFields { get; } string[] ProtectedFields { get; }
Task<bool> ShowPasswordPromptAsync(); Task<bool> ShowPasswordPromptAsync();
Task<(string password, bool valid)> ShowPasswordPromptAndGetItAsync(); Task<(string password, bool valid)> ShowPasswordPromptAndGetItAsync();
Task<bool> Enabled(); Task<bool> Enabled();

View File

@@ -1,5 +1,5 @@
using System.Threading.Tasks; using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Linq; using System.Threading.Tasks;
namespace Bit.App.Abstractions namespace Bit.App.Abstractions
{ {

View File

@@ -4,7 +4,6 @@ namespace Bit.App.Abstractions
{ {
public interface IPushNotificationService public interface IPushNotificationService
{ {
bool IsRegisteredForPush { get; }
Task<string> GetTokenAsync(); Task<string> GetTokenAsync();
Task RegisterAsync(); Task RegisterAsync();
Task UnregisterAsync(); Task UnregisterAsync();

View File

@@ -13,12 +13,11 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Plugin.Fingerprint" Version="2.1.5" /> <PackageReference Include="Microsoft.AppCenter.Crashes" Version="4.4.0" />
<PackageReference Include="SkiaSharp.Views.Forms" Version="2.80.3" /> <PackageReference Include="Plugin.Fingerprint" Version="2.1.4" />
<PackageReference Include="Xamarin.CommunityToolkit" Version="2.0.2" /> <PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.3" />
<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.2478" /> <PackageReference Include="Xamarin.Forms" Version="5.0.0.2125" />
<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>
@@ -121,21 +120,17 @@
<DependentUpon>SendGroupingsPage.xaml</DependentUpon> <DependentUpon>SendGroupingsPage.xaml</DependentUpon>
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Remove="Pages\Accounts\AccountsPopupPage.xaml.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Resources\" /> <Folder Include="Resources\" />
<Folder Include="Behaviors\" /> <Folder Include="Behaviors\" />
<Folder Include="Controls\AccountSwitchingOverlay\" />
<Folder Include="Utilities\AccountManagement\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Update="Controls\CipherViewCell\CipherViewCell.xaml"> <EmbeddedResource Update="Controls\CipherViewCell\CipherViewCell.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator> <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Remove="Pages\Accounts\AccountsPopupPage.xaml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@@ -419,8 +414,5 @@
<ItemGroup> <ItemGroup>
<None Remove="Behaviors\" /> <None Remove="Behaviors\" />
<None Remove="Xamarin.CommunityToolkit" />
<None Remove="Controls\AccountSwitchingOverlay\" />
<None Remove="Utilities\AccountManagement\" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -1,24 +1,23 @@
using System; using Bit.App.Abstractions;
using System.Threading.Tasks;
using Bit.App.Abstractions;
using Bit.App.Models; using Bit.App.Models;
using Bit.App.Pages; using Bit.App.Pages;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.App.Services; using Bit.App.Services;
using Bit.App.Utilities; using Bit.App.Utilities;
using Bit.App.Utilities.AccountManagement; using Bit.Core;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Enums;
using Bit.Core.Models.Data;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System;
using System.Threading.Tasks;
using Xamarin.Forms; using Xamarin.Forms;
using Xamarin.Forms.Xaml; using Xamarin.Forms.Xaml;
[assembly: XamlCompilation(XamlCompilationOptions.Compile)] [assembly: XamlCompilation(XamlCompilationOptions.Compile)]
namespace Bit.App namespace Bit.App
{ {
public partial class App : Application, IAccountsManagerHost public partial class App : Application, IMainPage
{ {
private readonly IUserService _userService;
private readonly IBroadcasterService _broadcasterService; private readonly IBroadcasterService _broadcasterService;
private readonly IMessagingService _messagingService; private readonly IMessagingService _messagingService;
private readonly IStateService _stateService; private readonly IStateService _stateService;
@@ -26,9 +25,9 @@ namespace Bit.App
private readonly ISyncService _syncService; private readonly ISyncService _syncService;
private readonly IPlatformUtilsService _platformUtilsService; private readonly IPlatformUtilsService _platformUtilsService;
private readonly IAuthService _authService; private readonly IAuthService _authService;
private readonly IStorageService _storageService;
private readonly IStorageService _secureStorageService; private readonly IStorageService _secureStorageService;
private readonly IDeviceActionService _deviceActionService; private readonly IDeviceActionService _deviceActionService;
private readonly IAccountsManager _accountsManager;
private static bool _isResumed; private static bool _isResumed;
@@ -40,6 +39,7 @@ namespace Bit.App
Current = this; Current = this;
return; return;
} }
_userService = ServiceContainer.Resolve<IUserService>("userService");
_broadcasterService = ServiceContainer.Resolve<IBroadcasterService>("broadcasterService"); _broadcasterService = ServiceContainer.Resolve<IBroadcasterService>("broadcasterService");
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService"); _messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
_stateService = ServiceContainer.Resolve<IStateService>("stateService"); _stateService = ServiceContainer.Resolve<IStateService>("stateService");
@@ -47,11 +47,11 @@ namespace Bit.App
_syncService = ServiceContainer.Resolve<ISyncService>("syncService"); _syncService = ServiceContainer.Resolve<ISyncService>("syncService");
_authService = ServiceContainer.Resolve<IAuthService>("authService"); _authService = ServiceContainer.Resolve<IAuthService>("authService");
_platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService"); _platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService");
_storageService = ServiceContainer.Resolve<IStorageService>("storageService");
_secureStorageService = ServiceContainer.Resolve<IStorageService>("secureStorageService"); _secureStorageService = ServiceContainer.Resolve<IStorageService>("secureStorageService");
_deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService"); _deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService");
_accountsManager = ServiceContainer.Resolve<IAccountsManager>("accountsManager");
_accountsManager.Init(() => Options, this); var navigator = new NavigationService(this, new ViewLocator());
Bootstrap(); Bootstrap();
_broadcasterService.Subscribe(nameof(App), async (message) => _broadcasterService.Subscribe(nameof(App), async (message) =>
@@ -76,11 +76,29 @@ namespace Bit.App
_messagingService.Send("showDialogResolve", new Tuple<int, bool>(details.DialogId, confirmed)); _messagingService.Send("showDialogResolve", new Tuple<int, bool>(details.DialogId, confirmed));
}); });
} }
else if (message.Command == "locked")
{
await LockedAsync(!(message.Data as bool?).GetValueOrDefault());
}
else if (message.Command == "lockVault")
{
await _vaultTimeoutService.LockAsync(true);
}
else if (message.Command == "logout")
{
Device.BeginInvokeOnMainThread(async () =>
await LogOutAsync((message.Data as bool?).GetValueOrDefault()));
}
else if (message.Command == "loggedOut")
{
// Clean up old migrated key if they ever log out.
await _secureStorageService.RemoveAsync("oldKey");
}
else if (message.Command == "resumed") else if (message.Command == "resumed")
{ {
if (Device.RuntimePlatform == Device.iOS) if (Device.RuntimePlatform == Device.iOS)
{ {
ResumedAsync().FireAndForget(); ResumedAsync();
} }
} }
else if (message.Command == "slept") else if (message.Command == "slept")
@@ -93,7 +111,7 @@ namespace Bit.App
else if (message.Command == "migrated") else if (message.Command == "migrated")
{ {
await Task.Delay(1000); await Task.Delay(1000);
await _accountsManager.NavigateOnAccountChangeAsync(); await SetMainPageAsync();
} }
else if (message.Command == "popAllAndGoToTabGenerator" || else if (message.Command == "popAllAndGoToTabGenerator" ||
message.Command == "popAllAndGoToTabMyVault" || message.Command == "popAllAndGoToTabMyVault" ||
@@ -137,6 +155,7 @@ namespace Bit.App
new NavigationPage(new RemoveMasterPasswordPage())); new NavigationPage(new RemoveMasterPasswordPage()));
}); });
} }
}); });
} }
@@ -150,7 +169,7 @@ namespace Bit.App
if (string.IsNullOrWhiteSpace(Options.Uri)) if (string.IsNullOrWhiteSpace(Options.Uri))
{ {
var updated = await AppHelpers.PerformUpdateTasksAsync(_syncService, _deviceActionService, var updated = await AppHelpers.PerformUpdateTasksAsync(_syncService, _deviceActionService,
_stateService); _storageService);
if (!updated) if (!updated)
{ {
SyncIfNeeded(); SyncIfNeeded();
@@ -159,8 +178,6 @@ namespace Bit.App
if (Device.RuntimePlatform == Device.Android) if (Device.RuntimePlatform == Device.Android)
{ {
await _vaultTimeoutService.CheckVaultTimeoutAsync(); await _vaultTimeoutService.CheckVaultTimeoutAsync();
// Reset delay on every start
_vaultTimeoutService.DelayLockAndLogoutMs = null;
} }
_messagingService.Send("startEventTimer"); _messagingService.Send("startEventTimer");
} }
@@ -174,12 +191,9 @@ namespace Bit.App
var isLocked = await _vaultTimeoutService.IsLockedAsync(); var isLocked = await _vaultTimeoutService.IsLockedAsync();
if (!isLocked) if (!isLocked)
{ {
await _stateService.SetLastActiveTimeAsync(_deviceActionService.GetActiveTime()); await _storageService.SaveAsync(Constants.LastActiveTimeKey, _deviceActionService.GetActiveTime());
}
if (!SetTabsPageFromAutofill(isLocked))
{
ClearAutofillUri();
} }
SetTabsPageFromAutofill(isLocked);
await SleptAsync(); await SleptAsync();
} }
} }
@@ -190,22 +204,21 @@ namespace Bit.App
_isResumed = true; _isResumed = true;
if (Device.RuntimePlatform == Device.Android) if (Device.RuntimePlatform == Device.Android)
{ {
ResumedAsync().FireAndForget(); ResumedAsync();
} }
} }
private async Task SleptAsync() private async Task SleptAsync()
{ {
await _vaultTimeoutService.CheckVaultTimeoutAsync(); await HandleVaultTimeoutAsync();
_messagingService.Send("stopEventTimer"); _messagingService.Send("stopEventTimer");
} }
private async Task ResumedAsync() private async void ResumedAsync()
{ {
await _stateService.CheckExtensionActiveUserAndSwitchIfNeededAsync(); UpdateTheme();
await _vaultTimeoutService.CheckVaultTimeoutAsync(); await _vaultTimeoutService.CheckVaultTimeoutAsync();
_messagingService.Send("startEventTimer"); _messagingService.Send("startEventTimer");
await UpdateThemeAsync();
await ClearCacheIfNeededAsync(); await ClearCacheIfNeededAsync();
Prime(); Prime();
SyncIfNeeded(); SyncIfNeeded();
@@ -215,15 +228,6 @@ namespace Bit.App
} }
} }
public async Task UpdateThemeAsync()
{
await Device.InvokeOnMainThreadAsync(() =>
{
ThemeManager.SetTheme(Current.Resources);
_messagingService.Send("updatedTheme");
});
}
private void SetCulture() private void SetCulture()
{ {
// Calendars are removed by linker. ref https://bugzilla.xamarin.com/show_bug.cgi?id=59077 // Calendars are removed by linker. ref https://bugzilla.xamarin.com/show_bug.cgi?id=59077
@@ -232,24 +236,88 @@ namespace Bit.App
new System.Globalization.UmAlQuraCalendar(); new System.Globalization.UmAlQuraCalendar();
} }
private async Task LogOutAsync(bool expired)
{
await AppHelpers.LogOutAsync();
_authService.LogOut(() =>
{
Current.MainPage = new HomePage();
if (expired)
{
_platformUtilsService.ShowToast("warning", null, AppResources.LoginExpired);
}
});
}
private async Task SetMainPageAsync()
{
var authed = await _userService.IsAuthenticatedAsync();
if (authed)
{
if (await _vaultTimeoutService.IsLockedAsync())
{
Current.MainPage = new NavigationPage(new LockPage(Options));
}
else if (Options.FromAutofillFramework && Options.SaveType.HasValue)
{
Current.MainPage = new NavigationPage(new AddEditPage(appOptions: Options));
}
else if (Options.Uri != null)
{
Current.MainPage = new NavigationPage(new AutofillCiphersPage(Options));
}
else if (Options.CreateSend != null)
{
Current.MainPage = new NavigationPage(new SendAddEditPage(Options));
}
else
{
Current.MainPage = new TabsPage(Options);
}
}
else
{
Current.MainPage = new HomePage(Options);
}
}
private async Task HandleVaultTimeoutAsync()
{
if (await _vaultTimeoutService.IsLockedAsync())
{
return;
}
var authed = await _userService.IsAuthenticatedAsync();
if (!authed)
{
return;
}
var vaultTimeout = await _storageService.GetAsync<int?>(Constants.VaultTimeoutKey);
vaultTimeout = vaultTimeout.GetValueOrDefault(-1);
if (vaultTimeout == 0)
{
var action = await _storageService.GetAsync<string>(Constants.VaultTimeoutActionKey);
if (action == "logOut")
{
await _vaultTimeoutService.LogOutAsync();
}
else
{
await _vaultTimeoutService.LockAsync(true);
}
}
}
private async Task ClearCacheIfNeededAsync() private async Task ClearCacheIfNeededAsync()
{ {
var lastClear = await _stateService.GetLastFileCacheClearAsync(); var lastClear = await _storageService.GetAsync<DateTime?>(Constants.LastFileCacheClearKey);
if ((DateTime.UtcNow - lastClear.GetValueOrDefault(DateTime.MinValue)).TotalDays >= 1) if ((DateTime.UtcNow - lastClear.GetValueOrDefault(DateTime.MinValue)).TotalDays >= 1)
{ {
var task = Task.Run(() => _deviceActionService.ClearCacheAsync()); var task = Task.Run(() => _deviceActionService.ClearCacheAsync());
} }
} }
private void ClearAutofillUri() private void SetTabsPageFromAutofill(bool isLocked)
{
if (Device.RuntimePlatform == Device.Android && !string.IsNullOrWhiteSpace(Options.Uri))
{
Options.Uri = null;
}
}
private bool SetTabsPageFromAutofill(bool isLocked)
{ {
if (Device.RuntimePlatform == Device.Android && !string.IsNullOrWhiteSpace(Options.Uri) && if (Device.RuntimePlatform == Device.Android && !string.IsNullOrWhiteSpace(Options.Uri) &&
!Options.FromAutofillFramework) !Options.FromAutofillFramework)
@@ -269,9 +337,7 @@ namespace Bit.App
} }
}); });
}); });
return true;
} }
return false;
} }
private void Prime() private void Prime()
@@ -287,13 +353,13 @@ namespace Bit.App
{ {
InitializeComponent(); InitializeComponent();
SetCulture(); SetCulture();
ThemeManager.SetTheme(Current.Resources); ThemeManager.SetTheme(Device.RuntimePlatform == Device.Android, Current.Resources);
Current.RequestedThemeChanged += (s, a) => Current.RequestedThemeChanged += (s, a) =>
{ {
UpdateThemeAsync(); UpdateTheme();
}; };
Current.MainPage = new NavigationPage(new HomePage(Options)); Current.MainPage = new HomePage();
var mainPageTask = _accountsManager.NavigateOnAccountChangeAsync(); var mainPageTask = SetMainPageAsync();
ServiceContainer.Resolve<MobilePlatformUtilsService>("platformUtilsService").Init(); ServiceContainer.Resolve<MobilePlatformUtilsService>("platformUtilsService").Init();
} }
@@ -314,8 +380,26 @@ namespace Bit.App
}); });
} }
public async Task SetPreviousPageInfoAsync() private void UpdateTheme()
{ {
Device.BeginInvokeOnMainThread(() =>
{
ThemeManager.SetTheme(Device.RuntimePlatform == Device.Android, Current.Resources);
_messagingService.Send("updatedTheme");
});
}
private async Task LockedAsync(bool autoPromptBiometric)
{
await _stateService.PurgeAsync();
if (autoPromptBiometric && Device.RuntimePlatform == Device.iOS)
{
var vaultTimeout = await _storageService.GetAsync<int?>(Constants.VaultTimeoutKey);
if (vaultTimeout == 0)
{
autoPromptBiometric = false;
}
}
PreviousPageInfo lastPageBeforeLock = null; PreviousPageInfo lastPageBeforeLock = null;
if (Current.MainPage is TabbedPage tabbedPage && tabbedPage.Navigation.ModalStack.Count > 0) if (Current.MainPage is TabbedPage tabbedPage && tabbedPage.Navigation.ModalStack.Count > 0)
{ {
@@ -340,45 +424,9 @@ namespace Bit.App
} }
} }
} }
await _stateService.SetPreviousPageInfoAsync(lastPageBeforeLock); await _storageService.SaveAsync(Constants.PreviousPageKey, lastPageBeforeLock);
} var lockPage = new LockPage(Options, autoPromptBiometric);
Device.BeginInvokeOnMainThread(() => Current.MainPage = new NavigationPage(lockPage));
public void Navigate(NavigationTarget navTarget, INavigationParams navParams)
{
switch (navTarget)
{
case NavigationTarget.HomeLogin:
Current.MainPage = new NavigationPage(new HomePage(Options));
break;
case NavigationTarget.Login:
if (navParams is LoginNavigationParams loginParams)
{
Current.MainPage = new NavigationPage(new LoginPage(loginParams.Email, Options));
}
break;
case NavigationTarget.Lock:
if (navParams is LockNavigationParams lockParams)
{
Current.MainPage = new NavigationPage(new LockPage(Options, lockParams.AutoPromptBiometric));
}
else
{
Current.MainPage = new NavigationPage(new LockPage(Options));
}
break;
case NavigationTarget.Home:
Current.MainPage = new TabsPage(Options);
break;
case NavigationTarget.AddEditCipher:
Current.MainPage = new NavigationPage(new AddEditPage(appOptions: Options));
break;
case NavigationTarget.AutofillCiphers:
Current.MainPage = new NavigationPage(new AutofillCiphersPage(Options));
break;
case NavigationTarget.SendAddEdit:
Current.MainPage = new NavigationPage(new SendAddEditPage(Options));
break;
}
} }
} }
} }

View File

@@ -1,57 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
xmlns:controls="clr-namespace:Bit.App.Controls"
xmlns:effects="clr-namespace:Bit.App.Effects"
xmlns:view="clr-namespace:Bit.Core.Models.View;assembly=BitwardenCore"
x:Name="_mainOverlay"
x:DataType="controls:AccountSwitchingOverlayViewModel"
x:Class="Bit.App.Controls.AccountSwitchingOverlayView"
BackgroundColor="#22000000"
Padding="0"
IsVisible="False">
<StackLayout
x:Name="_accountListContainer"
VerticalOptions="Fill"
HorizontalOptions="FillAndExpand"
BackgroundColor="Transparent">
<Frame
Padding="0"
HorizontalOptions="Fill"
VerticalOptions="Start"
xct:ShadowEffect.Color="Black"
xct:ShadowEffect.Radius="10"
xct:ShadowEffect.OffsetY="3">
<ListView
x:Name="_accountListView"
ItemsSource="{Binding BindingContext.AccountViews, Source={x:Reference _mainOverlay}}"
BackgroundColor="{DynamicResource BackgroundColor}"
VerticalOptions="Start"
RowHeight="{Binding AccountListRowHeight, Source={x:Reference _mainOverlay}}"
effects:ScrollViewContentInsetAdjustmentBehaviorEffect.ContentInsetAdjustmentBehavior="Never">
<ListView.ItemTemplate>
<DataTemplate x:DataType="view:AccountView">
<controls:AccountViewCell
Account="{Binding .}"
SelectAccountCommand="{Binding SelectAccountCommand, Source={x:Reference _mainOverlay}}"
LongPressAccountCommand="{Binding LongPressAccountCommand, Source={x:Reference _mainOverlay}}"
/>
</DataTemplate>
</ListView.ItemTemplate>
<ListView.Effects>
<effects:ScrollViewContentInsetAdjustmentBehaviorEffect />
</ListView.Effects>
</ListView>
</Frame>
<BoxView
BackgroundColor="Transparent"
HorizontalOptions="Fill"
VerticalOptions="FillAndExpand">
<BoxView.GestureRecognizers>
<TapGestureRecognizer Tapped="FreeSpaceOverlay_Tapped" />
</BoxView.GestureRecognizers>
</BoxView>
</StackLayout>
</ContentView>

View File

@@ -1,194 +0,0 @@
using System;
using System.Threading.Tasks;
using System.Windows.Input;
using Bit.Core.Abstractions;
using Bit.Core.Utilities;
using Xamarin.CommunityToolkit.ObjectModel;
using Xamarin.Forms;
namespace Bit.App.Controls
{
public partial class AccountSwitchingOverlayView : ContentView
{
public static readonly BindableProperty MainPageProperty = BindableProperty.Create(
nameof(MainPage),
typeof(ContentPage),
typeof(AccountSwitchingOverlayView),
defaultBindingMode: BindingMode.OneWay);
public static readonly BindableProperty MainFabProperty = BindableProperty.Create(
nameof(MainFab),
typeof(View),
typeof(AccountSwitchingOverlayView),
defaultBindingMode: BindingMode.OneWay);
public ContentPage MainPage
{
get => (ContentPage)GetValue(MainPageProperty);
set => SetValue(MainPageProperty, value);
}
public View MainFab
{
get => (View)GetValue(MainFabProperty);
set => SetValue(MainFabProperty, value);
}
readonly LazyResolve<ILogger> _logger = new LazyResolve<ILogger>("logger");
public AccountSwitchingOverlayView()
{
InitializeComponent();
ToggleVisibililtyCommand = new AsyncCommand(ToggleVisibilityAsync,
onException: ex => _logger.Value.Exception(ex),
allowsMultipleExecutions: false);
SelectAccountCommand = new AsyncCommand<AccountViewCellViewModel>(SelectAccountAsync,
onException: ex => _logger.Value.Exception(ex),
allowsMultipleExecutions: false);
LongPressAccountCommand = new AsyncCommand<AccountViewCellViewModel>(LongPressAccountAsync,
onException: ex => _logger.Value.Exception(ex),
allowsMultipleExecutions: false);
}
public AccountSwitchingOverlayViewModel ViewModel => BindingContext as AccountSwitchingOverlayViewModel;
public ICommand ToggleVisibililtyCommand { get; }
public ICommand SelectAccountCommand { get; }
public ICommand LongPressAccountCommand { get; }
public int AccountListRowHeight => Device.RuntimePlatform == Device.Android ? 74 : 70;
public bool LongPressAccountEnabled { get; set; } = true;
public Action AfterHide { get; set; }
public async Task ToggleVisibilityAsync()
{
if (IsVisible)
{
await HideAsync();
}
else
{
await ShowAsync();
}
}
public async Task ShowAsync()
{
if (ViewModel == null)
{
return;
}
await ViewModel.RefreshAccountViewsAsync();
await Device.InvokeOnMainThreadAsync(async () =>
{
// start listView in default (off-screen) position
await _accountListContainer.TranslateTo(0, _accountListContainer.Height * -1, 0);
// re-measure in case accounts have been removed without changing screens
if (ViewModel.AccountViews != null)
{
_accountListView.HeightRequest = AccountListRowHeight * ViewModel.AccountViews.Count;
}
// set overlay opacity to zero before making visible and start fade-in
Opacity = 0;
IsVisible = true;
this.FadeTo(1, 100);
if (Device.RuntimePlatform == Device.Android && MainFab != null)
{
// start fab fade-out
MainFab.FadeTo(0, 200);
}
// slide account list into view
await _accountListContainer.TranslateTo(0, 0, 200, Easing.SinOut);
});
}
public async Task HideAsync()
{
if (!IsVisible)
{
// already hidden, don't animate again
return;
}
// Not all animations are awaited. This is intentional to allow multiple simultaneous animations.
await Device.InvokeOnMainThreadAsync(async () =>
{
// start overlay fade-out
this.FadeTo(0, 200);
if (Device.RuntimePlatform == Device.Android && MainFab != null)
{
// start fab fade-in
MainFab.FadeTo(1, 200);
}
// slide account list out of view
await _accountListContainer.TranslateTo(0, _accountListContainer.Height * -1, 200, Easing.SinIn);
// remove overlay
IsVisible = false;
AfterHide?.Invoke();
});
}
private async void FreeSpaceOverlay_Tapped(object sender, EventArgs e)
{
try
{
await HideAsync();
}
catch (Exception ex)
{
_logger.Value.Exception(ex);
}
}
private async Task SelectAccountAsync(AccountViewCellViewModel item)
{
try
{
await Task.Delay(100);
await HideAsync();
ViewModel?.SelectAccountCommand?.Execute(item);
}
catch (Exception ex)
{
_logger.Value.Exception(ex);
}
}
private async Task LongPressAccountAsync(AccountViewCellViewModel item)
{
if (!LongPressAccountEnabled || !item.IsAccount)
{
return;
}
try
{
await Task.Delay(100);
await HideAsync();
ViewModel?.LongPressAccountCommand?.Execute(
new Tuple<ContentPage, AccountViewCellViewModel>(MainPage, item));
}
catch (Exception ex)
{
_logger.Value.Exception(ex);
}
}
}
}

View File

@@ -1,89 +0,0 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows.Input;
using Bit.App.Utilities;
using Bit.Core.Abstractions;
using Bit.Core.Models.View;
using Bit.Core.Utilities;
using Xamarin.CommunityToolkit.ObjectModel;
using Xamarin.Forms;
namespace Bit.App.Controls
{
public class AccountSwitchingOverlayViewModel : ExtendedViewModel
{
private readonly IStateService _stateService;
private readonly IMessagingService _messagingService;
public AccountSwitchingOverlayViewModel(IStateService stateService,
IMessagingService messagingService,
ILogger logger)
{
_stateService = stateService;
_messagingService = messagingService;
SelectAccountCommand = new AsyncCommand<AccountViewCellViewModel>(SelectAccountAsync,
onException: ex => logger.Exception(ex),
allowsMultipleExecutions: false);
LongPressAccountCommand = new AsyncCommand<Tuple<ContentPage, AccountViewCellViewModel>>(LongPressAccountAsync,
onException: ex => logger.Exception(ex),
allowsMultipleExecutions: false);
}
// this needs to be a new list every time for the binding to get updated,
// XF doesn't currentlyl provide a direct way to update on same instance
// https://github.com/xamarin/Xamarin.Forms/issues/1950
public List<AccountView> AccountViews => _stateService?.AccountViews is null ? null : new List<AccountView>(_stateService.AccountViews);
public bool AllowActiveAccountSelection { get; set; }
public bool AllowAddAccountRow { get; set; }
public ICommand SelectAccountCommand { get; }
public ICommand LongPressAccountCommand { get; }
public bool FromIOSExtension { get; set; }
private async Task SelectAccountAsync(AccountViewCellViewModel item)
{
if (!item.AccountView.IsAccount)
{
_messagingService.Send(AccountsManagerMessageCommands.ADD_ACCOUNT);
return;
}
if (!item.AccountView.IsActive)
{
await _stateService.SetActiveUserAsync(item.AccountView.UserId);
_messagingService.Send(AccountsManagerMessageCommands.SWITCHED_ACCOUNT);
if (FromIOSExtension)
{
await _stateService.SaveExtensionActiveUserIdToStorageAsync(item.AccountView.UserId);
}
}
else if (AllowActiveAccountSelection)
{
_messagingService.Send(AccountsManagerMessageCommands.SWITCHED_ACCOUNT);
}
}
private async Task LongPressAccountAsync(Tuple<ContentPage, AccountViewCellViewModel> item)
{
var (page, account) = item;
if (account.AccountView.IsAccount)
{
await AppHelpers.AccountListOptions(page, account);
}
}
public async Task RefreshAccountViewsAsync()
{
await _stateService.RefreshAccountViewsAsync(AllowAddAccountRow);
Device.BeginInvokeOnMainThread(() => TriggerPropertyChanged(nameof(AccountViews)));
}
}
}

View File

@@ -1,153 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ViewCell xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
x:Class="Bit.App.Controls.AccountViewCell"
xmlns:controls="clr-namespace:Bit.App.Controls"
xmlns:u="clr-namespace:Bit.App.Utilities"
x:Name="_accountView"
x:DataType="controls:AccountViewCellViewModel">
<Grid RowSpacing="0"
ColumnSpacing="0"
xct:TouchEffect.NativeAnimation="True"
xct:TouchEffect.Command="{Binding SelectAccountCommand, Source={x:Reference _accountView}}"
xct:TouchEffect.CommandParameter="{Binding .}"
xct:TouchEffect.LongPressCommand="{Binding LongPressAccountCommand, Source={x:Reference _accountView}}"
xct:TouchEffect.LongPressCommandParameter="{Binding .}">
<Grid.Resources>
<u:InverseBoolConverter x:Key="inverseBool" />
</Grid.Resources>
<Grid
IsVisible="{Binding IsAccount}"
VerticalOptions="CenterAndExpand">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Image
Grid.Column="0"
Source="{Binding AvatarImageSource}"
HorizontalOptions="Center"
Margin="10,0"
VerticalOptions="Center" />
<Grid
Grid.Column="1"
RowSpacing="1"
VerticalOptions="Center">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Label
Grid.Row="0"
Text="{Binding AccountView.Email}"
IsVisible="{Binding IsActive}"
StyleClass="accountlist-title, accountlist-title-platform"
LineBreakMode="TailTruncation" />
<Label
Grid.Row="0"
Text="{Binding AccountView.Email}"
IsVisible="{Binding IsActive, Converter={StaticResource inverseBool}}"
StyleClass="accountlist-title, accountlist-title-platform"
TextColor="{DynamicResource MutedColor}"
LineBreakMode="TailTruncation" />
<Label
Grid.Row="1"
IsVisible="{Binding ShowHostname}"
Text="{Binding AccountView.Hostname}"
StyleClass="accountlist-sub, accountlist-sub-platform"
LineBreakMode="TailTruncation" />
<Label
Grid.Row="2"
Text="{u:I18n AccountUnlocked}"
IsVisible="{Binding IsUnlockedAndNotActive}"
StyleClass="accountlist-sub, accountlist-sub-platform"
FontAttributes="Italic"
TextTransform="Lowercase"
LineBreakMode="TailTruncation" />
<Label
Grid.Row="2"
Text="{u:I18n AccountLocked}"
IsVisible="{Binding IsLockedAndNotActive}"
StyleClass="accountlist-sub, accountlist-sub-platform"
FontAttributes="Italic"
TextTransform="Lowercase"
LineBreakMode="TailTruncation" />
<Label
Grid.Row="2"
Text="{u:I18n AccountLoggedOut}"
IsVisible="{Binding IsLoggedOutAndNotActive}"
StyleClass="accountlist-sub, accountlist-sub-platform"
FontAttributes="Italic"
TextTransform="Lowercase"
LineBreakMode="TailTruncation" />
</Grid>
<controls:IconLabel
Grid.Column="2"
Text="{Binding AuthStatusIconNotActive}"
IsVisible="{Binding IsActive, Converter={StaticResource inverseBool}}"
Margin="12,0"
HorizontalOptions="Center"
VerticalOptions="Center"
StyleClass="list-icon, list-icon-platform" />
<controls:IconLabel
Grid.Column="2"
Text="{Binding AuthStatusIconActive}"
IsVisible="{Binding IsActive}"
Margin="12,0"
HorizontalOptions="Center"
VerticalOptions="Center"
StyleClass="list-icon, list-icon-platform"
TextColor="{DynamicResource TextColor}"/>
</Grid>
<Grid
IsVisible="{Binding IsAccount, Converter={StaticResource inverseBool}}"
VerticalOptions="CenterAndExpand">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image
Grid.Column="0"
VerticalOptions="Center"
HorizontalOptions="Center"
Margin="14,0"
WidthRequest="{OnPlatform 24, iOS=24, Android=26}"
HeightRequest="{OnPlatform 24, iOS=24, Android=26}"
Source="plus.png"
xct:IconTintColorEffect.TintColor="{DynamicResource TextColor}"
AutomationProperties.IsInAccessibleTree="False" />
<Label
Text="{u:I18n AddAccount}"
StyleClass="accountlist-title, accountlist-title-platform"
LineBreakMode="TailTruncation"
VerticalOptions="Center"
Grid.Column="1" />
</Grid>
</Grid>
</ViewCell>

View File

@@ -1,54 +0,0 @@
using System.Windows.Input;
using Bit.Core.Models.View;
using Xamarin.Forms;
namespace Bit.App.Controls
{
public partial class AccountViewCell : ViewCell
{
public static readonly BindableProperty AccountProperty = BindableProperty.Create(
nameof(Account), typeof(AccountView), typeof(AccountViewCell));
public static readonly BindableProperty SelectAccountCommandProperty = BindableProperty.Create(
nameof(SelectAccountCommand), typeof(ICommand), typeof(AccountViewCell));
public static readonly BindableProperty LongPressAccountCommandProperty = BindableProperty.Create(
nameof(LongPressAccountCommand), typeof(ICommand), typeof(AccountViewCell));
public AccountViewCell()
{
InitializeComponent();
}
public AccountView Account
{
get => GetValue(AccountProperty) as AccountView;
set => SetValue(AccountProperty, value);
}
public ICommand SelectAccountCommand
{
get => GetValue(SelectAccountCommandProperty) as ICommand;
set => SetValue(SelectAccountCommandProperty, value);
}
public ICommand LongPressAccountCommand
{
get => GetValue(LongPressAccountCommandProperty) as ICommand;
set => SetValue(LongPressAccountCommandProperty, value);
}
protected override void OnPropertyChanged(string propertyName = null)
{
base.OnPropertyChanged(propertyName);
if (propertyName == AccountProperty.PropertyName)
{
if (Account == null)
{
return;
}
BindingContext = new AccountViewCellViewModel(Account);
}
}
}
}

View File

@@ -1,93 +0,0 @@
using Bit.Core;
using Bit.Core.Enums;
using Bit.Core.Models.View;
using Bit.Core.Utilities;
namespace Bit.App.Controls
{
public class AccountViewCellViewModel : ExtendedViewModel
{
private AccountView _accountView;
private AvatarImageSource _avatar;
public AccountViewCellViewModel(AccountView accountView)
{
AccountView = accountView;
AvatarImageSource = new AvatarImageSource(AccountView.Name, AccountView.Email);
}
public AccountView AccountView
{
get => _accountView;
set => SetProperty(ref _accountView, value);
}
public AvatarImageSource AvatarImageSource
{
get => _avatar;
set => SetProperty(ref _avatar, value);
}
public bool IsAccount
{
get => AccountView.IsAccount;
}
public bool ShowHostname
{
get => !string.IsNullOrWhiteSpace(AccountView.Hostname) && AccountView.Hostname != "vault.bitwarden.com";
}
public bool IsActive
{
get => AccountView.IsActive;
}
public bool IsUnlocked
{
get => AccountView.AuthStatus == AuthenticationStatus.Unlocked;
}
public bool IsUnlockedAndNotActive
{
get => IsUnlocked && !IsActive;
}
public bool IsLocked
{
get => AccountView.AuthStatus == AuthenticationStatus.Locked;
}
public bool IsLockedAndNotActive
{
get => IsLocked && !IsActive;
}
public bool IsLoggedOut
{
get => AccountView.AuthStatus == AuthenticationStatus.LoggedOut;
}
public bool IsLoggedOutAndNotActive
{
get => IsLoggedOut && !IsActive;
}
public string AuthStatusIconActive
{
get => BitwardenIcons.CheckCircle;
}
public string AuthStatusIconNotActive
{
get
{
if (IsUnlocked)
{
return BitwardenIcons.Unlock;
}
return BitwardenIcons.Lock;
}
}
}
}

View File

@@ -1,153 +0,0 @@
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using SkiaSharp;
using Xamarin.Forms;
namespace Bit.App.Controls
{
public class AvatarImageSource : StreamImageSource
{
private string _data;
public override bool Equals(object obj)
{
if (obj is null)
{
return false;
}
if (obj is AvatarImageSource avatar)
{
return avatar._data == _data;
}
return base.Equals(obj);
}
public override int GetHashCode() => _data?.GetHashCode() ?? -1;
public AvatarImageSource(string name = null, string email = null)
{
_data = name;
if (string.IsNullOrWhiteSpace(_data))
{
_data = email;
}
}
public override Func<CancellationToken, Task<Stream>> Stream => GetStreamAsync;
private Task<Stream> GetStreamAsync(CancellationToken userToken = new CancellationToken())
{
OnLoadingStarted();
userToken.Register(CancellationTokenSource.Cancel);
var result = Draw();
OnLoadingCompleted(CancellationTokenSource.IsCancellationRequested);
return Task.FromResult(result);
}
private Stream Draw()
{
string chars = null;
string upperData = null;
if (string.IsNullOrEmpty(_data))
{
chars = "..";
}
else if (_data?.Length > 1)
{
upperData = _data.ToUpper();
chars = GetFirstLetters(upperData, 2);
}
else
{
chars = upperData = _data.ToUpper();
}
var bgColor = StringToColor(upperData);
var textColor = Color.White;
var size = 50;
var bitmap = new SKBitmap(
size * 2,
size * 2,
SKImageInfo.PlatformColorType,
SKAlphaType.Premul);
var canvas = new SKCanvas(bitmap);
canvas.Clear(SKColors.Transparent);
var midX = canvas.LocalClipBounds.Size.ToSizeI().Width / 2;
var midY = canvas.LocalClipBounds.Size.ToSizeI().Height / 2;
var radius = midX - midX / 5;
var circlePaint = new SKPaint
{
IsAntialias = true,
Style = SKPaintStyle.Fill,
StrokeJoin = SKStrokeJoin.Miter,
Color = SKColor.Parse(bgColor.ToHex())
};
canvas.DrawCircle(midX, midY, radius, circlePaint);
var typeface = SKTypeface.FromFamilyName("Arial", SKFontStyle.Normal);
var textSize = midX / 1.3f;
var textPaint = new SKPaint
{
IsAntialias = true,
Style = SKPaintStyle.Fill,
Color = SKColor.Parse(textColor.ToHex()),
TextSize = textSize,
TextAlign = SKTextAlign.Center,
Typeface = typeface
};
var rect = new SKRect();
textPaint.MeasureText(chars, ref rect);
canvas.DrawText(chars, midX, midY + rect.Height / 2, textPaint);
return SKImage.FromBitmap(bitmap).Encode(SKEncodedImageFormat.Png, 100).AsStream();
}
private string GetFirstLetters(string data, int charCount)
{
var parts = data.Split();
if (parts.Length > 1 && charCount <= 2)
{
var text = "";
for (int i = 0; i < charCount; i++)
{
text += parts[i].Substring(0, 1);
}
return text;
}
if (data.Length > 2)
{
return data.Substring(0, 2);
}
return data;
}
private Color StringToColor(string str)
{
if (str == null)
{
return Color.FromHex("#33ffffff");
}
var hash = 0;
for (var i = 0; i < str.Length; i++)
{
hash = str[i] + ((hash << 5) - hash);
}
var color = "#FF";
for (var i = 0; i < 3; i++)
{
var value = (hash >> (i * 8)) & 0xff;
var base16 = "00" + Convert.ToString(value, 16);
color += base16.Substring(base16.Length - 2);
}
return Color.FromHex(color);
}
}
}

View File

@@ -5,17 +5,16 @@
xmlns:controls="clr-namespace:Bit.App.Controls" xmlns:controls="clr-namespace:Bit.App.Controls"
xmlns:u="clr-namespace:Bit.App.Utilities" xmlns:u="clr-namespace:Bit.App.Utilities"
xmlns:ff="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms" xmlns:ff="clr-namespace:FFImageLoading.Forms;assembly=FFImageLoading.Forms"
xmlns:core="clr-namespace:Bit.Core;assembly=BitwardenCore"
StyleClass="list-row, list-row-platform" StyleClass="list-row, list-row-platform"
RowSpacing="0" RowSpacing="0"
ColumnSpacing="0" ColumnSpacing="0"
x:DataType="controls:CipherViewCellViewModel"> x:DataType="controls:CipherViewCellViewModel">
<Grid.Resources> <Grid.Resources>
<u:IconGlyphConverter x:Key="iconGlyphConverter"/> <u:IconGlyphConverter x:Key="iconGlyphConverter"/>
<u:IconImageConverter x:Key="iconImageConverter"/> <u:IconImageConverter x:Key="iconImageConverter"/>
<u:InverseBoolConverter x:Key="inverseBool" /> <u:InverseBoolConverter x:Key="inverseBool" />
<u:StringHasValueConverter x:Key="stringHasValueConverter" /> <u:StringHasValueConverter x:Key="stringHasValueConverter" />
</Grid.Resources> </Grid.Resources>
<Grid.RowDefinitions> <Grid.RowDefinitions>
@@ -23,33 +22,29 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="40" x:Name="_iconColumn" /> <ColumnDefinition Width="40" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
<ColumnDefinition Width="60" /> <ColumnDefinition Width="60" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<controls:IconLabel <controls:FaLabel
Grid.Column="0" Grid.Column="0"
HorizontalOptions="Center" HorizontalOptions="Center"
VerticalOptions="Center" VerticalOptions="Center"
StyleClass="list-icon, list-icon-platform" StyleClass="list-icon, list-icon-platform"
IsVisible="{Binding ShowIconImage, Converter={StaticResource inverseBool}}" IsVisible="{Binding ShowIconImage, Converter={StaticResource inverseBool}}"
Text="{Binding Cipher, Converter={StaticResource iconGlyphConverter}}" Text="{Binding Cipher, Converter={StaticResource iconGlyphConverter}}"
ShouldUpdateFontSizeDynamicallyForAccesibility="True"
AutomationProperties.IsInAccessibleTree="False" /> AutomationProperties.IsInAccessibleTree="False" />
<ff:CachedImage <ff:CachedImage
x:Name="_iconImage"
Grid.Column="0" Grid.Column="0"
BitmapOptimizations="True" BitmapOptimizations="True"
ErrorPlaceholder="login.png" ErrorPlaceholder="login.png"
LoadingPlaceholder="login.png" LoadingPlaceholder="login.png"
HorizontalOptions="CenterAndExpand" HorizontalOptions="Center"
VerticalOptions="CenterAndExpand" VerticalOptions="Center"
Margin="9"
WidthRequest="22" WidthRequest="22"
HeightRequest="22" HeightRequest="22"
Aspect="AspectFit"
IsVisible="{Binding ShowIconImage}" IsVisible="{Binding ShowIconImage}"
Source="{Binding IconImageSource, Mode=OneTime}" Source="{Binding IconImageSource, Mode=OneTime}"
AutomationProperties.IsInAccessibleTree="False" /> AutomationProperties.IsInAccessibleTree="False" />
@@ -81,25 +76,25 @@
Text="{Binding Cipher.SubTitle}" Text="{Binding Cipher.SubTitle}"
IsVisible="{Binding Source={RelativeSource Self}, Path=Text, IsVisible="{Binding Source={RelativeSource Self}, Path=Text,
Converter={StaticResource stringHasValueConverter}}"/> Converter={StaticResource stringHasValueConverter}}"/>
<controls:IconLabel <controls:FaLabel
Grid.Column="1" Grid.Column="1"
Grid.Row="0" Grid.Row="0"
HorizontalOptions="Start" HorizontalOptions="Start"
VerticalOptions="Center" VerticalOptions="Center"
StyleClass="list-title-icon" StyleClass="list-title-icon"
Margin="5, 0, 0, 0" Margin="5, 0, 0, 0"
Text="{Binding Source={x:Static core:BitwardenIcons.Collection}}" Text="&#xf1b2;"
IsVisible="{Binding Cipher.Shared, Mode=OneTime}" IsVisible="{Binding Cipher.Shared, Mode=OneTime}"
AutomationProperties.IsInAccessibleTree="True" AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Shared}" /> AutomationProperties.Name="{u:I18n Shared}" />
<controls:IconLabel <controls:FaLabel
Grid.Column="2" Grid.Column="2"
Grid.Row="0" Grid.Row="0"
HorizontalOptions="Start" HorizontalOptions="Start"
VerticalOptions="Center" VerticalOptions="Center"
StyleClass="list-title-icon" StyleClass="list-title-icon"
Margin="5, 0, 0, 0" Margin="5, 0, 0, 0"
Text="{Binding Source={x:Static core:BitwardenIcons.Paperclip}}" Text="&#xf0c6;"
IsVisible="{Binding Cipher.HasAttachments, Mode=OneTime}" IsVisible="{Binding Cipher.HasAttachments, Mode=OneTime}"
AutomationProperties.IsInAccessibleTree="True" AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Attachments}" /> AutomationProperties.Name="{u:I18n Attachments}" />
@@ -108,7 +103,7 @@
<controls:MiButton <controls:MiButton
Grid.Row="0" Grid.Row="0"
Grid.Column="2" Grid.Column="2"
Text="{Binding Source={x:Static core:BitwardenIcons.ViewCellMenu}}" Text="&#xe5d3;"
StyleClass="list-row-button, list-row-button-platform, btn-disabled" StyleClass="list-row-button, list-row-button-platform, btn-disabled"
Clicked="MoreButton_Clicked" Clicked="MoreButton_Clicked"
VerticalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand"
@@ -116,4 +111,4 @@
AutomationProperties.IsInAccessibleTree="True" AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Options}" /> AutomationProperties.Name="{u:I18n Options}" />
</controls:ExtendedGrid> </controls:ExtendedGrid>

View File

@@ -1,16 +1,11 @@
using System; using System;
using Bit.App.Abstractions;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Bit.Core.Utilities;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {
public partial class CipherViewCell : ExtendedGrid public partial class CipherViewCell : ExtendedGrid
{ {
private const int ICON_COLUMN_DEFAULT_WIDTH = 40;
private const int ICON_IMAGE_DEFAULT_WIDTH = 22;
public static readonly BindableProperty CipherProperty = BindableProperty.Create( public static readonly BindableProperty CipherProperty = BindableProperty.Create(
nameof(Cipher), typeof(CipherView), typeof(CipherViewCell), default(CipherView), BindingMode.OneWay); nameof(Cipher), typeof(CipherView), typeof(CipherViewCell), default(CipherView), BindingMode.OneWay);
@@ -23,11 +18,6 @@ namespace Bit.App.Controls
public CipherViewCell() public CipherViewCell()
{ {
InitializeComponent(); InitializeComponent();
var fontScale = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService").GetSystemFontSizeScale();
_iconColumn.Width = new GridLength(ICON_COLUMN_DEFAULT_WIDTH * fontScale, GridUnitType.Absolute);
_iconImage.WidthRequest = ICON_IMAGE_DEFAULT_WIDTH * fontScale;
_iconImage.HeightRequest = ICON_IMAGE_DEFAULT_WIDTH * fontScale;
} }
public bool? WebsiteIconsEnabled public bool? WebsiteIconsEnabled

View File

@@ -4,6 +4,5 @@ namespace Bit.App.Controls
{ {
public class ExtendedCollectionView : CollectionView public class ExtendedCollectionView : CollectionView
{ {
public string ExtraDataForLogging { get; set; }
} }
} }

View File

@@ -6,7 +6,7 @@ namespace Bit.App.Controls
{ {
public static readonly BindableProperty StepperBackgroundColorProperty = BindableProperty.Create( public static readonly BindableProperty StepperBackgroundColorProperty = BindableProperty.Create(
nameof(StepperBackgroundColor), typeof(Color), typeof(ExtendedStepper), Color.Default); nameof(StepperBackgroundColor), typeof(Color), typeof(ExtendedStepper), Color.Default);
public static readonly BindableProperty StepperForegroundColorProperty = BindableProperty.Create( public static readonly BindableProperty StepperForegroundColorProperty = BindableProperty.Create(
nameof(StepperForegroundColor), typeof(Color), typeof(ExtendedStepper), Color.Default); nameof(StepperForegroundColor), typeof(Color), typeof(ExtendedStepper), Color.Default);
@@ -15,7 +15,7 @@ namespace Bit.App.Controls
get => (Color)GetValue(StepperBackgroundColorProperty); get => (Color)GetValue(StepperBackgroundColorProperty);
set => SetValue(StepperBackgroundColorProperty, value); set => SetValue(StepperBackgroundColorProperty, value);
} }
public Color StepperForegroundColor public Color StepperForegroundColor
{ {
get => (Color)GetValue(StepperForegroundColorProperty); get => (Color)GetValue(StepperForegroundColorProperty);

View File

@@ -1,29 +0,0 @@
using System;
using Xamarin.Forms;
namespace Bit.App.Controls
{
public class ExtendedToolbarItem : ToolbarItem
{
public bool UseOriginalImage { get; set; }
// HACK: For the issue of correctly updating the avatar toolbar item color on iOS
// we need to subscribe to the PropertyChanged event of the ToolbarItem on the CustomNavigationRenderer
// The problem is that there are a lot of private places where the navigation renderer disposes objects
// that we don't have access to, and that we should in order to properly prevent memory leaks
// So as a hack solution we have this OnAppearing/OnDisappearing actions and methods to be called on page lifecycle
// to subscribe/unsubscribe indirectly on the CustomNavigationRenderer
public Action OnAppearingAction { get; set; }
public Action OnDisappearingAction { get; set; }
public void OnAppearing()
{
OnAppearingAction?.Invoke();
}
public void OnDisappearing()
{
OnDisappearingAction?.Invoke();
}
}
}

View File

@@ -2,18 +2,18 @@
namespace Bit.App.Controls namespace Bit.App.Controls
{ {
public class IconButton : Button public class FaButton : Button
{ {
public IconButton() public FaButton()
{ {
Padding = 0; Padding = 0;
switch (Device.RuntimePlatform) switch (Device.RuntimePlatform)
{ {
case Device.iOS: case Device.iOS:
FontFamily = "bwi-font"; FontFamily = "FontAwesome";
break; break;
case Device.Android: case Device.Android:
FontFamily = "bwi-font.ttf#bwi-font"; FontFamily = "FontAwesome.ttf#FontAwesome";
break; break;
} }
} }

View File

@@ -2,19 +2,17 @@
namespace Bit.App.Controls namespace Bit.App.Controls
{ {
public class IconLabel : Label public class FaLabel : Label
{ {
public bool ShouldUpdateFontSizeDynamicallyForAccesibility { get; set; } public FaLabel()
public IconLabel()
{ {
switch (Device.RuntimePlatform) switch (Device.RuntimePlatform)
{ {
case Device.iOS: case Device.iOS:
FontFamily = "bwi-font"; FontFamily = "FontAwesome";
break; break;
case Device.Android: case Device.Android:
FontFamily = "bwi-font.ttf#bwi-font"; FontFamily = "FontAwesome.ttf#FontAwesome";
break; break;
} }
} }

View File

@@ -4,7 +4,6 @@
x:Class="Bit.App.Controls.SendViewCell" x:Class="Bit.App.Controls.SendViewCell"
xmlns:controls="clr-namespace:Bit.App.Controls" xmlns:controls="clr-namespace:Bit.App.Controls"
xmlns:u="clr-namespace:Bit.App.Utilities" xmlns:u="clr-namespace:Bit.App.Utilities"
xmlns:core="clr-namespace:Bit.Core;assembly=BitwardenCore"
StyleClass="list-row, list-row-platform" StyleClass="list-row, list-row-platform"
RowSpacing="0" RowSpacing="0"
ColumnSpacing="0" ColumnSpacing="0"
@@ -19,19 +18,18 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="40" x:Name="_iconColumn" /> <ColumnDefinition Width="40" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
<ColumnDefinition Width="60" /> <ColumnDefinition Width="60" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<controls:IconLabel <controls:FaLabel
Grid.Row="0" Grid.Row="0"
Grid.Column="0" Grid.Column="0"
HorizontalOptions="Center" HorizontalOptions="Center"
VerticalOptions="Center" VerticalOptions="Center"
StyleClass="list-icon, list-icon-platform" StyleClass="list-icon, list-icon-platform"
Text="{Binding Send, Converter={StaticResource sendIconGlyphConverter}}" Text="{Binding Send, Converter={StaticResource sendIconGlyphConverter}}"
ShouldUpdateFontSizeDynamicallyForAccesibility="True"
AutomationProperties.IsInAccessibleTree="False" /> AutomationProperties.IsInAccessibleTree="False" />
<Grid RowSpacing="0" ColumnSpacing="0" Grid.Row="0" Grid.Column="1" VerticalOptions="Center" Padding="0, 7"> <Grid RowSpacing="0" ColumnSpacing="0" Grid.Row="0" Grid.Column="1" VerticalOptions="Center" Padding="0, 7">
@@ -62,58 +60,58 @@
Grid.ColumnSpan="6" Grid.ColumnSpan="6"
StyleClass="list-subtitle, list-subtitle-platform" StyleClass="list-subtitle, list-subtitle-platform"
Text="{Binding Send.DisplayDate}" /> Text="{Binding Send.DisplayDate}" />
<controls:IconLabel <controls:FaLabel
Grid.Column="1" Grid.Column="1"
Grid.Row="0" Grid.Row="0"
HorizontalOptions="Start" HorizontalOptions="Start"
VerticalOptions="Center" VerticalOptions="Center"
StyleClass="list-title-icon" StyleClass="list-title-icon"
Margin="5, 0, 0, 0" Margin="5, 0, 0, 0"
Text="{Binding Source={x:Static core:BitwardenIcons.ExclamationTriangle}}" Text="&#xf071;"
IsVisible="{Binding Send.Disabled, Mode=OneTime}" IsVisible="{Binding Send.Disabled, Mode=OneTime}"
AutomationProperties.IsInAccessibleTree="True" AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Disabled}" /> AutomationProperties.Name="{u:I18n Disabled}" />
<controls:IconLabel <controls:FaLabel
Grid.Column="2" Grid.Column="2"
Grid.Row="0" Grid.Row="0"
HorizontalOptions="Start" HorizontalOptions="Start"
VerticalOptions="Center" VerticalOptions="Center"
StyleClass="list-title-icon" StyleClass="list-title-icon"
Margin="5, 0, 0, 0" Margin="5, 0, 0, 0"
Text="{Binding Source={x:Static core:BitwardenIcons.Key}}" Text="&#xf084;"
IsVisible="{Binding Send.HasPassword, Mode=OneTime}" IsVisible="{Binding Send.HasPassword, Mode=OneTime}"
AutomationProperties.IsInAccessibleTree="True" AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Password}" /> AutomationProperties.Name="{u:I18n Password}" />
<controls:IconLabel <controls:FaLabel
Grid.Column="3" Grid.Column="3"
Grid.Row="0" Grid.Row="0"
HorizontalOptions="Start" HorizontalOptions="Start"
VerticalOptions="Center" VerticalOptions="Center"
StyleClass="list-title-icon" StyleClass="list-title-icon"
Margin="5, 0, 0, 0" Margin="5, 0, 0, 0"
Text="{Binding Source={x:Static core:BitwardenIcons.Ban}}" Text="&#xf05e;"
IsVisible="{Binding Send.MaxAccessCountReached, Mode=OneTime}" IsVisible="{Binding Send.MaxAccessCountReached, Mode=OneTime}"
AutomationProperties.IsInAccessibleTree="True" AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n MaxAccessCountReached}" /> AutomationProperties.Name="{u:I18n MaxAccessCountReached}" />
<controls:IconLabel <controls:FaLabel
Grid.Column="4" Grid.Column="4"
Grid.Row="0" Grid.Row="0"
HorizontalOptions="Start" HorizontalOptions="Start"
VerticalOptions="Center" VerticalOptions="Center"
StyleClass="list-title-icon" StyleClass="list-title-icon"
Margin="5, 0, 0, 0" Margin="5, 0, 0, 0"
Text="{Binding Source={x:Static core:BitwardenIcons.Clock}}" Text="&#xf017;"
IsVisible="{Binding Send.Expired, Mode=OneTime}" IsVisible="{Binding Send.Expired, Mode=OneTime}"
AutomationProperties.IsInAccessibleTree="True" AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Expired}" /> AutomationProperties.Name="{u:I18n Expired}" />
<controls:IconLabel <controls:FaLabel
Grid.Column="5" Grid.Column="5"
Grid.Row="0" Grid.Row="0"
HorizontalOptions="Start" HorizontalOptions="Start"
VerticalOptions="Center" VerticalOptions="Center"
StyleClass="list-title-icon" StyleClass="list-title-icon"
Margin="5, 0, 0, 0" Margin="5, 0, 0, 0"
Text="{Binding Source={x:Static core:BitwardenIcons.Trash}}" Text="&#xf1f8;"
IsVisible="{Binding Send.PendingDelete, Mode=OneTime}" IsVisible="{Binding Send.PendingDelete, Mode=OneTime}"
AutomationProperties.IsInAccessibleTree="True" AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n PendingDelete}" /> AutomationProperties.Name="{u:I18n PendingDelete}" />
@@ -122,7 +120,7 @@
<controls:MiButton <controls:MiButton
Grid.Row="0" Grid.Row="0"
Grid.Column="2" Grid.Column="2"
Text="{Binding Source={x:Static core:BitwardenIcons.ViewCellMenu}}" Text="&#xe5d3;"
IsVisible="{Binding ShowOptions, Mode=OneWay}" IsVisible="{Binding ShowOptions, Mode=OneWay}"
StyleClass="list-row-button, list-row-button-platform, btn-disabled" StyleClass="list-row-button, list-row-button-platform, btn-disabled"
Clicked="MoreButton_Clicked" Clicked="MoreButton_Clicked"

View File

@@ -1,7 +1,5 @@
using System; using System;
using Bit.App.Abstractions;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Bit.Core.Utilities;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Controls namespace Bit.App.Controls
@@ -13,16 +11,13 @@ namespace Bit.App.Controls
public static readonly BindableProperty ButtonCommandProperty = BindableProperty.Create( public static readonly BindableProperty ButtonCommandProperty = BindableProperty.Create(
nameof(ButtonCommand), typeof(Command<SendView>), typeof(SendViewCell)); nameof(ButtonCommand), typeof(Command<SendView>), typeof(SendViewCell));
public static readonly BindableProperty ShowOptionsProperty = BindableProperty.Create( public static readonly BindableProperty ShowOptionsProperty = BindableProperty.Create(
nameof(ShowOptions), typeof(bool), typeof(SendViewCell), true, BindingMode.OneWay); nameof(ShowOptions), typeof(bool), typeof(SendViewCell), true, BindingMode.OneWay);
public SendViewCell() public SendViewCell()
{ {
InitializeComponent(); InitializeComponent();
var deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService");
_iconColumn.Width = new GridLength(40 * deviceActionService.GetSystemFontSizeScale(), GridUnitType.Absolute);
} }
public SendView Send public SendView Send

View File

@@ -4,8 +4,8 @@ namespace Bit.App.Effects
{ {
public class FabShadowEffect : RoutingEffect public class FabShadowEffect : RoutingEffect
{ {
public FabShadowEffect() public FabShadowEffect()
: base("Bitwarden.FabShadowEffect") : base("Bitwarden.FabShadowEffect")
{ } { }
} }
} }

View File

@@ -1,33 +0,0 @@
using Xamarin.Forms;
namespace Bit.App.Effects
{
public enum ScrollContentInsetAdjustmentBehavior
{
Automatic,
ScrollableAxes,
Never,
Always
}
public class ScrollViewContentInsetAdjustmentBehaviorEffect : RoutingEffect
{
public static readonly BindableProperty ContentInsetAdjustmentBehaviorProperty =
BindableProperty.CreateAttached("ContentInsetAdjustmentBehavior", typeof(ScrollContentInsetAdjustmentBehavior), typeof(ScrollViewContentInsetAdjustmentBehaviorEffect), ScrollContentInsetAdjustmentBehavior.Automatic);
public static ScrollContentInsetAdjustmentBehavior GetContentInsetAdjustmentBehavior(BindableObject view)
{
return (ScrollContentInsetAdjustmentBehavior)view.GetValue(ContentInsetAdjustmentBehaviorProperty);
}
public static void SetContentInsetAdjustmentBehavior(BindableObject view, ScrollContentInsetAdjustmentBehavior value)
{
view.SetValue(ContentInsetAdjustmentBehaviorProperty, value);
}
public ScrollViewContentInsetAdjustmentBehaviorEffect()
: base($"Bitwarden.{nameof(ScrollViewContentInsetAdjustmentBehaviorEffect)}")
{
}
}
}

View File

@@ -21,8 +21,6 @@ namespace Bit.App.Models
public string SaveCardCode { get; set; } public string SaveCardCode { get; set; }
public bool IosExtension { get; set; } public bool IosExtension { get; set; }
public Tuple<SendType, string, byte[], string> CreateSend { get; set; } public Tuple<SendType, string, byte[], string> CreateSend { get; set; }
public bool CopyInsteadOfShareAfterSaving { get; set; }
public bool HideAccountSwitcher { get; set; }
public void SetAllFrom(AppOptions o) public void SetAllFrom(AppOptions o)
{ {
@@ -46,8 +44,6 @@ namespace Bit.App.Models
SaveCardCode = o.SaveCardCode; SaveCardCode = o.SaveCardCode;
IosExtension = o.IosExtension; IosExtension = o.IosExtension;
CreateSend = o.CreateSend; CreateSend = o.CreateSend;
CopyInsteadOfShareAfterSaving = o.CopyInsteadOfShareAfterSaving;
HideAccountSwitcher = o.HideAccountSwitcher;
} }
} }
} }

View File

@@ -1,4 +1,4 @@
namespace Bit.Core.Models.Data namespace Bit.App.Models
{ {
public class PreviousPageInfo public class PreviousPageInfo
{ {

View File

@@ -1,12 +1,12 @@
using System.Collections.Generic; using Bit.App.Resources;
using Bit.Core.Abstractions;
using Bit.Core.Utilities;
using System.Collections.Generic;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.App.Abstractions; using Bit.App.Abstractions;
using Bit.App.Resources;
using Bit.Core.Abstractions;
using Bit.Core.Models.Domain; using Bit.Core.Models.Domain;
using Bit.Core.Utilities;
using Xamarin.Essentials; using Xamarin.Essentials;
namespace Bit.App.Pages namespace Bit.App.Pages
@@ -14,7 +14,7 @@ namespace Bit.App.Pages
public class BaseChangePasswordViewModel : BaseViewModel public class BaseChangePasswordViewModel : BaseViewModel
{ {
protected readonly IPlatformUtilsService _platformUtilsService; protected readonly IPlatformUtilsService _platformUtilsService;
protected readonly IStateService _stateService; protected readonly IUserService _userService;
protected readonly IPolicyService _policyService; protected readonly IPolicyService _policyService;
protected readonly IPasswordGenerationService _passwordGenerationService; protected readonly IPasswordGenerationService _passwordGenerationService;
protected readonly II18nService _i18nService; protected readonly II18nService _i18nService;
@@ -31,7 +31,7 @@ namespace Bit.App.Pages
protected BaseChangePasswordViewModel() protected BaseChangePasswordViewModel()
{ {
_platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService"); _platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService");
_stateService = ServiceContainer.Resolve<IStateService>("stateService"); _userService = ServiceContainer.Resolve<IUserService>("userService");
_policyService = ServiceContainer.Resolve<IPolicyService>("policyService"); _policyService = ServiceContainer.Resolve<IPolicyService>("policyService");
_passwordGenerationService = _passwordGenerationService =
ServiceContainer.Resolve<IPasswordGenerationService>("passwordGenerationService"); ServiceContainer.Resolve<IPasswordGenerationService>("passwordGenerationService");
@@ -46,11 +46,7 @@ namespace Bit.App.Pages
{ {
get => _showPassword; get => _showPassword;
set => SetProperty(ref _showPassword, value, set => SetProperty(ref _showPassword, value,
additionalPropertyNames: new[] additionalPropertyNames: new[] { nameof(ShowPasswordIcon) });
{
nameof(ShowPasswordIcon),
nameof(PasswordVisibilityAccessibilityText)
});
} }
public bool IsPolicyInEffect public bool IsPolicyInEffect
@@ -70,9 +66,8 @@ namespace Bit.App.Pages
get => _policy; get => _policy;
set => SetProperty(ref _policy, value); set => SetProperty(ref _policy, value);
} }
public string ShowPasswordIcon => ShowPassword ? "" : ""; public string ShowPasswordIcon => ShowPassword ? "" : "";
public string PasswordVisibilityAccessibilityText => ShowPassword ? AppResources.PasswordIsVisibleTapToHide : AppResources.PasswordIsNotVisibleTapToShow;
public string MasterPassword { get; set; } public string MasterPassword { get; set; }
public string ConfirmMasterPassword { get; set; } public string ConfirmMasterPassword { get; set; }
public string Hint { get; set; } public string Hint { get; set; }
@@ -89,7 +84,7 @@ namespace Bit.App.Pages
await CheckPasswordPolicy(); await CheckPasswordPolicy();
} }
} }
private async Task CheckPasswordPolicy() private async Task CheckPasswordPolicy()
{ {
Policy = await _policyService.GetMasterPasswordPolicyOptions(); Policy = await _policyService.GetMasterPasswordPolicyOptions();
@@ -171,13 +166,13 @@ namespace Bit.App.Pages
AppResources.AnErrorHasOccurred, AppResources.Ok); AppResources.AnErrorHasOccurred, AppResources.Ok);
return false; return false;
} }
return true; return true;
} }
private async Task<List<string>> GetPasswordStrengthUserInput() private async Task<List<string>> GetPasswordStrengthUserInput()
{ {
var email = await _stateService.GetEmailAsync(); var email = await _userService.GetEmailAsync();
List<string> userInput = null; List<string> userInput = null;
var atPosition = email.IndexOf('@'); var atPosition = email.IndexOf('@');
if (atPosition > -1) if (atPosition > -1)

View File

@@ -1,24 +1,32 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.App.Abstractions; using Bit.App.Abstractions;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.App.Utilities;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Utilities; using Bit.Core.Utilities;
#if !FDROID
using Microsoft.AppCenter.Crashes;
#endif
namespace Bit.App.Pages namespace Bit.App.Pages
{ {
public class DeleteAccountViewModel : BaseViewModel public class DeleteAccountViewModel : BaseViewModel
{ {
readonly IApiService _apiService;
readonly IPasswordRepromptService _passwordRepromptService;
readonly IMessagingService _messagingService;
readonly ICryptoService _cryptoService;
readonly IPlatformUtilsService _platformUtilsService; readonly IPlatformUtilsService _platformUtilsService;
readonly IVerificationActionsFlowHelper _verificationActionsFlowHelper; readonly IDeviceActionService _deviceActionService;
readonly ILogger _logger;
public DeleteAccountViewModel() public DeleteAccountViewModel()
{ {
_apiService = ServiceContainer.Resolve<IApiService>("apiService");
_passwordRepromptService = ServiceContainer.Resolve<IPasswordRepromptService>("passwordRepromptService");
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
_cryptoService = ServiceContainer.Resolve<ICryptoService>("cryptoService");
_platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService"); _platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService");
_verificationActionsFlowHelper = ServiceContainer.Resolve<IVerificationActionsFlowHelper>("verificationActionsFlowHelper"); _deviceActionService = ServiceContainer.Resolve<IDeviceActionService>("deviceActionService");
_logger = ServiceContainer.Resolve<ILogger>("logger");
PageTitle = AppResources.DeleteAccount; PageTitle = AppResources.DeleteAccount;
} }
@@ -34,54 +42,18 @@ namespace Bit.App.Pages
return; return;
} }
await _verificationActionsFlowHelper var (password, valid) = await _passwordRepromptService.ShowPasswordPromptAndGetItAsync();
.Configure(VerificationFlowAction.DeleteAccount, if (!valid)
null, {
AppResources.DeleteAccount, return;
true) }
.ValidateAndExecuteAsync();
}
catch (System.Exception ex)
{
_logger.Exception(ex);
await _platformUtilsService.ShowDialogAsync(AppResources.AnErrorHasOccurred);
}
}
}
public interface IDeleteAccountActionFlowExecutioner : IActionFlowExecutioner { }
public class DeleteAccountActionFlowExecutioner : IDeleteAccountActionFlowExecutioner
{
readonly IApiService _apiService;
readonly IMessagingService _messagingService;
readonly IPlatformUtilsService _platformUtilsService;
readonly IDeviceActionService _deviceActionService;
readonly ILogger _logger;
public DeleteAccountActionFlowExecutioner(IApiService apiService,
IMessagingService messagingService,
IPlatformUtilsService platformUtilsService,
IDeviceActionService deviceActionService,
ILogger logger)
{
_apiService = apiService;
_messagingService = messagingService;
_platformUtilsService = platformUtilsService;
_deviceActionService = deviceActionService;
_logger = logger;
}
public async Task Execute(IActionFlowParmeters parameters)
{
try
{
await _deviceActionService.ShowLoadingAsync(AppResources.DeletingYourAccount); await _deviceActionService.ShowLoadingAsync(AppResources.DeletingYourAccount);
var masterPasswordHashKey = await _cryptoService.HashPasswordAsync(password, null);
await _apiService.DeleteAccountAsync(new Core.Models.Request.DeleteAccountRequest await _apiService.DeleteAccountAsync(new Core.Models.Request.DeleteAccountRequest
{ {
MasterPasswordHash = parameters.VerificationType == Core.Enums.VerificationType.MasterPassword ? parameters.Secret : (string)null, MasterPasswordHash = masterPasswordHashKey
OTP = parameters.VerificationType == Core.Enums.VerificationType.OTP ? parameters.Secret : (string)null
}); });
await _deviceActionService.HideLoadingAsync(); await _deviceActionService.HideLoadingAsync();
@@ -102,7 +74,9 @@ namespace Bit.App.Pages
catch (System.Exception ex) catch (System.Exception ex)
{ {
await _deviceActionService.HideLoadingAsync(); await _deviceActionService.HideLoadingAsync();
_logger.Exception(ex); #if !FDROID
Crashes.TrackError(ex);
#endif
await _platformUtilsService.ShowDialogAsync(AppResources.AnErrorHasOccurred); await _platformUtilsService.ShowDialogAsync(AppResources.AnErrorHasOccurred);
} }
} }

View File

@@ -1,8 +1,8 @@
using System; using Bit.Core.Abstractions;
using Bit.Core.Utilities;
using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.Core.Abstractions;
using Bit.Core.Utilities;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages
@@ -10,11 +10,14 @@ namespace Bit.App.Pages
public partial class EnvironmentPage : BaseContentPage public partial class EnvironmentPage : BaseContentPage
{ {
private readonly IPlatformUtilsService _platformUtilsService; private readonly IPlatformUtilsService _platformUtilsService;
private readonly IMessagingService _messagingService;
private readonly EnvironmentPageViewModel _vm; private readonly EnvironmentPageViewModel _vm;
public EnvironmentPage() public EnvironmentPage()
{ {
_platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService"); _platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("platformUtilsService");
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
_messagingService.Send("showStatusBar", true);
InitializeComponent(); InitializeComponent();
_vm = BindingContext as EnvironmentPageViewModel; _vm = BindingContext as EnvironmentPageViewModel;
_vm.Page = this; _vm.Page = this;
@@ -32,6 +35,7 @@ namespace Bit.App.Pages
_vm.SubmitSuccessAction = () => Device.BeginInvokeOnMainThread(async () => await SubmitSuccessAsync()); _vm.SubmitSuccessAction = () => Device.BeginInvokeOnMainThread(async () => await SubmitSuccessAsync());
_vm.CloseAction = async () => _vm.CloseAction = async () =>
{ {
_messagingService.Send("showStatusBar", false);
await Navigation.PopModalAsync(); await Navigation.PopModalAsync();
}; };
} }

View File

@@ -1,8 +1,8 @@
using System; using Bit.App.Resources;
using System.Threading.Tasks;
using Bit.App.Resources;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System;
using System.Threading.Tasks;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages

View File

@@ -1,9 +1,9 @@
using System.Threading.Tasks; using Bit.App.Abstractions;
using Bit.App.Abstractions;
using Bit.App.Resources; using Bit.App.Resources;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System.Threading.Tasks;
using Xamarin.Forms; using Xamarin.Forms;
namespace Bit.App.Pages namespace Bit.App.Pages

View File

@@ -7,75 +7,47 @@
xmlns:controls="clr-namespace:Bit.App.Controls" xmlns:controls="clr-namespace:Bit.App.Controls"
xmlns:u="clr-namespace:Bit.App.Utilities" xmlns:u="clr-namespace:Bit.App.Utilities"
x:DataType="pages:HomeViewModel" x:DataType="pages:HomeViewModel"
x:Name="_page"
Title="{Binding PageTitle}"> Title="{Binding PageTitle}">
<ContentPage.BindingContext> <ContentPage.BindingContext>
<pages:HomeViewModel /> <pages:HomeViewModel />
</ContentPage.BindingContext> </ContentPage.BindingContext>
<ContentPage.ToolbarItems> <ContentPage.ToolbarItems>
<controls:ExtendedToolbarItem <ToolbarItem Text="{u:I18n Close}" Clicked="Close_Clicked" Order="Primary" Priority="-1" />
x:Name="_accountAvatar"
x:Key="accountAvatar"
IconImageSource="{Binding AvatarImageSource}"
Command="{Binding Source={x:Reference _accountListOverlay}, Path=ToggleVisibililtyCommand}"
Order="Primary"
Priority="-1"
UseOriginalImage="True"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Account}" />
<ToolbarItem
Icon="cog_environment.png" Clicked="Environment_Clicked" Order="Primary"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{u:I18n Options}" />
</ContentPage.ToolbarItems> </ContentPage.ToolbarItems>
<ContentPage.Resources> <StackLayout Spacing="0" Padding="10, 5">
<ResourceDictionary> <controls:FaButton Text="&#xf013;"
<StackLayout x:Name="_mainLayout" x:Key="mainLayout" Spacing="0" Padding="10, 5"> StyleClass="btn-muted, btn-icon, btn-icon-platform"
<StackLayout VerticalOptions="CenterAndExpand" Spacing="20"> HorizontalOptions="Start"
<Image Clicked="Environment_Clicked"
x:Name="_logo" AutomationProperties.IsInAccessibleTree="True"
Source="logo.png" AutomationProperties.Name="{u:I18n Options}">
VerticalOptions="Center" /> <controls:FaButton.Margin>
<Label Text="{u:I18n LoginOrCreateNewAccount}" <OnPlatform x:TypeArguments="Thickness">
StyleClass="text-lg" <On Platform="iOS" Value="0, 10, 0, 0" />
HorizontalTextAlignment="Center"> <On Platform="Android" Value="0" />
</Label> </OnPlatform>
<StackLayout Spacing="5"> </controls:FaButton.Margin>
<Button Text="{u:I18n LogIn}" </controls:FaButton>
StyleClass="btn-primary" <StackLayout VerticalOptions="CenterAndExpand" Spacing="20">
Clicked="LogIn_Clicked" /> <Image
<Button Text="{u:I18n CreateAccount}" x:Name="_logo"
Clicked="Register_Clicked" /> Source="logo.png"
<Button Text="{u:I18n LogInSso}" VerticalOptions="Center" />
Clicked="LogInSso_Clicked" /> <Label Text="{u:I18n LoginOrCreateNewAccount}"
<Button Text="{u:I18n Cancel}" StyleClass="text-lg"
IsVisible="{Binding ShowCancelButton}" HorizontalTextAlignment="Center"></Label>
Margin="0,10,0,0" <StackLayout Spacing="5">
Clicked="Cancel_Clicked" /> <Button Text="{u:I18n LogIn}"
</StackLayout> StyleClass="btn-primary"
</StackLayout> Clicked="LogIn_Clicked" />
<Button Text="{u:I18n CreateAccount}"
Clicked="Register_Clicked" />
<Button Text="{u:I18n LogInSso}"
Clicked="LogInSso_Clicked" />
</StackLayout> </StackLayout>
</ResourceDictionary> </StackLayout>
</ContentPage.Resources> </StackLayout>
<AbsoluteLayout
x:Name="_absLayout"
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand">
<ContentView
x:Name="_mainContent"
AbsoluteLayout.LayoutFlags="All"
AbsoluteLayout.LayoutBounds="0, 0, 1, 1">
</ContentView>
<controls:AccountSwitchingOverlayView
x:Name="_accountListOverlay"
AbsoluteLayout.LayoutBounds="0, 0, 1, 1"
AbsoluteLayout.LayoutFlags="All"
MainPage="{Binding Source={x:Reference _page}}"
BindingContext="{Binding AccountSwitchingOverlayViewModel}"/>
</AbsoluteLayout>
</pages:BaseContentPage> </pages:BaseContentPage>

Some files were not shown because too many files have changed in this diff Show More