Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

My MAD Notes

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Android Security Model

Security features provided by Android:


1.Application Sandboxing:
Android applications operate in an isolated environment, preventing unauthorized
access to other applications' data when permissions are not granted.
2.Permission System:
Android features a robust permission system where applications need to declare
their permissions in their manifest file. Users grant permissions to applications
during installation, and they can manage permissions in the device settings.
3.Randomized Testing:
Android supports randomized testing, continuously examining the elements of the
operating system. During the boot process, the system verifies the integrity of each
component, or prevents booting if any inconsistencies are detected.
4.File-Based Encryption:
Android supports file-based encryption, providing independent encrypted storage
for each user profile. This secures users' data, ensuring the security and privacy of
their data.
5.Google Play Protect:
Google Play Protect is a content-aware malware security service that checks for
vulnerabilities on the device and applications from the Google Play Store. This
enables users to access safe and convenient applications.
6.Verified Boot:
Android devices support verified boot, ensuring the integrity of the operating
system. During the boot process, the system verifies the integrity of each
component, preventing the device from booting if tampering is detected.
7.Hardware Security Module (HSM):
Security Models in Android:
1.Sandboxing:
Application sandboxing means each application runs independently, without access
to data from other applications until permission is granted.
2.Permission Security:
Android applications request permission. This power involves regular monitoring of
these permission grants.
3.Data Encryption:
Android devices encrypt data to ensure privacy and security.
4.Secure Elements (Zone-Space Encryption):
Shielded Information Modules (SIM, Trusted Executable) create zone-space
encryption. These are hardware security models used for secure credentials.
5.Security Storage (KeyStore):
Android applications use KeyStore for certificates, passwords, and other secure
information.
6.Biometric Authentication:
Android devices support various biometric authentication methods, such as
fingerprint scanning and facial recognition.
7.Secure Automation:
Android supports secure automation supervisor services for applications, ensuring
company data and device security.
8.Application Continuous Update:
Android enables application updates to ensure application security.
9.Android Enterprise:
Android Enterprise is a form of industry-level suitable security.
Android permissions are necessary for apps to function properly and keep your
device secure.
Following are some of the important permissions :
1.INTERNET
Allows apps to access the internet for downloading and uploading data, like
browsing websites and in-app communication.
2.ACCESS_NETWORK_STATE
Provides information about the network status, such as data usage monitoring and
checking internet connectivity.
3.READ_EXTERNAL_STORAGE
Enables reading files stored externally, like photos and videos on an SD card.
4.WRITE_EXTERNAL_STORAGE
Allows apps to write data to external storage, such as saving files or downloading
content.
5.CAMERA
Used for taking photos and videos using the device's camera.
6.READ_CONTACTS
Allows access to view contacts stored in the contact database.
7.WRITE_CONTACTS
Enables adding new contacts to the contact database.
8.ACCESS_FINE_LOCATION
Allows precise location tracking.
9.ACCESS_COARSE_LOCATION
Allows approximate location tracking.
CALL_PHONE
Allows making phone calls and guiding voice calls.
SEND_SMS
Sending SMS messages.
RECEIVE_SMS
Receiving SMS messages.
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission
android:name="android.permission.READ_PHONE_STATE" />

Declaring and Using Permissions


Android features a robust permission system for the purpose to protect the privacy
of an android user, where applications need to declare there permissions in the
AndroidManifest.xml file under the “manifest” folder in the android studio.
Android apps must request permission to access sensitive user data (such as
contacts and SMS) as well as system features (such as camera and internet).
Depending on the permission, the system might grant the permission automatically
or might the prompt the user to approve the request.
To declare a permission, use the <uses-permission> element in the
AndroidManifest.xml file with the permission name as its attribute value.
For Example :
1. To Send SMS
<uses-permission android:name=”android.permission.SEND_SMS”/>
- It allows the app to send the SMS messages .
2. Bluetooth Operations
<uses-permission android:name=”android.permission.BLUETOOTH”/>
<uses-permission android:name=”android.permission.BLUETOOTH_ADMIN”/>
<uses-permission
android:name=”android.permission.ACCESS_COARSE_LOCATION”/>
<uses-permission
android:name=”android.permission.BLUETOOTH_CONNECT”/>
<uses-permission
android:name=”android:permission.BLUETOOTH_ADVERTISE” />

3. Internet permission:
<uses-permission android:name="android.permission.INTERNET" />
4. Read contacts permission:
<uses-permission android:name="android.permission.READ_CONTACTS" />
5. Camera usage permission:
<uses-permission android:name="android.permission.CAMERA" />
6. Fine location access permission:
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION" />

- To use a declared permission, first check if the permission is granted at


runtime using checkSelfPermission() method in activity.

- If the permission is not granted,we can request it using the


requestPermissions() method .

Eg . //Check if the CAMERA permission is already granted


If(ContextCompat.checkSelfPermission(this,Manifest.permission.CAMERA)!
=PackageManager.PERMISSION_GRANTED)
{
//Request Camera Permission
ActivityCompat.requestPermissions(this,new String[]
{Manifest.permission.CAMERA},REQ_CODE);
}
else
{
//Permission already granted
//Process with accessing the camera
}

You might also like