Files
pezkuwi-wallet-android/.github/workflows/code-quality.yml
T
SatoshiQaziMuhammed cf74df7cf4 Ship third-party licences and point to the exact source of each build (#36)
* Ship third-party licences and point to the exact source of each build

The light client links smoldot (GPL-3.0-or-later WITH Classpath-exception-2.0), and the app
shipped no third-party notices at all. Releases are not tagged, so nothing told a user which
source a given APK was built from.

- Settings > About gets an "Open source licenses" row. It opens the licences page with the commit
  the build was made from (BuildConfig.LICENCES_URL, from git rev-parse HEAD).
- assets/licences/rust-crates.txt lists the 430 Rust crates linked into the four native libraries,
  with their licence texts. scripts/licences/rust_notices.py writes it from the lockfiles, and a
  Code Quality job fails when it is stale.
- assets/licences/native-libraries.txt covers the prebuilt libsqlcipher.so and libsr25519java.so.
- The licensee plugin bundles the Android library list into the APK and fails the build on a
  licence outside the allowed set.
- NOTICE names the Pezkuwi Wallet copyright and where these notices live.

* Check Android library licences in Code Quality and keep the report

The build job fails on a disallowed licence but does not say which library, and its workflow is
taken from main. This job runs only the licence check on the PR branch and uploads the report
naming each library and its licence.

* Replace the GPL-3.0 NovaCrypto libraries and allow the reviewed licences

substrate-sdk-android brings in NovaCrypto BIP39, Sha256, ToRuntime and SecureString, all
GPL-3.0 without exception, which made the APK a GPL-3.0 combined work alongside Google's
proprietary SDKs. The SDK uses four of their types, only in MnemonicCreator and EnglishWordList.
common now provides those types under Apache-2.0 with the binary interface the SDK is compiled
against (taken from its bytecode), and every configuration excludes the NovaCrypto groups.

Bip39VectorsTest runs the SDK's MnemonicCreator on them against all 24 English BIP-0039 vectors,
both directions, plus a round trip of each random mnemonic length. Checked outside Gradle against
the SDK 2.11.0 classes: 24/24, and red when the checksum is broken.

The licence policy now names each remaining library licensee rejected: permissive licences
declared by URL, POMs without a licence (checked against each project's repository), Google's
SDK terms for the Play build, and the EPL libraries one by one.
2026-11-05 21:25:30 +04:00

94 lines
2.8 KiB
YAML

name: Code Quality
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: code-quality-${{ github.ref }}
cancel-in-progress: true
env:
ACALA_PROD_AUTH_TOKEN: ${{ secrets.ACALA_PROD_AUTH_TOKEN }}
ACALA_TEST_AUTH_TOKEN: ${{ secrets.ACALA_TEST_AUTH_TOKEN }}
MOONBEAM_PROD_AUTH_TOKEN: ${{ secrets.MOONBEAM_PROD_AUTH_TOKEN }}
MOONBEAM_TEST_AUTH_TOKEN: ${{ secrets.MOONBEAM_TEST_AUTH_TOKEN }}
MOONPAY_PRODUCTION_SECRET: ${{ secrets.MOONPAY_PRODUCTION_SECRET }}
MOONPAY_TEST_SECRET: ${{ secrets.MOONPAY_TEST_SECRET }}
MERCURYO_PRODUCTION_SECRET: ${{ secrets.MERCURYO_PRODUCTION_SECRET }}
MERCURYO_TEST_SECRET: ${{ secrets.MERCURYO_TEST_SECRET }}
EHTERSCAN_API_KEY_MOONBEAM: ${{ secrets.EHTERSCAN_API_KEY_MOONBEAM }}
EHTERSCAN_API_KEY_MOONRIVER: ${{ secrets.EHTERSCAN_API_KEY_MOONRIVER }}
EHTERSCAN_API_KEY_ETHEREUM: ${{ secrets.EHTERSCAN_API_KEY_ETHEREUM }}
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}
DWELLIR_API_KEY: ${{ secrets.DWELLIR_API_KEY }}
TRONGRID_API_KEY: ${{ secrets.TRONGRID_API_KEY }}
WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
DEBUG_GOOGLE_OAUTH_ID: ${{ secrets.DEBUG_GOOGLE_OAUTH_ID }}
RELEASE_GOOGLE_OAUTH_ID: ${{ secrets.RELEASE_GOOGLE_OAUTH_ID }}
permissions:
contents: read
jobs:
ktlint:
name: Kotlin Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/workflows/install/
- name: Run ktlint
run: ./gradlew ktlint
- name: Upload ktlint report
if: always()
uses: actions/upload-artifact@v4
with:
name: ktlint-report
path: build/reports/checkstyle/ktlint.xml
if-no-files-found: ignore
rust-notices:
name: Rust Licence Notices
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# The notices ship inside the APK; a crate added, removed or upgraded without them would
# ship without its licence.
- name: Notices match the lockfiles
run: python3 scripts/licences/rust_notices.py --check
android-licences:
name: Android Licences
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
uses: ./.github/workflows/install/
# Resolves the Play build's dependencies and checks each library's licence against the
# allowed set in app/build.gradle, without compiling anything.
- name: Licences of the Play build's libraries
run: ./gradlew :app:licenseeAndroidReleaseMarket
- name: Upload licence report
if: always()
uses: actions/upload-artifact@v4
with:
name: licensee-report
path: app/build/reports/licensee/
if-no-files-found: ignore