JiaGuLeGu:根据腾讯乐固命令行实现的自动化插件。
JiaGuLeGu 为apk提供快速加固,解放双手,实现自动化流程。解决“腾讯乐固”用命令行加固繁琐,用UI界面操作不能实现自动化的应用场景
在位于项目的根目录 build.gradle
文件中添加 JiaGuLeGu 插件的依赖, 如下:
buildscript {
dependencies {
classpath 'com.zf.plugins:JiaGuLeGu:1.0.2'
}
}
并在当前App的 build.gradle
文件中apply这个插件
apply plugin: 'legu'
jiaGuLeGuConfig {
//乐固 jar 包位置
leGuJarFilePath new File("E:\\XXX\\ms-shield.jar").absolutePath
//对应用 “腾讯乐固文档” 里的 sid
secretId "XXXXXX"
//对应用 “腾讯乐固文档” 里的 skey
secretKey "XXXXXX"
items {
hauyi {
//需要加固的apk
uploadPath new File("E:\\XXX\\ms-shield.jar").absolutePath
//加固后的apk输出文件夹
downloadPath new File("E:\\XXX\\out\\").absolutePath
}
}
}
jiaGuLeGuConfig {
//乐固 jar 包位置
leGuJarFilePath new File("E:\\XXX\\ms-shield.jar").absolutePath
//对应用 “腾讯乐固文档” 里的 sid
secretId 'XXXXXX'
//对应用 “腾讯乐固文档” 里的 skey
secretKey 'XXXXXX'
//统一配置优先级低于 自定义配置--------------start---------------------
//代理地址,可选参数。设置形如https://dev.proxy.oa.com:8080
proxy 'XXXXXX'
//加固成功后打开文件夹
isOpenOutputDir true
//统一配置--------------end---------------------
items {
abcRelease {
//待加固apk文件的路径,必选参数。-uploadType为file时候制定本地待加固apk文件的路径;-uploadType为url时候指定远程apk文件url
uploadPath new File("E:\\XXX\\out\\debug.apk").absolutePath
//加固后apk的路径,必选参数。请务必保证路径可写权限
downloadPath new File("E:\\XXX\\out\\").absolutePath
//待加固文件类型,可选参数。默认是file,其他可选url
uploadType 'file'
//下载类型,可选参数。默认是file,将自动下载文件,url打印加固后的url
downloadType 'file'
//自定义配置,优先统一配置--------------start---------------------
//代理地址,可选参数。设置形如https://dev.proxy.oa.com:8080
proxy 'XXXXXX'
//加固成功后打开文件夹
isOpenOutputDir true
//自定义配置,优先统一配置--------------end---------------------
}
}
}
配置参数详细说明
生成apk签名包:
./gradlew apkSign${配置名称(首页字母大小)}
如上面的配置,生成签名包需要执行如下命令:
./gradlew leguAbcRelease
查看乐固版本:
./gradlew leguShowVersion
升级乐固:
./gradlew leguUpdate
- 输出乱码?
- Read The Fucking Source Code
- 通过提交issue来寻求帮助
- 联系我们寻求帮助.(QQ群:366399995)
- 欢迎提交issue
- 欢迎提交PR
Copyright 2017 903600017
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.