Compile android project to apk without eclipse

前端 未结 2 551
被撕碎了的回忆
被撕碎了的回忆 2021-01-03 07:38

What I have done is I have taken the class-files from my eclipse project and run them trough an optimizer/obfuscator. So I now have optimized class-files that I want to get

2条回答
  •  佛祖请我去吃肉
    2021-01-03 08:10

    you can try to put them in bin/classes and then use "ant" command to build your application

    cd /path/to/my/app
    ant release
    

    it will ask you every time for your private key to sign the app, it can be configured to auto-sign by editing "build.properties" file:

    key.store=release.keystore
    key.alias=release
    key.store.password=my_key_password
    key.alias.password=my_key_password
    

    you can also investigate Android SDK, find the ANT build scripts it actually uses, and insert your custom obfuscator/optimizer call in middle of build process.

提交回复
热议问题