pokemon-go-xposed-mitm
pokemon-go-xposed-mitm copied to clipboard
JRuby/Java - add POGOProtos files to package, make them accessible from JRuby
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?
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.
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.
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.
First we need the jruby branch to load the POGOProtos into Java
I will restore that, just as in branch right-now. Java - much reflection :doge: