Skip to content

License Screen: Java/XML to Kotlin/Compose migration#122

Open
m4pl wants to merge 14 commits into
GrapheneOS:mainfrom
m4pl:license-compose
Open

License Screen: Java/XML to Kotlin/Compose migration#122
m4pl wants to merge 14 commits into
GrapheneOS:mainfrom
m4pl:license-compose

Conversation

@m4pl
Copy link
Copy Markdown
Contributor

@m4pl m4pl commented May 26, 2026

Migrated the Open Source Licenses screen from Java + XML to Kotlin + Compose. Added a script for generating the licenses HTML - see PR. Also updated libraries from the Conversation screen PR to avoid conflicts and code duplication.

Screenshots

Before After
Screenshot_20260526_143747 Screenshot_20260526_143839

@m4pl m4pl force-pushed the license-compose branch from 6c5ce7b to 4e2e007 Compare May 26, 2026 13:58
@m4pl m4pl requested review from RankoR and inthewaves and removed request for RankoR May 26, 2026 14:11
@m4pl m4pl marked this pull request as ready for review May 26, 2026 14:11
@m4pl m4pl requested a review from RankoR May 26, 2026 19:50
Comment thread app/build.gradle.kts
Comment on lines +135 to +141
implementation(libs.androidx.camera.camera2)
implementation(libs.androidx.camera.compose)
implementation(libs.androidx.camera.core)
implementation(libs.androidx.camera.lifecycle)
implementation(libs.androidx.camera.video)
implementation(libs.androidx.paging.compose)
implementation(libs.androidx.paging.runtime)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we need to incorporate the license generation script as a Gradle plugin so that it's auto-generated for us, e.g. these dependencies are not in the .html, and some of the versions don't match the actual versions in libs.versions.toml, e.g. org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2 is in the html, but the app actual uses version coroutines = "1.11.0"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this. I forgot to refresh the dependency cache after bumping versions in libs.versions.toml, so the script regenerated the HTML against stale input.
Agreed on moving this into Gradle. I'll try to replace the script with a Gradle task in this PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done - added a Gradle plugin under buildSrc/ (id("messaging.licenses")). Generation is now ./gradlew :app:generateLicenses.

Also regenerated assets/licenses.html against the current resolution graph.

Note: I leaned on AI for the implementation, but went through every file myself and verified the output after each step.

@m4pl m4pl force-pushed the license-compose branch from 4e2e007 to 04fd0d4 Compare May 27, 2026 23:37
@m4pl m4pl force-pushed the license-compose branch from 04fd0d4 to bade7bc Compare May 27, 2026 23:46
Comment thread app/build.gradle.kts
import java.util.Properties

plugins {
id("messaging.licenses")
Copy link
Copy Markdown
Member

@inthewaves inthewaves May 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing licenses for non-gradle-downloaded/pom dependencies such as GIFLIB (lib/platform_external_giflib) and the AOSP modules like platform_frameworks_opt_chips

These were in the previous license.html

<h3>Notices for GIFLIB</h3>

<h3>Notice for AOSP:</h3>

"LGPL-3.0-only",
"LGPL-3.0-or-later",
"MPL-1.1",
"MPL-2.0",
Copy link
Copy Markdown
Member

@inthewaves inthewaves May 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The license for OkHttp 4.12.0 includes this notice at the bottom, although the pom for it is just Apache 2.0. Maybe we need to handle this as part of the source available list

-----
NOTICE:

Note that publicsuffixes.gz is compiled from The Public Suffix List:
https://publicsuffix.org/list/public_suffix_list.dat

It is subject to the terms of the Mozilla Public License, v. 2.0:
https://mozilla.org/MPL/2.0/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No special handling needed. OkHttp itself is Apache-2.0; the MPL-2.0 only covers the bundled publicsuffixes.gz, which we don't modify. For an unmodified file the only MPL obligation is preserving its notice, which the NOTICE block already does, and it links to the upstream source.

Comment thread app/build.gradle.kts
import java.util.Properties

plugins {
id("messaging.licenses")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we probably also would need a process to make sure license html is up-to-date, maybe a GitHub workflow can regenerate (from a fresh gradle build) and fail if different from checked-in license html or something


import org.gradle.api.GradleException

internal object SpdxPolicy {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EUPL is missing. It's not popular, but worth adding just in case.

@m4pl m4pl force-pushed the license-compose branch from 2dda41d to 43882b2 Compare May 30, 2026 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants