简体   繁体   English

使用ANT发布Proguarded Android应用程序

[英]Publishing Proguarded Android Application using ANT

We're using Android SDK Tools 19 and Android ADT Plugin 18, If we're publishing Application through ANT, we're getting Application Not Installed when trying to install that application. 我们使用的是Android SDK工具19和Android ADT插件18,如果要通过ANT发布应用程序,则在尝试安装该应用程序时会收到未安装的应用程序。

I also wanted to know how to use Proguard with Android Application which uses Recent ADT plugin, SDK tools. 我还想知道如何将Proguard与使用最近的ADT插件,SDK工具的Android应用程序一起使用。

We're Using Windows 7,JDK 1.7.0, Eclipse For Android Application Development. 我们正在使用Windows 7,JDK 1.7.0,Eclipse进行Android应用程序开发。 We came to know that JDK 7 (1.7.0) so try adding these options when signing with jarsigner: -digestalg SHA1 -sigalg MD5withRSA And Replaced the following property of Tools->ANT->BuildJar->Signjar 我们知道JDK 7(1.7.0),所以在用jarsigner签名时尝试添加以下选项:-digestalg SHA1 -sigalg MD5withRSA并替换了Tools-> ANT-> BuildJar-> Signjar的以下属性

<signjar
                        jar="${out.packaged.file}"
                        signedjar="${out.unaligned.file}"
                        keystore="${key.store}"
                        storepass="${key.store.password}"
                        alias="${key.alias}"
                        keypass="${key.alias.password}"
                        verbose="${verbose}" />

with these properties 

 <signjar
                        sigalg="MD5withRSA"
                        digestalg="SHA1"
                        jar="${out.packaged.file}"
                        signedjar="${out.unaligned.file}"
                        keystore="${key.store}"
                        storepass="${key.store.password}"
                        alias="${key.alias}"
                        keypass="${key.alias.password}"
                        verbose="${verbose}" /> 

as per [blog]http://stackoverflow.com/questions/8036422/android-signing-with-ant

I am also using GSON Library,Http Mime Library,Android v4 Fragment. 我也在使用GSON库,Http Mime库,Android v4 Fragment。 So after publishing,it will be published and even the application is reduced.But if i'm trying to run the published Application if it is showing Forceful Close of Application 因此,发布后,它将被发布,甚至应用程序也将减少。但是,如果我尝试运行已发布的应用程序,则显示强制关闭应用程序

If you use the default build.xml provided in the Android SDK and specify target as release, you can get proguard applied release apk file. 如果您使用Android SDK中提供的默认build.xml并将目标指定为release,则可以获取proguard应用的release apk文件。

To get build.xml , run android update project command. 要获取build.xml ,请运行android update project命令。

To make a release build, you should prepare release key and proguard.cfg file. 要进行发行版本构建,您应该准备发行密钥和proguard.cfg文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM