Code Monkey home page Code Monkey logo

idguard's Introduction

IdGuard

介绍

Android资源和java文件 混淆

使用说明

注:请在执行操作前备份代码

projectbuild.gradle中的buildscript下添加

repositories {  
  maven { url 'https://jitpack.io' }  
}  
dependencies {  
  classpath 'com.github.ZTWave:IdGuard:0.3.6'  
}

在app下的build.gradle中添加

plugins {
  id 'idguard'
}

或者

apply plugin : 'idguard'

如果你有白名单需求请在app module 下添加。支持包名和文件名指定 如需要指定生成的混淆字典大小的话请添加 dictCapacity 属性,该值默认为 10000

idGuard{
    whiteList = [
        "com.littlew.example.pc",
        "com.littlew.example.pa",
        //support single java file
        "com.littlew.example.pf.A.java",
    ]
    dictCapacity = 5000
}

Android StudioTask中可以找到 LayoutGuard IdGuard ResGuard 这三个Task

  1. LayoutGuard : 可以将layout文件进行随机命名并更新引用
  2. IdGuard : 可以将viewid进行重命名并更新引用
  3. ResGuard : 可以把 mipmap drawable string 中的 资源文件进行随机命名并更新引用
  4. ClassGuard : 可以把java文件夹中的所有java文件和对应得 类 函数 变量 形参 进行重命名并更新引用
  5. ProguardDicGen : 可以生成一个混淆字典,按照入下方式添加到你的混淆配置文件中
-obfuscationdictionary dict.txt
-classobfuscationdictionary dict.txt
-packageobfuscationdictionary dict.txt

第 1 - 4 个 task 执行过后会在根目录下输出mapping文件,记得及时备份,以防修正错误或者日后查找需要

0.3.3 版本更新后,所有Task已经全部支持多个module情况

sync过后,在Gardle的窗口中可以找到guard这个group,双击某个任务可以执行这个Task GradleTask

目前classGuard 会对arr或者jar调用的同名方法进行替换,请在该task完成后进行错误检查!!

感谢

XmlClassGuard qbox

idguard's People

Contributors

ztwave avatar firstchapter avatar

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.