Code Monkey home page Code Monkey logo

android-apk-protect-gradle-plugin's Introduction

安卓应用加固gradle插件

此项目停止维护,请移步到新项目 wow-gradle-plugins

运行gradle任务,由gradle插件完成应用的加固过程

使用腾讯应用加固服务,需要配置腾讯云的密钥、对象存储库

  1. 应用插件 在根目录的build.gradle加入
buildscript {
    repositories {
        maven { url 'https://jitpack.io' }
    }
    dependencies {
        classpath 'com.github.JefferyBoy:android-apk-protect-gradle-plugin:1.0.1'
    }
}

在应用app的build.gradle加入

apply plugin: 'android.apk.protect'

Properties localProperties = new Properties()
localProperties.load(new FileInputStream(new File(project.rootDir, "local.properties")));
// apk加固配置,腾讯云对象存储用来上传apk
// 加固完成后自动下载apk并签名,打印出加固后的apk文件路径
// release版本请配置好singingConfig签名
apkprotect {
    tencentCloudSecretId = localProperties.get("tencentCloudSecretId")
    tencentCloudSecretKey = localProperties.get("tencentCloudSecretKey")
    tencentCloudCosBucket = localProperties.get("tencentCloudCosBucket")
    tencentCloudCosRegion = localProperties.get("tencentCloudCosRegion")
    tencentCloudCosDeleteFileAfterTask = true
}

local.gradle中配置腾讯云的密钥

tencentCloudSecretId=
tencentCloudSecretKey=
tencentCloudCosBucket=
tencentCloudCosRegion=
  1. 执行加固任务
# 任务名称根据app配置的编译编译variant而改变
./gradlew app:protect-assembleRelease

执行过程日志如下

> Task :app:protect-assembleRelease
Prepare protect apk /media/mxlei/data/workspace/android/android-apk-protect/app/build/outputs/apk/release/app-release.apk
Uploading file
Upload success
Create apk protect task
Processing protect apk, this will take several minutes.
please wait 5 seconds
please wait 15 seconds
please wait 25 seconds
please wait 35 seconds
please wait 45 seconds
please wait 55 seconds
Protect success
Download file
Download progress 1.0%
Download progress 19.1%
Download progress 37.3%
Download progress 55.4%
Download progress 73.6%
Download progress 91.8%
Download progress 99.8%
Download complete
Protect success
/media/mxlei/data/workspace/android/android-apk-protect/app/build/outputs/apk/release/app-release-protected.apk
Apk Signature success
/media/mxlei/data/workspace/android/android-apk-protect/app/build/outputs/apk/release/app-release-protected-signed.apk

BUILD SUCCESSFUL in 1m 36s
38 actionable tasks: 38 executed

android-apk-protect-gradle-plugin's People

Contributors

jefferyboy avatar

Watchers

 avatar

android-apk-protect-gradle-plugin's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.