From d22e9acc723f52575dfbbde9cb3b95f86b33dc1b Mon Sep 17 00:00:00 2001 From: linsui Date: Sat, 22 Apr 2023 22:10:12 +0800 Subject: [PATCH] schema: add AASK requirement and some patterns --- metadata/app.seeneva.reader.yml | 2 +- metadata/ch.thilojaeggi.notely.yml | 2 +- metadata/com.nextcloud.client.yml | 2 +- metadata/com.pocket_plan.j7_003.yml | 6 +- metadata/net.ser1.forage.yml | 2 +- schemas/metadata.json | 204 ++++++++++++++++------------ 6 files changed, 123 insertions(+), 95 deletions(-) diff --git a/metadata/app.seeneva.reader.yml b/metadata/app.seeneva.reader.yml index dda5c23e1f..40054f1c54 100644 --- a/metadata/app.seeneva.reader.yml +++ b/metadata/app.seeneva.reader.yml @@ -60,7 +60,7 @@ Builds: MaintainerNotes: Rust toolchain version comes from the rust-toolchain TOML file -AutoUpdateMode: Version %v-fdroid +-fdroid +AutoUpdateMode: Version +-fdroid %v-fdroid UpdateCheckMode: Tags ^[\d.]*-fdroid$ UpdateCheckData: seeneva.properties|seeneva.versionCode=(\d+)|.|seeneva.versionName=([\d.]+) CurrentVersion: 0.1.1 diff --git a/metadata/ch.thilojaeggi.notely.yml b/metadata/ch.thilojaeggi.notely.yml index b40cfe80ab..be2b7b719d 100644 --- a/metadata/ch.thilojaeggi.notely.yml +++ b/metadata/ch.thilojaeggi.notely.yml @@ -17,7 +17,7 @@ Builds: versionCode: 6 commit: 661b73e2ea8bc8b19f83ff4d662b07af5dba1b0f sudo: - - apt-get update || apt-get update + - apt-get update - apt-get install -y openjdk-11-jdk-headless - update-alternatives --auto java output: build/app/outputs/flutter-apk/app-fdroid-release.apk diff --git a/metadata/com.nextcloud.client.yml b/metadata/com.nextcloud.client.yml index f59fd2f526..459f9a443a 100644 --- a/metadata/com.nextcloud.client.yml +++ b/metadata/com.nextcloud.client.yml @@ -896,7 +896,7 @@ Builds: commit: stable-3.22.0 subdir: app sudo: - - apt-get update || apt-get update + - apt-get update - apt-get install -y openjdk-11-jdk-headless - update-alternatives --auto java gradle: diff --git a/metadata/com.pocket_plan.j7_003.yml b/metadata/com.pocket_plan.j7_003.yml index e66acaf472..5bb2f981ef 100644 --- a/metadata/com.pocket_plan.j7_003.yml +++ b/metadata/com.pocket_plan.j7_003.yml @@ -17,7 +17,7 @@ Builds: commit: v.1.3.6 subdir: app sudo: - - apt-get update || apt-get update + - apt-get update - apt-get install -y openjdk-11-jdk-headless - update-alternatives --auto java gradle: @@ -27,7 +27,6 @@ Builds: versionCode: 37 commit: 675f102d6191cf6b328e46681e0672b7842f27bf subdir: app - sudo: apt-get update || apt-get update gradle: - yes @@ -35,11 +34,10 @@ Builds: versionCode: 38 commit: 37a995b830575af89cda2b2ca2cea352c2678b5d subdir: app - sudo: apt-get update || apt-get update gradle: - yes -AutoUpdateMode: Version v.%v +AutoUpdateMode: Version UpdateCheckMode: Tags CurrentVersion: 1.3.8 CurrentVersionCode: 38 diff --git a/metadata/net.ser1.forage.yml b/metadata/net.ser1.forage.yml index 2562fdab2d..e96d990dc7 100644 --- a/metadata/net.ser1.forage.yml +++ b/metadata/net.ser1.forage.yml @@ -54,7 +54,7 @@ Builds: - ${HOME}/go/bin/fyne package -os android -release ndk: r23b -AutoUpdateMode: Version v%v +AutoUpdateMode: Version UpdateCheckMode: Tags ^v[0-9].[0-9].[0-9] UpdateCheckData: FyneApp.toml|Build\s=\s(\d+)|.|Version\s=\s"([\d.]+)" CurrentVersion: 1.2.0 diff --git a/schemas/metadata.json b/schemas/metadata.json index 9d3f7ba010..7d08027538 100644 --- a/schemas/metadata.json +++ b/schemas/metadata.json @@ -222,7 +222,8 @@ }, "AuthorEmail": { "description": "The e-mail address of the author(s).", - "type": "string" + "type": "string", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" }, "AuthorWebSite": { "description": "The website url of the author(s).", @@ -254,27 +255,26 @@ }, "FlattrID": { "description": "The project's Flattr (https://flattr.com) ID.", - "type": "string" + "type": "string", + "pattern": "^[0-9a-z]+$" }, "Liberapay": { "description": "The project's Liberapay (https://liberapay.com) user or group name.", "type": "string" }, - "LiberapayID": { - "description": "The project's Liberapay (https://liberapay.com) user or group ID.", - "type": "string" - }, "OpenCollective": { "description": "The project's OpenCollective (https://opencollective.com) user or group name.", "type": "string" }, "Bitcoin": { "description": "A Bitcoin address for donating to the project.", - "type": "string" + "type": "string", + "pattern": "^(bc1|[13])[a-zA-HJ-NP-Z0-9]{25,39}$" }, "Litecoin": { "description": "A Litecoin address for donating to the project.", - "type": "string" + "type": "string", + "pattern": "^([LM3][a-km-zA-HJ-NP-Z1-9]{26,33}|ltc1[a-km-z]{39})$" }, "Name": { "description": "The title of the application, with optional descriptive phrase.", @@ -299,15 +299,13 @@ "anyOf": [ { "type": "string", - "minLength": 64, - "maxLength": 64 + "pattern": "^[0-9a-f]{64}$" }, { "type": "array", "items": { "type": "string", - "minLength": 64, - "maxLength": 64 + "pattern": "^[0-9a-f]{64}$" } } ] @@ -365,10 +363,7 @@ }, "submodules": { "description": "Use if the project (git only) has submodules - causes git submodule update --init --recursive to be executed after the source is cloned.", - "type": "boolean", - "enum": [ - true - ] + "const": true }, "sudo": { "description": "Specifies a script to be run using sudo bash -x -c \"xxxx\" in the Buildserver VM guest. This script is run with full root privileges, but the state will be reset after each build.", @@ -384,10 +379,7 @@ }, "oldsdkloc": { "description": "The sdk location in the repo is in an old format, or the build.xml is expecting such. The 'new' format is sdk.dir while the VERY OLD format is sdk-location.", - "type": "boolean", - "enum": [ - true - ] + "const": true }, "target": { "description": "Specifies a particular SDK target for compilation, overriding the value defined in the code by upstream. This has different effects depending on what build system used — this flag currently affects Ant, Maven and Gradle projects only.", @@ -397,10 +389,7 @@ "description": "By default, 'android update' is used in Ant builds to generate or update the project and all its referenced projects. Specifying update=no bypasses that. Note that this is useless in builds that don't use Ant.", "anyOf": [ { - "type": "string", - "enum": [ - "auto" - ] + "const": "auto" }, { "type": "array", @@ -416,17 +405,11 @@ }, "forceversion": { "description": "If specified, the package version in AndroidManifest.xml is replaced with the version name for the build as specified in the metadata.", - "type": "boolean", - "enum": [ - true - ] + "const": true }, "forcevercode": { "description": "If specified, the package version code in the AndroidManifest.xml is replaced with the version code for the build. See also forceversion.", - "type": "boolean", - "enum": [ - true - ] + "const": true }, "rm": { "description": "Specifies the relative paths of files or directories to delete before the build is done.", @@ -492,10 +475,7 @@ { "type": "array", "items": { - "type": "string", - "enum": [ - "yes" - ] + "const": "yes" }, "maxItems": 1 }, @@ -544,10 +524,7 @@ }, "novcheck": { "description": "Don't check that the version name and code in the resulting APK are correct by looking at the build output - assume the metadata is correct.", - "type": "boolean", - "enum": [ - true - ] + "const": true }, "antifeatures": { "description": "List of Anti-Features for this specific build. They are described in AntiFeatures.", @@ -582,16 +559,16 @@ }, "AutoUpdateMode": { "description": "This determines the method used for auto-generating new builds when new releases are available - in other words, adding a new Build Version line to the metadata.", + "type": "string", "anyOf": [ { - "type": "string" - }, - { - "type": "string", "enum": [ "None", "Version" ] + }, + { + "pattern": "^Version( \\+.+)? [^+].+" } ] }, @@ -599,18 +576,18 @@ "description": "This determines the method using for determining when new releases are available - in other words, the updating of the CurrentVersion and CurrentVersionCode fields in the metadata by the fdroid checkupdates process.", "type": "string", "anyOf": [ - { - "type": "string" - }, { "enum": [ "None", "Static", - "RepoManifest", - "RepoTrunk", - "Tags", "HTTP" ] + }, + { + "pattern": "^RepoManifest(/.+)?$" + }, + { + "pattern": "^Tags( .*)?$" } ] }, @@ -663,49 +640,102 @@ "License", "Builds" ], - "anyOf": [ + "allOf": [ { - "required": [ - "Repo", - "RepoType", - "SourceCode" + "anyOf": [ + { + "required": [ + "Repo", + "RepoType", + "SourceCode" + ] + }, + { + "required": [ + "NoSourceSince" + ] + } ] }, { - "required": [ - "NoSourceSince" - ] + "if": { + "anyOf": [ + { + "properties": { + "ArchivePolicy": { + "const": "0 versions" + } + }, + "required": [ + "ArchivePolicy" + ] + }, + { + "required": [ + "NoSourceSince" + ] + } + ] + }, + "then": { + "properties": { + "AutoUpdateMode": { + "const": "None" + }, + "UpdateCheckMode": { + "const": "None" + } + } + } + }, + { + "if": { + "anyOf": [ + { + "required": [ + "Binaries" + ] + }, + { + "properties": { + "Builds": { + "contains": { + "required": [ + "binary" + ] + } + } + }, + "required": [ + "Builds" + ] + } + ] + }, + "then": { + "required": [ + "AllowedAPKSigningKeys" + ] + } + }, + { + "if": { + "properties": { + "UpdateCheckMode": { + "pattern": "^Tags" + } + } + }, + "then": { + "properties": { + "AutoUpdateMode": { + "type": "string", + "pattern": "^(None|Version( \\+.+)?)$" + } + } + } } ], - "if": { - "anyOf": [ - { - "properties": { - "ArchivePolicy": { - "const": "0 versions" - } - }, - "required": [ - "ArchivePolicy" - ] - }, - { - "required": [ - "NoSourceSince" - ] - } - ] - }, - "then": { - "properties": { - "AutoUpdateMode": { - "const": "None" - }, - "UpdateCheckMode": { - "const": "None" - } - } - }, "additionalProperties": false, "definitions": { "anti_features": {