Giter Site home page Giter Site logo

cuikangyuan / aabresguard Goto Github PK

View Code? Open in Web Editor NEW

This project forked from martinloren/aabresguard

0.0 0.0 0.0 9.41 MB

The tool of obfuscated aab resources.(Android app bundle资源混淆工具)

License: Apache License 2.0

Shell 0.22% Java 92.10% Groovy 1.41% Kotlin 6.28%

aabresguard's Introduction

AabResGuard - Artic Fox Edition

The tool of obfuscated aab resources

Download V.0.1.10

License Bundletool

English | 简体中文

Powered by bytedance douyin android team.

Features

The tool of obfuscated aab resources.

  • Merge duplicated resources: Consolidate duplicate resource files to reduce package size.
  • Filter bundle files: Support for filtering files in the bundle package. Currently only supports filtering in the MATE-INFO/ and lib/ paths.
  • White list: The resources in the whitelist are not to be obfuscated.
  • Incremental obfuscation: Input the mapping file to support incremental obfuscation.
  • Remove string: Input the unused file splits by lines to support remove strings.
  • ???: Looking ahead, there will be more feature support, welcome to submit PR & issue.

Data of size savings

AabResGuard is a resource obfuscation tool powered by the douyin Android team. It has been launched at the end of July 2018 in several overseas products, such as Tiktok, Vigo, etc. There is no feedback on related resource issues. For more data details, please go to Data of size savings.

Quick start

  • Command tool: Support command line.
  • Gradle plugin: Support for gradle plugin, using the original packaging command to execute obfuscation.

Gradle plugin

Configured in build.gradle(root project)

buildscript {
  repositories {
    mavenCentral()
    mavenLocal()
    jcenter()
    google()
   }
  dependencies {
    classpath "com.bytedance.android:aabresguard-plugin:0.1.10"
  }
}

Configured in build.gradle(application)

apply plugin: "com.bytedance.android.aabResGuard"
aabResGuard {
    //mappingFile = file("mapping.txt").toPath() // Mapping file used for incremental obfuscation
    whiteList = [ // White list rules
        "*.R.raw.*",
        "*.R.drawable.icon",
        // Google-services & Firebase
        "*.R.string.google_app_id",
        "*.R.string.gcm_defaultSenderId",
        "*.R.string.default_web_client_id",
        "*.R.string.ga_trackingId",
        "*.R.string.firebase_database_url",
        "*.R.string.google_api_key",
        "*.R.string.google_crash_reporting_api_key",
        "*.R.string.default_web_client_id",
        "*.R.string.gcm_defaultSenderId",
        "*.R.string.google_app_id",
        "*.R.string.google_crash_reporting_api_key",
        "*.R.string.google_storage_bucket",
        "*.R.string.project_id"
    ]
    obfuscatedBundleFileName = "duplicated-app.aab" // Obfuscated file name, must end with '.aab'
    mergeDuplicatedRes = true // Whether to allow the merge of duplicate resources
    enableFilterFiles = true // Whether to allow filter files
    filterList = [ // file filter rules
        "*/arm64-v8a/*",
        "META-INF/*"
    ]
    
    enableFilterStrings = false // switch of filter strings
    unusedStringPath = file("unused.txt").toPath() // strings will be filtered in this file
    languageWhiteList = ["en", "zh"] // keep en,en-xx,zh,zh-xx etc. remove others.
}

The aabResGuard plugin intrudes the bundle packaging process and can be obfuscated by executing the original packaging commands.

./gradlew clean :app:bundleDebug --stacktrace

Get the obfuscated bundle file path by gradle .

def aabResGuardPlugin = project.tasks.getByName("aabresguard${VARIANT_NAME}")
Path bundlePath = aabResGuardPlugin.getObfuscatedBundlePath()

Whitelist

The resources that can not be confused. Welcome PR your configs which is not included in WHITELIST

Command line

AabResGuard provides a jar file that can be executed directly from the command line. More details, please go to Command Line.

Output

After the packaging is completed, the obfuscated file and the log files will be output. More details, please go to Output File.

  • resources-mapping.txt: Resource obfuscation mapping, which can be used as the next obfuscation input to achieve incremental obfuscate.
  • aab: Optimized aab file.
  • -duplicated.txt: duplicated file logging.

Change log

Version change log. More details, please go to Change Log .

Contribute

Read the details to learn how to participate in the improvement AabResGuard.

Contributor

Thanks

aabresguard's People

Contributors

eakteam avatar jingyeoh avatar kaedea avatar martinloren 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.