marcglasberg / async_redux

Flutter Package: A Redux version tailored for Flutter, which is easy to learn, to use, to test, and has no boilerplate. Allows for both sync and async reducers.
Other
230 stars 41 forks source link

ActionLogger when app is obfuscated becomes useless #135

Closed pitazzo closed 2 years ago

pitazzo commented 2 years ago

I just noticed that after building my app using obfuscation options (--obfuscate --split-debug-info=./obf-ios-info) the logs of the ActionLogger become useless (which is the expected behavior). They look like this:

Starting Action Kt
Completed Action Kt

However, as I'm streaming those logs to a safe remote Datadog server using TLS, I think there is no risk of disclosing any implementation detail if we keep the action name. Is there any way to fix this? I have thought about creating a subclass of ReduxAction with a string field for the action name, and when logging, casting the action and accessing the name, but I don't really know if there is any cleaner way to achieve this.

marcglasberg commented 2 years ago

As you said, that's the expected behavior.

If you are not afraid of some manual work, you can implement the toString method for each and every action. That way, at least you can also show the parameters. For example, suppose an action called LoginAction that gets a String parameter called username. Then:

@override
String toString() => 'LoginAction($username)';

Please note this means the actual type of the action will be contained in the code itself, partially defeating the purpose of the obfuscation.