-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Hilt] Disable "keepnames" proguard rule #3197
[Hilt] Disable "keepnames" proguard rule #3197
Comments
Hi @evowizz , the reason we need to keep the class name is because the multibinding map is keyed by Note: we could have used |
Thanks for your reply @bcorso. Wouldn't it be possible to create a new Gradle task that replaces the The reason I'm asking is because I believe this breaks (one of) the purposes of obfuscation. Having the ViewModel names within a release can considerably help reverse engineering an app. It may also keep a ton of text within the app depending on how many ViewModels there are, and how long the names of those ViewModels are. |
Discussed this with @bcorso, we're going to add a flag to use |
Thank you for looking into other solutions. It looks like there's barely any documentation about Obfuscating the key string (if that's what Edit: |
Right, it basically tells R8 that the string is a class name and should be obfuscated with the classes. Thanks for that pointer, it looks like there may be some extra complications to using |
@bcorso how i can use @ClassKey,, please can you give an example with to use @ClassKey this in viewmodel ? |
I'd also be interested in a |
We're unlikely to do anything with However, using something like @jonathan-caryl Either way though, if/when we make those changes, I think for something like Arxan (which I only first heard of through your comment), I think you'll just have to have some sort of equivalent rule for Arxan to understand how to rewrite these identifiers. |
Hi. So I should use |
I don't have a solution (hence why this bug is still open). I'm just saying I think there is a path with |
It's almost a year from the issue being opened, why is it still not resolved? |
We have other priorities we are working on. |
This is a big security issue for applications using this library, I'm shocked that a year has passed and this is still not resolved! How long will this issue be open? 10, 20, 50 years? |
This is in no way a security issue. While it might prevent full obfuscation as stated in one of my first comments, it has nothing to do with security. It's an inconvenience at most. If you are affected by this issue, feel free to subscribe to it and react to the first comment. Non-constructive comments do not help the community, nor developers. |
Showing part of your logic without obfuscating it is a problem. Moreover, if there are viewModels in different parts of the project, this reveals not only the names of the view models, potentially making it clear to which part of the application each of them belongs, but also the structure of the packages, since the path to them is saved. In fact, if you do not move the viewModels to a separate folder, the project becomes "at a glance" for potential "bad" people. I insist that this is a big problem for the security of the application. |
Is this rule applied by default in my app or do I need to explicitly add it to the |
Hello. Is there any progress on this issue? It would be possible to replace identifiers in the form of class names with custom strings that would be written in the annotations to the ViewModel as is done for classes in Kotlin serialization. Please implement this. This is very necessary! It's been almost a year since my last comment! |
@Chang-Eric Is there any updated on this issue? |
We've been looking at this recently but it is complicated because using Proguard's So we're looking at this, but there are a number of issues getting in the way. |
@Chang-Eric Please give the opportunity to manually set |
Im working on banking application, and because of this issue, i think i need to remove hilt from the project. is there is any way around available? |
Just to clarify, this issue should only prevent obfuscation of the static class names of the Hilt ViewModels. This isn't going to leak any runtime or user data. Just clarifying since you mentioned a banking application. With that said, there isn't really a workaround, besides doing something like renaming your However, we are currently actively working on this, and hope to have the first part out pretty soon. The first part will be a new feature in Dagger, and then once that is done we'll have to update Hilt to use that new feature. We ran into some complications though, so this new feature will only work with R8 and not Proguard. For Proguard users we're going to keep using |
What's the expected time for an update on this issue? |
Hi, I'm perform a release now, should be done in 1~2 days |
It looks like the following Proguard rule prevents Proguard from obfuscating ViewModel names
dagger/java/dagger/hilt/android/lifecycle/proguard-rules.pro
Lines 1 to 2 in 47e7674
Is there a way to disable that Keep rule by chance? The first line indicates that the class names are used as multibinding map keys, but do these keys really need to use the original class names instead of the obfuscated ones?
The text was updated successfully, but these errors were encountered: