google / google/play-integrity-unity

IntegrityManagerV2 and StandardIntegrityManagerV2 fail to compile — RegisterOnFailureCallback lambda uses wrong signature

Open
#2 0 comments 5 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
14
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Summary
IntegrityManagerV2.cs and StandardIntegrityManagerV2.cs fail to compile with the latest package because their RegisterOnFailureCallback lambdas pass a single AndroidJavaObject argument, but PlayServicesTask.RegisterOnFailureCallback (defined in com.google.play.core) expects Action.

Compiler errors
StandardIntegrityManagerV2.cs(88,69): error CS1593: Delegate 'Action' does not take 1 arguments
StandardIntegrityManagerV2.cs(157,58): error CS1593: Delegate 'Action' does not take 1 arguments
StandardIntegrityManagerV2.cs(238,74): error CS1593: Delegate 'Action' does not take 1 arguments
IntegrityManagerV2.cs(90,69): error CS1593: Delegate 'Action' does not take 1 arguments
IntegrityManagerV2.cs(158,58): error CS1593: Delegate 'Action' does not take 1 arguments
Root cause
The V2 files pass a single-parameter lambda:

// IntegrityManagerV2.cs line 90, 158
// StandardIntegrityManagerV2.cs lines 88, 157, 238
task.RegisterOnFailureCallback((AndroidJavaObject rawException) =>
{
operation.SetError(new IntegrityServiceError(rawException)); // or StandardIntegrityError
...
});
But PlayServicesTask.RegisterOnFailureCallback is declared as:

public void RegisterOnFailureCallback(Action onFailure)
The non-V2 counterparts (IntegrityManager.cs, StandardIntegrityManager.cs) already use the correct two-argument pattern:

task.RegisterOnFailureCallback((reason, errorCode) =>
{
operation.SetError(PlayCoreTranslator.TranslatePlayCore...ErrorCode(errorCode));
...
});
Impact
The package does not compile at all. Any project using IntegrityManagerV2 or StandardIntegrityManagerV2 is completely broken.

Expected fix
Update all five RegisterOnFailureCallback lambdas in the V2 files to use (reason, errorCode) matching the V1 pattern. Note that IntegrityServiceError and StandardIntegrityError currently only have AndroidJavaObject constructors, so those error types may also need (string reason, int errorCode) constructors added to preserve the richer V2 error semantics — or the error propagation approach needs to be decided.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.