Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump targetSdk to 30 (again :p) #276

Merged
merged 1 commit into from
Jun 7, 2021
Merged

Conversation

pazos
Copy link
Member

@pazos pazos commented Dec 16, 2020

Binaries need to be bundled as shared libraries to avoid W^X on Android 10+

Is still possible to dlopen libraries from app home directory on Android 11, but that might change soon.

Symlink binaries stored in readable storage to the app home dir, where they're expected. Read symlinks from assets/module/map.txt

This works fine for binaries, but for shared libraries the minSdk needs to be bumped to API23. Since we're fine with targetSdk 30, as we were with targetSdk 28, there's no need to overcomplicate stuff for now.

At build time:

  1. place shared libraries in libs/$(ANDROID_ABI)
  2. place a symbolic map in assets/module/map.txt

At runtime map.txt is checked and symbolic links created.


This change is Reviewable

Copy link
Member

@Frenzie Frenzie left a comment

Choose a reason for hiding this comment

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

If it works, then /shrug ;-)

@pazos
Copy link
Member Author

pazos commented Dec 19, 2020

If it works, then /shrug ;-)

It is a work in progress. It works fine for both sdcv and unversioned libraries. The only deal breaker is libluacompat52.so, which is found 3 times and only the last one is copied to platform/android/luajit-launcher/libs

My idea is to fix koreader/koreader-base#1237 first (deversioning but renaming as needed), put everything as jniLibs and make symbolic links that match other platforms at runtime using android.bootstrap()

This superseedes #175 and should fix #16

@pazos pazos mentioned this pull request Dec 19, 2020
@pazos

This comment has been minimized.

@pazos
Copy link
Member Author

pazos commented Dec 26, 2020

@Frenzie @NiLuJe: this is ready to review. Works fine on top of current master.

Mainly we attempt to extract all assets in "module" in a single step.

for each asset:

  • if it is an 7z file extract it on filesDir
  • if it is a file called "module/map.txt" parse it and link nativeLibsDir to filesDir
  • if it is a file other than "module/version.txt" copy it on filesDir.

Other minor changes:

  • we read the version from a text file
  • the dots "dialog" is started each time we attempt to bootstrap assets and last the entire asset extraction, including linking and copying raw assets.

Copy link
Member

@Frenzie Frenzie left a comment

Choose a reason for hiding this comment

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

No real comments while reading, but I haven't yet tested it.

@pazos pazos linked an issue Dec 26, 2020 that may be closed by this pull request
@pazos pazos marked this pull request as draft December 27, 2020 00:00
@pazos pazos marked this pull request as ready for review May 10, 2021 18:41
@pazos
Copy link
Member Author

pazos commented May 10, 2021

Updated to support executing sdcv with targetSdk 30. Shared libraries are untouched as there's no way to get them outside filesDir that works across supported android versions.

Another related topic is the translation of https://github.com/koreader/android-luajit-launcher/blob/master/app/src/main/res/values/strings.xml. Since we have different projects hosted on weblate I think we can afford one extra project :)

@pazos
Copy link
Member Author

pazos commented Jun 6, 2021

Updated to support executing sdcv with targetSdk 30. Shared libraries are untouched as there's no way to get them outside filesDir that works across supported android versions.

Updated on top of master, which a few other fixes for recent-ish changes. Ready to be reviewed (and hopefully merged)

Copy link
Member

@Frenzie Frenzie left a comment

Choose a reason for hiding this comment

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

No comment. I trust you on the symlink stuff. ;-)

@pazos pazos merged commit 56e4fb5 into koreader:master Jun 7, 2021
@pazos pazos deleted the sdcv_android10 branch June 7, 2021 12:14
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.

Alternative approach for resource bundle?
2 participants