Closed Bug 794479 Opened 11 years ago Closed 11 years ago

Add support for loading java code in addons

Categories

(Firefox for Android Graveyard :: General, enhancement)

All
Android
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 19

People

(Reporter: kats, Assigned: kats)

References

Details

Attachments

(1 file)

Attached patch WIPSplinter Review
Turns out it's not that hard to load arbitrary java code from an addon into Fennec.

1. Apply the attached WIP to fennec
2. Grab the sample addon from https://github.com/staktrace/fennec-addon-javaddon and install it into fennec
3. ???
4. Profit!

If we want to expose this we should probably have some well-defined API interfaces that the addon java code can be compiled against, and that are provided to the addon java code at runtime.
Adding sec-review-needed since this will allow running arbitrary java code in the fennec process.
Whiteboard: sec-review-needed
Holy crap this is a small patch. Exciting!
Comment on attachment 664984 [details] [diff] [review]
WIP

Brad suggested landing this patch and putting together a proper API for addons in follow-up bugs. So requesting review here.
Attachment #664984 - Flags: review?(mark.finkle)
Comment on attachment 664984 [details] [diff] [review]
WIP

I am eager to see what projects this feature can open up in Firefox.

I wouldn't mind seeing some examples and a brief doc on what can _and_can't be done using this idea. For example, I assume we can run standalone Java code, but can the code interact with the Firefox UI?
Attachment #664984 - Flags: review?(mark.finkle) → review+
Assignee: nobody → bugmail.mozilla
Also, we might want to move to a JS ctypes -> JNI approach instead of the Dex:Load JSON message.
(In reply to Mark Finkle (:mfinkle) from comment #4)
> I wouldn't mind seeing some examples and a brief doc on what can _and_can't
> be done using this idea. For example, I assume we can run standalone Java
> code, but can the code interact with the Firefox UI?

It should be able to, since it's in the same process.
https://hg.mozilla.org/mozilla-central/rev/3cc4987101b8
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 19
Flags: sec-review?
Whiteboard: sec-review-needed
Flags: sec-review? → sec-review?(mgoodwin)
Dealt with (along with Java APIs in bug 805436) in https://wiki.mozilla.org/Security/Reviews/MobileJavaAddOns
Flags: sec-review?(mgoodwin) → sec-review+
Blocks: 1363843
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.