Comments (3)
`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;
}
`//something like this?
from aarogyasetu_android.
Yup I can easily use a fake GPS app and keep switching my location. If you have used the UTS app in Mumbai to book a local train ticket then the app stops you from booking a ticket if you're using using mock location.
Aarogya Setu can do something like that too
from aarogyasetu_android.
There can be two way to do so..
One check is device has any app which is using MOCK Location permission
Second Is system is mocking location?
For One:-
static boolean isMockLocationOn(Location location, Context context) {
return location.isFromMockProvider();
}
For Second :- static boolean areThereMockPermissionApps(Context context) {
int count = 0;
PackageManager pm = context.getPackageManager();
List<ApplicationInfo> packages =
pm.getInstalledApplications(PackageManager.GET_META_DATA);
for (ApplicationInfo applicationInfo : packages) {
try {
PackageInfo packageInfo = pm.getPackageInfo(applicationInfo.packageName,
PackageManager.GET_PERMISSIONS);
// Get Permissions
String[] requestedPermissions = packageInfo.requestedPermissions;
if (requestedPermissions != null) {
for (int i = 0; i < requestedPermissions.length; i++) {
if (requestedPermissions[i]
.equals("android.permission.ACCESS_MOCK_LOCATION")
&& !applicationInfo.packageName.equals(context.getPackageName())) {
count++;
}
}
}
} catch (PackageManager.NameNotFoundException e) {
Log.e("Got exception " , e.getMessage());
}
}
if (count > 0)
return true;
return false;
}
from aarogyasetu_android.
Related Issues (20)
- GattClient not used. Who is connecting to server then?
- New tech repport
- iOS - Translation text is missing for delete_account_title
- patient status problem when the active patient changes his handset
- This repo isn't updated as per the play store version! HOT 1
- Autostart permission
- Reporting Low SPO2 in patients across India
- BluetoothLE: Scanning nearby user not working
- New Feature to check availability of beds for Covid-19 critical patient HOT 4
- Feature Request : Notify users when Vaccines are available at the nearest location.
- Vaccination slots booked by bots HOT 2
- OTP validity mismatch
- Suggestions on New UI changes in Arogya Setu.. current UI is against desired output
- correction in autofill feature of mobile number in Aarogya Setu App HOT 1
- [BUG] Error in identity validation
- Feature Request : arogyasetu should also show if Bluetooth contacts are vaccinated
- Jรก
- [Suggestion] Add an option for choosing vaccine other than Covishield, Covaxin
- Unsuccessful account deletion
- Unable to log in arogyasetu app despite entering phone number HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aarogyasetu_android.