oppia / oppia-android

A free, online & offline learning platform to make quality education accessible for all.
https://www.oppia.org
Apache License 2.0
306 stars 505 forks source link

Ensure entire license text is displayed for all the copyright licenses #3738

Open prayutsu opened 2 years ago

prayutsu commented 2 years ago

Reference Link - https://stackoverflow.com/a/51733275/12215015

We cannot have a string that is larger than 32,767 bytes (encoded in UTF-8) in your APK file but some license texts (like CDDL + GPLv2 license) that are generated by running the RetrieveLicenseTexts.kt script are larger than 32,767 bytes so they can not be displayed directly in the UI and we only show the license link in these cases.

We should display the license texts whenever possible and hence we need another solution to support displaying large license texts.

Potential solutions

  1. Rather than storing the license texts in the third_party_dependencies.xml file, we can store them in a textproto file and parse the textproto file to display the license texts.

  2. Rather than storing the license text in a single string, we can split the license text before the first whitespace character before the max_limit_of_chars store the text in an array of strings. We can then concatenate all the strings of the array while displaying the license texts in the UI.

BenHenning commented 1 year ago

To clarify point (1), we'd need to load texts into a .pb file and load that from the app's assets directory. That could work as a drop-in replacement for using string resources in a way that avoids the limit, though we'd need some additional piping through the domain layer.

dmdbilal commented 6 months ago

If this issue still open, Shall i work on it ?

adhiamboperes commented 6 months ago

If this issue still open, Shall i work on it ?

Hi, Please submit an overview of your proposed solution. You can also create a draft PR for this.