MichaelRocks / paranoid

String obfuscator for Android applications.
Apache License 2.0
680 stars 80 forks source link

registerTransform is obsolete #65

Open SetelAssignment opened 2 years ago

SetelAssignment commented 2 years ago
WARNING:API 'android.registerTransform' is obsolete.
It will be removed in version 8.0 of the Android Gradle plugin.
The Transform API is removed to improve build performance. Projects that use the
Transform API force the Android Gradle plugin to use a less optimized flow for the
build that can result in large regressions in build times. It’s also difficult to
use the Transform API and combine it with other Gradle features; the replacement
APIs aim to make it easier to extend the build without introducing performance or
correctness issues.
There is no single replacement for the Transform API—there are new, targeted
APIs for each use case. All the replacement APIs are in the
`androidComponents {}` block.
For more information, see https://developer.android.com/studio/releases/gradle-plugin-api-updates#transform-api.
REASON: It is currently called from the following trace:
java.lang.Thread.getStackTrace(Thread.java:1607)
com.android.build.gradle.internal.errors.DeprecationReporterImpl.reportDeprecatedApi(DeprecationReporterImpl.kt:69)
com.android.build.gradle.BaseExtension.registerTransform(BaseExtension.kt:271)
io.michaelrocks.paranoid.plugin.ParanoidPlugin.apply(ParanoidPlugin.kt:35)
AndroidDeveloperLB commented 2 years ago

What will happen? Will it stop working? Will it cause build issues? Are there other known dependencies that cause it?

sirius94 commented 1 year ago

It will stop working with AGP 8.0. See https://developer.android.com/studio/releases/gradle-plugin-api-updates#transform-removed

AndroidDeveloperLB commented 1 year ago

@sirius94 Yes, I've tested it . Indeed a serious issue. Any workaround/fix? Any alterative?

sirius94 commented 1 year ago

Currently I'm not aware of any alternative to using one of the new APIs. I think this one would be the closest to the old one https://github.com/android/gradle-recipes/blob/agp-7.4/Kotlin/modifyProjectClasses/app/build.gradle.kts

AndroidDeveloperLB commented 1 year ago

@sirius94 I have no idea what's on this link, but maybe it could be useful for others. Can you please let me know here if you find anything (fix/alternative/working-fork) ?

yujincheng08 commented 1 year ago

@sirius94 @AndroidDeveloperLB @SetelAssignment Try this: https://github.com/LSPosed/LSParanoid

AndroidDeveloperLB commented 1 year ago

@yujincheng08 How do you use it in a project that has it using an Android library (to be used as AAR library)? These were the issues and workarounds for this here: https://github.com/MichaelRocks/paranoid/issues/61 https://github.com/MichaelRocks/paranoid/issues/38

How can we solve it now? I created this: https://github.com/LSPosed/LSParanoid/issues/7

AndroidDeveloperLB commented 1 year ago

Sadly I'm having issues with the alternative LSParanoid library, and I tried multiple solutions I thought of: https://github.com/LSPosed/LSParanoid/issues/8

@sirius94 @SetelAssignment Have you tried it?

sirius94 commented 1 year ago

Not yet

AndroidDeveloperLB commented 1 year ago

@sirius94 While for a normal module it worked fine for me and I don't see the warning anymore (and I even tried the newest gradle version of canary build of Android Studio), currently the issue I'm having is with AAR library.

With Paranoid, I had issues, but I was given advice on how to address them: https://github.com/MichaelRocks/paranoid/issues/38 https://github.com/MichaelRocks/paranoid/issues/61 I thought I solved it, but it only build fine, yet it doesn't obfuscate (in the AAR library module) : https://github.com/LSPosed/LSParanoid/issues/7