1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-10 13:23:39 +00:00

Compare commits

..

11 Commits

Author SHA1 Message Date
Federico Maccaroni
553ac4d027 PM-3349 MAUI - Android - Fix crash on converter 2023-09-05 17:40:12 -03:00
Federico Maccaroni
b9414d6384 PM-3349 MAUI - Android - Fix Add/Edit cipher page 2023-09-04 20:37:30 -03:00
Federico Maccaroni
d8e8747478 PM-3349 MAUI - Android - Fix Options page 2023-09-01 19:44:20 -03:00
Federico Maccaroni
19c89ebb5f PM-3349 MAUI - Android - Fix Send add edit page 2023-09-01 18:48:25 -03:00
Federico Maccaroni
df4672d4cb PM-3349 MAUI - Android - Fix awful buttons background 2023-09-01 18:46:07 -03:00
Federico Maccaroni
2fe8ae0b46 PM-3349 MAUI - Android - Fix Generator page bindings 2023-09-01 16:04:25 -03:00
Federico Maccaroni
19ba70c9a6 PM-3349 MAUI - Android - Fix Account switching view 2023-08-31 13:33:54 -03:00
Federico Maccaroni
16675c2a66 PM-3349 MAUI Migration Single Project - Android - Handlers and some fixes to avoid crashing 2023-08-30 23:37:10 -03:00
Federico Maccaroni
6ff978cef2 MAUI Migration Single Project - Android - Fonts, renderers, effects 2023-07-31 22:15:14 -03:00
Federico Maccaroni
276081f5f7 MAUI single project migration Android comipling 2023-07-31 11:58:19 -03:00
Federico Maccaroni
d7f52a58f0 MAUI Single project migration initial 2023-07-28 19:44:49 -03:00
1449 changed files with 272359 additions and 226312 deletions

39
.github/CODEOWNERS vendored
View File

@@ -1,39 +0,0 @@
# Please sort into logical groups with comment headers. Sort groups in order of specificity.
# For example, default owners should always be the first group.
# Sort lines alphabetically within these groups to avoid accidentally adding duplicates.
#
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
# Default file owners
* @bitwarden/dept-development-mobile
# DevOps for Actions and other workflow changes
.github/workflows @bitwarden/dept-devops
## Auth team files ##
## Platform team files ##
appIcons @bitwarden/team-platform-dev
build.cake @bitwarden/team-platform-dev
## Vault team files ##
src/watchOS @bitwarden/team-vault-dev
## Tools team files ##
src/Core/Services/EmailForwarders @bitwarden/team-tools-dev
## Crowdin Sync files ##
src/App/Resources @bitwarden/team-tools-dev
src/watchOS/bitwarden/bitwarden\ WatchKit\ Extension/Localization @bitwarden/team-tools-dev
store/apple @bitwarden/team-tools-dev
store/google @bitwarden/team-tools-dev
## Locales ##
src/App/Resources/AppResources.Designer.cs
src/App/Resources/AppResources.resx
src/watchOS/bitwarden/bitwarden\ WatchKit\ Extension/Localization/en.lproj
store/apple/en
store/google/en
## Utils ##
store/google/Publisher

16
.github/renovate.json vendored
View File

@@ -8,14 +8,16 @@
":pinAllExceptPeerDependencies", ":pinAllExceptPeerDependencies",
":prConcurrentLimit10", ":prConcurrentLimit10",
":rebaseStalePrs", ":rebaseStalePrs",
":separateMajorReleases", "schedule:weekends",
"group:monorepos", ":separateMajorReleases"
"schedule:weekends"
], ],
"enabledManagers": ["github-actions", "npm", "nuget"], "enabledManagers": ["cargo", "github-actions", "npm", "nuget"],
"commitMessagePrefix": "[deps]:",
"commitMessageTopic": "{{depName}}",
"packageRules": [ "packageRules": [
{
"groupName": "cargo minor",
"matchManagers": ["cargo"],
"matchUpdateTypes": ["minor", "patch"]
},
{ {
"groupName": "gh minor", "groupName": "gh minor",
"matchManagers": ["github-actions"], "matchManagers": ["github-actions"],
@@ -30,6 +32,6 @@
"groupName": "nuget minor", "groupName": "nuget minor",
"matchManagers": ["nuget"], "matchManagers": ["nuget"],
"matchUpdateTypes": ["minor", "patch"] "matchUpdateTypes": ["minor", "patch"]
} },
] ]
} }

View File

