首页
社区
课程
招聘
[旧帖] [求助]HelloWorld.smali 回编后在Dalvik下运行报语法错误... 0.00雪花
发表于: 2015-12-8 21:53 1737

[旧帖] [求助]HelloWorld.smali 回编后在Dalvik下运行报语法错误... 0.00雪花

2015-12-8 21:53
1737
.class public LHelloWorld;
.super Ljava/lang/Object;
.method public static main([Ljava/lang/String;)V
  .registers 5
  .parameter
  .prologue
  const v0, 0x2
  const v1, 0x4
  add-int/2addr v0, v1
  new-instance v3, Ljava/lang/StringBuilder;
  invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
  const-string v3, "The result is : "
  sget-object v2, Ljava/lang/System;->out:Ljava/io/PrintStream;
  invoke-virtual {v2, v3}, Ljava/lang/PrintStream;->print(Ljava/lang/String;)V
  invoke-virtual {v2, v0}, Ljava/lang/PrintStream;->println(Ljava/lang/Integer;)V
  return-void
.end method


功能:就是将两个数相加然后输出结果

编译后在手机上运行,adb shell 给我这样的报错信息:
Unable to find static main(String[]) in 'HelloWorld'
java.lang.VerifyError: Verifier rejected class HelloWorld due to bad method void HelloWorld.main(java.lang.String[]) (declaration of 'HelloW
orld' appears in /storage/extSdCard/HelloWorld.zip)

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回
//