Skip to content

Commit 01bd9f3

Browse files
committed
Update: New version of freeRASP
1 parent ee1c71d commit 01bd9f3

File tree

6 files changed

+61
-25
lines changed

6 files changed

+61
-25
lines changed

README.md

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
freeRASP for Flutter is a part of security SDK for the app shielding and security monitoring. Learn more about provided features on the [freeRASP's main repository](https://github.com/talsec/Free-RASP-Community) first. You can find freeRASP Flutter plugin on [pub.dev](https://pub.dev/packages/freerasp).
44

5+
<table>
6+
<tbody>
7+
<td>⚠️ Attention ⚠️ Update to the latest (<strong>1.1.0</strong>) version. Previous versions contain a bug that impacts logged data.<br>
8+
</td>
9+
</tbody>
10+
</table>
11+
512
# Usage
613
We will guide you step-by-step, but you can always check the expected result This is how final implementation should look like:
714

@@ -11,7 +18,7 @@ We will guide you step-by-step, but you can always check the expected result Th
1118
Add dependency to your `pubspec.yaml` file
1219
```yaml
1320
dependencies:
14-
freerasp: 1.0.0
21+
freerasp: 1.1.0
1522
```
1623
and then run: `pub get`
1724

@@ -54,13 +61,13 @@ fi
5461

5562
### Android setup
5663
* From root of your project, go to **android > app > build.gradle**
57-
* In `defaultConfig` update `minSdkVersion` to at least **19** (Android 4.4) or higher
64+
* In `defaultConfig` update `minSdkVersion` to at least **21** (Android 5.0) or higher
5865
```gradle
5966
android {
6067
...
6168
defaultConfig {
6269
...
63-
minSdkVersion 19
70+
minSdkVersion 21
6471
...
6572
}
6673
...
@@ -101,8 +108,8 @@ class _MyAppState extends State<MyApp> {
101108
102109
```
103110
and then create a Talsec config and insert `androidConfig` and/or `IOSConfig` with highlighted identifiers: `expectedPackageName` and `expectedSigningCertificateHash` are needed for Android version.
104-
`expectedPackageName` - package name of your app which you chose when you created it
105-
`expectedSigningCertificateHash` - hash of the certificate of the key which was used to sign the application. **Hash which is passed here must be encoded in Base64 form.**
111+
`expectedPackageName` - package name of your app you chose when you created it
112+
`expectedSigningCertificateHash` - hash of the certificate of the key which was used to sign the application. **Hash which is passed here must be encoded in Base64 form**
106113
Similarly, `appBundleId` and `appTeamId` are needed for iOS version of app. If you publish on the Google Play Store and/or Huawei AppGallery, you **don't have to assign anything** to `supportedAlternativeStores` as those are supported out of the box.
107114

108115
Lastly, pass a mail address to `watcherMail` to be able to get reports. Mail has a strict form `name@domain.com` which is passed as String.
@@ -149,9 +156,10 @@ void initState(){
149156
androidCallback: AndroidCallback(
150157
onRootDetected: () => print('Root detected'),
151158
onEmulatorDetected: () => print('Emulator detected'),
152-
onFingerprintDetected: () => print('Fingerprint detected'),
153159
onHookDetected: () => print('Hook detected'),
154160
onTamperDetected: () => print('Tamper detected'),
161+
onDeviceBinding: () => print('Device binding detected'),
162+
onUntrustedInstallationDetected: () => print('Untrusted installation detected'),
155163
),
156164
157165
// For iOS
@@ -163,6 +171,8 @@ void initState(){
163171
onPasscodeDetected: () => print('Passcode detected'),
164172
onSimulatorDetected: () => print('Simulator detected'),
165173
onMissingSecureEnclaveDetected: () => print('Missing secure enclave detected'),
174+
onDeviceChangeDetected: () => print('Device change detected'),
175+
onDeviceIdDetected: () => print('Device ID detected'),
166176
),
167177
168178
// Common for both platforms
@@ -189,19 +199,23 @@ void initState(){
189199
And you're done 🎉!
190200

191201
# Troubleshooting
192-
### `Could not find ... ` dependency issue
193-
**Solution:** Add dependency manually (see this [issue](https://github.com/talsec/Free-RASP-Flutter/issues/1))
202+
### \[Android] `Cloud not find ... ` dependency issue
203+
**Solution:** Add dependency manually (see [issue](https://github.com/talsec/Free-RASP-Flutter/issues/1))
194204
In android -> app -> build.gradle add these dependencies
195205
```gradle
196206
dependencies {
197207
198-
...some other dependecies...
208+
... some other dependecies ...
199209
200210
// Talsec Release
201-
releaseImplementation 'com.aheaditec.talsec.security:TalsecSecurity-Community:2.6.0-release'
211+
debugImplementation 'com.aheaditec.talsec.security:TalsecSecurity-Community:3.1.0-dev'
202212
203213
// Talsec Debug
204-
debugImplementation 'com.aheaditec.talsec.security:TalsecSecurity-Community:2.6.0-dev'
214+
releaseImplementation 'com.aheaditec.talsec.security:TalsecSecurity-Community:3.1.0-release'
205215
}
206216
207-
```
217+
```
218+
219+
### \[iOS] Unable to build release for simulator in Xcode (errors)
220+
**Solution:** Simulator does **not** support release build of Flutter - more about it [here](https://flutter.dev/docs/testing/build-modes#release).
221+
Use real device in order to build app in release mode.

android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ android {
3535
defaultConfig {
3636
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
3737
applicationId "com.aheaditec.freerasp_example"
38-
minSdkVersion 19
38+
minSdkVersion 21
3939
targetSdkVersion 30
4040
versionCode flutterVersionCode.toInteger()
4141
versionName flutterVersionName

ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ EXTERNAL SOURCES:
1515

1616
SPEC CHECKSUMS:
1717
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
18-
freerasp: cf77912fd2d8ad087abcba5b591802e401646230
18+
freerasp: 3516f6bd34a4d386ab4a20aa7a5ca8310d5c3a09
1919

2020
PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c
2121

22-
COCOAPODS: 1.10.1
22+
COCOAPODS: 1.10.2

lib/main.dart

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ class _MyAppState extends State<MyApp> {
1818
String _emulatorState = 'Secured';
1919
String _tamperState = 'Secured';
2020
String _hookState = 'Secured';
21-
String _fingerPrintState = 'Secured';
21+
String _untrustedInstallationSourceState = 'Secured';
22+
String _deviceBindingState = 'Secured';
2223

2324
// String to hold state (iOS)
2425
String _signatureState = 'Secured';
@@ -28,6 +29,8 @@ class _MyAppState extends State<MyApp> {
2829
String _passcodeChangeState = 'Secured';
2930
String _simulatorState = 'Secured';
3031
String _missingSecureEnclaveState = 'Secured';
32+
String _deviceChangeState = 'Secured';
33+
String _deviceIdDetectedState = 'Secured';
3134

3235
// String to hold state (common)
3336
String _debuggerState = 'Secured';
@@ -41,7 +44,9 @@ class _MyAppState extends State<MyApp> {
4144
Text('Emulator: $_emulatorState\n'),
4245
Text('Tamper: $_tamperState\n'),
4346
Text('Hook: $_hookState\n'),
44-
Text('Fingerprint: $_fingerPrintState\n'),
47+
Text('Device binding: $_deviceBindingState\n'),
48+
Text(
49+
'Untrusted source of installation: $_untrustedInstallationSourceState\n'),
4550
];
4651
}
4752
return [
@@ -53,6 +58,8 @@ class _MyAppState extends State<MyApp> {
5358
Text('Passcode change: $_passcodeChangeState\n'),
5459
Text('Simulator: $_simulatorState\n'),
5560
Text('Missing secure enclave: $_missingSecureEnclaveState\n'),
61+
Text('Device change: $_deviceChangeState\n'),
62+
Text('Device ID: $_deviceIdDetectedState\n')
5663
];
5764
}
5865

@@ -97,11 +104,6 @@ class _MyAppState extends State<MyApp> {
97104
_emulatorState = 'Detected';
98105
});
99106
},
100-
onFingerprintDetected: () {
101-
setState(() {
102-
_fingerPrintState = 'Detected';
103-
});
104-
},
105107
onHookDetected: () {
106108
setState(() {
107109
_hookState = 'Detected';
@@ -112,6 +114,16 @@ class _MyAppState extends State<MyApp> {
112114
_tamperState = 'Detected';
113115
});
114116
},
117+
onDeviceBindingDetected: () {
118+
setState(() {
119+
_deviceBindingState = 'Detected';
120+
});
121+
},
122+
onUntrustedInstallationDetected: () {
123+
setState(() {
124+
_untrustedInstallationSourceState = 'Detected';
125+
});
126+
},
115127
),
116128

117129
/// For iOS
@@ -151,6 +163,16 @@ class _MyAppState extends State<MyApp> {
151163
_missingSecureEnclaveState = 'Detected';
152164
});
153165
},
166+
onDeviceChangeDetected: () {
167+
setState(() {
168+
_deviceChangeState = 'Detected';
169+
});
170+
},
171+
onDeviceIdDetected: () {
172+
setState(() {
173+
_deviceIdDetectedState = 'Detected';
174+
});
175+
},
154176
),
155177

156178
/// Debugger is common for both platforms
@@ -188,4 +210,4 @@ class _MyAppState extends State<MyApp> {
188210
),
189211
);
190212
}
191-
}
213+
}

pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ packages:
7373
name: freerasp
7474
url: "https://pub.dartlang.org"
7575
source: hosted
76-
version: "0.0.2"
76+
version: "1.1.0"
7777
matcher:
7878
dependency: transitive
7979
description:

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ environment:
1212
dependencies:
1313
flutter:
1414
sdk: flutter
15-
freerasp: 1.0.0
15+
freerasp: 1.1.0
1616

1717
cupertino_icons: ^1.0.2
1818

0 commit comments

Comments
 (0)