mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-11-20 01:26:11 +00:00
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:
1 parent
5c13c84eca
commit
cf74df7cf4
27 files changed
+18831
No files matched your search
@@ -54,3 +54,40 @@ jobs:
|
||||
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
|
||||
@@ -1,3 +1,23 @@
|
||||
Pezkuwi Wallet
|
||||
|
||||
Copyright 2026 PezkuwiChain
|
||||
Pezkuwi Wallet is derived from Nova Wallet; the Nova Wallet notice follows below.
|
||||
|
||||
Third-party components ship with their licences inside the app, under assets/licences:
|
||||
rust-crates.txt Rust crates in the native libraries (scripts/licences/rust_notices.py)
|
||||
native-libraries.txt prebuilt native libraries in app/src/main/jniLibs
|
||||
android-libraries.json Android libraries, generated at build time by the licensee plugin
|
||||
|
||||
The light client links smoldot, licensed GPL-3.0-or-later WITH Classpath-exception-2.0. Its
|
||||
source is https://github.com/pezkuwichain/smoldot at the revision pinned in
|
||||
bindings/pezkuwi-light/rust/Cargo.toml. Settings > About > Open source licenses in the app opens
|
||||
a page naming the exact commit each build is made from.
|
||||
|
||||
The classes under io.github.novacrypto in common/ are written for this app under Apache-2.0. They
|
||||
take the place of the GPL-3.0 NovaCrypto libraries that substrate-sdk-android depends on.
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
Nova - Polkadot, Kusama wallet
|
||||
|
||||
Copyright 2022-2025 Novasama Technologies PTE. LTD.
|
||||
|
||||
@@ -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()}"
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
Prebuilt native libraries in app/src/main/jniLibs
|
||||
|
||||
These replace the copies inside two Maven dependencies with builds aligned to 16 KB pages. Their
|
||||
licences are those of the dependencies they replace, which are listed with the other Android
|
||||
libraries.
|
||||
|
||||
libsqlcipher.so
|
||||
from: net.zetetic:android-database-sqlcipher 4.5.3 (a dependency of the WalletConnect SDK), segments realigned
|
||||
licence: SQLCipher Community Edition, a BSD-style licence (Copyright (c) Zetetic LLC),
|
||||
https://www.zetetic.net/sqlcipher/license/ ; SQLite is in the public domain.
|
||||
It links OpenSSL statically: this product includes software developed by the OpenSSL Project
|
||||
for use in the OpenSSL Toolkit (http://www.openssl.org/), and cryptographic software written by
|
||||
Eric Young (eay@cryptsoft.com).
|
||||
source: https://github.com/sqlcipher/android-database-sqlcipher
|
||||
|
||||
libsr25519java.so
|
||||
from: substrate-sdk-android 2.11.0, crate sr25519-java, rebuilt from source
|
||||
licence: Apache-2.0 (Novasama Technologies)
|
||||
source: https://github.com/novasamatech/substrate-sdk-android/tree/master/sr25519-java
|
||||
Rust crates linked in, with their licences:
|
||||
schnorrkel <=0.9.1 BSD-3-Clause (Web3 Foundation, Isis Lovecruft, Jeff Burdges)
|
||||
jni 0.17 MIT OR Apache-2.0
|
||||
zeroize <=1.1.1 Apache-2.0 OR MIT
|
||||
log <=0.4.11 MIT OR Apache-2.0
|
||||
and the crates schnorrkel depends on (curve25519-dalek, merlin, sha2, subtle, rand and others),
|
||||
all under BSD-3-Clause, MIT or Apache-2.0. The standard texts of these licences are in
|
||||
rust-crates.txt.
|
||||
File diff suppressed because it is too large.
Load diff
@@ -243,6 +243,7 @@ buildscript {
|
||||
classpath "com.google.firebase:firebase-appdistribution-gradle:$firebaseAppDistrVersion"
|
||||
classpath "com.github.triplet.gradle:play-publisher:$playPublisherVersion"
|
||||
classpath "com.google.devtools.ksp:symbol-processing-gradle-plugin:2.1.0-1.0.29"
|
||||
classpath "app.cash.licensee:licensee-gradle-plugin:1.14.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,6 +257,13 @@ allprojects {
|
||||
mavenLocal()
|
||||
flatDir { dirs "$rootDir/common/libs" }
|
||||
}
|
||||
|
||||
// substrate-sdk-android brings in the NovaCrypto libraries, which are GPL-3.0. The app provides the
|
||||
// few classes the SDK uses under Apache-2.0 instead (common, io.github.novacrypto).
|
||||
configurations.configureEach {
|
||||
exclude group: 'com.github.NovaCrypto'
|
||||
exclude group: 'io.github.novacrypto'
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
apply plugin: 'kotlin-parcelize'
|
||||
|
||||
String sourceCommit() {
|
||||
try {
|
||||
def process = ['git', 'rev-parse', 'HEAD'].execute()
|
||||
def commit = process.text.trim()
|
||||
return process.waitFor() == 0 && commit ==~ /[0-9a-f]{40}/ ? commit : ""
|
||||
} catch (IOException ignored) {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
|
||||
defaultConfig {
|
||||
@@ -8,6 +18,9 @@ android {
|
||||
buildConfigField "String", "PRIVACY_URL", "\"https://pezkuwichain.io/privacy.html\""
|
||||
buildConfigField "String", "TERMS_URL", "\"https://pezkuwichain.io/terms.html\""
|
||||
buildConfigField "String", "GITHUB_URL", "\"https://github.com/pezkuwichain\""
|
||||
// Releases are not tagged, so the licences page is told which commit this build is made from:
|
||||
// that is where the source the GPL-licensed light client requires us to offer lives.
|
||||
buildConfigField "String", "LICENCES_URL", "\"https://pezkuwichain.github.io/pezkuwi-wallet-utils/licences/?commit=${sourceCommit()}\""
|
||||
buildConfigField "String", "TELEGRAM_URL", "\"https://t.me/pezkuwichainBot\""
|
||||
buildConfigField "String", "TWITTER_URL", "\"https://x.com/bizinikiwi\""
|
||||
buildConfigField "String", "RATE_URL", "\"market://details?id=${rootProject.applicationId}.${releaseApplicationSuffix}\""
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package io.github.novacrypto;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* A character buffer that is wiped when closed, for assembling a mnemonic. See
|
||||
* {@link io.github.novacrypto.bip39.WordList}.
|
||||
*/
|
||||
public final class SecureCharBuffer implements Closeable {
|
||||
|
||||
private char[] chars = new char[256];
|
||||
private int length;
|
||||
|
||||
public void append(CharSequence text) {
|
||||
if (length + text.length() > chars.length) {
|
||||
char[] grown = Arrays.copyOf(chars, Math.max(chars.length * 2, length + text.length()));
|
||||
Arrays.fill(chars, '\0');
|
||||
chars = grown;
|
||||
}
|
||||
for (int i = 0; i < text.length(); i++) {
|
||||
chars[length++] = text.charAt(i);
|
||||
}
|
||||
}
|
||||
|
||||
/** The content so far; the caller owns the copy it makes from it. */
|
||||
public CharSequence toStringAble() {
|
||||
return new String(chars, 0, length);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
Arrays.fill(chars, '\0');
|
||||
length = 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package io.github.novacrypto.bip39;
|
||||
|
||||
import io.github.novacrypto.hashing.Sha256;
|
||||
|
||||
/** Turns entropy into a BIP39 mnemonic, as specified in BIP-0039. See {@link WordList}. */
|
||||
public final class MnemonicGenerator {
|
||||
|
||||
/** Receives the mnemonic piece by piece, so it never has to sit in an immutable String. */
|
||||
public interface Target {
|
||||
void append(CharSequence text);
|
||||
}
|
||||
|
||||
private static final int BITS_PER_WORD = 11;
|
||||
|
||||
private final WordList wordList;
|
||||
|
||||
public MnemonicGenerator(WordList wordList) {
|
||||
this.wordList = wordList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends the words for {@code entropy} (16 to 32 bytes, a multiple of 4) to {@code target}: the
|
||||
* entropy followed by the first length/32 bits of its SHA-256, read in groups of 11 bits.
|
||||
*/
|
||||
public void createMnemonic(byte[] entropy, Target target) {
|
||||
if (entropy.length < 16 || entropy.length > 32 || entropy.length % 4 != 0) {
|
||||
throw new IllegalArgumentException("Entropy must be 16 to 32 bytes, a multiple of 4: " + entropy.length);
|
||||
}
|
||||
byte[] checksum = Sha256.sha256(entropy);
|
||||
int checksumBits = entropy.length * 8 / 32;
|
||||
int words = (entropy.length * 8 + checksumBits) / BITS_PER_WORD;
|
||||
String space = String.valueOf(wordList.getSpace());
|
||||
|
||||
for (int word = 0; word < words; word++) {
|
||||
int index = 0;
|
||||
for (int bit = word * BITS_PER_WORD; bit < (word + 1) * BITS_PER_WORD; bit++) {
|
||||
index = (index << 1) | bitAt(entropy, checksum, bit);
|
||||
}
|
||||
if (word > 0) {
|
||||
target.append(space);
|
||||
}
|
||||
target.append(wordList.getWord(index));
|
||||
}
|
||||
}
|
||||
|
||||
private static int bitAt(byte[] entropy, byte[] checksum, int bit) {
|
||||
int entropyBits = entropy.length * 8;
|
||||
byte[] source = bit < entropyBits ? entropy : checksum;
|
||||
int position = bit < entropyBits ? bit : bit - entropyBits;
|
||||
return (source[position / 8] >> (7 - position % 8)) & 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package io.github.novacrypto.bip39;
|
||||
|
||||
/**
|
||||
* A BIP39 word list.
|
||||
*
|
||||
* <p>The classes under {@code io.github.novacrypto} are written for this app under Apache-2.0. They
|
||||
* replace the GPL-3.0 NovaCrypto libraries that substrate-sdk-android depends on, and keep only the
|
||||
* binary interface its MnemonicCreator and EnglishWordList are compiled against, so the SDK runs
|
||||
* unchanged. The NovaCrypto artifacts are excluded in the root build.gradle.
|
||||
*/
|
||||
public interface WordList {
|
||||
|
||||
/** The word at {@code index}, 0 to 2047. */
|
||||
String getWord(int index);
|
||||
|
||||
/** The character the words of a mnemonic are joined with. */
|
||||
char getSpace();
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package io.github.novacrypto.hashing;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
/** SHA-256 from the platform. See {@link io.github.novacrypto.bip39.WordList}. */
|
||||
public final class Sha256 {
|
||||
|
||||
private Sha256() {
|
||||
}
|
||||
|
||||
public static byte[] sha256(byte[] bytes) {
|
||||
try {
|
||||
return MessageDigest.getInstance("SHA-256").digest(bytes);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new IllegalStateException("SHA-256 is required on every Java platform", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package io.novafoundation.nova.common.data.network
|
||||
class AppLinksProvider(
|
||||
val termsUrl: String,
|
||||
val privacyUrl: String,
|
||||
val licencesUrl: String,
|
||||
val telegram: String,
|
||||
val twitter: String,
|
||||
val rateApp: String,
|
||||
|
||||
@@ -55,6 +55,7 @@ class NetworkModule {
|
||||
return AppLinksProvider(
|
||||
termsUrl = BuildConfig.TERMS_URL,
|
||||
privacyUrl = BuildConfig.PRIVACY_URL,
|
||||
licencesUrl = BuildConfig.LICENCES_URL,
|
||||
payoutsLearnMore = BuildConfig.PAYOUTS_LEARN_MORE,
|
||||
twitterAccountTemplate = BuildConfig.TWITTER_ACCOUNT_TEMPLATE,
|
||||
setControllerLearnMore = BuildConfig.SET_CONTROLLER_LEARN_MORE,
|
||||
|
||||
@@ -1498,6 +1498,7 @@
|
||||
<string name="about_contact_us">Têkilî bi me re</string>
|
||||
<string name="about_github_v2_2_0">Github</string>
|
||||
<string name="about_privacy">Siyaseta nepeniyê</string>
|
||||
<string name="about_open_source_licences">Lîsansên çavkaniya vekirî</string>
|
||||
<string name="about_rate_app">Me binirxîne</string>
|
||||
<string name="about_telegram_v2_2_0">Telegram</string>
|
||||
<string name="about_terms">Merc û şert</string>
|
||||
|
||||
@@ -1536,6 +1536,7 @@ Transfer sonrası kalan bakiye: %2$s</string>
|
||||
<string name="about_contact_us">Bize Ulaşın</string>
|
||||
<string name="about_github_v2_2_0">Github</string>
|
||||
<string name="about_privacy">Gizlilik politikası</string>
|
||||
<string name="about_open_source_licences">Açık kaynak lisansları</string>
|
||||
<string name="about_rate_app">Bizi değerlendirin</string>
|
||||
<string name="about_telegram_v2_2_0">Telegram</string>
|
||||
<string name="about_terms">Şartlar ve koşullar</string>
|
||||
|
||||
@@ -2254,6 +2254,7 @@
|
||||
<string name="about_contact_us">Contact Us</string>
|
||||
<string name="about_github_v2_2_0">Github</string>
|
||||
<string name="about_privacy">Privacy policy</string>
|
||||
<string name="about_open_source_licences">Open source licenses</string>
|
||||
<string name="about_rate_app">Rate us</string>
|
||||
<string name="about_telegram_v2_2_0">Telegram</string>
|
||||
<string name="about_terms">Terms and conditions</string>
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
package io.novafoundation.nova.common.utils
|
||||
|
||||
import io.novasama.substrate_sdk_android.encrypt.mnemonic.Mnemonic
|
||||
import io.novasama.substrate_sdk_android.encrypt.mnemonic.MnemonicCreator
|
||||
import io.novasama.substrate_sdk_android.extensions.fromHex
|
||||
import io.novasama.substrate_sdk_android.extensions.toHexString
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
// The SDK's MnemonicCreator runs on the Apache-2.0 classes in io.github.novacrypto that replace the
|
||||
// GPL-3.0 NovaCrypto libraries. A wrong word here would give users a phrase that restores another
|
||||
// account, so every English vector of BIP-0039 (trezor/python-mnemonic vectors.json) is checked.
|
||||
class Bip39VectorsTest {
|
||||
|
||||
private val vectors = listOf(
|
||||
"00000000000000000000000000000000" to "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about",
|
||||
"7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f" to "legal winner thank year wave sausage worth useful legal winner thank yellow",
|
||||
"80808080808080808080808080808080" to "letter advice cage absurd amount doctor acoustic avoid letter advice cage above",
|
||||
"ffffffffffffffffffffffffffffffff" to "zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo wrong",
|
||||
"000000000000000000000000000000000000000000000000" to "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon agent",
|
||||
"7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f" to "legal winner thank year wave sausage worth useful legal winner thank year wave sausage worth useful legal will",
|
||||
"808080808080808080808080808080808080808080808080" to "letter advice cage absurd amount doctor acoustic avoid letter advice cage absurd amount doctor acoustic avoid letter always",
|
||||
"ffffffffffffffffffffffffffffffffffffffffffffffff" to "zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo when",
|
||||
"0000000000000000000000000000000000000000000000000000000000000000" to "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon art",
|
||||
"7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f" to "legal winner thank year wave sausage worth useful legal winner thank year wave sausage worth useful legal winner thank year wave sausage worth title",
|
||||
"8080808080808080808080808080808080808080808080808080808080808080" to "letter advice cage absurd amount doctor acoustic avoid letter advice cage absurd amount doctor acoustic avoid letter advice cage absurd amount doctor acoustic bless",
|
||||
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" to "zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo zoo vote",
|
||||
"9e885d952ad362caeb4efe34a8e91bd2" to "ozone drill grab fiber curtain grace pudding thank cruise elder eight picnic",
|
||||
"6610b25967cdcca9d59875f5cb50b0ea75433311869e930b" to "gravity machine north sort system female filter attitude volume fold club stay feature office ecology stable narrow fog",
|
||||
"68a79eaca2324873eacc50cb9c6eca8cc68ea5d936f98787c60c7ebc74e6ce7c" to "hamster diagram private dutch cause delay private meat slide toddler razor book happy fancy gospel tennis maple dilemma loan word shrug inflict delay length",
|
||||
"c0ba5a8e914111210f2bd131f3d5e08d" to "scheme spot photo card baby mountain device kick cradle pact join borrow",
|
||||
"6d9be1ee6ebd27a258115aad99b7317b9c8d28b6d76431c3" to "horn tenant knee talent sponsor spell gate clip pulse soap slush warm silver nephew swap uncle crack brave",
|
||||
"9f6a2878b2520799a44ef18bc7df394e7061a224d2c33cd015b157d746869863" to "panda eyebrow bullet gorilla call smoke muffin taste mesh discover soft ostrich alcohol speed nation flash devote level hobby quick inner drive ghost inside",
|
||||
"23db8160a31d3e0dca3688ed941adbf3" to "cat swing flag economy stadium alone churn speed unique patch report train",
|
||||
"8197a4a47f0425faeaa69deebc05ca29c0a5b5cc76ceacc0" to "light rule cinnamon wrap drastic word pride squirrel upgrade then income fatal apart sustain crack supply proud access",
|
||||
"066dca1a2bb7e8a1db2832148ce9933eea0f3ac9548d793112d9a95c9407efad" to "all hour make first leader extend hole alien behind guard gospel lava path output census museum junior mass reopen famous sing advance salt reform",
|
||||
"f30f8c1da665478f49b001d94c5fc452" to "vessel ladder alter error federal sibling chat ability sun glass valve picture",
|
||||
"c10ec20dc3cd9f652c7fac2f1230f7a3c828389a14392f05" to "scissors invite lock maple supreme raw rapid void congress muscle digital elegant little brisk hair mango congress clump",
|
||||
"f585c11aec520db57dd353c69554b21a89b20fb0650966fa0a9d6f74fd989d8f" to "void come effort suffer camp survey warrior heavy shoot primary clutch crush open amazing screen patrol group space point ten exist slush involve unfold"
|
||||
)
|
||||
|
||||
@Test
|
||||
fun entropyGivesTheVectorMnemonic() {
|
||||
vectors.forEach { (entropy, words) ->
|
||||
assertEquals(words, MnemonicCreator.fromEntropy(entropy.fromHex()).words)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun vectorMnemonicGivesBackItsEntropy() {
|
||||
vectors.forEach { (entropy, words) ->
|
||||
assertEquals(entropy, MnemonicCreator.fromWords(words).entropy.toHexString())
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun randomMnemonicHasTheRequestedLengthAndRoundTrips() {
|
||||
Mnemonic.Length.values().forEach { length ->
|
||||
val mnemonic = MnemonicCreator.randomMnemonic(length)
|
||||
|
||||
// Each word carries 11 bits; a checksum bit is added per 32 bits of entropy.
|
||||
assertEquals(length.byteLength * 8 * 33 / 32 / 11, mnemonic.wordList.size)
|
||||
assertTrue(mnemonic.entropy.contentEquals(MnemonicCreator.fromWords(mnemonic.words).entropy))
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
@@ -43,6 +43,7 @@ class SettingsFragment : BaseFragment<SettingsViewModel, FragmentSettingsBinding
|
||||
binder.settingsGithub.setOnClickListener { viewModel.githubClicked() }
|
||||
binder.settingsTerms.setOnClickListener { viewModel.termsClicked() }
|
||||
binder.settingsPrivacy.setOnClickListener { viewModel.privacyClicked() }
|
||||
binder.settingsLicences.setOnClickListener { viewModel.licencesClicked() }
|
||||
|
||||
binder.settingsRateUs.setOnClickListener { viewModel.rateUsClicked() }
|
||||
binder.settingsWiki.setOnClickListener { viewModel.wikiClicked() }
|
||||
|
||||
+4
@@ -242,6 +242,10 @@ class SettingsViewModel(
|
||||
openLink(appLinksProvider.privacyUrl)
|
||||
}
|
||||
|
||||
fun licencesClicked() {
|
||||
openLink(appLinksProvider.licencesUrl)
|
||||
}
|
||||
|
||||
fun emailClicked() {
|
||||
_openEmailEvent.value = appLinksProvider.email.event()
|
||||
}
|
||||
|
||||
@@ -271,6 +271,13 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:icon="@drawable/ic_file_outline"
|
||||
app:title="@string/about_privacy" />
|
||||
|
||||
<io.novafoundation.nova.common.view.settings.SettingsItemView
|
||||
android:id="@+id/settingsLicences"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:icon="@drawable/ic_file_outline"
|
||||
app:title="@string/about_open_source_licences" />
|
||||
</io.novafoundation.nova.common.view.settings.SettingsGroupView>
|
||||
|
||||
<ImageView
|
||||
|
||||
@@ -0,0 +1,183 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Writes the licence notices of every Rust crate linked into the app's native libraries.
|
||||
|
||||
Every bindings/*/rust crate builds one .so. The notices ship inside the APK
|
||||
(app/src/main/assets/licences/rust-crates.txt). `--check` fails when the committed file no longer
|
||||
matches the lockfiles, so a dependency change cannot ship without them.
|
||||
"""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import pathlib
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
ROOT = pathlib.Path(__file__).resolve().parents[2]
|
||||
OUTPUT = ROOT / "app/src/main/assets/licences/rust-crates.txt"
|
||||
# The ABIs the app ships; one target's graph can miss a crate another target pulls in.
|
||||
TARGETS = ["aarch64-linux-android", "armv7-linux-androideabi", "i686-linux-android", "x86_64-linux-android"]
|
||||
STANDARD = pathlib.Path(__file__).resolve().parent / "standard"
|
||||
# Crates whose pinned source declares no licence, with the licence their author has since given them.
|
||||
DECLARED_ELSEWHERE = {
|
||||
"merkleized-metadata": (
|
||||
"MIT OR Apache-2.0",
|
||||
"licence declared upstream after the pinned commit: github.com/bkchr/merkleized-metadata (2024-05-21)",
|
||||
),
|
||||
}
|
||||
LICENCE_FILE = re.compile(r"^(licen[cs]e|copying|notice|copyright|unlicense)([-_.].*)?$", re.IGNORECASE)
|
||||
|
||||
|
||||
def manifests():
|
||||
return sorted(ROOT.glob("bindings/*/rust/Cargo.toml"))
|
||||
|
||||
|
||||
def library_name(manifest):
|
||||
meta = json.loads(subprocess.run(
|
||||
["cargo", "metadata", "--format-version", "1", "--locked", "--no-deps", "--manifest-path", str(manifest)],
|
||||
check=True, capture_output=True, text=True,
|
||||
).stdout)
|
||||
package = meta["packages"][0]
|
||||
lib = next(t for t in package["targets"] if "cdylib" in t["kind"])
|
||||
return f"lib{lib['name']}.so"
|
||||
|
||||
|
||||
def metadata(manifest, target):
|
||||
out = subprocess.run(
|
||||
["cargo", "metadata", "--format-version", "1", "--locked", "--manifest-path", str(manifest),
|
||||
"--filter-platform", target],
|
||||
check=True, capture_output=True, text=True,
|
||||
).stdout
|
||||
return json.loads(out)
|
||||
|
||||
|
||||
def shipped_packages(manifest):
|
||||
"""Packages reachable from the root through normal (not build or dev) dependencies."""
|
||||
# The licence files are read from the crate sources, which `cargo metadata` does not download.
|
||||
subprocess.run(["cargo", "fetch", "--locked", "--quiet", "--manifest-path", str(manifest)], check=True)
|
||||
packages = {}
|
||||
for target in TARGETS:
|
||||
meta = metadata(manifest, target)
|
||||
by_id = {p["id"]: p for p in meta["packages"]}
|
||||
nodes = {n["id"]: n for n in meta["resolve"]["nodes"]}
|
||||
root = meta["resolve"]["root"]
|
||||
stack, seen = [root], {root}
|
||||
while stack:
|
||||
node = nodes[stack.pop()]
|
||||
for dep in node["deps"]:
|
||||
if any(k["kind"] is None for k in dep["dep_kinds"]) and dep["pkg"] not in seen:
|
||||
seen.add(dep["pkg"])
|
||||
stack.append(dep["pkg"])
|
||||
seen.discard(root)
|
||||
for pid in seen:
|
||||
packages[pid] = by_id[pid]
|
||||
return sorted(packages.values(), key=lambda p: (p["name"], p["version"]))
|
||||
|
||||
|
||||
def licence_files(package):
|
||||
"""Licence files of a crate; a crate inside a git workspace often keeps them at the workspace root."""
|
||||
directory = pathlib.Path(package["manifest_path"]).parent
|
||||
candidates = []
|
||||
if package.get("license_file"):
|
||||
candidates.append(directory / package["license_file"])
|
||||
for current in [directory, *directory.parents]:
|
||||
found = sorted(f for f in current.iterdir() if f.is_file() and LICENCE_FILE.match(f.name))
|
||||
if found or not package["source"] or not package["source"].startswith("git+"):
|
||||
candidates.extend(found)
|
||||
break
|
||||
if (current / ".git").exists():
|
||||
break
|
||||
unique = []
|
||||
for path in candidates:
|
||||
if path.is_file() and path.resolve() not in [u.resolve() for u in unique]:
|
||||
unique.append(path)
|
||||
return unique
|
||||
|
||||
|
||||
def source_of(package):
|
||||
"""Where this exact version's source is: for a git dependency the fork and commit, not upstream."""
|
||||
source = package["source"] or ""
|
||||
if source.startswith("git+"):
|
||||
url, _, commit = source[len("git+"):].partition("#")
|
||||
return f"{url.split('?')[0]}/tree/{commit}"
|
||||
return package.get("repository") or source or "local"
|
||||
|
||||
|
||||
def spdx_ids(expression):
|
||||
ids = [i for i in re.split(r"[\s/()]+", expression or "") if i and i not in ("OR", "AND", "WITH")]
|
||||
return list(dict.fromkeys(ids))
|
||||
|
||||
|
||||
def render():
|
||||
texts = {}
|
||||
sections = []
|
||||
total = set()
|
||||
for manifest in manifests():
|
||||
packages = shipped_packages(manifest)
|
||||
total.update((p["name"], p["version"]) for p in packages)
|
||||
entries = [entry(package, texts) for package in packages]
|
||||
sections += ["=" * 72, f"{library_name(manifest)}: {len(packages)} crates ({manifest.parent.relative_to(ROOT)})",
|
||||
"=" * 72, "", *entries]
|
||||
lines = [
|
||||
"Third-party Rust crates in the app's native libraries",
|
||||
"Generated by scripts/licences/rust_notices.py from bindings/*/rust/Cargo.lock.",
|
||||
f"{len(total)} distinct crates. Each refers to its licence texts by id; the texts follow the lists.",
|
||||
"",
|
||||
*sections,
|
||||
"=" * 72,
|
||||
"Licence texts",
|
||||
"=" * 72,
|
||||
]
|
||||
for digest, text in texts.items():
|
||||
lines += ["", f"[{digest}]", "", text, "", "-" * 72]
|
||||
return "\n".join(lines) + "\n"
|
||||
|
||||
|
||||
def entry(package, texts):
|
||||
licence, note = package.get("license"), None
|
||||
if not licence and package["name"] in DECLARED_ELSEWHERE:
|
||||
licence, note = DECLARED_ELSEWHERE[package["name"]]
|
||||
if not licence and not package.get("license_file"):
|
||||
raise SystemExit(f"{package['name']}: declares no licence; record where it is licensed in DECLARED_ELSEWHERE")
|
||||
refs = []
|
||||
for path in licence_files(package):
|
||||
text = path.read_text(encoding="utf-8", errors="replace").strip()
|
||||
digest = hashlib.sha256(text.encode()).hexdigest()[:12]
|
||||
texts.setdefault(digest, text)
|
||||
refs.append(f"{path.name} [{digest}]")
|
||||
if not refs:
|
||||
for spdx in spdx_ids(licence):
|
||||
standard = STANDARD / f"{spdx}.txt"
|
||||
if not standard.is_file():
|
||||
raise SystemExit(f"{package['name']}: no licence file and no standard text for {spdx}")
|
||||
digest = f"spdx:{spdx}"
|
||||
texts.setdefault(digest, standard.read_text(encoding="utf-8").strip())
|
||||
refs.append(f"standard text [{digest}]")
|
||||
return (
|
||||
f"{package['name']} {package['version']}\n"
|
||||
f" licence: {licence or 'see licence text'}{f' ({note})' if note else ''}\n"
|
||||
f" source: {source_of(package)}\n"
|
||||
f" authors: {', '.join(package.get('authors') or []) or '-'}\n"
|
||||
f" licence text: {', '.join(refs)}\n"
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--check", action="store_true", help="fail if the committed notices are stale")
|
||||
args = parser.parse_args()
|
||||
content = render()
|
||||
if args.check:
|
||||
if not OUTPUT.exists() or OUTPUT.read_text(encoding="utf-8") != content:
|
||||
print(f"{OUTPUT.relative_to(ROOT)} is stale: run scripts/licences/rust_notices.py", file=sys.stderr)
|
||||
return 1
|
||||
print(f"{OUTPUT.relative_to(ROOT)} is current")
|
||||
return 0
|
||||
OUTPUT.parent.mkdir(parents=True, exist_ok=True)
|
||||
OUTPUT.write_text(content, encoding="utf-8")
|
||||
print(f"wrote {OUTPUT.relative_to(ROOT)}")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -0,0 +1,73 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -0,0 +1,9 @@
|
||||
Copyright (c) <year> <owner>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -0,0 +1,11 @@
|
||||
Copyright (c) <year> <owner>.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -0,0 +1,121 @@
|
||||
Creative Commons Legal Code
|
||||
|
||||
CC0 1.0 Universal
|
||||
|
||||
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
||||
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
||||
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
||||
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
||||
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
||||
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
||||
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
||||
HEREUNDER.
|
||||
|
||||
Statement of Purpose
|
||||
|
||||
The laws of most jurisdictions throughout the world automatically confer
|
||||
exclusive Copyright and Related Rights (defined below) upon the creator
|
||||
and subsequent owner(s) (each and all, an "owner") of an original work of
|
||||
authorship and/or a database (each, a "Work").
|
||||
|
||||
Certain owners wish to permanently relinquish those rights to a Work for
|
||||
the purpose of contributing to a commons of creative, cultural and
|
||||
scientific works ("Commons") that the public can reliably and without fear
|
||||
of later claims of infringement build upon, modify, incorporate in other
|
||||
works, reuse and redistribute as freely as possible in any form whatsoever
|
||||
and for any purposes, including without limitation commercial purposes.
|
||||
These owners may contribute to the Commons to promote the ideal of a free
|
||||
culture and the further production of creative, cultural and scientific
|
||||
works, or to gain reputation or greater distribution for their Work in
|
||||
part through the use and efforts of others.
|
||||
|
||||
For these and/or other purposes and motivations, and without any
|
||||
expectation of additional consideration or compensation, the person
|
||||
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
|
||||
is an owner of Copyright and Related Rights in the Work, voluntarily
|
||||
elects to apply CC0 to the Work and publicly distribute the Work under its
|
||||
terms, with knowledge of his or her Copyright and Related Rights in the
|
||||
Work and the meaning and intended legal effect of CC0 on those rights.
|
||||
|
||||
1. Copyright and Related Rights. A Work made available under CC0 may be
|
||||
protected by copyright and related or neighboring rights ("Copyright and
|
||||
Related Rights"). Copyright and Related Rights include, but are not
|
||||
limited to, the following:
|
||||
|
||||
i. the right to reproduce, adapt, distribute, perform, display,
|
||||
communicate, and translate a Work;
|
||||
ii. moral rights retained by the original author(s) and/or performer(s);
|
||||
iii. publicity and privacy rights pertaining to a person's image or
|
||||
likeness depicted in a Work;
|
||||
iv. rights protecting against unfair competition in regards to a Work,
|
||||
subject to the limitations in paragraph 4(a), below;
|
||||
v. rights protecting the extraction, dissemination, use and reuse of data
|
||||
in a Work;
|
||||
vi. database rights (such as those arising under Directive 96/9/EC of the
|
||||
European Parliament and of the Council of 11 March 1996 on the legal
|
||||
protection of databases, and under any national implementation
|
||||
thereof, including any amended or successor version of such
|
||||
directive); and
|
||||
vii. other similar, equivalent or corresponding rights throughout the
|
||||
world based on applicable law or treaty, and any national
|
||||
implementations thereof.
|
||||
|
||||
2. Waiver. To the greatest extent permitted by, but not in contravention
|
||||
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
||||
irrevocably and unconditionally waives, abandons, and surrenders all of
|
||||
Affirmer's Copyright and Related Rights and associated claims and causes
|
||||
of action, whether now known or unknown (including existing as well as
|
||||
future claims and causes of action), in the Work (i) in all territories
|
||||
worldwide, (ii) for the maximum duration provided by applicable law or
|
||||
treaty (including future time extensions), (iii) in any current or future
|
||||
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
||||
including without limitation commercial, advertising or promotional
|
||||
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
||||
member of the public at large and to the detriment of Affirmer's heirs and
|
||||
successors, fully intending that such Waiver shall not be subject to
|
||||
revocation, rescission, cancellation, termination, or any other legal or
|
||||
equitable action to disrupt the quiet enjoyment of the Work by the public
|
||||
as contemplated by Affirmer's express Statement of Purpose.
|
||||
|
||||
3. Public License Fallback. Should any part of the Waiver for any reason
|
||||
be judged legally invalid or ineffective under applicable law, then the
|
||||
Waiver shall be preserved to the maximum extent permitted taking into
|
||||
account Affirmer's express Statement of Purpose. In addition, to the
|
||||
extent the Waiver is so judged Affirmer hereby grants to each affected
|
||||
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
||||
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
||||
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
||||
maximum duration provided by applicable law or treaty (including future
|
||||
time extensions), (iii) in any current or future medium and for any number
|
||||
of copies, and (iv) for any purpose whatsoever, including without
|
||||
limitation commercial, advertising or promotional purposes (the
|
||||
"License"). The License shall be deemed effective as of the date CC0 was
|
||||
applied by Affirmer to the Work. Should any part of the License for any
|
||||
reason be judged legally invalid or ineffective under applicable law, such
|
||||
partial invalidity or ineffectiveness shall not invalidate the remainder
|
||||
of the License, and in such case Affirmer hereby affirms that he or she
|
||||
will not (i) exercise any of his or her remaining Copyright and Related
|
||||
Rights in the Work or (ii) assert any associated claims and causes of
|
||||
action with respect to the Work, in either case contrary to Affirmer's
|
||||
express Statement of Purpose.
|
||||
|
||||
4. Limitations and Disclaimers.
|
||||
|
||||
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
||||
surrendered, licensed or otherwise affected by this document.
|
||||
b. Affirmer offers the Work as-is and makes no representations or
|
||||
warranties of any kind concerning the Work, express, implied,
|
||||
statutory or otherwise, including without limitation warranties of
|
||||
title, merchantability, fitness for a particular purpose, non
|
||||
infringement, or the absence of latent or other defects, accuracy, or
|
||||
the present or absence of errors, whether or not discoverable, all to
|
||||
the greatest extent permissible under applicable law.
|
||||
c. Affirmer disclaims responsibility for clearing rights of other persons
|
||||
that may apply to the Work or any use thereof, including without
|
||||
limitation any person's Copyright and Related Rights in the Work.
|
||||
Further, Affirmer disclaims responsibility for obtaining any necessary
|
||||
consents, permissions or other rights required for any use of the
|
||||
Work.
|
||||
d. Affirmer understands and acknowledges that Creative Commons is not a
|
||||
party to this document and has no duty or obligation with respect to
|
||||
this CC0 or use of the Work.
|
||||
@@ -0,0 +1,15 @@
|
||||
---- LLVM Exceptions to the Apache 2.0 License ----
|
||||
|
||||
As an exception, if, as a result of your compiling your source code, portions
|
||||
of this Software are embedded into an Object form of such source code, you
|
||||
may redistribute such embedded portions in such Object form without complying
|
||||
with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
|
||||
|
||||
In addition, if you combine or link compiled forms of this Software with
|
||||
software that is licensed under the GPLv2 ("Combined Software") and if a
|
||||
court of competent jurisdiction determines that the patent provision (Section
|
||||
3), the indemnity provision (Section 9) or other Section of the License
|
||||
conflicts with the conditions of the GPLv2, you may retroactively and
|
||||
prospectively choose to deem waived or otherwise exclude such Section(s) of
|
||||
the License, but only in their entirety and only with respect to the Combined
|
||||
Software.
|
||||
@@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) <year> <copyright holders>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
Reference in new issue
Block a user