Android Flashcards

1
Q

What is a Service in Linux?

A

In Linux a service is just another name for a daemon, which is a client / server application that runs in the background. A service is continuously listening for incoming requests and sends a response based on the request given.

A Linux service is an application (or set of applications) that runs in the background waiting to be used, or carrying out essential tasks. I’ve already mentioned a couple of typical ones (Apache and MySQL). You will generally be unaware of services until you need them. …

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a Process in Linux?

A

A process is simply an application or a script which can be running in the foreground or the background.

Processes carry out tasks within the operating system. A program is a set of machine code instructions and data stored in an executable image on disk and is, as such, a passive entity; a process can be thought of as a computer program in action.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the four main components of Android apps?

A

Activities
Services
Content Providers
Broadcast Receivers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

A single focused thing a user can do. They are the main building blocks of Android GUI applications.

A

Activity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

A component that runs in the background and has no user interface. Typically used to perform some long-running operation, without blocking the user interface. (like downloading a file or playing music).

A

Service

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What;s the difference between a system service and an application service?

A

System services, which are part of the OS, are always running.

App services are started and stopped on demand.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Content Providers

A

An interface to app data, which is typically stored in a database or files.
Accessed via IPC
Mainly used to share data with other apps.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a Broadcast Receiver?

A

An app component that responds to system-wide events call broadcasts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a broadcast?

A

A system-wide event that can originate from the system of from an app.

System ex. - Announcing changes in network connectivity.

App ex. - Announcing that background data update has completed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is Binder?

How does it work?

A

An IPC mechanism.

Binder manages address space of each process. Acts as a middle-man.

inter-process communication (IPC)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does Binder prevent privilege escalation?

A

Binder automatically adds process ID (PID) and user ID of the calling process to the transaction data.

Identity can’t be faked because the kernel provides the PID and UID.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is an Intent?

A

Commands with associated data that are delivered to components across process.

Built on top of binder.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a contentprovider (component)?

A

Components that expose a cross-process data management interface.

Built no top of binder.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is SELinux?

A

It’s a MAC implementation of the Linux kernel.

Security Enhanced Linux

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does Mandatory Access Control do?

A

MAC ensures that access to resources conforms to a system-wide set of authorization rules called a policy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is DAC and how does it differ from MAC?

A

Discretionary access control.

Once a user gets access to a particular resource, they can pass it on to another user at their discretion.

17
Q

How is SELinux used in Android?

A

Enforcing mode for core system daemons (policy violations cause runtime errors)

Apps are run in permissive mode (violations are logged only.)

18
Q

What are the 4 main permission types?

A

Normal
Dangerous
Signature
signatureOrSystem

19
Q

How do apps request permissions?

A

Add one or more tags to their AndroidManifest.xml file.

20
Q

When are app permissions checked?

A

At runtime as of Android 6.0

Dangerous permissions must be authorized by the user at runtime?

21
Q

What enforces app permissions and how?

A

The Package Manager

It has the UID and permissions of the app from the kernel.

A service can check if a service caller has been granted a certain permission by querying the Package Manager service.

22
Q

What is an explicit intent?

A

Description of an operation that needs to be performed that fully specifies the target components.

23
Q

What is an implicit intent?

A

Description of an operation that needs to be performed but that lets the system find a matching component.

(System looks and if there’s more than one matching component, the user is presented with a selection dialog)

24
Q

How are permissions enforced for intents?

A

The system checks the intent’s (service caller’s) permissions to see if they match the target component’s declared permissions.

25
Q

How are broadcast permission’s enforced?

A

The permission check is performed when delivering the intent to registered receivers.

Might require two permission checks:

  • one for the broadcast sender (if receiver specified permission.)
  • one for the broadcast receiver (if the sender specified permissions.)

Because broadcasts are asynchronous, no permission check is performed when calling this method.

26
Q

Are broadcasts delivered to all components?

A

No. Only to components that registered as broadcast receivers.

27
Q

What are protected broadcasts?

A

Broadcasts that can only be sent by root and a few system processes.

28
Q

System applications use signature permissions, signed by the _________ key.

A

Platform key

29
Q

Can apps create custom permissions? If so, how?

A

Yes. Applications using the same certificate can use customer permissions. The app that defines the customer permission has to be installed first so the system can enforce it. (Can’t enforce what you don’t know exists.)

30
Q

Does an application have to show everything that is available in it?

A

No. Components can be defined in the AndroidManifest.xml as public or private.