Skip to content
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

Release/6.9.0 #149

Merged
merged 11 commits into from
Nov 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: rename adb to adbEnabled
yardexx committed Nov 20, 2024
commit 42db64293aa80d16b4baae2bfaa72b0ed8b94f46
2 changes: 1 addition & 1 deletion example/lib/threat_notifier.dart
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ class ThreatNotifier extends AutoDisposeNotifier<ThreatState> {
_updateThreat(Threat.secureHardwareNotAvailable),
onSystemVPN: () => _updateThreat(Threat.systemVPN),
onDevMode: () => _updateThreat(Threat.devMode),
onADB: () => _updateThreat(Threat.adb),
onADBEnabled: () => _updateThreat(Threat.adbEnabled),
);

Talsec.instance.attachListener(threatCallback);
4 changes: 2 additions & 2 deletions lib/src/enums/threat.dart
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ enum Threat {
/// (Android Debug Bridge).
///
/// Android only
adb,
adbEnabled,
}

/// An extension on the [Threat] enum to provide additional functionality.
@@ -120,7 +120,7 @@ extension ThreatX on Threat {
case 45291047:
return Threat.devMode;
case 379769839:
return Threat.adb;
return Threat.adbEnabled;
default:
// Unknown data came from native code. This shouldn't normally happen.
exit(127);
4 changes: 2 additions & 2 deletions lib/src/talsec.dart
Original file line number Diff line number Diff line change
@@ -193,8 +193,8 @@ class Talsec {
callback.onSystemVPN?.call();
case Threat.devMode:
callback.onDevMode?.call();
case Threat.adb:
callback.onADB?.call();
case Threat.adbEnabled:
callback.onADBEnabled?.call();
}
});
}
4 changes: 2 additions & 2 deletions lib/src/threat_callback.dart
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ class ThreatCallback extends TalsecPigeonApi {
this.onSecureHardwareNotAvailable,
this.onSystemVPN,
this.onDevMode,
this.onADB,
this.onADBEnabled,
this.onMalware,
});

@@ -85,7 +85,7 @@ class ThreatCallback extends TalsecPigeonApi {
final VoidCallback? onDevMode;

/// This method is called when the device has active ADB (Android Debug)
final VoidCallback? onADB;
final VoidCallback? onADBEnabled;

@override
void onMalwareDetected(List<SuspiciousAppInfo> packageInfo) {
4 changes: 2 additions & 2 deletions test/src/enums/threat_test.dart
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ void main() {
expect(threatValues[10], Threat.secureHardwareNotAvailable);
expect(threatValues[11], Threat.systemVPN);
expect(threatValues[12], Threat.devMode);
expect(threatValues[13], Threat.adb);
expect(threatValues[13], Threat.adbEnabled);
});

test(
@@ -44,7 +44,7 @@ void main() {
expect(ThreatX.fromInt(1564314755), Threat.secureHardwareNotAvailable);
expect(ThreatX.fromInt(659382561), Threat.systemVPN);
expect(ThreatX.fromInt(45291047), Threat.devMode);
expect(ThreatX.fromInt(379769839), Threat.adb);
expect(ThreatX.fromInt(379769839), Threat.adbEnabled);
},
);
}
4 changes: 2 additions & 2 deletions test/test_utils/spy_threat_callback.dart
Original file line number Diff line number Diff line change
@@ -54,8 +54,8 @@ class SpyThreatListener {
callback.onSystemVPN?.call();
case Threat.devMode:
callback.onDevMode?.call();
case Threat.adb:
callback.onADB?.call();
case Threat.adbEnabled:
callback.onADBEnabled?.call();
}
}
}