@@ -9,14 +9,15 @@ on:
paths-ignore: paths-ignore:
- ".github/workflows/**" - ".github/workflows/**"
workflow_dispatch: workflow_dispatch:
inputs: {}
jobs: jobs:
cloc: cloc:
name: CLOC name: CLOC
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Set up CLOC - name: Set up CLOC
run: | run: |
@@ -29,13 +30,13 @@ jobs:
setup: setup:
name: Setup name: Setup
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
outputs: outputs:
rc_branch_exists: ${{ steps.branch-check.outputs.rc_branch_exists }} rc_branch_exists: ${{ steps.branch-check.outputs.rc_branch_exists }}
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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with: with:
submodules: 'true' submodules: 'true'
@@ -53,6 +54,7 @@ jobs:
else else
echo "hotfix_branch_exists=0" >> $GITHUB_OUTPUT echo "hotfix_branch_exists=0" >> $GITHUB_OUTPUT
fi fi
shell: bash
android: android:
@@ -70,7 +72,7 @@ jobs:
nuget-version: 5.9.0 nuget-version: 5.9.0
- name: Set up .NET - name: Set up .NET
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0 uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0
with: with:
dotnet-version: '3.1.x' dotnet-version: '3.1.x'
@@ -80,12 +82,25 @@ jobs:
- name: Setup Windows builder - name: Setup Windows builder
run: choco install checksum --no-progress run: choco install checksum --no-progress
- name: Install Microsoft OpenJDK 11 - name: Work Around for broken Windows 2022 Runner Image
run: | run: |
choco install microsoft-openjdk11 --no-progress Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
Write-Output "JAVA_HOME=$(Get-ChildItem -Path 'C:\Program Files\Microsoft\jdk*' | Select -First 1 -ExpandProperty FullName)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
Write-Output "Java Home: $env:JAVA_HOME" $componentsToAdd = @(
"Component.Xamarin"
)
[string]$workloadArgs = $componentsToAdd | ForEach-Object {" --add " + $_}
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache')
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
if ($process.ExitCode -eq 0)
{
Write-Host "components have been successfully added"
}
else
{
Write-Host "components were not installed"
exit 1
}
- name: Print environment - name: Print environment
run: | run: |
nuget help | grep Version nuget help | grep Version
@@ -95,10 +110,9 @@ jobs:
echo "GitHub event: $GITHUB_EVENT" echo "GitHub event: $GITHUB_EVENT"
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Decrypt secrets - name: Decrypt secrets
env: env:
DECRYPT_FILE_PASSWORD: ${{ secrets.DECRYPT_FILE_PASSWORD }} DECRYPT_FILE_PASSWORD: ${{ secrets.DECRYPT_FILE_PASSWORD }}
@@ -112,7 +126,6 @@ jobs:
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \ gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \
--output $HOME/secrets/play_creds.json ./.github/secrets/play_creds.json.gpg --output $HOME/secrets/play_creds.json ./.github/secrets/play_creds.json.gpg
shell: bash shell: bash
- name: Decrypt secrets - Google Services - name: Decrypt secrets - Google Services
if: ${{ matrix.variant == 'prod' }} if: ${{ matrix.variant == 'prod' }}
env: env:
@@ -121,7 +134,6 @@ jobs:
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \ gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \
--output ./src/Android/google-services.json ./.github/secrets/google-services.json.gpg --output ./src/Android/google-services.json ./.github/secrets/google-services.json.gpg
shell: bash shell: bash
- name: Increment version - name: Increment version
run: | run: |
BUILD_NUMBER=$((3000 + $GITHUB_RUN_NUMBER)) BUILD_NUMBER=$((3000 + $GITHUB_RUN_NUMBER))
@@ -139,12 +151,15 @@ jobs:
- name: Restore tools - name: Restore tools
run: dotnet tool restore run: dotnet tool restore
shell: pwsh
- name: Verify Format - name: Verify Format
run: dotnet tool run dotnet-format --check 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 --logger "trx;LogFileName=test-results.trx" run: dotnet test test/Core.Test/Core.Test.csproj --logger "trx;LogFileName=test-results.trx"
shell: pwsh
- name: Report test results - name: Report test results
uses: dorny/test-reporter@c9b3d0e2bd2a4e96aaf424dbaa31c46b42318226 # v1.6.0 uses: dorny/test-reporter@c9b3d0e2bd2a4e96aaf424dbaa31c46b42318226 # v1.6.0
@@ -171,6 +186,8 @@ jobs:
Write-Output "########################################" Write-Output "########################################"
msbuild "$($env:GITHUB_WORKSPACE + "/src/Android/Android.csproj")" "/p:Configuration=$configuration" msbuild "$($env:GITHUB_WORKSPACE + "/src/Android/Android.csproj")" "/p:Configuration=$configuration"
shell: pwsh
- name: Sign Android Build - name: Sign Android Build
env: env:
PLAY_KEYSTORE_PASSWORD: ${{ secrets.PLAY_KEYSTORE_PASSWORD }} PLAY_KEYSTORE_PASSWORD: ${{ secrets.PLAY_KEYSTORE_PASSWORD }}
@@ -217,10 +234,10 @@ jobs:
$signedApkDestPath = $($env:GITHUB_WORKSPACE + "/$($packageName).apk"); $signedApkDestPath = $($env:GITHUB_WORKSPACE + "/$($packageName).apk");
Copy-Item $signedApkPath $signedApkDestPath Copy-Item $signedApkPath $signedApkDestPath
shell: pwsh
- name: Upload Prod .aab artifact - name: Upload Prod .aab artifact
if: ${{ matrix.variant == 'prod' }} if: ${{ matrix.variant == 'prod' }}
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
with: with:
name: com.x8bit.bitwarden.aab name: com.x8bit.bitwarden.aab
path: ./com.x8bit.bitwarden.aab path: ./com.x8bit.bitwarden.aab
@@ -228,7 +245,7 @@ jobs:
- name: Upload Prod .apk artifact - name: Upload Prod .apk artifact
if: ${{ matrix.variant == 'prod' }} if: ${{ matrix.variant == 'prod' }}
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
with: with:
name: com.x8bit.bitwarden.apk name: com.x8bit.bitwarden.apk
path: ./com.x8bit.bitwarden.apk path: ./com.x8bit.bitwarden.apk
@@ -236,7 +253,7 @@ jobs:
- name: Upload Other .apk artifact - name: Upload Other .apk artifact
if: ${{ matrix.variant != 'prod' }} if: ${{ matrix.variant != 'prod' }}
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
with: with:
name: com.x8bit.bitwarden.${{ matrix.variant }}.apk name: com.x8bit.bitwarden.${{ matrix.variant }}.apk
path: ./com.x8bit.bitwarden.${{ matrix.variant }}.apk path: ./com.x8bit.bitwarden.${{ matrix.variant }}.apk
@@ -256,7 +273,7 @@ jobs:
- name: Upload .apk sha file for prod - name: Upload .apk sha file for prod
if: ${{ matrix.variant == 'prod' }} if: ${{ matrix.variant == 'prod' }}
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
with: with:
name: bw-android-apk-sha256.txt name: bw-android-apk-sha256.txt
path: ./bw-android-apk-sha256.txt path: ./bw-android-apk-sha256.txt
@@ -264,14 +281,14 @@ jobs:
- name: Upload .apk sha file for other - name: Upload .apk sha file for other
if: ${{ matrix.variant != 'prod' }} if: ${{ matrix.variant != 'prod' }}
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
with: with:
name: bw-android-${{ matrix.variant }}-apk-sha256.txt name: bw-android-${{ matrix.variant }}-apk-sha256.txt
path: ./bw-android-${{ matrix.variant }}-apk-sha256.txt path: ./bw-android-${{ matrix.variant }}-apk-sha256.txt
if-no-files-found: error if-no-files-found: error
- name: Deploy to Play Store - name: Deploy to Play Store
if: ${{ matrix.variant == 'prod' && (( github.ref == 'refs/heads/main' if: ${{ matrix.variant == 'prod' && (( 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)
@@ -301,11 +318,25 @@ jobs:
- name: Setup Windows builder - name: Setup Windows builder
run: choco install checksum --no-progress run: choco install checksum --no-progress
- name: Install Microsoft OpenJDK 11 - name: Work Around for broken Windows 2022 Runner Image
run: | run: |
choco install microsoft-openjdk11 --no-progress Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
Write-Output "JAVA_HOME=$(Get-ChildItem -Path 'C:\Program Files\Microsoft\jdk*' | Select -First 1 -ExpandProperty FullName)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
Write-Output "Java Home: $env:JAVA_HOME" $componentsToAdd = @(
"Component.Xamarin"
)
[string]$workloadArgs = $componentsToAdd | ForEach-Object {" --add " + $_}
$Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache')
$process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
if ($process.ExitCode -eq 0)
{
Write-Host "components have been successfully added"
}
else
{
Write-Host "components were not installed"
exit 1
}
- name: Print environment - name: Print environment
run: | run: |
@@ -316,7 +347,7 @@ jobs:
echo "GitHub event: $GITHUB_EVENT" echo "GitHub event: $GITHUB_EVENT"
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Decrypt secrets - name: Decrypt secrets
env: env:
@@ -410,6 +441,7 @@ jobs:
$appCenterNode.ParentNode.RemoveChild($appCenterNode); $appCenterNode.ParentNode.RemoveChild($appCenterNode);
$xml.Save($corePath); $xml.Save($corePath);
shell: pwsh
- name: Restore packages - name: Restore packages
run: nuget restore run: nuget restore
@@ -423,6 +455,7 @@ jobs:
Write-Output "########################################" Write-Output "########################################"
msbuild "$($env:GITHUB_WORKSPACE + "/src/Android/Android.csproj")" "/p:Configuration=$configuration" msbuild "$($env:GITHUB_WORKSPACE + "/src/Android/Android.csproj")" "/p:Configuration=$configuration"
shell: pwsh
- name: Sign for F-Droid - name: Sign for F-Droid
env: env:
@@ -446,9 +479,10 @@ jobs:
$signedApkDestPath = $($env:GITHUB_WORKSPACE + "/com.x8bit.bitwarden-fdroid.apk"); $signedApkDestPath = $($env:GITHUB_WORKSPACE + "/com.x8bit.bitwarden-fdroid.apk");
Copy-Item $signedApkPath $signedApkDestPath Copy-Item $signedApkPath $signedApkDestPath
shell: pwsh
- name: Upload F-Droid .apk artifact - name: Upload F-Droid .apk artifact
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
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
@@ -460,7 +494,7 @@ jobs:
-t sha256 | Out-File -Encoding ASCII ./bw-fdroid-apk-sha256.txt -t sha256 | Out-File -Encoding ASCII ./bw-fdroid-apk-sha256.txt
- name: Upload F-Droid sha file - name: Upload F-Droid sha file
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
with: with:
name: bw-fdroid-apk-sha256.txt name: bw-fdroid-apk-sha256.txt
path: ./bw-fdroid-apk-sha256.txt path: ./bw-fdroid-apk-sha256.txt
@@ -486,21 +520,28 @@ jobs:
echo "GitHub event: $GITHUB_EVENT" echo "GitHub event: $GITHUB_EVENT"
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with: with:
submodules: 'true' submodules: 'true'
- name: Login to Azure - CI Subscription - name: Login to Azure - CI Subscription
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.6 uses: Azure/login@1f63701bf3e6892515f1b7ce2d2bf1708b46beaf # v1.4.3
with: with:
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
- name: Retrieve secrets - name: Retrieve secrets
id: retrieve-secrets id: retrieve-secrets
uses: bitwarden/gh-actions/get-keyvault-secrets@main env:
with: KEYVAULT: bitwarden-ci
keyvault: "bitwarden-ci" SECRETS: |
secrets: "appcenter-ios-token" appcenter-ios-token
run: |
for i in ${SECRETS//,/ }
do
VALUE=$(az keyvault secret show --vault-name $KEYVAULT --name $i --query value --output tsv)
echo "::add-mask::$VALUE"
echo "$i=$VALUE" >> $GITHUB_OUTPUT
done
- name: Decrypt secrets - name: Decrypt secrets
env: env:
@@ -529,6 +570,7 @@ jobs:
./.github/secrets/dist_watch_app_extension.mobileprovision.gpg ./.github/secrets/dist_watch_app_extension.mobileprovision.gpg
gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \ gpg --quiet --batch --yes --decrypt --passphrase="$DECRYPT_FILE_PASSWORD" \
--output ./src/watchOS/bitwarden/GoogleService-Info.plist ./.github/secrets/GoogleService-Info.plist.gpg --output ./src/watchOS/bitwarden/GoogleService-Info.plist ./.github/secrets/GoogleService-Info.plist.gpg
shell: bash
- name: Increment version - name: Increment version
run: | run: |
@@ -544,6 +586,8 @@ 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.ShareExtension/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
cd src/watchOS/bitwarden cd src/watchOS/bitwarden
agvtool new-version -all $BUILD_NUMBER agvtool new-version -all $BUILD_NUMBER
cd ../../..
shell: bash
- name: Update Entitlements - name: Update Entitlements
run: | run: |
@@ -552,6 +596,7 @@ jobs:
echo "########################################" 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 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
- name: Set up Keychain - name: Set up Keychain
env: env:
@@ -568,6 +613,7 @@ jobs:
security import ~/secrets/iphone-distribution-cert.p12 -k build.keychain -P $DIST_CERT_PASSWORD \ security import ~/secrets/iphone-distribution-cert.p12 -k build.keychain -P $DIST_CERT_PASSWORD \
-T /usr/bin/codesign -T /usr/bin/security -T /usr/bin/codesign -T /usr/bin/security
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $KEYCHAIN_PASSWORD build.keychain security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $KEYCHAIN_PASSWORD build.keychain
shell: bash
- name: Set up provisioning profiles - name: Set up provisioning profiles
run: | run: |
@@ -598,6 +644,7 @@ jobs:
WATCH_APP_EXTENSION_UUID=$(grep UUID -A1 -a $WATCH_APP_EXTENSION_PROFILE_PATH | grep -io "[-A-F0-9]\{36\}") WATCH_APP_EXTENSION_UUID=$(grep UUID -A1 -a $WATCH_APP_EXTENSION_PROFILE_PATH | grep -io "[-A-F0-9]\{36\}")
cp $WATCH_APP_EXTENSION_PROFILE_PATH "$PROFILES_DIR_PATH/$WATCH_APP_EXTENSION_UUID.mobileprovision" cp $WATCH_APP_EXTENSION_PROFILE_PATH "$PROFILES_DIR_PATH/$WATCH_APP_EXTENSION_UUID.mobileprovision"
shell: bash
- name: Bulid WatchApp - name: Bulid WatchApp
run: | run: |
@@ -610,6 +657,7 @@ jobs:
echo "########################################" echo "########################################"
echo "##### Done" echo "##### Done"
echo "########################################" echo "########################################"
shell: bash
- name: Restore packages - name: Restore packages
run: nuget restore run: nuget restore
@@ -619,22 +667,6 @@ jobs:
$configuration = "AppStore"; $configuration = "AppStore";
$platform = "iPhone"; $platform = "iPhone";
Write-Output "########################################"
Write-Output "##### Archive $configuration Configuration for $platform Platform"
Write-Output "########################################"
msbuild "$($env:GITHUB_WORKSPACE + "/src/iOS/iOS.csproj")" "/p:Platform=$platform" `
"/p:Configuration=$configuration" "/p:ArchiveOnBuild=true" "/t:`"Build`""
Write-Output "########################################"
Write-Output "##### Done"
Write-Output "########################################"
shell: pwsh
- name: Archive Build for Mobile Automation
run: |
$configuration = "Release";
$platform = "iPhoneSimulator";
Write-Output "########################################" Write-Output "########################################"
Write-Output "##### Archive $configuration Configuration for $platform Platform" Write-Output "##### Archive $configuration Configuration for $platform Platform"
Write-Output "########################################" Write-Output "########################################"
@@ -655,14 +687,7 @@ jobs:
xcodebuild -exportArchive -archivePath $ARCHIVE_PATH -exportPath $EXPORT_PATH \ xcodebuild -exportArchive -archivePath $ARCHIVE_PATH -exportPath $EXPORT_PATH \
-exportOptionsPlist $EXPORT_OPTIONS_PATH -exportOptionsPlist $EXPORT_OPTIONS_PATH
shell: bash
- name: Export .app for Automation CI
run: |
ARCHIVE_PATH="./src/iOS/bin/iPhoneSimulator/Release/BitwardeniOS.app"
EXPORT_PATH="./bitwarden-export"
zip -r -q BitwardeniOS.app.zip $ARCHIVE_PATH
mv BitwardeniOS.app.zip $EXPORT_PATH
- name: Copy all dSYMs files to upload - name: Copy all dSYMs files to upload
run: | run: |
@@ -675,9 +700,10 @@ jobs:
cp -r -v $ARCHIVE_DSYMS_PATH $EXPORT_PATH cp -r -v $ARCHIVE_DSYMS_PATH $EXPORT_PATH
mkdir $WATCH_DSYMS_EXPORT_PATH mkdir $WATCH_DSYMS_EXPORT_PATH
cp -r -v $WATCH_ARCHIVE_DSYMS_PATH $WATCH_DSYMS_EXPORT_PATH cp -r -v $WATCH_ARCHIVE_DSYMS_PATH $WATCH_DSYMS_EXPORT_PATH
shell: bash
- name: Upload App Store .ipa & dSYMs artifacts - name: Upload App Store .ipa & dSYMs artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535 # v3.0.0
with: with:
name: Bitwarden iOS name: Bitwarden iOS
path: | path: |
@@ -685,16 +711,9 @@ jobs:
./bitwarden-export/dSYMs/*.* ./bitwarden-export/dSYMs/*.*
if-no-files-found: error if-no-files-found: error
- name: Upload .app file for Automation CI
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: BitwardeniOS.app.zip
path: ./bitwarden-export/BitwardeniOS.app.zip
if-no-files-found: error
- name: Install AppCenter CLI - name: Install AppCenter CLI
if: | if: |
(github.ref == 'refs/heads/main' (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)
@@ -703,7 +722,7 @@ jobs:
- name: Upload dSYMs to App Center - name: Upload dSYMs to App Center
if: | if: |
(github.ref == 'refs/heads/main' (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)
@@ -711,24 +730,27 @@ jobs:
env: env:
APPCENTER_IOS_TOKEN: ${{ steps.retrieve-secrets.outputs.appcenter-ios-token }} APPCENTER_IOS_TOKEN: ${{ steps.retrieve-secrets.outputs.appcenter-ios-token }}
run: appcenter crashes upload-symbols -a bitwarden/bitwarden -s "./bitwarden-export/dSYMs" --token $APPCENTER_IOS_TOKEN run: appcenter crashes upload-symbols -a bitwarden/bitwarden -s "./bitwarden-export/dSYMs" --token $APPCENTER_IOS_TOKEN
shell: bash
- name: Upload Watch dSYMs to Firebase Crashlytics - name: Upload Watch dSYMs to Firebase Crashlytics
if: | if: |
(github.ref == 'refs/heads/main' (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-rc'
run: | run: |
echo "########################################" echo "########################################"
echo "##### Uploading Watch dSYMs to Firebase" echo "##### Uploading Watch dSYMs to Firebase"
echo "########################################" echo "########################################"
find "$HOME/Library/Developer/XCode/DerivedData" -name "upload-symbols" -exec chmod +x {} \; -exec {} -gsp "./src/watchOS/bitwarden/GoogleService-Info.plist" -p ios "./bitwarden-export/Watch_dSYMs" \; find "$HOME/Library/Developer/XCode/DerivedData" -name "upload-symbols" -exec chmod +x {} \; -exec {} -gsp "./src/watchOS/bitwarden/GoogleService-Info.plist" -p ios "./bitwarden-export/Watch_dSYMs" \;
shell: bash
- name: Deploy to App Store - name: Deploy to App Store
if: | if: |
(github.ref == 'refs/heads/main' (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)
@@ -739,33 +761,41 @@ jobs:
run: | run: |
xcrun altool --upload-app --type ios --file "./bitwarden-export/Bitwarden.ipa" \ xcrun altool --upload-app --type ios --file "./bitwarden-export/Bitwarden.ipa" \
--username "$APPLE_ID_USERNAME" --password "$APPLE_ID_PASSWORD" --username "$APPLE_ID_USERNAME" --password "$APPLE_ID_PASSWORD"
shell: bash
crowdin-push: crowdin-push:
name: Crowdin Push name: Crowdin Push
if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/master'
needs: needs:
- android - android
- f-droid - f-droid
- ios - ios
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
env: env:
_CROWDIN_PROJECT_ID: "269690" _CROWDIN_PROJECT_ID: "269690"
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Login to Azure - CI Subscription - name: Login to Azure - CI Subscription
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.6 uses: Azure/login@1f63701bf3e6892515f1b7ce2d2bf1708b46beaf # v1.4.3
with: with:
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
- name: Retrieve secrets - name: Retrieve secrets
id: retrieve-secrets id: retrieve-secrets
uses: bitwarden/gh-actions/get-keyvault-secrets@main env:
with: KEYVAULT: bitwarden-ci
keyvault: "bitwarden-ci" SECRETS: |
secrets: "crowdin-api-token" crowdin-api-token
run: |
for i in ${SECRETS//,/ }
do
VALUE=$(az keyvault secret show --vault-name $KEYVAULT --name $i --query value --output tsv)
echo "::add-mask::$VALUE"
echo "$i=$VALUE" >> $GITHUB_OUTPUT
done
- name: Upload Sources - name: Upload Sources
uses: crowdin/github-action@965d501f160af7b1f88aed4c29154b0caf1e94b9 # v1.9.0 uses: crowdin/github-action@965d501f160af7b1f88aed4c29154b0caf1e94b9 # v1.9.0
@@ -774,7 +804,7 @@ jobs:
CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }} CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }}
with: with:
config: crowdin.yml config: crowdin.yml
crowdin_branch_name: main crowdin_branch_name: master
upload_sources: true upload_sources: true
upload_translations: false upload_translations: false
@@ -782,7 +812,7 @@ jobs:
check-failures: check-failures:
name: Check for failures name: Check for failures
if: always() if: always()
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
needs: needs:
- cloc - cloc
- android - android
@@ -792,7 +822,7 @@ jobs:
steps: steps:
- name: Check if any job failed - name: Check if any job failed
if: | if: |
(github.ref == 'refs/heads/main') (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-rc')
env: env:
@@ -815,18 +845,25 @@ jobs:
fi fi
- name: Login to Azure - CI Subscription - name: Login to Azure - CI Subscription
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.6 uses: Azure/login@1f63701bf3e6892515f1b7ce2d2bf1708b46beaf # v1.4.3
if: failure() if: failure()
with: with:
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
- name: Retrieve secrets - name: Retrieve secrets
id: retrieve-secrets id: retrieve-secrets
uses: bitwarden/gh-actions/get-keyvault-secrets@main
if: failure() if: failure()
with: env:
keyvault: "bitwarden-ci" KEYVAULT: bitwarden-ci
secrets: "devops-alerts-slack-webhook-url" SECRETS: |
devops-alerts-slack-webhook-url
run: |
for i in ${SECRETS//,/ }
do
VALUE=$(az keyvault secret show --vault-name $KEYVAULT --name $i --query value --output tsv)
echo "::add-mask::$VALUE"
echo "$i=$VALUE" >> $GITHUB_OUTPUT
done
- name: Notify Slack on failure - name: Notify Slack on failure
uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f # v2.0.0 uses: act10ns/slack@ed1309ab9862e57e9e583e51c7889486b9a00b0f # v2.0.0

View File

@@ -18,13 +18,13 @@ jobs:
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Login to Azure - CI Subscription - name: Login to Azure - CI Subscription
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.6 uses: Azure/login@1f63701bf3e6892515f1b7ce2d2bf1708b46beaf # v1.4.3
with: with:
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
- name: Retrieve secrets - name: Retrieve secrets
id: retrieve-secrets id: retrieve-secrets
uses: bitwarden/gh-actions/get-keyvault-secrets@main uses: bitwarden/gh-actions/get-keyvault-secrets@34ecb67b2a357795dc893549df0795e7383ff50f
with: with:
keyvault: "bitwarden-ci" keyvault: "bitwarden-ci"
secrets: "crowdin-api-token, github-gpg-private-key, github-gpg-private-key-passphrase" secrets: "crowdin-api-token, github-gpg-private-key, github-gpg-private-key-passphrase"
@@ -36,7 +36,7 @@ jobs:
CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }} CROWDIN_API_TOKEN: ${{ steps.retrieve-secrets.outputs.crowdin-api-token }}
with: with:
config: crowdin.yml config: crowdin.yml
crowdin_branch_name: main crowdin_branch_name: master
upload_sources: false upload_sources: false
upload_translations: false upload_translations: false
download_translations: true download_translations: true

View File

@@ -12,6 +12,6 @@ jobs:
pull-requests: write pull-requests: write
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
- uses: actions/labeler@ac9175f8a1f3625fd0d4fb234536d26811351594 # v4.3.0 - uses: actions/labeler@ba790c862c380240c6d5e7427be5ace9a05c754b # v4.0.3
with: with:
sync-labels: true sync-labels: true

View File

@@ -38,11 +38,11 @@ jobs:
fi fi
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Check Release Version - name: Check Release Version
id: version id: version
uses: bitwarden/gh-actions/release-version-check@main uses: bitwarden/gh-actions/release-version-check@34ecb67b2a357795dc893549df0795e7383ff50f
with: with:
release-type: ${{ github.event.inputs.release_type }} release-type: ${{ github.event.inputs.release_type }}
project-type: xamarin project-type: xamarin
@@ -80,14 +80,14 @@ jobs:
with: with:
workflow: build.yml workflow: build.yml
workflow_conclusion: success workflow_conclusion: success
branch: main branch: master
- name: Prep Bitwarden iOS release asset - name: Prep Bitwarden iOS release asset
run: zip -r Bitwarden\ iOS.zip Bitwarden\ iOS run: zip -r Bitwarden\ iOS.zip Bitwarden\ iOS
- name: Create release - name: Create release
if: ${{ github.event.inputs.release_type != 'Dry Run' }} if: ${{ github.event.inputs.release_type != 'Dry Run' }}
uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0 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,
@@ -126,7 +126,7 @@ jobs:
if: inputs.fdroid_publish if: inputs.fdroid_publish
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Download F-Droid .apk artifact - name: Download F-Droid .apk artifact
if: ${{ github.event.inputs.release_type != 'Dry Run' }} if: ${{ github.event.inputs.release_type != 'Dry Run' }}
@@ -143,13 +143,13 @@ jobs:
with: with:
workflow: build.yml workflow: build.yml
workflow_conclusion: success workflow_conclusion: success
branch: main branch: master
name: com.x8bit.bitwarden-fdroid.apk name: com.x8bit.bitwarden-fdroid.apk
- name: Set up Node - name: Set up Node
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561 # v2.5.1
with: with:
node-version: '16.x' node-version: '10.x'
- name: Set up F-Droid server - name: Set up F-Droid server
run: | run: |

View File

@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
- name: 'Run stale action' - name: 'Run stale action'
uses: actions/stale@f7176fd3007623b69d27091f9b9d4ab7995f0a06 # v5.2.1 uses: actions/stale@3cc123766321e9f15a6676375c154ccffb12a358 # v5.0.0
with: with:
stale-issue-label: 'needs-reply' stale-issue-label: 'needs-reply'
stale-pr-label: 'needs-changes' stale-pr-label: 'needs-changes'
@@ -27,4 +27,4 @@ jobs:
If youre still working on this, please respond here after youve made the changes weve requested and our team will re-open it for further review. If youre still working on this, please respond here after youve made the changes weve requested and our team will re-open it for further review.
Please make sure to resolve any conflicts with the main branch before requesting another review. Please make sure to resolve any conflicts with the master branch before requesting another review.

View File

@@ -14,7 +14,7 @@ jobs:
version_number: ${{ steps.version.outputs.new-version }} version_number: ${{ steps.version.outputs.new-version }}
steps: steps:
- name: Checkout Branch - name: Checkout Branch
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Calculate bumped version - name: Calculate bumped version
id: version id: version
@@ -35,6 +35,7 @@ jobs:
name: Bump version to ${{ needs.setup.outputs.version_number }} name: Bump version to ${{ needs.setup.outputs.version_number }}
needs: setup needs: setup
uses: ./.github/workflows/version-bump.yml uses: ./.github/workflows/version-bump.yml
secrets:
AZURE_PROD_KV_CREDENTIALS: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
with: with:
version_number: ${{ needs.setup.outputs.version_number }} version_number: ${{ needs.setup.outputs.version_number }}
secrets: inherit

View File

@@ -1,45 +1,43 @@
--- ---
name: Version Bump name: Version Bump
run-name: Version Bump - v${{ inputs.version_number }}
on: on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
version_number: version_number:
description: "New version (example: '2024.1.0')" description: "New Version"
required: true
workflow_call:
inputs:
version_number:
required: true
type: string
secrets:
AZURE_PROD_KV_CREDENTIALS:
required: true required: true
cut_rc_branch:
description: "Cut RC branch?"
default: true
type: boolean
jobs: jobs:
bump_version: bump_version:
name: "Bump Version to v${{ inputs.version_number }}" name: "Create version_bump_${{ github.event.inputs.version_number }} branch"
runs-on: ubuntu-22.04 runs-on: ubuntu-20.04
steps: steps:
- name: Checkout Branch
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Login to Azure - CI Subscription - name: Login to Azure - CI Subscription
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7 uses: Azure/login@1f63701bf3e6892515f1b7ce2d2bf1708b46beaf # v1.4.3
with: with:
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}
- name: Retrieve secrets - name: Retrieve secrets
id: retrieve-secrets id: retrieve-secrets
uses: bitwarden/gh-actions/get-keyvault-secrets@main uses: bitwarden/gh-actions/get-keyvault-secrets@34ecb67b2a357795dc893549df0795e7383ff50f
with: with:
keyvault: "bitwarden-ci" keyvault: "bitwarden-ci"
secrets: "github-gpg-private-key, secrets: "github-gpg-private-key, github-gpg-private-key-passphrase"
github-gpg-private-key-passphrase,
github-pat-bitwarden-devops-bot-repo-scope"
- name: Checkout Branch
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
ref: main
repository: bitwarden/mobile
- name: Import GPG key - name: Import GPG key
uses: crazy-max/ghaction-import-gpg@d6f3f49f3345e29369fe57596a3ca8f94c4d2ca7 # v5.4.0 uses: crazy-max/ghaction-import-gpg@111c56156bcc6918c056dbef52164cfa583dc549 # v5.2.0
with: with:
gpg_private_key: ${{ steps.retrieve-secrets.outputs.github-gpg-private-key }} gpg_private_key: ${{ steps.retrieve-secrets.outputs.github-gpg-private-key }}
passphrase: ${{ steps.retrieve-secrets.outputs.github-gpg-private-key-passphrase }} passphrase: ${{ steps.retrieve-secrets.outputs.github-gpg-private-key-passphrase }}
@@ -47,68 +45,37 @@ jobs:
git_commit_gpgsign: true git_commit_gpgsign: true
- name: Create Version Branch - name: Create Version Branch
id: create-branch run: git switch -c version_bump_${{ github.event.inputs.version_number }}
run: |
NAME=version_bump_${{ github.ref_name }}_${{ inputs.version_number }}
git switch -c $NAME
echo "name=$NAME" >> $GITHUB_OUTPUT
- name: Install xmllint
run: sudo apt install -y libxml2-utils
- name: Verify input version
env:
NEW_VERSION: ${{ inputs.version_number }}
run: |
CURRENT_VERSION=$(xmllint --xpath '
string(/manifest/@*[local-name()="versionName"
and namespace-uri()="http://schemas.android.com/apk/res/android"])
' src/Android/Properties/AndroidManifest.xml)
# Error if version has not changed.
if [[ "$NEW_VERSION" == "$CURRENT_VERSION" ]]; then
echo "Version has not changed."
exit 1
fi
# Check if version is newer.
printf '%s\n' "${CURRENT_VERSION}" "${NEW_VERSION}" | sort -C -V
if [ $? -eq 0 ]; then
echo "Version check successful."
else
echo "Version check failed."
exit 1
fi
- name: Bump Version - Android XML - name: Bump Version - Android XML
uses: bitwarden/gh-actions/version-bump@main uses: bitwarden/gh-actions/version-bump@34ecb67b2a357795dc893549df0795e7383ff50f
with: with:
version: ${{ 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@main uses: bitwarden/gh-actions/version-bump@34ecb67b2a357795dc893549df0795e7383ff50f
with: with:
version: ${{ 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@main uses: bitwarden/gh-actions/version-bump@34ecb67b2a357795dc893549df0795e7383ff50f
with: with:
version: ${{ 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 - name: Bump Version - iOS.ShareExtension
uses: bitwarden/gh-actions/version-bump@main uses: bitwarden/gh-actions/version-bump@34ecb67b2a357795dc893549df0795e7383ff50f
with: with:
version: ${{ inputs.version_number }} version: ${{ github.event.inputs.version_number }}
file_path: "src/iOS.ShareExtension/Info.plist" file_path: "./src/iOS.ShareExtension/Info.plist"
- name: Bump Version - iOS - name: Bump Version - iOS
uses: bitwarden/gh-actions/version-bump@main uses: bitwarden/gh-actions/version-bump@34ecb67b2a357795dc893549df0795e7383ff50f
with: with:
version: ${{ inputs.version_number }} version: ${{ github.event.inputs.version_number }}
file_path: "src/iOS/Info.plist" file_path: "./src/iOS/Info.plist"
- name: Setup git - name: Setup git
run: | run: |
@@ -127,24 +94,22 @@ jobs:
- name: Commit files - name: Commit files
if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }}
run: git commit -m "Bumped version to ${{ inputs.version_number }}" -a run: git commit -m "Bumped version to ${{ github.event.inputs.version_number }}" -a
- name: Push changes - name: Push changes
if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }}
env: run: git push -u origin version_bump_${{ github.event.inputs.version_number }}
PR_BRANCH: ${{ steps.create-branch.outputs.name }}
run: git push -u origin $PR_BRANCH
- name: Create Version PR - name: Create Version PR
if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }} if: ${{ steps.version-changed.outputs.changes_to_commit == 'TRUE' }}
id: create-pr
env: env:
GH_TOKEN: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }} PR_BRANCH: "version_bump_${{ github.event.inputs.version_number }}"
PR_BRANCH: ${{ steps.create-branch.outputs.name }} GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
TITLE: "Bump version to ${{ inputs.version_number }}" BASE_BRANCH: master
TITLE: "Bump version to ${{ github.event.inputs.version_number }}"
run: | run: |
PR_URL=$(gh pr create --title "$TITLE" \ gh pr create --title "$TITLE" \
--base "main" \ --base "$BASE" \
--head "$PR_BRANCH" \ --head "$PR_BRANCH" \
--label "version update" \ --label "version update" \
--label "automated pr" \ --label "automated pr" \
@@ -157,42 +122,4 @@ jobs:
- [X] Other - [X] Other
## Objective ## Objective
Automated version bump to ${{ inputs.version_number }}") Automated version bump to ${{ github.event.inputs.version_number }}"
echo "pr_number=${PR_URL##*/}" >> $GITHUB_OUTPUT
- name: Approve PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ steps.create-pr.outputs.pr_number }}
run: gh pr review $PR_NUMBER --approve
- name: Merge PR
env:
GH_TOKEN: ${{ steps.retrieve-secrets.outputs.github-pat-bitwarden-devops-bot-repo-scope }}
PR_NUMBER: ${{ steps.create-pr.outputs.pr_number }}
run: gh pr merge $PR_NUMBER --squash --auto --delete-branch
cut_rc:
name: Cut RC branch
needs: bump_version
if: ${{ inputs.cut_rc_branch == true }}
runs-on: ubuntu-22.04
steps:
- name: Checkout Branch
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: main
- name: Check if RC branch exists
run: |
remote_rc_branch_check=$(git ls-remote --heads origin rc | wc -l)
if [[ "${remote_rc_branch_check}" -gt 0 ]]; then
echo "Remote RC branch exists."
echo "Please delete current RC branch before running again."
exit 1
fi
- name: Cut RC branch
run: |
git switch --quiet --create rc
git push --quiet --set-upstream origin rc

View File

@@ -8,4 +8,4 @@ on:
jobs: jobs:
call-workflow: call-workflow:
uses: bitwarden/gh-actions/.github/workflows/workflow-linter.yml@main uses: bitwarden/gh-actions/.github/workflows/workflow-linter.yml@34ecb67b2a357795dc893549df0795e7383ff50f

View File

@@ -1,7 +1,5 @@
{ {
"sdk": { "sdk": {
"version": "7.0.400", "version": "7.0.306"
"rollForward": "latestPatch",
"allowPrerelease": false
} }
} }

14
package-lock.json generated
View File

@@ -8,7 +8,7 @@
"name": "bitwarden-mobile", "name": "bitwarden-mobile",
"version": "0.0.0", "version": "0.0.0",
"devDependencies": { "devDependencies": {
"gh-pages": "3.2.3" "gh-pages": "^3.2.3"
} }
}, },
"node_modules/array-union": { "node_modules/array-union": {
@@ -33,9 +33,9 @@
} }
}, },
"node_modules/async": { "node_modules/async": {
"version": "2.6.4", "version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"lodash": "^4.17.14" "lodash": "^4.17.14"
@@ -480,9 +480,9 @@
"dev": true "dev": true
}, },
"async": { "async": {
"version": "2.6.4", "version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"dev": true, "dev": true,
"requires": { "requires": {
"lodash": "^4.17.14" "lodash": "^4.17.14"

View File

@@ -6,6 +6,6 @@
"clean:l10n": "git push origin --delete l10n_master" "clean:l10n": "git push origin --delete l10n_master"
}, },
"devDependencies": { "devDependencies": {
"gh-pages": "3.2.3" "gh-pages": "^3.2.3"
} }
} }

View File

@@ -107,7 +107,6 @@ namespace Bit.Droid.Accessibility
new Browser("org.bromite.chromium", "url_bar"), new Browser("org.bromite.chromium", "url_bar"),
new Browser("org.chromium.chrome", "url_bar"), new Browser("org.chromium.chrome", "url_bar"),
new Browser("org.codeaurora.swe.browser", "url_bar"), new Browser("org.codeaurora.swe.browser", "url_bar"),
new Browser("org.cromite.cromite", "url_bar"),
new Browser("org.gnu.icecat", "url_bar_title,mozac_browser_toolbar_url_view"), // 2nd = Anticipation new Browser("org.gnu.icecat", "url_bar_title,mozac_browser_toolbar_url_view"), // 2nd = Anticipation
new Browser("org.mozilla.fenix", "mozac_browser_toolbar_url_view"), new Browser("org.mozilla.fenix", "mozac_browser_toolbar_url_view"),
new Browser("org.mozilla.fenix.nightly", "mozac_browser_toolbar_url_view"), // [DEPRECATED ENTRY] new Browser("org.mozilla.fenix.nightly", "mozac_browser_toolbar_url_view"), // [DEPRECATED ENTRY]

View File

@@ -77,21 +77,21 @@
<PackageReference Include="Portable.BouncyCastle"> <PackageReference Include="Portable.BouncyCastle">
<Version>1.9.0</Version> <Version>1.9.0</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.6.1.3" /> <PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.5.1.1" />
<PackageReference Include="Xamarin.AndroidX.AutoFill" Version="1.1.0.18" /> <PackageReference Include="Xamarin.AndroidX.AutoFill" Version="1.1.0.16" />
<PackageReference Include="Xamarin.AndroidX.CardView" Version="1.0.0.21" /> <PackageReference Include="Xamarin.AndroidX.CardView" Version="1.0.0.19" />
<PackageReference Include="Xamarin.AndroidX.Core" Version="1.10.1.2" /> <PackageReference Include="Xamarin.AndroidX.Core" Version="1.10.0" />
<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.4.0.2" /> <PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.3.1.1" />
<PackageReference Include="Xamarin.Essentials"> <PackageReference Include="Xamarin.Essentials">
<Version>1.8.0</Version> <Version>1.7.5</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Xamarin.Firebase.Messaging"> <PackageReference Include="Xamarin.Firebase.Messaging">
<Version>123.1.2.2</Version> <Version>123.1.1.1</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.9.0.2" /> <PackageReference Include="Xamarin.Google.Android.Material" Version="1.8.0" />
<PackageReference Include="Xamarin.Google.Dagger" Version="2.46.1.2" /> <PackageReference Include="Xamarin.Google.Dagger" Version="2.44.2.1" />
<PackageReference Include="Xamarin.GooglePlayServices.SafetyNet"> <PackageReference Include="Xamarin.GooglePlayServices.SafetyNet">
<Version>118.0.1.5</Version> <Version>118.0.1.3</Version>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@@ -245,14 +245,6 @@
<SubType></SubType> <SubType></SubType>
<Generator></Generator> <Generator></Generator>
</AndroidResource> </AndroidResource>
<AndroidResource Include="Resources\drawable\empty_login_requests.xml">
<SubType></SubType>
<Generator></Generator>
</AndroidResource>
<AndroidResource Include="Resources\drawable\empty_login_requests_dark.xml">
<SubType></SubType>
<Generator></Generator>
</AndroidResource>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<AndroidResource Include="Resources\drawable\splash_screen.xml" /> <AndroidResource Include="Resources\drawable\splash_screen.xml" />

View File

@@ -20,7 +20,6 @@ using AndroidX.AutoFill.Inline.V1;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using SaveFlags = Android.Service.Autofill.SaveFlags; using SaveFlags = Android.Service.Autofill.SaveFlags;
using Bit.Droid.Utilities; using Bit.Droid.Utilities;
using Bit.Core.Services;
namespace Bit.Droid.Autofill namespace Bit.Droid.Autofill
{ {
@@ -128,7 +127,6 @@ namespace Bit.Droid.Autofill
"org.bromite.chromium", "org.bromite.chromium",
"org.chromium.chrome", "org.chromium.chrome",
"org.codeaurora.swe.browser", "org.codeaurora.swe.browser",
"org.cromite.cromite",
"org.gnu.icecat", "org.gnu.icecat",
"org.mozilla.fenix", "org.mozilla.fenix",
"org.mozilla.fenix.nightly", "org.mozilla.fenix.nightly",
@@ -154,9 +152,8 @@ namespace Bit.Droid.Autofill
"androidapp://com.oneplus.applocker", "androidapp://com.oneplus.applocker",
}; };
public static async Task<List<FilledItem>> GetFillItemsAsync(Parser parser, ICipherService cipherService, IUserVerificationService userVerificationService) public static async Task<List<FilledItem>> GetFillItemsAsync(Parser parser, ICipherService cipherService)
{ {
var userHasMasterPassword = await userVerificationService.HasMasterPasswordAsync();
if (parser.FieldCollection.FillableForLogin) if (parser.FieldCollection.FillableForLogin)
{ {
var ciphers = await cipherService.GetAllDecryptedByUrlAsync(parser.Uri); var ciphers = await cipherService.GetAllDecryptedByUrlAsync(parser.Uri);
@@ -164,14 +161,14 @@ namespace Bit.Droid.Autofill
{ {
var allCiphers = ciphers.Item1.ToList(); var allCiphers = ciphers.Item1.ToList();
allCiphers.AddRange(ciphers.Item2.ToList()); allCiphers.AddRange(ciphers.Item2.ToList());
var nonPromptCiphers = allCiphers.Where(cipher => !userHasMasterPassword || cipher.Reprompt == CipherRepromptType.None); var nonPromptCiphers = allCiphers.Where(cipher => cipher.Reprompt == CipherRepromptType.None);
return nonPromptCiphers.Select(c => new FilledItem(c)).ToList(); return nonPromptCiphers.Select(c => new FilledItem(c)).ToList();
} }
} }
else if (parser.FieldCollection.FillableForCard) else if (parser.FieldCollection.FillableForCard)
{ {
var ciphers = await cipherService.GetAllDecryptedAsync(); var ciphers = await cipherService.GetAllDecryptedAsync();
return ciphers.Where(c => c.Type == CipherType.Card && (!userHasMasterPassword || c.Reprompt == CipherRepromptType.None)).Select(c => new FilledItem(c)).ToList(); return ciphers.Where(c => c.Type == CipherType.Card && c.Reprompt == CipherRepromptType.None).Select(c => new FilledItem(c)).ToList();
} }
return new List<FilledItem>(); return new List<FilledItem>();
} }

View File

@@ -11,7 +11,6 @@ using Android.Widget;
using Bit.Core; using Bit.Core;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Enums; using Bit.Core.Enums;
using Bit.Core.Services;
using Bit.Core.Utilities; using Bit.Core.Utilities;
namespace Bit.Droid.Autofill namespace Bit.Droid.Autofill
@@ -27,7 +26,6 @@ namespace Bit.Droid.Autofill
private IPolicyService _policyService; private IPolicyService _policyService;
private IStateService _stateService; private IStateService _stateService;
private LazyResolve<ILogger> _logger = new LazyResolve<ILogger>("logger"); private LazyResolve<ILogger> _logger = new LazyResolve<ILogger>("logger");
private IUserVerificationService _userVerificationService;
public async override void OnFillRequest(FillRequest request, CancellationSignal cancellationSignal, public async override void OnFillRequest(FillRequest request, CancellationSignal cancellationSignal,
FillCallback callback) FillCallback callback)
@@ -66,9 +64,11 @@ namespace Bit.Droid.Autofill
var locked = await _vaultTimeoutService.IsLockedAsync(); var locked = await _vaultTimeoutService.IsLockedAsync();
if (!locked) if (!locked)
{ {
_cipherService ??= ServiceContainer.Resolve<ICipherService>(); if (_cipherService == null)
_userVerificationService ??= ServiceContainer.Resolve<IUserVerificationService>(); {
items = await AutofillHelpers.GetFillItemsAsync(parser, _cipherService, _userVerificationService); _cipherService = ServiceContainer.Resolve<ICipherService>("cipherService");
}
items = await AutofillHelpers.GetFillItemsAsync(parser, _cipherService);
} }
// build response // build response

View File

@@ -3,11 +3,5 @@
public static class Constants public static class Constants
{ {
public const string PACKAGE_NAME = "com.x8bit.bitwarden"; public const string PACKAGE_NAME = "com.x8bit.bitwarden";
public const string TEMP_CAMERA_IMAGE_NAME = "temp_camera_image.jpg";
/// <summary>
/// This directory must also be declared in filepaths.xml
/// </summary>
public const string TEMP_CAMERA_IMAGE_DIR = "camera_temp";
} }
} }

