android lib工程打包并且混淆

Build.xml 参考如下:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>


<project basedir="." default="build" name="sdk2.0.0">

    <taskdef resource="jockytasks">
    </taskdef>

    <property file="build.properties" />

    <property name="output.dir" value="${out.dir}" />
    <property name="target" value="1.7" />
    
    <path id="project.classpath">
        <pathelement location="${project.bin.classes}" />
        <pathelement location="${android.jar}"></pathelement>
        <pathelement location="${extend1.jar}"></pathelement>
        <pathelement location="${extend2.jar}"></pathelement>
        <pathelement location="${extend3.jar}"></pathelement>
        <pathelement location="${extend4.jar}"></pathelement>
        <pathelement location="${extend5.jar}"></pathelement>
        <pathelement location="${extend6.jar}"></pathelement>
        <pathelement location="${extend7.jar}"></pathelement>
        <pathelement location="${extend8.jar}"></pathelement>
        <pathelement location="${extend9.jar}"></pathelement>
        <pathelement location="${extend10.jar}"></pathelement>
    </path>
    
    <target name="init" depends="clean">
        <mkdir dir="${output.dir}" />
        <mkdir dir="${output.dir}/bin/classes" />
    </target>
    
    <target name="clean">
        <delete dir="${output.dir}/bin/classes" />
        <delete dir="${output.dir}" />
    </target>
    
    <target depends="init" name="compile">
        <echo message="${ant.project.name}: ${ant.file}" />
        
        <javac destdir="${output.dir}/bin/classes" target="${target}"
            includeantruntime="no" encoding="utf-8" fork="yes">
            <src path="src" />
            <classpath refid="project.classpath" />
        </javac>
    </target>

    <target name="build" depends="compile" >
        <echo>        Proguad ....    </echo>
        
        <jar basedir="${output.dir}/bin/classes" destfile="temp.jar" />
        
        <java failοnerrοr="true" fork="true" jar="E:\Yangzc\android\android_sdk\tools\proguard\lib\proguard.jar">
            <arg value="-injars temp.jar" />
            <arg value="-outjars optimized.jar" />
            <arg value="-libraryjars ${android.jar}" />
            <arg value="@proguard-project.txt" />
        </java>
        
        <delete file="temp.jar" />
        <delete dir="${output.dir}/bin/classes" />
        <mkdir dir="${output.dir}/bin/classes" />
        <unzip dest="${output.dir}/bin/classes" src="optimized.jar" />

    </target>

</project>


Python:脚本参考如下;

if __name__ == '__main__':

    cmd3 = 'ant -f  + ''build.xml build'
    os.system(cmd3)


Build.property 主要是一些必要jar的路径。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值