Skip to content

Commit c41629c

Browse files
authored
Merge pull request #85 from talsec/release-3.9.0
Release 3.9.0
2 parents dd34f08 + a06444a commit c41629c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1225
-6973
lines changed

CHANGELOG.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,50 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.9.0] - 2024-09-25
9+
10+
- Android SDK version: 11.1.0
11+
- iOS SDK version: 6.6.0
12+
13+
### React Native
14+
15+
#### Fixed
16+
17+
- Fixed incorrect path to types in package.json
18+
19+
#### Changed
20+
21+
- Improved error messages when validation of the freeRASP configuration fails
22+
23+
### Android
24+
25+
#### Added
26+
27+
- Added the auditing of the internal execution for the future check optimization and overall security improvements.
28+
29+
#### Fixed
30+
31+
- Fixed native crashes (SEGFAULT errors) in `ifpip` method
32+
- Fixed collision for command line tools (like ping) invoked without absolute path
33+
34+
#### Changed
35+
36+
- ❗️Breaking: Changed the way TalsecConfig is created, we introduced a Builder pattern to make the process more streamlined and readable
37+
- Updated OpenSSL to version 3.0.14
38+
- Updated CURL to version 8.8.0
39+
- Refactored fetching the list of installed applications for root and hook detection.
40+
41+
### iOS
42+
43+
#### Added
44+
45+
- [Dopamine](https://github.com/opa334/Dopamine) jailbreak detection.
46+
47+
#### Changed
48+
49+
- Updated OpenSSL to version 3.0.14
50+
- Updated CURL to version 8.8.0
51+
852
## [3.8.2] - 2024-09-02
953

1054
### React Native
@@ -29,13 +73,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2973
### Android
3074

3175
- ⚡ Added new threat `devMode` for Developer mode detection
32-
- ⚡ Enhanced and accelerated the data collection logic
3376
- ⚡ Fixed proguard warning in specific versions of RN
3477
- ⚡ Fixed issue with Arabic alphabet in logs caused by the device’s default system locale
3578
- ✔️ Increased the version of the GMS dependency
3679
- ✔️ Updated CA bundle
3780

3881
### iOS
82+
- ⚡ Enhanced and accelerated the data collection logic
3983
- ⚡ Fixed issue with Arabic alphabet in logs caused by the device’s default system locale
4084
- ⚡ Passcode check is now periodical
4185
- ✔️ Updated CA bundle

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
freeRASP for React Native is a mobile in-app protection and security monitoring plugin. It aims to cover the main aspects of RASP (Runtime App Self Protection) and application shielding.
1010

11-
:loudspeaker: The official documentation has been moved to a new location. You can now find it [here](https://docs.talsec.app/freerasp). :loudspeaker:
11+
:loudspeaker: The official documentation has been moved to a new location. You can now find it [here](https://docs.talsec.app/docs-and-articles-portal). :loudspeaker:
1212

1313

1414
# Overview
@@ -46,10 +46,12 @@ Learn more about commercial features at [https://talsec.app](https://talsec.app)
4646

4747
Learn more about freemium freeRASP features at [GitHub main repository](https://github.com/talsec/Free-RASP-Community).
4848

49-
# :book: Discover Official Documentation
50-
Visit the [GitBook page](https://docs.talsec.app/freerasp) for comprehensive and up-to-date guides, tutorials, and technical documentation. It serves as your go-to resource, offering everything from basic instructions to advanced tips and tricks to help you get the most out of the project.
49+
# :book: Discover the Official freeRASP Documentation
50+
51+
Visit the [GitBook page](https://docs.talsec.app/freerasp) for comprehensive and up-to-date guides, tutorials, and technical documentation specifically for freeRASP. It serves as your go-to resource, offering everything from basic instructions to advanced tips and tricks to help you get the most out of the project.
5152

5253
## :link: Integration Guide
54+
5355
For integrating freeRASP on the React Native platform, be sure to follow all the steps in the [Integration Guide](https://docs.talsec.app/freerasp/integration). This guide provides detailed instructions to help you achieve a smooth and efficient integration.
5456

5557
Be sure to bookmark it and stay informed! :books: :sparkles:.
@@ -61,6 +63,7 @@ If you have any suggestions for improvement or notice anything that could be cla
6163
For information on older integration methods, you can refer to the [freeRASP wiki](https://github.com/talsec/Free-RASP-ReactNative/wiki), which includes comprehensive legacy details and guidance. Additionally, the old integration can be found when you checkout to a specific tag. Your input is invaluable in helping us improve our resources and provide even better support for your needs.
6264

6365
# :rocket: What's New and Changelog
66+
6467
Stay informed and make the most of freeRASP by checking out [What's New and Changelog](https://docs.talsec.app/freerasp/whats-new-and-changelog)! Here, you’ll discover the latest features, enhancements, and bug fixes we’ve implemented to improve your experience across all platforms, including Android, iOS, Flutter, React Native, Capacitor, and Cordova.
6568

6669
Don’t miss out on any updates and explore the changelog to see how we’re continually making freeRASP better for you!
@@ -70,3 +73,6 @@ Don’t miss out on any updates and explore the changelog to see how we’re con
7073
If you have any ideas for improvements, feel free to [raise an issue](https://github.com/talsec/Free-RASP-ReactNative/issues) and mark it with an **enhancement** label. We track these enhancements using [GitHub Projects](https://docs.github.com/en/issues/planning-and-tracking-with-projects/learning-about-projects/about-projects) to keep tasks organized and connected to relevant issues or pull requests.
7174

7275
You can check out the project board [here](https://github.com/orgs/talsec/projects/2).
76+
77+
# :page_facing_up: License
78+
This project is provided as freemium software, i.e. there is a fair usage policy that imposes some limitations on the free usage. The SDK software consists of open-source and binary parts, which is the property of Talsec. The open-source part is licensed under the MIT License - see the LICENSE file for details.

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ dependencies {
8787
//noinspection GradleDynamicVersion
8888
implementation "com.facebook.react:react-native:$react_native_version"
8989
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
90-
implementation "com.aheaditec.talsec.security:TalsecSecurity-Community-ReactNative:9.6.0"
90+
implementation "com.aheaditec.talsec.security:TalsecSecurity-Community-ReactNative:11.1.0"
9191
}
9292

9393
if (isNewArchitectureEnabled()) {

android/src/main/java/com/freeraspreactnative/FreeraspReactNativeModule.kt

Lines changed: 19 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import com.facebook.react.bridge.ReactApplicationContext
99
import com.facebook.react.bridge.ReactContextBaseJavaModule
1010
import com.facebook.react.bridge.ReactMethod
1111
import com.facebook.react.bridge.ReadableMap
12+
import com.facebook.react.bridge.UiThreadUtil.runOnUiThread
1213
import com.facebook.react.bridge.WritableArray
1314
import com.facebook.react.modules.core.DeviceEventManagerModule
1415

@@ -32,17 +33,18 @@ class FreeraspReactNativeModule(val reactContext: ReactApplicationContext) :
3233
) {
3334

3435
try {
35-
val config = parseTalsecConfig(options)
36+
val config = buildTalsecConfig(options)
3637
FreeraspThreatHandler.listener = ThreatListener
3738
listener.registerListener(reactContext)
38-
Talsec.start(reactContext, config)
39+
runOnUiThread {
40+
Talsec.start(reactContext, config)
41+
}
42+
3943
promise.resolve("freeRASP started")
4044

41-
} catch (e: Exception) {
42-
val params = Arguments.createMap().apply {
43-
putString("message", e.message)
44-
}
45-
promise.reject("initializationError", params)
45+
}
46+
catch (e: Exception) {
47+
promise.reject("TalsecInitializationError", e.message, e)
4648
}
4749
}
4850

@@ -85,42 +87,17 @@ class FreeraspReactNativeModule(val reactContext: ReactApplicationContext) :
8587
// Remove upstream listeners, stop unnecessary background tasks
8688
}
8789

88-
private fun parseTalsecConfig(config: ReadableMap): TalsecConfig {
89-
val androidConfig = config.getMap("androidConfig")!!
90-
val packageName = androidConfig.getString("packageName")!!
91-
val certificateHashes = mutableListOf<String>()
92-
val hashes = androidConfig.getArray("certificateHashes")!!
93-
for (i in 0 until hashes.size()) {
94-
// in RN versions < 0.63, getString is nullable
95-
@Suppress("UNNECESSARY_SAFE_CALL")
96-
hashes.getString(i)?.let {
97-
certificateHashes.add(it)
98-
}
99-
}
100-
val watcherMail = config.getString("watcherMail")
101-
val alternativeStores = mutableListOf<String>()
102-
if (androidConfig.hasKey("supportedAlternativeStores")) {
103-
val stores = androidConfig.getArray("supportedAlternativeStores")!!
104-
for (i in 0 until stores.size()) {
105-
// in RN versions < 0.63, getString is nullable
106-
@Suppress("UNNECESSARY_SAFE_CALL")
107-
stores.getString(i)?.let {
108-
alternativeStores.add(it)
109-
}
110-
}
111-
}
112-
var isProd = true
113-
if (config.hasKey("isProd")) {
114-
isProd = config.getBoolean("isProd")
115-
}
90+
private fun buildTalsecConfig(config: ReadableMap): TalsecConfig {
91+
val androidConfig = config.getMapThrowing("androidConfig")
92+
val packageName = androidConfig.getStringThrowing("packageName")
93+
val certificateHashes = androidConfig.getArraySafe("certificateHashes")
94+
95+
val talsecBuilder = TalsecConfig.Builder(packageName, certificateHashes)
96+
.watcherMail(config.getString("watcherMail"))
97+
.supportedAlternativeStores(androidConfig.getArraySafe("supportedAlternativeStores"))
98+
.prod(config.getBooleanSafe("isProd"))
11699

117-
return TalsecConfig(
118-
packageName,
119-
certificateHashes.toTypedArray(),
120-
watcherMail,
121-
alternativeStores.toTypedArray(),
122-
isProd
123-
)
100+
return talsecBuilder.build()
124101
}
125102

126103
companion object {

android/src/main/java/com/freeraspreactnative/FreeraspThreatHandler.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.freeraspreactnative
22

3+
import com.aheaditec.talsec_security.security.api.SuspiciousAppInfo
34
import com.aheaditec.talsec_security.security.api.ThreatListener
45

56
internal object FreeraspThreatHandler : ThreatListener.ThreatDetected, ThreatListener.DeviceState {
@@ -38,6 +39,8 @@ internal object FreeraspThreatHandler : ThreatListener.ThreatDetected, ThreatLis
3839
listener?.threatDetected(Threat.ObfuscationIssues)
3940
}
4041

42+
override fun onMalwareDetected(p0: MutableList<SuspiciousAppInfo>?) {}
43+
4144
override fun onUnlockedDeviceDetected() {
4245
listener?.threatDetected(Threat.Passcode)
4346
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package com.freeraspreactnative
2+
3+
import com.facebook.react.bridge.ReadableArray
4+
import com.facebook.react.bridge.ReadableMap
5+
import com.freeraspreactnative.exceptions.TalsecException
6+
7+
internal fun ReadableMap.getMapThrowing(key: String): ReadableMap {
8+
return this.getMap(key) ?: throw TalsecException("Key missing in configuration: $key")
9+
}
10+
11+
internal fun ReadableMap.getStringThrowing(key: String): String {
12+
return this.getString(key) ?: throw TalsecException("Key missing in configuration: $key")
13+
}
14+
15+
internal fun ReadableMap.getBooleanSafe(key: String, defaultValue: Boolean = true): Boolean {
16+
if (this.hasKey(key)) {
17+
return this.getBoolean(key)
18+
}
19+
return defaultValue
20+
}
21+
22+
internal fun ReadableArray.toArray(): Array<String> {
23+
val output = mutableListOf<String>()
24+
for (i in 0 until this.size()) {
25+
// in RN versions < 0.63, getString is nullable
26+
@Suppress("UNNECESSARY_SAFE_CALL")
27+
this.getString(i)?.let {
28+
output.add(it)
29+
}
30+
}
31+
return output.toTypedArray()
32+
}
33+
34+
internal fun ReadableMap.getArraySafe(key: String): Array<String> {
35+
if (this.hasKey(key)) {
36+
val inputArray = this.getArray(key)!!
37+
return inputArray.toArray()
38+
}
39+
return arrayOf()
40+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package com.freeraspreactnative.exceptions
2+
3+
class TalsecException(message: String, val code: String? = null, val ex: Exception? = null) : Exception(message)

example/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const App = () => {
1414
const config = {
1515
androidConfig: {
1616
packageName: 'com.freeraspreactnativeexample',
17-
certificateHashes: ['your_signing_certificate_hash_base64'],
17+
certificateHashes: ['AKoRuyLMM91E7lX/Zqp3u4jMmd0A7hH/Iqozu0TMVd0='],
1818
// supportedAlternativeStores: ['storeOne', 'storeTwo'],
1919
},
2020
iosConfig: {

ios/FreeraspReactNative.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class FreeraspReactNative: RCTEventEmitter {
2020
try initializeTalsec(talsecConfig: options)
2121
}
2222
catch let error as NSError {
23-
reject("initialization_error", "Could not initialize freeRASP", error)
23+
reject("TalsecInitializationError", "Could not initialize freeRASP: \(error.domain)", error)
2424
return
2525
}
2626
resolve("freeRASP started")

ios/TalsecRuntime.xcframework/Info.plist

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,35 @@
55
<key>AvailableLibraries</key>
66
<array>
77
<dict>
8+
<key>BinaryPath</key>
9+
<string>TalsecRuntime.framework/TalsecRuntime</string>
810
<key>LibraryIdentifier</key>
9-
<string>ios-arm64</string>
11+
<string>ios-arm64_x86_64-simulator</string>
1012
<key>LibraryPath</key>
1113
<string>TalsecRuntime.framework</string>
1214
<key>SupportedArchitectures</key>
1315
<array>
1416
<string>arm64</string>
17+
<string>x86_64</string>
1518
</array>
1619
<key>SupportedPlatform</key>
1720
<string>ios</string>
21+
<key>SupportedPlatformVariant</key>
22+
<string>simulator</string>
1823
</dict>
1924
<dict>
25+
<key>BinaryPath</key>
26+
<string>TalsecRuntime.framework/TalsecRuntime</string>
2027
<key>LibraryIdentifier</key>
21-
<string>ios-arm64_x86_64-simulator</string>
28+
<string>ios-arm64</string>
2229
<key>LibraryPath</key>
2330
<string>TalsecRuntime.framework</string>
2431
<key>SupportedArchitectures</key>
2532
<array>
2633
<string>arm64</string>
27-
<string>x86_64</string>
2834
</array>
2935
<key>SupportedPlatform</key>
3036
<string>ios</string>
31-
<key>SupportedPlatformVariant</key>
32-
<string>simulator</string>
3337
</dict>
3438
</array>
3539
<key>CFBundlePackageType</key>

0 commit comments

Comments
 (0)