View File

@@ -116,7 +116,7 @@ namespace Bit.Droid
{ {
ListenYubiKey((bool)message.Data); ListenYubiKey((bool)message.Data);
} }
else if (message.Command is ThemeManager.UPDATED_THEME_MESSAGE_KEY) else if (message.Command == "updatedTheme")
{ {
Xamarin.Forms.Device.BeginInvokeOnMainThread(() => AppearanceAdjustments()); Xamarin.Forms.Device.BeginInvokeOnMainThread(() => AppearanceAdjustments());
} }
@@ -239,22 +239,18 @@ namespace Bit.Droid
string fileName = null; string fileName = null;
if (data != null && data.Data != null) if (data != null && data.Data != null)
{ {
if (data.Data.ToString()?.Contains(Constants.PACKAGE_NAME) != true) uri = data.Data;
{ fileName = AndroidHelpers.GetFileName(ApplicationContext, uri);
uri = data.Data;
fileName = AndroidHelpers.GetFileName(ApplicationContext, uri);
}
} }
else else
{ {
// camera // camera
var tmpDir = new Java.IO.File(FilesDir, Constants.TEMP_CAMERA_IMAGE_DIR); var file = new Java.IO.File(FilesDir, "temp_camera_photo.jpg");
var file = new Java.IO.File(tmpDir, Constants.TEMP_CAMERA_IMAGE_NAME);
uri = FileProvider.GetUriForFile(this, "com.x8bit.bitwarden.fileprovider", file); uri = FileProvider.GetUriForFile(this, "com.x8bit.bitwarden.fileprovider", file);
fileName = $"photo_{DateTime.UtcNow.ToString("yyyyMMddHHmmss")}.jpg"; fileName = $"photo_{DateTime.UtcNow.ToString("yyyyMMddHHmmss")}.jpg";
} }
if (uri == null || fileName == null) if (uri == null)
{ {
return; return;
} }

View File

@@ -68,9 +68,9 @@ namespace Bit.Droid
ServiceContainer.Register<IDeleteAccountActionFlowExecutioner>("deleteAccountActionFlowExecutioner", deleteAccountActionFlowExecutioner); ServiceContainer.Register<IDeleteAccountActionFlowExecutioner>("deleteAccountActionFlowExecutioner", deleteAccountActionFlowExecutioner);
var verificationActionsFlowHelper = new VerificationActionsFlowHelper( var verificationActionsFlowHelper = new VerificationActionsFlowHelper(
ServiceContainer.Resolve<IKeyConnectorService>("keyConnectorService"),
ServiceContainer.Resolve<IPasswordRepromptService>("passwordRepromptService"), ServiceContainer.Resolve<IPasswordRepromptService>("passwordRepromptService"),
ServiceContainer.Resolve<ICryptoService>("cryptoService"), ServiceContainer.Resolve<ICryptoService>("cryptoService"));
ServiceContainer.Resolve<IUserVerificationService>());
ServiceContainer.Register<IVerificationActionsFlowHelper>("verificationActionsFlowHelper", verificationActionsFlowHelper); ServiceContainer.Register<IVerificationActionsFlowHelper>("verificationActionsFlowHelper", verificationActionsFlowHelper);
var accountsManager = new AccountsManager( var accountsManager = new AccountsManager(
@@ -156,11 +156,10 @@ namespace Bit.Droid
messagingService, broadcasterService); messagingService, broadcasterService);
var autofillHandler = new AutofillHandler(stateService, messagingService, clipboardService, var autofillHandler = new AutofillHandler(stateService, messagingService, clipboardService,
platformUtilsService, new LazyResolve<IEventService>()); platformUtilsService, new LazyResolve<IEventService>());
var biometricService = new BiometricService(stateService);
var cryptoFunctionService = new PclCryptoFunctionService(cryptoPrimitiveService); var cryptoFunctionService = new PclCryptoFunctionService(cryptoPrimitiveService);
var cryptoService = new CryptoService(stateService, cryptoFunctionService); var cryptoService = new CryptoService(stateService, cryptoFunctionService);
var biometricService = new BiometricService(stateService, cryptoService); var passwordRepromptService = new MobilePasswordRepromptService(platformUtilsService, cryptoService);
var userPinService = new UserPinService(stateService, cryptoService);
var passwordRepromptService = new MobilePasswordRepromptService(platformUtilsService, cryptoService, stateService);
ServiceContainer.Register<ISynchronousStorageService>(preferencesStorage); ServiceContainer.Register<ISynchronousStorageService>(preferencesStorage);
ServiceContainer.Register<IBroadcasterService>("broadcasterService", broadcasterService); ServiceContainer.Register<IBroadcasterService>("broadcasterService", broadcasterService);
@@ -183,7 +182,6 @@ namespace Bit.Droid
ServiceContainer.Register<ICryptoService>("cryptoService", cryptoService); ServiceContainer.Register<ICryptoService>("cryptoService", cryptoService);
ServiceContainer.Register<IPasswordRepromptService>("passwordRepromptService", passwordRepromptService); ServiceContainer.Register<IPasswordRepromptService>("passwordRepromptService", passwordRepromptService);
ServiceContainer.Register<IAvatarImageSourcePool>("avatarImageSourcePool", new AvatarImageSourcePool()); ServiceContainer.Register<IAvatarImageSourcePool>("avatarImageSourcePool", new AvatarImageSourcePool());
ServiceContainer.Register<IUserPinService>(userPinService);
// Push // Push
#if FDROID #if FDROID

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="2024.1.1" android:installLocation="internalOnly" package="com.x8bit.bitwarden"> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:versionCode="1" android:versionName="2023.7.1" android:installLocation="internalOnly" package="com.x8bit.bitwarden">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33" /> <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.NFC" /> <uses-permission android:name="android.permission.NFC" />

