Skip to content

Conversation

@cameron-radar
Copy link

server pr: https://github.com/radarlabs/server/pull/7066

run local server using branch cameronmorrow1/fra-1378-ios-fraud-lib-split, point host and verified host to it and call track verified (my staging branch doesn't seem to be a "verified host")

try running master ios branch too to ensure backwards compatibility on server

@Copilot Copilot AI review requested due to automatic review settings October 21, 2025 18:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR splits iOS fraud detection functionality into a separate submodule (RadarSDKFraud), making it an optional dependency rather than part of the core SDK. The fraud detection code (jailbreak checks, attestation, IP monitoring) is moved to the new submodule and accessed via a protocol interface.

Key Changes:

  • Fraud detection logic extracted to RadarSDKFraud submodule
  • New RadarSDKFraudProtocol defines the interface between core SDK and fraud module
  • Core SDK checks for fraud module availability at runtime using NSClassFromString

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.gitmodules Adds RadarSDKFraud as a git submodule dependency
RadarSDK/Include/RadarSDKFraudProtocol.h Defines protocol interface for fraud detection functionality
RadarSDK/RadarVerificationManager.m Removes fraud implementation, adds runtime checks for fraud module availability
RadarSDK/RadarVerificationManager.h Removes exposed fraud-related method signatures
RadarSDK/RadarAPIClient.m Replaces inline fraud checks with calls to fraud module
RadarSDK/RadarUtils.m Removes isSimulator utility (moved to fraud module)
RadarSDK/RadarUtils.h Removes isSimulator method declaration
RadarSDKTests/RadarTestUtils.h Removes import of RadarVerificationManager
RadarSDKTests/RadarTestutils.m Removes jailbreak detection from test utilities
RadarSDKTests/RadarSDKTests.m Removes fraud-related test assertions
RadarSDK.xcodeproj/project.pbxproj Adds RadarSDKFraudProtocol.h to build configuration
Comments suppressed due to low confidence (1)

RadarSDK/RadarVerificationManager.m:1

  • Missing closing brace for the if (RadarSDKFraud) block that starts at line 367. This will cause a compilation error.
//

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +105 to +106
// todo: add a new error type for missing modules?
completionHandler(RadarStatusErrorUnknown, nil);
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

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

The TODO comment should be converted to a FIXME or TODO with a ticket reference, or resolved before merging. Using RadarStatusErrorUnknown for missing module dependencies is unclear to API consumers.

Suggested change
// todo: add a new error type for missing modules?
completionHandler(RadarStatusErrorUnknown, nil);
// FIXME(RADAR-1234): Use a specific error type for missing RadarSDKFraud module
completionHandler(RadarStatusErrorMissingDependency, nil);

Copilot uses AI. Check for mistakes.
[submodule "RadarSDKFraud"]
path = RadarSDKFraud
url = https://github.com/radarlabs/radar-lib-fraud-ios.git
branch = initial-setup
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

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

Submodules should typically reference a stable branch (e.g., main or a release tag) rather than a development branch like initial-setup. This could cause instability for other developers or CI/CD systems.

Suggested change
branch = initial-setup
branch = main

Copilot uses AI. Check for mistakes.
Class RadarSDKFraud = NSClassFromString(@"RadarSDKFraud");
if (RadarSDKFraud) {
NSString *fraudResults = [[RadarSDKFraud sharedInstance] detectFraudWithLocation:location];
params[@"fraudPayload"] = fraudResults;
Copy link

Copilot AI Oct 21, 2025

Choose a reason for hiding this comment

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

Missing nil check for fraudResults before assignment. If detectFraudWithLocation: returns nil, this will add a null value to the params dictionary, which could cause serialization issues.

Suggested change
params[@"fraudPayload"] = fraudResults;
if (fraudResults) {
params[@"fraudPayload"] = fraudResults;
}

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant