Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

JRuby/Java - add POGOProtos files to package, make them accessible from JRuby #19

Open
ELynx opened this issue Sep 6, 2016 · 5 comments

Comments

@ELynx
Copy link
Owner

ELynx commented Sep 6, 2016

Add output .rb (and .proto?) from POGOProtos to APK, and make it so that they can be:

  • called from Ruby code
  • updated when new APK is installed

Does Ruby have a form of "compiled" distribution? Or can JRuby call Java and use POGOProtos compiled to Java?

@griest024
Copy link
Collaborator

ruby does have a 'compiled' distribution, they are called gems. in order to load the compiled POGOProtos, the JRuby would need the google-protobuf gem installed (jruby -S gem install google-protobuf). I haven't managed to package any gems with the app yet. That's another feature that might rely on bundling jruby with the app. Some relevant links

Instead, I think we should parse all pogo messages with Java and then pass that data to ruby for processing.

@ELynx
Copy link
Owner Author

ELynx commented Sep 6, 2016

What will be "pass" format? If we compile Java POGOProtos, will JRuby use Java classes?
E.g. we pass byte array containing request, in JRuby we can do same as in Java

RequestEnvelope request = RequestEnvelope.parseFrom(buffer);

in Ruby syntax.
I saw something similar in Ruboto, but can't understand how deep this go. Coming from C++ I expect that JRuby will know nothing about Java and vice versa, save for interface we code.

@griest024
Copy link
Collaborator

JRuby can load and use Java classes, and I suspect that we can use that feature to import the protobuf classes. It may not even matter since ruby is dynamically typed, I'll do some testing tonight.

@griest024
Copy link
Collaborator

First we need the jruby branch to load the POGOProtos into Java

@ELynx
Copy link
Owner Author

ELynx commented Sep 7, 2016

I will restore that, just as in branch right-now.
Java - much reflection :doge:

ELynx added a commit that referenced this issue Sep 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants