Git Product home page Git Product logo

aarogyasetu_android's Introduction

Aarogya Setu Android app

alt text

Aarogya Setu is a mobile application developed by the Government of India to connect essential health services with the people of India in our combined fight against COVID-19. The App is aimed at augmenting the initiatives of the Government of India, particularly the Department of Health, in proactively reaching out to and informing the users of the app regarding risks, best practices and relevant advisories pertaining to the containment of COVID-19.

Features

Aarogya Setu mobile application provides the following features:

  • Minimal and simple user interface, which user can get easily acquainted with
  • Scan nearby Aarogya Setu user using BluetoothLE Scanner
  • Advertise to nearby Aarogya Setu user using BluetoothLE GATT Server
  • Update user about nearby activity using Location Service
  • Secure information transfer with SSL Pinning
  • Encrypt any sensitive information
  • Available in 12 different languages
  • Nation wide COVID-19 Statistics
  • Self-Assessment as per MoHFW and ICMR guidelines
  • Emergency Helpline Contact
  • List of ICMR approved labs with COVID-19 testing facilities
  • e-Pass integration

The Aarogya Setu App is being widely used by more than 11 Crore Users. The App has been highly successful in identifying people with high risk of COVID-19 infection and has also played a major role in identifying potential COVID-19 hotspots. In the larger public interest and in order to help the international community in their COVID-19 efforts, the Government of India is opening the source code of this App under Apache License 2.0.

If you find any security issues or vulnerabilities in the code, then you can send the details to us at : [email protected]

If you want to convey any other feedback regarding the App or Code, then you can send it to us at : [email protected]

Setup

Requirements

  • JDK 8
  • Latest Android SDK tools
  • Latest Android platform tools
  • Android SDK 21 or newer
  • AndroidX

Configure

  • ./keystore.properties
  • Firebase - google-services.json

keystore.properties

Setup a keystore.properties at the root folder with following sample detail and your configurations

# Server SSL Keys
ssl_public_key=<Your Public Key>
ssl_backup_key=<Your Backup Key>
ssl_auth_key=<Your Auth Key>
ssl_auth_backup_key=<Your Auth Backup Key>

aws_api_key=<Your AWS Key>
platform_key=android_key

# Android Keystore details
android_alias=YourAndroidAlias
android_keystore=YourAndroidKeyStore
transformation=AES/GCM/NoPadding

# BLE UUIDs
service_uuid=YOURUUID-1234-ABCD-WXYZ-A12B34C56D78
did_uuid=YOURUUID-1234-ABCD-WXYZ-A12B34C56E78
pinger_uuid=YOURUUID-1234-ABCD-WXYZ-A12B34C56F78


# API URLs
webview_url = <Your Web URL>
webview_host = <Your Web Host>
app_host_url = <Your App Host>
auth_host_url = <Your Auth Host>

# API End Points
bulk_upload_api = /api/v1/end/point/1/
register_user_api = /api/v1/end/point/2/
update_fcm_token_api = /api/v1/end/point/3/
check_status_api = /api/v1/end/point/4/
fetch_config_api = /api/v1/end/point/5/
generate_otp_api = endPoint6
validate_otp_api = endPoint7
refresh_auth_token_api = endPoint8
qr_fetch_api = endPoint9
call_us_url=tel:1075
faq_url=<Your URL>
privacy_policy_url=<Your URL>
tnc_url=<Your URL>
verify_app_url=<Your URL>

# APK sign Keystore details:
key_store_cetificate = yourCertificate.jks
key_store_password = yourStorePassword
key_alias = yourAlias
key_password = yourPassword

Firebase and google-services.json

Setup Firebase for the different environment. Download the google-services.json for each of the environments and put it in the corresponding folder.

Debug: ./app/src/debug/google-services.json

Production: ./app/src/google-services.json

Build

./gradlew assembleDebug

Download App

Get it on Google Play

aarogyasetu_android's People

Contributors

chandrapal-yadav avatar delhiamitk avatar harryoxford avatar punit-go-mmt avatar rahulgoyaliitr avatar rsmnic avatar vikalp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aarogyasetu_android's Issues

