Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Build with DexGuard & Product Flavor Not Mapped in the Report #167

Open
arifrgilang opened this issue Jun 21, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@arifrgilang
Copy link

Current behavior

I ran :app:analyzeSitReleaseBundle with DexGuard enabled.
"Sit" is the build flavor.
The names were not mapped in the report.

Expected behavior

The names should be mapped correctly base on this comment #87 (comment)

Steps to reproduce

:app:analyzeSitReleaseBundle with DexGuard enabled. overwriteUnprotected = false

Versions

DexGuard 9.x.x
Ruler 1.4.0
Android Gradle Plugin 7.3.1
Gradle 7.4

Anything else?

I tried to modify the target package to place the mapping from DexGuard, just in case Ruler can't find the mapping file.

This is the code from #87 (comment)
task.mappingFile.set(File(project.buildDir, "outputs/dexguard/mapping/bundle/${variant.name}/mapping.txt"))

The default location is outputs/dexguard/mapping/bundle/sit/release/mapping.txt
There's a DexGuard feature to specify the package output, and I change it to:

  • outputs/dexguard/mapping/bundle/sit/mapping.txt
  • outputs/dexguard/mapping/bundle/release/mapping.txt
  • outputs/dexguard/mapping/bundle/sitRelease/mapping.txt
  • outputs/dexguard/mapping/bundle/sitrelease/mapping.txt
    However, it is still not working.

I also tried changing the DexGuard configuration to overwriteUnprotected = true and with all the package name above, but it is still not working.

@arifrgilang arifrgilang added the bug Something isn't working label Jun 21, 2024
@arifrgilang
Copy link
Author

After carefully reviewing the logs, I found that Ruler puts the report files here: projectname/app/build/reports/ruler/sitRelease/report.html. Therefore, the correct package should be sitRelease.

Upon examining my mapping, it should be: build/outputs/dexguard/mapping/bundle/sitRelease/mapping.txt. After changing the mapping accordingly, it now works.

However, this ticket should probably remain open with a different title. I'll change it to "Release Build with DexGuard & Product Flavor Not Mapped in the Report."

@arifrgilang arifrgilang changed the title Release Build with DexGuard not mapped in the report Release Build with DexGuard & Product Flavor Not Mapped in the Report Jun 21, 2024
@MrHadiSatrio
Copy link
Contributor

Interesting. I think this behavior is perhaps expected, as Ruler only considers variant.name when registering tasks (in lieu of also looking at variant.flavorName).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants