How to use the F-Droid libraries, like CalyxOS

When we built the next-generation F-Droid client, we rewrote
our code to fit into re-usable libraries, so other projects can make use of
F-Droid technology with minimal hassle.

The libraries

So far, we have published three libraries. Two of them are written in
Kotlin multi-platform, so they can be used outside Android as well. For
example, you could use them to write a command line or even an iOS client.

Check out their
README

for how to include them in your project.

Download library

This library includes everything you need to download F-Droid repositories
and the APKs and images included in them. It handles resuming of downloads,
repository mirrors and takes care of the special HTTP cases that an F-Droid
client can encounter.

The Android version of the library also takes care of rejecting TLS older
than 1.2 as well as weak ciphers. It prevents DNS leaks when using Tor as a
proxy and uses a short TLS session timeout to prevent tracking and key
re-use. If you use Glide as an image loader, it also comes with a special
ModelLoader to be used with Glide.

Please see the API
docs
for details.
Check how F-Droid switched to the download
library
for
an example.

Index library

The multi-platform index library gives you everything you need to handle
F-Droid repository indexes. Of course, there’s a parser for reading and
representing the indexes internally. For version 1 indexes, there is also a
creator which F-Droid uses to create its own nearby swap repositories. Both
versions have a signature verifier, so you can always make sure that the
repository is properly signed before working with its data.

Apart from these basics, the library also has many useful classes that help
you to choose the best translation based on the user’s locale, to check if
an app is compatible with the current device, and to check if an app has an
update available in the repository index. There are classes for processing
streams of index data, so you don’t need to load the entire index into
memory which can be an issue on devices with little RAM. If you prefer to
work only with the version 2 format internally, the library features an
index converter which can convert version 1 format into version 2.

F-Droid clients wishing to make use of version 2 delta updates, also find
helpful classes for this, so they don’t have to re-invent the wheel
themselves.

Please see the API docs
for details. Check how F-Droid switched to the index
library
for
an example.

Database library

In case you need to persist F-Droid repository information in your Android
app, this library is for you. It stores F-Droid related information such as
repositories, apps and their versions. Then allows you to query and search
for them. Under the hood, it uses a Room database which in turn uses
sqlite.

Besides database related classes, this library currently also includes
classes related to updating repositories, so that information fetched from
the internet (using the downloader library) can be streamed directly into
the database.

Please see the API
docs
for details.
Check how F-Droid switched to the database
library
for
an example.

CalyxOS

The first known user of these new libraries is CalyxOS which is already
using them in two of their apps. Thanks to the libraries, they can focus
their development effort on the apps themselves and don’t need to
re-implement the F-Droid related bits.

The first app is used as part of their setup wizard that shows up after
initial install. It allows the user to install additional apps on an opt-in
basis, so they don’t need to ship as non-removable system apps. The benefit
for CalyxOS is that they can load these apps from an F-Droid repository in
the internet without needing to ship APKs as part of their ROM keeping its
size minimal.

This is their
method

to get an index representation from a file, making use of the index library:

fun getIndex(file: File): IndexV2 = file.inputStream().use { inputStream ->
    IndexParser.parseV2(inputStream)
}

The second app uses F-Droid to keep its own essential apps up to date. With
a minimal UI, its main purpose is to regularly check for updates and install
them in the background, once available.

The app makes use of the UpdateChecker of the index library to check if
updates are available:

private fun getUpdate(packageName: String, packageVersions: List<PackageVersionV2>): PackageVersionV2? {
    val packageInfo = packageManager.getPackageInfo(packageName, GET_SIGNATURES)
    return updateChecker.getUpdate(packageVersions, packageInfo)
}

(Full code
example
)

Both of these
apps
don’t need
to persist any data, so they only use the download and the index library.

The library work was funded by the FFDW-DVD grant

Criador da inteligência artificial diz estar arrependido

Video by via Dailymotion Source Um dos criadores da inteligência artificial se diz arrependido do trabalho e alerta para o risco das novas tecnologias. Geoffrey Hinton é considerado uma das maiores autoridades do mundo quando o assunto é inteligência artificial, sendo um dos cientistas pioneiros da tecnologia. Assista ao Jornal da Manhã completo: https://www.youtube.com/watch?v=tOjqWKtj-U0 Baixe … Read more

Cara Memberi Material Pada Logo Youtube Menggunakan Blender 3D

Video by via Dailymotion Source Sebelumnya, yuk belanja Buku Desain Grafis The Magic Of Blender 3D Modelling 37 Total Tutorial di sini: 1. https://tokopedia.link/xdQ7QR7Pizb Dan beli buku CD Tutorial The Magic Of Blender 3D Modeling Versi 2.8 Dan 2.9 di sini: 2. https://tokopedia.link/kQx3SS3Rizb Di sini dijelaskan bagaimana caranya memberi material pada logo youtube menggunakan Blender … Read more

