2013-01-16 23:06:32 +01:00
|
|
|
/**
|
|
|
|
* Copyright 2011 Ryszard Wiśniewski <brut.alll@gmail.com>
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
version = apktoolversion
|
2013-01-17 14:58:50 +01:00
|
|
|
apply plugin: 'fatjar'
|
2013-01-16 23:06:32 +01:00
|
|
|
|
2013-01-17 04:51:04 +01:00
|
|
|
configurations {
|
|
|
|
proguard
|
|
|
|
}
|
|
|
|
|
2013-01-16 23:06:32 +01:00
|
|
|
dependencies {
|
|
|
|
compile project(':brut.apktool:apktool-lib')
|
2013-01-17 04:51:04 +01:00
|
|
|
proguard 'net.sf.proguard:proguard-base:4.8'
|
2013-01-16 23:06:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
gradle.taskGraph.whenReady {
|
2013-01-17 14:58:50 +01:00
|
|
|
fatJar {
|
2013-01-16 23:06:32 +01:00
|
|
|
manifest {
|
|
|
|
attributes("Main-Class": "brut.apktool.Main")
|
|
|
|
}
|
|
|
|
}
|
2013-01-17 04:51:04 +01:00
|
|
|
}
|
|
|
|
|
2013-01-17 14:58:50 +01:00
|
|
|
task proguard(type: JavaExec, dependsOn: fatJar) {
|
2013-01-17 04:51:04 +01:00
|
|
|
def outFile = jar.destinationDir.getPath() + '/' + jar.baseName + '-' + jar.version + '-small' + '.' + jar.extension
|
|
|
|
inputs.file jar.archivePath
|
|
|
|
outputs.file outFile
|
|
|
|
|
|
|
|
classpath = configurations.proguard
|
|
|
|
main = 'proguard.ProGuard'
|
|
|
|
args '-injars ' + "${jar.archivePath}" + ' (!META-INF/LICENSE.txt,!META-INF/NOTICE.txt,!README)'
|
|
|
|
args "-outjars ${outFile}"
|
|
|
|
args "-libraryjars ${System.properties['java.home']}/lib/rt.jar"
|
|
|
|
args '-dontobfuscate'
|
|
|
|
args '-dontoptimize'
|
|
|
|
args '-keep public class brut.apktool.Main { public static void main(java.lang.String[]); }'
|
|
|
|
args '-keep class org.yaml.snakeyaml.** { public protected private *; }'
|
|
|
|
args '-keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); }'
|
|
|
|
args '-dontwarn com.google.common.base.**'
|
|
|
|
args '-dontwarn com.google.common.collect.**'
|
2013-08-12 19:27:07 +02:00
|
|
|
args '-dontwarn com.google.common.util.**'
|
2013-01-17 04:51:04 +01:00
|
|
|
args '-dontwarn javax.xml.xpath.**'
|
|
|
|
args '-dontnote **'
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.getByPath(':release').dependsOn(proguard)
|