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

Allow correct recognition of Android OS when running Termux environment #796

Merged
merged 3 commits into from
Nov 24, 2022

Conversation

arch-dev
Copy link
Contributor

@arch-dev arch-dev commented Oct 16, 2022

If isAndroid() check fails, checkIfAndroidTermux() is called which runs uname -o command and check if its output contains android. This should fix #789.

Sample command output in Termux before changes:
Screenshot_20221016-120121.png

Sample command output in Termux after changes:
Screenshot_20221016-120404.png

@gotson
Copy link
Collaborator

gotson commented Oct 17, 2022

why did you change some of the native libraries ?

@gotson
Copy link
Collaborator

gotson commented Oct 17, 2022

when running java within Termux, is it using a different Java runtime that when running a normal Android app ? What is the result of System.getProperty("java.runtime.name", "") within Termux ?

@arch-dev
Copy link
Contributor Author

Here's the output:
Screenshot_20221017-090813.png

@gotson
Copy link
Collaborator

gotson commented Oct 17, 2022

While working on #797 i am actually not sure how Termux works on Android.

  • it seems to be a JDK from eclipse, but not specific to Android?
  • however the native library needs to have been compiled with the NDK for it to work
  • that bit is apparently not triggered though, and the classic loader is used

Would you be able to check the value of the property java.vm.vendor also ?

@arch-dev
Copy link
Contributor Author

arch-dev commented Oct 17, 2022

Here you are:
Screenshot_20221017-120304.png

Note: to install Java on Termux you run pkg install openjdk-x where x is the jdk version you need. Regarding openjdk-17 it is grabbed through Termux pkg management system: https://github.com/termux/termux-packages/blob/master/packages/openjdk-17/build.sh

@gotson
Copy link
Collaborator

gotson commented Oct 17, 2022

Thanks, that confirm my understanding.

@gotson gotson added the platform request Request for support for a new platform/os/architecture label Oct 17, 2022
@gotson gotson self-assigned this Oct 17, 2022
@gotson
Copy link
Collaborator

gotson commented Nov 17, 2022

This still requires some work @arch-dev as there are conflicts, and the native libs should not have been changed. Is that something you're still working on?

@gotson gotson added waiting for feedback Waiting for a feedback from the issue creator needs rework labels Nov 17, 2022
@arch-dev arch-dev closed this Nov 22, 2022
@arch-dev
Copy link
Contributor Author

Reworked and used available ProcessRunner class.

@arch-dev arch-dev reopened this Nov 22, 2022
@gotson gotson removed waiting for feedback Waiting for a feedback from the issue creator needs rework labels Nov 22, 2022
@arch-dev arch-dev requested a review from gotson November 22, 2022 21:50
@gotson
Copy link
Collaborator

gotson commented Nov 23, 2022

@arch-dev i have refactored the code slightly and added some tests, please have a look and let me know if that's fine with you

@arch-dev
Copy link
Contributor Author

Yes good idea separing checks. Tested and it works without problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform request Request for support for a new platform/os/architecture
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failed to load native library when running in Termux
2 participants