isRooted Detection can be improved

isRooted Only check the test-keys , uperuser.apk and su but system can be rooted with many other way.

Like
TEST KEYS
DEV KEYS
NON RELEASE KEYS
DANGEROUS PROPS
PERMISSIVE SELINUX
SU EXISTS
SUPERUSER APK
SU BINARY
BUSYBOX BINARY
XPOSED
RESETPROP(EXPERIMENTAL)
WRONG PATH PERMITION
HOOKS

these are some key points

https://github.com/DimaKoz/meat-grinder

This uses some some native NDK methods to check so..

I can push this mechanisam as I've implemented this in my another app

Thanks n Regards:
Haneet Singh Chhabra

use of point datatype instead of plain-text cords

in line 60 and 61
database.execSQL("CREATE TABLE nearby_devices_info_table_backup " + "(id INTEGER NOT NULL, bluetooth_mac_address TEXT,distance INTEGER, lat TEXT,long TEXT,timestamp INTEGER, PRIMARY KEY(timestamp))");
there should be a check here that validates if the given lat long co-ordinates are valid lat-long cords also instead of just using TEXT datatype, wouldn't DECIMAL or POINT datatype should be used?

Safe Path of Movement

With easing of lockdown Movement of people will increase so an navigation option should be added so that people can move from one location to another location
by safe (green) path (Contamination free or low risk) instead of people relying on Google Maps or for shortest route between two points

Encrypt local fight-covid-db using SQLCipher

The current android room database present locally doesn't encrypt and store the information even locally which would be good security practice to do. This can be easily implemented with SQLCipher where the plaintext data like latitude, longitude, bluetooth_mac_address, timestamp are encrypted on the local device using a randomly generated symmetric key from the AndroidKeyStore for which this app already seems to contains support taking a look at the SecureUtils

App treats multiple devices of same user as different people

Allow for an username or id system which can link multiple users to a single account and prevent confusion, for eg if a someone gets tested positive and uses multiple devices, does he get marked as +ve on all of them or just one, both can cause confusion as just marking a single entry will overlook the times user came in contact using the other device, and in the latter, single user might show up as 2 diff people who got tested +ve in stats...

Wrong link present in the advisory section

In case a person selects "Recently interacted or lived or currently live with someone who has tested positive for COVID-19" in the assessment section
The link in the subsequent bot for:
List of testing centers: https://icmr.nic.in/node/39071 lands the user on a URl which says Not Found.
In short, it returns 404 which should be fixed.

Why the native framework is not adopted?

Instead of developing the App for two Platforms with two different codebases, you can have got in one codebase if you have used a framework like flutter. That would be much easier for developers to find a bug and that will be rectified with ease.

Check for mock location is not present

Anyone can easily change there location by using mock locations apps. Check if any other apps from the device is using in ACCESS_MOCK_LOCATION Permission.

Auto scrolling Marquee text of stats should be allowed to paused

The auto scrolling of stats of no of users, at risk and infected within a certain radius can be too fast for elders to read, also it causes unnecessary waste of time, it should paused when touching over it, allow manual scrolling or make it a normal larger list window which doesn't require scrolling...

Anti Red Zone Route Detection

Mechanism which suggest route people which avoid red zone or zone with more cases.
As lockdown is going to end soon, at least people avoid selecting a red zone path.

UI/UX Improvements for fonts / icons / back-button action.

The reassess/reset button icon on the top right corner of the self-assessment page shows up as a green box with an X in it.
The logo needs to be fixed, as without a clear icon or caption it's purpose is ambiguous.

Device: Samsung M30S
One UI Core Version: 2.0
Android version: 10

App auto logged out and scan service continued running

Out of the blue, when I opened the app a couple of days ago, I received a toast stating "you have been logged out" and was taken to the splash/on-boarding screens. The scan service was running (persistent notification showing) unitl I opened the app. I had to go through the on-boarding and sign-up process again to resume the scan service. Another user of the app I know also experienced this "random" app logout. Unfortunately I do not have logs or a way to reproduce the issue.

