Thursday, November 3, 2011

Create JAR suitable for use with Dalvikvm

1. Create Helloworld.java:
package org.apache;

public class HelloWorld {
public static void main(String[] args) {
}
}
2. Compile java:
javac -d . -g Helloworld.java
3. Package Java Into a temporary jar
jar -cvf Temp.jar *
4. Use DX to generate classes.dex from Temp.jar
dx --dex --output=classes.dex Temp.jar
5. Use aapt to create new Jar (CmdLine.jar) suitable for use with Dalvikvm
aapt add CmdLine.jar classes.dex
6. Push Jar to folder:
adb shell
    mount -o remount /system
    exit
adb push CmdLine.jar /system/framework/
7. Restart:
adb reboot

No comments:

Post a Comment

[ROM] Samsung S7 Stock Firmware BRI (Taiwan台灣)

Latest ROM: G930FXXU1DQEU Download: https://kfhost.net/tpl/firmwares.php?record=B7E6DE774E3811E7963AFA163EE8F90B Reference: http://...