View File

@@ -1,41 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:aapt="http://schemas.android.com/aapt"
android:viewportWidth="200"
android:viewportHeight="143"
android:width="200dp"
android:height="143dp">
<path
android:pathData="M34 43H10C6.68629 43 4 45.6863 4 49V109C4 112.314 6.68629 115 10 115H34C37.3137 115 40 112.314 40 109V49C40 45.6863 37.3137 43 34 43ZM10 39C4.47715 39 0 43.4772 0 49V109C0 114.523 4.47715 119 10 119H34C39.5228 119 44 114.523 44 109V49C44 43.4772 39.5228 39 34 39H10Z"
android:fillType="evenOdd"
android:fillColor="#89929F" />
<path
android:pathData="M20.3701 47.809C20.3701 47.2567 20.8178 46.809 21.3701 46.809H22.6122C23.1645 46.809 23.6122 47.2567 23.6122 47.809C23.6122 48.3612 23.1645 48.809 22.6122 48.809H21.3701C20.8178 48.809 20.3701 48.3612 20.3701 47.809Z"
android:fillType="evenOdd"
android:fillColor="#89929F" />
<path
android:pathData="M68 120C68 119.448 68.4477 119 69 119H127C127.552 119 128 119.448 128 120C128 120.552 127.552 121 127 121H69C68.4477 121 68 120.552 68 120Z"
android:fillType="evenOdd"
android:fillColor="#89929F" />
<path
android:pathData="M87.7402 120V102.236H89.7402V120H87.7402Z"
android:fillType="evenOdd"
android:fillColor="#89929F" />
<path
android:pathData="M107.71 120V102.236H109.71V120H107.71Z"
android:fillType="evenOdd"
android:fillColor="#89929F" />
<path
android:pathData="M27 25C27 17.268 33.268 11 41 11H157C164.732 11 171 17.268 171 25V31H167V25C167 19.4772 162.523 15 157 15H41C35.4772 15 31 19.4772 31 25V41H27V25ZM42 99H127V103H42V99Z"
android:fillType="evenOdd"
android:fillColor="#89929F" />
<path
android:pathData="M35 26C35 22.134 38.134 19 42 19H156C159.866 19 163 22.134 163 26V31H161V26C161 23.2386 158.761 21 156 21H42C39.2386 21 37 23.2386 37 26V41H35V26ZM42 93H127V95H42V93Z"
android:fillType="evenOdd"
android:fillColor="#89929F" />
<path
android:pathData="M125 39C125 33.4771 129.477 29 135 29H188C193.523 29 198 33.4772 198 39V119C198 124.523 193.523 129 188 129H135C129.477 129 125 124.523 125 119V39ZM135 33C131.686 33 129 35.6863 129 39V119C129 122.314 131.686 125 135 125H188C191.314 125 194 122.314 194 119V39C194 35.6863 191.314 33 188 33H135Z"
android:fillType="evenOdd"
android:fillColor="#89929F" />
<path
android:pathData="M164 120C164 121.105 163.105 122 162 122C160.895 122 160 121.105 160 120C160 118.895 160.895 118 162 118C163.105 118 164 118.895 164 120Z"
android:fillColor="#89929F" />
</vector>

View File

@@ -1,41 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:aapt="http://schemas.android.com/aapt"
android:viewportWidth="200"
android:viewportHeight="143"
android:width="200dp"
android:height="143dp">
<path
android:pathData="M34 43H10C6.68629 43 4 45.6863 4 49V109C4 112.314 6.68629 115 10 115H34C37.3137 115 40 112.314 40 109V49C40 45.6863 37.3137 43 34 43ZM10 39C4.47715 39 0 43.4772 0 49V109C0 114.523 4.47715 119 10 119H34C39.5228 119 44 114.523 44 109V49C44 43.4772 39.5228 39 34 39H10Z"
android:fillType="evenOdd"
android:fillColor="#A3A3A3" />
<path
android:pathData="M20.3701 47.809C20.3701 47.2567 20.8178 46.809 21.3701 46.809H22.6122C23.1645 46.809 23.6122 47.2567 23.6122 47.809C23.6122 48.3612 23.1645 48.809 22.6122 48.809H21.3701C20.8178 48.809 20.3701 48.3612 20.3701 47.809Z"
android:fillType="evenOdd"
android:fillColor="#A3A3A3" />
<path
android:pathData="M68 120C68 119.448 68.4477 119 69 119H127C127.552 119 128 119.448 128 120C128 120.552 127.552 121 127 121H69C68.4477 121 68 120.552 68 120Z"
android:fillType="evenOdd"
android:fillColor="#A3A3A3" />
<path
android:pathData="M87.7402 120V102.236H89.7402V120H87.7402Z"
android:fillType="evenOdd"
android:fillColor="#A3A3A3" />
<path
android:pathData="M107.71 120V102.236H109.71V120H107.71Z"
android:fillType="evenOdd"
android:fillColor="#A3A3A3" />
<path
android:pathData="M27 25C27 17.268 33.268 11 41 11H157C164.732 11 171 17.268 171 25V31H167V25C167 19.4772 162.523 15 157 15H41C35.4772 15 31 19.4772 31 25V41H27V25ZM42 99H127V103H42V99Z"
android:fillType="evenOdd"
android:fillColor="#A3A3A3" />
<path
android:pathData="M35 26C35 22.134 38.134 19 42 19H156C159.866 19 163 22.134 163 26V31H161V26C161 23.2386 158.761 21 156 21H42C39.2386 21 37 23.2386 37 26V41H35V26ZM42 93H127V95H42V93Z"
android:fillType="evenOdd"
android:fillColor="#A3A3A3" />
<path
android:pathData="M125 39C125 33.4771 129.477 29 135 29H188C193.523 29 198 33.4772 198 39V119C198 124.523 193.523 129 188 129H135C129.477 129 125 124.523 125 119V39ZM135 33C131.686 33 129 35.6863 129 39V119C129 122.314 131.686 125 135 125H188C191.314 125 194 122.314 194 119V39C194 35.6863 191.314 33 188 33H135Z"
android:fillType="evenOdd"
android:fillColor="#A3A3A3" />
<path
android:pathData="M164 120C164 121.105 163.105 122 162 122C160.895 122 160 121.105 160 120C160 118.895 160.895 118 162 118C163.105 118 164 118.895 164 120Z"
android:fillColor="#A3A3A3" />
</vector>

View File

@@ -236,9 +236,6 @@
<compatibility-package <compatibility-package
android:name="org.codeaurora.swe.browser" android:name="org.codeaurora.swe.browser"
android:maxLongVersionCode="10000000000"/> android:maxLongVersionCode="10000000000"/>
<compatibility-package
android:name="org.cromite.cromite"
android:maxLongVersionCode="10000000000"/>
<compatibility-package <compatibility-package
android:name="org.gnu.icecat" android:name="org.gnu.icecat"
android:maxLongVersionCode="10000000000"/> android:maxLongVersionCode="10000000000"/>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<paths xmlns:android="http://schemas.android.com/apk/res/android"> <paths xmlns:android="http://schemas.android.com/apk/res/android">
<cache-path name="cache" path="." /> <cache-path name="cache" path="." />
<files-path name="temp_camera_images" path="camera_temp/" /> <files-path name="internal" path="." />
</paths> </paths>

View File

