Add support for loading java code in addons

RESOLVED FIXED in Firefox 19

Status

()

--
enhancement
RESOLVED FIXED
7 years ago
2 years ago

People

(Reporter: kats, Assigned: kats)

Tracking

(Blocks: 1 bug)

Trunk
Firefox 19
All
Android
Points:
---
Dependency tree / graph
Bug Flags:
sec-review +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Created attachment 664984 [details] [diff] [review]
WIP

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.
Blocks: 799631
https://hg.mozilla.org/mozilla-central/rev/3cc4987101b8
Status: NEW → RESOLVED
Last Resolved: 6 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+

Updated

2 years ago
Blocks: 1363843
You need to log in before you can comment on or make changes to this bug.