Beauty Gonzalez, personal choice ni Lani Mercado na gampanan ang dating role bilang “Matinik na…

Video by via Dailymotion Source 24 Oras is GMA Network’s flagship newscast, anchored by Mike Enriquez, Mel Tiangco and Vicky Morales. It airs on GMA-7 Mondays to Fridays at 6:30 PM (PHL Time) and on weekends at 6:00 PM. For more videos from 24 Oras, visit http://www.gmanetwork.com/24oras. #Nakatutok24Oras Breaking news and stories from the Philippines … Read more

Levels – Revit Creating and Managing Levels

Video by via Dailymotion Source Levels – Revit Creating and Managing LevelsIn this video, we’ll cover the basics of creating and managing levels in Revit. Levels are a crucial part of any building design, as they define the height and elevation of different parts of a building. First, we’ll show you how to create a … Read more

汛期來臨!林右昌視察災害應變中心 籲民眾下載防災APP

Video by via Dailymotion Source 汛期來臨!林右昌視察災害應變中心 籲民眾下載防災APP https://news.ltn.com.tw/news/politics/breakingnews/4288623 台灣汛期為每年5月初至11月底,是雨量最豐沛的梅雨及颱風季節,內政部長林右昌今天下午4時,特別視導中央災害應變中心,聽取「消防防災e點通APP」以及「應變管理資訊系統(EMIC)」2項簡報;林右昌除了呼籲民眾下載這套APP,並強調「台灣在相關管理應變資訊系統,在國際上是名列前茅的」。 —————————————————- 我們的頻道➔ http://video.ltn.com.tw YouTube➔ https://www.youtube.com/user/tvforltn Dailymotion➔ https://www.dailymotion.com/LibertyTimes Go to Source

Alessandra Sublet sort du silence après de longs mois d’absence : “un nouveau départ” étonnant !

Johnny Star: Merci beaucoup d’avoir regardé!
Si vous souhaitez plus de nouvelles, abonnez-vous à la chaîne!
CLIQUEZ ICI POUR INSCRIRE: https://goo.gl/aNWbA4
Alessandra Sublet sort du silence après de longs mois d’absence : “un nouveau départ” étonnant !
Musique est protégé des droits d’auteur par: https://www.ntmediastudio.com/
Musique de fond utilisée dans vidéo de cette chaîne: https://www.youtube.com/channel/UCIZ8_Xpxgn_lONAp32IEJqA
Tous les risques n’auront pas la saveur du succès quelle sera le titre du premier spectacle d’Alessandra Sublet qui goûte déjà l’aventure ce mercredi 26 avril l’ancienne animatrice de télévision a annoncé sa reconversion sur son compte Instagram dans ce pot elle partage donc la fiche de son nouveau projet accompagné d’une légende explicative sur la teneur de ce spectacle une longue absence pour un nouveau départ et une aventure qui me tenait à cœur a-t-elle écrit sur ses réseaux je suis très heureux de vous retrouver bientôt différemment tous les risques n’auront pas la saveur du succès c’est une longue réflexion que j’ai eu sur notre faculté à faire des choix sur les chemins de vie que nous empruntons [Musique] en somme surtout ces obstacles qui jalonnent notre existence et que chacun doit essayer de surmonter pour trouver son propre épanouissement après avoir présenté pour le petit écran les émissions incroyables talents et l’amour et dans le pré Alessandra Sublet a entamé une traversée du désert mais c’est bien sûr les planches que l’ancienne animatrice a décidé de faire son grand retour avec tous les risques n’auront pas la saveur du succès lancienne présentatrice de M6 se lance dans une nouvelle aventure dont nous espérons que le titre ne reflète pas le futur du projet supérieur à supérieur à Alessandra Sublet élément de sa galaxie ou voir à Alexandra Sublet joué dans son post Instagram Alessandra Sublet a indiqué quel serait présente au festival d’Avignon et dans la capitale cet au Théâtre du Chêne Noir dans le 19e arrondissement officiera l’ancienne animatrice de M6 du 7 au 29 juillet 2023 nos audaces ne mènent pas nécessairement à la réussite mais je crois qu’il est important de les suivre pour progresser et se réaliser rendez-vous du 7 au 29 juillet @estivalope Avignon au théâtre @2 Arduino noir rose merci @ Jean-Marc Dumontet pour ta confiance @françois relans pour cette photo @ antonybazartiste pour cette affiche@an [Musique] Bouvier 0 4 4 pour la mise en scène merde article écrit en collaboration avec 6 médias crédits photos Rachid Belak [Musique] S [Musique]