Build fails because of missing keystore.properties

The gradle build of the project looks for a keystore.properties file, which is missing from the checked in codebase.

def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

While the details are mentioned in the readme, please checkin a default file as is which needs to be configured by the developers running the build.

Where is the server code ?

This release misses

  1. Server code
  2. Ios & Kaios apps
  3. Cloud & Deploy functions.

This release does not help in transparency without 1 & 3

Add indicator to show bluetooth uptime

In order to prevent users from faking the green badge, It is essential to provide Bluetooth uptime % on home screen to ensure the risk status is not false positive. Organizations permitting entry based on green status can make an informed decision.

CHECK FOR MOCK LOCATION and ROOT access not available

The application is vulnerable to location spoofers which let them allow to enable mocklocation and use any third party app and the major problem are the handset with root access which can manupulate the application location by systemizing the spoofing apps

Search option in ICMR Approved Labs doesn't work

The option to choose the name of a State or UT in the search section of ICMR approved labs doesn't populate the searched UT or State.
For instance, I tried searching Ladakh & still landed on Uttar Pradesh which is my home state by default.

Steps to reproduce:

  1. Go to Useful Resources Section & Click on ICMR Approved Labs
  2. Click on the CTA (Uttar Pradesh) in my case.
  3. Enter the keyword 'Ladakh'
  4. Nothing will be displayed about the search

There is not even an error on the page. A user can search for any name, it will only show the default state present unless the user explicitly selects a particular state or UT.

Android Build Version : 1.1.3

Chnage bluetooth name

it's change Bluetooth name and doesn't allow other devices to connect them or causes trouble connecting with them.

'Turn on' Bluetooth CTA launches the prompt twice to Allow Aarogya Setu to enable bluetooth

In case the user turns of the bluetooth of cellphone. On launching the app, there is a modal to turn on the bluetooth. When a user clicks on the modal, another prompt appears on the screen which says, "Allow Aarogya Setu to enable Bluetooth?"

This little dialog box appears for approximately 3 seconds and vanishes & relaunches again.

Device details:
Huawei P20 Lite
Android Version 9
Resolution: 2280 * 1080

Any way to disable the keystore.Properties check, or bypass it?

Since unless you implement the server yourself, which you can't (yet), there's virtually no way to compile the app. even if you somehow add all the properties, you'll have to manually "disable" each crash or bad api response.

basically, is it possible to compile a demo version of the app, without actual api calls (since no server side code has been released (yet) ).
even a fake api inbuilt into the app would work, because implementing the server by yourself is a tough thing to do

Minor cosmetic display issues upon choosing language as Kannada

There are few minor cosmetic display issues when we choose language as Kannada:

  1. When the assessment is taken and it is low risk, the "ok" button and auto-reply "ok" text are in english whereas all the questions and auto-answers before it appear in Kannada.
  2. The button text in Kannada on the app home page for "call helpline" and "assess again" buttons is displayed out of the button layout border.

Wishlist: CVE-2020-0022 warning on before collecting Bluetooth permission

CVE-2020-0022, affects devices running Android Oreo (8.0 and 8.1) and Pie (9.0) and can allow remote code execution over Bluetooth with no additional execution privileges needed without any user interaction. More here https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-0022

Considering a major number of these devices in India may not have received Feb 2020 security update, it is better to give a warning pointing the risks before switching on Bluetooth 24/7.

Use of Moshi over Gson

Moshi is a modern, high performance and recommend serialisation library for kotlin and java by Square developers. Gson has some limitations and existing bugs which Moshi overcomes. If it's used in this codebase we can also reduce some amount of code.

Wishlist: Need a mandatory sunset clause

All proximity tracing applications take too many critical device permissions, and it should sunset from functioning after the covid19 crisis period.

A sunset policy is essential for all proximity tracing apps.

Do Check for Mock Location

Since there isn't any method called to check whether mock location is enabled or not, hackers/miscreants can use any mock location app to hide their real location and report infection from this fake location.
Since the program does not have any checks for Temporary phone numbers ,
A user could register/login using a temporary phone number hide his location and report a fake covid infection case.
adding this simple permission check will prevent this

public static boolean isMockSettingsON(Context context) {
// returns true if mock location enabled, false if not enabled.
if (Settings.Secure.getString(context.getContentResolver(),
Settings.Secure.ALLOW_MOCK_LOCATION).equals("0"))
return false;
else
return true;
}

Support for Android 10 and above

To support and run this app seamlessly on Android 10 or above there should be permission ACCESS_BACKGROUND_LOCATION. Because this permission is needed to be granted to access location in the background. Otherwise this application will not work on devices having Android 10 or above OS version. If it looks good to you then I'll be happy to work on it.

Please add a Code of Conduct

Please add a clear code of conduct for this repo.
People have a lot of devisive sentiments related to this app and it is very likely that this repo will be brigaded or the issues be used for insensitive comments.

Already I can see fights breaking out in GH Issues, with folks making personal attacks on each other.
To prevent this repo become a battlefield for politically motivated comments, a CoC is absolutely needed. See here for inspiration
https://help.github.com/en/github/building-a-strong-community/adding-a-code-of-conduct-to-your-project

For your reference, and to get the discussion started, I will add some great CoCs used by other OSS communities:

  1. Rust-lang has a fantastic community with a good CoC that you can refer to https://github.com/rust-lang/rust/blob/master/CODE_OF_CONDUCT.md
  2. Here is the one for Docker https://github.com/docker/code-of-conduct/blob/master/code-of-conduct-EN.md
  3. Here's python's https://github.com/python/pycon-code-of-conduct/blob/master/code_of_conduct.md
  4. Nodejs have separated their CoC into community guilines and Moderation policies. I really like their approach here https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md

You will need to have clear definitions of what infarctions are and how they will be handled.
Best of luck!

Also, separate out the discussion forum so that people who want to discuss items which are not issues/FRs, can do so without polluting the main repo. GH has discussion board built in.

PS. unrelated but just wanted to say that it is so amazing to have this app as an OSS project. Hats off to you guys.

Integrity checks for ECB mode on older android devices, Potential security bug

This seems slightly hard to validate given the challenges in #16 Looking through the workflow of the code, the symmetric key encryption mode used for older Android devices is AES128 with ECB mode, as a sanity check:

  1. Do not reuse the AES keys for multiple encryptions especially when in ECB mode. (This seems to be happening with initCipherForLessThanM() and generateKeysForAPILessThanM() being called for every encryption on API < M) which is used to locally encrypt the latitude and longitude fields with the key.
  2. This however doesn't make it clear as to why there is an RSA keygen in generateKeysForAPILessThanM attempted every single time getCipher() is called especially when the RSA keypair isn't used in the encryption process at all, if it is, which public key is being used to encrypt this data? Is this the Aarogya Setu hosted public key?
  3. Looking at the official android documentation, Android M (API level 23) from the build numbers list seems to support NoPadding based AES GCM from API level 10, if this is the case, why is the ECB mode continued to be used?

So this leads to the final question:

  • Why is the encryption locally on older devices below Android M using AES 128 with ECB when it is insecure while GCM or CBC+MAC exists?
  • Are there IV values which are changed for every symmetric encryption irrespective of initializing EncryptionUtil() or DecryptionUtil() since IV becomes the first block of the cipher text? It currently looks like this only happens once and the singleton instance with the same IV value continues to be used.

[Question] Is open-sourcing the iOS App on the roadmap?

Thanks for open-sourcing the Android App! A fantastic step towards openness and transparency. I would like to ask, will the iOS App be open-sourced in a similar fashion anytime soon? It will be another great step towards openness.

Thanks.

Multiple CVEs per MobSF scan

There was a comment about static code analyzers being unaware of dynamism of the app and the same will be addressed in a FAQ. Unable to locate the FAQ and reporting multiple CVEs as per MobSF .

Ideally, each of these issues must be verified / tracked separately. But looking for FAQ if any related to static code analysis that is missing in the release.

image
image
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.