Forum: JRuby Obfuscating rails code with jruby

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A6a170c33a7a70686cd5314979755771?d=identicon&s=25 Matt Ramirez (mbramire)
on 2015-06-25 23:20
Well im trying to turn my .rb files (for example
application_controller.rb) into .class files (java byte files) to
obfuscate them.

I can do that by running javac application_controller.rb from the
command line and it gives me application_controller.class which is
pretty obfuscated.

According to some older documentation I should be able to delete the
application_controller.rb and jRuby will just use the .class file at
runtime - https://github.com/jruby/jruby/wiki/RailsAOT

However that doesnt work at all. So then I tried using a java_import
method to load that class like this -
https://www.ruby-forum.com/topic/216572#939791

But I get an error saying 'cannot import application_controller as
application_controller' Im guessing because ruby wants camel case class
names and I can see by decompiling the byte code that the java class is
named application_controller.

Basically, I just need to figure out a way to obfuscate the source to
protect it.

ALSO, I have looked at using warble to generate a .war, but we already
have a solid IIS and puma environment using jruby that I cant really
mess with.
This topic is locked and can not be replied to.