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.
This commit is contained in:
SatoshiQaziMuhammed authored and GitHub committed 2026-11-05 21:25:30 +04:00
1 parent 5c13c84eca
commit cf74df7cf4
27 files changed
+18831

No files matched your search

+49
View File
@@ -2,6 +2,7 @@ apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-parcelize'
apply plugin: 'com.google.firebase.appdistribution'
apply plugin: "com.github.triplet.play"
apply plugin: 'app.cash.licensee'
apply from: "../scripts/versions.gradle"
apply from: "../scripts/secrets.gradle"
@@ -341,6 +342,54 @@ dependencies {
androidTestImplementation allureKotlinAndroid
}
// Every Android library the app ships is listed, with its licence, in the APK itself; a dependency
// under a licence not allowed here fails the build. The Rust crates and the prebuilt native
// libraries are listed beside it (assets/licences, scripts/licences/rust_notices.py).
licensee {
allow('Apache-2.0')
allow('MIT')
allow('BSD-2-Clause')
allow('BSD-3-Clause')
allow('ISC')
allow('CC0-1.0')
allowUrl('https://www.zetetic.net/sqlcipher/license/') {
because 'SQLCipher Community Edition, a BSD-style licence'
}
// Permissive licences their POMs name by a URL licensee does not map to an SPDX id.
allowUrl('http://opensource.org/licenses/BSD-2-Clause') { because 'BSD-2-Clause' }
allowUrl('https://spdx.org/licenses/MIT.txt') { because 'MIT' }
allowUrl('http://www.bouncycastle.org/licence.html') { because 'Bouncy Castle licence, MIT-style' }
allowUrl('https://www.bouncycastle.org/licence.html') { because 'Bouncy Castle licence, MIT-style' }
allowUrl('https://asm.ow2.io/license.html') { because 'ASM licence, BSD-3-Clause' }
allowUrl('https://github.com/facebook/shimmer-android/blob/master/LICENSE') { because 'BSD licence' }
allowUrl('https://github.com/multiformats/java-multiaddr/blob/master/LICENSE') { because 'MIT' }
allowUrl('https://github.com/journeyapps/zxing-android-embedded/blob/master/COPYING') { because 'Apache-2.0' }
allowUrl('https://github.com/TooTallNate/Java-WebSocket/blob/master/LICENSE') { because 'MIT' }
// Google's SDKs in the Play build, under Google's terms. The build without Google services (D22) drops them.
allowUrl('https://developer.android.com/studio/terms.html') { because 'Google Play services and Firebase' }
allowUrl('https://developer.android.com/guide/playcore/license') { because 'Google Play Core' }
allowUrl('https://developer.android.com/google/play/integrity/overview#tos') { because 'Google Play Integrity' }
// POMs that declare no licence or none licensee can read; the licence is the one in the project's repository.
allowDependency('io.coil-kt', 'coil', '1.2.1') { because 'Apache-2.0, named without a URL' }
allowDependency('io.coil-kt', 'coil-base', '1.2.1') { because 'Apache-2.0, named without a URL' }
allowDependency('io.coil-kt', 'coil-svg', '1.2.1') { because 'Apache-2.0, named without a URL' }
allowDependency('com.github.PhilJay', 'MPAndroidChart', 'v3.1.0') { because 'Apache-2.0' }
allowDependency('com.github.florent37', 'RuntimePermission', '1.1.2') { because 'Apache-2.0' }
allowDependency('com.github.komputing', 'khex', '1.1.2') { because 'MIT' }
['bip32', 'bip39', 'bip39_wordlist_en', 'crypto', 'crypto_api', 'crypto_impl_java_provider',
'crypto_impl_spongycastle', 'extensions_kotlin', 'keccak_shortcut', 'model'].each { module ->
allowDependency('com.github.komputing.kethereum', module, '0.85.7') { because 'MIT' }
}
// Eclipse Public Licence, taken one library at a time: a weak copyleft whose source obligation
// covers changes to the library itself, which we do not make.
allowDependency('junit', 'junit', '4.13.2') { because 'EPL-1.0' }
allowDependency('org.eclipse.birt.runtime.3_7_1', 'org.apache.xerces', '2.9.0') { because 'EPL-1.0' }
allowDependency('com.github.jnr', 'jnr-posix', '3.1.15') { because 'EPL-2.0, GPL-2.0 or LGPL-2.1: used under EPL-2.0' }
allowDependency('jakarta.ws.rs', 'jakarta.ws.rs-api', '3.1.0') { because 'EPL-2.0 or GPL-2.0 with Classpath exception: used under EPL-2.0' }
bundleAndroidAsset = true
androidAssetReportPath = 'licences/android-libraries.json'
}
task printVersion {
doLast {
println "versionName:${computeVersionName()}"