@@ -2,7 +2,6 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Android.OS; using Android.OS;
using Android.Security.Keystore; using Android.Security.Keystore;
using Bit.App.Services;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Services; using Bit.Core.Services;
using Java.Security; using Java.Security;
@@ -10,8 +9,10 @@ using Javax.Crypto;
namespace Bit.Droid.Services namespace Bit.Droid.Services
{ {
public class BiometricService : BaseBiometricService public class BiometricService : IBiometricService
{ {
private readonly IStateService _stateService;
private const string KeyName = "com.8bit.bitwarden.biometric_integrity"; private const string KeyName = "com.8bit.bitwarden.biometric_integrity";
private const string KeyStoreName = "AndroidKeyStore"; private const string KeyStoreName = "AndroidKeyStore";
@@ -23,14 +24,14 @@ namespace Bit.Droid.Services
private readonly KeyStore _keystore; private readonly KeyStore _keystore;
public BiometricService(IStateService stateService, ICryptoService cryptoService) public BiometricService(IStateService stateService)
: base(stateService, cryptoService)
{ {
_stateService = stateService;
_keystore = KeyStore.GetInstance(KeyStoreName); _keystore = KeyStore.GetInstance(KeyStoreName);
_keystore.Load(null); _keystore.Load(null);
} }
public override async Task<bool> SetupBiometricAsync(string bioIntegritySrcKey = null) public async Task<bool> SetupBiometricAsync(string bioIntegritySrcKey = null)
{ {
if (Build.VERSION.SdkInt >= BuildVersionCodes.M) if (Build.VERSION.SdkInt >= BuildVersionCodes.M)
{ {
@@ -40,7 +41,7 @@ namespace Bit.Droid.Services
return true; return true;
} }
public override async Task<bool> IsSystemBiometricIntegrityValidAsync(string bioIntegritySrcKey = null) public async Task<bool> IsSystemBiometricIntegrityValidAsync(string bioIntegritySrcKey = null)
{ {
if (Build.VERSION.SdkInt < BuildVersionCodes.M) if (Build.VERSION.SdkInt < BuildVersionCodes.M)
{ {

View File

@@ -547,12 +547,6 @@ namespace Bit.Droid.Services
return true; return true;
} }
public bool SupportsAutofillServices() => Build.VERSION.SdkInt >= BuildVersionCodes.O;
public bool SupportsInlineAutofill() => Build.VERSION.SdkInt >= BuildVersionCodes.R;
public bool SupportsDrawOver() => Build.VERSION.SdkInt >= BuildVersionCodes.M;
private Intent RateIntentForUrl(string url, Activity activity) private Intent RateIntentForUrl(string url, Activity activity)
{ {
var intent = new Intent(Intent.ActionView, Android.Net.Uri.Parse($"{url}?id={activity.PackageName}")); var intent = new Intent(Intent.ActionView, Android.Net.Uri.Parse($"{url}?id={activity.PackageName}"));
@@ -607,38 +601,6 @@ namespace Bit.Droid.Services
throw new NotImplementedException(); throw new NotImplementedException();
} }
public string GetAutofillAccessibilityDescription()
{
if (Build.VERSION.SdkInt <= BuildVersionCodes.LollipopMr1)
{
return AppResources.AccessibilityDescription;
}
if (Build.VERSION.SdkInt <= BuildVersionCodes.M)
{
return AppResources.AccessibilityDescription2;
}
if (Build.VERSION.SdkInt <= BuildVersionCodes.NMr1)
{
return AppResources.AccessibilityDescription3;
}
return AppResources.AccessibilityDescription4;
}
public string GetAutofillDrawOverDescription()
{
if (Build.VERSION.SdkInt <= BuildVersionCodes.M)
{
return AppResources.DrawOverDescription;
}
if (Build.VERSION.SdkInt <= BuildVersionCodes.NMr1)
{
return AppResources.DrawOverDescription2;
}
return AppResources.DrawOverDescription3;
}
private void SetNumericKeyboardTo(EditText editText) private void SetNumericKeyboardTo(EditText editText)
{ {
editText.InputType = InputTypes.ClassNumber | InputTypes.NumberFlagDecimal | InputTypes.NumberFlagSigned; editText.InputType = InputTypes.ClassNumber | InputTypes.NumberFlagDecimal | InputTypes.NumberFlagSigned;

View File

@@ -190,8 +190,7 @@ namespace Bit.Droid.Services
{ {
try try
{ {
var tmpDir = new Java.IO.File(activity.FilesDir, Constants.TEMP_CAMERA_IMAGE_DIR); var file = new Java.IO.File(activity.FilesDir, "temp_camera_photo.jpg");
var file = new Java.IO.File(tmpDir, Constants.TEMP_CAMERA_IMAGE_NAME);
if (!file.Exists()) if (!file.Exists())
{ {
file.ParentFile.Mkdirs(); file.ParentFile.Mkdirs();

View File

@@ -28,9 +28,6 @@ namespace Bit.App.Abstractions
bool SupportsNfc(); bool SupportsNfc();
bool SupportsCamera(); bool SupportsCamera();
bool SupportsFido2(); bool SupportsFido2();
bool SupportsAutofillServices();
bool SupportsInlineAutofill();
bool SupportsDrawOver();
bool LaunchApp(string appName); bool LaunchApp(string appName);
void RateApp(); void RateApp();
@@ -44,7 +41,5 @@ namespace Bit.App.Abstractions
Task SetScreenCaptureAllowedAsync(); Task SetScreenCaptureAllowedAsync();
void OpenAppSettings(); void OpenAppSettings();
void CloseExtensionPopUp(); void CloseExtensionPopUp();
string GetAutofillAccessibilityDescription();
string GetAutofillDrawOverDescription();
} }
} }

View File

@@ -1,5 +1,4 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.Core.Enums;
namespace Bit.App.Abstractions namespace Bit.App.Abstractions
{ {
@@ -7,8 +6,10 @@ namespace Bit.App.Abstractions
{ {
string[] ProtectedFields { get; } string[] ProtectedFields { get; }
Task<bool> PromptAndCheckPasswordIfNeededAsync(CipherRepromptType repromptType = CipherRepromptType.Password); Task<bool> ShowPasswordPromptAsync();
Task<(string password, bool valid)> ShowPasswordPromptAndGetItAsync(); Task<(string password, bool valid)> ShowPasswordPromptAndGetItAsync();
Task<bool> Enabled();
} }
} }

View File

@@ -1,33 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<RootNamespace>Bit.App</RootNamespace> <RootNamespace>Bit.App</RootNamespace>
<AssemblyName>BitwardenApp</AssemblyName> <AssemblyName>BitwardenApp</AssemblyName>
<Configurations>Debug;Release;FDroid</Configurations> <Configurations>Debug;Release;FDroid</Configurations>
<TargetFrameworks>net7.0-android;net7.0-ios</TargetFrameworks>
<UseMaui>True</UseMaui>
<OutputType>Library</OutputType>
<ImplicitUsings>enable</ImplicitUsings>
<SingleProject>true</SingleProject>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Plugin.Fingerprint" Version="2.1.5" /> <PackageReference Include="Plugin.Fingerprint" Version="2.1.5" />
<PackageReference Include="SkiaSharp.Views.Forms" Version="2.88.3" />
<PackageReference Include="Xamarin.CommunityToolkit" Version="2.0.6" />
<PackageReference Include="Xamarin.Essentials" Version="1.8.0" />
<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.2612" />
<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" />
<PackageReference Include="MessagePack" Version="2.4.59" /> <PackageReference Include="MessagePack" Version="2.4.59" />
<PackageReference Include="SkiaSharp.Views.Maui.Core" Version="2.88.3" />
<PackageReference Include="SkiaSharp.Views.Maui.Controls" Version="2.88.3" />
<PackageReference Include="SkiaSharp.Views.Maui.Controls.Compatibility" Version="2.88.3" />
<PackageReference Include="CommunityToolkit.Maui" Version="5.2.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Core\Core.csproj" /> <ProjectReference Include="..\Core\Core.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Update="Pages\Accounts\EnvironmentPage.xaml.cs"> <Compile Update="Pages\Accounts\EnvironmentPage.xaml.cs">
<DependentUpon>EnvironmentPage.xaml</DependentUpon> <DependentUpon>EnvironmentPage.xaml</DependentUpon>
@@ -59,6 +54,9 @@
<Compile Update="Pages\Settings\ExtensionPage.xaml.cs"> <Compile Update="Pages\Settings\ExtensionPage.xaml.cs">
<DependentUpon>ExtensionPage.xaml</DependentUpon> <DependentUpon>ExtensionPage.xaml</DependentUpon>
</Compile> </Compile>
<Compile Update="Pages\Settings\AutofillServicesPage.xaml.cs">
<DependentUpon>AutofillServicesPage.xaml</DependentUpon>
</Compile>
<Compile Update="Pages\Settings\FolderAddEditPage.xaml.cs"> <Compile Update="Pages\Settings\FolderAddEditPage.xaml.cs">
<DependentUpon>FolderAddEditPage.xaml</DependentUpon> <DependentUpon>FolderAddEditPage.xaml</DependentUpon>
</Compile> </Compile>
@@ -68,6 +66,12 @@
<Compile Update="Pages\Settings\ExportVaultPage.xaml.cs"> <Compile Update="Pages\Settings\ExportVaultPage.xaml.cs">
<DependentUpon>ExportVaultPage.xaml</DependentUpon> <DependentUpon>ExportVaultPage.xaml</DependentUpon>
</Compile> </Compile>
<Compile Update="Pages\Settings\OptionsPage.xaml.cs">
<DependentUpon>OptionsPage.xaml</DependentUpon>
</Compile>
<Compile Update="Pages\Settings\SyncPage.xaml.cs">
<DependentUpon>SyncPage.xaml</DependentUpon>
</Compile>
<Compile Update="Pages\Vault\AttachmentsPage.xaml.cs"> <Compile Update="Pages\Vault\AttachmentsPage.xaml.cs">
<DependentUpon>AttachmentsPage.xaml</DependentUpon> <DependentUpon>AttachmentsPage.xaml</DependentUpon>
</Compile> </Compile>
@@ -121,7 +125,6 @@
<DependentUpon>LoginPasswordlessRequestPage.xaml</DependentUpon> <DependentUpon>LoginPasswordlessRequestPage.xaml</DependentUpon>
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Resources\" /> <Folder Include="Resources\" />
<Folder Include="Behaviors\" /> <Folder Include="Behaviors\" />
@@ -138,13 +141,10 @@
<Folder Include="Controls\PasswordStrengthProgressBar\" /> <Folder Include="Controls\PasswordStrengthProgressBar\" />
<Folder Include="Utilities\Automation\" /> <Folder Include="Utilities\Automation\" />
<Folder Include="Utilities\Prompts\" /> <Folder Include="Utilities\Prompts\" />
<Folder Include="Controls\Settings\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Remove="Pages\Accounts\AccountsPopupPage.xaml" /> <EmbeddedResource Remove="Pages\Accounts\AccountsPopupPage.xaml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Update="Styles\Black.xaml.cs"> <Compile Update="Styles\Black.xaml.cs">
<DependentUpon>Black.xaml</DependentUpon> <DependentUpon>Black.xaml</DependentUpon>
@@ -168,7 +168,6 @@
<DependentUpon>Android.xaml</DependentUpon> <DependentUpon>Android.xaml</DependentUpon>
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Update="Resources\AppResources.cs.Designer.cs"> <Compile Update="Resources\AppResources.cs.Designer.cs">
<DependentUpon>AppResources.cs.resx</DependentUpon> <DependentUpon>AppResources.cs.resx</DependentUpon>
@@ -306,7 +305,6 @@
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Update="Resources\AppResources.cs.resx"> <EmbeddedResource Update="Resources\AppResources.cs.resx">
<LastGenOutput>AppResources.cs.Designer.cs</LastGenOutput> <LastGenOutput>AppResources.cs.Designer.cs</LastGenOutput>
@@ -417,7 +415,6 @@
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Remove="Behaviors\" /> <None Remove="Behaviors\" />
<None Remove="Xamarin.CommunityToolkit" /> <None Remove="Xamarin.CommunityToolkit" />
@@ -436,6 +433,5 @@
<None Remove="Controls\PasswordStrengthProgressBar\" /> <None Remove="Controls\PasswordStrengthProgressBar\" />
<None Remove="Utilities\Automation\" /> <None Remove="Utilities\Automation\" />
<None Remove="Utilities\Prompts\" /> <None Remove="Utilities\Prompts\" />
<None Remove="Controls\Settings\" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<Application xmlns="http://xamarin.com/schemas/2014/forms" <Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Bit.App.App"> x:Class="Bit.App.App">
<Application.Resources> <Application.Resources>

View File

@@ -15,8 +15,9 @@ using Bit.Core.Models.Data;
using Bit.Core.Models.Response; using Bit.Core.Models.Response;
using Bit.Core.Services; using Bit.Core.Services;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using Xamarin.Forms; using Microsoft.Maui.Controls.Xaml;
using Xamarin.Forms.Xaml; using Microsoft.Maui.Controls;
using Microsoft.Maui;
[assembly: XamlCompilation(XamlCompilationOptions.Compile)] [assembly: XamlCompilation(XamlCompilationOptions.Compile)]
namespace Bit.App namespace Bit.App
@@ -91,8 +92,9 @@ 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 == AppHelpers.RESUMED_MESSAGE_COMMAND) else if (message.Command == "resumed")
{ {
// TODO Xamarin.Forms.Device.RuntimePlatform is no longer supported. Use Microsoft.Maui.Devices.DeviceInfo.Platform instead. For more details see https://learn.microsoft.com/en-us/dotnet/maui/migration/forms-projects#device-changes
if (Device.RuntimePlatform == Device.iOS) if (Device.RuntimePlatform == Device.iOS)
{ {
ResumedAsync().FireAndForget(); ResumedAsync().FireAndForget();
@@ -100,6 +102,7 @@ namespace Bit.App
} }
else if (message.Command == "slept") else if (message.Command == "slept")
{ {
// TODO Xamarin.Forms.Device.RuntimePlatform is no longer supported. Use Microsoft.Maui.Devices.DeviceInfo.Platform instead. For more details see https://learn.microsoft.com/en-us/dotnet/maui/migration/forms-projects#device-changes
if (Device.RuntimePlatform == Device.iOS) if (Device.RuntimePlatform == Device.iOS)
{ {
await SleptAsync(); await SleptAsync();
@@ -121,7 +124,7 @@ namespace Bit.App
Options.OtpData = new OtpData((string)message.Data); Options.OtpData = new OtpData((string)message.Data);
} }
await Device.InvokeOnMainThreadAsync(async () => Device.InvokeOnMainThreadAsync(async () =>
{ {
if (Current.MainPage is TabsPage tabsPage) if (Current.MainPage is TabsPage tabsPage)
{ {
@@ -171,11 +174,6 @@ namespace Bit.App
new NavigationPage(new UpdateTempPasswordPage())); new NavigationPage(new UpdateTempPasswordPage()));
}); });
} }
else if (message.Command == Constants.ForceSetPassword)
{
await Device.InvokeOnMainThreadAsync(() => Application.Current.MainPage.Navigation.PushModalAsync(
new NavigationPage(new SetPasswordPage(orgIdentifier: (string)message.Data))));
}
else if (message.Command == "syncCompleted") else if (message.Command == "syncCompleted")
{ {
await _configService.GetAsync(true); await _configService.GetAsync(true);
@@ -298,6 +296,7 @@ namespace Bit.App
{ {
_messagingService.Send(Constants.PasswordlessLoginRequestKey); _messagingService.Send(Constants.PasswordlessLoginRequestKey);
} }
// TODO Xamarin.Forms.Device.RuntimePlatform is no longer supported. Use Microsoft.Maui.Devices.DeviceInfo.Platform instead. For more details see https://learn.microsoft.com/en-us/dotnet/maui/migration/forms-projects#device-changes
if (Device.RuntimePlatform == Device.Android) if (Device.RuntimePlatform == Device.Android)
{ {
await _vaultTimeoutService.CheckVaultTimeoutAsync(); await _vaultTimeoutService.CheckVaultTimeoutAsync();
@@ -313,6 +312,7 @@ namespace Bit.App
{ {
System.Diagnostics.Debug.WriteLine("XF App: OnSleep"); System.Diagnostics.Debug.WriteLine("XF App: OnSleep");
_isResumed = false; _isResumed = false;
// TODO Xamarin.Forms.Device.RuntimePlatform is no longer supported. Use Microsoft.Maui.Devices.DeviceInfo.Platform instead. For more details see https://learn.microsoft.com/en-us/dotnet/maui/migration/forms-projects#device-changes
if (Device.RuntimePlatform == Device.Android) if (Device.RuntimePlatform == Device.Android)
{ {
var isLocked = await _vaultTimeoutService.IsLockedAsync(); var isLocked = await _vaultTimeoutService.IsLockedAsync();
@@ -336,6 +336,7 @@ namespace Bit.App
{ {
_messagingService.Send(Constants.PasswordlessLoginRequestKey); _messagingService.Send(Constants.PasswordlessLoginRequestKey);
} }
// TODO Xamarin.Forms.Device.RuntimePlatform is no longer supported. Use Microsoft.Maui.Devices.DeviceInfo.Platform instead. For more details see https://learn.microsoft.com/en-us/dotnet/maui/migration/forms-projects#device-changes
if (Device.RuntimePlatform == Device.Android) if (Device.RuntimePlatform == Device.Android)
{ {
ResumedAsync().FireAndForget(); ResumedAsync().FireAndForget();
@@ -370,7 +371,7 @@ namespace Bit.App
await Device.InvokeOnMainThreadAsync(() => await Device.InvokeOnMainThreadAsync(() =>
{ {
ThemeManager.SetTheme(Current.Resources); ThemeManager.SetTheme(Current.Resources);
_messagingService.Send(ThemeManager.UPDATED_THEME_MESSAGE_KEY); _messagingService.Send("updatedTheme");
}); });
} }
@@ -401,6 +402,7 @@ namespace Bit.App
private void ClearAutofillUri() private void ClearAutofillUri()
{ {
// TODO Xamarin.Forms.Device.RuntimePlatform is no longer supported. Use Microsoft.Maui.Devices.DeviceInfo.Platform instead. For more details see https://learn.microsoft.com/en-us/dotnet/maui/migration/forms-projects#device-changes
if (Device.RuntimePlatform == Device.Android && !string.IsNullOrWhiteSpace(Options.Uri)) if (Device.RuntimePlatform == Device.Android && !string.IsNullOrWhiteSpace(Options.Uri))
{ {
Options.Uri = null; Options.Uri = null;
@@ -409,6 +411,7 @@ namespace Bit.App
private bool SetTabsPageFromAutofill(bool isLocked) private bool SetTabsPageFromAutofill(bool isLocked)
{ {
// TODO Xamarin.Forms.Device.RuntimePlatform is no longer supported. Use Microsoft.Maui.Devices.DeviceInfo.Platform instead. For more details see https://learn.microsoft.com/en-us/dotnet/maui/migration/forms-projects#device-changes
if (Device.RuntimePlatform == Device.Android && !string.IsNullOrWhiteSpace(Options.Uri) && if (Device.RuntimePlatform == Device.Android && !string.IsNullOrWhiteSpace(Options.Uri) &&
!Options.FromAutofillFramework) !Options.FromAutofillFramework)
{ {
@@ -457,7 +460,7 @@ namespace Bit.App
private void SyncIfNeeded() private void SyncIfNeeded()
{ {
if (Xamarin.Essentials.Connectivity.NetworkAccess == Xamarin.Essentials.NetworkAccess.None) if (Microsoft.Maui.Networking.Connectivity.NetworkAccess == Microsoft.Maui.Networking.NetworkAccess.None)
{ {
return; return;
} }

View File

@@ -1,5 +1,5 @@
using Xamarin.Essentials; using Microsoft.Maui.Controls;
using Xamarin.Forms; using Microsoft.Maui;
namespace Bit.App.Behaviors namespace Bit.App.Behaviors
{ {

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<ContentView <ContentView
xmlns="http://xamarin.com/schemas/2014/forms" xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:xct="http://xamarin.com/schemas/2020/toolkit" xmlns:xct="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:controls="clr-namespace:Bit.App.Controls" xmlns:controls="clr-namespace:Bit.App.Controls"
xmlns:effects="clr-namespace:Bit.App.Effects" xmlns:effects="clr-namespace:Bit.App.Effects"
xmlns:view="clr-namespace:Bit.Core.Models.View;assembly=BitwardenCore" xmlns:view="clr-namespace:Bit.Core.Models.View;assembly=BitwardenCore"

View File

@@ -4,7 +4,8 @@ using System.Windows.Input;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using Xamarin.CommunityToolkit.ObjectModel; using Xamarin.CommunityToolkit.ObjectModel;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {
@@ -61,7 +62,8 @@ namespace Bit.App.Controls
public ICommand LongPressAccountCommand { get; } public ICommand LongPressAccountCommand { get; }
public int AccountListRowHeight => Device.RuntimePlatform == Device.Android ? 74 : 70; public int AccountListRowHeight => // TODO Xamarin.Forms.Device.RuntimePlatform is no longer supported. Use Microsoft.Maui.Devices.DeviceInfo.Platform instead. For more details see https://learn.microsoft.com/en-us/dotnet/maui/migration/forms-projects#device-changes
Device.RuntimePlatform == Device.Android ? 74 : 70;
public bool LongPressAccountEnabled { get; set; } = true; public bool LongPressAccountEnabled { get; set; } = true;

View File

@@ -7,7 +7,8 @@ using Bit.Core.Abstractions;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using Xamarin.CommunityToolkit.ObjectModel; using Xamarin.CommunityToolkit.ObjectModel;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ViewCell xmlns="http://xamarin.com/schemas/2014/forms" <ViewCell xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:xct="http://xamarin.com/schemas/2020/toolkit" xmlns:xct="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
x:Class="Bit.App.Controls.AccountViewCell" x:Class="Bit.App.Controls.AccountViewCell"
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"

View File

@@ -1,6 +1,7 @@
using System.Windows.Input; using System.Windows.Input;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {

View File

@@ -36,7 +36,7 @@ namespace Bit.App.Controls
public bool ShowHostname public bool ShowHostname
{ {
get => !string.IsNullOrWhiteSpace(AccountView.Hostname); get => !string.IsNullOrWhiteSpace(AccountView.Hostname) && AccountView.Hostname != "vault.bitwarden.com";
} }
public bool IsActive public bool IsActive

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<controls:ExtendedGrid xmlns="http://xamarin.com/schemas/2014/forms" <controls:ExtendedGrid xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Bit.App.Controls.AuthenticatorViewCell" x:Class="Bit.App.Controls.AuthenticatorViewCell"
xmlns:controls="clr-namespace:Bit.App.Controls" xmlns:controls="clr-namespace:Bit.App.Controls"

View File

@@ -3,7 +3,8 @@ using Bit.App.Pages;
using Bit.App.Utilities; using Bit.App.Utilities;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {

View File

@@ -5,7 +5,8 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using SkiaSharp; using SkiaSharp;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {
@@ -160,7 +161,7 @@ namespace Bit.App.Controls
{ {
if (str == null) if (str == null)
{ {
return Color.FromHex("#33ffffff"); return Color.FromArgb("#33ffffff");
} }
var hash = 0; var hash = 0;
for (var i = 0; i < str.Length; i++) for (var i = 0; i < str.Length; i++)
@@ -174,7 +175,7 @@ namespace Bit.App.Controls
var base16 = "00" + Convert.ToString(value, 16); var base16 = "00" + Convert.ToString(value, 16);
color += base16.Substring(base16.Length - 2); color += base16.Substring(base16.Length - 2);
} }
return Color.FromHex(color); return Color.FromArgb(color);
} }
} }
} }

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<controls:ExtendedGrid xmlns="http://xamarin.com/schemas/2014/forms" <controls:ExtendedGrid xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Bit.App.Controls.CipherViewCell" x:Class="Bit.App.Controls.CipherViewCell"
xmlns:controls="clr-namespace:Bit.App.Controls" xmlns:controls="clr-namespace:Bit.App.Controls"

View File

@@ -3,7 +3,8 @@ using System.Windows.Input;
using Bit.App.Abstractions; using Bit.App.Abstractions;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {

View File

@@ -1,9 +1,11 @@
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using SkiaSharp; using SkiaSharp;
using SkiaSharp.Views.Forms; using Microsoft.Maui.Graphics;
using Xamarin.Essentials; using Microsoft.Maui.Controls;
using Xamarin.Forms; using Microsoft.Maui;
using SkiaSharp.Views.Maui.Controls;
using SkiaSharp.Views.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {
@@ -21,13 +23,13 @@ namespace Bit.App.Controls
nameof(StrokeWidth), typeof(float), typeof(CircularProgressbarView), 3f); nameof(StrokeWidth), typeof(float), typeof(CircularProgressbarView), 3f);
public static readonly BindableProperty ProgressColorProperty = BindableProperty.Create( public static readonly BindableProperty ProgressColorProperty = BindableProperty.Create(
nameof(ProgressColor), typeof(Color), typeof(CircularProgressbarView), Color.FromHex("175DDC")); nameof(ProgressColor), typeof(Color), typeof(CircularProgressbarView), Color.FromArgb("175DDC"));
public static readonly BindableProperty EndingProgressColorProperty = BindableProperty.Create( public static readonly BindableProperty EndingProgressColorProperty = BindableProperty.Create(
nameof(EndingProgressColor), typeof(Color), typeof(CircularProgressbarView), Color.FromHex("dd4b39")); nameof(EndingProgressColor), typeof(Color), typeof(CircularProgressbarView), Color.FromArgb("dd4b39"));
public static readonly BindableProperty BackgroundProgressColorProperty = BindableProperty.Create( public static readonly BindableProperty BackgroundProgressColorProperty = BindableProperty.Create(
nameof(BackgroundProgressColor), typeof(Color), typeof(CircularProgressbarView), Color.White); nameof(BackgroundProgressColor), typeof(Color), typeof(CircularProgressbarView), Colors.White);
public double Progress public double Progress
{ {

View File

@@ -1,4 +1,5 @@
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<Grid <Grid
xmlns="http://xamarin.com/schemas/2014/forms" xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:controls="clr-namespace:Bit.App.Controls" xmlns:controls="clr-namespace:Bit.App.Controls"
x:Class="Bit.App.Controls.DateTimePicker" x:Class="Bit.App.Controls.DateTimePicker"

View File

@@ -1,6 +1,12 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using Xamarin.CommunityToolkit.UI.Views; using Microsoft.Maui.Controls;
using Xamarin.Forms; using Microsoft.Maui;
using CommunityToolkit.Maui.Converters;
using CommunityToolkit.Maui.ImageSources;
using CommunityToolkit.Maui;
using CommunityToolkit.Maui.Core;
using CommunityToolkit.Maui.Layouts;
using CommunityToolkit.Maui.Views;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {

View File

@@ -1,6 +1,7 @@
using System.Linq; using System.Linq;
using Xamarin.CommunityToolkit.Converters; using CommunityToolkit.Maui.Converters;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {

View File

@@ -1,5 +1,6 @@
using System; using System;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {

View File

@@ -1,4 +1,5 @@
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {

View File

@@ -1,5 +1,7 @@
using Bit.App.Utilities; using Bit.App.Utilities;
using Xamarin.Forms; using Microsoft.Maui.Graphics;
using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {
@@ -7,6 +9,7 @@ namespace Bit.App.Controls
{ {
public ExtendedSearchBar() public ExtendedSearchBar()
{ {
// TODO Xamarin.Forms.Device.RuntimePlatform is no longer supported. Use Microsoft.Maui.Devices.DeviceInfo.Platform instead. For more details see https://learn.microsoft.com/en-us/dotnet/maui/migration/forms-projects#device-changes
if (Device.RuntimePlatform == Device.iOS) if (Device.RuntimePlatform == Device.iOS)
{ {
if (ThemeManager.UsingLightTheme) if (ThemeManager.UsingLightTheme)

View File

@@ -1,11 +1,12 @@
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {
public class ExtendedSlider : Slider public class ExtendedSlider : Slider
{ {
public static readonly BindableProperty ThumbBorderColorProperty = BindableProperty.Create( public static readonly BindableProperty ThumbBorderColorProperty = BindableProperty.Create(
nameof(ThumbBorderColor), typeof(Color), typeof(ExtendedSlider), Color.FromHex("b5b5b5")); nameof(ThumbBorderColor), typeof(Color), typeof(ExtendedSlider), Color.FromArgb("b5b5b5"));
public Color ThumbBorderColor public Color ThumbBorderColor
{ {

View File

@@ -1,4 +1,5 @@
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {

View File

@@ -1,14 +1,16 @@
using Xamarin.Forms; using Microsoft.Maui.Graphics;
using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {
public class ExtendedStepper : Stepper public class ExtendedStepper : Stepper
{ {
public static readonly BindableProperty StepperBackgroundColorProperty = BindableProperty.Create( public static readonly BindableProperty StepperBackgroundColorProperty = BindableProperty.Create(
nameof(StepperBackgroundColor), typeof(Color), typeof(ExtendedStepper), Color.White); nameof(StepperBackgroundColor), typeof(Color), typeof(ExtendedStepper), Colors.White);
public static readonly BindableProperty StepperForegroundColorProperty = BindableProperty.Create( public static readonly BindableProperty StepperForegroundColorProperty = BindableProperty.Create(
nameof(StepperForegroundColor), typeof(Color), typeof(ExtendedStepper), Color.Black); nameof(StepperForegroundColor), typeof(Color), typeof(ExtendedStepper), Colors.Black);
public Color StepperBackgroundColor public Color StepperBackgroundColor
{ {

View File

@@ -1,5 +1,6 @@
using System; using System;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {

View File

@@ -1,5 +1,6 @@
using System; using System;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {

View File

@@ -1,29 +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:controls="clr-namespace:Bit.App.Controls"
x:Class="Bit.App.Controls.ExternalLinkItemView"
xmlns:core="clr-namespace:Bit.Core;assembly=BitwardenCore"
x:Name="_contentView">
<ContentView.GestureRecognizers>
<TapGestureRecognizer Command="{Binding GoToLinkCommand, Mode=OneWay, Source={x:Reference _contentView}}" />
</ContentView.GestureRecognizers>
<StackLayout
Orientation="Horizontal">
<controls:CustomLabel
Text="{Binding Title, Mode=OneWay, Source={x:Reference _contentView}}"
HorizontalOptions="StartAndExpand"
LineBreakMode="TailTruncation" />
<controls:IconLabel
Text="{Binding Source={x:Static core:BitwardenIcons.ShareSquare}}"
TextColor="{DynamicResource TextColor}"
HorizontalOptions="End"
VerticalOptions="Center"
AutomationProperties.IsInAccessibleTree="True"
AutomationProperties.Name="{Binding Title, Mode=OneWay, Source={x:Reference _contentView}}" />
</StackLayout>
</ContentView>

View File

@@ -1,31 +0,0 @@
using System.Windows.Input;
using Xamarin.Forms;
namespace Bit.App.Controls
{
public partial class ExternalLinkItemView : ContentView
{
public static readonly BindableProperty TitleProperty = BindableProperty.Create(
nameof(Title), typeof(string), typeof(ExternalLinkItemView), null, BindingMode.OneWay);
public static readonly BindableProperty GoToLinkCommandProperty = BindableProperty.Create(
nameof(GoToLinkCommand), typeof(ICommand), typeof(ExternalLinkItemView));
public ExternalLinkItemView()
{
InitializeComponent();
}
public string Title
{
get { return (string)GetValue(TitleProperty); }
set { SetValue(TitleProperty, value); }
}
public ICommand GoToLinkCommand
{
get => GetValue(GoToLinkCommandProperty) as ICommand;
set => SetValue(GoToLinkCommandProperty, value);
}
}
}

View File

@@ -1,5 +1,6 @@
using System; using System;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {

View File

@@ -1,5 +1,6 @@
using Bit.App.Effects; using Bit.App.Effects;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {
@@ -8,6 +9,7 @@ namespace Bit.App.Controls
public IconButton() public IconButton()
{ {
Padding = 0; Padding = 0;
// TODO Xamarin.Forms.Device.RuntimePlatform is no longer supported. Use Microsoft.Maui.Devices.DeviceInfo.Platform instead. For more details see https://learn.microsoft.com/en-us/dotnet/maui/migration/forms-projects#device-changes
switch (Device.RuntimePlatform) switch (Device.RuntimePlatform)
{ {
case Device.iOS: case Device.iOS:

View File

@@ -1,5 +1,6 @@
using Bit.App.Effects; using Bit.App.Effects;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {
@@ -9,6 +10,7 @@ namespace Bit.App.Controls
public IconLabel() public IconLabel()
{ {
// TODO Xamarin.Forms.Device.RuntimePlatform is no longer supported. Use Microsoft.Maui.Devices.DeviceInfo.Platform instead. For more details see https://learn.microsoft.com/en-us/dotnet/maui/migration/forms-projects#device-changes
switch (Device.RuntimePlatform) switch (Device.RuntimePlatform)
{ {
case Device.iOS: case Device.iOS:

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Frame xmlns="http://xamarin.com/schemas/2014/forms" <Frame xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Bit.App.Controls.IconLabelButton" x:Class="Bit.App.Controls.IconLabelButton"
xmlns:controls="clr-namespace:Bit.App.Controls" xmlns:controls="clr-namespace:Bit.App.Controls"

View File

@@ -5,8 +5,10 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Input; using System.Windows.Input;
using Bit.Core.Models.Domain; using Bit.Core.Models.Domain;
using Xamarin.Forms; using Microsoft.Maui.Controls.Xaml;
using Xamarin.Forms.Xaml; using Microsoft.Maui.Graphics;
using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {
@@ -22,13 +24,13 @@ namespace Bit.App.Controls
nameof(ButtonCommand), typeof(ICommand), typeof(IconLabelButton)); nameof(ButtonCommand), typeof(ICommand), typeof(IconLabelButton));
public static readonly BindableProperty IconLabelColorProperty = BindableProperty.Create( public static readonly BindableProperty IconLabelColorProperty = BindableProperty.Create(
nameof(IconLabelColor), typeof(Color), typeof(IconLabelButton), Color.White); nameof(IconLabelColor), typeof(Color), typeof(IconLabelButton), Colors.White);
public static readonly BindableProperty IconLabelBackgroundColorProperty = BindableProperty.Create( public static readonly BindableProperty IconLabelBackgroundColorProperty = BindableProperty.Create(
nameof(IconLabelBackgroundColor), typeof(Color), typeof(IconLabelButton), Color.White); nameof(IconLabelBackgroundColor), typeof(Color), typeof(IconLabelButton), Colors.White);
public static readonly BindableProperty IconLabelBorderColorProperty = BindableProperty.Create( public static readonly BindableProperty IconLabelBorderColorProperty = BindableProperty.Create(
nameof(IconLabelBorderColor), typeof(Color), typeof(IconLabelButton), Color.White); nameof(IconLabelBorderColor), typeof(Color), typeof(IconLabelButton), Colors.White);
public IconLabelButton() public IconLabelButton()
{ {

View File

@@ -1,4 +1,5 @@
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {
@@ -7,6 +8,7 @@ namespace Bit.App.Controls
public MiButton() public MiButton()
{ {
Padding = 0; Padding = 0;
// TODO Xamarin.Forms.Device.RuntimePlatform is no longer supported. Use Microsoft.Maui.Devices.DeviceInfo.Platform instead. For more details see https://learn.microsoft.com/en-us/dotnet/maui/migration/forms-projects#device-changes
switch (Device.RuntimePlatform) switch (Device.RuntimePlatform)
{ {
case Device.iOS: case Device.iOS:

View File

@@ -1,4 +1,5 @@
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {
@@ -6,6 +7,7 @@ namespace Bit.App.Controls
{ {
public MiLabel() public MiLabel()
{ {
// TODO Xamarin.Forms.Device.RuntimePlatform is no longer supported. Use Microsoft.Maui.Devices.DeviceInfo.Platform instead. For more details see https://learn.microsoft.com/en-us/dotnet/maui/migration/forms-projects#device-changes
switch (Device.RuntimePlatform) switch (Device.RuntimePlatform)
{ {
case Device.iOS: case Device.iOS:

View File

@@ -1,4 +1,5 @@
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {
@@ -6,6 +7,7 @@ namespace Bit.App.Controls
{ {
public MonoEntry() public MonoEntry()
{ {
// TODO Xamarin.Forms.Device.RuntimePlatform is no longer supported. Use Microsoft.Maui.Devices.DeviceInfo.Platform instead. For more details see https://learn.microsoft.com/en-us/dotnet/maui/migration/forms-projects#device-changes
switch (Device.RuntimePlatform) switch (Device.RuntimePlatform)
{ {
case Device.iOS: case Device.iOS:

View File

@@ -1,4 +1,5 @@
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {
@@ -6,6 +7,7 @@ namespace Bit.App.Controls
{ {
public MonoLabel() public MonoLabel()
{ {
// TODO Xamarin.Forms.Device.RuntimePlatform is no longer supported. Use Microsoft.Maui.Devices.DeviceInfo.Platform instead. For more details see https://learn.microsoft.com/en-us/dotnet/maui/migration/forms-projects#device-changes
switch (Device.RuntimePlatform) switch (Device.RuntimePlatform)
{ {
case Device.iOS: case Device.iOS:

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<StackLayout <StackLayout
xmlns="http://xamarin.com/schemas/2014/forms" xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
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"

View File

@@ -1,5 +1,7 @@
using System; using System;
using Xamarin.Forms; using Microsoft.Maui.Graphics;
using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {
@@ -100,7 +102,7 @@ namespace Bit.App.Controls
case Controls.PasswordStrengthLevel.Strong: case Controls.PasswordStrengthLevel.Strong:
return StrongColor; return StrongColor;
default: default:
return Color.Transparent; return Colors.Transparent;
} }
} }
} }

View File

@@ -1,7 +1,8 @@
using System.Collections.Generic; using System.Collections.Generic;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {

View File

@@ -1,7 +1,8 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Specialized; using System.Collections.Specialized;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {

View File

@@ -1,5 +1,6 @@
using System; using System;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<controls:ExtendedGrid xmlns="http://xamarin.com/schemas/2014/forms" <controls:ExtendedGrid xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
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"

View File

@@ -2,7 +2,8 @@
using Bit.App.Abstractions; using Bit.App.Abstractions;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Controls namespace Bit.App.Controls
{ {

View File

@@ -1,27 +0,0 @@
using System.Runtime.CompilerServices;
using Bit.App.Utilities;
using Xamarin.Forms;
namespace Bit.App.Controls
{
public class BaseSettingItemView : ContentView
{
public static readonly BindableProperty TitleProperty = BindableProperty.Create(
nameof(Title), typeof(string), typeof(SwitchItemView), null);
public static readonly BindableProperty SubtitleProperty = BindableProperty.Create(
nameof(Subtitle), typeof(string), typeof(SwitchItemView), null);
public string Title
{
get { return (string)GetValue(TitleProperty); }
set { SetValue(TitleProperty, value); }
}
public string Subtitle
{
get { return (string)GetValue(SubtitleProperty); }
set { SetValue(SubtitleProperty, value); }
}
}
}

View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<controls:BaseSettingItemView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:controls="clr-namespace:Bit.App.Controls"
x:Class="Bit.App.Controls.SettingChooserItemView"
x:Name="_contentView"
ControlTemplate="{StaticResource SettingControlTemplate}">
<controls:BaseSettingItemView.GestureRecognizers>
<TapGestureRecognizer Command="{Binding ChooseCommand, Mode=OneWay, Source={x:Reference _contentView}}" />
</controls:BaseSettingItemView.GestureRecognizers>
<controls:CustomLabel
Text="{Binding DisplayValue, Source={x:Reference _contentView}}"
HorizontalTextAlignment="End"
TextColor="{DynamicResource MutedColor}"
StyleClass="list-sub" />
</controls:BaseSettingItemView>

View File

@@ -1,31 +0,0 @@
using System.Windows.Input;
using Xamarin.Forms;
namespace Bit.App.Controls
{
public partial class SettingChooserItemView : BaseSettingItemView
{
public static readonly BindableProperty DisplayValueProperty = BindableProperty.Create(
nameof(DisplayValue), typeof(string), typeof(SettingChooserItemView), null);
public static readonly BindableProperty ChooseCommandProperty = BindableProperty.Create(
nameof(ChooseCommand), typeof(ICommand), typeof(ExternalLinkItemView));
public string DisplayValue
{
get { return (string)GetValue(DisplayValueProperty); }
set { SetValue(DisplayValueProperty, value); }
}
public SettingChooserItemView()
{
InitializeComponent();
}
public ICommand ChooseCommand
{
get => GetValue(ChooseCommandProperty) as ICommand;
set => SetValue(ChooseCommandProperty, value);
}
}
}

View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<controls:BaseSettingItemView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:controls="clr-namespace:Bit.App.Controls"
x:Class="Bit.App.Controls.SwitchItemView"
x:Name="_contentView"
ControlTemplate="{StaticResource SettingControlTemplate}">
<controls:BaseSettingItemView.GestureRecognizers>
<TapGestureRecognizer Tapped="ContentView_Tapped" />
</controls:BaseSettingItemView.GestureRecognizers>
<Switch
x:Name="_switch"
HeightRequest="20"
Scale="{OnPlatform iOS=0.8, Android=1}"
IsToggled="{Binding IsToggled, Mode=TwoWay, Source={x:Reference _contentView}}"
AutomationId="{Binding SwitchAutomationId, Mode=OneWay, Source={x:Reference _contentView}}"/>
</controls:BaseSettingItemView>

View File

@@ -1,45 +0,0 @@
using System.Windows.Input;
using Xamarin.Forms;
namespace Bit.App.Controls
{
public partial class SwitchItemView : BaseSettingItemView
{
public static readonly BindableProperty IsToggledProperty = BindableProperty.Create(
nameof(IsToggled), typeof(bool), typeof(SwitchItemView), null, BindingMode.TwoWay);
public static readonly BindableProperty SwitchAutomationIdProperty = BindableProperty.Create(
nameof(SwitchAutomationId), typeof(string), typeof(SwitchItemView), null, BindingMode.OneWay);
public static readonly BindableProperty ToggleSwitchCommandProperty = BindableProperty.Create(
nameof(ToggleSwitchCommand), typeof(ICommand), typeof(ExternalLinkItemView));
public SwitchItemView()
{
InitializeComponent();
}
public bool IsToggled
{
get { return (bool)GetValue(IsToggledProperty); }
set { SetValue(IsToggledProperty, value); }
}
public string SwitchAutomationId
{
get { return (string)GetValue(SwitchAutomationIdProperty); }
set { SetValue(SwitchAutomationIdProperty, value); }
}
public ICommand ToggleSwitchCommand
{
get => GetValue(ToggleSwitchCommandProperty) as ICommand;
set => SetValue(ToggleSwitchCommandProperty, value);
}
void ContentView_Tapped(System.Object sender, System.EventArgs e)
{
_switch.IsToggled = !_switch.IsToggled;
}
}
}

View File

@@ -1,4 +1,5 @@
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Effects namespace Bit.App.Effects
{ {

View File

@@ -1,4 +1,5 @@
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Effects namespace Bit.App.Effects
{ {

View File

@@ -1,5 +1,6 @@
using System; using System;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Effects namespace Bit.App.Effects
{ {

View File

@@ -1,5 +1,6 @@
using System; using System;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Effects namespace Bit.App.Effects
{ {

View File

@@ -1,4 +1,5 @@
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Effects namespace Bit.App.Effects
{ {

View File

@@ -1,4 +1,5 @@
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Effects namespace Bit.App.Effects
{ {

View File

@@ -1,4 +1,5 @@
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Effects namespace Bit.App.Effects
{ {

View File

@@ -1,5 +1,6 @@
using Bit.App.Lists.ItemViewModels.CustomFields; using Bit.App.Lists.ItemViewModels.CustomFields;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Lists.DataTemplateSelectors namespace Bit.App.Lists.DataTemplateSelectors
{ {

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<StackLayout <StackLayout
xmlns="http://xamarin.com/schemas/2014/forms" xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Bit.App.Lists.ItemLayouts.CustomFields.BooleanCustomFieldItemLayout" x:Class="Bit.App.Lists.ItemLayouts.CustomFields.BooleanCustomFieldItemLayout"
xmlns:u="clr-namespace:Bit.App.Utilities" xmlns:u="clr-namespace:Bit.App.Utilities"

View File

@@ -1,4 +1,5 @@
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Lists.ItemLayouts.CustomFields namespace Bit.App.Lists.ItemLayouts.CustomFields
{ {

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<StackLayout xmlns="http://xamarin.com/schemas/2014/forms" <StackLayout xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Bit.App.Lists.ItemLayouts.CustomFields.HiddenCustomFieldItemLayout" x:Class="Bit.App.Lists.ItemLayouts.CustomFields.HiddenCustomFieldItemLayout"
xmlns:controls="clr-namespace:Bit.App.Controls" xmlns:controls="clr-namespace:Bit.App.Controls"

View File

@@ -1,4 +1,5 @@
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Lists.ItemLayouts.CustomFields namespace Bit.App.Lists.ItemLayouts.CustomFields
{ {

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<StackLayout xmlns="http://xamarin.com/schemas/2014/forms" <StackLayout xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Bit.App.Lists.ItemLayouts.CustomFields.LinkedCustomFieldItemLayout" x:Class="Bit.App.Lists.ItemLayouts.CustomFields.LinkedCustomFieldItemLayout"
xmlns:controls="clr-namespace:Bit.App.Controls" xmlns:controls="clr-namespace:Bit.App.Controls"

View File

@@ -1,4 +1,5 @@
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Lists.ItemLayouts.CustomFields namespace Bit.App.Lists.ItemLayouts.CustomFields
{ {

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<StackLayout xmlns="http://xamarin.com/schemas/2014/forms" <StackLayout xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Bit.App.Lists.ItemLayouts.CustomFields.TextCustomFieldItemLayout" x:Class="Bit.App.Lists.ItemLayouts.CustomFields.TextCustomFieldItemLayout"
xmlns:controls="clr-namespace:Bit.App.Controls" xmlns:controls="clr-namespace:Bit.App.Controls"

View File

@@ -1,4 +1,5 @@
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Lists.ItemLayouts.CustomFields namespace Bit.App.Lists.ItemLayouts.CustomFields
{ {

View File

@@ -1,7 +1,8 @@
using System.Windows.Input; using System.Windows.Input;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Lists.ItemViewModels.CustomFields namespace Bit.App.Lists.ItemViewModels.CustomFields
{ {

View File

@@ -5,7 +5,8 @@ using Bit.App.Utilities;
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Xamarin.CommunityToolkit.ObjectModel; using Xamarin.CommunityToolkit.ObjectModel;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Lists.ItemViewModels.CustomFields namespace Bit.App.Lists.ItemViewModels.CustomFields
{ {

View File

@@ -1,6 +1,7 @@
using System.Windows.Input; using System.Windows.Input;
using Bit.Core.Models.View; using Bit.Core.Models.View;
using Xamarin.Forms; using Microsoft.Maui.Controls;
using Microsoft.Maui;
namespace Bit.App.Lists.ItemViewModels.CustomFields namespace Bit.App.Lists.ItemViewModels.CustomFields
{ {

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