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
. a
withhref
is currently allowed, but might be removed without notice.- 某些標籤被明確禁止,包括
applet
,base
,body
,button
,embed
,form
,head
,html
,iframe
,img
,input
,link
,object
,picture
,script
,source
,style
,svg
和video
。 - 請注意,換行符將被自動轉換為
br
標籤。 - 你不得使用 JavaScript。
提供元數據的方式
下面可以通過添加元數據的方式。
在應用程式的來源軟體庫中
對於官方F-Droid 軟體庫,強烈建議在應用程式的軟體庫中添加中介資料,原因如下:
- 應用程式的中介資料由軟體庫的所有者直接控制
- 軟體庫中的中介資料會自動複製到 F-Droid 軟體庫(因此不需要合併請求)
F-Droid 支援兩種不同的檔結構。這些旨在與現有的自由軟體工具相容,這些工具使你可以將應用程式發佈到Google Play。你不需要安裝任何這些工具,因為檔結構可以很容易地手動創建。
請注意,應用程式的中介資料檔案中的文本將覆蓋所有通過下面解釋的結構提供的描述性文本。這會影響到Name,Summary 和 Description。如果在中介資料檔案中的中介資料存儲字段被轉移到應用程序的庫中,請提交請求合併 或問題 以從應用程式的中介資料檔案中刪除 Summary 和 Description。
更多細節參見本檔案末尾描述的優先權規則。
F-Droid將只使用最新發佈版本裏的中介資料檔案。 這意味著fdroidserver將拉取它所知道的最新版本,並在該版本的 軟體庫中查找中繼資料檔案。
所有中介資料檔案都是完全可選的,除了簡短的摘要描述以及較長的完整描述。 然而,不符合某些標準的應用程式將不會被顯示在最新標籤頁上。
Fastlane結構
第一種結構旨在與Fastlane提供工具相容。
基本的檔案結構如下。請注意右邊的註釋。當創建專案結構時,這些檔案一定要被放置在正確的位置,如下所述。
├── en-US (en-US is the F-Droid fallback language)
│ ├── short_description.txt (short description, max 80 chars, mandatory)
│ ├── full_description.txt (full app description, mandatory)
│ ├── title.txt (app name)
│ ├── video.txt (URL to a video introducing the app)
│ ├── images
│ │ ├── icon.png (app icon, mandatory if your app doesn't include any png icon)
│ │ ├── featureGraphic.png (promo banner, shown on top of the app desc in F-Droid client; landscape)
│ │ ├── tvBanner.png ("icon" for TV devices, currently not used)
│ │ ├── phoneScreenshots
│ │ │ ├── 1.png
│ │ │ ├── 2.png
│ │ │ ...
│ │ ├── sevenInchScreenshots/
│ │ ├── tenInchScreenshots/ (you may add different screenshots for different screen sizes)
│ │ ├── tvScreenshots/
│ │ └── wearScreenshots/
│ └── changelogs
│ ├── 100000.txt (must correspond to versionCode, literally, no padding)
│ ├── 100100.txt (if the version code was set to 100100)
│ └── 100101.txt (maximum size: 500 characters)
└── ru (other locale codes)
... (localized metadata is always preferred by the client)
└── changelogs
└── 100100.txt
這個結構必須放置在軟體庫根目錄的以下位置之一:
metadata/
fastlane/metadata/android/
注意,把這個結構放在其他地方,比如在 gradle 模塊的根目錄下將不能正常工作。
Build flavors and multiple apps inside one repository are currently not properly supported. (Follow this issue tracking the implementation of this.)
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)
│ ├── short-description.txt (short description, max 80 chars, mandatory)
│ ├── full-description.txt (full app description, mandatory)
│ ├── video-url.txt (URL to a video introducing the app)
│ ├── whatsnew (alternative changelog location; single file, no .txt)
│ └── graphics
│ ├── icon (app icon; mandatory if your app doesn't include any png 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.txt
would 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
Precedence
當多個上述選項提供中介資料時應用程式以下一般優先規則:
- 中介資料檔案(即
<fdroiddata>/metadata/<packageId>.yml
)覆蓋fdroiddata 檔案,甚至是在地化的。 - fdroiddata 檔案覆蓋應用程式原始碼中的中介資料。
- 應用程式名稱等資料也包含在 APK 檔案中,前兩個選項均會覆蓋此類資料。
然而,也應用以下更具體的規則:
- 來自應用程式的 fdroiddata 源的圖像檔案覆蓋軟體庫中的檔案。