simlar-android icon indicating copy to clipboard operation
simlar-android copied to clipboard

Internet availability may not be being verified in methods

Open caev03 opened this issue 4 years ago • 0 comments

Dear Developer!

My name is Camilo Escobar, I am a PhD Student at Universidad de los Andes, Colombia. I am part of a research on the usage of network libraries within android apps. As a result of this we have identified some code locations that might have a missing validation of Internet availability, validation that is needed since some network operations are being performed within some methods.

As you might know, a device may be connected to a network but may not have Internet connection. Therefore it is recommended for the app to identify whether the device is connected to a network having Internet connectivity before performing a network operation.

In order to address this issue we recommend you to visit:

  1. https://developer.android.com/reference/android/net/NetworkCapabilities
  2. https://developer.android.com/reference/android/net/NetworkCapabilities#NET_CAPABILITY_INTERNET
  3. https://developer.android.com/reference/android/net/NetworkCapabilities#NET_CAPABILITY_VALIDATED

Potential Code Location missing Internet connectivity validation:

https://github.com/simlar/simlar-android/blob/6af259d2c9c52dba69f508878679e21c77c484d4/app/src/main/java/org/simlar/https/HttpsPost.java#L79-L85

caev03 avatar Aug 16 '21 12:08 caev03