zafena development

March 18, 2011

Thanks to the IcedRobot project, it are now possible to run Android .dex files on top of any GNU/Linux system using OpenJDK and JamVM!
xranby@babbage:/wd/daneel$ java -jamvm -showversion -cp target/daneel-0.0.1-SNAPSHOT-jar-with-dependencies.jar \
-Djava.system.class.loader=org.icedrobot.daneel.loader.DaneelClassLoader -Ddaneel.class.path=src/test/java/resources/HelloDroid.dex \
org.icedrobot.test.HelloDroid

java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8.3) (6b18-1.8.3-2+squeeze1)
JamVM (build 1.6.0-devel, inline-threaded interpreter with stack-caching)

Trying to find class 'org.icedrobot.test.HelloDroid' ...
Hello Android!

xranby@babbage:/wd/daneel$ uname -a
Linux babbage 2.6.28-11-imx51 #42 Tue Jun 23 11:27:23 BST 2009 armv7l GNU/Linux


# If you want to try this yourself then follow these simple steps:
# Install all tools needed on Debian to build and run IcedRobot.
sudo apt-get install openjdk-6-jdk maven2 mercurial

# Fetch the latest IcedRobot danieel sources using mercurial
hg clone http://icedtea.classpath.org/icedrobot/hg/daneel/

# Build and enjoy running a HelloDroid.dex on your GNU/Linux system!
cd daneel
mvn package
mvn clean install assembly:assembly

java -cp target/daneel-0.0.1-SNAPSHOT-jar-with-dependencies.jar -Djava.system.class.loader=org.icedrobot.daneel.loader.DaneelClassLoader -Ddaneel.class.path=src/test/java/resources/HelloDroid.dex org.icedrobot.test.HelloDroid
Trying to find class 'org.icedrobot.test.HelloDroid' ...
Hello Android!

java -cp target/daneel-0.0.1-SNAPSHOT-jar-with-dependencies.jar org.icedrobot.daneel.rewriter.Main src/test/java/resources/HelloDroid.dex org.icedrobot.test.HelloDroid
()V
00000 HelloDroid : : ALOAD 0
00001 HelloDroid : HelloDroid : INVOKESPECIAL java/lang/Object. ()V
00002 HelloDroid : : RETURN

main([Ljava/lang/String;)V
00000 String . : : GETSTATIC java/lang/System.out : Ljava/io/PrintStream;
00001 String . : PrintStream : ASTORE 0
00002 PrintStream . : : LDC "Hello Android!"
00003 PrintStream . : String : ASTORE 1
00004 PrintStream String : : ALOAD 0
00005 PrintStream String : PrintStream : ALOAD 1
00006 PrintStream String : PrintStream String : INVOKEVIRTUAL java/io/PrintStream.println (Ljava/lang/String;)V
00007 PrintStream String : : RETURN

Hello Android!

2 Comments »

  1. Cool!

    Comment by Mario Torre — March 18, 2011 @ 02:29

  2. Congrats! Really cool stuff guys!

    Comment by Pekka Enberg — March 18, 2011 @ 07:54

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress