forked from PrismJS/prism
-
Notifications
You must be signed in to change notification settings - Fork 2
/
prism-smali.html
30 lines (22 loc) · 872 Bytes
/
prism-smali.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<h2>Full example</h2>
<pre><code># Source: https://github.com/JesusFreke/smali/blob/master/examples/HelloWorld/HelloWorld.smali
.class public LHelloWorld;
#Ye olde hello world application
#To assemble and run this on a phone or emulator:
#
#java -jar smali.jar -o classes.dex HelloWorld.smali
#zip HelloWorld.zip classes.dex
#adb push HelloWorld.zip /data/local
#adb shell dalvikvm -cp /data/local/HelloWorld.zip HelloWorld
#
#if you get out of memory type errors when running smali.jar, try
#java -Xmx512m -jar smali.jar HelloWorld.smali
#instead
.super Ljava/lang/Object;
.method public static main([Ljava/lang/String;)V
.registers 2
sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
const-string v1, "Hello World!"
invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V
return-void
.end method</code></pre>