Support
Quality
Security
License
Reuse
kandi has reviewed AndResGuard and discovered the below as its top functions. This is intended to give you an instant insight into AndResGuard implemented functionality, and help decide if they suit your requirements.
Obfuscate android resources. It contains all the resource type(such as drawable、layout、string...). It can prevent your apk from being reversed by Apktool.
Shrinking the apk size. It can reduce the resources.arsc and the package size obviously.
Repackage with 7zip. It supports repackage apk with 7zip, and we can specify the compression method for each file.
With Gradle
apply plugin: 'AndResGuard'
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.tencent.mm:AndResGuard-gradle-plugin:1.2.21'
}
}
andResGuard {
// mappingFile = file("./resource_mapping.txt")
mappingFile = null
use7zip = true
useSign = true
// It will keep the origin path of your resources when it's true
keepRoot = false
// If set, name column in arsc those need to proguard will be kept to this value
fixedResName = "arg"
// It will merge the duplicated resources, but don't rely on this feature too much.
// it's always better to remove duplicated resource from repo
mergeDuplicatedRes = true
whiteList = [
// your icon
"R.drawable.icon",
// for fabric
"R.string.com.crashlytics.*",
// for google-services
"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.project_id",
]
compressFilePattern = [
"*.png",
"*.jpg",
"*.jpeg",
"*.gif",
]
sevenzip {
artifact = 'com.tencent.mm:SevenZip:1.2.21'
//path = "/usr/local/bin/7za"
}
/**
* Optional: if finalApkBackupPath is null, AndResGuard will overwrite final apk
* to the path which assemble[Task] write to
**/
// finalApkBackupPath = "${project.rootDir}/final.apk"
/**
* Optional: Specifies the name of the message digest algorithm to user when digesting the entries of JAR file
* Only works in V1signing, default value is "SHA-1"
**/
// digestalg = "SHA-256"
}
Wildcard
? Zero or one character
* Zero or more of character
+ One or more of character
WhiteList
res path mapping:
res/mipmap-hdpi-v4 -> res/mipmap-hdpi-v4
res/mipmap-mdpi-v4 -> res/mipmap-mdpi-v4
res/mipmap-xhdpi-v4 -> res/mipmap-xhdpi-v4
res/mipmap-xxhdpi-v4 -> res/mipmap-xxhdpi-v4
res/mipmap-xxxhdpi-v4 -> res/mipmap-xxxhdpi-v4
android studio clear .gradle on C:\Users\Administrator,can't find one of the classpath
1.2.3/
1.2.4/
1.2.5-RC1/
1.2.5/
1.2.6/
1.2.7/
buildscript {
repositories {
jcenter()
maven { url 'https://dl.bintray.com/simsun/maven' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.tencent.mm:AndResGuard-gradle-plugin:1.1.8'
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.1'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
-----------------------
1.2.3/
1.2.4/
1.2.5-RC1/
1.2.5/
1.2.6/
1.2.7/
buildscript {
repositories {
jcenter()
maven { url 'https://dl.bintray.com/simsun/maven' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.tencent.mm:AndResGuard-gradle-plugin:1.1.8'
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.1'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;'
buildscript {
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
google()
jcenter()
}
dependencies {
classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT'
}
}
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
apply plugin: 'com.jakewharton.butterknife'
...
dependencies {
compile 'com.jakewharton:butterknife:9.0.0-SNAPSHOT'
kapt 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT'
}
apply plugin: 'com.jakewharton.butterknife'
-----------------------
buildscript {
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
google()
jcenter()
}
dependencies {
classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT'
}
}
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
apply plugin: 'com.jakewharton.butterknife'
...
dependencies {
compile 'com.jakewharton:butterknife:9.0.0-SNAPSHOT'
kapt 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT'
}
apply plugin: 'com.jakewharton.butterknife'
-----------------------
buildscript {
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
google()
jcenter()
}
dependencies {
classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT'
}
}
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
apply plugin: 'com.jakewharton.butterknife'
...
dependencies {
compile 'com.jakewharton:butterknife:9.0.0-SNAPSHOT'
kapt 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT'
}
apply plugin: 'com.jakewharton.butterknife'
QUESTION
android studio clear .gradle on C:\Users\Administrator,can't find one of the classpath
Asked 2018-Apr-14 at 05:48The ERROR:
my app gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.tencent.mm:AndResGuard-gradle-plugin:1.1.8'
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.1'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
i am sry for that the code can't post,so what i said this sentence is nonsense
ANSWER
Answered 2017-Oct-23 at 14:28Well if you open the url mentioned you will find that this version 1.1.8
does not exist in jcenter
repository. The available versions there are:
https://jcenter.bintray.com/com/tencent/mm/AndResGuard-gradle-plugin/
1.2.3/
1.2.4/
1.2.5-RC1/
1.2.5/
1.2.6/
1.2.7/
So either upgrade your AndResGuard-gradle-plugin
to a 1.2.x
version or change the jcenter
repository in by adding maven { url 'https://dl.bintray.com/simsun/maven' }
:
buildscript {
repositories {
jcenter()
maven { url 'https://dl.bintray.com/simsun/maven' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.tencent.mm:AndResGuard-gradle-plugin:1.1.8'
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.1'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
No vulnerabilities reported
Save this library and start creating your kit
Save this library and start creating your kit