Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

compile Java to native Android instead of writing in C

We are looking for a way to protect our code and obfuscation is not enough. Is it possible to compile Android java code to a native Android library?

Another option would be to write the code in c and connect with it through JNI ourselves. But the code we have is quite elaborate and well tested, a rewrite to c would start the testing all over.

PS: Before we were running on x86 hardware and used Excelsior Jet as a means for protection. As we want to move to more cost-effective (cheaper) Arm/android hardware we are looking for a simular solution as Jet, which alas only compiles to x86.

like image 866
bluevoid Avatar asked Jun 03 '13 11:06

bluevoid


1 Answers

In theory you should be able to use LLVM. It has:

  • A Java frontend
  • A C backend

In principle, this could do what you need. However I imagine you'd need to distribute (in compiled form) lots of the Java class library. All in all, it sounds really hard. And someone who really wants to read the code won't have too much problem with ARM disassembly...

like image 81
Adrian Taylor Avatar answered Sep 28 '22 07:09

Adrian Taylor