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

add ContextClassLoader interface, allow custom ContextFactory.createClassLoader for Android #403

Closed
wants to merge 1 commit into from

Conversation

kinpoo
Copy link

@kinpoo kinpoo commented Aug 29, 2019

An example RingoJS on Android at
https://github.com/kinpoo/ringojs-android-example, use
https://github.com/F43nd1r/rhino-android to dynamically load classes on
android/dalvik.

@botic
Copy link
Member

botic commented Sep 3, 2019

Can you provide a more detailed description why this change is needed (with a reference)? I guess Android requires to enforce a context class loader, but since I never developed for this platform, you have to provide further details of this change.

@kinpoo
Copy link
Author

kinpoo commented Sep 5, 2019

Android Runtime(ART) https://en.wikipedia.org/wiki/Android_Runtime is an application runtime environment for Android. ART uses the same input bytecode as Dalvik https://en.wikipedia.org/wiki/Dalvik_(software).

Android application's souce code compiled to java bytecode store as .class files, it can not run on ART directly, it must be translated to Dalvik bytecode .dex files use Android's d8/dx tool first.

Rhino's compiler org.mozilla.javascript.tools.jsc.Main can translate javascript into java bytecode .class, if need run on Android, need override the ContextFactory.createClassLoader to do the translating job.

@botic botic closed this Mar 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants