-
Notifications
You must be signed in to change notification settings - Fork 31
split ios fraud into submodule #494
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
RadarSDKFraudsubmodule - New
RadarSDKFraudProtocoldefines 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.
| // todo: add a new error type for missing modules? | ||
| completionHandler(RadarStatusErrorUnknown, nil); |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
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.
| // 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); |
| [submodule "RadarSDKFraud"] | ||
| path = RadarSDKFraud | ||
| url = https://github.com/radarlabs/radar-lib-fraud-ios.git | ||
| branch = initial-setup |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
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.
| branch = initial-setup | |
| branch = main |
| Class RadarSDKFraud = NSClassFromString(@"RadarSDKFraud"); | ||
| if (RadarSDKFraud) { | ||
| NSString *fraudResults = [[RadarSDKFraud sharedInstance] detectFraudWithLocation:location]; | ||
| params[@"fraudPayload"] = fraudResults; |
Copilot
AI
Oct 21, 2025
There was a problem hiding this comment.
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.
| params[@"fraudPayload"] = fraudResults; | |
| if (fraudResults) { | |
| params[@"fraudPayload"] = fraudResults; | |
| } |
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