# FirmPlugin **Repository Path**: zzuli/FirmPlugin ## Basic Information - **Project Name**: FirmPlugin - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-02-23 - **Last Updated**: 2021-07-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # FirmPlugin Gradle插件使用说明 FirmPlugin 是360加固gradle插件,并支持自动上传蒲公英 `/build.gradle`文件如下: ``` buildscript { repositories { jcenter() } dependencies { ... classpath 'com.jiandan.plugin:FirmPlugin:latest.release' } }} ``` 其中latest.release为插件最新版,如需指定具体版本则指定如1.0.3。 在module的build.gradle文件的顶部添加: ``` apply plugin: 'com.jiandan.FirmPlugin' firmPlugin { Properties properties = new Properties() InputStream inputStream = project.rootProject.file('local.properties').newDataInputStream() properties.load(inputStream) firmEnable true //是否开启360 加固 //firmJarPath //360加固程序位置 不填写会自动下载 //apkFilePath "${project.projectDir}/app-1.0.1.apk" //加固的文件 不填写会自动编译apk firmAccountName properties.getProperty("firmAccountName")//360加固账号 firmAccountPwd properties.getProperty("firmAccountPwd")//360加固密码 channelFilePath "${project.rootDir}/文档/多渠道模板.txt" // 多渠道模版 //firm360Config "-nocert" //360加固基础配置选项 appName "Mobilelesson" //apk 或重名成appName_versoionName_versionCode cleanBeforeBuildApk false //buildApk 之前是否clean attachAssembleRelease true //执行gradlew a 打包命令后自动加固或者上传蒲公英 pgyerEnable true //是否上传蒲公英 pgyerApikey "d367c01fa029480fecf2e24d6806876e" // 蒲公英上传key buildChannel "官网"// 上传的渠道名称 printUpdateJson true //打印升级json } ``` 可设置属性列表如下: | 属性 | 值 | 说明 | | --- | --- | --- | |firmEnable |Boolean| 360加固是否可用 | | cleanBeforeBuildApk |Boolean| build 之前收否clean | | attachAssembleRelease | Boolean | 关联assembleRelease | | outPath | String | 输出总路径 默认项目跟路径/360Firm | | apkFilePath | String | 指定的apk文件,如不指定则自动编译apk | | firmJarPath | String | 360加固程序的安装位置 不填写会根据系统自动下载解压 | | firmResultDirName | String | app加固以后文件夹 名称 默认firmResult | | firmAccountName | String | 360加固账号 | | firmAccountPwd | String |360加固密码| | channelFilePath | String | 渠道文件路径 不传不打包多渠道 | | storeFilePath | String | apk签名文件路径 默认使用release/signingConfig 配置 | | storePassword | String | apk签名文件密码 默认使用release/signingConfig 配置 | | keyAlias |String | apk签名文件别名 默认使用release/signingConfig 配置 | | keyPassword |String | apk签名文件别名密码 默认使用release/signingConfig 配置 | | apkVersionCode |Int | apk versionCode 默认android/defaultConfig/versionCode | | apkVersionName |String | apk versionName默认android/defaultConfig/versionName | | firm360Config |String | 360加固高级选项 -x86 -data -crashlog -analyse -nocert | | pgyerEnable |Boolean | 上传蒲公英 | | pgyerApikey |String | 上传蒲公英的apikey | | buildChannel |String | 上传蒲公英的渠道 | | moveReleaseApk |Boolean | 移动打包的apk | | printUpdateJson |Boolean | 输出升级json | 可以直接点击Gradle/Tasks/fim360/firmTask 执行 或者在命令行输入以下命令: ``` gradlew firmTask (windows) ./gradlew firmTask (mac) ```