Skip to content

Commit

Permalink
- combine hasUsbDevices with other checks (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilthreads669966 authored Oct 8, 2020
1 parent 2b871b8 commit aa5ac98
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions evade/src/main/java/com/evilthreads/evade/Evade.kt
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ inline suspend fun Context.evade(scope: CoroutineScope, requiresNetwork: Boolean
val hasAdbOverWifi = scope.async { hasAdbOverWifi() }
val isConnected = scope.async { isConnected() }
val hasUsbDevices = scope.async { hasUsbDevices() }
if( !isEmulator.await() && !isRooted.await() && !hasAdbOverWifi.await() && !isConnected.await()){
if(hasUsbDevices.await())
return OnEvade.Escape(false)
if( !isEmulator.await() && !isRooted.await() && !hasAdbOverWifi.await() && !isConnected.await() && !hasUsbDevices.await()){
if(requiresNetwork){
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
if(hasVPN())
Expand Down

0 comments on commit aa5ac98

Please sign in to comment.