Skip to content

Commit

Permalink
Merge pull request #24 from talsec/add-adb
Browse files Browse the repository at this point in the history
feat: add ADB detection callback
  • Loading branch information
msikyna authored Nov 20, 2024
2 parents 8f70f67 + a699ea2 commit 86b27cd
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 9 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.7.0] - 2024-11-19

### Capacitor

#### Added

- Added `adbEnabled` callback, which allows you to detect USB debugging option enabled in the developer settings on the device

### Android

#### Added

- ADB detection feature

## [1.6.0] - 2024-11-15

- Android SDK version: 12.0.0
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@ dependencies {
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"

implementation 'com.aheaditec.talsec.security:TalsecSecurity-Community-Capacitor:12.0.0'
implementation 'com.aheaditec.talsec.security:TalsecSecurity-Community-Capacitor:13.0.0'
}
4 changes: 3 additions & 1 deletion android/src/main/java/com/aheaditec/freerasp/Threat.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ internal sealed class Threat(val value: Int) {
object SystemVPN : Threat((10000..999999999).random())
object DevMode : Threat((10000..999999999).random())
object Malware : Threat((10000..999999999).random())
object ADBEnabled : Threat((10000..999999999).random())

companion object {
internal fun getThreatValues(): JSONArray {
Expand All @@ -42,7 +43,8 @@ internal sealed class Threat(val value: Int) {
Overlay.value,
ObfuscationIssues.value,
DevMode.value,
Malware.value
Malware.value,
ADBEnabled.value
))
)
}
Expand Down
4 changes: 4 additions & 0 deletions android/src/main/java/com/aheaditec/freerasp/ThreatHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ internal class TalsecThreatHandler(private val instance: FreeraspPlugin) :
instance.notifyListeners(Threat.DevMode)
}

override fun onADBEnabledDetected() {
instance.notifyListeners(Threat.ADBEnabled)
}

override fun onSystemVPNDetected() {
instance.notifyListeners(Threat.SystemVPN)
}
Expand Down
2 changes: 2 additions & 0 deletions dist/esm/definitions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export type NativeEventEmitterActions = {
devMode?: () => any;
systemVPN?: () => any;
malware?: (suspiciousApps: SuspiciousAppInfo[]) => any;
adbEnabled?: () => any;
};
export declare class Threat {
value: number;
Expand All @@ -84,6 +85,7 @@ export declare class Threat {
static ObfuscationIssues: Threat;
static DevMode: Threat;
static Malware: Threat;
static ADBEnabled: Threat;
constructor(value: number);
static getValues(): Threat[];
}
2 changes: 2 additions & 0 deletions dist/esm/definitions.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/esm/definitions.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion dist/esm/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 86b27cd

Please sign in to comment.