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

Ruboto+JRuby - almost got it #11

Open
ELynx opened this issue Aug 31, 2016 · 8 comments
Open

Ruboto+JRuby - almost got it #11

ELynx opened this issue Aug 31, 2016 · 8 comments
Assignees
Milestone

Comments

@ELynx
Copy link
Owner

ELynx commented Aug 31, 2016

To set up application with ruboto use JRuby version 1.7.24. Exactly, later versions seem to fail miserably.
With that in mind, and latest commits, it is possible to start JRuby. But script file is not found by engine:

D/RUBOTO: EntryPointActivity onCreate:
I/System.out: RubotoActivity onCreate(): com.elynx.pogoxmitm.ScriptTestActivity, finishing: false
D/RUBOTO: Looking for Ruby class: ScriptTestActivity
D/RUBOTO: Found: null
D/RUBOTO: Checking path: /storage/emulated/0/Android/data/com.elynx.pogoxmitm/files/scripts/script_test_activity.rb
D/RUBOTO: Checking path: scripts/script_test_activity.rb
D/RUBOTO: Classpath resource: null
E/RUBOTO: Missing script and class.  Either script or predefined class must be present.

So, help wanted - where to place script_test_activity.rb in project so JRuby will see it?

@griest024
Copy link
Collaborator

griest024 commented Aug 31, 2016

@ELynx I don't think we should be using EntryPointActivity. I was able to run arbitrary Ruby scripts with this commit. The only caveat is that you must have the Ruboto Core installed on your phone.

There is a way to include full JRuby with the app (an extra 21.3 MB) but I haven't been able to get that working yet. Currently working on that.

When I ran it with EntryPointActivity, I got the same error. The error is because Ruboto expects the scripts to be in project-root/src, which is the old Android project structure. Install the Ruboto core on your phone and try running that commit.

@griest024
Copy link
Collaborator

Better yet, checkout the jruby branch and try to run that.

@griest024 griest024 self-assigned this Aug 31, 2016
@ELynx
Copy link
Owner Author

ELynx commented Aug 31, 2016

@griest024 I think they have later version on github... I saw a tutorial to include everything from Core to APK also. But I thought that "everything" is JRuby and JRuby std lib. Apparently, there is more to that.

@ELynx
Copy link
Owner Author

ELynx commented Sep 4, 2016

I did try ruboto core. From app log - they seem to use pretty old versions of everything

09-04 16:56:55.229 18679-18679/com.elynx.pogoxmitm I/System.out: Found JRuby in platform APK
09-04 16:56:55.239 18679-18679/com.elynx.pogoxmitm I/System.out: JRuby version: 1.7.19
09-04 16:56:55.239 18679-18679/com.elynx.pogoxmitm I/RUBOTO: Setting JRUBY_HOME: file:/data/app/org.ruboto.core-1.apk!/jruby.home
09-04 16:56:55.249 18679-18679/com.elynx.pogoxmitm I/System.out: Ruby version: RUBY1_9

Looks like *,jar files are not needed, they are not added tp APK if they are in root/libs

Play store core 1.0.5 confirms this

  • Updated to JRuby 1.7.19
  • Updated to Ruboto 1.3.0
  • Updated to ActiveRecord 4.1.10

So, I am looking at ruboto-core releases. I will try to clone at tag 1.0.5 and get some resources from there.
Then get binary release of JRuby 1.7.19, and from there will try to get gem Ruboto with version 1.3.0. And with that ruboto to make an application. Whew...

@ELynx
Copy link
Owner Author

ELynx commented Sep 4, 2016

Even better idea. May be put built-in ruboto aside for some time...
With Ruboto-core scripting seem to work, and for development, who cares? Even if they come from outer space, better focus on ruby-ing. I will try just that I think.

@griest024
Copy link
Collaborator

Yeah for now, I think we should use Ruboto core. Its not that much of a hassle to install compared to rooting a phone and installing xposed framework. It would be nice to get built in JRuby (lots of great new features), but it may be more trouble than its worth. Lets write some hacks.

@griest024
Copy link
Collaborator

griest024 commented Sep 6, 2016

@ELynx So we are able to pass some data to a ruby script. I think this is really the last thing we needed before we can write some functional hacks, in ruby.

@ELynx ELynx changed the title Ruboto+JRuby - one more step Ruboto+JRuby - almost got it Sep 6, 2016
@ELynx ELynx added this to the JRuby - Alpha milestone Sep 6, 2016
@ELynx ELynx removed the help wanted label Sep 6, 2016
@ELynx
Copy link
Owner Author

ELynx commented Sep 6, 2016

I think I will try to make a "test environment" for this setup #17 . Make a thread pool, and call JRubyAdapter.* from there. So testing will be faster, and without PoGo actually running.

For this we need a hack framework #18 and POGOProtos this or another way #19

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