task signTVApk(type: Exec, description: 'sign apk') { delete 'app-debug-sign.apk'//delete original files, avoid using OS depended commands like "del" workingDir '/' def myCommond = [ 'java', '-jar', 'signapk.jar', '-w', 'platform.x509.pem', 'platform.pk8', './build/outputs/apk/debug/app-debug.apk', "app-debug-sign.apk" ] commandLine myCommond // commandLine 'cmd',"/c","dir" //list all files, only for test, we should avoid using commands that depended on OS }
参考 https://blog.csdn.net/lixiaodaoaaa/article/details/51594404