Skip to content

Commit

Permalink
Merge pull request #5 from talsec/new_update
Browse files Browse the repository at this point in the history
new update
  • Loading branch information
msikyna authored Apr 11, 2023
2 parents bd6319f + 90538ca commit 78a4512
Show file tree
Hide file tree
Showing 104 changed files with 37 additions and 16,846 deletions.
2 changes: 1 addition & 1 deletion FreeRASP/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
window.makeKeyAndVisible()
self.window = window

let config = TalsecConfig(appBundleIds: ["your_bundle_id"], appTeamId: "your_team_id", watcherMailAddress: "your@email.com")
let config = TalsecConfig(appBundleIds: ["your_bundle_id"], appTeamId: "your_team_id", watcherMailAddress: "your@email.com", isProd: true)
Talsec.start(config: config)
}

Expand Down
19 changes: 0 additions & 19 deletions FreeRASPDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,6 @@
isa = PBXNativeTarget;
buildConfigurationList = 37A122A126BAC5DA00D0BB68 /* Build configuration list for PBXNativeTarget "FreeRASPDemo" */;
buildPhases = (
37A1238026BD25AC00D0BB68 /* Use Proper Talsec Version */,
37A122CD26BAD0F000D0BB68 /* Run Swiftlint */,
37A122CE26BAD11D00D0BB68 /* Run R.swift generate */,
37A1228926BAC5D900D0BB68 /* Sources */,
Expand Down Expand Up @@ -630,24 +629,6 @@
shellPath = /bin/sh;
shellScript = "\"$SRCROOT/rswift\" generate \"$SRCROOT/FreeRASP/Resources/R.generated.swift\" --generators image,string,nib,font,color,file\n";
};
37A1238026BD25AC00D0BB68 /* Use Proper Talsec Version */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = "Use Proper Talsec Version";
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "cd \"${SRCROOT}/Talsec\"\nif [ \"${CONFIGURATION}\" == \"Release\" ]; then\n rm -rf ./TalsecRuntime.xcframework\n ln -s ./Release/TalsecRuntime.xcframework/ TalsecRuntime.xcframework\nelse\n rm -rf ./TalsecRuntime.xcframework\n ln -s ./Debug/TalsecRuntime.xcframework/ TalsecRuntime.xcframework\nfi\n\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down
34 changes: 12 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,50 +17,40 @@ To learn more about freeRASP features, visit our main GitHub [repository](https:
# Usage
The installation guide will lead you through the following steps:
* [Prepare Talsec library](#step-1-prepare-talsec-library)
+ [Debug vs Release version](#debug-vs-release-version)
* [Setup the configuration](#step-2-setup-the-configuration-for-your-app)
+ [Debug vs Release version](#debug-vs-release-version)
* [Handle detected threats](#step-3-handle-detected-threats)
* [App Store User Data Policy](#step-4-app-store-user-data-policy)

## Step 1: Prepare Talsec library

- Copy folder `Talsec` into your Application folder
- Drag & drop Talsec folder to your `.xcworkspace`
- Go to your **Target > Build Phases > New Run Script Phase**
- Use the following code to use an appropriate Talsec for a release or debug build:
!!! **Do clean build before change Debug <-> Release version** !!!
```sh
cd "${SRCROOT}/Talsec"
if [ "${CONFIGURATION}" = "Release" ]; then
rm -rf ./TalsecRuntime.xcframework
ln -s ./Release/TalsecRuntime.xcframework/ TalsecRuntime.xcframework
else
rm -rf ./TalsecRuntime.xcframework
ln -s ./Debug/TalsecRuntime.xcframework/ TalsecRuntime.xcframework
fi
```
- Add **TalsecRuntime** framework to **Target > Build Phases > Link Binary With Libraries**
- In the **General > Frameworks, Libraries, and Embedded Content** choose **Embed & Sign**

### Debug vs Release version
The Dev version is used to not complicate the development process of the application, e.g. if you would implement killing of the application on the debugger callback. It disables some checks which won't be triggered during the development process:
* Debugging
* Tampering
* Simulator
* Unofficial store

Note: In case you are using Carthage, the zipped version of frameworks are included in the Releases.

## Step 2: Setup the Configuration for your App

- In the `AppDelegate` import `TalsecRuntime` and add the following code (e.g., in the `didFinishLaunchingWithOptions` method.:
```swift
let config = TalsecConfig(appBundleIds: ["YOUR_APP_BUNDLE_ID"], appTeamId: "YOUR TEAM ID", watcherMailAddress: "WATCHER EMAIL ADDRESS")
let config = TalsecConfig(appBundleIds: ["YOUR_APP_BUNDLE_ID"], appTeamId: "YOUR TEAM ID", watcherMailAddress: "WATCHER EMAIL ADDRESS", isProd: true)

Talsec.start(config: config)
```
The value of watcherMail is automatically used as the target address for your security reports. Mail has a strict form `'name@domain.com'`.


### Debug vs Release version
The Debug version is used to not complicate the development process of the application, e.g. if you would implement killing of the application on the debugger callback. It disables some checks which won't be triggered during the development process:
* Debugging
* Tampering
* Simulator
* Unofficial store

If you want to use the Debug version, set the **isProd** parameter to **false**. Make sure, that you have the Release version in the production (i.e. **isProd** set to **true**)!

## Step 3: Handle detected threats
Anywhere in your project, add the following code as an extension:
```swift
Expand Down

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.
40 changes: 0 additions & 40 deletions Talsec/Release/TalsecRuntime.xcframework/Info.plist

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 78a4512

Please sign in to comment.