Skip to content

Conversation

@adriantuk
Copy link
Contributor

Related to approov/core-project-approov#40

@adriantuk adriantuk requested review from ivolz and jexh October 22, 2025 16:21
@adriantuk adriantuk added the enhancement New feature or request label Oct 22, 2025
…e host keys; Update SfBareItem.fromDynamic to remove dead code for int check; Clean up test cases by removing unused test
…gning synchronus (as it was) as we want it to be returning void not Future
…d message signing components, for each method in the code.

defaultConfig {
minSdkVersion 19
minSdk 21
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the same as everywhere else?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is automatically generated by Flutter initially, I had to update it to modern standards, minSdkVersion 21 is required for Flutter 3.10. We still support Android 5.0+ on SDK 21

@try {
result([Approov getInstallMessageSignature:call.arguments[@"message"]]);
}
@catch (NSException *exception) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these the only methods to catch exceptions? What happens if you don't catch the exception here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's because other methods are not throwing, so we don't expect anything to catch. If exception is not caught here it would most likely escape the plugin and crash the Flutter app.

We throw things such as:

StateError('install message signature empty');

I think it makes sense to throw NSException here, we could just log and return but it doesn't seem right

}

void setAlg(String value) {
_parameters['alg'] = SfBareItem.string(value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'alg' and 'algorithm' should be the same value in your implementation. (I think algorithm should probably be removed). The SignatureParameters object shouldn't really know about the set of vaild algorithms either. That should be managed at a higher level (the default Approov message singing implementation - the same approach taken by okhttp). If this has been copied from the swift stuff, then I am a little concerned that we have different implementations betwee android and iOS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've addressed it in the latest commit 722a3fa
Now it aligns with our other implementations.

…ecify whether Installation or Account message signing is used.
… the "alg" parameter so the Dart layer mirrors the OkHttp/URLSession behaviour and the parameter object stays algorithm-agnostic.

Improved formatting of the code to be easier to read.
…layers to provide a clearer intent for account message signing. Now there is a clear distinction between account and installation message signing.

Added revelant tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants