GithubHelp home page GithubHelp logo

mohgovil / hamagen-react-native Goto Github PK

View Code? Open in Web Editor NEW
507.0 31.0 158.0 5.44 MB

Israel's Ministry of Health's COVID-19 Exposure Prevention App

Home Page: https://health.gov.il/

License: MIT License

JavaScript 11.64% Starlark 0.49% Java 1.41% Swift 0.04% Ruby 0.84% C 0.03% Objective-C 3.77% TypeScript 81.78%
covid-19 coronavirus

hamagen-react-native's Introduction

hamagen-react-native's People

Contributors

almamoh avatar arielko1248 avatar dotansimha avatar greenyossi avatar kaplanlior avatar maxtoyberman avatar mirishalev avatar nirtamir2 avatar obit91 avatar orenmoh avatar rimony avatar rootux avatar sagivonoapps avatar sagivstekolshik avatar shinmem58 avatar yoav85 avatar yoavramon avatar yoel311 avatar yonatankalman avatar yonirimon 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

hamagen-react-native's Issues

Exposure radius and time - too strict?

Isn't 500 meters for 1 millisecond a bit strict?

    meterRadius: 500,
    intersectMilliseconds: 1, // 1 milli

The official guidelines are 2 meters for 15 minutes.

Unprepared statements in Database.js

In some of the queries that are executed in Database.js, you used string formatting instead of prepared statements.

I don't see how it leads to an actual security vulnerability - the only scenario I can imagine is that attacker with access to your server will be able to modify the saved user locations in the database (via malicious OBJECTID, for instance. see containsObjectID()) , but it's really impractical.

Although it's far from critical, it is a bad practice, and you should use prepared statements instead.

Few questions

What distance is measured between people?
Was exposure time taken into account?
Were inacurecies (of the cellular network, wifi structure) taken into account?
what about scenarios like - were they taken into account:
two people on both side of a wall (two apartments for example - horizontal / vertical)
two people in two cars one near another
single none segregated wifi in a building can show that the whole building is exposed
Does the government understand this is indicative? and there are many cases that will require further investigation?

iPhone 6, iOS 10.3.3 - Text issues

The info text about being exposed is overlapping and is hard to read. This problem is present only in Hebrew and English, Russian and Arabic seems to be fine.
(Also, the fifth language seems to be missing encoding and therefore shows question marks)

iPhone 6, iOS 10.3.3, app ver. 1.0.20 (updated on 23/3/2020)

magen_textover_bug_1 0 20

magen_encoding_bug_1 0 20

CI pipeline?

Hi @MohGovIL! Welcome to GitHub ;)

I was wondering if there is a plan to add a CI pipeline? it's useful and important especially because you are using TypeScript in this project - some issues could be detected easily in build time.

GitHub Actions supports React Native builds for iOS and Android (see https://blog.usejournal.com/automate-react-native-builds-with-github-actions-af54212d26dc )

Also, it could be done with Microsoft AppCenter (https://appcenter.ms/) - it can also automate the complete CD pipeline, and publish artifact to the App Stores automatically :)

Points.json only has one point on bus/train rides - false negatives

On bus rides with multiple stops, having only one point causes partial route overlaps to be missed.

Suggested fix: include an additional point, 20 meters before and after each bus stop along the route, to detect partial overlaps. 20 meters away from the stop, not at the stop itself, to avoid false positives when a sick person is on a bus, and the user is standing in the bus stop waiting for another bus. Alert only if both points between two stops are positive, which indicates that both passengers were indeed on the same bus.

iPhone SE - Unable to complete onboarding and unsupported screen size

Launch screen gets over scaled:

image

The iPhone SE is equipped with a 4‑inch (diagonal) LED‑backlit widescreen Multi‑Touch Retina display with 1136‑by‑640‑pixel resolution at 326 ppi.

After which user is stuck in the following screen, where the checkbox can be marked but no location privacy prompt is popping. Off screen button which needs to be tapped?

Commit convensions

I think it's better to have commit conversions since it's an open-source project it might be easier for new developers to see common commit conversions for example:

feat, chore, update, add, etc.

Also, separate your commits to subjects, and don't commit all your changes in one commit.

Notification is in English

If have Hebrew or any other language need to translate it too.
For people that don't know Hebrew...
And this government app and in israel Hebrew is the main language :)

Access the raw data the app compares to

How can one download the data of previous cases, to compare with it? I can export my location history to JSON, and I plan to write a program to locally compare it to your database. Is it possible to get the sick cases locations raw data?

Make locations comparison more efficient

Currently, checkSickPeople is doing a fetch to the base URL (locations DB) and gets it in its entirety.
Second, it iterates over the sick people locations DB, end for each document it iterates over the local DB which is O(m*n) (where m and n are the remote and local DB sizes).
As infections will become large (hopefully it wouldn't) this may be a bottleneck for the application, causing memory and performance issues.
While it is mostly a server-side work for enabling a more flexible API, I can try to make some suggestions.

  1. Get only the locations that haven't been inspected yet. No need to fetch and check locations that were already checked against the local DB since no new intersections can be found there.
    This can be implemented by utilizing a cursor, depending on the backend DB.
  2. Get only locations that occurred only after the application's first tracking. It is probably information the server can have on the user anyway (it can easily log its first API call), so it doesn't leak any additional information.
  3. Other optimizations depend on the amount of data we are willing to expose.
    If we're willing to give some rough boundaries for a user's locations, that can cut the amount of data significantly in the vast majority of cases.
  4. For making the iteration more efficient we can consider sorting the two lists (e.g. by time) and then working with 2 pointers for comparison and advancing.

Hard Coded Key in android/app/src/debug/res/values/

<string name="transistorsoft_key">c10047e800a8d08ee0e7236fc2b35d595bf89f020d99ea125eaf578c5a6180bd</string>

As a security person, I would want to avoid from hard coded keys.
If I got it right, the debug mode will allow an attacker to use this to impersonate the application as legitimate request and contaminate the db.

Let me know what you think and if this could be change, thanks.

Enable access for non-Israel app stores

At least on the Play store, I'm not able to install the app because my account is linked to the US store.

I suspect this is the cause of most problems at #26 - the store message make it seem like a device issue, but I'm on a clean Android on Pixel 3a so I doubt that's the cause.

The sick case number is missing from Points.json

In the Points.json file, each exposure object should contain the sick case number in the Name property, under the properties, as you use it here.


{
  "type": "Feature",
  "id": 7031,
  "geometry": {
    "type": "Point",
    "coordinates": [
      34.9617953000001,
      32.3125987
    ]
  },
  "properties": {
    "OBJECTID": 7031,
    "Name": MISSING,
    "Place": "סופרמרקט חינם פלוס צומת תנובות ",
    "Comments": "",
    "POINT_X": 34.9617953,
    "POINT_Y": 32.3125987,
    "fromTime": 1583677800000,
    "toTime": 1583681400000,
    "sourceOID": 1,
    "stayTimes": "14:30-15:30"
  }
}

App in play store is locked down to Israeli Google accounts

Why not open to all countries?
Some of us are using Non Israeli google accounts in the phone due to needing american apps.
Also, there might be foreign people in Israel with foreign accounts as well, who currently live here, and should use the app as well.

Text is too small

Enlarge the text on the app, there is a lot of unused space, so the text can be displayed with larger fonts that can be more readable

Bug: OS large font settings prevents installation for certain languages, on some devices

mi a2

The 'APPROVE' button is missing during {Eng / Rus} installation on Xiaomi Mi A2. with large font OS settting on. The issue probably occurs due to disabled scrolling in installation phase.

Impact: the issue prevents, for example, {Eng / Rus} speakers with large font setting on, from installing the app, if they don't switch to Hebrew.

If enabling scrolling on this specific dialog isn't an option (as suggested by @YOEL311"you can't do ScrollView in a Model") a possible solution might be to override the OS font size settings and to pick the size depending on the actual screen size -- so that the entire dialogue, including the 'APPROVE' button will fit 100% of the times, independent of OS / font settings / device.

improve russian translation

src\config\config.ts
old:
title: 'Возможно, обнаружено одно или несколько совпадений',
body: 'Нажмите здесь, чтобы узнать, если вы были выставлены'
suggested:
title: 'Найдено возможное нахождение вблизи зараженного',
body: 'Нажмите чтоб проверить если вы были вблизи зараженного'

suggest some fixes here:
https://matrixdemos.blob.core.windows.net/mabar/texts.json
"ru": {
"general": {
"start": "Начать",
"additionalInfo": "политика конфиденциальности"
},
"languages": {
"title": "Выберите язык",
"short": {
"he": "עב",
"en": "En",
"ru": "Ru",
"ar": "عر",
"am": "አማ"
},
"long": {
"he": "עברית",
"en": "English",
"ru": "Русский",
"ar": "عربيه",
"am": "አማርኛ"
}
},
"forceUpdate": {
"title": "Обновить версию",
"desc": "Появилась новая версия приложения. Чтобы продолжать поддерживать здоровье всех нас, мы рекомендуем обновить версию"
},
"forceTerms": {
"title": "Условия использования обновлены",
"desc": "Обновлены Условия использования приложения, чтобы мы могли продолжать поддерживать ваше здоровье. Примите новые Условия использования.",
"approve": "Подтвердить"
},
"welcome": {
"title": "Мы рады что вы присоединились к нашим усилиям!",
"subTitle1": "Тысячи израильтян могут пострадать от коронавируса.",
"subTitle2": "Диагностирование и карантин могут спасти их жизнь. Спасибо что помогаете нам!"
},
"location": {
"title": "Местонахождение критично",
"subTitle1": "Приложение будет собирать данные о вашем местонахождении, и сообщит вам если будет совпадение с данными местонахождения больных.",
"subTitle2IOS": "Ради этого вы должны включить услуги местонахождения на постоянной основе",
"subTitle2Android": "Ради этого вы должны включить услуги местонахождения на постоянной основе",
"dataAnonymous": "Данные будут сохранены анонимно",
"consent1": "Я прочитал и согласен с условиями ",
"consent2": "пользования",
"approveLocation": "Подтвердить"
},
"locationIOS": {
"title": "Включение услуг местонахождения\nна постоянной основе",
"subTitle1": "Чтобы регулярно получать точную информацию о вашим местонахождении, включите услуги местонахождения на постоянной основе.",
"subTitle2": "Измените настройки как указано в фотографиях",
"goToSettings": "Настройки",
"set": "Продолжить"
},
"notifications": {
"title": "Важно вас проинформировать",
"subTitle1": "Чтобы информировать вас об релевантных для вас событиях связанных с коронавирусом, подтвердите пожалуйста получение нотификаций от нас.",
"subTitle2": "Получение нотификаций от нас необходимо для вас и ваших близких.",
"approveNotifications": "Подтвердить получение нотификаций"
},
"allSet": {
"allGood": "Отлично!\nСейчас начнём"
},
"scanHome": {
"hasData": "успешная передача данных",
"noData": "Нет передачи данных",
"exposureHistory": "История контактов",
"noDataDesc": "Проверьте связь к интернету и услуги местонахождения",
"noExposure": "По имеющимся данным, вы не контактировали с больным.",
"noExposure1": "По данным собранным до сих пор,",
"noExposure2": "с:",
"noExposure3": "в:",
"noExposure4": ",мы не обнаружили контакта с больным",
"recommendation": "Вы можете закрыть приложение.Вся необходимая информация поступит к вам отдельным сообщением.",
"found": "Обнаружены",
"exposureEvents": "Потенциальное соприкосновение",
"reportedAt": "Документально записан",
"inDate": "Число",
"fromHour": "С часов,:",
"toHour": "до часов:",
"whereYouThere": "Были ли вы в этом месте в то же время?",
"no": "Нет",
"canContinue": "Можно продолжить",
"yes": "Да",
"needDirections": "Инструкции"
},
"exposuresHistory": {
"title": "История контактов",
"noExposures": "Нет точек соприкосновения"
},
"exposureInstructions": {
"title": "Рекомендации после выявления контакта",
"weUnderstand": "Вы оказались в точке соприкосновения",
"wrong": "Ошибка, я там не был.",
"keepSafe": "В целях поддержания вашего здоровья, здоровья вашей семьи и окружающих вас людей руководствуйтесь рекомендациями Министерства Здравоохранения и пожалуйста, примите следующие меры",
"goIntoIsolation": "исключите полностью контакты с другими людьми на протяжении 14 дней, не выходя из дома",
"reportIsolation": "оставьте сообщение на сайте Министерства Здравоохранения о вашем карантине",
"allInstructions": "Инструкции",
"reportSite": "Поставить в известность"
}
},

Fine granular Intersection calculation required

At the current release, the criterion for finding an intersection between a corona carrier to a given user on the production environment is "500 meter for 1 millisecond", which obviously does not make any sense.

./config/config.ts

Is:

{
..
   meterRadius: 500,
    intersectMilliseconds: 1, // 1 milli
}

Should:

{
..
   meterRadius: 10,
    intersectMilliseconds: 1000 * 60 * 15, // e.g. 15 minutes 
}

Location comparing

Hi,
I'm not sure you save the time that the user stay in each location. It's very important to take it into account because there could be a scenario that user has been within the same location but for few seconds.

Why Redux? (or: Refactor to use Hooks+Context)

It there a reason to use Redux? It seems like there is a mixup of Redux state, hooks and props passing across this repo. It could be simplified by using hooks for most cases, and use React context to manage state and share it across components.
I know hooks doesn't completely replace Redux and state, but in this case, and in small apps, it could simplify things.

I can help with improving it if the maintainers are ok with it :)

Question about functionality

If I installed the APP and went into the house of a person that is in quarantine and than back to my home, will I get notified about that?

Keep dependencies up-to-date?

You can use free tools to make sure you are always using the latest dependencies. From what I can see now, some are already outdated.
With a simple CI pipeline (#34) you can easily detect issues with updated dependencies before merging to master.

I can recommend on Renovate (https://github.com/renovatebot/renovate) , it's simple and nice (and it works for NodeJS dependencies and also for Pods)

[iOS] Can't run the app locally - several issues with XCode/RN configuration

It seems like there is an issue while trying to run the app on for iOS (using yarn ios). I'm using the latest commit from master.

TL;DR

I created a PR here that fixes those issues: #38

  1. Run react-native unlink react-native-background-geolocation to fix linking issues
  2. Make sure to install pods (cd ios && pod install)
  3. Update the npm ios script to run: react-native run-ios --scheme hamagen

How to reproduce

The first issue is that react-native-background-geolocation is linked manually, which is no longer needed in RN 0.60.

The log output is:

➜  hamagen-react-native git:(fix-deps) yarn ios 
yarn run v1.22.4
$ react-native run-ios
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually: 
  - react-native-background-geolocation (to unlink run: "react-native unlink react-native-background-geolocation")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.
Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md

Running react-native unlink react-native-background-geolocation does fix the issue.

Also, documentation doesn't refer to the actual setup flow required to make iOS app work.
For iOS, pods should be installed prior to starting rn. To fix that, it requires to do: cd ios && pod install

Then, there are issues with the XCode scheme - it has the incorrect name configured, and the existing schemes doesn't seems to be shared correctly, or pointing to an incorrect scheme.

The error is:

xcodebuild: error: The workspace named "codeAgainstCorona" does not contain a scheme named "codeAgainstCorona". The "-list" option can be used to find the names of the schemes in the workspace.

RN looks for codeAgainstCorona because of mismatch in the configuration. The actual name of the scheme is hamagen (could be listed using xcodebuild -workspace codeAgainstCorona.xcworkspace -list).

To fix that, we need to point to the correct scheme (which is missing in the repo from the first place, because it's was not shared correctly) in ios script in package.json:

react-native run-ios --scheme hamagen

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.