Code Monkey home page Code Monkey logo

gmaeni's Introduction

Gmaeni

Android Gradle Plugin - Obfuscator Strings

this plugin help you to obfuscate string in your android project due to the task change source for obfuscate string and restore after build success, you must use SCM (git, svn etc..) to run the plugin.

How integrate it?

build.gradle (app)

apply plugin: 'com.android.application'

// Add Gmaeni Plugin
apply plugin: 'io.github.duccuideptrai.gmaeni'

// Set Gmaeni options:
gmaeni.enabled = true
gmaeni.injectFakeKeys = true
gmaeni.ignoredClasses = ["com.my.packagename.MainActivity.java"]

android {
    buildTypes {
        release {
            // Don't forget to enable ProGuard !
            minifyEnabled true
        }
    }
}

Compile your App process

In the compilation process, gmaeni plugin do:

  • Backup all Java files in backup directory gmaeni-backup
  • Parse your code and encrypt all String values for each Java file
  • Inject Gmaeni source code (encryption code)
  • Inject fake secrete keys (optional - check gmaeni.injectFakeKeys option)
  • Compile your App (classic process)
  • Restore your original Java files
$ ./gradlew assembleRelease
> Task :app:backup
💾 Backup: /app/src/main/java/com/app/helloworld/MainActivity.java
💾 Backup: /app/src/main/java/com/app/helloworld/helpers/IResponse.java
💾 Backup: /app/src/main/java/com/app/helloworld/helpers/Utils.java
💾 Backup: /app/src/main/java/com/app/helloworld/helpers/ATest.java
💾 Backup: /app/src/main/java/com/app/helloworld/helpers/TestImpl.java
💾 Backup: /app/src/main/java/com/app/helloworld/Constants.java

> Task :app:encrypt
🔐 MainActivity.java encrypted
🔐 IResponse.java encrypted
🔐 Utils.java encrypted
🔐 ATest.java encrypted
🔐 TestImpl.java encrypted
🔐 Constants.java encrypted

> Task :app:injectCode
✏️ Add Gmaeni code

> Task :app:restore
♻️ Restore: /app/src/main/java/com/proto/helloworld/MainActivity.java
♻️ Restore: /app/src/main/java/com/app/helloworld/helpers/IResponse.java
♻️ Restore: /app/src/main/java/com/app/helloworld/helpers/Utils.java
♻️ Restore: /app/src/main/java/com/app/helloworld/helpers/ATest.java
♻️ Restore: /app/src/main/java/com/app/helloworld/helpers/TestImpl.java
♻️ Restore: /app/src/main/java/com/app/helloworld/Constants.java
🧹 Remove Gmaeni code: ~/HelloWorld/app/src/main/java/com/app

Options

Bellow the options of Gmaeni plugin:

  • gmaeni.enabled (true | false) : Enable or disable the string obfuscate process (default: true)
  • gmaeni.injectFakeKeys (true | false) : if activated, create fake string keys and injected it into your code (default: true)
  • gmaeni.hash (string) : let you define your own obfuscate key (32 characters recommended)
  • gmaeni.classes (array of strings) : let you defined the only classes to encrypt
  • gmaeni.ignoredClasses (array of strings): define the classes to not encrypt
  • gmaeni.srcJava (string): root path of your JAVA files (default: /app/src/main/java)

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.