手工命令创建空白android apk

来源:互联网 发布:成都医疗大数据公司 编辑:程序博客网 时间:2024/05/17 23:46

环境:android-sdk + jdk + apache-ant

创建工程:android create project -n hello -t 1 -p hello -k com.hello -a hello(关于 -t 用android list targets 查看版本)

更新工程:android update project -p hello -t 1 -n hello

创建密钥:keytool -genkey -alias hello.keystore -keyalg RSA -validity 10000 -keystore hello.keystore

生成APK: ant release -f hello\build.xml

签名APK:jarsigner -verbose -keystore hello.keystore -signedjar hello.apk hello\bin\hello-release-unsigned.apk hello.keystore (如果是JDK1.7的版本,需要在签名命令后边添加如下参数:-digestalg SHA1 -sigalg MD5withRSA)

空白APK才5KB,安装后发现有读写SD卡和读取手机身份权限.查看AndroidManifest.xml却没有任何权限,不知为什么,还有hello.java的中文显示乱码,查看hello\bin\classes.dex毎个中文都变成EF BF BD,请高手指点.

http://blog.sina.com.cn/s/blog_4c451e0e0101338s.html