pokemon-go-xposed-mitm icon indicating copy to clipboard operation
pokemon-go-xposed-mitm copied to clipboard

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

Open ELynx opened this issue 8 years ago • 5 comments

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?

ELynx avatar Sep 06 '16 08:09 ELynx

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.

griest024 avatar Sep 06 '16 15:09 griest024

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.

ELynx avatar Sep 06 '16 16:09 ELynx

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 avatar Sep 06 '16 22:09 griest024

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

griest024 avatar Sep 07 '16 03:09 griest024

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

ELynx avatar Sep 07 '16 09:09 ELynx