F-Droid 上的應用程式可以為應用程式商店提供內容,使其”關於”頁面更有趣、資訊更豐富。
從 F-Droid 0.103 版本和 1fdroidserver2 0.8 版本開始支持。
最新的标签标准
在 F-Droid 用戶端中,從 1.6 版本開始,只有具備以下所有條件的應用程式才會顯示在“最新”標籤頁上:
- 名稱
- Icon
- 概述
- 描述
- 授權條款
- 至少有一個版本的更新內容
- 至少一張圖片(屏幕截圖或一張功能演示圖片)
- 以上的最後一個已被翻譯
在公告文章中進一步瞭解更多資訊。
資料格式
照片檔案格式
圖片可以用PNG或JPEG格式提供。圖片必須以PNG、jpg或者JPEG結束語。
一個重要細節:危險和不必要的詮釋資料會先從影像檔中剝除,然後再被納入在軟體庫中。例如,JPEG EXIF 資料有安全問題,並且無需顯示圖像。這也可能意味著圖像是被重新壓縮過。
HTML 描述
在應用程式的詳細描述中可以使用HTML 標籤,但請注意渲染器並不支援所有的標籤。
- These simple layout tags are
supported:
b,big,blockquote,br,cite,em,i,li,ol,small,strike,strong,sub,sup,tt,u,ul. awithhrefis currently allowed, but might be removed without notice.- Certain tags are explicitly prohibited, namely
applet,base,body,button,embed,form,head,html,iframe,img,input,link,object,picture,script,source,style,svgandvideo. - Note that a line break will automatically be converted to a
brtag. - You may not make use of JavaScript.
提供詮釋資料的方式
下面可以通過加入詮釋資料的方式。
在應用程式的來源軟體庫中
對於官方F-Droid 軟體庫,強烈建議在應用程式的軟體庫中加入詮釋資料,原因如下:
- 應用程式的詮釋資料由軟體庫的所有者直接控制
- 軟體庫中的詮釋資料會自動複製到 F-Droid 軟體庫(因此不需要合併請求)
- 這是提供圖片(例如應用程式圖示或螢幕截圖)的唯一方式
F-Droid 支援兩種不同的檔結構。這些旨在與現有的自由軟體工具相容,這些工具使你可以將應用程式發佈到Google Play。你不需要安裝任何這些工具,因為檔結構可以很容易地手動創建。
請注意,應用程式的詮釋資料檔案中的文本將覆蓋所有通過下面解釋的結構提供的描述性文本。這會影響到Name,Summary 和 Description。如果在詮釋資料檔案中的詮釋資料儲存欄位被轉移到應用程序的庫中,請提交請求合併 或問題 以從應用程式的詮釋資料檔案中刪除 Summary 和 Description。
更多細節參見本檔案末尾描述的優先權規則。
F-Droid將只使用最新發佈版本裏的詮釋資料檔案。 這意味著fdroidserver將拉取它所知道的最新版本,並在該版本的 軟體庫中搜尋詮釋資料檔案。
所有詮釋資料檔案都是完全可選的,除了簡短的摘要描述以及較長的完整描述。 然而,不符合某些標準的應用程式將不會被顯示在最新標籤頁上。
Fastlane結構
第一種結構旨在與Fastlane提供工具相容。
基本的檔案結構如下。請注意右邊的註釋。當創建專案結構時,這些檔案一定要被放置在正確的位置,如下所述。
├── en-US (en-US 是 F-Droid 的預設語言)
│ ├── short_description.txt (簡短描述,最多 80 字元,必填)
│ ├── full_description.txt (完整應用程式描述,最多 4000 字元,必填)
│ ├── title.txt (應用程式名稱,最多 50 字元)
│ ├── video.txt (應用程式介紹影片連結)
│ ├── images
│ │ ├── icon.png (應用程式圖示)
│ │ ├── featureGraphic.png (宣傳橫幅,顯示於 F-Droid 用戶端應用程式描述頂端;橫向顯示)
│ │ ├── tvBanner.png (電視裝置專用圖示,目前未使用)
│ │ ├── phoneScreenshots
│ │ │ ├── 1.png
│ │ │ ├── 2.png
│ │ │ ...
│ │ ├── sevenInchScreenshots/
│ │ ├── tenInchScreenshots/ (可為不同螢幕尺寸新增專屬截圖)
│ │ ├── tvScreenshots/
│ │ └── wearScreenshots/
│ └── changelogs
│ ├── 100000.txt (必須與 versionCode 完全一致,不允許填充字元)
│ ├── 100100.txt (若 versionCode 設定為 100100)
│ └── 100101.txt (最多 500 字元)
└── ru (其他地區代碼)
... (用戶端優先採用在地化詮釋資料)
└── changelogs
└── 100100.txt
This structure should be placed at one of the following locations from the repository’s root:
metadata/<locale>/fastlane/metadata/android/<locale>/
Alternatively, if a Gradle build flavor is specified in the Build Metadata, the following location is also supported:
src/<buildFlavor>/fastlane/metadata/android/<locale>/
Or if the sub-directory is specified in the Build Metadata, the following location is also supported:
<subdir>/fastlane/metadata/android/<locale>/
(Some use cases of build flavors and multiple apps inside one repository are currently not properly supported. Follow this issue tracking the implementation of this.)
注意,把這個結構放在其他地方,比如在 gradle 模組的根目錄下將不能正常工作。
Triple-T 結構
第二種支援的結構與 Triple-T Gradle Play Publisher 工具相容。
將以下結構放在 <module>/src/main/play/,或者,要支援建置 Flavor,放在<module>/src/<buildFlavor>/play/,其中 <module> 是你的應用程式的 gradle 模組(在許多情況下是app 目錄)。
├── contact-email.txt (Developer email / AuthorEmail)
├── contact-website.txt (Developer website / AuthorWebSite)
├── release-notes
│ └── en-US
│ └── default.txt (latest changelog)
└── listings
├── en-US (en-US is the default locale in F-Droid)
│ ├── title.txt (app name, max 50 chars)
│ ├── short-description.txt (short description, max 80 chars, mandatory)
│ ├── full-description.txt (full app description, max 4000 chars, mandatory)
│ ├── video-url.txt (URL to a video introducing the app)
│ ├── whatsnew (alternative changelog location; single file, no .txt)
│ └── graphics
│ ├── icon (app icon)
│ │ └── *.(png|jpg) 1 image, usually 512x512
│ ├── feature-graphic (promo banner, shown on top of the app desc in F-Droid client)
│ │ └── *.(png|jpg) 1 image, usually 1024x500
│ ├── phone-screenshots
│ │ └── *.(png|jpg)
│ ├── tablet-screenshots
│ │ └── *.(png|jpg)
│ ├── large-tablet-screenshots
│ │ └── *.(png|jpg)
│ ├── tv-banner ("icon" for TV devices, currently not used)
│ │ └── *.(png|jpg)
│ ├── tv-screenshots
│ │ └── *.(png|jpg)
│ └── wear-screenshots
│ └── *.(png|jpg)
├── de (other locales)
├── ...
位於應用程式的一個 fdroiddata 集合內的版本詮釋資料中
注意:這個選項只適用於那些託管自己的軟體庫的人。如果你是想把應用程式放到 F-Droid 主軟體庫的開發者,別選這個選項。特別是不可以把屏幕螢幕快照加入到 fdroiddata 軟體庫。
詮釋資料檔案也可以被加入到任何建置詮釋資料的 fdroiddata 庫中。檔案結構也是按照 fastlane 的結構來的,它看起來和上面所示的相同,但還有如下額外要點。
- 將檔案結構放在以下位置:
<fdroiddata>/metadata/<packageId>/- For example, for
en-US,title.txtwould reside in this location:<fdroiddata>/metadata/<packageId>/en-US/title.txt
- For example, for
- Instead of
short_description.txt, the summary file should be namedsummary.txt. - Instead of
full_description.txt, the description file should be nameddescription.txt. - Not following the above two points causes the linter to fail.
In the F-Droid repo
注意:此選項僅對自託管軟體庫生效。
來自應用程式源軟體庫和 fdroiddata 詮釋資料子目錄的檔案的最終目的地是 F-Droid 軟體庫。所有文本都包含在索引檔案中(也稱為 index-v1.json)。所有的圖片檔案都可以直接包含在軟體庫中。
如果圖形檔案也在應用程式原始碼或 fdroiddata 中,則直接位於軟體庫中的檔案將被覆蓋。
你不應將文本檔案直接置於軟體庫中。
作為參考,圖片檔案可以放在軟體庫中的以下位置:
- fdroid
└── repo
└── <package-id>
└── <locale>
├── featureGraphic.png
├── icon.png
├── tvBanner.png
├── phoneScreenshots
│ └── *.png
├── sevenInchScreenshots
│ └── *.png
├── tenInchScreenshots
│ └── *.png
├── tvScreenshots
│ └── *.png
└── wearScreenshots
└── *.png
優先順序
當多個上述選項提供詮釋資料時應用程式以下一般優先規則:
- 詮釋資料檔案(即
<fdroiddata>/metadata/<packageId>.yml)覆蓋fdroiddata 檔案,甚至是在地化的。 - fdroiddata 檔案覆蓋應用程式原始碼中的詮釋資料。
- For data that is also contained in the APK file like the app’s name, the previous two options both overwrite the data from the APK file.
然而,也應用以下更具體的規則:
- 來自應用程式的 fdroiddata 源的圖像檔案覆蓋軟體庫中的檔案。
