diff --git a/core/build.gradle b/core/build.gradle index ce3725e..7edac6b 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -6,7 +6,7 @@ buildscript { } } dependencies { - classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.8" + classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.13" } } @@ -30,24 +30,24 @@ dependencies { compileOnly "com.android.tools.build:aapt2-proto:0.4.0" compileOnly gradleApi() -// compile deps.gradle.agp + // compile deps.gradle.agp implementation "com.android.support:support-annotations:24.2.0" - shadow 'commons-io:commons-io:2.6' + shadow 'commons-io:commons-io:2.7' shadow 'commons-codec:commons-codec:1.5' - shadow "com.google.guava:guava:27.0.1-jre" + shadow "com.google.guava:guava:30.0-jre" annotationProcessor "com.google.auto.value:auto-value:1.5.2" implementation "com.google.auto.value:auto-value:1.5.2" - shadow group: 'org.dom4j', name: 'dom4j', version: '2.1.0' + shadow group: 'org.dom4j', name: 'dom4j', version: '2.1.1' shadow deps.bundletool testImplementation deps.gradle.agp testImplementation "com.android.tools.build:aapt2-proto:0.4.0" - testImplementation group: 'org.dom4j', name: 'dom4j', version: '2.1.0' + testImplementation group: 'org.dom4j', name: 'dom4j', version: '2.1.1' testImplementation "junit:junit:4.12" testImplementation "org.junit.jupiter:junit-jupiter-api:5.2.0" - testImplementation "com.google.guava:guava:27.0.1-jre" + testImplementation "com.google.guava:guava:30.0-jre" testImplementation "org.mockito:mockito-core:2.18.3" testImplementation "com.google.truth.extensions:truth-java8-extension:0.45" testImplementation "com.google.truth.extensions:truth-proto-extension:0.45" diff --git a/core/src/main/java/com/bytedance/android/aabresguard/parser/ResourcesMappingParser.java b/core/src/main/java/com/bytedance/android/aabresguard/parser/ResourcesMappingParser.java index ef3901d..d8758bf 100644 --- a/core/src/main/java/com/bytedance/android/aabresguard/parser/ResourcesMappingParser.java +++ b/core/src/main/java/com/bytedance/android/aabresguard/parser/ResourcesMappingParser.java @@ -36,6 +36,7 @@ public ResourcesMapping parse() throws IOException { line = br.readLine(); continue; } + System.out.println("Res: "+line); if (!line.contains(":")) { Matcher mat = MAP_DIR_PATTERN.matcher(line); if (mat.find()) { diff --git a/gradle.properties b/gradle.properties index 15aae33..a067f45 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,11 +21,11 @@ RELEASE_REPOSITORY_URL= SNAPSHOT_REPOSITORY_URL= PUBLISH_LOCAL_REPO=../repo # 是否使用本地 maven 依赖 -useLocalMaven=false +useLocalMaven=true # 是否源码依赖 -useSource=false +useSource=true enableAabResGuardPlugin=true # bintray -uploadToBintray=true +uploadToBintray=false bintrayInfo.user=**** bintrayInfo.apiKey=*************** diff --git a/gradle/versions.gradle b/gradle/versions.gradle index 58a336d..8e7d6ac 100644 --- a/gradle/versions.gradle +++ b/gradle/versions.gradle @@ -1,15 +1,15 @@ def versions = [:] -versions.agp = "4.1.0" +versions.agp = "4.2.0" versions.kotlin = "1.3.61" versions.java = "8" -versions.aabresguard = "0.1.9" +versions.aabresguard = "0.1.10" // android -versions.compileSdkVersion = 28 +versions.compileSdkVersion = 30//28 versions.minSdkVersion = 15 -versions.targetSdkVersion = 28 +versions.targetSdkVersion = 30//28 versions.support = "28.0.0" -versions.bundletool = "0.10.0" +versions.bundletool = "0.12.0" versions["aabresguard-core"] = versions.aabresguard versions["aabresguard-plugin"] = versions.aabresguard @@ -22,6 +22,7 @@ versions.digital = "3.4.0" ext.versions = versions ext.deps = [:] + // gradle def gradle = [:] gradle.agp = "com.android.tools.build:gradle:${versions.agp}" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 46ec2ea..78f6d1c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,10 +1,6 @@ -#Tue Oct 15 17:54:10 CST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip +#distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -#distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip -#distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip -#distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-milestone-2-all.zip -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip -#distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip diff --git a/plugin/src/main/kotlin/com/bytedance/android/plugin/tasks/AabResGuardTask.kt b/plugin/src/main/kotlin/com/bytedance/android/plugin/tasks/AabResGuardTask.kt index cb411e8..dffac3b 100644 --- a/plugin/src/main/kotlin/com/bytedance/android/plugin/tasks/AabResGuardTask.kt +++ b/plugin/src/main/kotlin/com/bytedance/android/plugin/tasks/AabResGuardTask.kt @@ -8,20 +8,30 @@ import com.bytedance.android.plugin.internal.getBundleFilePath import com.bytedance.android.plugin.internal.getSigningConfig import com.bytedance.android.plugin.model.SigningConfig import org.gradle.api.DefaultTask -import org.gradle.api.tasks.TaskAction +import org.gradle.api.tasks.* import java.io.File import java.nio.file.Path /** * Created by YangJing on 2019/10/15 . * Email: yangjing.yeoh@bytedance.com + * Modified 2021/08/11 */ open class AabResGuardTask : DefaultTask() { + @get:Internal private lateinit var variant: ApplicationVariant + + @get:Internal lateinit var signingConfig: SigningConfig + + @get:Internal var aabResGuard: AabResGuardExtension = project.extensions.getByName("aabResGuard") as AabResGuardExtension + + @get:Internal private lateinit var bundlePath: Path + + @get:Internal private lateinit var obfuscatedBundlePath: Path init { @@ -36,11 +46,13 @@ open class AabResGuardTask : DefaultTask() { bundlePath = getBundleFilePath(project, variant) obfuscatedBundlePath = File(bundlePath.toFile().parentFile, aabResGuard.obfuscatedBundleFileName).toPath() } - +/* + @InputFile + @Optional fun getObfuscatedBundlePath(): Path { return obfuscatedBundlePath } - +*/ @TaskAction private fun execute() { println(aabResGuard.toString())