Closed flymonkey00 closed 4 years ago
Yes, same here, changing Gradle to version 6.7-rc-5
doesn't solve this too
Edit: looks like it's related to the packagename.R.?.?
我也有同样的问题,白名单失效,
gradle版本为6.6.1
,
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.tencent.mm:AndResGuard-gradle-plugin:1.2.19'
getResources().getIdentifier("XXX", "drawable", this.getPackageName()) = 0
用1.2.18的版本也一样。
花了点时间快速看了一眼,应该是由于AGP 4.1 DslInfo 中的 applicationId 类型由 String 变为了 Property
diff --git a/AndResGuard-gradle-plugin/src/main/groovy/com/tencent/gradle/AndResGuardTask.groovy b/AndResGuard-gradle-plugin/src/main/groovy/com/tencent/gradle/AndResGuardTask.groovy
index 7eb164a..7006edc 100644
--- a/AndResGuard-gradle-plugin/src/main/groovy/com/tencent/gradle/AndResGuardTask.groovy
+++ b/AndResGuard-gradle-plugin/src/main/groovy/com/tencent/gradle/AndResGuardTask.groovy
@@ -6,6 +6,7 @@ import com.tencent.mm.resourceproguard.InputParam
import com.tencent.mm.resourceproguard.Main
import org.gradle.api.DefaultTask
import org.gradle.api.GradleException
+import org.gradle.api.provider.Property
import org.gradle.api.tasks.TaskAction
/**
@@ -58,7 +59,7 @@ class AndResGuardTask extends DefaultTask {
buildConfigs << new BuildInfo(
outputFile,
variantInfo.signingConfig,
- variantInfo.applicationId,
+ variantInfo.applicationId instanceof Property ? variantInfo.applicationId.get() : variantInfo.applicationId,
variant.buildType.name,
variant.productFlavors,
variantName,
同样问题,求解决!
同问
同问
+1
The same problem, could you please fix it ASAP?
我将AGP改成4.0.0就可以了
项目升级到AGP 4.1之后,whitelist中的资源同样会被混淆并能在mapping日志文件中找到混淆的记录