准备好signapk.jar包,platform.pk8,platform.x509.pem,放到app路径下和app的gradle同级别,
/**
* 给debug包签名
*/
task signTVDebugApk(type: Exec, description: 'sign apk') {
workingDir '/'
def outputFileName = "app_debug_singed.apk"
File file = new File("./build/outSignApk");
if(!file.exists())
file.mkdirs();
def myCommond = [
'java', '-jar', 'signapk.jar', '-w', 'platform.x509.pem', 'platform.pk8', './build/outputs/apk/debug/app-debug.apk',"./build/outSignApk/"+outputFileName
]
commandLine myCommond
}
/**
* 卸载apk
*/
task signTVUninstallApk(type: Exec, description: 'uninstall apk') {
commandLine 'adb', 'uninstall', android.defaultConfig.applicationId
}
/**
* 安装apk
*/
task signTVDebugInstallApk(type: Exec, description: 'install dbugapk') {
def