Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Major update #61

Draft
wants to merge 69 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
9d49587
ci: Update GitHub workflows to use JDK 17
devinbileck Dec 23, 2023
0ba6af1
build: Update gradle version
devinbileck Dec 23, 2023
55553db
refactor: Move FirebaseMock to a separate testCommon module
devinbileck Dec 23, 2023
5da2040
build: Update to latest dependency versions
devinbileck Dec 23, 2023
d3be668
build: Bump compile, min, and target Android SDK versions
devinbileck Dec 23, 2023
7e1e19e
build: Cleanup gradle build files
devinbileck Dec 23, 2023
b171d9c
chore: Specify nuisance ktlint rules
devinbileck Dec 23, 2023
0b7ed3b
minor: UI improvements
devinbileck Dec 23, 2023
7c4893f
refactor: Code cleanup
devinbileck Dec 23, 2023
254f1a4
build: Update verification-metadata.xml
devinbileck Dec 23, 2023
e7f8584
fix: Reset device should preserve token and generate new key
devinbileck Dec 23, 2023
6d453bc
chore: Update logging
devinbileck Dec 23, 2023
9a67d0f
test: Update manual tests
devinbileck Dec 23, 2023
a21b96c
major: Add support for handling data-only push notification messages
devinbileck Jan 26, 2024
46b2ebf
fix: Update startActivity to prevent navigating back in various scena…
devinbileck Jan 26, 2024
a080592
chore: Remove unnecessary log entry
devinbileck Jan 26, 2024
f43ea8b
fix: Display simulate pairing button when device has been erased
devinbileck Jan 26, 2024
74abe45
fix: Resolve error message
devinbileck Jan 26, 2024
edd34f0
minor: Allow prompts to be dismissed by navigating back or clicking e…
devinbileck Jan 26, 2024
50e271f
fix: Correct send pairing token label and fix intent type
devinbileck Jan 26, 2024
f121be2
minor: Update message when unable to retrieve FCM token
devinbileck Jan 26, 2024
06cd04e
build: Bump dependencies
devinbileck Jan 26, 2024
bcacded
docs: Include details for updating Gradle verification metadata in RE…
devinbileck Jan 26, 2024
2609bc1
fix: Update pairing success image to reflect changed label
devinbileck Jan 26, 2024
74df7f2
build: Update how GoogleServices tasks are disabled for GitHub workflows
devinbileck Jan 27, 2024
c4e6fea
build: Bump dependencies
devinbileck Jan 27, 2024
0d9bc14
build: Update Gradle verification metadata and dependency locks
devinbileck Jan 27, 2024
4552053
docs: Include info about updating gradle.lockfile in README
devinbileck Jan 27, 2024
9c8f042
fix: Action bar menu text color in dark mode
devinbileck Jan 27, 2024
32459c2
build: Update verification-metadata again
devinbileck Jan 27, 2024
24b847f
docs: Resize images in README
devinbileck Jan 27, 2024
80194f0
docs: Update dependency instructions in README
devinbileck Jan 27, 2024
1760af2
ci: Updated ci workflow for running instrumentation tests on ubuntu
devinbileck Jan 28, 2024
e0c7b50
fix: Resolve SecurityException when running on Android 14 or higher
devinbileck Jan 28, 2024
6f7ac78
ci: Try running instrumentation tests in CI on all API levels
devinbileck Jan 28, 2024
63edf2e
chore: Minor code cleanup
devinbileck Jan 28, 2024
4f0ec06
build: Bump dependencies to resolve failing instrumentation tests in …
devinbileck Jan 29, 2024
5bf349b
build: Exclude META-INF
devinbileck Jan 29, 2024
91b0d78
build: Update verification-metadata.xml
devinbileck Jan 29, 2024
f5bc2b6
build: Bump dependencies
devinbileck Jan 31, 2024
ffb1479
build: Switch kapt with ksp
devinbileck Jan 31, 2024
973cf01
build: Update verification-metadata.xml
devinbileck Jan 31, 2024
7be3e85
build: Exclude META-INF/* resources in testCommon
devinbileck Jan 31, 2024
726d0fb
build: Cleanup Gradle files
devinbileck Jan 31, 2024
ad15269
docs: Add note to README
devinbileck Jan 31, 2024
e9e034d
ci: Update sign-android-release action to use latest build-tools version
devinbileck Feb 1, 2024
9e55788
ci: Prevent in-progess instrumentation test jobs from being cancelled
devinbileck Feb 1, 2024
bc3cc59
ci: Misc GitHub actions cleanup
devinbileck Feb 1, 2024
9144442
test: Cleanup tests and utilize assertj to provide meaningful errors
devinbileck Feb 1, 2024
1bfaeae
fix: Replace notification icon
devinbileck Feb 1, 2024
9dc9096
ci: Update report artifact names to prevent failure due to conflicts
devinbileck Feb 1, 2024
0b486a3
ci: Minor cleanup
devinbileck Feb 1, 2024
6b3a5b0
chore: Replace deprecated set-output command
devinbileck Feb 1, 2024
493106b
tests: Capture screenshot on failed tests and embed in test report
devinbileck Feb 9, 2024
f854f5e
chore: Bump dependencies
devinbileck Feb 9, 2024
b530e4b
chore: Eliminate buildType variable from build.gradle
devinbileck Feb 9, 2024
bdfb664
ci: Fix failing instrumentation tests in CI
devinbileck Feb 9, 2024
238608b
ci: Disable animations
devinbileck Feb 9, 2024
b21caed
chore: Minor cleanup
devinbileck Feb 9, 2024
9615a7f
chore: Bump dependencies
devinbileck Feb 9, 2024
ad6450c
ci: Utilize ATD system images available in API 30+
devinbileck Feb 10, 2024
8cef192
ci: Remove channel and update arch for google_atd system images
devinbileck Feb 10, 2024
b9b4cce
ci: API 34 does not yet provide a google_atd system image
devinbileck Feb 10, 2024
d026998
tests: Fix PermissionPrompt button selectors
devinbileck Feb 10, 2024
25fd775
ci: Tweak AVD target
devinbileck Feb 10, 2024
9e1d935
fix: Improve layout on smaller screens
devinbileck Feb 10, 2024
b381755
ci: Remove failing API level for instrumentation tests
devinbileck Feb 11, 2024
3656136
ci: Cleanup comments
devinbileck Feb 11, 2024
8c7039c
ci: Reduce instrumentation tests timeout
devinbileck Feb 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@ insert_final_newline = true
[.idea/codeStyles/*.xml]
indent_size = 2
insert_final_newline = false

[*.{kt,kts}]
max_line_length = 120
ktlint_code_style = android_studio
ktlint_standard_import-ordering = disabled
ktlint_class_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = unset
ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = unset
ktlint_standard_trailing-comma-on-call-site = disabled
ktlint_standard_trailing-comma-on-declaration-site = disabled
ktlint_standard_function-signature = disabled
19 changes: 12 additions & 7 deletions .github/actions/get-avd-info/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,23 @@ inputs:
description: The API level for which to retrieve AVD info
required: true
outputs:
arch:
description: CPU architecture of the system image
value: ${{ steps.get-avd-arch.outputs.arch }}
target:
description: Target of the system image
value: ${{ steps.get-avd-target.outputs.target }}
arch:
description: CPU architecture of the system image
value: ${{ steps.get-avd-arch.outputs.arch }}
runs:
using: "composite"
steps:
- id: get-avd-arch
run: echo "::set-output name=arch::$(if [ ${{ inputs.api-level }} -ge 30 ]; then echo x86_64; else echo x86; fi)"
shell: bash
# Prefer ATD system images available in API 30+ as they are optimized for headless tests.
# Google Play services is required and is available in the google_atd and google_apis images.
# Note, API 27 does not provide a google_apis system image and API 34 does not yet provide a
# google_atd system image.
- id: get-avd-target
run: echo "::set-output name=target::$(if [ ${{ inputs.api-level }} -ge 32 ]; then echo google_apis; else echo default; fi)"
run: echo "target=$(if [ ${{ inputs.api-level }} -eq 34 ]; then echo google_apis; elif [ ${{ inputs.api-level }} -eq 27 ]; then echo default; elif [ ${{ inputs.api-level }} -ge 30 ]; then echo google_atd; else echo google_apis; fi)" >> $GITHUB_OUTPUT
shell: bash
# Prefer x86_64 architecture
- id: get-avd-arch
run: echo "arch=x86_64" >> $GITHUB_OUTPUT
shell: bash
51 changes: 28 additions & 23 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
- name: Checkout the code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93
with:
java-version: '11'
distribution: 'temurin'
java-version: '17'
distribution: 'corretto'
cache: gradle

- name: Clear gradle cache
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
- name: Upload reports
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8
with:
name: Test-Reports
name: analyze-reports
path: app/build/reports
if: always()

Expand All @@ -76,11 +76,11 @@ jobs:
- name: Checkout the code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93
with:
java-version: '11'
distribution: 'temurin'
java-version: '17'
distribution: 'corretto'
cache: gradle

- name: Clear gradle cache
Expand All @@ -106,28 +106,28 @@ jobs:
- name: Upload reports
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8
with:
name: Test-Reports
name: unit-tests-reports
path: app/build/reports
if: always()

instrumentation-tests:
name: Instrumentation tests on ${{ matrix.target }} API ${{ matrix.api-level }}
runs-on: macos-latest
timeout-minutes: 30
name: Instrumentation tests on API ${{ matrix.api-level }}
runs-on: ubuntu-latest
timeout-minutes: 15
needs: unit-tests
strategy:
fail-fast: true
fail-fast: false
matrix:
api-level: [ 21, 32 ]
api-level: [ 26, 27, 28, 29, 31, 32, 33, 34 ]
steps:
- name: Checkout the code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93
with:
java-version: '11'
distribution: 'temurin'
java-version: '17'
distribution: 'corretto'
cache: gradle

- name: Clear gradle cache
Expand All @@ -145,7 +145,12 @@ jobs:
- name: Check Gradle wrapper
uses: gradle/wrapper-validation-action@27152f6fa06a6b8062ef7195c795692e51fc2c81

# API 30+ emulators only have x86_64 system images
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm

- name: Get AVD info
uses: ./.github/actions/get-avd-info
id: avd-info
Expand All @@ -168,9 +173,9 @@ jobs:
uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ steps.avd-info.outputs.arch }}
target: ${{ steps.avd-info.outputs.target }}
disable-animations: false
arch: ${{ steps.avd-info.outputs.arch }}
disable-animations: true
force-avd-creation: false
ram-size: 4096M
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
Expand All @@ -180,17 +185,17 @@ jobs:
uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2
with:
api-level: ${{ matrix.api-level }}
arch: ${{ steps.avd-info.outputs.arch }}
target: ${{ steps.avd-info.outputs.target }}
arch: ${{ steps.avd-info.outputs.arch }}
disable-animations: true
force-avd-creation: false
ram-size: 4096M
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-snapshot-save
script: mv .github/debug.keystore ~/.android; ./gradlew connectedDebugAndroidTest
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
script: ./gradlew connectedCheck

- name: Upload reports
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8
with:
name: Test-Reports
name: instrumentation-tests-reports-api${{ matrix.api-level }}
path: app/build/reports
if: always()
17 changes: 14 additions & 3 deletions .github/workflows/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ jobs:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $GOOGLE_SERVICES_JSON > app/google-services.json

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93
with:
java-version: '11'
distribution: 'temurin'
java-version: '17'
distribution: 'corretto'
cache: gradle

- name: Clear gradle cache
Expand Down Expand Up @@ -98,6 +98,13 @@ jobs:
name: bisq-release.aab
path: app/build/outputs/bundle/release

- name: Determine latest build-tools version
shell: bash
run: |
LATEST_BUILD_TOOLS_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1)
echo "LATEST_BUILD_TOOLS_VERSION=$LATEST_BUILD_TOOLS_VERSION" >> $GITHUB_ENV
echo Latest build tools version is: $LATEST_BUILD_TOOLS_VERSION

- name: Sign APK
uses: r0adkll/sign-android-release@dbeba6b98a60b0fd540c02443c7f428cdedf0e7f
id: sign_apk
Expand All @@ -107,6 +114,8 @@ jobs:
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: ${{ env.LATEST_BUILD_TOOLS_VERSION }}

- name: Sign AAB
uses: r0adkll/sign-android-release@dbeba6b98a60b0fd540c02443c7f428cdedf0e7f
Expand All @@ -117,6 +126,8 @@ jobs:
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: ${{ env.LATEST_BUILD_TOOLS_VERSION }}

- name: Upload signed APK
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: Read VERSION file
id: get_version
run: echo "::set-output name=version::$(cat VERSION/VERSION)"
run: echo "version=$(cat VERSION/VERSION)" >> $GITHUB_OUTPUT

- name: Create release
id: create_release
Expand Down
40 changes: 32 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,46 @@
# Bisq Notification Android App

Since Bisq is a desktop-based application, this Android app enables you to pair it with your desktop
application and receive important notifications such as trade updates and offer alerts when you are
not near your computer.

## How to Run
In order to pair the app and receive notifications, you will need to create your own
## Prerequisites

In order to pair the app and receive notifications, you will need to obtain an appropriate
`google-services.json` file and place it under the app/ directory. Refer to
[firebase documentation](https://firebase.google.com/docs/android/setup#add-config-file)
for more information.

> Note, the `google-services.json` file needs to correspond to the `fcmServiceAccountKey.json`
> used by the [bisq-relay](https://github.com/bisq-network/bisq-relay) service.

## Updating Dependencies

Whenever dependencies are updated/changed, it is necessary to update the following:

- [gradle/verification-metadata.xml](gradle/verification-metadata.xml) - can be updated using the
following command:

```shell
./gradlew --write-verification-metadata sha256 build :app:processDebugResources :app:connectedDebugAndroidTest
```

- [gradle.lockfile](gradle.lockfile) - can be updated using the following command:

```shell
./gradlew dependencies --write-locks
```

## Architectural Design

For information on the architectural design, refer to the
[Bisq Remote Specification](https://github.com/bisq-network/bisqremote/wiki/Specification).

## Screenshots
![Welcome](images/welcome.png)
![Scan Pairing Code](images/scan_pairing_code.png)
![Pairing Success](images/pairing_success.png)
![Notification List](images/notification_list.png)
![Offer Taken Details](images/offer_taken_details.png)
![Settings](images/settings.png)

<img alt="Welcome" src="images/welcome.png" width=40% height=40%>
<img alt="Scan Pairing Code" src="images/scan_pairing_code.png" width=40% height=40%>
<img alt="Pairing Success" src="images/pairing_success.png" width=40% height=40%>
<img alt="Notification List" src="images/notification_list.png" width=40% height=40%>
<img alt="Offer Taken Details" src="images/offer_taken_details.png" width=40% height=40%>
<img alt="Settings" src="images/settings.png" width=40% height=40%>
Loading